From ffcbe833cf4a8212aa0325c851c4c5bfec5c9266 Mon Sep 17 00:00:00 2001 From: shijing Date: Thu, 19 Sep 2024 15:46:44 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BA=A4=E6=8E=A5=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98&=E6=A3=80=E9=AA=8C?= =?UTF-8?q?=E6=97=B6=E7=89=A9=E6=96=99=E6=89=B9=E6=AC=A1=E7=9A=84=E6=8E=92?= =?UTF-8?q?=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/qm/products_form.vue | 41 +++++++++++++++++++++++++----- src/views/wpm_gx/handover_form.vue | 8 ++++-- 2 files changed, 40 insertions(+), 9 deletions(-) diff --git a/src/views/qm/products_form.vue b/src/views/qm/products_form.vue index 53942f09..1fd599ac 100644 --- a/src/views/qm/products_form.vue +++ b/src/views/qm/products_form.vue @@ -558,22 +558,49 @@ export default { } this.form.count_ok = this.form.count - this.form.count_notok; }, + compare(name){ + return function(a,b){ + let value1 = a[name]; + let value2 = b[name]; + return value2 - value1 + } + }, //获取物料批次 getMaterialBatch() { let that = this; let obj = {page: 0, count__gte: 0, count_xtest__gte: 0}; if(that.mode == "sizeAdd"||that.mode == "sizeEdit"||that.mode == "sizeShow"){ console.log('sizeAdd') - obj.material__process__name = '一次超洗' + that.$API.system.dept.list.req({name__contains:'尺寸',page:0}).then((res) => { + if(res.length>0){ + obj.belong_dept=res[0].id; + that.getMaterials(obj); + } + }) + // obj.material__process__name = '一次超洗' }else { console.log('facadeAdd') - obj.material__process__name = '二次超洗' + // obj.material__process__name = '二次超洗' + that.$API.system.dept.list.req({name__contains:'外观',page:0}).then((res) => { + if(res.length>0){ + obj.belong_dept=res[0].id; + that.getMaterials(obj); + } + }) } - that.$API.wpm.wmaterial.list - .req(obj) - .then((res) => { - that.options = res; - }); + // that.$API.wpm.wmaterial.list.req(obj).then((res) => { + // res.sort(that.compare("count")); + // console.log('res',res) + // that.options = res; + // }); + }, + getMaterials(obj){ + let that = this; + that.$API.wpm.wmaterial.list.req(obj).then((res) => { + res.sort(that.compare("count")); + console.log('res',res) + that.options = res; + }); }, handleChange(val) { let that = this; diff --git a/src/views/wpm_gx/handover_form.vue b/src/views/wpm_gx/handover_form.vue index 675e0371..73fc51e5 100644 --- a/src/views/wpm_gx/handover_form.vue +++ b/src/views/wpm_gx/handover_form.vue @@ -116,13 +116,14 @@ - + + @@ -153,6 +155,7 @@ controls-position="right" :min="0" step="1" + :disabled="mode==='show'" :step-strictly="true" style="width: 100%" placeholder="交接数量" @@ -160,7 +163,7 @@ - + @@ -483,6 +486,7 @@ export default { //表单注入数据 setData(data) { Object.assign(this.form, data); + console.log('this.form',this.form); if(data.type==30){ this.getUserList3(); }else{