579 lines
23 KiB
Vue
579 lines
23 KiB
Vue
<template>
|
|
<tpx-page>
|
|
<tpx-layout>
|
|
<template v-slot:body>
|
|
<view class="com-jianju pos-rlt pb-30" style="padding-top: 2rpx;">
|
|
<view class="blcok-white">
|
|
<u-row justify="between">
|
|
<view style="width: 130rpx;">运单号</view>
|
|
<view style="flex:1;">
|
|
<tpx-scan-input v-model:value="submitParam.billCode"
|
|
@scanChange="handleScanChange" :showConfirm="!showCreateBNoBtn" @confirmClick="handleScanChange"></tpx-scan-input>
|
|
</view>
|
|
<view class="pl-10" v-if="showCreateBNoBtn">
|
|
<u-button @click="handleCreateOrderNo()"
|
|
custom-style="font-size: 28rpx;padding:0 10rpx;height: 74rpx;" :plain="true" >系统生成</u-button>
|
|
</view>
|
|
|
|
</u-row>
|
|
<!-- <u-row justify="between" custom-style="margin-top:20rpx;">
|
|
<view style="width: 130rpx;">客户</view>
|
|
<view style="flex:1;">
|
|
<tpx-select v-model:resObject="kehuRes" v-model:text="submitParam.customerName" :getListFun="getCustomerUserList" :transKeyVal="{valKey: 'monthlyPayCode',titleKey: 'company'}" v-model:value="submitParam.customerCode" :isWhite="true" placeholder="请选择客户"></tpx-select>
|
|
</view>
|
|
</u-row> -->
|
|
</view>
|
|
|
|
<view v-if="!pageLoading">
|
|
<view v-if="submitParam.orderSn" class="com-section mt-30" @click="goto(`post/detail?billCode=${submitParam.billCode}&orderSn=${submitParam.orderSn}`)">
|
|
<u-row justify="space-between">
|
|
<text>订单号:{{submitParam.orderSn}}</text>
|
|
<u-icon name="bag" size="42"></u-icon>
|
|
</u-row>
|
|
</view>
|
|
|
|
<view class="blcok-white">
|
|
<!-- 地址选择 -->
|
|
<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>
|
|
<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>
|
|
</template>
|
|
|
|
<template v-if="submitParam.transLine">
|
|
<view class="yunf-input-item">
|
|
<tpx-select v-model:value="submitParam.productType" v-model:text="submitParam.productTypeName" v-model:resObject="productRes" :getListFun="getTransProductList" :transKeyVal="{valKey: 'prodCode',titleKey: 'prodName'}" :isWhite="true"
|
|
:searchParam="productSearchParam" placeholder="请选择产品类型"
|
|
>
|
|
<tpx-text-item label="产品类型" :value="submitParam.productTypeName"></tpx-text-item>
|
|
</tpx-select>
|
|
</view>
|
|
</template>
|
|
|
|
<view class="yunf-input-item">
|
|
<tpx-select v-model:value="submitParam.customsEclaration" :list="dicData.emis_declare_mode"
|
|
mode="drop"
|
|
>
|
|
<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">
|
|
<tpx-select v-model:value="submitParam.pickupMethod" :list="dicData.emis_qujian_fangshi"
|
|
mode="drop"
|
|
>
|
|
<tpx-text-item label="取件方式" :value="submitParam.pickupMethod" :list="dicData.emis_qujian_fangshi"></tpx-text-item>
|
|
</tpx-select>
|
|
</view>
|
|
|
|
<view v-show="submitParam.pickupMethod == 1" class="yunf-input-item">
|
|
<tpx-select v-model:value="submitParam.operateEmployeeCode" v-model:resObject="caozuoRes" v-model:text="submitParam.operateEmployeeName" :getListFun="getOpStaffList" :transKeyVal="{valKey: 'empCode',titleKey: 'empName'}" placeholder="请选择操作员">
|
|
<tpx-text-item label="操作员" :value="submitParam.operateEmployeeName"></tpx-text-item>
|
|
</tpx-select>
|
|
</view>
|
|
|
|
<view v-show="submitParam.pickupMethod == 2" class="yunf-input-item">
|
|
<tpx-select v-model:value="submitParam.takePieceEmployeeCode" v-model:resObject="shoupaiRes" v-model:text="submitParam.takePieceEmployeeName" :getListFun="getRSDStaffList" :transKeyVal="{valKey: 'empCode',titleKey: 'empName'}" placeholder="请选择收派员">
|
|
<tpx-text-item label="收派员" :value="submitParam.takePieceEmployeeName"></tpx-text-item>
|
|
</tpx-select>
|
|
</view>
|
|
|
|
<view class="yunf-input-item">
|
|
<tpx-select v-model:value="submitParam.paymentType" :list="dicData.emis_payment_type"
|
|
mode="drop"
|
|
>
|
|
<tpx-text-item label="付款方式" :value="submitParam.paymentType" :list="dicData.emis_payment_type"></tpx-text-item>
|
|
</tpx-select>
|
|
</view>
|
|
<template v-if="isShowYueJie">
|
|
<view class="yunf-input-item">
|
|
<tpx-select v-model:value="submitParam.custNo" v-model:text="submitParam.customerName" v-model:resObject="yuejieRes" :getListFun="getMonthpayAccountList" :transKeyVal="{valKey: 'custNo',titleKey: 'custName'}"
|
|
@onChange="handleYueJieSelect" placeholder="请选择月结账户"
|
|
>
|
|
<tpx-text-item label="月结账户" :value="submitParam.customerName"></tpx-text-item>
|
|
</tpx-select>
|
|
</view>
|
|
<template v-if="submitParam.custNo">
|
|
<view class="yunf-input-item">
|
|
<tpx-text-item label="月结编号">
|
|
<template v-slot:right>{{submitParam.custNo}}</template>
|
|
</tpx-text-item>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
|
|
<template v-if="submitParam.paymentType">
|
|
<view class="yunf-input-item">
|
|
<tpx-select v-model:value="submitParam.salesmen" v-model:text="submitParam.salesmen" v-model:resObject="salemanRes" :getListFun="getSalemanList" :transKeyVal="{valKey: 'empName',titleKey: 'empName'}"
|
|
placeholder="请选择销售联系人" :disabled="isShowYueJie"
|
|
>
|
|
<tpx-text-item label="销售联系人">
|
|
<template v-slot:right>
|
|
{{submitParam.salesmen || (isShowYueJie ? '': '请选择')}}
|
|
<u-icon v-if="!isShowYueJie" size="26" name="arrow-right" color="#333"></u-icon>
|
|
</template>
|
|
</tpx-text-item>
|
|
</tpx-select>
|
|
</view>
|
|
|
|
<view class="yunf-input-item">
|
|
<tpx-select v-model:value="submitParam.payee" v-model:text="submitParam.payee" v-model:resObject="paybeeRes" :getListFun="getPayeeList" :transKeyVal="{valKey: 'empName',titleKey: 'empName'}"
|
|
placeholder="请选择回款联系人" :disabled="isShowYueJie"
|
|
>
|
|
<tpx-text-item label="回款联系人">
|
|
<template v-slot:right>
|
|
{{submitParam.payee || (isShowYueJie ? '': '请选择')}}
|
|
<u-icon v-if="!isShowYueJie" size="26" name="arrow-right" color="#333"></u-icon>
|
|
</template>
|
|
</tpx-text-item>
|
|
</tpx-select>
|
|
</view>
|
|
</template>
|
|
|
|
<view v-if="submitParam.transLine" 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"
|
|
:searchParam="destPostParam" @onChange="handleDestPostChange" placeholder="请选择目的地"
|
|
>
|
|
<tpx-text-item label="目的地" :value="submitParam.destinationName"></tpx-text-item>
|
|
</tpx-select>
|
|
</view>
|
|
|
|
<view v-if="submitParam.destinationCode" class="yunf-input-item">
|
|
<tpx-text-item label="目的网点">
|
|
<template v-slot:right>{{submitParam.dispatchUnderlingSiteName}}</template>
|
|
</tpx-text-item>
|
|
</view>
|
|
|
|
<view class="yunf-input-item">
|
|
<tpx-select v-model:value="submitParam.warehouseInNo" v-model:resObject="wareRes" :getListFun="getWarehouseInList" :transKeyVal="{valKey: 'inNo',titleKey: 'inNo'}" :isWhite="true"
|
|
searchParam="" type="multiple" placeholder="请选择进仓单" minChecked="0"
|
|
>
|
|
<tpx-text-item label="进仓单" :value="submitParam.warehouseInNo"></tpx-text-item>
|
|
</tpx-select>
|
|
</view>
|
|
|
|
<view class="yunf-input-item">
|
|
<tpx-select v-model:value="submitParam.dispatchMethod" :list="dicData.emis_tab_dispatch_mode"
|
|
mode="drop"
|
|
>
|
|
<tpx-text-item label="派送方式" :value="submitParam.dispatchMethod" :list="dicData.emis_tab_dispatch_mode"></tpx-text-item>
|
|
</tpx-select>
|
|
</view>
|
|
|
|
<view class="yunf-input-item">
|
|
<tpx-text-item label="生成子单">
|
|
<template v-slot:right>
|
|
<u-switch v-model="submitParam.blGenSubbill" activeValue="1" inactiveValue="0" active-color="#B12D29" size="34"></u-switch>
|
|
</template>
|
|
</tpx-text-item>
|
|
</view>
|
|
|
|
<view class="yunf-input-item">
|
|
<tpx-text-item label="合同号">
|
|
<template v-slot:right>
|
|
<tpx-input v-model:value="submitParam.custOrderId" inputAlign="right"></tpx-input>
|
|
</template>
|
|
</tpx-text-item>
|
|
</view>
|
|
|
|
<view class="yunf-input-item">
|
|
<tpx-text-item label="寄件短信">
|
|
<template v-slot:right>
|
|
<text class="pr-20 clr-sub">是否短信</text>
|
|
<u-switch v-model="submitParam.blMessage" activeValue="1" inactiveValue="0" active-color="#B12D29" size="34"></u-switch>
|
|
</template>
|
|
</tpx-text-item>
|
|
</view>
|
|
|
|
<view class="yunf-input-item">
|
|
<tpx-text-item label="收件短信">
|
|
<template v-slot:right>
|
|
<text class="pr-20 clr-sub">是否短信</text>
|
|
<u-switch v-model="submitParam.blAcceptMessage" activeValue="1" inactiveValue="0" active-color="#B12D29" size="34"></u-switch>
|
|
</template>
|
|
</tpx-text-item>
|
|
</view>
|
|
|
|
</view>
|
|
</view>
|
|
|
|
<view class="com-section mt-30" @click="handleDialogClick(goodChooseModal)">
|
|
<u-row justify="space-between">
|
|
<text>发货信息(进仓情况)</text>
|
|
<u-icon name="edit-pen" size="42"></u-icon>
|
|
</u-row>
|
|
</view>
|
|
<view class="blcok-white">
|
|
<bpe-goodstatic-tmp v-model:value="submitParam"></bpe-goodstatic-tmp>
|
|
</view>
|
|
|
|
<view>
|
|
<view class="com-section mt-30">
|
|
<u-row justify="space-between">
|
|
<text>计费信息</text>
|
|
</u-row>
|
|
</view>
|
|
<view class="blcok-white">
|
|
<bpe-cost-tmp v-model:value="submitParam" ref="bCostRef"></bpe-cost-tmp>
|
|
</view>
|
|
</view>
|
|
|
|
<view class="com-section mt-30">
|
|
<u-row justify="space-between">
|
|
<text>备注</text>
|
|
</u-row>
|
|
</view>
|
|
<view class="blcok-white">
|
|
<u-textarea v-model="submitParam.remark" border="surround" height="120" placeholder="备注"
|
|
maxlength="300" count></u-textarea>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
<template v-slot:footer>
|
|
<view class="pos-rlt blcok-white" style="border-radius: 0;margin-top: 0;">
|
|
<view v-if="submitParam.lockFlag == 'T'">
|
|
<view class="clr-prm font-weight font-30" style="padding: 20rpx 0;">{{submitParam.lockReason}}</view>
|
|
</view>
|
|
<view v-else>
|
|
<u-row v-if="!pageLoading">
|
|
<u-button @click="handleSave()" size="large" shape="circle"
|
|
custom-style="width: 260rpx;height:80rpx;font-size: 30rpx;" :plain="true" type="primary">保存</u-button>
|
|
|
|
<u-button @click="handleSave('print')" size="large" shape="circle"
|
|
custom-style="width: 400rpx;height:80rpx;font-size: 30rpx;" type="primary" >确认并打印</u-button>
|
|
</u-row>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</tpx-layout>
|
|
|
|
<buns-edit-sheet percentHeight="70" title="商品信息" v-model:show="goodChooseModal.show" v-model:value="submitParam" v-slot="tempObject" @onSure="handleGoodInfoSure">
|
|
<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>
|
|
|
|
</buns-edit-sheet>
|
|
|
|
<tpx-bluetooth-print-preview ref="curPrint"></tpx-bluetooth-print-preview>
|
|
|
|
</tpx-page>
|
|
</template>
|
|
|
|
<script>
|
|
|
|
import BpeAddressinfoTmp from "@/components/buns-post-edit-templates/bpe-addressinfo-tmp"
|
|
import BpeGoodstaticTmp from "@/components/buns-post-edit-templates/bpe-goodstatic-tmp"
|
|
import BpeCostTmp from "@/components/buns-post-edit-templates/bpe-cost-tmp"
|
|
import BpeGooditemEditTmp from "@/components/buns-post-edit-templates/bpe-gooditem-edit-tmp"
|
|
import BpeGoodphotoTmp from "@/components/buns-post-edit-templates/bpe-goodphoto-tmp"
|
|
import BpeGoodKuaidiTmp from "@/components/buns-post-edit-templates/bpe-good-kuaidi-tmp"
|
|
import TpxBluetoothPrintPreview from "@/components/tpx-bluetooth-print/tpx-bluetooth-print-preview"
|
|
import { debounce } from "@/common/util"
|
|
import * as apiService from "@/common/api"
|
|
import { getBillPrintData } from "@/pages/print/printData"
|
|
import { getOrderModels } from "./model"
|
|
const pageTypeEnum = {
|
|
create: 'create',
|
|
edit: 'edit'
|
|
}
|
|
|
|
export default {
|
|
components: { BpeAddressinfoTmp, BpeGoodstaticTmp, BpeCostTmp, BpeGooditemEditTmp, BpeGoodphotoTmp, BpeGoodKuaidiTmp, TpxBluetoothPrintPreview },
|
|
props: {
|
|
// hasLeftWin: {
|
|
// type: Boolean
|
|
// }
|
|
},
|
|
computed: {
|
|
waySearchParam() {
|
|
return { country: this.submitParam.reciever.country, fromCountry: this.submitParam.sender.country }
|
|
},
|
|
productSearchParam() {
|
|
return { transLineCode: this.submitParam.transLine }
|
|
},
|
|
destPostParam(){
|
|
const { country } = this.submitParam.reciever
|
|
return { lineCode: this.submitParam.transLine, countryCode: country }
|
|
},
|
|
dicData() {
|
|
return this.$store.getters.dicData
|
|
},
|
|
isShowYueJie(){
|
|
let { submitParam } = this
|
|
return submitParam.paymentType == 2 || submitParam.paymentType == 4 || submitParam.paymentType == 5
|
|
},
|
|
showCreateBNoBtn(){
|
|
return this.queryOption.type == this.pageTypeEnum.create || this.queryOption.copyBillCode
|
|
}
|
|
},
|
|
data() {
|
|
return this.getDefaultData()
|
|
},
|
|
onShareAppMessage() {
|
|
return {
|
|
// title: '',
|
|
// path: 'TODO'
|
|
}
|
|
},
|
|
onLoad(option) {
|
|
this.queryOption = option
|
|
this.initData();
|
|
this.initEvent()
|
|
},
|
|
unmounted() {
|
|
|
|
},
|
|
methods: {
|
|
getDefaultData() { // data的默认数据
|
|
return {
|
|
pageTypeEnum,
|
|
pageTypeMap: {
|
|
[pageTypeEnum.create]: { title: '开单', savedConfirmTitle: '是否操作下一单' },
|
|
[pageTypeEnum.edit]: { title: '运单修改', savedConfirmTitle: '是否操作下一单' }
|
|
},
|
|
curPageType: {},
|
|
pageLoading: true,
|
|
isEdit: false,
|
|
queryOption: {
|
|
type: '', // edit: 运单修改, create: 下单,
|
|
defaultSubParams: '', // 提交默认参数
|
|
billCode: '', // 运单id
|
|
orderSn: '', // 订单id
|
|
copyBillCode: '', // 复制的运单id
|
|
},
|
|
kehuRes: { list: [] },
|
|
wayRes: { list: [] },
|
|
productRes: { list: [] },
|
|
caozuoRes: { list: [] },
|
|
shoupaiRes: { list: [] },
|
|
yuejieRes: { list: [] },
|
|
destPostRes: { list: [] },
|
|
wareRes: { list: [] },
|
|
paybeeRes: { list: [] },
|
|
salemanRes: { list: [] },
|
|
goodChooseModal: {
|
|
show: false,
|
|
},
|
|
submitParam: {
|
|
...getOrderModels(),
|
|
sendSiteCode: this.$store.getters.userInfo.ownerSiteCode,
|
|
}
|
|
}
|
|
},
|
|
getCustomerUserList: apiService.getCustomerUserList,
|
|
getTransLineList: apiService.getTransLineList,
|
|
getTransProductList: apiService.getTransProductList,
|
|
getOpStaffList: apiService.getOpStaffList,
|
|
getRSDStaffList: apiService.getRSDStaffList,
|
|
getMonthpayAccountList: apiService.getMonthpayAccountList,
|
|
getDestPositionList: apiService.getDestPositionList,
|
|
getWarehouseInList: apiService.warehouseInList,
|
|
getPayeeList: apiService.getPayeeList,
|
|
getSalemanList: apiService.getSalemanList,
|
|
async initData() { // 初始化
|
|
this.queryOption.billCode = this.queryOption.billCode || this.queryOption.copyBillCode
|
|
this.curPageType = this.pageTypeMap[this.queryOption.type] || {}
|
|
this.setNavigationBarTitle(this.curPageType.title || this.pageTypeMap[pageTypeEnum.create].title)
|
|
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) {
|
|
this.pageLoading = true
|
|
this.submitParam.billCode = this.queryOption.billCode
|
|
let res = await apiService.getOrderDetail({...this.queryOption, _loading: true})
|
|
let data = res.data || {}
|
|
data.goodsPics = (data.goodsPics && data.goodsPics.split(",")) || []
|
|
this.submitParam = res.data
|
|
if(res.data.lockFlag == 'T') {
|
|
setTimeout(()=> {
|
|
this.showToast(res.data.lockReason)
|
|
}, 500)
|
|
}
|
|
// 复制场景 清除billCode orderSn
|
|
if(this.queryOption.copyBillCode) {
|
|
delete this.submitParam.billCode
|
|
delete this.submitParam.orderSn
|
|
}
|
|
}
|
|
this.pageLoading = false
|
|
},
|
|
|
|
initEvent() {
|
|
|
|
},
|
|
handleScanChange: debounce(function(){
|
|
// 创建不做 查询详情
|
|
if(this.queryOption.type != pageTypeEnum.create) {
|
|
// 扫码回调 要重新查询新运单信息,并覆盖老的
|
|
this.queryOption.billCode = this.submitParam.billCode
|
|
this.initData();
|
|
this.initEvent()
|
|
}
|
|
}),
|
|
async handleCreateOrderNo() {
|
|
const res = await apiService.createOrderNo()
|
|
this.submitParam.billCode = res.data
|
|
},
|
|
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() // 调用线路切换,清空后续数据
|
|
}
|
|
},
|
|
handleYueJieSelect(val) {
|
|
const item = this.yuejieRes.list.filter(t=> t.val == val)[0]
|
|
this.submitParam.salesmen = item.salesmen
|
|
this.submitParam.salesmenName = item.salesmenName
|
|
// this.submitParam.payee = item.payeeName
|
|
this.submitParam.payee = item.payee
|
|
},
|
|
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 })
|
|
},
|
|
handleDestPostChange(val) {
|
|
const item = this.destPostRes.list.filter(t=> t.val == val)[0]
|
|
this.submitParam.dispatchUnderlingSiteCode = item.siteCode;
|
|
this.submitParam.dispatchUnderlingSiteName = item.siteName;
|
|
},
|
|
handleDialogClick(curModal){
|
|
curModal.show = true
|
|
},
|
|
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 handleGoodInfoSure() {
|
|
// 校验各个组件的参数
|
|
let res = await this.$refs.goodEditInfo.validData()
|
|
// 同步 代垫运费 数据
|
|
setTimeout(()=> {
|
|
this.$refs.bCostRef.updateDaiDianFeeData()
|
|
}, 300)
|
|
},
|
|
async handleSave(type) {
|
|
let saveServerHand = apiService.submitOrder
|
|
if(this.isEdit) { }
|
|
let params = JSON.parse(JSON.stringify(this.submitParam));
|
|
params.goodsPics = params.goodsPics.join(",")
|
|
params._loading = true
|
|
await saveServerHand(params)
|
|
if(type == 'print') {
|
|
this.showToast('操作成功')
|
|
this.handlePrint()
|
|
} else {
|
|
await this.saveSuccessBack()
|
|
}
|
|
},
|
|
async handlePrint(){
|
|
let { billCode, blGenSubbill, parcelQty } = this.submitParam
|
|
let param = {
|
|
billCode,
|
|
printType: 'TAN-GC-130,TAN-GM-130'
|
|
}
|
|
// 生成子单,需要传递范围
|
|
if(blGenSubbill == '1' && parcelQty) {
|
|
param.subBillCodeRange = `1,${parcelQty}`
|
|
}
|
|
let prtRes = await getBillPrintData(param)
|
|
this.$refs.curPrint.confirmPrint(prtRes)
|
|
this.resetForm()
|
|
},
|
|
async saveSuccessBack(){
|
|
let { savedConfirmTitle } = this.curPageType
|
|
if(savedConfirmTitle) {
|
|
let cBl = await this.confirmModal(`操作成功,${savedConfirmTitle}`)
|
|
if(cBl) {
|
|
// 刷新当前页面状态
|
|
this.reloadCurrentPage(this)
|
|
} else {
|
|
this.goBack()
|
|
}
|
|
} else {
|
|
this.showToast('操作成功')
|
|
this.goBack()
|
|
}
|
|
},
|
|
resetForm(){
|
|
// 清空新建的数据
|
|
if(this.showCreateBNoBtn) {
|
|
this.submitParam = this.getDefaultData().submitParam
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
@import '@/common/uni-nvue.scss';
|
|
|
|
page {
|
|
background-color: #F6F6F6;
|
|
height: 100% !important;
|
|
}
|
|
</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> |