From 69bd78af7c133bd418f3daaba4e5059c9d05db60 Mon Sep 17 00:00:00 2001 From: linfso Date: Wed, 25 Dec 2024 17:41:43 +0800 Subject: [PATCH] md --- src/views/emis/emisWaybill/UserOrderList.vue | 4 +- src/views/emis/emisWaybill/waybillModify.vue | 71 ++++++++++------- src/views/emis/emisWaybill/waybillRecord.vue | 80 +++++++++----------- 3 files changed, 80 insertions(+), 75 deletions(-) diff --git a/src/views/emis/emisWaybill/UserOrderList.vue b/src/views/emis/emisWaybill/UserOrderList.vue index a03ecddf..c141dd3c 100644 --- a/src/views/emis/emisWaybill/UserOrderList.vue +++ b/src/views/emis/emisWaybill/UserOrderList.vue @@ -891,7 +891,9 @@ export default { } let billCode=item0.billCode; - this.$router.push({ path: '/d24/waybillManagement/WaybillRecord', query: {name:"接单", action: "add",billCode: billCode,addFrom:"userOrder"}}) + this.$router.push({ path: '/d24/waybillManagement/WaybillGot', query: {name:"接单", action: "got",billCode: billCode,timestamp:(new Date()).getTime() }}) + // this.$router.push({ path: '/d24/waybillManagement/WaybillRecord', query: {name:"接单", action: "add",billCode: billCode,addFrom:"userOrder"}}) + } diff --git a/src/views/emis/emisWaybill/waybillModify.vue b/src/views/emis/emisWaybill/waybillModify.vue index 3e8fd999..27f4f288 100644 --- a/src/views/emis/emisWaybill/waybillModify.vue +++ b/src/views/emis/emisWaybill/waybillModify.vue @@ -13,23 +13,23 @@ - + - +
- +
-
{{ $t('电子主单') }}
+
{{ $t('电子主单') }}
- @@ -823,6 +824,7 @@ import { deepClone } from '@/utils/index' export default { // name: "WaybillRecord", + // name: "WaybillGot", name: "WaybillModify", components: { SalemanPicker, @@ -871,8 +873,8 @@ data() { loading: true, triggerCount:0, action:null, - addFrom:null, sendDate:null, + lastTimestamp:null, // 表单参数 form: {}, timer:null, @@ -1032,30 +1034,43 @@ computed: { }, watch: { $route () { - if(this.$route.query.addFrom=="userOrder"){ - this.action="add"; - this.addFrom="userOrder"; - this.billCode=this.$route.query.billCode; - this.$route.meta.title = "接单"; - this.initData(); + if(this.$route.query.action=='got'){ + this.action="got"; + // 判断时间是否一致 + if(this.lastTimestamp != this.$route.query.timestamp){ + this.lastTimestamp=this.$route.query.timestamp; + this.billCode=this.$route.query.billCode; + const title = '接单:'+this.billCode; + const route = Object.assign({}, this.$route, { title: `${title}` }) + this.$store.dispatch('tagsView/updateVisitedView', route) + this.initData(); + } } + } }, -// beforeRouteEnter(to,from,next){ -// if(to.query.name){ -// to.meta.title = to.query.name; -// } -// next() -// }, created() { this.action=this.$route.query.action; if(!this.action){ this.action="add"; } - if(this.$route.query.addFrom=="userOrder"){ + if(this.action=='add' ){ + this.billCode=null; + const title = '运单录入'; + const route = Object.assign({}, this.$route, { title: `${title}` }) + this.$store.dispatch('tagsView/updateVisitedView', route) + } + else if(this.action=='got'){ this.billCode=this.$route.query.billCode; - this.addFrom="userOrder"; + const title = '接单:'+this.billCode; + const route = Object.assign({}, this.$route, { title: `${title}` }) + this.$store.dispatch('tagsView/updateVisitedView', route) + } + else if(this.action=='modify'){ + const title = '运单修改'; + const route = Object.assign({}, this.$route, { title: `${title}` }) + this.$store.dispatch('tagsView/updateVisitedView', route) } this.initData(); @@ -1073,7 +1088,6 @@ methods: { this.billCode=this.form.billCode+""; this.initData(); }, - onBillCodeChange(){ if(this.form.billCode){ this.form.billCode=this.form.billCode.replace(/\s+/g, ''); @@ -1448,7 +1462,7 @@ methods: { if(this.billCode && this.billCode!=undefined) { this.loading = true; getWaybillDetail(this.billCode).then(response => { - if(this.$store.getters.ownerSiteCode!='88888'&&this.addFrom!='userOrder'){ + if(this.$store.getters.ownerSiteCode!='88888'&&this.action!='got'){ if(this.$store.getters.ownerSiteCode!=response.data.sendSiteCode){ this.$modal.msgError('此单归属不允许修改'); return; @@ -1456,7 +1470,7 @@ methods: { } this.form = response.data; - if(this.form.lockFlag=="T"&&this.addFrom!='userOrder'){ + if(this.form.lockFlag=="T"&&this.action!='got'){ this.$confirm(this.form.lockReason, '提示', { confirmButtonText: '确认', cancelButtonText: '返回', @@ -1492,7 +1506,7 @@ methods: { // 接单处理 - if(this.addFrom=="userOrder"){ + if(this.action=="got"){ // 获取可用运单数 this.initGetTotalAvailablePag(this.form.sendSiteCode); this.startTimer(); @@ -1716,7 +1730,7 @@ methods: { }); }, startTimer(){ - if(this.action=='add' || this.action=='preAdd'){ + if(this.action=='add' || this.action=='preAdd' || this.action=='got'){ this.sendDate=parseTime(new Date()); this.timer = setTimeout(this.startTimer, 1000); } @@ -1737,9 +1751,8 @@ methods: { realSubmitOrder(postForm).then(response => { this.$modal.msgSuccess("下单成功"); - this.addFrom=null; // 新开单才需要打印 - if(this.action == "add"){ + if(this.action == "add" || this.action == "got"){ // 做揽收扫描记录 // this.handDoGotScan(); diff --git a/src/views/emis/emisWaybill/waybillRecord.vue b/src/views/emis/emisWaybill/waybillRecord.vue index c0b7a245..c2e043db 100644 --- a/src/views/emis/emisWaybill/waybillRecord.vue +++ b/src/views/emis/emisWaybill/waybillRecord.vue @@ -13,23 +13,23 @@ - + - +
- +
-
{{ $t('电子主单') }}
+
{{ $t('电子主单') }}
- @@ -824,6 +824,7 @@ import { deepClone } from '@/utils/index' export default { name: "WaybillRecord", + // name: "WaybillGot", // name: "WaybillModify", components: { SalemanPicker, @@ -872,8 +873,8 @@ data() { loading: true, triggerCount:0, action:null, - addFrom:null, sendDate:null, + lastTimestamp:null, // 表单参数 form: {}, timer:null, @@ -1033,27 +1034,17 @@ computed: { }, watch: { $route () { - if(this.$route.query.action=='add'){ - - this.action="add"; - if(this.$route.query.addFrom=="userOrder"){ - this.addFrom="userOrder"; + if(this.$route.query.action=='got'){ + this.action="got"; + // 判断时间是否一致 + if(this.lastTimestamp != this.$route.query.timestamp){ + this.lastTimestamp=this.$route.query.timestamp; this.billCode=this.$route.query.billCode; - - const title = '接单'; + const title = '接单:'+this.billCode; const route = Object.assign({}, this.$route, { title: `${title}` }) this.$store.dispatch('tagsView/updateVisitedView', route) - - }else{ - this.addFrom=null; - this.billCode=null; - - const title = '运单录入'; - const route = Object.assign({}, this.$route, { title: `${title}` }) - this.$store.dispatch('tagsView/updateVisitedView', route) - + this.initData(); } - this.initData(); } } @@ -1065,20 +1056,16 @@ created() { } if(this.action=='add' ){ + this.billCode=null; + const title = '运单录入'; + const route = Object.assign({}, this.$route, { title: `${title}` }) + this.$store.dispatch('tagsView/updateVisitedView', route) + } + else if(this.action=='got'){ this.billCode=this.$route.query.billCode; - if(this.$route.query.addFrom=="userOrder"){ - this.addFrom="userOrder"; - const title = '接单'; - const route = Object.assign({}, this.$route, { title: `${title}` }) - this.$store.dispatch('tagsView/updateVisitedView', route) - }else{ - this.billCode=null; - this.addFrom=null; - const title = '运单录入'; - const route = Object.assign({}, this.$route, { title: `${title}` }) - this.$store.dispatch('tagsView/updateVisitedView', route) - } - + const title = '接单:'+this.billCode; + const route = Object.assign({}, this.$route, { title: `${title}` }) + this.$store.dispatch('tagsView/updateVisitedView', route) } else if(this.action=='modify'){ const title = '运单修改'; @@ -1101,7 +1088,6 @@ methods: { this.billCode=this.form.billCode+""; this.initData(); }, - onBillCodeChange(){ if(this.form.billCode){ this.form.billCode=this.form.billCode.replace(/\s+/g, ''); @@ -1476,7 +1462,7 @@ methods: { if(this.billCode && this.billCode!=undefined) { this.loading = true; getWaybillDetail(this.billCode).then(response => { - if(this.$store.getters.ownerSiteCode!='88888'&&this.addFrom!='userOrder'){ + if(this.$store.getters.ownerSiteCode!='88888'&&this.action!='got'){ if(this.$store.getters.ownerSiteCode!=response.data.sendSiteCode){ this.$modal.msgError('此单归属不允许修改'); return; @@ -1484,7 +1470,7 @@ methods: { } this.form = response.data; - if(this.form.lockFlag=="T"&&this.addFrom!='userOrder'){ + if(this.form.lockFlag=="T"&&this.action!='got'){ this.$confirm(this.form.lockReason, '提示', { confirmButtonText: '确认', cancelButtonText: '返回', @@ -1520,9 +1506,14 @@ methods: { // 接单处理 - if(this.addFrom=="userOrder"){ + if(this.action=="got"){ // 获取可用运单数 this.initGetTotalAvailablePag(this.form.sendSiteCode); + + if(!this.form.cargoList){ + this.handleInitGenGoods(); + } + this.startTimer(); } @@ -1744,7 +1735,7 @@ methods: { }); }, startTimer(){ - if(this.action=='add' || this.action=='preAdd'){ + if(this.action=='add' || this.action=='preAdd' || this.action=='got'){ this.sendDate=parseTime(new Date()); this.timer = setTimeout(this.startTimer, 1000); } @@ -1765,9 +1756,8 @@ methods: { realSubmitOrder(postForm).then(response => { this.$modal.msgSuccess("下单成功"); - this.addFrom=null; // 新开单才需要打印 - if(this.action == "add"){ + if(this.action == "add" || this.action == "got"){ // 做揽收扫描记录 // this.handDoGotScan();