emis-app/pages/deliveryDeal/translateScanning.vue
2024-06-20 19:09:46 +08:00

124 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>
<u-row custom-style="margin-top:40rpx;">
<view style="flex: 1;">
<tpx-select v-model:value="submitParam.transferCode" :list="dicData.emis_express_code"
mode="drop" isWhite="true" placeholder="请选择同行快递"
>
</tpx-select>
</view>
</u-row>
<u-row custom-style="margin-top:20rpx;">
<view style="flex:1;">
<tpx-scan-input v-model:value="submitParam.transferBillcode" placeholder="请输入同行单号或扫码"
iconPos="left"></tpx-scan-input>
</view>
</u-row>
<view class="mt-20">
<tpx-input v-model:value="submitParam.destCity" placeholder="目的城市" :isWhite="true"></tpx-input>
</view>
<view class="mt-20">
<tpx-date-input v-model:value="submitParam.transferDate" placeholder="转件时间" mode="datetime"/>
</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 { scanTypeEnum, getScanParams, ansScanResponse } from "@/common/scanUtil"
import { checkParams } from "@/common/validate"
export default {
components:{ },
props: {
},
computed: {
dicData() {
return this.$store.getters.dicData
},
},
data() {
return {
submitParam: {
billCode: '',
transferCode: '', // 转单同行快递代码
transferBillcode: '', // 转单同行单号
destCity: '', // 目的城市
transferDate: '', // 转件时间
},
submitValidConfig: {
billCode: { required: true, requiredMsg: '运单号不能为空' },
},
}
},
onShareAppMessage() {
return {
}
},
onLoad() {
this.initData();
},
onUnload() {
},
methods: {
initData() {
},
async handleSubmit() {
await checkParams(this.submitParam, this.submitValidConfig)
let scnParam = getScanParams(scanTypeEnum.zhuanJian, { ...this.submitParam })
let res = await apiService.scanRecord({...scnParam, _loading: true})
let { bl, resItem } = ansScanResponse({ res, title: "转件" })
if(bl) {
this.resetForm()
}
},
resetForm() {
this.submitParam.billCode = ''
this.submitParam.transferBillcode = ''
}
}
}
</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>