uu m
This commit is contained in:
parent
542019567b
commit
ddebb3c5b7
21
common/validate.js
Normal file
21
common/validate.js
Normal file
@ -0,0 +1,21 @@
|
||||
import { showToast } from "./untool"
|
||||
const checkParams = (param, validConfig)=> {
|
||||
return new Promise((resolve)=> {
|
||||
let errMsg = ''
|
||||
Object.keys(validConfig).map(key=> {
|
||||
const itemConf = validConfig[key]
|
||||
if(!errMsg && itemConf.required && !param[key]) {
|
||||
errMsg = itemConf.requiredMsg || `${itemConf.label}不能为空`
|
||||
}
|
||||
})
|
||||
if(errMsg) {
|
||||
showToast(errMsg)
|
||||
} else {
|
||||
resolve()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export {
|
||||
checkParams
|
||||
}
|
||||
@ -9,14 +9,22 @@
|
||||
<slot name="titleRight"></slot>
|
||||
</view>
|
||||
</u-row>
|
||||
<u-row justify="between" custom-style="margin-top: 20rpx;">
|
||||
<u-row justify="between" custom-style="flex-wrap:wrap;">
|
||||
<u-col span="6" align="center">
|
||||
<view class="clr-prm font-34 font-weight">{{staticInfo.parcelQty}}</view>
|
||||
<view class="mt-20 clr-sub font-28">总件数</view>
|
||||
<view class="mt-20 clr-prm font-34 font-weight">{{staticInfo.parcelQty}}</view>
|
||||
<view class="mt-10 clr-sub font-28">总件数</view>
|
||||
</u-col>
|
||||
<u-col span="6" align="center">
|
||||
<view class="clr-prm font-34 font-weight">{{staticInfo.billWeight}}</view>
|
||||
<view class="mt-20 clr-sub font-28">总重量(KG)</view>
|
||||
<view class="mt-20 clr-prm font-34 font-weight">{{staticInfo.billWeight}}</view>
|
||||
<view class="mt-21 clr-sub font-28">总重量(KG)</view>
|
||||
</u-col>
|
||||
<u-col span="6" align="center">
|
||||
<view class="mt-20 clr-prm font-34 font-weight">{{staticInfo.totalVolume}}</view>
|
||||
<view class="mt-10 clr-sub font-28">总体积(m³)</view>
|
||||
</u-col>
|
||||
<u-col span="6" align="center">
|
||||
<view class="mt-20 clr-prm font-34 font-weight">{{staticInfo.piaoNum}}</view>
|
||||
<view class="mt-10 clr-sub font-28">总票数</view>
|
||||
</u-col>
|
||||
</u-row>
|
||||
</view>
|
||||
@ -42,11 +50,16 @@
|
||||
let data = {
|
||||
parcelQty: 0,
|
||||
billWeight: 0,
|
||||
totalVolume: 0,
|
||||
piaoNum: this.list?.length || 0
|
||||
}
|
||||
this.list.map(t=> {
|
||||
data.parcelQty += t.parcelQty
|
||||
data.billWeight += t.billWeight
|
||||
data.totalVolume += t.totalVolume
|
||||
|
||||
})
|
||||
|
||||
return data
|
||||
}
|
||||
},
|
||||
|
||||
@ -53,6 +53,7 @@
|
||||
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 },
|
||||
@ -69,6 +70,10 @@
|
||||
billCode: '',
|
||||
dispatchOrSendManCode: '',
|
||||
},
|
||||
submitValidConfig: {
|
||||
dispatchOrSendManCode: { required: true, requiredMsg: '请选择派件员' },
|
||||
billCode: { required: true, requiredMsg: '运单号不能为空' },
|
||||
},
|
||||
pageLoading: true,
|
||||
queryOption: {
|
||||
billCode: '', // 运单id
|
||||
@ -100,6 +105,7 @@
|
||||
async handleSubmit(val) {
|
||||
let extParam = {}
|
||||
val && (extParam.billCode = val);
|
||||
await checkParams(this.submitParam, this.submitValidConfig)
|
||||
let daoParam = getScanParams(scanTypeEnum.daoJian, { ...this.submitParam, ...extParam })
|
||||
let daoRes = await apiService.scanRecord({...daoParam, _loading: true})
|
||||
let { bl: daoBl, resItem: daoResItem } = ansScanResponse({ res: daoRes })
|
||||
|
||||
@ -42,6 +42,8 @@
|
||||
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: {
|
||||
|
||||
@ -53,6 +53,7 @@
|
||||
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 },
|
||||
@ -69,6 +70,10 @@
|
||||
billCode: '',
|
||||
dispatchOrSendManCode: '',
|
||||
},
|
||||
submitValidConfig: {
|
||||
dispatchOrSendManCode: { required: true, requiredMsg: '请选择派件员' },
|
||||
billCode: { required: true, requiredMsg: '运单号不能为空' },
|
||||
},
|
||||
pageLoading: true,
|
||||
queryOption: {
|
||||
billCode: '', // 运单id
|
||||
@ -100,6 +105,7 @@
|
||||
async handleSubmit(val) {
|
||||
let extParam = {}
|
||||
val && (extParam.billCode = val);
|
||||
await checkParams(this.submitParam, this.submitValidConfig)
|
||||
let scnParam = getScanParams(scanTypeEnum.paiJian, { ...this.submitParam, ...extParam })
|
||||
let res = await apiService.scanRecord({...scnParam, _loading: true})
|
||||
let { bl, resItem } = ansScanResponse({ res, title: "派件" })
|
||||
|
||||
@ -49,6 +49,7 @@
|
||||
|
||||
import * as apiService from "@/common/api"
|
||||
import { scanTypeEnum, getScanParams, ansScanResponse } from "@/common/scanUtil"
|
||||
import { checkParams } from "@/common/validate"
|
||||
|
||||
export default {
|
||||
components:{ BoOperatorTmp, BoScanlistTmp },
|
||||
@ -63,7 +64,10 @@
|
||||
billCode: '',
|
||||
preOrNextStationCode: '',
|
||||
},
|
||||
|
||||
submitValidConfig: {
|
||||
preOrNextStationCode: { required: true, requiredMsg: '请选择下一网点' },
|
||||
billCode: { required: true, requiredMsg: '运单号不能为空' },
|
||||
},
|
||||
pageLoading: true,
|
||||
queryOption: {
|
||||
billCode: '', // 运单id
|
||||
@ -96,6 +100,7 @@
|
||||
async handleSubmit(val) {
|
||||
let extParam = {}
|
||||
val && (extParam.billCode = val);
|
||||
await checkParams(this.submitParam, this.submitValidConfig)
|
||||
let scnParam = getScanParams(scanTypeEnum.faJian, { ...this.submitParam, ...extParam })
|
||||
let res = await apiService.scanRecord({...scnParam, _loading: true})
|
||||
let { bl, resItem } = ansScanResponse({ res, title: "发件" })
|
||||
|
||||
@ -136,7 +136,7 @@
|
||||
import { debounce } from "@/common/util"
|
||||
import dayjs from "dayjs"
|
||||
import * as apiService from "@/common/api"
|
||||
|
||||
import { checkParams } from "@/common/validate"
|
||||
export default {
|
||||
props: {
|
||||
// hasLeftWin: {
|
||||
@ -157,6 +157,10 @@
|
||||
billCode: [],
|
||||
subBillCodeRange: []
|
||||
},
|
||||
submitValidConfig: {
|
||||
printType: { required: true, requiredMsg: '请勾选打印配' },
|
||||
billCode: { required: true, requiredMsg: '请选择运单号' },
|
||||
},
|
||||
yinlTypeList: [
|
||||
{ title: '中文', val: 'zh' },
|
||||
{ title: '英文', val: 'en' },
|
||||
@ -212,29 +216,13 @@
|
||||
this.submitParam.billCode = this.resData.list.map(item=> item.val)
|
||||
}
|
||||
},
|
||||
async checkParam(param) {
|
||||
return new Promise((resolve)=> {
|
||||
let errMsg = ''
|
||||
if(!errMsg && !param.printType) {
|
||||
errMsg = '请勾选打印配置'
|
||||
}
|
||||
if(!errMsg && !param.billCode) {
|
||||
errMsg = '请选择运单号'
|
||||
}
|
||||
if(errMsg) {
|
||||
this.showToast(errMsg)
|
||||
} else {
|
||||
resolve()
|
||||
}
|
||||
})
|
||||
},
|
||||
async getRealGetWaybillPrintData() {
|
||||
// 请求后端接口
|
||||
let param = JSON.parse(JSON.stringify(this.submitParam))
|
||||
param.printType = param.printType.join(',')
|
||||
param.billCode = param.billCode.join(',')
|
||||
param.subBillCodeRange = param.subBillCodeRange.join(',')
|
||||
await this.checkParam(param)
|
||||
await checkParams(param, this.submitValidConfig)
|
||||
let res = await apiService.getRealGetWaybillPrintData({ ...param, _loading: true })
|
||||
return res
|
||||
},
|
||||
|
||||
@ -53,6 +53,8 @@
|
||||
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: {
|
||||
@ -75,6 +77,11 @@
|
||||
billCode: '',
|
||||
preOrNextStationCode: '',
|
||||
},
|
||||
submitValidConfig: {
|
||||
preOrNextStationCode: { required: true, requiredMsg: '请选择下一网点' },
|
||||
bagNo: { required: true, requiredMsg: '请选择合包号' },
|
||||
billCode: { required: true, requiredMsg: '运单号不能为空' },
|
||||
},
|
||||
}
|
||||
},
|
||||
onShareAppMessage() {
|
||||
@ -97,6 +104,7 @@
|
||||
async handleSubmit(val) {
|
||||
let extParam = {}
|
||||
val && (extParam.billCode = val);
|
||||
await checkParams(this.submitParam, this.submitValidConfig)
|
||||
let scnParam = getScanParams(scanTypeEnum.heBao, { ...this.submitParam, ...extParam })
|
||||
let res = await apiService.scanRecord({...scnParam, _loading: true})
|
||||
let { bl, resItem } = ansScanResponse({ res, title: "合包" })
|
||||
|
||||
@ -44,6 +44,7 @@
|
||||
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 },
|
||||
@ -58,7 +59,10 @@
|
||||
billCode: '',
|
||||
preOrNextStationCode: '',
|
||||
},
|
||||
|
||||
submitValidConfig: {
|
||||
preOrNextStationCode: { required: true, requiredMsg: '请选择下一网点' },
|
||||
billCode: { required: true, requiredMsg: '运单号不能为空' },
|
||||
},
|
||||
pageLoading: true,
|
||||
queryOption: {
|
||||
billCode: '', // 运单id
|
||||
@ -91,6 +95,7 @@
|
||||
async handleSubmit(val) {
|
||||
let extParam = {}
|
||||
val && (extParam.billCode = val);
|
||||
await checkParams(this.submitParam, this.submitValidConfig)
|
||||
let scnParam = getScanParams(scanTypeEnum.qingGuan, { ...this.submitParam, ...extParam })
|
||||
let res = await apiService.scanRecord({...scnParam, _loading: true})
|
||||
let { bl, resItem } = ansScanResponse({ res, title: "清关" })
|
||||
|
||||
@ -45,6 +45,7 @@
|
||||
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 },
|
||||
@ -64,6 +65,10 @@
|
||||
queryOption: {
|
||||
billCode: '', // 运单id
|
||||
},
|
||||
submitValidConfig: {
|
||||
preOrNextStationCode: { required: true, requiredMsg: '请选择下一网点' },
|
||||
billCode: { required: true, requiredMsg: '运单号不能为空' },
|
||||
},
|
||||
resData: {
|
||||
list: []
|
||||
},
|
||||
@ -92,6 +97,7 @@
|
||||
async handleSubmit(val) {
|
||||
let extParam = {}
|
||||
val && (extParam.billCode = val);
|
||||
await checkParams(this.submitParam, this.submitValidConfig)
|
||||
let scnParam = getScanParams(scanTypeEnum.baoGUan, { ...this.submitParam, ...extParam })
|
||||
let res = await apiService.scanRecord({...scnParam, _loading: true})
|
||||
let { bl, resItem } = ansScanResponse({ res, title: "报关" })
|
||||
|
||||
@ -48,6 +48,8 @@
|
||||
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: {
|
||||
@ -69,6 +71,10 @@
|
||||
billCode: '',
|
||||
preOrNextStationCode: '',
|
||||
},
|
||||
submitValidConfig: {
|
||||
preOrNextStationCode: { required: true, requiredMsg: '请选择上一网点' },
|
||||
billCode: { required: true, requiredMsg: '运单号不能为空' },
|
||||
},
|
||||
}
|
||||
},
|
||||
onShareAppMessage() {
|
||||
@ -90,6 +96,7 @@
|
||||
async handleSubmit(val) {
|
||||
let extParam = {}
|
||||
val && (extParam.billCode = val);
|
||||
await checkParams(this.submitParam, this.submitValidConfig)
|
||||
let scnParam = getScanParams(scanTypeEnum.chaiBao, { ...this.submitParam, ...extParam })
|
||||
let res = await apiService.scanRecord({...scnParam, _loading: true})
|
||||
let { bl, resItem } = ansScanResponse({ res, title: "拆包" })
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 421 KiB After Width: | Height: | Size: 212 KiB |
Loading…
Reference in New Issue
Block a user