emis-app/pages/deliveryDeal/arriveDeliveryScanning.vue

150 lines
4.2 KiB
Vue
Raw Normal View History

2024-02-01 12:34:03 +00:00
<template>
2024-05-07 17:03:51 +00:00
<tpx-page>
<tpx-layout>
<template v-slot:body>
<view class="blcok-white-noradius" style="margin-top: 0;">
2024-05-08 09:26:34 +00:00
<u-row justify="between">
2024-05-07 17:03:51 +00:00
<view style="flex:1;">
2024-05-08 07:27:30 +00:00
<tpx-scan-input v-model:value="submitParam.billCode" placeholder="请输入或扫码"
2024-05-07 17:03:51 +00:00
@change="handleScanValChange" iconPos="left"></tpx-scan-input>
</view>
</u-row>
<u-row custom-style="margin-top:20rpx;">
<view style="flex: 1;">
2024-06-11 13:37:18 +00:00
<tpx-select v-model:value="submitParam.dispatchOrSendManCode" v-model:resObject="paiRes" :getListFun="getRSDStaffList" :transKeyVal="{valKey: 'empCode',titleKey: 'empName'}" placeholder="请选择派件员" mode="drop"></tpx-select>
2024-05-07 17:03:51 +00:00
</view>
</u-row>
2024-06-12 16:43:21 +00:00
<!-- <view class="mt-20 clr-sub">
2024-05-26 15:38:06 +00:00
当前件: 重量 <text class="clr-prm pr-40">{{curScanItem.billWeight || 0}}KG</text>
数量: <text class="clr-prm">{{curScanItem.parcelQty || 0}}件</text>
2024-06-12 16:43:21 +00:00
</view> -->
2024-05-07 17:03:51 +00:00
<view class="mt-30">
<u-button @click="handleSubmit()" type="primary" size="large" shape="square"
custom-style="height:80rpx;font-size: 30rpx;border-radius: 14rpx;">确定</u-button>
2024-02-01 12:34:03 +00:00
</view>
2024-05-07 17:03:51 +00:00
2024-02-01 12:34:03 +00:00
</view>
2024-05-07 17:03:51 +00:00
<view class="blcok-white-noradius">
2024-05-10 01:25:24 +00:00
<bo-operator-tmp :list="resData.list">
2024-05-07 17:03:51 +00:00
<template v-slot:titleRight>
2024-05-27 05:58:30 +00:00
<button @click="goto(`deliveryDeal/arriveList`)" size="mini">查看历史到件</button>
2024-05-07 17:03:51 +00:00
</template>
</bo-operator-tmp>
2024-02-01 12:34:03 +00:00
</view>
2024-05-07 17:03:51 +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-01 12:34:03 +00:00
</view>
2024-05-07 17:03:51 +00:00
</template>
2024-02-01 12:34:03 +00:00
2024-05-07 17:03:51 +00:00
<template v-slot:footer>
</template>
</tpx-layout>
</tpx-page>
2024-02-01 12:34:03 +00:00
</template>
<script>
2024-05-07 17:03:51 +00:00
import { debounce } from "@/common/util"
import dayjs from "dayjs"
2024-02-01 12:34:03 +00:00
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-07 17:03:51 +00:00
import * as apiService from "@/common/api"
2024-05-30 10:33:54 +00:00
import { scanTypeEnum, getScanParams, ansScanResponse } from "@/common/scanUtil"
2024-06-08 17:31:07 +00:00
import { checkParams } from "@/common/validate"
2024-05-07 17:03:51 +00:00
2024-02-01 12:34:03 +00:00
export default {
2024-06-01 04:25:22 +00:00
components:{ BoOperatorTmp, BoScanlistTmp },
2024-02-01 12:34:03 +00:00
props: {
2024-05-08 07:27:30 +00:00
2024-02-01 12:34:03 +00:00
},
computed: {
},
data() {
return {
2024-05-08 07:27:30 +00:00
paiRes: { list: [] } ,
submitParam: {
billCode: '',
dispatchOrSendManCode: '',
},
2024-06-08 17:31:07 +00:00
submitValidConfig: {
dispatchOrSendManCode: { required: true, requiredMsg: '请选择派件员' },
billCode: { required: true, requiredMsg: '运单号不能为空' },
},
2024-05-07 17:03:51 +00:00
pageLoading: true,
queryOption: {
billCode: '', // 运单id
orderSn: '', // 订单id
2024-02-01 12:34:03 +00:00
},
2024-05-07 17:03:51 +00:00
resData: {
list: []
2024-05-26 15:38:06 +00:00
},
curScanItem: {},
2024-02-01 12:34:03 +00:00
}
},
onShareAppMessage() {
return {
2024-05-08 07:27:30 +00:00
2024-02-01 12:34:03 +00:00
}
},
2024-05-07 17:03:51 +00:00
onLoad(option) {
this.queryOption = option
2024-02-01 12:34:03 +00:00
this.initData();
},
onUnload() {
2024-05-08 07:27:30 +00:00
2024-02-01 12:34:03 +00:00
},
methods: {
2024-05-08 07:27:30 +00:00
getRSDStaffList: apiService.getRSDStaffList,
2024-02-01 12:34:03 +00:00
initData() {
2024-06-21 05:08:25 +00:00
this.submitParam.billCode = this.queryOption.billCode
2024-05-08 07:27:30 +00:00
},
async handleSubmit(val) {
let extParam = {}
val && (extParam.billCode = val);
2024-06-08 17:31:07 +00:00
await checkParams(this.submitParam, this.submitValidConfig)
2024-05-08 07:27:30 +00:00
let daoParam = getScanParams(scanTypeEnum.daoJian, { ...this.submitParam, ...extParam })
let daoRes = await apiService.scanRecord({...daoParam, _loading: true})
let { bl: daoBl, resItem: daoResItem } = ansScanResponse({ res: daoRes })
if(daoBl) {
2024-06-15 06:53:59 +00:00
let paiParam = getScanParams(scanTypeEnum.paiJian, {
scanDate: dayjs().add(10, 'minute').format("YYYY-MM-DD HH:mm:ss"), // 自定义扫描时间 +10min
...this.submitParam,
...extParam
})
2024-05-08 07:27:30 +00:00
let paiRes = await apiService.scanRecord({...paiParam, _loading: true})
let { bl, resItem } = ansScanResponse({ res: paiRes, title: "到派件" })
if(bl) {
2024-05-26 15:38:06 +00:00
this.curScanItem = resItem
this.resData.list.unshift({ ...resItem })
2024-05-08 07:27:30 +00:00
this.resetForm()
}
}
2024-02-01 12:34:03 +00:00
},
2024-05-07 17:03:51 +00:00
handleScanValChange: debounce(function(val){
2024-05-08 07:27:30 +00:00
val && (this.handleSubmit(val))
2024-05-07 17:03:51 +00:00
}),
2024-05-08 07:27:30 +00:00
resetForm() {
this.submitParam.billCode = ''
}
2024-02-01 12:34:03 +00:00
}
}
</script>
<style lang="scss">
@import '@/common/uni-nvue.scss';
page {
background-color: #F6F6F6;
height: 100% !important;
}
</style>
<style scoped lang="scss">
.yditem{
padding: 20rpx 0;
border-top: 2px solid #F6F6F6;
}
</style>