diff --git a/src/views/emis/EmisBaseTools/MasterBillCodePicker.vue b/src/views/emis/EmisBaseTools/MasterBillCodePicker.vue index e869cf3c..86f6dbd0 100644 --- a/src/views/emis/EmisBaseTools/MasterBillCodePicker.vue +++ b/src/views/emis/EmisBaseTools/MasterBillCodePicker.vue @@ -9,6 +9,7 @@ v-model="svalue" :placeholder="placeholder" style="width: 100%" + @blur="onBlur" @focus="onFocus" @change="onChange" > @@ -83,7 +84,10 @@ export default { this.$emit("onMasterBillCodeChange", valObject);//子组件传选中对象到父组件 this.$emit("input", this.svalue); // 子组件值传到父组件 基础双向绑定 }, - + onBlur(val) { + this.$emit("input", this.svalue); + this.dispatch('ElFormItem', 'el.form.blur'); + }, queryData(val) { this.queryParams = {...this.searchParams}; this.queryParams.billCode = val; diff --git a/src/views/emis/emisWaybill/waybillGot.vue b/src/views/emis/emisWaybill/waybillGot.vue index 9b390a14..fe63a334 100644 --- a/src/views/emis/emisWaybill/waybillGot.vue +++ b/src/views/emis/emisWaybill/waybillGot.vue @@ -525,12 +525,12 @@ - + 是否为虚拟单 - + @@ -1051,7 +1051,7 @@ data() { { required: true, message: "包装类型不能为空",trigger: ["blur",'change'] } ], //自定义校验 - masterBillCode:[ + masterBillCode:[{ required: true, message: "关联主单不能为空", trigger: ["blur", 'change'] }, {validator: checkmasterProductType, trigger: ['blur', 'change']} ], dispatchMethod: [ @@ -1595,6 +1595,10 @@ methods: { } this.form = response.data; + //处理始发网点为空 始发网点等于寄件网点 + if(!this.form.startSiteCode || this.form.startSiteCode.trim()==''){ + this.form.startSiteCode=this.form.sendSiteCode; + } if(this.form.lockFlag=="T"&&this.action!='got'){ this.$confirm(this.form.lockReason, '提示', { confirmButtonText: '确认', @@ -1806,11 +1810,11 @@ methods: { }, onProductChange(item,transType){ //非缅甸快递/缅甸快递进口/柬埔寨快递进口 重置虚拟单 - if(!['002','012','014'].includes(item[0])){ + if(!['002','012','014','078'].includes(item[0])){ this.form.masterBillCode = null; this.form.blVirtual = null; } - if(item[0]!=='002' && this.form.remark && this.form.remark!==null){ + if(item && !['002'].includes(item[0]) && this.form.remark && this.form.remark!==null){ this.form.remark = this.form.remark.replace(/该单为虚拟单:对应主单为[\da-zA-Z]+/g, ''); } if(item!=null && item.length==2){ @@ -2443,8 +2447,8 @@ methods: { if (val) { this.form.masterBillCode = val.value; this.masterBillProductType = val.productType; - if (this.form.transLine === '002') { - if (this.form.remark==null || this.form.remark.trim() === '') { + if (['002'].includes(this.form.transLine)) { + if (this.form.remark == null || this.form.remark.trim() === '') { //生成备注 this.form.remark = `该单为虚拟单:对应主单为${this.form.masterBillCode}`; } else { @@ -2453,18 +2457,22 @@ methods: { this.form.remark = this.form.remark.replace(/主单为[\da-zA-Z]+/g, '主单为' + val.value); } else { //判断结尾是不是逗号 - if(!this.form.remark.endsWith(',')){ - this.form.remark = this.form.remark +','; + if (!this.form.remark.endsWith(',')) { + this.form.remark = this.form.remark + ','; } - this.form.remark =this.form.remark + '该单为虚拟单:对应主单为' + val.value; + this.form.remark = this.form.remark + '该单为虚拟单:对应主单为' + val.value; } } } else { //删除备注中虚拟单部分 + if (this.form.remark) { + this.form.remark = this.form.remark.replace(/该单为虚拟单:对应主单为[\da-zA-Z]+/g, ''); + } + } + } else { + if (this.form.remark) { this.form.remark = this.form.remark.replace(/该单为虚拟单:对应主单为[\da-zA-Z]+/g, ''); } - }else{ - this.form.remark = this.form.remark.replace(/该单为虚拟单:对应主单为[\da-zA-Z]+/g, ''); } }, //虚拟单变化 diff --git a/src/views/emis/emisWaybill/waybillModify.vue b/src/views/emis/emisWaybill/waybillModify.vue index 9771e996..149d3faf 100644 --- a/src/views/emis/emisWaybill/waybillModify.vue +++ b/src/views/emis/emisWaybill/waybillModify.vue @@ -527,12 +527,12 @@ - + 是否为虚拟单 - + @@ -1050,8 +1050,8 @@ data() { packType: [ { required: true, message: "包装类型不能为空",trigger: ["blur",'change'] } ], - //自定义校验 - masterBillCode:[ + //自定义校验 + masterBillCode:[{ required: true, message: "关联主单不能为空", trigger: ["blur", 'change'] }, {validator: checkmasterProductType, trigger: ['blur', 'change']} ], dispatchMethod: [ @@ -1583,6 +1583,10 @@ methods: { } this.form = response.data; + //处理始发网点为空 始发网点等于寄件网点的值 + if(!this.form.startSiteCode || this.form.startSiteCode.trim()==''){ + this.form.startSiteCode=this.form.sendSiteCode; + } if(this.form.lockFlag=="T"&&this.action!='got'){ this.$confirm(this.form.lockReason, '提示', { confirmButtonText: '确认', @@ -1798,11 +1802,11 @@ methods: { }, onProductChange(item,transType){ //非缅甸快递/缅甸快递进口/柬埔寨快递进口 重置虚拟单 - if(!['002','012','014'].includes(item[0])){ + if(!['002','012','014','078'].includes(item[0])){ this.form.masterBillCode = null; this.form.blVirtual = null; } - if(item[0]!=='002' && this.form.remark && this.form.remark!==null){ + if(item && !['002'].includes(item[0]) && this.form.remark && this.form.remark!==null){ this.form.remark = this.form.remark.replace(/该单为虚拟单:对应主单为[\da-zA-Z]+/g, ''); } if(item!=null && item.length==2){ @@ -2438,13 +2442,13 @@ methods: { this.form.billCode="" } }, - //获取虚拟运单关联主单 + //获取虚拟运单关联主单 onMasterBillCodeChange(val) { if (val) { this.form.masterBillCode = val.value; this.masterBillProductType = val.productType; - if (this.form.transLine === '002') { - if (this.form.remark==null || this.form.remark.trim() === '') { + if (['002'].includes(this.form.transLine)) { + if (this.form.remark == null || this.form.remark.trim() === '') { //生成备注 this.form.remark = `该单为虚拟单:对应主单为${this.form.masterBillCode}`; } else { @@ -2453,19 +2457,23 @@ methods: { this.form.remark = this.form.remark.replace(/主单为[\da-zA-Z]+/g, '主单为' + val.value); } else { //判断结尾是不是逗号 - if(!this.form.remark.endsWith(',')){ - this.form.remark = this.form.remark +','; + if (!this.form.remark.endsWith(',')) { + this.form.remark = this.form.remark + ','; } - this.form.remark =this.form.remark + '该单为虚拟单:对应主单为' + val.value; + this.form.remark = this.form.remark + '该单为虚拟单:对应主单为' + val.value; } } } else { //删除备注中虚拟单部分 + if(this.form.remark){ + this.form.remark = this.form.remark.replace(/该单为虚拟单:对应主单为[\da-zA-Z]+/g, ''); + } + } + } else { + //删除备注中虚拟单部分 + if(this.form.remark){ this.form.remark = this.form.remark.replace(/该单为虚拟单:对应主单为[\da-zA-Z]+/g, ''); } - }else { - //删除备注中虚拟单部分 - this.form.remark = this.form.remark.replace(/该单为虚拟单:对应主单为[\da-zA-Z]+/g, ''); } }, //虚拟单变化 diff --git a/src/views/emis/emisWaybill/waybillRecord.vue b/src/views/emis/emisWaybill/waybillRecord.vue index d06da126..f6788c41 100644 --- a/src/views/emis/emisWaybill/waybillRecord.vue +++ b/src/views/emis/emisWaybill/waybillRecord.vue @@ -529,12 +529,12 @@ - + 是否为虚拟单 - + @@ -1055,8 +1055,8 @@ data() { { required: true, message: "包装类型不能为空",trigger: ["blur",'change'] } ], //自定义校验 - masterBillCode:[ - {validator: checkmasterProductType, trigger: ['blur', 'change']} + masterBillCode: [{ required: true, message: "关联主单不能为空", trigger: ["blur", 'change'] }, + { validator: checkmasterProductType, trigger: ['blur', 'change'] } ], dispatchMethod: [ { required: true, message: "派件方式不能为空", trigger: ["blur",'change'] } @@ -1803,11 +1803,11 @@ methods: { }, onProductChange(item,transType){ //非缅甸快递/缅甸快递进口/柬埔寨快递进口 重置虚拟单 - if(item && !['002','012','014'].includes(item[0])){ + if(item && !['002','012','014','078'].includes(item[0])){ this.form.masterBillCode = null; this.form.blVirtual = null; } - if(item && item[0]!=='002' && this.form.remark && this.form.remark!==null){ + if(item && !['002'].includes(item[0]) && this.form.remark && this.form.remark!==null){ this.form.remark = this.form.remark.replace(/该单为虚拟单:对应主单为[\da-zA-Z]+/g, ''); } if(item!=null && item.length==2){ @@ -2435,8 +2435,8 @@ methods: { if (val) { this.form.masterBillCode = val.value; this.masterBillProductType = val.productType; - if (this.form.transLine === '002') { - if (this.form.remark==null || this.form.remark.trim() === '') { + if (['002'].includes(this.form.transLine)) { + if (this.form.remark == null || this.form.remark.trim() === '') { //生成备注 this.form.remark = `该单为虚拟单:对应主单为${this.form.masterBillCode}`; } else { @@ -2445,19 +2445,23 @@ methods: { this.form.remark = this.form.remark.replace(/主单为[\da-zA-Z]+/g, '主单为' + val.value); } else { //判断结尾是不是逗号 - if(!this.form.remark.endsWith(',')){ - this.form.remark = this.form.remark +','; + if (!this.form.remark.endsWith(',')) { + this.form.remark = this.form.remark + ','; } - this.form.remark =this.form.remark + '该单为虚拟单:对应主单为' + val.value; + this.form.remark = this.form.remark + '该单为虚拟单:对应主单为' + val.value; } } } else { //删除备注中虚拟单部分 + if (this.form.remark) { + this.form.remark = this.form.remark.replace(/该单为虚拟单:对应主单为[\da-zA-Z]+/g, ''); + } + } + } else { + //删除备注中虚拟单部分 + if(this.form.remark){ this.form.remark = this.form.remark.replace(/该单为虚拟单:对应主单为[\da-zA-Z]+/g, ''); } - }else { - //删除备注中虚拟单部分 - this.form.remark = this.form.remark.replace(/该单为虚拟单:对应主单为[\da-zA-Z]+/g, ''); } }, //虚拟单变化 diff --git a/src/views/emis/emisWaybillAjustApply/adjustPanel.vue b/src/views/emis/emisWaybillAjustApply/adjustPanel.vue index 4fe2002d..927119c0 100644 --- a/src/views/emis/emisWaybillAjustApply/adjustPanel.vue +++ b/src/views/emis/emisWaybillAjustApply/adjustPanel.vue @@ -832,7 +832,7 @@ - + 虚拟单调整