Commit 4628245e authored by 仇晓婷's avatar 仇晓婷

bom

parent 8d9738b9
......@@ -241,7 +241,7 @@ export default {
style['text-align'] = column.align
}
if (column.width) {
style['min-width'] = `${column.width}px`
style['width'] = `${column.width}px`
}
return style
},
......
......@@ -59,7 +59,7 @@ export default {
data() {
return {
data1: [],
action: Api.lists,
isactive: 0,
showFrom: true,
showTable: false,
......@@ -90,12 +90,15 @@ export default {
},
{
key: "creationTime",
title: "名称",
title: "时间",
align: "left"
}
]
};
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
mounted() {
this.load(this.eid);
this.initFiled();
......@@ -105,11 +108,12 @@ export default {
Api.get({ id: v }).then(r => {
if (r.result) {
this.entity = r.result;
let rootCategoryId = r.result.rootCategoryId;
let conditions = [
{
conditionalType: "Equal",
fieldName: "categoryId",
fieldValue: this.rootCategoryId
fieldValue: rootCategoryId
}
];
......@@ -165,7 +169,6 @@ export default {
Api.categoryList({ conditions: conditions }).then(r => {
this.data1 = r.result;
});
// this.$refs.grid.reload(this.easySearch);
}
},
l(key) {
......
......@@ -88,7 +88,8 @@ export default {
code: 0,
categoryId: this.nodeInfo.categoryId, //左侧树点击的id
customProperties: {},
rootCategoryId: this.nodeInfo.rootCategoryId //左侧树点击的数据的最顶层id
rootCategoryId: this.nodeInfo.rootCategoryId, //左侧树点击的数据的最顶层id
version: null
},
fileds: [],
checkList: [],
......@@ -145,6 +146,7 @@ export default {
Api.get({ id: this.eid }).then(r => {
if (r.result) {
this.entity = r.result;
this.entity.version = parseInt(r.result.version);
}
});
},
......
......@@ -50,6 +50,7 @@
<FormItem :label="l('type')" prop="type">
<!-- <Input v-model="entity.type"></Input> -->
<Dictionary
disabled
code="material.main.type"
v-model="entity.type"
type="select"
......@@ -96,7 +97,7 @@ export default {
mmcode: "", //物料编号
drawingNo: "",
name: "",
type: "", //物料类型
type: 1, //物料类型
// productCode: "", //产品编号
// status: null,
// remark: "",
......
......@@ -20,6 +20,9 @@ export default {
// return Api.post(`${technologyUrl}productinfo/batchdelete`,params);
// },
list(params){
return Api.post(`${technologyUrl}productinfo/list`,params);
},
getbom(params){
return Api.get(`${technologyUrl}productinfo/getbom`,params);
},
......
......@@ -6,7 +6,10 @@
<Filed :span="8" :name="l('mmcode')+':'">{{entity.mmcode}}</Filed>
<Filed :span="8" :name="l('drawingNo')+':'">{{entity.drawingNo}}</Filed>
<Filed :span="8" :name="l('name')+':'">{{entity.name}}</Filed>
<Filed :span="8" :name="l('madeCompany')+':'">{{entity.madeCompanyTitle}}</Filed>
<Filed :span="8" :name="l('version')+':'">
<State code="material.main.version" :value="parseInt(entity.version)" />
</Filed>
<!-- <Filed :span="8" :name="l('madeCompany')+':'">{{entity.madeCompanyTitle}}</Filed> -->
<Filed :span="8" :name="l('productUrl')+':'">
<a href="#" @click="seeImg(entity.productUrl)">查看图片</a>
</Filed>
......@@ -26,7 +29,14 @@
</Row>
</div>
<TreeGrid :columns="columns" :items="treeData"></TreeGrid>
<Modal v-model="modal" :title="title" width="1200" footer-hide :mask-closable="false">
<Modal
v-model="modal"
:title="title"
width="1200"
footer-hide
:mask-closable="false"
:fullscreen="fullscreen"
>
<component :is="detail" :eid="curId" @on-close="cancel" @on-ok="ok" :parents="parents" />
</Modal>
</div>
......@@ -42,11 +52,13 @@ export default {
title: "新增",
detail: null,
curId: 0,
fullscreen: false,
entity: {
id: "",
levelId: 0,
levelTitle: "",
bomId: 0
bomId: 0,
version: ""
},
parms: {
app: "technology",
......@@ -58,32 +70,58 @@ export default {
columns: [
{
key: "name",
title: this.l("name"),
align: "left",
high: true
},
{
key: "type",
title: this.l("type"),
align: "left",
high: true,
align: "center",
width: 60,
render: (h, params) => {
return h("op", {
props: {
icon: params.row.type == 1 ? "md-git-merge" : "",
type: "icon"
},
on: {
click: () => this.bom(params.row)
}
});
}
},
{
key: "mmcode",
title: this.l("mmcode"),
align: "center",
high: true
high: true,
render: (h, params) => {
return h(
"a",
{
props: {},
on: {
click: () => this.details(params.row)
}
},
params.row.mmcode
);
}
},
{
key: "drawingNo",
title: this.l("drawingNo"),
align: "center",
high: true
},
{
key: "count",
title: this.l("count"),
align: "center",
high: true
},
{
key: "postion",
title: this.l("postion"),
align: "center",
high: true
},
{
......@@ -97,7 +135,8 @@ export default {
{
title: "操作",
key: "id",
align: "left",
width: 150,
align: "center",
render: (h, params) => {
let actions = [
h(
......@@ -150,6 +189,15 @@ export default {
this.init();
},
methods: {
details(row) {
this.fullscreen = true;
this.curId = row.materialId;
// this.rootCategoryId = row.rootCategoryId;
this.title = "详情";
this.detail = () => import("../../../materiel/masterData/details");
this.rowsTable = [];
this.modal = true;
},
init() {
Api.alltree({ id: this.parents.bomId, levelId: this.parents.id }).then(
r => {
......@@ -168,7 +216,7 @@ export default {
this.modal = true;
},
addBom() {
console.log(this.entity);
// console.log(this.entity);
this.curId = this.entity.id;
this.parents.upBomId = this.entity.bomId;
this.parents.id = this.entity.levelId;
......@@ -187,6 +235,17 @@ export default {
this.detail = () => import("./bomEdit");
this.modal = true;
},
bom(row) {
console.log(row);
this.curId = row.bomId;
this.eid = row.id;
this.parents.bomId = row.bomId;
this.parents.id = row.levelId;
this.parents.rootProductId = row.rootProductId;
this.title = "bom";
this.detail = () => import("./bom");
this.modal = true;
},
remove(row) {
Api.deleteBom(row.bomId, row.levelId, row.rootProductId).then(r => {
if (r.success) {
......@@ -198,6 +257,7 @@ export default {
load(v) {
Api.get({ id: v, levelId: this.parents.id }).then(r => {
this.entity = r.result;
this.entity.version = parseInt(r.result.version);
this.parms.eid = r.result.productUrlList;
this.$emit("on-load");
});
......
......@@ -51,8 +51,11 @@ export default {
levelId: this.parents.id,
levelTitle: this.parents.parentName,
rootProductId: this.parents.rootProductId,
upBomId: this.parents.upBomId
upBomId: this.parents.upBomId,
type: 0,
count: 1
},
listData: [],
dataList: [],
downUrl: fileUrlDown,
componaylist: [],
......@@ -85,16 +88,33 @@ export default {
await store.dispatch("loadDictionary"); // 加载数据字典
},
created() {
this.getTree();
this.getList();
},
methods: {
change(e) {
// console.log(e);
this.entity.name = e.name;
this.entity.mmcode = e.mmcode;
this.entity.drawingNo = e.drawingNo;
this.entity.version = parseInt(e.version);
this.entity.materialId = e.materialId;
let code = e.mmcode;
if (code) {
this.listData.forEach(a => {
if (a.mmcode == code) {
this.entity.type = 1;
}
});
}
},
getList() {
let conditions = [];
Api.list({ conditions: conditions }).then(r => {
if (r.success) {
this.listData = r.result;
} else {
this.$Message.error("保存失败");
}
});
},
handleSubmit() {
this.$refs.form.validate(v => {
......
......@@ -3,7 +3,7 @@
<Row>
<Col :span="12">
<FormItem :label="l('materialId')" prop="materialId">
<Materiel v-model="entity.materialId" @on-change="change" :disabled='true'></Materiel>
<Materiel v-model="entity.materialId" @on-change="change" :disabled="true"></Materiel>
</FormItem>
</Col>
<Col :span="12">
......@@ -44,7 +44,9 @@ export default {
entity: {
id: this.eid,
levelId: 0,
levelTitle: ""
levelTitle: "",
type: null,
count: 1
},
dataList: [],
downUrl: fileUrlDown,
......@@ -70,7 +72,7 @@ export default {
id: Number,
parentName: String,
ids: String,
rootProductId:Number,
rootProductId: Number
}
},
async fetch({ store, params }) {
......@@ -83,7 +85,7 @@ export default {
},
methods: {
load(v) {
Api.getbom({ id: v}).then(r => {
Api.getbom({ id: v }).then(r => {
this.entity = r.result;
});
},
......
......@@ -46,6 +46,7 @@
<FormItem :label="l('type')" prop="type">
<!-- <Input v-model="entity.type"></Input> -->
<Dictionary
disabled
code="material.main.type"
v-model="entity.type"
type="select"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment