From 79f5c0a7d45842996ef5cfbc33a64a7bfd9bcbd9 Mon Sep 17 00:00:00 2001 From: wk Date: 星期四, 10 十月 2024 17:04:37 +0800 Subject: [PATCH] feat:临时入场 --- pages/driver-page/delivery-my/delivery-my/delivery-my.vue | 204 ++++++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 194 insertions(+), 10 deletions(-) diff --git a/pages/driver-page/delivery-my/delivery-my/delivery-my.vue b/pages/driver-page/delivery-my/delivery-my/delivery-my.vue index 1b9b35b..66be58e 100644 --- a/pages/driver-page/delivery-my/delivery-my/delivery-my.vue +++ b/pages/driver-page/delivery-my/delivery-my/delivery-my.vue @@ -67,13 +67,14 @@ required v-if="daydata.isWeighing==1"> <u--input v-model="clean" border="surround" + disabled placeholder="璇疯緭鍏ュ噣閲�" clearable></u--input> </u-form-item> <uni-table border id="table-box" - emptyText="鏆傛棤鏇村鏁版嵁" v-if="daydata.isWeighing==0"> + emptyText="鏆傛棤鏇村鏁版嵁" v-if="daydata.isWeighing == 0 && daydata.productNames.split(',').length <= 1"> <uni-tr> <uni-th align="center" >浜у搧</uni-th> <uni-th align="center">鏁伴噺</uni-th> @@ -93,7 +94,7 @@ </uni-table> <u-form-item prop='contactPicture'> <view class="label-text"> - <text style="color: #f56c6c;">*</text>鍘熷彂鍗曟嵁 + 鍘熷彂鍗曟嵁 </view> <u-upload :fileList="fileList1" @afterRead="afterRead" @@ -198,6 +199,14 @@ </uni-tr> </uni-table> </view> + <view class="logoutModel"> + <u-modal :show="logoutShow" + :title="logoutTitle" + showCancelButton + :content="logoutContent" + @confirm="logoutConfirm" + @cancel="logoutCancel"></u-modal> + </view> </view> </template> @@ -205,6 +214,7 @@ import { apiRegister } from '@/api/publicInterface.js'; import { mapMutations } from 'vuex'; import { BaseUrl } from '@/api/publicInterface.js'; + import BigNumber from "bignumber.js" export default { // 鐩戝惉椤甸潰鍒濇娓叉煋瀹屾垚銆傛敞鎰忓鏋滄覆鏌撻�熷害蹇紝浼氬湪椤甸潰杩涘叆鍔ㄧ敾瀹屾垚鍓嶈Е鍙� onReady() { @@ -223,9 +233,21 @@ Object.assign(that.registerFormModel, res.data) } }); + uni.getStorage({ + key: 'isshow', + success: function (res) { + that.isshow=res.data + } + }); + this.ids=null }, data() { return { + ids:null, + logoutShow: false, + logoutTitle: '鎻愮ず', + logoutContent: '鍏ュ満闇�瑕佹壂鎻忚溅鐗岀収鍜屽埛韬唤璇佸叆鍦猴紝璇锋惡甯﹁韩浠借瘉鍘熶欢', + isshow:true, scrollTop: 0, id:"", value: 0, @@ -244,7 +266,6 @@ }, skin:"", hair:"", - clean:"", TableData:[], radiolist1: [{ name: '鍚�', @@ -298,6 +319,13 @@ trigger: ['change', 'blur'] } ], + idNumber: [{ + type: 'string', + required: true, + message: '璇疯緭鍏ヨ韩浠借瘉鍙�', + trigger: ['blur', 'change'] + } + ], // carNo: [{ // type: 'string', // required: true, @@ -317,6 +345,27 @@ // ], }, }; + }, + computed:{ + clean() { + if(this.daydata.isWeighing==1){ + let xx = BigNumber(this.hair ? this.hair : 0) + let yy = BigNumber(this.skin ? this.skin : 0) + return xx.minus(yy).toNumber() > 0 ? xx.minus(yy).toNumber().toFixed(2) : 0 + }else{ + //鏁伴噺 + if(!this.tmTaskCoalList.length){ + return false + }else{ + const reslut = this.tmTaskCoalList.find(item=>!item.productQuantity); + if(reslut){ + return false + }else{ + return true + } + } + } + } }, methods: { ...mapMutations(['changeisUploadimg']), @@ -385,7 +434,7 @@ }); }); }, - yuYueBtnClick(item){ + logoutConfirm() { this.$refs.regesterFormRef.validate().then(res => { if(this.daydata.orderType=='澶栬喘'){ if(this.daydata.isWeighing==1){ @@ -398,7 +447,7 @@ orderTye:this.daydata.orderType, sendDate:this.daydata.sendDate, carNumSurplus:this.daydata.carNumSurplus, - yyId:item.id, + yyId:this.ids.id, ...this.registerFormModel, tmTaskCoalContact:{ coalName:this.daydata.productName, @@ -412,9 +461,15 @@ key: 'myDelivery', data: this.registerFormModel, }); + uni.setStorage({ + key: 'isshow', + data: false, + }); + this.logoutShow=false + this.isshow=false if (res.code === 0) { uni.$u.toast('棰勭害鎴愬姛') - this.GetMyDelivery() + this.GetMyDeliverys() } else { uni.$u.toast(res.msg ? res.msg : '棰勭害澶辫触') } @@ -432,7 +487,7 @@ orderTye:this.daydata.orderType, sendDate:this.daydata.sendDate, carNumSurplus:this.daydata.carNumSurplus, - yyId:item.id, + yyId:this.ids.id, ...this.registerFormModel, tmTaskCoalContact:{ contactPicture:this.contactPicture, @@ -443,9 +498,15 @@ key: 'myDelivery', data: this.registerFormModel, }); + uni.setStorage({ + key: 'isshow', + data: false, + }); + this.logoutShow=false + this.isshow=false if (res.code === 0) { uni.$u.toast('棰勭害鎴愬姛') - this.GetMyDelivery() + this.GetMyDeliverys() } else { uni.$u.toast(res.msg ? res.msg : '棰勭害澶辫触') } @@ -462,16 +523,22 @@ orderTye:this.daydata.orderType, sendDate:this.daydata.sendDate, carNumSurplus:this.daydata.carNumSurplus, - yyId:item.id, + yyId:this.ids.id, ...this.registerFormModel }, 'json').then(res => { uni.setStorage({ key: 'myDelivery', data: this.registerFormModel, }); + uni.setStorage({ + key: 'isshow', + data: false, + }); + this.logoutShow=false + this.isshow=false if (res.code === 0) { uni.$u.toast('棰勭害鎴愬姛') - this.GetMyDelivery() + this.GetMyDeliverys() } else { uni.$u.toast(res.msg ? res.msg : '棰勭害澶辫触') } @@ -479,6 +546,123 @@ } }) }, + logoutCancel() { + this.logoutShow = false; + }, + yuYueBtnClick(item){ + this.$refs.regesterFormRef.validate().then(res => { + if(this.isshow){ + this.logoutShow = true; + this.ids=item + }else{ + if(this.daydata.orderType=='澶栬喘'){ + if(this.daydata.isWeighing==1){ + this.$reqPost('saveMyDelivery',{ + productName:this.daydata.productName, + customerId:this.daydata.customerId, + deptId:this.daydata.deptId, + filedId:this.daydata.filedId, + orderPlanId:this.daydata.id, + orderTye:this.daydata.orderType, + sendDate:this.daydata.sendDate, + carNumSurplus:this.daydata.carNumSurplus, + yyId:item.id, + ...this.registerFormModel, + tmTaskCoalContact:{ + coalName:this.daydata.productName, + contactPicture:this.contactPicture, + skin:this.skin, + hair:this.hair, + clean:this.clean + } + }, 'json').then(res => { + uni.setStorage({ + key: 'myDelivery', + data: this.registerFormModel, + }); + if (res.code === 0) { + uni.$u.toast('棰勭害鎴愬姛') + this.GetMyDeliverys() + } else { + uni.$u.toast(res.msg ? res.msg : '棰勭害澶辫触') + } + }) + }else{ + let numDtoList=this.tmTaskCoalList.map(item=>{ + return {tmId:item.productId,num:item.productQuantity,coalName:item.coalName} + }) + this.$reqPost('saveMyDelivery',{ + productName:this.daydata.productName, + customerId:this.daydata.customerId, + deptId:this.daydata.deptId, + filedId:this.daydata.filedId, + orderPlanId:this.daydata.id, + orderTye:this.daydata.orderType, + sendDate:this.daydata.sendDate, + carNumSurplus:this.daydata.carNumSurplus, + yyId:item.id, + ...this.registerFormModel, + tmTaskCoalContact:{ + contactPicture:this.contactPicture, + numDtoList:numDtoList + } + }, 'json').then(res => { + uni.setStorage({ + key: 'myDelivery', + data: this.registerFormModel, + }); + if (res.code === 0) { + uni.$u.toast('棰勭害鎴愬姛') + this.GetMyDeliverys() + } else { + uni.$u.toast(res.msg ? res.msg : '棰勭害澶辫触') + } + }) + } + + }else{ + this.$reqPost('saveMyDelivery',{ + productName:this.daydata.productName, + customerId:this.daydata.customerId, + deptId:this.daydata.deptId, + filedId:this.daydata.filedId, + orderPlanId:this.daydata.id, + orderTye:this.daydata.orderType, + sendDate:this.daydata.sendDate, + carNumSurplus:this.daydata.carNumSurplus, + yyId:item.id, + ...this.registerFormModel + }, 'json').then(res => { + uni.setStorage({ + key: 'myDelivery', + data: this.registerFormModel, + }); + if (res.code === 0) { + uni.$u.toast('棰勭害鎴愬姛') + this.GetMyDeliverys() + } else { + uni.$u.toast(res.msg ? res.msg : '棰勭害澶辫触') + } + }) + } + } + }) + }, + GetMyDeliverys() { + this.$reqGet('driverYuYueList', {orderPlanId:this.id}).then(res => { + if (res.code == 0) { + this.yuYueData = res.data; + } else { + this.$u.toast('鍔犺浇澶辫触'); + } + }); + this.$reqGetId('myDelivery',this.id).then(res => { + if (res.data) { + this.daydata=res.data + this.tmTaskCoalList=res.data.jhOrderPlanList + } + }); + }, GetMyDelivery() { uni.showLoading({ title: '鍔犺浇涓�...' -- Gitblit v1.9.1