Commit f037eae9 authored by renjintao's avatar renjintao

materiel/add/edit

parent 843b8e4c
...@@ -88,11 +88,12 @@ export default { ...@@ -88,11 +88,12 @@ export default {
data: [], data: [],
departId: "", departId: "",
group: [], group: [],
ids: [] ids: [],
bId:this.bomId,
}; };
}, },
created() { created() {
this.materiallist(Number(this.bomId)); this.materiallist();
}, },
async fetch({ store, params }) { async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典 await store.dispatch("loadDictionary"); // 加载数据字典
...@@ -154,7 +155,7 @@ export default { ...@@ -154,7 +155,7 @@ export default {
this.$emit("on-change", entity); this.$emit("on-change", entity);
}, },
// 加载物料 // 加载物料
materiallist(id) { materiallist() {
let url = `${systemUrl}/material/materiallist`; let url = `${systemUrl}/material/materiallist`;
this.$api this.$api
.post(url, { .post(url, {
...@@ -170,20 +171,21 @@ export default { ...@@ -170,20 +171,21 @@ export default {
if (this.theme == "list") { if (this.theme == "list") {
this.departmentGroup(); this.departmentGroup();
} }
if (id != null) { if (this.bId != null) {
let url1 = `${technologyUrl}productinfo/getmaterialids`; let url1 = `${technologyUrl}productinfo/getmaterialids`;
this.$api this.$api
.get(url1, { .get(url1, {
Id: id Id: this.bId
}) })
.then(res => { .then(res => {
if (res.success) { if (res.success) {
this.ids = res.result; this.ids = res.result;
let arr = r.result.filter(u => u.status == 3); let arr = [...this.data].filter(x =>
this.data = [...arr].filter(x =>
[...this.ids].some(y => y === x.id) [...this.ids].some(y => y === x.id)
); );
this.data=arr
} }
}); });
} }
}); });
......
...@@ -54,11 +54,11 @@ ...@@ -54,11 +54,11 @@
</FormItem> </FormItem>
</Col> </Col>
<Col :span="8"> <Col :span="8">
<FormItem :label="l('materialNumber')" prop="materialNumber"> <FormItem :label="l('nameMaterial')" prop="materialNumber">
<Materiel :bomId="productBomId" @on-change="change"></Materiel> <Materiel :bomId="productBomId" v-model="entity.materialId" @on-change="change"></Materiel>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="8"> <Col :span="8" v-if="false">
<FormItem :label="l('nameMaterial')" prop="nameMaterial"> <FormItem :label="l('nameMaterial')" prop="nameMaterial">
<Input v-model="entity.nameMaterial"></Input> <Input v-model="entity.nameMaterial"></Input>
</FormItem> </FormItem>
...@@ -123,9 +123,9 @@ export default { ...@@ -123,9 +123,9 @@ export default {
routingDetailId: null, routingDetailId: null,
routingStepId: 0, routingStepId: 0,
quantity: null, quantity: null,
materialId: null, materialId: "",
materialType: "", materialType: "",
materialNumber: "", materialNumber: null,
nameMaterial: "", nameMaterial: "",
brand: "", brand: "",
specifications: "", specifications: "",
......
...@@ -54,11 +54,11 @@ ...@@ -54,11 +54,11 @@
</FormItem> </FormItem>
</Col> </Col>
<Col :span="8"> <Col :span="8">
<FormItem :label="l('materialNumber')" prop="materialNumber"> <FormItem :label="l('nameMaterial')" prop="materialNumber">
<Materiel :bomId="productBomId"></Materiel> <Materiel v-model="entity.materialId" :bomId="productBomId" @on-change="change"></Materiel>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="8"> <Col :span="8" v-if="false">
<FormItem :label="l('nameMaterial')" prop="nameMaterial"> <FormItem :label="l('nameMaterial')" prop="nameMaterial">
<Input v-model="entity.nameMaterial"></Input> <Input v-model="entity.nameMaterial"></Input>
</FormItem> </FormItem>
...@@ -185,6 +185,11 @@ export default { ...@@ -185,6 +185,11 @@ export default {
this.routingDetailList = tempD; this.routingDetailList = tempD;
}); });
}, },
change(e) {
this.entity.nameMaterial = e.name;
this.entity.materialId = e.materialId;
this.entity.materialNumber = e.mmcode;
},
handleClose() { handleClose() {
this.$emit("on-close"); this.$emit("on-close");
}, },
......
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