From 9cb5cd3735f58bd62c3ad0d20b89646801bc05bf Mon Sep 17 00:00:00 2001 From: yangan <yangan0921@163.com> Date: 星期三, 10 一月 2024 17:20:26 +0800 Subject: [PATCH] 验质页面增加单价 --- pages/driver-page/driver-index/bill-of-lading-details/weighDetail/weighDetail.vue | 131 ++++++++++++++++++++++++++++++++++--------- 1 files changed, 103 insertions(+), 28 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 f10a4d5..e1904eb 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 @@ -59,7 +59,7 @@ <view class="label-text"> 鎵f福鍚庡噣閲� </view> - <view class="count">{{ item.weight }}</view> + <view class="count"> {{ cleanWeight(item) }}</view> </view> </view> </view> @@ -227,8 +227,28 @@ {{item.penaltyAmount}} </view> </view> + <!-- 鍗曚环 --> + <view class="notice-num"> + <view class="num-text" + style="margin-left: 10rpx;"> + <u--text text="鍗曚环" + size='32'></u--text> + </view> + <view class="num-input" + v-if='roleType===4&&!flag' + > + <u--input placeholder="璇疯緭鍏ュ崟浠�" + border="bottom" + clearable + v-model="item.unitPrice"></u--input> + </view> + <view class="num-show" + v-else-if="flag"> + {{item.unitPrice}} + </view> + </view> <!--涓嶅悎鏍煎垽瀹氱绫� --> - <!-- <view class="notice-num" v-if="item.penaltyType == '鍏朵粬鎵g綒'" > + <view class="notice-num"> <view class="num-text" style="margin-left: 10rpx;"> <u--text text="涓嶅悎鏍煎垽瀹�" @@ -239,17 +259,17 @@ @click.stop="onFoucus" style="height: 50rpx;" > - <u-radio-group size='32' v-model="item.unqualifiedType"> - <u-radio :label-size="25" :name="1" :label="'闀垮害鎵g綒'" :disabled="disabled">闀垮害鎵g綒</u-radio> + <u-radio-group size='32' v-model="item.penaltyType"> + <u-radio :label-size="25" :name="'1'" :label="'闀垮害鎵g綒'" :disabled="disabled">闀垮害鎵g綒</u-radio> <u-radio :label-size="25" :name="'2'" :label="'鍘氬害鎵g綒'" :disabled="disabled">鍘氬害鎵g綒</u-radio> <u-radio :label-size="25" :name="'3'" :label="'瀵嗛棴鍣�'" :disabled="disabled">瀵嗛棴鍣�</u-radio> </u-radio-group> </view> <view class="num-show" v-else-if="flag"> - <text> {{item.unqualifiedType == 1 ? '闀垮害鎵g綒' : item.unqualifiedType == 2 ? '鍘氬害鎵g綒' :item.unqualifiedType == 3 ? '瀵嗛棴鍣�' : null }} </text> + <text> {{item.penaltyType == 1 ? '闀垮害鎵g綒' : item.penaltyType == 2 ? '鍘氬害鎵g綒' :item.penaltyType == 3 ? '瀵嗛棴鍣�' : null }} </text> </view> - </view> --> + </view> </view> <u-empty v-if=" isYanz() && !isShow(item) " icon-size="200" text="''" > <text>鏆傛湭楠岃川</text> @@ -321,7 +341,7 @@ <view> <view class="notice-num"> <view class="num-text"> - <u--text text="涓嶅悎鏍肩綒娆�" + <u--text text="涓嶅悎鏍奸噸閲�" size='32'></u--text> </view> <view class="num-input" @@ -342,9 +362,26 @@ </view> </view> - <view class="notice-num"> + <!-- <view class="notice-num"> <view class="num-text"> <u--text text="涓嶅悎鏍煎搧鍒ゅ畾" + size='32'></u--text> + </view> + <view class="num-input" + v-if='roleType===4&&!flag'> + <view class="num-show"> + {{selectlist.find(item=>item.value ==el.unqualifiedType ) ? selectlist.find(item=>item.value ==el.unqualifiedType ).name : '' }} + </view> + </view> + <view class="num-show" + v-else-if="flag"> + {{selectlist.find(item=>item.value ==el.unqualifiedType ) ? selectlist.find(item=>item.value ==el.unqualifiedType ).name : '' }} + </view> + + </view> --> + <view class="notice-num"> + <view class="num-text"> + <u--text text="鍗曚环" size='32'></u--text> </view> <view class="num-input" @@ -355,13 +392,13 @@ v-model="el.unqualifiedWeight" readonly @input='v=>unqualifiedWeightInputHandle(v,i,item.clean)'></u--input> --> - <view class="num-show"> - {{selectlist.find(item=>item.value ==el.unqualifiedType ) ? selectlist.find(item=>item.value ==el.unqualifiedType ).name : '' }} + <view class="num-show" +> {{el.penaltyUnitPrice || ''}} </view> </view> <view class="num-show" v-else-if="flag"> - {{selectlist.find(item=>item.value ==el.unqualifiedType ) ? selectlist.find(item=>item.value ==el.unqualifiedType ).name : '' }} + {{el.penaltyUnitPrice || ''}} </view> </view> @@ -669,6 +706,7 @@ let arr = []; let temp = []; let noPin = []; + let noPrice = []; const item = this.globalShowWeigh[index]; console.log(this.globalShowWeigh[index],'index') if(item){ @@ -681,12 +719,15 @@ noPin = item.unqualifiedType.toString().split(','); } + if(item.penaltyUnitPrice){ + noPrice = item.penaltyUnitPrice.toString().split(',') + } // if(item.penaltyType){ // noPin = item.penaltyType.toString().split(','); // } let result = arr.length && arr.map((el,index)=>{ - let obj = {unqualifiedBreed:el,unqualifiedWeight:temp[index],unqualifiedType:noPin[index]} + let obj = {unqualifiedBreed:el,unqualifiedWeight:temp[index],unqualifiedType:noPin[index],penaltyUnitPrice:noPrice[index]} return obj }) console.log(result,temp,'arr') @@ -699,12 +740,27 @@ } + }, + cleanWeight(){ + return function(item){ + console.log(item,'itemsssss') + if(!item.weight){ + return '' + }else if(item.weight && !item.unqualifiedWeight){ + return item.weight + }else if(item.weight && item.unqualifiedWeight){ + return (item.weight - (item.unqualifiedWeight - 0)).toFixed(2) + }else{ + return '' + } + } } + }, onShow(params){ console.log(params,'paramss') - // this.numAll(this.globalShowWeigh[this.indexFlag].unqualifiedWeights.split(","),this.indexFlag,this.showWeigh[this.indexFlag].clean) + this.numAll(this.globalShowWeigh[this.indexFlag].unqualifiedWeights.split(","),this.indexFlag,this.showWeigh[this.indexFlag].clean) }, mounted() { this.roleType === 1 ? this.GetOrderPlan() : this.getTakeCoal(); @@ -851,17 +907,22 @@ }, // 鐐瑰嚮纭 confirmInput() { + let flag = true; let params = {},unqualifiedWeightAll; params.qualityInstructions = this.qualityInstructions; params.remarks = this.remarks; this.showWeigh = this.showWeigh.map((v, i) => { - if(!v.penaltyType) { - v.unqualifiedType = ''; + v.unqualifiedType = ''; + if(!v.unitPrice){ + flag = false; } + + + if(this.globalShowWeigh[i].unqualifiedWeights){ unqualifiedWeightAll = this.globalShowWeigh[i].unqualifiedWeights.split(",").reduce((p,n)=>{return (p - 0) + (n - 0)},0).toFixed(2) || '' }else{ - unqualifiedWeightAll ='' + unqualifiedWeightAll = 0; } return { ...v, @@ -869,14 +930,15 @@ breed: this.globalShowWeigh[i].modifyProductName ? this.globalShowWeigh[i].breed : v.breed, 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 :unqualifiedWeightAll, - penaltyType:this.globalShowWeigh[i].unqualifiedType, - tempArr:this.globalShowWeigh[i].tempArr ? JSON.stringify(this.globalShowWeigh[i].tempArr) : '' + unqualifiedWeights :this.globalShowWeigh[i].unqualifiedWeights ? this.globalShowWeigh[i].unqualifiedWeights : 0, + unqualifiedWeight :unqualifiedWeightAll , + // penaltyType:this.globalShowWeigh[i].unqualifiedType, + tempArr:this.globalShowWeigh[i].tempArr ? JSON.stringify(this.globalShowWeigh[i].tempArr) : '', + penaltyUnitPrice:this.globalShowWeigh[i].penaltyUnitPrice, } }); - console.log(this.globalShowWeigh,this.showWeigh,'this.gloa') + if(flag){ this.loading = true; params.tmTaskCoalItems = this.showWeigh; this.$reqPost('updateTmTaskCoalItem', params, 'json').then( @@ -894,6 +956,11 @@ this.$u.toast(res.msg ? res.msg : '鎿嶄綔澶辫触') } }) + }else{ + this.$u.toast('璇疯緭鍏ュ崟浠�') + return + } + }, // 鏍¢獙鏁版嵁鏄惁鍚堟牸 checkValue(data,target){ @@ -1097,7 +1164,7 @@ } }, deleteItem(i,index){ - let {unqualifiedBreed,unqualifiedWeights,unqualifiedType} = this.globalShowWeigh[i]; + let {unqualifiedBreed,unqualifiedWeights,unqualifiedType,penaltyUnitPrice} = this.globalShowWeigh[i]; this.indexFlag = i; // 璁板綍鏍囪瘑浣� console.log(this.globalShowWeigh[i],'index') if (this.roleType === 4 && !this.flag) { @@ -1120,22 +1187,30 @@ unqualifiedWeights = ''; } - if(unqualifiedType.split(",").length > 1){ - let strArr = unqualifiedType.split(','); + // if(unqualifiedType.split(",").length > 1){ + // let strArr = unqualifiedType.split(','); + // strArr.splice(index ,1) + // unqualifiedType = strArr.join(",") + // }else{ + // unqualifiedType = ''; + // } + if(penaltyUnitPrice.split(",").length > 1){ + let strArr = penaltyUnitPrice.split(','); strArr.splice(index ,1) - unqualifiedType = strArr.join(",") + penaltyUnitPrice = strArr.join(",") }else{ - unqualifiedType = ''; + penaltyUnitPrice = ''; } this.globalShowWeigh[i].unqualifiedBreed = unqualifiedBreed; this.globalShowWeigh[i].unqualifiedWeights = unqualifiedWeights; - this.globalShowWeigh[i].unqualifiedType = unqualifiedType; + // this.globalShowWeigh[i].unqualifiedType = unqualifiedType; + this.globalShowWeigh[i].penaltyUnitPrice = penaltyUnitPrice; this.globalShowWeigh[i].tempArr.splice(index,1) console.log(this.globalShowWeigh[i].unqualifiedBreed,'unqualifiedBreed') this.changeglobalShowWeigh(this.globalShowWeigh) } - // this.numAll(this.globalShowWeigh[this.indexFlag].unqualifiedWeights.split(","),this.indexFlag,this.showWeigh[this.indexFlag].clean) + this.numAll(this.globalShowWeigh[this.indexFlag].unqualifiedWeights.split(","),this.indexFlag,this.showWeigh[this.indexFlag].clean) console.log(this.globalShowWeigh[i],'deleteItem'); } -- Gitblit v1.9.1