emis-app/pages/deliveryDeal/stayScanning.vue
2024-08-06 17:55:25 +08:00

118 lines
3.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="请输入运单号或扫码"
iconPos="left"></tpx-scan-input>
</view>
</u-row>
<view class="mt-20">
<tpx-select v-model:value="submitParam.keepType" :list="dicData.emis_keep_warehouse" mode="drop" placeholder="请选择留仓类型"
></tpx-select>
</view>
<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="300" 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 * as apiService from "@/common/api"
import BpeGoodphotoTmp from "@/components/buns-post-edit-templates/bpe-goodphoto-tmp"
import { scanTypeEnum, getScanParams, ansScanResponse } from "@/common/scanUtil"
import { checkParams } from "@/common/validate"
export default {
components:{ BpeGoodphotoTmp },
props: {
},
computed: {
dicData() {
return this.$store.getters.dicData
},
},
data() {
return {
submitParam: {
billCode: '',
keepType: '',
picUrl: [],
remark: '',
},
submitValidConfig: {
billCode: { required: true, requiredMsg: '运单号不能为空' },
keepType: { required: true, requiredMsg: '留仓类型不能为空' },
// picUrl: { required: true, requiredMsg: '图片不能为空' },
// remark: { required: true, requiredMsg: '备注不能为空' },
},
}
},
onShareAppMessage() {
return {
}
},
onLoad() {
this.initData();
},
onUnload() {
},
methods: {
initData() {
},
async handleSubmit() {
await checkParams(this.submitParam, this.submitValidConfig)
let extParams = {}
extParams.picUrl = this.submitParam.picUrl?.join?.(",") || ''
let scnParam = getScanParams(scanTypeEnum.liuCang, { ...this.submitParam, ...extParams })
let res = await apiService.scanRecord({...scnParam, _loading: true})
let { bl, resItem } = ansScanResponse({ res, title: "留仓" })
if(bl) {
this.resetForm()
}
},
resetForm() {
this.submitParam.billCode = ''
this.submitParam.picUrl = []
this.submitParam.remark = ''
}
}
}
</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>