From 29611eb117777efebb245e85e448693a349167a8 Mon Sep 17 00:00:00 2001 From: yangan <yangan0921@163.com> Date: 星期五, 10 十一月 2023 11:17:38 +0800 Subject: [PATCH] 验质增加单位,回显示bug修复 --- pages/driver-page/driver-index/bill-of-lading-details/weighDetail/weighDetail.vue | 407 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 386 insertions(+), 21 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 ce9e833..8535363 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 @@ -1,7 +1,10 @@ <!-- 鏌ョ湅鐨瘺鍑�鏄庣粏 --> <template> + <view class="main"> - <u-empty mode="data" + <u-subsection class="tabs" :fontSize = '30' :list="list" :current="current" @change="tabChange"></u-subsection> + <view v-if="current"> + <u-empty mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png" textSize="30" iconSize="1000" @@ -42,6 +45,7 @@ class="count-input"> <u--input placeholder="璇疯緭鍏ユ墸娓�" border="bottom" + type="number" clearable v-model="item.cinderWeight" @input='v=>discountInputHandle(v,i,item.clean)'></u--input> @@ -54,14 +58,17 @@ <view class="label-text"> 鎵f福鍚庡噣閲� </view> - <view class="count">{{ item.weight }}</view> + <view class="count">{{ item.weight || item.clean}}</view> </view> </view> - <view class="level"> + <!-- 鍒ゆ柇鏄惁妫�楠岃川閲� --> + <view v-if="isShow(item)"> + <view class="level"> <view style="width: 140rpx;"> <u--text text="鐗╄祫鏄庣粏" size='32'></u--text> </view> + <view class="tag-select" @click="goodsPopoverShow(i)" v-if='roleType===4'> @@ -119,18 +126,114 @@ <u--text text="閫氱煡鏁伴噺" size='32'></u--text> </view> - <view class="num-input" + <view class="num-input " v-if='roleType===4&&!flag'> - <u--input placeholder="璇疯緭鍏ラ�氱煡鏁伴噺" + <u-input placeholder="璇疯緭鍏ラ�氱煡鏁伴噺" border="bottom" clearable - v-model="item.num"></u--input> + style="width: 70%;" + v-model="item.num"> + <template slot="suffix"> + <text class="inp-unit">{{ item.numUnit}}</text> + </template> + </u-input> </view> <view class="num-show" v-else-if="flag"> - {{item.num}} + {{item.num + item.numUnit}} </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 + style="width: 70%;" + v-model="item.weight1"> + <template slot="suffix"> + <text class="inp-unit">{{ item.weightUnit }}</text> + </template> + </u-input> + </view> + <view class="num-show" + v-else-if="flag"> + {{item.weight1 + item.weightUnit }} + </view> + </view> + <!-- 鏂板鎵g綒绉嶇被銆� 鎵g綒閲戦锛屼笉鍚堟牸鍒ゅ畾绉嶇被--> + <view class="notice-num"> + <view class="num-text" + style="margin-left: 10rpx;"> + <u--text text="鎵g綒绉嶇被" + size='32'></u--text> + </view> + <view class="num-radio" + v-if='roleType===4&&!flag' + > + <u-radio-group size='34' v-model="item.penaltyType"> + <u-radio :label-size="32" :name="'0'" :label="'鏃犳墸缃�'" :disabled="disabled">鏃犳墸缃�</u-radio> + <u-radio :label-size="32" :name="'鍏朵粬鎵g綒'" :label="'鍏朵粬鎵g綒'" :disabled="disabled">鍏朵粬鎵g綒</u-radio> + </u-radio-group> + </view> + <view class="num-show" + v-else-if="flag"> + {{item.penaltyType}} + </view> + </view> + <!-- 鎵g綒閲戦 --> + <view class="notice-num" v-if="item.penaltyType == '鍏朵粬鎵g綒'"> + <view class="num-text" + style="margin-left: 10rpx;"> + <u--text text="鎵g綒閲戦" + size='32'></u--text> + </view> + <view class="num-input" + v-if='roleType===4&&!flag' + > + <u--input placeholder="璇疯緭鍏ユ墸缃氶噾棰�" + border="bottom" + clearable + v-model="item.penaltyAmount"></u--input> + </view> + <view class="num-show" + v-else-if="flag"> + {{item.penaltyAmount}} + </view> + </view> + <!--涓嶅悎鏍煎垽瀹氱绫� --> + <view class="notice-num" v-if="item.penaltyType == '鍏朵粬鎵g綒'" > + <view class="num-text" + style="margin-left: 10rpx;"> + <u--text text="涓嶅悎鏍煎垽瀹�" + size='32'></u--text> + </view> + <view class="num-radio" + v-if='roleType===4&&!flag' + @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 :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> + </view> + </view> + </view> + <u-empty v-else icon-size="200" text="''" > + <text>鏆傛湭楠岃川</text> + </u-empty> <view style="display: flex;margin-top: 20rpx;margin-left: 20rpx;" v-if="item.isImage"> <view style="width: 100px;" @@ -185,6 +288,46 @@ @select="selectUnqualifiedClick"></u-action-sheet> </view> </view> + <!-- 鏂板 楠岃川澶囨敞銆傞獙璐ㄨ鏄� --> + <view style="padding: 10rpx;"> + <u-row > + <u-col span="24" > + <view class="demo-layout bg-purple-light" style="display: flex;"> + <text style="font-size: 32rpx;">楠岃川璇存槑锛�</text> + <view style="display: inline-block;" + v-if='roleType===4&&!flag' + > + <u--input placeholder="璇疯緭鍏ラ獙璐ㄨ鏄�" + border="bottom" + clearable + v-model="qualityInstructions"></u--input> + </view> + <view class="num-show" + v-else-if="flag"> + {{ qualityInstructions }} + </view> + </view> + </u-col> + </u-row> + </view> + <view style="padding: 10rpx;"> + <u-row > + <u-col span="24"> + <view class="demo-layout bg-purple-light" > + <text style="font-size: 32rpx;">楠岃川澶囨敞锛�</text> + <view style="width: 50%;" + v-if='roleType===4&&!flag' + > + <u-textarea border="surround" v-model="remarks" ref="textarea" placeholder="璇疯緭鍏ラ獙璐ㄥ娉�"></u-textarea> + </view> + <view class="num-show" + v-else-if="flag"> + {{ remarks }} + </view> + </view> + </u-col> + </u-row> + </view> <view class="confirm-button" v-if='roleType===4&&!flag'> <u-button type="primary" @@ -193,11 +336,101 @@ @click="confirmInput" :loading="loading" loading-text="纭"></u-button> + </view></view> + <!-- 鐗╂枡鏄庣粏 --> + <view v-if="!current"> + <view class="main-block" + v-for="(item,i) in goodsList" + :key="item.id"> + <view class="level"> + <view style="width: 140rpx;"> + <u--text text="鐗╄祫鍚嶇О" + size='32'></u--text> + </view> + <view class="tag-select" + > + <text class="num-text"> + {{item.breed}} + </text> + </view> + </view> + <view class="level"> + <view style="width: 180rpx;"> + <u--text text="鏄庣粏缂栧彿" + size='32'></u--text> + </view> + <view class="tag-select"> + <text> + {{item.itemId}} + </text> + </view> + </view> + <view class="level"> + <view style="width: 180rpx;"> + <u--text text="閫氱煡鏁伴噺" + size='32'></u--text> + </view> + <view class="tag-select"> + <text> + {{item.num}} + </text> + </view> + </view> + <view class="level"> + <view style="width: 180rpx;"> + <u--text text="瑙勬牸" + size='32'></u--text> + </view> + <view class="tag-select"> + <text> + {{item.spec}} + </text> + </view> + </view> + <view class="level"> + <view style="width: 180rpx;"> + <u--text text="閫氱煡閲嶉噺" + size='32'></u--text> + </view> + <view class="tag-select"> + <text> + {{item.weight}} + </text> + </view> + </view> + <!-- 鐗╄祫鏄庣粏 --> + <u-action-sheet :actions="goodsList" + :show="goodsShow" + cancelText='鍙栨秷' + :closeOnClickOverlay='true' + @close='goodsNameClose' + @select="goodsselectClick"></u-action-sheet> + <!-- 鍝佸悕涓庤鏍� --> + <view class=""> + <u-action-sheet :actions="actionsList" + :show="actionShow" + cancelText='鍙栨秷' + :closeOnClickOverlay='true' + @close='productNameClose' + @select="selectClick"></u-action-sheet> + </view> + <!-- 涓嶅悎鏍煎搧鍚� --> + <view class=""> + <u-action-sheet :actions="actionsList" + :show="unqualifiedShow" + cancelText='鍙栨秷' + :closeOnClickOverlay='true' + @close='unqualifiedClose' + @select="selectUnqualifiedClick"></u-action-sheet> + </view> </view> + </view> + </view> </template> <script> + import BigNumber from "bignumber.js" import { BaseUrl } from '@/api/publicInterface.js'; import { onlineurl } from '@/api/request.js' @@ -205,9 +438,45 @@ export default { data() { return { + qualityInstructions:"", + remarks:'', + selectlist:[ + { + value: '1', + name:'闀垮害鎵g綒', + fontSize:'40' + }, + { + value: '2', + name:'鍘氬害鎵g綒', + fontSize:'40' + + }, + { + value: '3', + name:'瀵嗛棴鍣�', + fontSize:'40' + } + ], orderPlanId: "", + title: '绱犺儦鍕惧嫆鍑洪潚鑺憋紝绗旈攱娴撹浆娣�', + isWeighingType:'', + subTitle: '2020-05-15', + thumb: 'http://pic2.sc.chinaz.com/Files/pic/pic9/202002/hpic2119_s.jpg', coalDetailsData: {}, + list: [ + { + name: '鐗╄祫鏄庣粏' + }, + { + name: '绉伴噸鏄庣粏' + }, + ], + current: 1, showWeigh: [], + + cityPickerValueDefault: [0, 0, 1], + form:{}, showWeighCopy: [], discountrate: "", loading: false, @@ -253,16 +522,27 @@ }, showWeighCopyStorgeOther() { return uni.getStorageSync('showWeighCopyStorgeOther') + }, + isShow(){ + //鏄惁鏄剧ず 鏄惁宸查獙璐� + return function(item){ + return uni.getStorageSync('roleType')!== 4 && item.iszj == 1 ? true : uni.getStorageSync('roleType')== 4 ? true : false; + // 宸茬粡楠岃川 + } } }, + mounted() { + this.roleType === 1 ? this.GetOrderPlan() : this.getTakeCoal() + }, onLoad(params) { + console.log(params,this.showWeighCopyStorge,'params璺敱') this.orderPlanId = params.orderPlanId ? params.orderPlanId : ''; this.flag = params.flag ? params.flag : false; - this.roleType === 1 ? this.GetOrderPlan() : this.getTakeCoal() this.ModifiedOrderIndex = params.index this.alterProductName = params.productName === "true" || false this.alterUnqualified = params.unqualified === "true" || false - this.havedSubmit = params.havedSubmit === "true" || false + this.havedSubmit = params.havedSubmit === "true" || false; + console.log(this.havedSubmit,'this.havedSubmit') }, methods: { ...mapMutations(['changeglobalShowWeigh']), @@ -274,10 +554,13 @@ if (res.code == 0) { uni.hideLoading() this.coalDetailsData = res.data; + this.remarks = res.data.remarks; + this.qualityInstructions = res.data.qualityInstructions this.orderCode = res.data.orderCode this.showWeigh = this.coalDetailsData.tmTaskCoalItems ? this.coalDetailsData .tmTaskCoalItems : []; this.showWeigh = this.showWeigh.map(v => { + if(!v.penaltyType) v.penaltyType = '0' return { ...v, modifyProductName: '', @@ -294,6 +577,11 @@ } else { this.changeglobalShowWeigh(uni.getStorageSync('showWeighCopyStorge')) } + //绉伴噸鏄庣粏鏃犳暟鎹椂鏄剧ず鐗╄祫鏄庣粏 + if(!this.coalDetailsData.tmTaskCoalItems.length){ + this.current = 0; + } + this.isWeighingType = res.data.weighingType //褰撳墠纾呭崟鏄惁鍥炵 } else { this.$u.toast('鍔犺浇澶辫触') uni.hideLoading() @@ -339,8 +627,15 @@ }, // 鐐瑰嚮纭 confirmInput() { - this.loading = true + this.loading = true; + let params = {}; + params.qualityInstructions = this.qualityInstructions; + params.remarks = this.remarks; this.showWeigh = this.showWeigh.map((v, i) => { + if(!v.penaltyType) { + v.penaltyAmount = ''; + v.unqualifiedType = ''; + } return { ...v, unqualifiedBreed: this.globalShowWeigh[i].unqualifiedBreed ? this.globalShowWeigh[i] @@ -351,7 +646,8 @@ } }) - this.$reqPost('updateTmTaskCoalItem', this.showWeigh, 'json').then( + params.tmTaskCoalItems = this.showWeigh; + this.$reqPost('updateTmTaskCoalItem', params, 'json').then( res => { if (res.code == 0) { this.loading = false @@ -366,6 +662,20 @@ this.$u.toast(res.msg ? res.msg : '鎿嶄綔澶辫触') } }) + }, + // 鏍¢獙鏁版嵁鏄惁鍚堟牸 + checkValue(data,target){ + if(!data.length){ + return + } + let flag = data.find(item=>item[target] <=0); + console.log(flag,'flag'); + if(flag){ + return false + }else{ + return true; + } + }, // 鐗╄祫鏄庣粏 goodsPopoverShow(index) { @@ -387,6 +697,7 @@ this.showWeigh[this.goodsIndex].breed = val.breed this.showWeigh[this.goodsIndex].spec = val.spec this.showWeigh[this.goodsIndex].weightUnit = val.weightUnit + this.showWeigh[this.goodsIndex].weight1 = val.weight; }, // 鍝佸悕涓庤鏍� productNamePopoverShow(index) { @@ -408,12 +719,20 @@ }, // 鎶樻墸鐜囪緭鍏� discountInputHandle(value, index, clean) { - this.showWeigh[index].cinderWeight = Number(value) - if (clean) { - let x = new BigNumber(clean) - let y = new BigNumber(value) - this.showWeigh[index].weight = x.minus(y).toFixed(2) - } + console.log('璁$畻鍑�閲�',value, index, clean) + this.showWeigh[index].cinderWeight = (value - 0) + let x = new BigNumber(clean - 0) + let y = new BigNumber(value - 0) + let z = new BigNumber(this.showWeigh[index].unqualifiedWeight - 0) + console.log(clean,value,this.showWeigh[index].unqualifiedWeight - 0,'鎵f福'); + if(x.minus(y).minus(z).toFixed(2) <= 0){ + this.showWeigh[index].weight = '0'; + this.$u.toast('褰撳墠鍑�閲嶄笉鍚堟牸锛岃妫�鏌ョ毊閲嶏紝姣涢噸鏄惁鍑嗙‘') + }else{ + this.showWeigh[index].weight = x.minus(y).minus(z).toFixed(2) + } + + }, // 閫夋嫨涓嶅悎鏍煎搧鍚� selectunqualifiedBreed(index) { @@ -433,10 +752,18 @@ }, // 涓嶅悎鏍奸噸閲忚緭鍏� unqualifiedWeightInputHandle(value, index, clean) { - let x = new BigNumber(clean) - let y = new BigNumber(value) - let z = new BigNumber(this.showWeigh[index].cinderWeight) - this.showWeigh[index].weight = x.minus(y).minus(z).toFixed(2) || '' + // 鍒ゆ柇鏄笉鏄湁鍑�閲嶆墠杩涜璁$畻 + let x = new BigNumber(clean - 0) + let y = new BigNumber(value - 0) + let z = new BigNumber(this.showWeigh[index].cinderWeight - 0); + if(x.minus(y).minus(z).toFixed(2) <= 0){ + this.showWeigh[index].weight = '0'; + this.$u.toast('褰撳墠鍑�閲嶄笉鍚堟牸锛岃妫�鏌ョ毊閲嶏紝姣涢噸鏄惁鍑嗙‘') + }else{ + this.showWeigh[index].weight = x.minus(y).minus(z).toFixed(2) ; + } + + }, // 鍒犻櫎鍥剧墖 deletePic(event) { @@ -482,6 +809,18 @@ }); }); }, + //鐐瑰嚮tab 鍒囨崲灞曠ず鏄庣粏 + tabChange(val){ + this.current = val; + }, + //涓嬫媺妗嗚仛鐒︽椂闂� + onFoucus(val){ + this.focusSelect = true; + + }, + closeEvent(){ + this.focusSelect = false; + } }, } </script> @@ -594,6 +933,11 @@ .num-input { width: 60%; border-bottom: 1px solid rgb(218, 219, 222); + position: relative; + } + .num-radio{ + width: 60%; + font-size: 100rpx; } .num-show { @@ -657,4 +1001,25 @@ margin-bottom: 40rpx; } } + .tabs{ + font-size: 20rpx!important; + } + .u-card-wrap { + background-color: $u-bg-color; + padding: 1px; + } + + .u-body-item { + font-size: 32rpx; + color: #333; + padding: 20rpx 10rpx; + } + + .u-body-item image { + width: 120rpx; + flex: 0 0 120rpx; + height: 120rpx; + border-radius: 8rpx; + margin-left: 12rpx; + } </style> \ No newline at end of file -- Gitblit v1.9.1