emis-app/pages/deliveryDeal/arriveDeliveryScanning.vue
2024-05-08 17:26:34 +08:00

160 lines
4.2 KiB
Vue

<template>
<tpx-page>
<tpx-layout>
<template v-slot:body>
<view class="blcok-white-noradius" style="margin-top: 0;">
<u-row justify="between">
<view style="flex:1;">
<tpx-scan-input v-model:value="submitParam.billCode" placeholder="请输入或扫码"
@change="handleScanValChange" iconPos="left"></tpx-scan-input>
</view>
</u-row>
<u-row custom-style="margin-top:20rpx;">
<view style="flex: 1;">
<tpx-select v-model:value="submitParam.dispatchOrSendManCode" v-model:resObject="paiRes" :getListFun="getRSDStaffList" :transKeyVal="{valKey: 'empCode',titleKey: 'empName'}" placeholder="请选择派件员" :isWhite="true"></tpx-select>
</view>
</u-row>
<view class="mt-20 clr-sub">
当前件: 重量 <text class="clr-prm pr-40">1.2KG</text> 体积: <text class="clr-prm">0.1m³</text>
</view>
<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>
</view>
</view>
<view class="blcok-white-noradius">
<bo-operator-tmp>
<template v-slot:titleRight>
<button size="mini">查看历史发件</button>
</template>
</bo-operator-tmp>
</view>
<view class="blcok-white-noradius">
<tpx-scroll-view v-model:resObject="resData"
>
<view class="">
<view class="pb-20">
<u-row>
<u-col span="8">
<text class="font-weight">运单号</text>
</u-col>
<u-col span="4">
<text class="font-weight">扫描时间</text>
</u-col>
</u-row>
</view>
<view v-for="(item, index) in resData.list" class="yditem">
<u-row>
<u-col span="8">
<text class="">{{item.billCode}}</text>
</u-col>
<u-col span="4">
<text class="clr-sub">{{item.scanDate}}</text>
</u-col>
</u-row>
</view>
</view>
</tpx-scroll-view>
</view>
</template>
<template v-slot:footer>
</template>
</tpx-layout>
</tpx-page>
</template>
<script>
import { debounce } from "@/common/util"
import dayjs from "dayjs"
import BoOperatorTmp from "@/components/buns-order-templates/bo-operator-tmp"
import * as apiService from "@/common/api"
import { scanTypeEnum, getScanParams, ansScanResponse } from "./scanUtil"
export default {
components:{ BoOperatorTmp },
props: {
},
computed: {
},
data() {
return {
paiRes: { list: [] } ,
submitParam: {
billCode: '',
dispatchOrSendManCode: '',
},
pageLoading: true,
queryOption: {
billCode: '', // 运单id
orderSn: '', // 订单id
},
resData: {
list: []
}
}
},
onShareAppMessage() {
return {
}
},
onLoad(option) {
this.queryOption = option
this.initData();
},
onUnload() {
},
methods: {
getRSDStaffList: apiService.getRSDStaffList,
initData() {
this.submitParam.billCode = this.queryOption.billCode || this.queryOption.orderSn
},
async handleSubmit(val) {
let extParam = {}
val && (extParam.billCode = val);
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) {
let paiParam = getScanParams(scanTypeEnum.paiJian, { ...this.submitParam, ...extParam })
let paiRes = await apiService.scanRecord({...paiParam, _loading: true})
let { bl, resItem } = ansScanResponse({ res: paiRes, title: "到派件" })
if(bl) {
this.resData.list.push({ ...resItem })
this.resetForm()
}
}
},
handleScanValChange: debounce(function(val){
val && (this.handleSubmit(val))
}),
resetForm() {
this.submitParam.billCode = ''
}
}
}
</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>