Commit f037eae9 authored by renjintao's avatar renjintao

materiel/add/edit

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