Merge pull request '虚拟单、备注、始发网点调整' (#1) from develop-virtualRecord into master
Reviewed-on: http://git.xdadan.loc/tanex/emis-app/pulls/1
This commit is contained in:
commit
d00d81dfd1
@ -69,6 +69,10 @@ export const getLastAppVersion = (data = {})=> {
|
||||
return coreRequest(url.getLastAppVersion, data, {})
|
||||
}
|
||||
|
||||
//获取网点列表
|
||||
export const listSimple = (data = {})=> {
|
||||
return coreRequest(url.listSimple, data, {}, "GET")
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ -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")
|
||||
}
|
||||
@ -77,6 +77,7 @@ export default {
|
||||
getMyProfitSimpleList: `/emis/emisCommissionProfit/getMyProfitSimpleList`, // 计提明细列表
|
||||
getMyBizStatInfo: `/emis/emisWaybill/getMyBizStatInfo`, // 业务统计(顶部统计)
|
||||
getMyBizStatList: `/emis/emisWaybill/getMyBizStatList`, // 业务统计明细(区分国家)
|
||||
|
||||
getMasterEmisWaybills: `/emis/emisWaybill/getMasterEmisWaybills`, // 获取关联主单号
|
||||
listSimple: `/emis/emisSite/listSimple`, // 获取网点列表
|
||||
}
|
||||
|
||||
|
||||
@ -4,11 +4,11 @@ import { setSessionXToken, getSessionXToken } from "@/session"
|
||||
import { textEncoder, textDecoder } from "./util"
|
||||
import { getCurrentAppInfo } from "@/common/appUpdate"
|
||||
|
||||
|
||||
let _appVersion="1.0.0"
|
||||
// getCurrentAppInfo().then(res=> {
|
||||
// _appVersion = res._appVersion
|
||||
// })
|
||||
|
||||
const getCommonReqData = ()=> {
|
||||
const xToken = getSessionXToken()
|
||||
|
||||
|
||||
@ -99,6 +99,12 @@
|
||||
<text class="">{{ modelInfo.dispatchUnderlingSiteName }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="dt-item">
|
||||
<view>
|
||||
<text class="clr-sub pr-10">始发网点</text>
|
||||
<text class="">{{ modelInfo.startSiteName }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="dt-item">
|
||||
<view>
|
||||
<text class="clr-sub pr-10">目的地</text>
|
||||
@ -141,6 +147,16 @@
|
||||
</view>
|
||||
</u-row>
|
||||
</view>
|
||||
<view class="dt-item" v-if="modelInfo.blVirtual && modelInfo.blVirtual === '1'">
|
||||
<view>
|
||||
<text class="clr-sub pr-10">是否为虚拟单</text>
|
||||
<text class="">{{ modelInfo.blVirtual==='1'?'是':'否' }}</text>
|
||||
</view>
|
||||
<view>
|
||||
<text class="clr-sub pr-10">关联主单</text>
|
||||
<text class="">{{ modelInfo.masterBillCode }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="dt-item">
|
||||
<u-row>
|
||||
<text class="clr-sub pr-10">寄件时间</text>
|
||||
@ -295,7 +311,7 @@
|
||||
</view>
|
||||
<u-line margin="20rpx 0 20rpx"></u-line>
|
||||
<view class="blcok-grey-sm">
|
||||
<view class="dt-item">{{modelInfo.remark || '-'}}</view>
|
||||
<view class="dt-item">{{remarkFormat(modelInfo) || '-'}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@ -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})
|
||||
|
||||
@ -39,12 +39,19 @@
|
||||
|
||||
<view class="com-section mt-30">路线信息</view>
|
||||
<view class="blcok-white" style="padding-top: 0;padding-bottom: 0;">
|
||||
<view class="yunf-input-item">
|
||||
<tpx-select v-model:value="submitParam.startSiteCode" v-model:text="submitParam.startSiteName" v-model:resObject="startSiteRes" :getListFun="listSimple" :transKeyVal="{valKey: 'siteCode',titleKey: 'siteName'}" :isWhite="true"
|
||||
:searchParam="productSearchParam" placeholder="请选择始发网点"
|
||||
>
|
||||
<tpx-text-item label="始发网点" :value="submitParam.startSiteName"></tpx-text-item>
|
||||
</tpx-select>
|
||||
</view>
|
||||
<view>
|
||||
<template v-if="submitParam.reciever.country && submitParam.sender.country">
|
||||
<view class="yunf-input-item">
|
||||
<tpx-select v-model:value="submitParam.transLine" v-model:text="submitParam.transLineTypeName" v-model:resObject="wayRes"
|
||||
:getListFun="getTransLineList" :transKeyVal="{valKey: 'lineCode',titleKey: 'lineName'}"
|
||||
:searchParam="waySearchParam" @onChange="handleWayChange" placeholder="请选择路线"
|
||||
:searchParam="waySearchParam" @onChange="handleWayChange" placeholder="请选择路线"
|
||||
>
|
||||
<tpx-text-item label="路线" :value="submitParam.transLineTypeName"></tpx-text-item>
|
||||
</tpx-select>
|
||||
@ -178,7 +185,20 @@
|
||||
<tpx-text-item label="派送方式" :value="submitParam.dispatchMethod" :list="dicData.emis_tab_dispatch_mode"></tpx-text-item>
|
||||
</tpx-select>
|
||||
</view>
|
||||
|
||||
<view class="yunf-input-item" v-if="['012','002','014','078'].includes(submitParam.transLine)">
|
||||
<tpx-text-item label="是否为虚拟单">
|
||||
<template v-slot:right>
|
||||
<u-switch v-model="submitParam.blVirtual" activeValue="1" inactiveValue="0" active-color="#B12D29" size="34" @change="handleVirtualChange"></u-switch>
|
||||
</template>
|
||||
</tpx-text-item>
|
||||
</view>
|
||||
<view class="yunf-input-item" v-if="submitParam.blVirtual==='1' && ['012','002','014','078'].includes(submitParam.transLine)">
|
||||
<tpx-select v-model:value="submitParam.masterBillCode" v-model:resObject="mastRes" :getListFun="getMasterEmisWaybills" :transKeyVal="{valKey: 'billCode',titleKey: 'billCode'}" :isWhite="true"
|
||||
:searchParam="masterBillSearchParam" placeholder="请选择关联主单" minChecked="0" @onChange="handleMasterSelectChange"
|
||||
>
|
||||
<tpx-text-item label="关联主单" :value="submitParam.masterBillCode"></tpx-text-item>
|
||||
</tpx-select>
|
||||
</view>
|
||||
<view class="yunf-input-item">
|
||||
<tpx-text-item label="生成子单">
|
||||
<template v-slot:right>
|
||||
@ -268,26 +288,25 @@
|
||||
</tpx-layout>
|
||||
|
||||
<buns-edit-sheet percentHeight="70" title="商品信息" v-model:show="goodChooseModal.show" v-model:value="submitParam" v-slot="tempObject" @onSure="handleGoodInfoSure">
|
||||
<view v-if="goodChooseModal.show">
|
||||
<view class="mt-30">
|
||||
<bpe-gooditem-edit-tmp ref="goodEditInfo" :value="tempObject.value"></bpe-gooditem-edit-tmp>
|
||||
</view>
|
||||
<view class="mt-30">
|
||||
<bpe-good-kuaidi-tmp :value="tempObject.value"></bpe-good-kuaidi-tmp>
|
||||
</view>
|
||||
|
||||
<view class="mt-30">
|
||||
<bpe-goodphoto-tmp :value="tempObject.value" filedName="goodsPics">
|
||||
<template v-slot:title>
|
||||
<text class="font-weight font-28">货物照片</text>
|
||||
</template>
|
||||
</bpe-goodphoto-tmp>
|
||||
</view>
|
||||
<view v-if="goodChooseModal.show">
|
||||
<view class="mt-30">
|
||||
<bpe-gooditem-edit-tmp ref="goodEditInfo" :value="tempObject.value"></bpe-gooditem-edit-tmp>
|
||||
</view>
|
||||
<view class="mt-30">
|
||||
<bpe-good-kuaidi-tmp :value="tempObject.value"></bpe-good-kuaidi-tmp>
|
||||
</view>
|
||||
|
||||
<view class="mt-30">
|
||||
<bpe-goodphoto-tmp :value="tempObject.value" filedName="goodsPics">
|
||||
<template v-slot:title>
|
||||
<text class="font-weight font-28">货物照片</text>
|
||||
</template>
|
||||
</bpe-goodphoto-tmp>
|
||||
</view>
|
||||
</view>
|
||||
</buns-edit-sheet>
|
||||
|
||||
<tpx-bluetooth-print-preview ref="curPrint"></tpx-bluetooth-print-preview>
|
||||
|
||||
</tpx-page>
|
||||
</template>
|
||||
|
||||
@ -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, '');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user