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>
|
<slot name="titleRight"></slot>
|
||||||
</view>
|
</view>
|
||||||
</u-row>
|
</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">
|
<u-col span="6" align="center">
|
||||||
<view class="clr-prm font-34 font-weight">{{staticInfo.parcelQty}}</view>
|
<view class="mt-20 clr-prm font-34 font-weight">{{staticInfo.parcelQty}}</view>
|
||||||
<view class="mt-20 clr-sub font-28">总件数</view>
|
<view class="mt-10 clr-sub font-28">总件数</view>
|
||||||
</u-col>
|
</u-col>
|
||||||
<u-col span="6" align="center">
|
<u-col span="6" align="center">
|
||||||
<view class="clr-prm font-34 font-weight">{{staticInfo.billWeight}}</view>
|
<view class="mt-20 clr-prm font-34 font-weight">{{staticInfo.billWeight}}</view>
|
||||||
<view class="mt-20 clr-sub font-28">总重量(KG)</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-col>
|
||||||
</u-row>
|
</u-row>
|
||||||
</view>
|
</view>
|
||||||
@ -42,11 +50,16 @@
|
|||||||
let data = {
|
let data = {
|
||||||
parcelQty: 0,
|
parcelQty: 0,
|
||||||
billWeight: 0,
|
billWeight: 0,
|
||||||
|
totalVolume: 0,
|
||||||
|
piaoNum: this.list?.length || 0
|
||||||
}
|
}
|
||||||
this.list.map(t=> {
|
this.list.map(t=> {
|
||||||
data.parcelQty += t.parcelQty
|
data.parcelQty += t.parcelQty
|
||||||
data.billWeight += t.billWeight
|
data.billWeight += t.billWeight
|
||||||
|
data.totalVolume += t.totalVolume
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
return data
|
return data
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@ -53,6 +53,7 @@
|
|||||||
import BoScanlistTmp from "@/components/buns-order-templates/bo-scanlist-tmp"
|
import BoScanlistTmp from "@/components/buns-order-templates/bo-scanlist-tmp"
|
||||||
import * as apiService from "@/common/api"
|
import * as apiService from "@/common/api"
|
||||||
import { scanTypeEnum, getScanParams, ansScanResponse } from "@/common/scanUtil"
|
import { scanTypeEnum, getScanParams, ansScanResponse } from "@/common/scanUtil"
|
||||||
|
import { checkParams } from "@/common/validate"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components:{ BoOperatorTmp, BoScanlistTmp },
|
components:{ BoOperatorTmp, BoScanlistTmp },
|
||||||
@ -69,6 +70,10 @@
|
|||||||
billCode: '',
|
billCode: '',
|
||||||
dispatchOrSendManCode: '',
|
dispatchOrSendManCode: '',
|
||||||
},
|
},
|
||||||
|
submitValidConfig: {
|
||||||
|
dispatchOrSendManCode: { required: true, requiredMsg: '请选择派件员' },
|
||||||
|
billCode: { required: true, requiredMsg: '运单号不能为空' },
|
||||||
|
},
|
||||||
pageLoading: true,
|
pageLoading: true,
|
||||||
queryOption: {
|
queryOption: {
|
||||||
billCode: '', // 运单id
|
billCode: '', // 运单id
|
||||||
@ -100,6 +105,7 @@
|
|||||||
async handleSubmit(val) {
|
async handleSubmit(val) {
|
||||||
let extParam = {}
|
let extParam = {}
|
||||||
val && (extParam.billCode = val);
|
val && (extParam.billCode = val);
|
||||||
|
await checkParams(this.submitParam, this.submitValidConfig)
|
||||||
let daoParam = getScanParams(scanTypeEnum.daoJian, { ...this.submitParam, ...extParam })
|
let daoParam = getScanParams(scanTypeEnum.daoJian, { ...this.submitParam, ...extParam })
|
||||||
let daoRes = await apiService.scanRecord({...daoParam, _loading: true})
|
let daoRes = await apiService.scanRecord({...daoParam, _loading: true})
|
||||||
let { bl: daoBl, resItem: daoResItem } = ansScanResponse({ res: daoRes })
|
let { bl: daoBl, resItem: daoResItem } = ansScanResponse({ res: daoRes })
|
||||||
|
|||||||
@ -42,6 +42,8 @@
|
|||||||
import BoScanlistTmp from "@/components/buns-order-templates/bo-scanlist-tmp"
|
import BoScanlistTmp from "@/components/buns-order-templates/bo-scanlist-tmp"
|
||||||
import * as apiService from "@/common/api"
|
import * as apiService from "@/common/api"
|
||||||
import { scanTypeEnum, getScanParams, ansScanResponse } from "@/common/scanUtil"
|
import { scanTypeEnum, getScanParams, ansScanResponse } from "@/common/scanUtil"
|
||||||
|
import { checkParams } from "@/common/validate"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components:{ BoOperatorTmp, BoScanlistTmp },
|
components:{ BoOperatorTmp, BoScanlistTmp },
|
||||||
props: {
|
props: {
|
||||||
|
|||||||
@ -53,6 +53,7 @@
|
|||||||
import BoScanlistTmp from "@/components/buns-order-templates/bo-scanlist-tmp"
|
import BoScanlistTmp from "@/components/buns-order-templates/bo-scanlist-tmp"
|
||||||
import * as apiService from "@/common/api"
|
import * as apiService from "@/common/api"
|
||||||
import { scanTypeEnum, getScanParams, ansScanResponse } from "@/common/scanUtil"
|
import { scanTypeEnum, getScanParams, ansScanResponse } from "@/common/scanUtil"
|
||||||
|
import { checkParams } from "@/common/validate"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components:{ BoOperatorTmp, BoScanlistTmp },
|
components:{ BoOperatorTmp, BoScanlistTmp },
|
||||||
@ -69,6 +70,10 @@
|
|||||||
billCode: '',
|
billCode: '',
|
||||||
dispatchOrSendManCode: '',
|
dispatchOrSendManCode: '',
|
||||||
},
|
},
|
||||||
|
submitValidConfig: {
|
||||||
|
dispatchOrSendManCode: { required: true, requiredMsg: '请选择派件员' },
|
||||||
|
billCode: { required: true, requiredMsg: '运单号不能为空' },
|
||||||
|
},
|
||||||
pageLoading: true,
|
pageLoading: true,
|
||||||
queryOption: {
|
queryOption: {
|
||||||
billCode: '', // 运单id
|
billCode: '', // 运单id
|
||||||
@ -100,6 +105,7 @@
|
|||||||
async handleSubmit(val) {
|
async handleSubmit(val) {
|
||||||
let extParam = {}
|
let extParam = {}
|
||||||
val && (extParam.billCode = val);
|
val && (extParam.billCode = val);
|
||||||
|
await checkParams(this.submitParam, this.submitValidConfig)
|
||||||
let scnParam = getScanParams(scanTypeEnum.paiJian, { ...this.submitParam, ...extParam })
|
let scnParam = getScanParams(scanTypeEnum.paiJian, { ...this.submitParam, ...extParam })
|
||||||
let res = await apiService.scanRecord({...scnParam, _loading: true})
|
let res = await apiService.scanRecord({...scnParam, _loading: true})
|
||||||
let { bl, resItem } = ansScanResponse({ res, title: "派件" })
|
let { bl, resItem } = ansScanResponse({ res, title: "派件" })
|
||||||
|
|||||||
@ -49,6 +49,7 @@
|
|||||||
|
|
||||||
import * as apiService from "@/common/api"
|
import * as apiService from "@/common/api"
|
||||||
import { scanTypeEnum, getScanParams, ansScanResponse } from "@/common/scanUtil"
|
import { scanTypeEnum, getScanParams, ansScanResponse } from "@/common/scanUtil"
|
||||||
|
import { checkParams } from "@/common/validate"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components:{ BoOperatorTmp, BoScanlistTmp },
|
components:{ BoOperatorTmp, BoScanlistTmp },
|
||||||
@ -63,7 +64,10 @@
|
|||||||
billCode: '',
|
billCode: '',
|
||||||
preOrNextStationCode: '',
|
preOrNextStationCode: '',
|
||||||
},
|
},
|
||||||
|
submitValidConfig: {
|
||||||
|
preOrNextStationCode: { required: true, requiredMsg: '请选择下一网点' },
|
||||||
|
billCode: { required: true, requiredMsg: '运单号不能为空' },
|
||||||
|
},
|
||||||
pageLoading: true,
|
pageLoading: true,
|
||||||
queryOption: {
|
queryOption: {
|
||||||
billCode: '', // 运单id
|
billCode: '', // 运单id
|
||||||
@ -96,6 +100,7 @@
|
|||||||
async handleSubmit(val) {
|
async handleSubmit(val) {
|
||||||
let extParam = {}
|
let extParam = {}
|
||||||
val && (extParam.billCode = val);
|
val && (extParam.billCode = val);
|
||||||
|
await checkParams(this.submitParam, this.submitValidConfig)
|
||||||
let scnParam = getScanParams(scanTypeEnum.faJian, { ...this.submitParam, ...extParam })
|
let scnParam = getScanParams(scanTypeEnum.faJian, { ...this.submitParam, ...extParam })
|
||||||
let res = await apiService.scanRecord({...scnParam, _loading: true})
|
let res = await apiService.scanRecord({...scnParam, _loading: true})
|
||||||
let { bl, resItem } = ansScanResponse({ res, title: "发件" })
|
let { bl, resItem } = ansScanResponse({ res, title: "发件" })
|
||||||
|
|||||||
@ -136,7 +136,7 @@
|
|||||||
import { debounce } from "@/common/util"
|
import { debounce } from "@/common/util"
|
||||||
import dayjs from "dayjs"
|
import dayjs from "dayjs"
|
||||||
import * as apiService from "@/common/api"
|
import * as apiService from "@/common/api"
|
||||||
|
import { checkParams } from "@/common/validate"
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
// hasLeftWin: {
|
// hasLeftWin: {
|
||||||
@ -157,6 +157,10 @@
|
|||||||
billCode: [],
|
billCode: [],
|
||||||
subBillCodeRange: []
|
subBillCodeRange: []
|
||||||
},
|
},
|
||||||
|
submitValidConfig: {
|
||||||
|
printType: { required: true, requiredMsg: '请勾选打印配' },
|
||||||
|
billCode: { required: true, requiredMsg: '请选择运单号' },
|
||||||
|
},
|
||||||
yinlTypeList: [
|
yinlTypeList: [
|
||||||
{ title: '中文', val: 'zh' },
|
{ title: '中文', val: 'zh' },
|
||||||
{ title: '英文', val: 'en' },
|
{ title: '英文', val: 'en' },
|
||||||
@ -212,29 +216,13 @@
|
|||||||
this.submitParam.billCode = this.resData.list.map(item=> item.val)
|
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() {
|
async getRealGetWaybillPrintData() {
|
||||||
// 请求后端接口
|
// 请求后端接口
|
||||||
let param = JSON.parse(JSON.stringify(this.submitParam))
|
let param = JSON.parse(JSON.stringify(this.submitParam))
|
||||||
param.printType = param.printType.join(',')
|
param.printType = param.printType.join(',')
|
||||||
param.billCode = param.billCode.join(',')
|
param.billCode = param.billCode.join(',')
|
||||||
param.subBillCodeRange = param.subBillCodeRange.join(',')
|
param.subBillCodeRange = param.subBillCodeRange.join(',')
|
||||||
await this.checkParam(param)
|
await checkParams(param, this.submitValidConfig)
|
||||||
let res = await apiService.getRealGetWaybillPrintData({ ...param, _loading: true })
|
let res = await apiService.getRealGetWaybillPrintData({ ...param, _loading: true })
|
||||||
return res
|
return res
|
||||||
},
|
},
|
||||||
|
|||||||
@ -53,6 +53,8 @@
|
|||||||
import BoScanlistTmp from "@/components/buns-order-templates/bo-scanlist-tmp"
|
import BoScanlistTmp from "@/components/buns-order-templates/bo-scanlist-tmp"
|
||||||
import * as apiService from "@/common/api"
|
import * as apiService from "@/common/api"
|
||||||
import { scanTypeEnum, getScanParams, ansScanResponse } from "@/common/scanUtil"
|
import { scanTypeEnum, getScanParams, ansScanResponse } from "@/common/scanUtil"
|
||||||
|
import { checkParams } from "@/common/validate"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components:{ BoOperatorTmp, BoScanlistTmp },
|
components:{ BoOperatorTmp, BoScanlistTmp },
|
||||||
props: {
|
props: {
|
||||||
@ -75,6 +77,11 @@
|
|||||||
billCode: '',
|
billCode: '',
|
||||||
preOrNextStationCode: '',
|
preOrNextStationCode: '',
|
||||||
},
|
},
|
||||||
|
submitValidConfig: {
|
||||||
|
preOrNextStationCode: { required: true, requiredMsg: '请选择下一网点' },
|
||||||
|
bagNo: { required: true, requiredMsg: '请选择合包号' },
|
||||||
|
billCode: { required: true, requiredMsg: '运单号不能为空' },
|
||||||
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onShareAppMessage() {
|
onShareAppMessage() {
|
||||||
@ -97,6 +104,7 @@
|
|||||||
async handleSubmit(val) {
|
async handleSubmit(val) {
|
||||||
let extParam = {}
|
let extParam = {}
|
||||||
val && (extParam.billCode = val);
|
val && (extParam.billCode = val);
|
||||||
|
await checkParams(this.submitParam, this.submitValidConfig)
|
||||||
let scnParam = getScanParams(scanTypeEnum.heBao, { ...this.submitParam, ...extParam })
|
let scnParam = getScanParams(scanTypeEnum.heBao, { ...this.submitParam, ...extParam })
|
||||||
let res = await apiService.scanRecord({...scnParam, _loading: true})
|
let res = await apiService.scanRecord({...scnParam, _loading: true})
|
||||||
let { bl, resItem } = ansScanResponse({ res, title: "合包" })
|
let { bl, resItem } = ansScanResponse({ res, title: "合包" })
|
||||||
|
|||||||
@ -44,6 +44,7 @@
|
|||||||
import BoScanlistTmp from "@/components/buns-order-templates/bo-scanlist-tmp"
|
import BoScanlistTmp from "@/components/buns-order-templates/bo-scanlist-tmp"
|
||||||
import * as apiService from "@/common/api"
|
import * as apiService from "@/common/api"
|
||||||
import { scanTypeEnum, getScanParams, ansScanResponse } from "@/common/scanUtil"
|
import { scanTypeEnum, getScanParams, ansScanResponse } from "@/common/scanUtil"
|
||||||
|
import { checkParams } from "@/common/validate"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components:{ BoOperatorTmp, BoScanlistTmp },
|
components:{ BoOperatorTmp, BoScanlistTmp },
|
||||||
@ -58,7 +59,10 @@
|
|||||||
billCode: '',
|
billCode: '',
|
||||||
preOrNextStationCode: '',
|
preOrNextStationCode: '',
|
||||||
},
|
},
|
||||||
|
submitValidConfig: {
|
||||||
|
preOrNextStationCode: { required: true, requiredMsg: '请选择下一网点' },
|
||||||
|
billCode: { required: true, requiredMsg: '运单号不能为空' },
|
||||||
|
},
|
||||||
pageLoading: true,
|
pageLoading: true,
|
||||||
queryOption: {
|
queryOption: {
|
||||||
billCode: '', // 运单id
|
billCode: '', // 运单id
|
||||||
@ -91,6 +95,7 @@
|
|||||||
async handleSubmit(val) {
|
async handleSubmit(val) {
|
||||||
let extParam = {}
|
let extParam = {}
|
||||||
val && (extParam.billCode = val);
|
val && (extParam.billCode = val);
|
||||||
|
await checkParams(this.submitParam, this.submitValidConfig)
|
||||||
let scnParam = getScanParams(scanTypeEnum.qingGuan, { ...this.submitParam, ...extParam })
|
let scnParam = getScanParams(scanTypeEnum.qingGuan, { ...this.submitParam, ...extParam })
|
||||||
let res = await apiService.scanRecord({...scnParam, _loading: true})
|
let res = await apiService.scanRecord({...scnParam, _loading: true})
|
||||||
let { bl, resItem } = ansScanResponse({ res, title: "清关" })
|
let { bl, resItem } = ansScanResponse({ res, title: "清关" })
|
||||||
|
|||||||
@ -45,6 +45,7 @@
|
|||||||
import BoScanlistTmp from "@/components/buns-order-templates/bo-scanlist-tmp"
|
import BoScanlistTmp from "@/components/buns-order-templates/bo-scanlist-tmp"
|
||||||
import * as apiService from "@/common/api"
|
import * as apiService from "@/common/api"
|
||||||
import { scanTypeEnum, getScanParams, ansScanResponse } from "@/common/scanUtil"
|
import { scanTypeEnum, getScanParams, ansScanResponse } from "@/common/scanUtil"
|
||||||
|
import { checkParams } from "@/common/validate"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components:{ BoOperatorTmp, BoScanlistTmp },
|
components:{ BoOperatorTmp, BoScanlistTmp },
|
||||||
@ -64,6 +65,10 @@
|
|||||||
queryOption: {
|
queryOption: {
|
||||||
billCode: '', // 运单id
|
billCode: '', // 运单id
|
||||||
},
|
},
|
||||||
|
submitValidConfig: {
|
||||||
|
preOrNextStationCode: { required: true, requiredMsg: '请选择下一网点' },
|
||||||
|
billCode: { required: true, requiredMsg: '运单号不能为空' },
|
||||||
|
},
|
||||||
resData: {
|
resData: {
|
||||||
list: []
|
list: []
|
||||||
},
|
},
|
||||||
@ -92,6 +97,7 @@
|
|||||||
async handleSubmit(val) {
|
async handleSubmit(val) {
|
||||||
let extParam = {}
|
let extParam = {}
|
||||||
val && (extParam.billCode = val);
|
val && (extParam.billCode = val);
|
||||||
|
await checkParams(this.submitParam, this.submitValidConfig)
|
||||||
let scnParam = getScanParams(scanTypeEnum.baoGUan, { ...this.submitParam, ...extParam })
|
let scnParam = getScanParams(scanTypeEnum.baoGUan, { ...this.submitParam, ...extParam })
|
||||||
let res = await apiService.scanRecord({...scnParam, _loading: true})
|
let res = await apiService.scanRecord({...scnParam, _loading: true})
|
||||||
let { bl, resItem } = ansScanResponse({ res, title: "报关" })
|
let { bl, resItem } = ansScanResponse({ res, title: "报关" })
|
||||||
|
|||||||
@ -48,6 +48,8 @@
|
|||||||
import BoScanlistTmp from "@/components/buns-order-templates/bo-scanlist-tmp"
|
import BoScanlistTmp from "@/components/buns-order-templates/bo-scanlist-tmp"
|
||||||
import * as apiService from "@/common/api"
|
import * as apiService from "@/common/api"
|
||||||
import { scanTypeEnum, getScanParams, ansScanResponse } from "@/common/scanUtil"
|
import { scanTypeEnum, getScanParams, ansScanResponse } from "@/common/scanUtil"
|
||||||
|
import { checkParams } from "@/common/validate"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components:{ BoOperatorTmp, BoScanlistTmp },
|
components:{ BoOperatorTmp, BoScanlistTmp },
|
||||||
props: {
|
props: {
|
||||||
@ -69,6 +71,10 @@
|
|||||||
billCode: '',
|
billCode: '',
|
||||||
preOrNextStationCode: '',
|
preOrNextStationCode: '',
|
||||||
},
|
},
|
||||||
|
submitValidConfig: {
|
||||||
|
preOrNextStationCode: { required: true, requiredMsg: '请选择上一网点' },
|
||||||
|
billCode: { required: true, requiredMsg: '运单号不能为空' },
|
||||||
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onShareAppMessage() {
|
onShareAppMessage() {
|
||||||
@ -90,6 +96,7 @@
|
|||||||
async handleSubmit(val) {
|
async handleSubmit(val) {
|
||||||
let extParam = {}
|
let extParam = {}
|
||||||
val && (extParam.billCode = val);
|
val && (extParam.billCode = val);
|
||||||
|
await checkParams(this.submitParam, this.submitValidConfig)
|
||||||
let scnParam = getScanParams(scanTypeEnum.chaiBao, { ...this.submitParam, ...extParam })
|
let scnParam = getScanParams(scanTypeEnum.chaiBao, { ...this.submitParam, ...extParam })
|
||||||
let res = await apiService.scanRecord({...scnParam, _loading: true})
|
let res = await apiService.scanRecord({...scnParam, _loading: true})
|
||||||
let { bl, resItem } = ansScanResponse({ res, title: "拆包" })
|
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