emis-app/pages/tms/coPackingScanning.vue

175 lines
5.2 KiB
Vue
Raw Normal View History

2024-02-01 15:35:47 +00:00
<template>
2024-05-30 11:24:27 +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-06-15 06:53:59 +00:00
<tpx-scan-input v-model:value="submitParam.billCode" placeholder="运单号, 请输入或扫码"
2024-07-11 14:25:52 +00:00
@scanChange="handleScanValChange" :showConfirm="true" @confirmClick="handleScanValChange" iconPos="left"></tpx-scan-input>
2024-05-30 11:24:27 +00:00
</view>
</u-row>
<u-row custom-style="margin-top:20rpx;">
2024-02-01 15:35:47 +00:00
<view style="flex: 1;">
2024-06-11 13:37:18 +00:00
<tpx-select v-model:resObject="siteRes" :getListFun="getNextStationList" :transKeyVal="{valKey: 'destSite',titleKey: 'destSiteName'}" v-model:value="submitParam.preOrNextStationCode" mode="drop" placeholder="请选择下一网点"></tpx-select>
2024-02-01 15:35:47 +00:00
</view>
2024-05-30 11:24:27 +00:00
</u-row>
<u-row custom-style="margin-top:20rpx;">
<view style="flex: 1;">
2024-06-15 06:53:59 +00:00
<tpx-scan-input v-model:value="submitParam.bagNo" placeholder="合包号, 请输入或扫码"
iconPos="left"></tpx-scan-input>
</view>
2024-06-20 05:25:55 +00:00
<!-- <view class="pl-10">
2024-06-15 06:53:59 +00:00
<u-button @click="handleCreatePaNo()"
custom-style="font-size: 28rpx;padding:0 10rpx;height: 74rpx;" :plain="true" >系统生成</u-button>
2024-06-20 05:25:55 +00:00
</view> -->
2024-02-01 15:35:47 +00:00
</u-row>
2024-06-15 15:32:09 +00:00
<u-row custom-style="margin-top:20rpx;">
2024-06-18 16:16:19 +00:00
<tpx-input v-model:value="submitParam.scanWeight" placeholder="合包重量" _digit="5" suffix="KG"></tpx-input>
2024-06-15 15:32:09 +00:00
</u-row>
<view class="mt-20">合包件数:{{resData.list.length}}</view>
2024-06-15 06:53:59 +00:00
2024-06-15 15:17:03 +00:00
<u-button @click="handleSubmit" custom-style="height:74rpx;font-size: 28rpx;margin-top: 30rpx;" type="primary">合包完成</u-button>
2024-02-01 15:35:47 +00:00
</view>
2024-05-30 11:24:27 +00:00
<view class="blcok-white-noradius">
<bo-operator-tmp :list="resData.list">
<template v-slot:titleRight>
</template>
</bo-operator-tmp>
</view>
<view class="blcok-white-noradius">
2024-06-18 16:16:19 +00:00
<bo-scanlist-tmp :resData="resData" :canDel="true"></bo-scanlist-tmp>
2024-05-30 11:24:27 +00:00
</view>
</template>
2024-06-14 08:50:18 +00:00
<!-- <template v-slot:footer>
2024-05-30 11:24:27 +00:00
<view class="pos-rlt blcok-white" style="border-radius: 0;margin-top: 0;">
<u-row>
<u-button size="large" shape="circle"
custom-style="width: 500rpx;height:80rpx;font-size: 30rpx;" type="primary">打印合包条码</u-button>
</u-row>
</view>
2024-06-14 08:50:18 +00:00
</template> -->
2024-05-30 11:24:27 +00:00
</tpx-layout>
</tpx-page>
2024-02-01 15:35:47 +00:00
</template>
<script>
2024-05-30 11:24:27 +00:00
import { debounce } from "@/common/util"
import dayjs from "dayjs"
2024-02-01 15:35:47 +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-30 11:24:27 +00:00
import * as apiService from "@/common/api"
2024-06-15 15:17:03 +00:00
import { scanTypeEnum, getScanParams, ansScanResponse, preCheckScan, confirmScanUpload } from "@/common/scanUtil"
2024-06-08 17:31:07 +00:00
import { checkParams } from "@/common/validate"
2024-02-01 15:35:47 +00:00
export default {
2024-06-01 04:25:22 +00:00
components:{ BoOperatorTmp, BoScanlistTmp },
2024-02-01 15:35:47 +00:00
props: {
// hasLeftWin: {
// type: Boolean
// }
},
computed: {
},
data() {
return {
2024-05-30 11:24:27 +00:00
queryOption: {
billCode: '', // 运单id
},
resData: { list: [] },
siteRes: { list: [] },
cpackRes: { list: [] },
2024-02-01 15:35:47 +00:00
submitParam: {
2024-05-30 11:24:27 +00:00
billCode: '',
preOrNextStationCode: '',
2024-06-15 15:32:09 +00:00
bagNo: '',
scanWeight: ''
2024-02-01 15:35:47 +00:00
},
2024-06-08 17:31:07 +00:00
submitValidConfig: {
preOrNextStationCode: { required: true, requiredMsg: '请选择下一网点' },
bagNo: { required: true, requiredMsg: '请选择合包号' },
2024-06-15 15:32:09 +00:00
scanWeight: { required: true, requiredMsg: '合包重量不能为空' },
2024-06-08 17:31:07 +00:00
billCode: { required: true, requiredMsg: '运单号不能为空' },
},
2024-02-01 15:35:47 +00:00
}
},
onShareAppMessage() {
return {
}
},
2024-05-30 11:24:27 +00:00
onLoad(option) {
this.queryOption = option
2024-02-01 15:35:47 +00:00
this.initData();
},
onUnload() {
2024-05-30 11:24:27 +00:00
2024-02-01 15:35:47 +00:00
},
methods: {
2024-05-30 11:24:27 +00:00
getNextStationList: apiService.getNextStationList,
getPackCodeList: apiService.getPackCodeList,
2024-02-01 15:35:47 +00:00
initData() {
2024-05-30 11:24:27 +00:00
this.submitParam.billCode = this.queryOption.billCode
2024-06-15 06:53:59 +00:00
},
async handleCreatePaNo() {
2024-06-15 15:32:09 +00:00
let res = await apiService.getPackNo()
this.submitParam.bagNo = res.data
2024-02-01 15:35:47 +00:00
},
2024-06-15 15:17:03 +00:00
async handleSubmit() {
2024-05-30 11:24:27 +00:00
let extParam = {}
2024-06-15 15:17:03 +00:00
let param = JSON.parse(JSON.stringify(this.submitParam))
param.billCode = this.resData.list.map(t=>t.billCode).join(",")
await checkParams(param, this.submitValidConfig)
let scCfBl = await confirmScanUpload({ scanType: scanTypeEnum.heBao, param, list: this.resData.list })
if(scCfBl) {
this.showToast('合包操作成功')
2024-05-30 11:24:27 +00:00
this.resetForm()
}
},
2024-07-11 14:25:52 +00:00
handleScanValChange: debounce(async function(){
let preBl = await preCheckScan({ scanType: scanTypeEnum.heBao, param: { ...this.submitParam }, list: this.resData.list })
if(preBl) {
this.submitParam.billCode = ''
2024-06-15 15:17:03 +00:00
}
2024-05-30 11:24:27 +00:00
}),
resetForm() {
2024-06-15 15:32:09 +00:00
this.submitParam = {
billCode: '',
preOrNextStationCode: '',
bagNo: '',
scanWeight: ''
}
this.resData.list = []
2024-02-01 15:35:47 +00:00
}
}
}
</script>
<style lang="scss">
@import '@/common/uni-nvue.scss';
page {
background-color: #F6F6F6;
height: 100% !important;
}
</style>
<style scoped lang="scss">
.yditem{
margin-top: 20rpx;
padding: 20rpx;
border-radius: 20rpx;
background-color: #F6F6F6;
&:first-child{
margin-top: 0;
}
.lbwth{
display: inline-block;
width: 120rpx;
}
}
</style>