From e30f3645f87de88b4f96ae0b6ec82d41ea119878 Mon Sep 17 00:00:00 2001 From: shijing Date: Wed, 14 May 2025 17:10:02 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=85=89=E8=8A=AFfmlog=E5=B1=82=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E7=BC=BA=E9=99=B7=E9=A1=B9=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/model/qm.js | 6 +++++ src/views/wpm_gx/f_mlogs_form.vue | 38 ++++++++++++++++++++----------- 2 files changed, 31 insertions(+), 13 deletions(-) diff --git a/src/api/model/qm.js b/src/api/model/qm.js index d408013a..bcdacbe0 100644 --- a/src/api/model/qm.js +++ b/src/api/model/qm.js @@ -147,6 +147,12 @@ export default { return await http.delete(`${config.API_URL}/qm/qct/${id}/`); }, }, + getQct: { + name: "获取检验模板", + req: async function (data) { + return await http.post(`${config.API_URL}/qm/qct/get_qct/`, data); + }, + }, }, //检验表检测缺陷项 qctdefect:{ diff --git a/src/views/wpm_gx/f_mlogs_form.vue b/src/views/wpm_gx/f_mlogs_form.vue index d05f77dd..9c81bd1e 100644 --- a/src/views/wpm_gx/f_mlogs_form.vue +++ b/src/views/wpm_gx/f_mlogs_form.vue @@ -262,7 +262,7 @@ 加工前不良 - + { - if(res.length>0){ - that.qct = res[0].id; - that.$API.qm.qct.item.req(res[0].id).then((res) => { - res.qct_defects.forEach((item) => { - that.defectform[item.defect_name] = 0; - that.defectinform[item.defect_name] = 0; - }) - that.qct_defects=res.qct_defects; - }) - } + // material_in + that.$API.qm.qct.getQct.req({material: that.material_in,tag:'process'}).then((res) => { + res.qct_defects.forEach((item) => { + that.defectinform[item.defect_name] = 0; + }) + that.qct_indefects=res.qct_defects; }) + //material_out + that.$API.qm.qct.getQct.req({material: that.material_out,tag:'process'}).then((res) => { + res.qct_defects.forEach((item) => { + that.defectform[item.defect_name] = 0; + }) + that.qct_defects=res.qct_defects; + }) + // if(that.mlogbItem.qct!==null){ + // that.$API.qm.qct.item.req(that.mlogbItem.qct).then((res) => { + // res.qct_defects.forEach((item) => { + // that.defectform[item.defect_name] = that.defectform[item.defect_name]?that.defectform[item.defect_name]:0; + // }) + // that.max_defect_rate =Number(res.max_defect_rate); + // that.qct_defects=res.qct_defects; + // }) + // } }, getEquipment() { let that = this; @@ -588,7 +600,7 @@ export default { countinChange(){ let that = this; that.form.count_pn_jgqbl = 0; - that.qct_defects.forEach(item => { + that.qct_indefects.forEach(item => { that.form.count_pn_jgqbl += that.defectinform[item.defect_name]; }) that.form.count_real = that.form.count_use - that.form.count_pn_jgqbl;