Commit 14cfad59 authored by 仇晓婷's avatar 仇晓婷

封装物料控件

parent 8270e90f
......@@ -17,9 +17,7 @@
<Col :span="12">
<FormItem :label="l('materialId')" prop="materialId">
<!-- <Input v-model="entity.mmcode"></Input> -->
<Select v-model="entity.materialId" filterable clearable @on-change="change">
<Option v-for="item in dataList" :value="item.id" :key="item.id">{{ item.code }}</Option>
</Select>
<Materiel v-model="entity.materialId" @on-change="change"></Materiel>
</FormItem>
</Col>
<!-- <Col :span="12">
......@@ -123,17 +121,13 @@ export default {
v: Object,
eid: Number,
parents: {
type: Object,
default: () => {
return {
id: -1,
parentName: ""
};
}
id: Number,
parentName: String,
ids: String
}
},
created() {
this.getMaterialList();
// this.getMaterialList();
},
mounted() {
this.treeCompany();
......@@ -145,23 +139,13 @@ export default {
await store.dispatch("loadDictionary"); // 加载数据字典
},
methods: {
change(val) {
this.dataList.forEach(e => {
if (e.id == val) {
this.entity.name = e.name;
this.entity.mmcode = e.code;
this.entity.drawingNo = e.drawingNo;
this.entity.version = e.version;
}
});
},
getMaterialList() {
let data = {
conditions: []
};
Api.materiallist(data).then(r => {
this.dataList = r.result.filter(item => item.status == 3);
});
change(e) {
// console.log(e);
this.entity.name = e.name;
this.entity.mmcode = e.mmcode;
this.entity.drawingNo = e.drawingNo;
this.entity.version = e.version;
this.entity.materialId = e.materialId;
},
clickData(data, liUrl) {
this.img = liUrl;
......@@ -189,7 +173,7 @@ export default {
});
},
load(v) {
Api.get({ id: v }).then(r => {
Api.get({ id: v, levelId: this.parents.id }).then(r => {
if (r.result.productUrlList && r.result.productUrlList != "") {
this.parms.eid = r.result.productUrlList;
} else {
......@@ -202,7 +186,7 @@ export default {
this.$refs.edit.dep = r.result.levelId;
this.$refs.edit.label = r.result.levelTitle;
this.entity.materialId = r.result.materialId;
this.entity.levelId = r.result.levelId+'';
this.entity.levelId = r.result.levelId + "";
});
},
handleSubmit() {
......
......@@ -49,7 +49,7 @@
<a @click="bom(row)">
<Icon type="md-git-merge" />BOM
</a>&nbsp;
<a @click="edit(row.id)">
<a @click="edit(row)">
<Icon type="md-create" />编辑
</a>&nbsp;
<a @click="remove(row.id)">
......@@ -189,7 +189,7 @@ export default {
{
attrs: { oprate: "edit" },
on: {
click: () => this.edit(params.row.id)
click: () => this.edit(params.row)
}
},
"编辑"
......@@ -279,14 +279,16 @@ export default {
// console.log(row)
this.curId = row.id;
this.parent.id = row.levelId;
this.parent.parentName = row.levelTitle;
this.parent.parentName = row.levelTitle;
this.title = "详情";
this.detail = () => import("./detail");
this.modal = true;
this.fullscreen = false;
},
edit(id) {
this.curId = id;
edit(row) {
this.curId = row.id;
this.parent.id = row.levelId;
this.parent.parentName = row.levelTitle;
this.title = "编辑";
this.detail = () => import("./edit");
this.modal = true;
......
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