emis-app/pages/deliveryDeal/arriveDeliveryScanning.vue

160 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-05-08 07:27:30 +00:00
<tpx-select v-model:value="submitParam.dispatchOrSendManCode" v-model:resObject="paiRes" :getListFun="getRSDStaffList" :transKeyVal="{valKey: 'empCode',titleKey: 'empName'}" placeholder="请选择派件员" :isWhite="true"></tpx-select>
2024-05-07 17:03:51 +00:00
</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>
2024-02-01 12:34:03 +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>
<button size="mini">查看历史发件</button>
</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">
<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">
2024-05-08 07:27:30 +00:00
<text class="">{{item.billCode}}</text>
2024-05-07 17:03:51 +00:00
</u-col>
<u-col span="4">
2024-05-08 07:27:30 +00:00
<text class="clr-sub">{{item.scanDate}}</text>
2024-05-07 17:03:51 +00:00
</u-col>
</u-row>
</view>
</view>
</tpx-scroll-view>
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-05-07 17:03:51 +00:00
import * as apiService from "@/common/api"
2024-05-08 07:27:30 +00:00
import { scanTypeEnum, getScanParams, ansScanResponse } from "./scanUtil"
2024-05-07 17:03:51 +00:00
2024-02-01 12:34:03 +00:00
export default {
components:{ BoOperatorTmp },
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-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-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-05-08 07:27:30 +00:00
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()
}
}
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>