emis-app/pages/deliveryDeal/arriveScanning.vue

123 lines
2.9 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;">
<u-row justify="between">
<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>
<view style="">
<u-button type="primary" custom-style="width: 140rpx;margin-left: 20rpx;height: 68rpx;">确定</u-button>
</view>
</u-row>
</view>
2024-02-01 12:34:03 +00:00
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>
</view>
2024-02-01 12:34:03 +00:00
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-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-07 17:03:51 +00:00
2024-02-01 12:34:03 +00:00
},
computed: {
},
data() {
return {
2024-05-08 07:27:30 +00:00
submitParam: {
billCode: ''
},
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 {
// title: '',
// path: 'TODO'
}
},
2024-05-07 17:03:51 +00:00
onLoad(option) {
this.queryOption = option
2024-02-01 12:34:03 +00:00
this.initData();
},
onUnload() {
},
methods: {
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);
let scnParam = getScanParams(scanTypeEnum.daoJian, { ...this.submitParam, ...extParam })
let res = await apiService.scanRecord({...scnParam, _loading: true})
let { bl, resItem } = ansScanResponse({ res, 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>