emis-app/pages/deliveryDeal/signedScanning.vue
2024-06-16 09:48:22 +08:00

145 lines
4.1 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.signMan" :list="dicData.emis_signs_remark"
mode="drop"
>
<u-input placeholder="签收人" v-model="submitParam.signMan" font-size="26"
custom-style="border-radius: 10rpx;padding: 10rpx 20rpx;"
placeholder-style="color: #999; "
></u-input>
</tpx-select>
</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="请选择派件员" mode="drop"></tpx-select>
</view>
</u-row>
<view class="mt-20">
<bpe-goodphoto-tmp title="签收拍照" :value="submitParam" filedName="picUrl"></bpe-goodphoto-tmp>
</view>
<view class="mt-10">
<u-textarea v-model="submitParam.remark" border="surround" height="120" placeholder="备注"
maxlength="50" count></u-textarea>
</view>
</view>
</template>
<template v-slot:footer>
<view class="pos-rlt blcok-white" style="border-radius: 0;margin-top: 0;">
<u-row>
<u-button @click="handleSubmit" size="large" shape="circle"
custom-style="width: 500rpx;height:80rpx;font-size: 30rpx;" type="primary">确认签收</u-button>
</u-row>
</view>
</template>
</tpx-layout>
</tpx-page>
</template>
<script>
import BpeGoodphotoTmp from "@/components/buns-post-edit-templates/bpe-goodphoto-tmp"
import { debounce } from "@/common/util"
import dayjs from "dayjs"
import * as apiService from "@/common/api"
import { scanTypeEnum, getScanParams, ansScanResponse, preCheckScan } from "@/common/scanUtil"
import { checkParams } from "@/common/validate"
export default {
components:{ BpeGoodphotoTmp },
props: {
},
computed: {
dicData() {
return this.$store.getters.dicData
},
},
data() {
return {
queryOption: {
billCode: '', // 运单id
orderSn: '', // 订单id
},
submitParam: {
billCode: "",
signMan: "",
picUrl: '',
remark: "",
dispatchOrSendManCode: ""
},
submitValidConfig: {
signMan: { required: true, requiredMsg: '签收人不能为空' },
dispatchOrSendManCode: { required: true, requiredMsg: '请选择派件员' },
billCode: { required: true, requiredMsg: '运单号不能为空' },
},
paiRes: { 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
},
handleScanValChange: debounce(async function(val){
if(val) {
let preBl = await preCheckScan({ scanType: scanTypeEnum.qianShou, param: { ...this.submitParam, billCode: val } })
}
}),
async handleSubmit() {
await checkParams(this.submitParam, this.submitValidConfig)
this.submitParam.picUrl = this.submitParam.picUrl?.join?.(",") || ''
let scnParam = getScanParams(scanTypeEnum.qianShou, { ...this.submitParam })
let res = await apiService.scanRecord({...scnParam, _loading: true})
let { bl, resItem } = ansScanResponse({ res, title: "签收" })
if(bl) {
this.resetForm()
}
},
resetForm() {
this.submitParam = {
picUrl: ''
}
}
}
}
</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>