From fd08cc9356762d6b890125c978eaecdfcc281bba Mon Sep 17 00:00:00 2001 From: shijing Date: Wed, 7 Aug 2024 13:29:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E6=97=A0=E8=81=8A=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=97=B6=E6=97=A0=E8=81=8A=E7=B3=BB=E5=88=97=E7=9A=84=E8=8E=B7?= =?UTF-8?q?=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/model/mtm.js | 6 ++++++ src/views/mtm/materials_form.vue | 29 ++++++++++++++++++++--------- 2 files changed, 26 insertions(+), 9 deletions(-) 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/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;