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

bom

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