diff --git a/src/api/model/mtm.js b/src/api/model/mtm.js index fe3ac67f..487664b2 100644 --- a/src/api/model/mtm.js +++ b/src/api/model/mtm.js @@ -147,6 +147,12 @@ export default { ); }, }, + cates: { + name: "产品系列", + req: async function (data) { + return await http.get(`${config.API_URL}/mtm/material/cates/`, data); + }, + }, }, // 工段 mgroup: { diff --git a/src/views/enm_base/testItem.vue b/src/views/enm_base/testItem.vue index 2a8a1358..90951850 100644 --- a/src/views/enm_base/testItem.vue +++ b/src/views/enm_base/testItem.vue @@ -35,13 +35,31 @@ prop="name" min-width="100" > - + + + + + + @@ -25,6 +25,100 @@ > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 添加 + + + + + + + + + + + - - - - - 添加 - - - - - @@ -91,7 +153,9 @@ const defaultForm = { name: "", description: "", sort: 1, - tags: [""], + tags: [], + mcate_tags: [], + choices: [""], }; export default { emits: ["success", "closed"], @@ -114,19 +178,37 @@ export default { }, visible: false, isSaveing: false, - options: [], + options: [ + {value:"input-int",name:"整数"}, + {value:"input-number",name:"小数"}, + {value:"input-text",name:"文本"}, + {value:"select",name:"单选"}, + {value:"selects",name:"多选"}, + ], + tagsOptions: [ + {value:"first",name:"首件检验"}, + {value:"prod",name:"成品检验"}, + {value:"performance",name:"性能检验"}, + ], + mcateTagsOptions: [], processOptions: [], setFiltersVisible: false, }; }, - mounted() {}, + mounted() { + this.getmcateTagsOptions(); + }, methods: { - addComponent() { - this.form.tags.push(""); + getmcateTagsOptions() { + this.$API.mtm.material.cates.req().then((res) => { + this.mcateTagsOptions = res; + }); }, - delComponent(index) { - this.form.tags.splice(index, 1); - console.log("this.form.tags:", this.form.tags); + addComponent(type) { + this.form[type].push(""); + }, + delComponent(index,type) { + this.form[type].splice(index, 1); }, //显示 open(mode = "add") { diff --git a/src/views/mtm/materials_form.vue b/src/views/mtm/materials_form.vue index 84c98889..e376b116 100644 --- a/src/views/mtm/materials_form.vue +++ b/src/views/mtm/materials_form.vue @@ -55,13 +55,17 @@ v-model="form.cate" placeholder="物料系列" clearable + allow-create + filterable + default-first-option + :reserve-keyword="false" style="width: 100%" > @@ -244,12 +248,12 @@ export default { }, visible: false, isSaveing: false, - cateOptions: [ - { id: "bang", name: "棒" }, - { id: "guan", name: "管" }, - { id: "bangguan", name: "棒管" }, - { id: "huiliao", name: "混料" }, - ], + // cateOptions: [ + // { id: "bang", name: "棒" }, + // { id: "guan", name: "管" }, + // { id: "bangguan", name: "棒管" }, + // { id: "huiliao", name: "混料" }, + // ], options: [ { id: 0, name: "电/水/气" }, { id: 10, name: "成品" }, @@ -270,8 +274,15 @@ export default { }, mounted() { this.getProcessOptions(); + this.getMaterialCate(); + }, methods: { + getMaterialCate() { + this.$API.mtm.material.cates.req({ page: 0 }).then((res) => { + this.cateOptions = res; + }); + }, getProcessOptions() { this.$API.mtm.process.list.req({ page: 0 }).then((res) => { this.processOptions = res; diff --git a/src/views/qm/behavior.vue b/src/views/qm/behavior.vue index 59095f63..866669eb 100644 --- a/src/views/qm/behavior.vue +++ b/src/views/qm/behavior.vue @@ -304,7 +304,7 @@ export default { getTextItem() { let that = this; that.$API.qm.getTestItem - .get({ tag: "performance", page: 0 }) + .get({ tags__contains: "performance", page: 0 }) .then((res) => { that.behaviors = res; that.query.testitem = res[0].id; diff --git a/src/views/qm/first_check.vue b/src/views/qm/first_check.vue index 0f785e9f..8257e605 100644 --- a/src/views/qm/first_check.vue +++ b/src/views/qm/first_check.vue @@ -252,7 +252,7 @@ export default { getTextItem() { let that = this; that.$API.qm.getTestItem - .get({ tag: "first", page: 0 }) + .get({ tags__contains: "first", page: 0 }) .then((res) => { console.log(res); let ftestitems = [];