This commit is contained in:
aihe 2024-05-23 23:15:34 +08:00
parent 816146c3bd
commit 644a3f6d53
4 changed files with 90 additions and 81 deletions

View File

@ -41,7 +41,7 @@ export const getSalemanList = (data = {})=> {
// 报价试算 // 报价试算
export const preCalcWaybillFee = (data = {})=> { export const preCalcWaybillFee = (data = {})=> {
return coreRequest(url.preCalcWaybillFee, { ...data, postCode: 'RSD' }, {}, "GET") return coreRequest(url.preCalcWaybillFee, { ...data, postCode: 'RSD' }, {})
} }
// 物流轨迹 // 物流轨迹

View File

@ -54,7 +54,7 @@
return { return {
submitParams: { submitParams: {
username: '25001108', username: '25001108',
password: '123456' password: 'q123456'
}, },
remberPassport: [true] remberPassport: [true]
} }

View File

@ -6,32 +6,29 @@
<view class="blcok-white" style="padding-top: 0;padding-bottom: 0;"> <view class="blcok-white" style="padding-top: 0;padding-bottom: 0;">
<view> <view>
<view class="yunf-input-item"> <view class="yunf-input-item">
<tpx-select v-model:value="submitParam.sendSiteCode" v-model:text="submitParam.sendSiteName" v-model:resObject="sendPostRes" :getListFun="getSendPositionList" :transKeyVal="{valKey: 'destCode',titleKey: 'destName'}" :isWhite="true" <tpx-text-item label="始发网点">
:searchParam="sendPostParam" placeholder="请选择始发网点" <template v-slot:right>{{submitParam.sendSiteName}}</template>
> </tpx-text-item>
<tpx-text-item label="始发网点" :value="submitParam.sendSiteName"></tpx-text-item>
</tpx-select>
</view> </view>
<view class="yunf-input-item"> <view class="yunf-input-item">
<tpx-select v-model:value="submitParam.sendSiteCode" v-model:text="submitParam.sendSiteName" v-model:resObject="sendPostRes" :getListFun="getSendPositionList" :transKeyVal="{valKey: 'destCode',titleKey: 'destName'}" :isWhite="true" <tpx-select v-model:value="submitParam.reciever.country" v-model:resObject="countryRes" :getListFun="getEmisCountry" :transKeyVal="{valKey: 'code',titleKey: 'name'}" :isWhite="true"
:searchParam="sendPostParam" placeholder="请选择始目的国" v-model:text="submitParam.reciever.countryName" :searchParam="countrySearchParam" placeholder="请选择目的国" @onChange="handleCountryChange"
> >
<tpx-text-item label="目的国" :value="submitParam.sendSiteName"></tpx-text-item> <tpx-text-item label="目的国" :value="submitParam.reciever.countryName"></tpx-text-item>
</tpx-select> </tpx-select>
</view> </view>
<view class="yunf-input-item"> <view v-if="submitParam.reciever.country" class="yunf-input-item">
<tpx-select v-model:value="submitParam.sendSiteCode" v-model:text="submitParam.sendSiteName" v-model:resObject="sendPostRes" :getListFun="getSendPositionList" :transKeyVal="{valKey: 'destCode',titleKey: 'destName'}" :isWhite="true" <tpx-select v-model:value="submitParam.reciever.province" v-model:resObject="provRes" :getListFun="getEmisRegion" :transKeyVal="{valKey: 'regionCode',titleKey: 'regionName'}" :isWhite="true"
:searchParam="sendPostParam" placeholder="请选择省/州" v-model:text="submitParam.reciever.provinceName" :searchParam="provParam" placeholder="请选择省/州" @onChange="handlePrvChange"
> >
<tpx-text-item label="省/州" :value="submitParam.sendSiteName"></tpx-text-item> <tpx-text-item label="省/州" :value="submitParam.reciever.provinceName"></tpx-text-item>
</tpx-select> </tpx-select>
</view> </view>
<template v-if="submitParam.senderCountry"> <template v-if="submitParam.reciever.province">
<view class="yunf-input-item"> <view class="yunf-input-item">
<tpx-select v-model:value="submitParam.transLine" v-model:text="submitParam.transLineTypeName" v-model:resObject="wayRes" <tpx-select v-model:value="submitParam.transLine" v-model:text="submitParam.transLineTypeName" v-model:resObject="wayRes"
:getListFun="getTransLineList" :transKeyVal="{valKey: 'lineCode',titleKey: 'lineName'}" :getListFun="getTransLineList" :transKeyVal="{valKey: 'lineCode',titleKey: 'lineName'}"
@ -42,12 +39,10 @@
</view> </view>
</template> </template>
<view v-if="submitParam.transLine" class="yunf-input-item"> <view class="yunf-input-item">
<tpx-select v-model:value="submitParam.destinationCode" v-model:text="submitParam.destinationName" v-model:resObject="destPostRes" :getListFun="getDestPositionList" :transKeyVal="{valKey: 'destCode',titleKey: 'destName'}" :isWhite="true" <tpx-text-item label="目的网点">
:searchParam="destPostParam" @onChange="handleDestPostChange" placeholder="请选择目的网点" <template v-slot:right>{{submitParam.dispatchUnderlingSiteName}}</template>
> </tpx-text-item>
<tpx-text-item label="目的网点" :value="submitParam.destinationName"></tpx-text-item>
</tpx-select>
</view> </view>
<view class="yunf-input-item"> <view class="yunf-input-item">
@ -84,27 +79,29 @@
</view> </view>
</view> </view>
<template v-if="true"> <view v-if="proTypeList.length > 0">
<view class="com-section mt-30">产品类型TODO</view> <view class="com-section mt-30">产品类型</view>
<view class="blcok-white yunf-list" style="padding-bottom: 2rpx;"> <view class="blcok-white yunf-list" style="padding-bottom: 2rpx;">
<tpx-checkitems :list="proList" v-model:value="submitParam.prodId" v-slot="curPro" min-checked="1" type="single"> <tpx-checkitems :list="proTypeList" v-model:value="submitParam.productType" v-model:text="submitParam.productTypeName" v-slot="curPro" min-checked="1" type="single"
:transKeyVal="{valKey: 'productType', titleKey: 'productTypeName'}"
>
<view slot :class="`yunf-item ${curPro.checked?'active':''}`"> <view slot :class="`yunf-item ${curPro.checked?'active':''}`">
<u-row justify="between"> <u-row justify="between">
<u-col span="8"> <u-col span="8">
<u-text :text="`柬埔寨-国际特快`" size="28" :bold="true"></u-text> <u-text :text="curPro.item.productTypeName" size="28" :bold="true"></u-text>
<u-text margin="6rpx" text="1-2工作日 ¥80元起" size="26" color="#999"></u-text> <u-text margin="6rpx" :text="curPro.item.agingDesc" size="26" color="#999"></u-text>
</u-col> </u-col>
<u-col span="4"> <u-col span="4">
<u-text align="right" text="运费预估" size="26" color="#999"></u-text> <u-text align="right" text="运费预估" size="26" color="#999"></u-text>
<u-text align="right" margin="6rpx" text="32" size="26" :bold="true" mode="price" <u-text align="right" margin="6rpx" :text="curPro.item.estFee" size="26" :bold="true" mode="price"
color="#B12D29"></u-text> color="#B12D29"></u-text>
</u-col> </u-col>
</u-row> </u-row>
</view> </view>
</tpx-checkitems> </tpx-checkitems>
</view> </view>
</template> </view>
<u-row justify="center"> <u-row justify="center">
<view class="mt-40"> <view class="mt-40">
@ -115,7 +112,7 @@
</view> </view>
</template> </template>
<template v-if="hasCalcuPost" v-slot:footer> <template v-if="proTypeList.length > 0" v-slot:footer>
<view class="pos-rlt blcok-white" style="border-radius: 0;margin-top: 0;"> <view class="pos-rlt blcok-white" style="border-radius: 0;margin-top: 0;">
<u-row justify="between"> <u-row justify="between">
@ -125,7 +122,7 @@
<view class="mr-10"> <view class="mr-10">
<u-text text="预估" :bold="true" size="28"></u-text> <u-text text="预估" :bold="true" size="28"></u-text>
</view> </view>
<u-text :text="80" mode="price" color="#B12D29" :bold="true" size="28"></u-text> <u-text :text="checkedEstFee" mode="price" color="#B12D29" :bold="true" size="28"></u-text>
</u-row> </u-row>
<u-text margin="10rpx 0 0 0" text="温馨提示:具体费用以快递小哥核实为准" color="#999" size="26"></u-text> <u-text margin="10rpx 0 0 0" text="温馨提示:具体费用以快递小哥核实为准" color="#999" size="26"></u-text>
</view> </view>
@ -156,30 +153,30 @@
// } // }
}, },
computed: { computed: {
sendPostParam(){
return {}
},
waySearchParam() { waySearchParam() {
return { country: this.submitParam.reciever.country, fromCountry: this.submitParam.sender.country } return { country: this.submitParam.reciever.country, fromCountry: '' }
}, },
productSearchParam() { countrySearchParam() {
return { transLineCode: this.submitParam.transLine } return { transLineCode: this.submitParam.transLine }
}, },
destPostParam(){ provParam(){
const { country } = this.submitParam.reciever const { country } = this.submitParam.reciever
return { lineCode: this.submitParam.transLine, countryCode: country } return { countryCode: country, regionType: 1 }
}, },
dicData() { dicData() {
return this.$store.getters.dicData return this.$store.getters.dicData
}, },
checkedEstFee() {
let item = this.proTypeList.filter(t=> t.val == this.submitParam.productType)[0] || {}
return item.estFee
},
}, },
data() { data() {
return this.getDefaultData() return this.getDefaultData()
}, },
onShareAppMessage() { onShareAppMessage() {
return { return {
// title: '',
// path: 'TODO'
} }
}, },
onLoad(option) { onLoad(option) {
@ -192,31 +189,36 @@
}, },
methods: { methods: {
getDefaultData() { // data的默认数据 getDefaultData() { // data的默认数据
let { ownerSiteCode, ownerSiteName } = this.$store.getters.userInfo
return { return {
pageLoading: true, pageLoading: true,
queryOption: { queryOption: {
}, },
sendPostRes: { list: [] }, proTypeList: [],
countryRes: { list: [] },
provRes: { list: [] },
wayRes: { list: [] }, wayRes: { list: [] },
productRes: { list: [] },
destPostRes: { list: [] },
submitParam: { submitParam: {
reciever: {
country: '',
province: ''
},
transLine: "", // 线路编码 transLine: "", // 线路编码
productType: "", // 产品类型code
calcFeeType: "", // 计费类型 1-重量计费 2-体积计费 calcFeeType: "", // 计费类型 1-重量计费 2-体积计费
billWeight: "", // 实际重量 billWeight: "", // 实际重量
totalVolume: "", // 总体积 totalVolume: "", // 总体积
dispatchUnderlingSiteCode: "", // 目的地站点 dispatchUnderlingSiteCode: "", // 目的地站点
customsClear: "", // 清关方式 customsClear: "", // 清关方式
customsEclaration:"", // 清关方式 customsEclaration:"", // 清关方式
sendSiteCode: this.$store.getters.userInfo.ownerSiteCode, // 发件站点 sendSiteCode: ownerSiteCode, // 发件站点
sendSiteName: ownerSiteName, // 发件站点名称
} }
} }
}, },
getSendPositionList: apiService.getDestPositionList, getEmisCountry: apiService.getEmisCountry,
getTransLineList: apiService.getTransLineList, getTransLineList: apiService.getTransLineList,
getTransProductList: apiService.getTransProductList, getEmisRegion: apiService.getEmisRegion,
getRSDStaffList: apiService.getRSDStaffList,
getDestPositionList: apiService.getDestPositionList,
async initData() { // 初始化 async initData() { // 初始化
this.pageLoading = false this.pageLoading = false
}, },
@ -224,52 +226,50 @@
initEvent() { initEvent() {
}, },
handleCountryChange(val) {
handleAddressChange() { // 地址切换 this.submitParam.reciever.province = ''
let { wayRes, submitParam } = this.getDefaultData() this.submitParam.reciever.provinceName = ''
if(this.submitParam.reciever.country && this.submitParam.sender.country) { this.handlePrvChange()
this.submitParam.transLine = submitParam.transLine },
this.submitParam.transLineTypeName = submitParam.transLineTypeName handlePrvChange(val){
this.handleWayChange() // 调用线路切换,清空后续数据 this.submitParam.transLine = ''
} this.submitParam.transLineTypeName = ''
this.handleWayChange() // 调用线路切换,清空后续数据
}, },
handleWayChange(val) { // 线路切换 handleWayChange(val) { // 线路切换
let { productRes, submitParam } = this.getDefaultData()
// 清空产品类型数据
this.submitParam.productType = submitParam.productType
this.submitParam.productTypeName = submitParam.productTypeName
const item = this.wayRes.list.filter(t=> t.val == val)[0] const item = this.wayRes.list.filter(t=> t.val == val)[0]
this.updateDltDestSite({ lineCode: val }) if(val) {
}, this.updateDltDestSite({ lineCode: val })
handleDestPostChange(val) { } else {
const item = this.destPostRes.list.filter(t=> t.val == val)[0] this.submitParam.dispatchUnderlingSiteCode = ''
this.submitParam.dispatchUnderlingSiteCode = item.siteCode; this.submitParam.dispatchUnderlingSiteName = ''
this.submitParam.dispatchUnderlingSiteName = item.siteName; }
}, },
handleDialogClick(curModal){ handleDialogClick(curModal){
curModal.show = true curModal.show = true
}, },
async updateDltDestSite({ lineCode }) { async updateDltDestSite({ lineCode }) {
const { country, province, city, county, address } = this.submitParam.reciever const { country, province } = this.submitParam.reciever
let res = await apiService.getCaculteDestSite({ lineCode, country, province, city, county, address }) let res = await apiService.getCaculteDestSite({ lineCode, country, province })
// 更新路线推荐的默认目的地 // 更新路线推荐的默认目的地
let data = res.data || {} let data = res.data || {}
this.submitParam.destinationCode = data.destCode
this.submitParam.destinationName = data.destName
this.submitParam.dispatchUnderlingSiteCode = data.siteCode; this.submitParam.dispatchUnderlingSiteCode = data.siteCode;
this.submitParam.dispatchUnderlingSiteName = data.siteName; this.submitParam.dispatchUnderlingSiteName = data.siteName;
}, },
async handleGoodInfoSure() {
// 校验各个组件的参数
let res = await this.$refs.goodSize.validData()
},
async handleCalPost(type) { async handleCalPost(type) {
let params = JSON.parse(JSON.stringify(this.submitParam)); let params = JSON.parse(JSON.stringify(this.submitParam));
params.goodsPics = params.goodsPics.join(",") params.calcFeeType = 1 // "计费类型 1-重量计费 2-体积计费"
await saveServerHand(params) let res = await apiService.preCalcWaybillFee({ ...params, _loading: true })
this.showToast('操作成功') this.proTypeList = res.data || []
// TOTO if(this.proTypeList.length > 0) {
debugger this.showToast('试算成功')
} else {
this.showToast('未匹配到产品信息,请切换条件重新试算')
}
},
handleGoXiaDan() {
this.goto(`post/openorder?defaultSubParams=${encodeURIComponent(JSON.stringify(this.submitParam))}`)
} }
} }
} }

View File

@ -337,6 +337,7 @@
pageLoading: true, pageLoading: true,
isEdit: false, isEdit: false,
queryOption: { queryOption: {
defaultSubParams: '', // 提交默认参数
billCode: '', // 运单id billCode: '', // 运单id
orderSn: '', // 订单id orderSn: '', // 订单id
}, },
@ -371,6 +372,14 @@
getSalemanList: apiService.getSalemanList, getSalemanList: apiService.getSalemanList,
async initData() { // 初始化 async initData() { // 初始化
this.isEdit = Boolean(this.queryOption.billCode || this.queryOption.orderSn) this.isEdit = Boolean(this.queryOption.billCode || this.queryOption.orderSn)
if(this.queryOption.defaultSubParams) {
try{
this.queryOption.defaultSubParams = JSON.parse(decodeURIComponent(this.queryOption.defaultSubParams))
Object.assign(this.submitParam, this.queryOption.defaultSubParams)
}catch(e){
console.error("queryOption.defaultSubParams=====转换失败===", this.queryOption.defaultSubParams)
}
}
if(this.isEdit) { if(this.isEdit) {
let res = await apiService.getOrderDetail({...this.queryOption, _loading: true}) let res = await apiService.getOrderDetail({...this.queryOption, _loading: true})
let data = res.data || {} let data = res.data || {}