123 lines
2.9 KiB
Vue
123 lines
2.9 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>
|
|
<view style="">
|
|
<u-button type="primary" custom-style="width: 140rpx;margin-left: 20rpx;height: 68rpx;">确定</u-button>
|
|
</view>
|
|
</u-row>
|
|
|
|
</view>
|
|
|
|
<view class="blcok-white-noradius">
|
|
<bo-operator-tmp :list="resData.list">
|
|
<template v-slot:titleRight>
|
|
<button @click="goto(`deliveryDeal/arriveList`)" size="mini">查看历史到件</button>
|
|
</template>
|
|
</bo-operator-tmp>
|
|
</view>
|
|
|
|
<view class="blcok-white-noradius">
|
|
<bo-scanlist-tmp :resData="resData"></bo-scanlist-tmp>
|
|
</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 BoScanlistTmp from "@/components/buns-order-templates/bo-scanlist-tmp"
|
|
import * as apiService from "@/common/api"
|
|
import { scanTypeEnum, getScanParams, ansScanResponse } from "@/common/scanUtil"
|
|
import { checkParams } from "@/common/validate"
|
|
|
|
export default {
|
|
components:{ BoOperatorTmp, BoScanlistTmp },
|
|
props: {
|
|
|
|
},
|
|
computed: {
|
|
|
|
},
|
|
data() {
|
|
return {
|
|
submitParam: {
|
|
billCode: ''
|
|
},
|
|
pageLoading: true,
|
|
queryOption: {
|
|
billCode: '', // 运单id
|
|
orderSn: '', // 订单id
|
|
},
|
|
resData: {
|
|
list: []
|
|
},
|
|
curScanItem: {},
|
|
}
|
|
},
|
|
onShareAppMessage() {
|
|
return {
|
|
// title: '',
|
|
// path: 'TODO'
|
|
}
|
|
},
|
|
onLoad(option) {
|
|
this.queryOption = option
|
|
this.initData();
|
|
},
|
|
onUnload() {
|
|
|
|
},
|
|
methods: {
|
|
initData() {
|
|
this.submitParam.billCode = this.queryOption.billCode
|
|
},
|
|
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) {
|
|
this.curScanItem = resItem
|
|
this.resData.list.unshift({ ...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> |