From 9cb673c3e98c52323ad44893953c1b808705e7d7 Mon Sep 17 00:00:00 2001 From: wk Date: 星期六, 12 十月 2024 16:45:31 +0800 Subject: [PATCH] feat:临时入场 --- pages/driver-page/delivery-my/delivery-my/delivery-my.vue | 275 +++++++++++++++++++++--------------------------------- 1 files changed, 106 insertions(+), 169 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 66be58e..f36d69c 100644 --- a/pages/driver-page/delivery-my/delivery-my/delivery-my.vue +++ b/pages/driver-page/delivery-my/delivery-my/delivery-my.vue @@ -434,50 +434,86 @@ }); }); }, - logoutConfirm() { + lohOutLogin(){ this.$refs.regesterFormRef.validate().then(res => { - 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:this.ids.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, - }); - uni.setStorage({ - key: 'isshow', - data: false, - }); - this.logoutShow=false - this.isshow=false - if (res.code === 0) { - uni.$u.toast('棰勭害鎴愬姛') - this.GetMyDeliverys() - } else { - uni.$u.toast(res.msg ? res.msg : '棰勭害澶辫触') - } - }) + 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:this.ids.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, + }); + uni.setStorage({ + key: 'isshow', + data: false, + }); + this.logoutShow=false + this.isshow=false + 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:this.ids.id, + ...this.registerFormModel, + tmTaskCoalContact:{ + contactPicture:this.contactPicture, + numDtoList:numDtoList + } + }, '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.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, @@ -488,11 +524,7 @@ sendDate:this.daydata.sendDate, carNumSurplus:this.daydata.carNumSurplus, yyId:this.ids.id, - ...this.registerFormModel, - tmTaskCoalContact:{ - contactPicture:this.contactPicture, - numDtoList:numDtoList - } + ...this.registerFormModel }, 'json').then(res => { uni.setStorage({ key: 'myDelivery', @@ -512,39 +544,33 @@ } }) } - - }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: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.GetMyDeliverys() - } else { - uni.$u.toast(res.msg ? res.msg : '棰勭害澶辫触') - } - }) - } }) + }, + logoutConfirm() { + + if(this.registerFormModel.carNo==""){ + this.lohOutLogin() + }else{ + if(this.registerFormModel.carNo){ + var xreg=/^[浜触娌笣鍐�璞簯杈介粦婀樼殩椴佹柊鑻忔禉璧i剛妗傜敇鏅嬭挋闄曞悏闂借吹绮ら潚钘忓窛瀹佺惣浣块A-Z]{1}[A-Z]{1}(([0-9]{5}[DF]$)|([DF][A-HJ-NP-Z0-9][0-9]{4}$))/; + var creg=/^[浜触娌笣鍐�璞簯杈介粦婀樼殩椴佹柊鑻忔禉璧i剛妗傜敇鏅嬭挋闄曞悏闂借吹绮ら潚钘忓窛瀹佺惣浣块A-Z]{1}[A-Z]{1}[A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9鎸傚璀︽腐婢砞{1}$/; + if(this.registerFormModel.carNo.length == 7){ + if(!creg.test(this.registerFormModel.carNo)) { + uni.$u.toast('璇疯緭鍏ユ纭殑杞︾墝鍙�') + }else { + this.lohOutLogin() + } + } else if(this.registerFormModel.carNo.length == 8){ + if(!xreg.test(this.registerFormModel.carNo)) { + uni.$u.toast('璇疯緭鍏ユ纭殑杞︾墝鍙�') + }else { + this.lohOutLogin() + } + }else { + uni.$u.toast('璇疯緭鍏ユ纭殑杞︾墝鍙�') + } + } + } }, logoutCancel() { this.logoutShow = false; @@ -555,96 +581,7 @@ 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 : '棰勭害澶辫触') - } - }) - } + this.logoutConfirm(); } }) }, -- Gitblit v1.9.1