Commit ddc8fde7 authored by 仇晓婷's avatar 仇晓婷

bom

parent 4345952b
......@@ -109,7 +109,7 @@ export default {
downUrl: fileUrlDown,
componaylist: [],
componaylist: [],
data2: [],
data2: [], //主承制单位
selectdata1: [],
rules: {
code: [{ required: true, message: "必填", trigger: "change" }],
......@@ -152,7 +152,7 @@ export default {
getTree() {
var url = `${designUrl}/productlevel/getdepartmentstree`;
service.get(`${url}`).then(response => {
this.data2 = response.result;
this.data2 = response.result; //主承制单位
});
},
getMaterialList() {
......
......@@ -27,7 +27,7 @@
</div>
<TreeGrid :columns="columns" :items="treeData"></TreeGrid>
<Modal v-model="modal" :title="title" width="1200" footer-hide>
<component :is="detail" :eid="curId" @on-close="cancel" @on-ok="ok" />
<component :is="detail" :eid="curId" @on-close="cancel" @on-ok="ok" :parents="parents" />
</Modal>
</div>
</template>
......@@ -76,7 +76,7 @@ export default {
"op",
{
attrs: { oprate: "add" },
on: { click: () => this.add(params.row.id) }
on: { click: () => this.add(params.row) }
},
"新增"
),
......@@ -123,8 +123,10 @@ export default {
this.treeData = r.result;
});
},
add(id) {
this.curId = id;
add(row) {
this.curId = row.id;
this.parents.id = row.levelId;
this.parents.parentName = row.levelTitle;
this.title = "新增";
this.detail = () => import("./bomAdd");
this.modal = true;
......
......@@ -49,7 +49,9 @@ export default {
return {
disabled: false,
entity: {
upId: this.eid
upId: this.eid,
levelId: this.parents.id,
levelTitle: this.parents.parentName
},
dataList: [],
downUrl: fileUrlDown,
......@@ -70,7 +72,12 @@ export default {
};
},
props: {
eid: Number
eid: Number,
parents: {
id: Number,
parentName: String,
ids: String
}
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
......@@ -99,7 +106,7 @@ export default {
if (e.id == val) {
this.entity.name = e.name;
this.entity.mmcode = e.code;
this.entity.drawingNo = e.drawingNo;
this.entity.drawingNo = e.drawingNo;
}
});
},
......@@ -112,7 +119,7 @@ export default {
this.disabled = false;
if (r.success) {
this.$Message.success("保存成功");
this.$emit("on-ok");
this.$emit("on-ok");
} else {
this.$Message.error("保存失败");
}
......
......@@ -44,7 +44,9 @@ export default {
return {
disabled: false,
entity: {
id: this.eid
id: this.eid,
levelId: 0,
levelTitle: ""
},
dataList: [],
downUrl: fileUrlDown,
......
......@@ -96,7 +96,6 @@ export default {
easySearch: {
keys: { op: "mmcode,name,productCode", value: null },
levelId: { op: "In", value: this.id }
// levelTitle: { op: "In", value: this.parentName }
},
modal: false,
title: "新增",
......@@ -293,6 +292,7 @@ export default {
bom(row) {
this.curId = row.id;
this.parent.id = row.levelId;
this.parent.parentName = row.levelTitle;
this.title = "BOM";
this.detail = () => import("./bom");
this.modal = true;
......@@ -318,7 +318,10 @@ export default {
watch: {
"parent.id"(v) {
if (v) {
let data = { levelId: { op: "In", value: this.parent.ids } };
let data = {
levelId: { op: "In", value: this.parent.ids },
upId: { op: "In", value: 0 }
};
this.$refs.grid.reload(data);
}
}
......
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