From f8efcc177dcde3bbeec6a64bf2597a871e2ca64a Mon Sep 17 00:00:00 2001 From: yangan <yangan0921@163.com> Date: 星期四, 14 十二月 2023 14:27:58 +0800 Subject: [PATCH] 验质扣渣重量,不合格品类修改 --- pages/driver-page/driver-index/bill-of-lading-details/weighDetail/weighDetail.vue | 38 ++++++++++++++++++++++++++++++++------ 1 files changed, 32 insertions(+), 6 deletions(-) diff --git a/pages/driver-page/driver-index/bill-of-lading-details/weighDetail/weighDetail.vue b/pages/driver-page/driver-index/bill-of-lading-details/weighDetail/weighDetail.vue index a555225..768d7fe 100644 --- a/pages/driver-page/driver-index/bill-of-lading-details/weighDetail/weighDetail.vue +++ b/pages/driver-page/driver-index/bill-of-lading-details/weighDetail/weighDetail.vue @@ -46,7 +46,7 @@ class="count-input"> <u--input placeholder="璇疯緭鍏ユ墸娓�" border="bottom" - type="number" + type="digit" clearable v-model="item.cinderWeight" @input='v=>discountInputHandle(v,i,item.clean)'></u--input> @@ -280,7 +280,7 @@ :height="0" > <u-cell - :title="(index + 1) + '.' + '涓嶅悎鏍艰鏍�'" + :title="(index + 1) + '.' + '涓嶅悎鏍煎搧绫�'" style="text-indent: 30RPX;" @click="editItem(i,index)" > @@ -329,7 +329,7 @@ </u--list> <!-- 澧炲姞涓嶅悎鏍艰鐭� --> - <button class="addBtn" type="primary" :plain="false" @click="addUnqualified(i)">娣诲姞涓嶅悎鏍艰鐭�</button> + <button class="addBtn" type="primary" :plain="false" @click="addUnqualified(i)">娣诲姞涓嶅悎鏍煎搧绫�</button> <!-- 鐗╄祫鏄庣粏 --> <u-action-sheet :actions="goodsList" :show="goodsShow" @@ -778,13 +778,18 @@ // 鐐瑰嚮纭 confirmInput() { this.loading = true; - let params = {}; + let params = {},unqualifiedWeightAll; params.qualityInstructions = this.qualityInstructions; params.remarks = this.remarks; this.showWeigh = this.showWeigh.map((v, i) => { if(!v.penaltyType) { v.penaltyAmount = ''; v.unqualifiedType = ''; + } + if(this.globalShowWeigh[i].unqualifiedWeight){ + unqualifiedWeightAll = this.globalShowWeigh[i].unqualifiedWeight.split(",").reduce((p,n)=>{return (p - 0) + (n - 0)},0) || '' + }else{ + unqualifiedWeightAll ='' } return { ...v, @@ -794,7 +799,7 @@ spec: this.globalShowWeigh[i].modifyProductName ? this.globalShowWeigh[i].spec : v.spec, inspectionJpg: v.fileList.map(v => v.url.replace(BaseUrl, '')).join(','), unqualifiedWeights :this.globalShowWeigh[i].unqualifiedWeights, - unqualifiedWeight :this.globalShowWeigh[i].unqualifiedWeight.split(",").reduce((p,n)=>{return (p - 0) + (n - 0)},0) + unqualifiedWeight :unqualifiedWeightAll } }) @@ -871,12 +876,33 @@ }, // 鎶樻墸鐜囪緭鍏� discountInputHandle(value, index, clean) { + let znums; + if(this.globalShowWeigh[index].unqualifiedWeights){ + znums = this.globalShowWeigh[index].unqualifiedWeights.split(',') + }else{ + znums = [] + } console.log('璁$畻鍑�閲�',value, index, clean) this.indexFlag = index; // 璁板綍鏍囪瘑浣� + if ( + value && + value.indexOf(".") < 0 && + value != "" + ) { + value = parseFloat(value); + value = value + ""; // 鍙樺洖涓哄瓧绗︿覆 + }else{ + value = value.replace(/^(-)*(\d+)\.(\d\d).*$/,"$1$2.$3"); + this.$nextTick(()=>{ + this.showWeigh[index].cinderWeight = value.replace(/[^\d.]/g, ""); + }); + } // 濡傛灉娌℃湁灏忔暟鐐癸紝棣栦綅涓嶈兘涓虹被浼间簬 01銆�02鐨勫�� + + this.showWeigh[index].cinderWeight = (value - 0) let x = new BigNumber(clean - 0) let y = new BigNumber(value - 0) - let z = new BigNumber(this.globalShowWeigh[index].unqualifiedWeights.split(',').reduce((p,n)=>{ + let z = new BigNumber(znums.reduce((p,n)=>{ return (p - 0) + (n - 0) },0)) console.log(clean,value,'鎵f福'); -- Gitblit v1.9.1