emis-app/pages/tms/customsClearanceScanning.vue

130 lines
3.4 KiB
Vue
Raw Normal View History

2024-02-02 05:23:24 +00:00
<template>
2024-05-30 10:33:54 +00:00
<tpx-page>
<tpx-layout>
<template v-slot:body>
2024-02-02 05:23:24 +00:00
<view class="blcok-white-noradius" style="margin-top: 0;">
2024-05-30 10:33:54 +00:00
<u-row justify="between">
<view style="flex:1;">
<tpx-scan-input v-model:value="submitParam.billCode" placeholder="请输入或扫码"
2024-07-13 04:46:17 +00:00
@scanChange="handleScanValChange" :showConfirm="true" @confirmClick="handleScanValChange" iconPos="left"></tpx-scan-input>
2024-02-02 05:23:24 +00:00
</view>
</u-row>
2024-05-30 10:33:54 +00:00
<u-row custom-style="margin-top:20rpx;">
<view style="flex: 1;">
2024-06-11 13:37:18 +00:00
<tpx-select v-model:resObject="siteRes" :getListFun="getNextStationList" :transKeyVal="{valKey: 'destSite',titleKey: 'destSiteName'}" v-model:value="submitParam.preOrNextStationCode" mode="drop" placeholder="请选择下一网点"></tpx-select>
2024-02-02 05:23:24 +00:00
</view>
</u-row>
2024-05-30 10:33:54 +00:00
2024-02-02 05:23:24 +00:00
<view class="mt-30">
<u-button @click="handleSubmit()" type="primary" size="large" shape="square"
2024-05-30 10:33:54 +00:00
custom-style="height:80rpx;font-size: 30rpx;border-radius: 14rpx;">确定</u-button>
2024-02-02 05:23:24 +00:00
</view>
</view>
2024-05-30 10:33:54 +00:00
<view class="blcok-white-noradius">
<bo-operator-tmp :list="resData.list"></bo-operator-tmp>
2024-02-02 05:23:24 +00:00
</view>
2024-05-30 10:33:54 +00:00
<view class="blcok-white-noradius">
2024-06-01 04:25:22 +00:00
<bo-scanlist-tmp :resData="resData"></bo-scanlist-tmp>
2024-02-02 05:23:24 +00:00
</view>
2024-05-30 10:33:54 +00:00
</template>
<template v-slot:footer>
</template>
</tpx-layout>
</tpx-page>
2024-02-02 05:23:24 +00:00
</template>
<script>
2024-05-30 10:33:54 +00:00
import { debounce } from "@/common/util"
import dayjs from "dayjs"
import BoOperatorTmp from "@/components/buns-order-templates/bo-operator-tmp"
2024-06-01 04:25:22 +00:00
import BoScanlistTmp from "@/components/buns-order-templates/bo-scanlist-tmp"
2024-05-30 10:33:54 +00:00
import * as apiService from "@/common/api"
import { scanTypeEnum, getScanParams, ansScanResponse } from "@/common/scanUtil"
2024-06-08 17:31:07 +00:00
import { checkParams } from "@/common/validate"
2024-05-30 10:19:13 +00:00
2024-02-02 05:23:24 +00:00
export default {
2024-06-01 04:25:22 +00:00
components:{ BoOperatorTmp, BoScanlistTmp },
2024-02-02 05:23:24 +00:00
props: {
},
computed: {
},
data() {
return {
submitParam: {
2024-05-30 10:33:54 +00:00
billCode: '',
preOrNextStationCode: '',
},
2024-06-08 17:31:07 +00:00
submitValidConfig: {
preOrNextStationCode: { required: true, requiredMsg: '请选择下一网点' },
billCode: { required: true, requiredMsg: '运单号不能为空' },
},
2024-05-30 10:33:54 +00:00
pageLoading: true,
queryOption: {
billCode: '', // 运单id
},
resData: {
list: []
2024-02-02 05:23:24 +00:00
},
2024-05-30 10:33:54 +00:00
siteRes: {
list: []
2024-02-02 05:23:24 +00:00
},
2024-05-30 10:33:54 +00:00
curScanItem: {},
2024-02-02 05:23:24 +00:00
}
},
onShareAppMessage() {
return {
}
},
2024-05-30 10:33:54 +00:00
onLoad(option) {
this.queryOption = option
2024-02-02 05:23:24 +00:00
this.initData();
},
onUnload() {
},
methods: {
2024-05-30 10:33:54 +00:00
getNextStationList: apiService.getNextStationList,
2024-02-02 05:23:24 +00:00
initData() {
2024-05-30 10:33:54 +00:00
this.submitParam.billCode = this.queryOption.billCode
2024-02-02 05:23:24 +00:00
},
2024-07-13 04:46:17 +00:00
async handleSubmit() {
2024-05-30 10:33:54 +00:00
let extParam = {}
2024-06-08 17:31:07 +00:00
await checkParams(this.submitParam, this.submitValidConfig)
2024-05-30 10:33:54 +00:00
let scnParam = getScanParams(scanTypeEnum.qingGuan, { ...this.submitParam, ...extParam })
let res = await apiService.scanRecord({...scnParam, _loading: true})
let { bl, resItem } = ansScanResponse({ res, title: "清关" })
if(bl) {
this.curScanItem = resItem
this.resData.list.unshift({ ...resItem })
this.resetForm()
}
2024-02-02 05:23:24 +00:00
},
2024-07-13 04:46:17 +00:00
handleScanValChange: debounce(function(){
this.handleSubmit()
2024-05-30 10:33:54 +00:00
}),
resetForm() {
this.submitParam.billCode = ''
}
2024-02-02 05:23:24 +00:00
}
}
</script>
<style lang="scss">
@import '@/common/uni-nvue.scss';
page {
background-color: #F6F6F6;
height: 100% !important;
}
</style>
<style scoped lang="scss">
2024-05-30 10:33:54 +00:00
.yditem{
padding: 20rpx 0;
border-top: 2px solid #F6F6F6;
2024-02-02 05:23:24 +00:00
}
</style>