From 85d2c2feb90d3ccaceccbf17b3b789579dfe2823 Mon Sep 17 00:00:00 2001
From: wuteng <419274783@qq.com>
Date: Thu, 26 Jun 2025 11:08:47 +0800
Subject: [PATCH] =?UTF-8?q?=E8=99=9A=E6=8B=9F=E5=8D=95=E3=80=81=E5=A4=87?=
=?UTF-8?q?=E6=B3=A8=E3=80=81=E5=A7=8B=E5=8F=91=E7=BD=91=E7=82=B9=E8=B0=83?=
=?UTF-8?q?=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
common/api/common.js | 4 +
common/api/order.js | 5 +
common/api/url.js | 3 +-
common/manageServer.js | 16 +-
.../buns-order-templates/bo-detail-tmp.vue | 37 ++++-
pages/post/openorder.vue | 142 ++++++++++++++----
6 files changed, 174 insertions(+), 33 deletions(-)
diff --git a/common/api/common.js b/common/api/common.js
index 6cf48d9..f17ff9b 100644
--- a/common/api/common.js
+++ b/common/api/common.js
@@ -69,6 +69,10 @@ export const getLastAppVersion = (data = {})=> {
return coreRequest(url.getLastAppVersion, data, {})
}
+//获取网点列表
+export const listSimple = (data = {})=> {
+ return coreRequest(url.listSimple, data, {}, "GET")
+}
diff --git a/common/api/order.js b/common/api/order.js
index 89d9e99..b915d06 100644
--- a/common/api/order.js
+++ b/common/api/order.js
@@ -250,4 +250,9 @@ export const getMyBizStatInfo = (data = {})=> {
// 业务统计明细(区分国家)
export const getMyBizStatList = (data = {})=> {
return coreRequest(url.getMyBizStatList, data, {}, "GET")
+}
+
+// 获取关联主单号
+export const getMasterEmisWaybills = (data = {}) => {
+ return coreRequest(url.getMasterEmisWaybills, data, {}, "GET")
}
\ No newline at end of file
diff --git a/common/api/url.js b/common/api/url.js
index 13bc841..88afab8 100644
--- a/common/api/url.js
+++ b/common/api/url.js
@@ -72,6 +72,7 @@ export default {
getMyProfitSimpleList: `/emis/emisCommissionProfit/getMyProfitSimpleList`, // 计提明细列表
getMyBizStatInfo: `/emis/emisWaybill/getMyBizStatInfo`, // 业务统计(顶部统计)
getMyBizStatList: `/emis/emisWaybill/getMyBizStatList`, // 业务统计明细(区分国家)
-
+ getMasterEmisWaybills: `/emis/emisWaybill/getMasterEmisWaybills`, // 获取关联主单号
+ listSimple: `/emis/emisSite/listSimple`, // 获取网点列表
}
diff --git a/common/manageServer.js b/common/manageServer.js
index a00b163..fde0996 100644
--- a/common/manageServer.js
+++ b/common/manageServer.js
@@ -4,11 +4,17 @@ import { setSessionXToken, getSessionXToken } from "@/session"
import { textEncoder, textDecoder } from "./util"
import { getCurrentAppInfo } from "@/common/appUpdate"
-let _appVersion
-getCurrentAppInfo().then(res=> {
- _appVersion = res._appVersion
-})
-
+var _appVersion;
+// getCurrentAppInfo().then(res=> {
+// _appVersion = res._appVersion
+// })
+const init = async () => {
+ const { getCurrentAppInfo } = await import("@/common/appUpdate");
+ getCurrentAppInfo().then((res) => {
+ _appVersion = res._appVersion;
+ });
+};
+init();
const getCommonReqData = ()=> {
const xToken = getSessionXToken()
diff --git a/components/buns-order-templates/bo-detail-tmp.vue b/components/buns-order-templates/bo-detail-tmp.vue
index 3521e25..21ad80e 100644
--- a/components/buns-order-templates/bo-detail-tmp.vue
+++ b/components/buns-order-templates/bo-detail-tmp.vue
@@ -99,6 +99,12 @@
{{ modelInfo.dispatchUnderlingSiteName }}
+
+
+ 始发网点
+ {{ modelInfo.startSiteName }}
+
+
目的地
@@ -141,6 +147,16 @@
+
+
+ 是否为虚拟单
+ {{ modelInfo.blVirtual==='1'?'是':'否' }}
+
+
+ 关联主单
+ {{ modelInfo.masterBillCode }}
+
+
寄件时间
@@ -295,7 +311,7 @@
- {{modelInfo.remark || '-'}}
+ {{remarkFormat(modelInfo) || '-'}}
@@ -395,6 +411,25 @@
},
methods: {
+ //拼接虚拟单后6位
+ conCatVirtualRemark(virtualRemark) {
+ if (virtualRemark != null) {
+ return virtualRemark.split(',').map((item) => {
+ return item.substring(item.length - 6);
+ }).join(',');
+ }
+ },
+ //拼接备注
+ remarkFormat(modelInfo) {
+ let remark = modelInfo.remark;
+ if (modelInfo.blVirtual === '0' && modelInfo.virtualRemark !== '' && modelInfo.virtualRemark !== null && modelInfo.transLine === '002' && modelInfo.sendDate > '2025-06-23 20:00:00') {
+ if (remark && remark.trim() !== '' && !remark.endsWith(',')) {
+ remark = remark + ','
+ }
+ remark = `${remark}该运单为主单,对应虚拟单为${this.conCatVirtualRemark(modelInfo.virtualRemark)}`;
+ }
+ return remark;
+ },
async initData(){
if(this.billCode) {
let res = await apiService.getOrderDetail({billCode: this.billCode, _loading: true})
diff --git a/pages/post/openorder.vue b/pages/post/openorder.vue
index 0c62389..8d50336 100644
--- a/pages/post/openorder.vue
+++ b/pages/post/openorder.vue
@@ -39,12 +39,19 @@
路线信息
+
+
+
+
+
@@ -178,7 +185,20 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -268,26 +288,25 @@
-
-
-
-
-
-
-
-
-
-
-
- 货物照片
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+ 货物照片
+
+
+
-
@@ -336,7 +355,15 @@
},
showCreateBNoBtn(){
return this.queryOption.type == this.pageTypeEnum.create || this.queryOption.copyBillCode
- }
+ },
+ masterBillSearchParam(){
+ return {
+ transLineType: this.submitParam.transLine,
+ productType: this.submitParam.productType,
+ // 寄件点编码
+ sendSiteCode: this.submitParam.sendSiteCode,
+ }
+ },
},
data() {
return this.getDefaultData()
@@ -383,12 +410,17 @@
wareRes: { list: [] },
paybeeRes: { list: [] },
salemanRes: { list: [] },
+ mastRes:{ list: [] }, // 主单列表数据
+ startSiteRes: { list: [] }, // 始发网点列表数据
goodChooseModal: {
show: false,
},
submitParam: {
...getOrderModels(),
sendSiteCode: this.$store.getters.userInfo.ownerSiteCode,
+ //始发网点初始值
+ startSiteCode: this.$store.getters.userInfo.ownerSiteCode,
+ startSiteName: this.$store.getters.userInfo.ownerSiteName,
}
}
},
@@ -402,6 +434,8 @@
getWarehouseInList: apiService.getWarehouseInList,
getPayeeList: apiService.getPayeeList,
getSalemanList: apiService.getSalemanList,
+ getMasterEmisWaybills: apiService.getMasterEmisWaybills, // 获取关联主单号
+ listSimple: apiService.listSimple, // 获取网点列表
async initData() { // 初始化
this.queryOption.billCode = this.queryOption.billCode || this.queryOption.copyBillCode
this.curPageType = this.pageTypeMap[this.queryOption.type] || {}
@@ -429,15 +463,15 @@
}
// 复制场景 清除billCode orderSn
if(this.queryOption.copyBillCode) {
- delete this.submitParam.billCode
- delete this.submitParam.orderSn
- this.submitParam.pickStartDate = ''
+ delete this.submitParam.billCode
+ delete this.submitParam.orderSn
+ this.submitParam.pickStartDate = ''
this.submitParam.sendDate = getOrderModels().sendDate
}
- }
- let qsParam = this.queryOption.defaultSubParams || {}
- if(qsParam.warehouseInNo) {
- this.submitParam.warehouseInNo = qsParam.warehouseInNo
+ }
+ let qsParam = this.queryOption.defaultSubParams || {}
+ if(qsParam.warehouseInNo) {
+ this.submitParam.warehouseInNo = qsParam.warehouseInNo
}
this.pageLoading = false
},
@@ -480,6 +514,14 @@
this.submitParam.productTypeName = submitParam.productTypeName
const item = this.wayRes.list.filter(t=> t.val == val)[0]
this.updateDltDestSite({ lineCode: val })
+ //非缅甸快递/缅甸快递进口/柬埔寨快递进口 重置虚拟单
+ if (val && !['002', '012', '014','078'].includes(val)) {
+ this.submitParam.masterBillCode = null;
+ this.submitParam.blVirtual = null;
+ }
+ if (val && val !== '002' && this.submitParam.remark && this.submitParam.remark !== null) {
+ this.submitParam.remark = this.submitParam.remark.replace(/该单为虚拟单:对应主单为[\da-zA-Z]+/g, '');
+ }
},
handleDestPostChange(val) {
const item = this.destPostRes.list.filter(t=> t.val == val)[0]
@@ -508,6 +550,14 @@
}, 300)
},
async handleSave(type) {
+ //校验产品类型和关联主单产品类型 线路是否一致
+ if(this.submitParam.transLine && this.submitParam.masterBillCode){
+ let masterRes = await apiService.getOrderDetail({billCode: this.submitParam.masterBillCode})
+ if(masterRes.data.productType != this.submitParam.productType){
+ this.showToast('主单和虚拟单线路不一致')
+ return
+ }
+ }
let saveServerHand = apiService.submitOrder
if(this.isEdit) { }
let params = JSON.parse(JSON.stringify(this.submitParam));
@@ -555,6 +605,46 @@
if(this.showCreateBNoBtn) {
this.submitParam = this.getDefaultData().submitParam
}
+ },
+ //关联主单改变
+ handleMasterSelectChange(val) {
+ if (val) {
+ this.submitParam.masterBillCode = val
+ }
+ if (val && this.submitParam.transLine === '002') {
+ if (this.submitParam.remark == null || this.submitParam.remark.trim() === '') {
+ //生成备注
+ this.submitParam.remark = `该单为虚拟单:对应主单为${val}`;
+ } else {
+ if (this.submitParam.remark.indexOf('该单为虚拟单:对应主单为') > -1) {
+ //替换主单号
+ this.submitParam.remark = this.submitParam.remark.replace(/主单为[\da-zA-Z]+/g, '主单为' + val);
+ } else {
+ //判断结尾是不是逗号
+ if(this.submitParam.remark){
+ if (!this.submitParam.remark.endsWith(',')) {
+ this.submitParam.remark = this.submitParam.remark + ',';
+ }
+ this.submitParam.remark = this.submitParam.remark + '该单为虚拟单:对应主单为' + val;
+ }
+ }
+ }
+ } else {
+ //删除备注中虚拟单部分
+ if (this.submitParam.remark) {
+ this.submitParam.remark = this.submitParam.remark.replace(/该单为虚拟单:对应主单为[\da-zA-Z]+/g, '');
+ }
+ }
+ },
+ //虚拟单变化
+ handleVirtualChange() {
+ if (this.submitParam.blVirtual !== '1') {
+ this.submitParam.masterBillCode = null;
+ //删除备注中虚拟单内容
+ if (this.submitParam.remark && this.submitParam.remark.trim() != '') {
+ this.submitParam.remark = this.submitParam.remark.replace(/该单为虚拟单:对应主单为[\da-zA-Z]+/g, '');
+ }
+ }
}
}
}