This commit is contained in:
aihe 2024-07-17 00:59:38 +08:00
parent ee81d7f6c0
commit 95a494e044
3 changed files with 134 additions and 109 deletions

View File

@ -1,5 +1,5 @@
<template>
<u-row align="top">
<u-row v-if="showPrivacy" align="top">
<u-checkbox-group placement="column" @change="handleAgree()">
<u-checkbox size="26" labelSize="26" :checked="modelInfo._agreePrivateRule" label="我已同意接受"
label-color=":#999" activeColor="#B12D29"
@ -9,6 +9,7 @@
<u-text text="《快件运单契约条款》" size="26"></u-text>
</view>
</u-row>
<view @click="handleAgree()">
<u-row>
<view class="mr-10">
@ -38,7 +39,12 @@
default () {
return { }
}
}
},
showPrivacy: {
default () {
return true
}
},
},
data() {
return {

View File

@ -47,6 +47,11 @@
searchParam: {
handler(newVal, oldVal){
let vals = Object.values(newVal)
this.proTypeList = []
this.modelInfo.freight = 0
this.modelInfo.productType = ''
this.modelInfo.productTypeName = ''
if(this.autoCalc) {
// 所有关联入参都有值再 执行自动计算,数据未变化不做计算
if(vals.length == vals.filter(v => !!v).length) {
@ -88,7 +93,7 @@
methods: {
async calcTypeFee(params = {}){
let res = await apiService.preCalcWaybillFee({ custNo: this.modelInfo.custNo, ...params })
let res = await apiService.preCalcWaybillFee({ ...this.searchParam, custNo: this.modelInfo.custNo, ...params, _loading: true })
this.proTypeList = res.data || []
},
handleChooseItem(val, text, checkedList){

View File

@ -9,71 +9,57 @@
<bpe-addressinfo-tmp v-model:value="submitParam" @onChange="handleAddressChange"></bpe-addressinfo-tmp>
</view>
<view class="com-section mt-30">路线信息</view>
<view class="blcok-white" style="padding-top: 0;padding-bottom: 0;">
<view>
<view @click="handleDialogClick(countryModal)" class="pt-30 pb-30" style="border-bottom: 2rpx solid #F6F6F6;" >
<u-row>
<view>
<u-text text="目的国" size="28" :bold="true"></u-text>
</view>
<u-row custom-style="flex: 1;" justify="end" align="center">
<u-text align="right" margin="0 12rpx 0 0" size="26" text="柬埔寨"></u-text>
<u-icon size="26" name="arrow-right" color="#333"></u-icon>
</u-row>
</u-row>
<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="请选择路线"
>
<tpx-text-item label="路线" :value="submitParam.transLineTypeName"></tpx-text-item>
</tpx-select>
</view>
<view @click="handleDialogClick(wayModal)" class="pt-30 pb-30" style="border-bottom: 2rpx solid #F6F6F6;;">
<u-row>
<view>
<u-text text="选择线路" size="28" :bold="true"></u-text>
</view>
<u-row custom-style="flex: 1;" justify="end" align="center">
<u-text align="right" margin="0 12rpx 0 0" size="26" color="#999"
text="请选择"></u-text>
<u-icon size="26" name="arrow-right" color="#333"></u-icon>
</u-row>
</u-row>
</view>
<view @click="handleDialogClick(goodChooseModal)" class="pt-30 pb-30" style="border-bottom: 2rpx solid #F6F6F6;;"
v-if="submitParam.type != sendTypeEnum.container"
</template>
<view class="yunf-input-item">
<tpx-select v-model:value="submitParam.customsEclaration" :list="dicData.emis_declare_mode"
mode="drop"
>
<u-row>
<view>
<u-text text="重量/体积" size="28" :bold="true"></u-text>
</view>
<u-row custom-style="flex: 1;" justify="end" align="center">
<u-text align="right" margin="0 12rpx 0 0" size="26" color="#999"
text="填写重量体积"></u-text>
<u-icon size="26" name="arrow-right" color="#333"></u-icon>
</u-row>
</u-row>
</view>
<tpx-text-item label="报关方式" :value="submitParam.customsEclaration" :list="dicData.emis_declare_mode"></tpx-text-item>
</tpx-select>
</view>
<view class="yunf-input-item">
<tpx-select v-model:value="submitParam.customsClear" :list="dicData.emis_customs_clear"
mode="drop"
>
<tpx-text-item label="清关方式" :value="submitParam.customsClear" :list="dicData.emis_customs_clear"></tpx-text-item>
</tpx-select>
</view>
<view class="yunf-input-item">
<u-row justify="between">
<text class="font-28 font-weight">包裹重量</text>
<view>
<tpx-input v-model:value="submitParam.billWeight" placeholder="" inputAlign="right" suffix="kg" _digit="5"></tpx-input>
</view>
</u-row>
</view>
<view class="yunf-input-item">
<u-row justify="between" align="top">
<text class="font-28 pt-20 font-weight">总体积</text>
<view>
<tpx-input v-model:value="submitParam.totalVolume" placeholder="" inputAlign="right" suffix="m³" _digit="5"></tpx-input>
</view>
</u-row>
</view>
</view>
<view class="com-section mt-30">产品类型</view>
<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">
<view slot :class="`yunf-item ${curPro.checked?'active':''}`">
<u-row justify="between">
<u-col span="8">
<u-text :text="`柬埔寨-国际特快`" size="28" :bold="true"></u-text>
<u-text margin="6rpx" text="1-2工作日 ¥80元起" size="26" color="#999"></u-text>
</u-col>
<u-col span="4">
<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"
color="#B12D29"></u-text>
</u-col>
</u-row>
</view>
</tpx-checkitems>
<bpe-choosetypelist-tmp ref="caleRef" v-model:value="submitParam" :autoCalc="false"></bpe-choosetypelist-tmp>
</view>
<u-row justify="center">
@ -85,67 +71,54 @@
</view>
</template>
<template v-if="hasCalcuPost" v-slot:footer>
<template v-if="submitParam.freight" v-slot:footer>
<view class="pos-rlt blcok-white" style="border-radius: 0;margin-top: 0;">
<u-row justify="between">
<view>
<view >
<u-row>
<view class="mr-10">
<u-text text="预估" :bold="true" size="28"></u-text>
</view>
<u-text :text="80" mode="price" color="#B12D29" :bold="true" size="28"></u-text>
</u-row>
<u-text margin="10rpx 0 0 0" text="温馨提示:具体费用以快递小哥核实为准" color="#999" size="26"></u-text>
</view>
<view style="flex:1;">
<bpe-checkagree-tmp v-model:value="submitParam" :showPrivacy="false"></bpe-checkagree-tmp>
</view>
<view>
<u-row>
<u-button @click="handleToXiaDan" size="large" shape="circle"
custom-style="width: 200rpx;height:80rpx;font-size: 30rpx;" type="primary">下单</u-button>
</u-row>
</view>
<u-row>
<u-button @click="handleGoXiaDan" size="large" shape="circle"
custom-style="width: 200rpx;height:80rpx;font-size: 30rpx;" type="primary">下单</u-button>
</u-row>
</u-row>
</view>
</template>
</tpx-layout>
<buns-country-sheet v-model:show="countryModal.show" v-model:value="submitParam.countryId"></buns-country-sheet>
<buns-way-sheet v-model:show="wayModal.show" v-model:value="submitParam.wayId"></buns-way-sheet>
<buns-goodsize-sheet v-model:show="goodChooseModal.show" v-model:value="submitParam.goods"></buns-goodsize-sheet>
</tpx-page>
</template>
<script>
import BpeAddressinfoTmp from "@/components/buns-post-edit-templates/bpe-addressinfo-tmp"
import BpeCheckagreeTmp from "@/components/buns-post-edit-templates/bpe-checkagree-tmp"
import BpeChoosetypelistTmp from "@/components/buns-post-edit-templates/bpe-choosetypelist-tmp"
import * as apiService from "@/common/api"
export default {
components: { BpeAddressinfoTmp },
components: { BpeAddressinfoTmp, BpeCheckagreeTmp, BpeChoosetypelistTmp },
props: {
// hasLeftWin: {
// type: Boolean
// }
},
computed: {
dicData() {
return this.$store.getters.dicData
},
waySearchParam() {
return { country: this.submitParam.reciever.country, fromCountry: this.submitParam.sender.country }
},
},
data() {
return {
proList: [
],
hasCalcuPost: false,
countryModal: {
show: false
},
wayModal: {
show: false,
},
goodChooseModal:{
show: false
},
submitParam: {
}
...this.getDefaultData(),
}
},
onShareAppMessage() {
@ -159,16 +132,63 @@
},
methods: {
getTransLineList: apiService.getTransLineList,
initData() {
},
getDefaultData(){
return {
submitParam: {
reciever: {},
sender: {}
},
wayRes: { list: [] },
}
},
handleDialogClick(curModal){
curModal.show = true
},
handleCalPost() {
this.hasCalcuPost = true
async handleCalPost() {
this.submitParam.freight = 0
await this.$refs.caleRef.calcTypeFee()
},
handleAddressChange() { // 地址切换
let { wayRes, submitParam } = this.getDefaultData()
if(this.submitParam.reciever.country && this.submitParam.sender.country) {
this.submitParam.transLine = submitParam.transLine
this.submitParam.transLineTypeName = submitParam.transLineTypeName
this.handleWayChange() // 调用线路切换,清空后续数据
}
},
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]
this.updateDltDestSite({ lineCode: val })
this.updateDltSendSite({ lineCode: val })
},
async updateDltDestSite({ lineCode }) {
const { country, province, city, county, address } = this.submitParam.reciever
let res = await apiService.getCaculteDestSite({ lineCode, country, province, city, county, address })
// 更新路线推荐的默认目的地
let data = res.data || {}
this.submitParam.destinationCode = data.destCode
this.submitParam.destinationName = data.destName
this.submitParam.dispatchUnderlingSiteCode = data.siteCode;
this.submitParam.dispatchUnderlingSiteName = data.siteName;
},
async updateDltSendSite({ lineCode }) {
const { country, province, city, county, address } = this.submitParam.sender
let sendRes = await apiService.getCaculteSendSite({ lineCode, country, province, city, county, address })
let data = sendRes.data || {}
this.submitParam.sendSiteCode = data.siteCode
this.submitParam.sendSiteName = data.siteName
},
handleToXiaDan(){
let cpData = JSON.parse(JSON.stringify(this.submitParam))
this.goto(`post/post?defaultSubParams=${encodeURIComponent(JSON.stringify(cpData))}&type=create`)
}
}
}
</script>
@ -182,14 +202,8 @@
}
</style>
<style scoped lang="scss">
.yunf-item {
margin-bottom: 20rpx;
padding: 30rpx;
background: #F6F6F6;
border-radius: 20rpx;
border: 2rpx solid transparent;
&.active {
border-color: $uni-color-primary;
}
.yunf-input-item{
padding: 26rpx 0;
border-bottom: 2rpx solid #F6F6F6;
}
</style>