uu
This commit is contained in:
parent
e736a46267
commit
422aa69500
@ -156,4 +156,9 @@ export const registerProblemInfo = (data = {})=> {
|
||||
export const queryScanWaybillList = (data = {})=> {
|
||||
return coreRequest(url.queryScanWaybillList, data, {}, "GET")
|
||||
}
|
||||
|
||||
// 运单附件上传
|
||||
export const uploadWaybillAttach = (data = {})=> {
|
||||
return coreRequest(url.uploadWaybillAttach, data, {})
|
||||
}
|
||||
|
||||
@ -51,5 +51,7 @@ export default {
|
||||
queryProblemTypeList: `/emis/emisProblemType/listSimple`, // 问题件类型列表
|
||||
registerProblemInfo: `/emis/emisWaybillProblemInfo/registerProblemInfo`, // 问题件登记
|
||||
queryScanWaybillList: `/emis/emisWaybill/queryScanWaybillList`, // 1-发件清单 2-到件清单 3-派件清单
|
||||
uploadWaybillAttach: `/emis/emisWaybillAttachment/uploadWaybillAttach`, // 运单附件上传
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import dayjs from "dayjs"
|
||||
import { showToast, playAudio } from "@/common/untool"
|
||||
import { audioTypeEnum } from "@/common/enum"
|
||||
import * as apiService from "@/common/api"
|
||||
|
||||
export const scanTypeEnum = {
|
||||
lanShou: 10, // 揽收
|
||||
@ -18,15 +19,16 @@ export const scanTypeEnum = {
|
||||
baoGUan: 700, // 报关
|
||||
}
|
||||
|
||||
export const getScanParams = (type, model = {})=> {
|
||||
export const getScanParams = (type, model = {}, extModel = {})=> {
|
||||
let scanDate = dayjs().format("YYYY-MM-DD HH:mm:ss")
|
||||
return {
|
||||
scanType: type, // 扫描类型
|
||||
opType: model._opType || 2, // 动作, 1 检查; 2 确认
|
||||
opType: 2, // 动作, 1 检查; 2 确认
|
||||
scanData: [{
|
||||
scanDate,
|
||||
...model,
|
||||
}]
|
||||
}],
|
||||
...extModel,
|
||||
}
|
||||
}
|
||||
|
||||
@ -59,4 +61,33 @@ export const ansScanResponse = ({ res, title })=> {
|
||||
bl,
|
||||
resItem,
|
||||
}
|
||||
}
|
||||
|
||||
// 扫描预检-- 接口
|
||||
export const preCheckScan = async ({ param, extParam, list, scanType })=> {
|
||||
let scnParam = getScanParams(scanType, { ...param }, { ...(extParam || {}), opType: 1 })
|
||||
let res = await apiService.scanRecord({...scnParam, _loading: true})
|
||||
let { bl, resItem } = ansScanResponse({ res })
|
||||
if(bl) {
|
||||
// 更新list
|
||||
if(list) {
|
||||
let existItem = list.filter(t=> t.billCode == resItem.billCode)[0]
|
||||
if(existItem?.billCode) {
|
||||
bl = false // 已扫描, list已存在
|
||||
playAudio(audioTypeEnum.repetitive)
|
||||
showToast('重复扫描')
|
||||
} else {
|
||||
list.unshift({ ...resItem })
|
||||
}
|
||||
}
|
||||
}
|
||||
return bl
|
||||
}
|
||||
|
||||
// 扫描确认-- 接口
|
||||
export const confirmScanUpload = async ({ param, extParam, list, scanType })=> {
|
||||
let scnParam = getScanParams(scanType, { ...param }, { ...(extParam || {}) })
|
||||
let res = await apiService.scanRecord({...scnParam, _loading: true})
|
||||
let { bl, resItem } = ansScanResponse({ res })
|
||||
return bl
|
||||
}
|
||||
@ -56,7 +56,7 @@
|
||||
import { debounce } from "@/common/util"
|
||||
import dayjs from "dayjs"
|
||||
import * as apiService from "@/common/api"
|
||||
import { scanTypeEnum, getScanParams, ansScanResponse } from "@/common/scanUtil"
|
||||
import { scanTypeEnum, getScanParams, ansScanResponse, preCheckScan } from "@/common/scanUtil"
|
||||
import { checkParams } from "@/common/validate"
|
||||
|
||||
export default {
|
||||
@ -106,9 +106,9 @@
|
||||
this.submitParam.billCode = this.queryOption.billCode || this.queryOption.orderSn
|
||||
},
|
||||
handleScanValChange: debounce(async function(val){
|
||||
let scnParam = getScanParams(scanTypeEnum.qianShou, { ...this.submitParam, _opType: 1 })
|
||||
let res = await apiService.scanRecord({...scnParam, _loading: true})
|
||||
let { bl, resItem } = ansScanResponse({ res })
|
||||
if(val) {
|
||||
let preBl = await preCheckScan({ scanType: scanTypeEnum.qianShou, param: { ...this.submitParam, billCode: val } })
|
||||
}
|
||||
}),
|
||||
async handleSubmit() {
|
||||
await checkParams(this.submitParam, this.submitValidConfig)
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
</u-row>
|
||||
|
||||
<view class="mt-20">
|
||||
<bpe-goodphoto-tmp title="照片" :value="submitParam" filedName="picUrl"></bpe-goodphoto-tmp>
|
||||
<bpe-goodphoto-tmp title="照片" :value="submitParam" filedName="fileUrl"></bpe-goodphoto-tmp>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
@ -38,12 +38,19 @@
|
||||
import { scanTypeEnum, getScanParams, ansScanResponse } from "@/common/scanUtil"
|
||||
import { checkParams } from "@/common/validate"
|
||||
|
||||
// attachType: 0-商品图片 1-寄件图片 2-签收图片 3-清关文件
|
||||
const pageTypeMap = {
|
||||
'1': {
|
||||
title: '货物图片',
|
||||
extData: {
|
||||
attachType: 0
|
||||
},
|
||||
},
|
||||
'2': {
|
||||
title: '签收图片',
|
||||
extData: {
|
||||
attachType: 2
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@ -65,10 +72,10 @@
|
||||
curPageType: {},
|
||||
submitParam: {
|
||||
billCode: "",
|
||||
picUrl: '',
|
||||
fileUrl: [],
|
||||
},
|
||||
submitValidConfig: {
|
||||
picUrl: { required: true, requiredMsg: '图片不能为空' },
|
||||
fileUrl: { required: true, requiredMsg: '图片不能为空' },
|
||||
// dispatchOrSendManCode: { required: true, requiredMsg: '请选择派件员' },
|
||||
billCode: { required: true, requiredMsg: '运单号不能为空' },
|
||||
},
|
||||
@ -98,17 +105,18 @@
|
||||
}),
|
||||
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()
|
||||
let extParams = {
|
||||
...this.curPageType.extData
|
||||
}
|
||||
extParams.fileUrl = this.submitParam.fileUrl?.join?.(",") || ''
|
||||
await apiService.uploadWaybillAttach({ ...this.submitParam, ...extParams, _loading: true })
|
||||
this.showToast('操作成功')
|
||||
this.resetForm()
|
||||
},
|
||||
resetForm() {
|
||||
this.submitParam = {
|
||||
picUrl: ''
|
||||
fileUrl: [],
|
||||
billCode: ''
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
</view>
|
||||
</u-row>
|
||||
|
||||
<u-button custom-style="height:74rpx;font-size: 28rpx;margin-top: 30rpx;" type="primary">合包完成</u-button>
|
||||
<u-button @click="handleSubmit" custom-style="height:74rpx;font-size: 28rpx;margin-top: 30rpx;" type="primary">合包完成</u-button>
|
||||
</view>
|
||||
|
||||
<view class="blcok-white-noradius">
|
||||
@ -59,7 +59,7 @@
|
||||
import BoOperatorTmp from "@/components/buns-order-templates/bo-operator-tmp"
|
||||
import BoScanlistTmp from "@/components/buns-order-templates/bo-scanlist-tmp"
|
||||
import * as apiService from "@/common/api"
|
||||
import { scanTypeEnum, getScanParams, ansScanResponse } from "@/common/scanUtil"
|
||||
import { scanTypeEnum, getScanParams, ansScanResponse, preCheckScan, confirmScanUpload } from "@/common/scanUtil"
|
||||
import { checkParams } from "@/common/validate"
|
||||
|
||||
export default {
|
||||
@ -111,21 +111,24 @@
|
||||
async handleCreatePaNo() {
|
||||
|
||||
},
|
||||
async handleSubmit(val) {
|
||||
async handleSubmit() {
|
||||
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: "合包" })
|
||||
if(bl) {
|
||||
this.curScanItem = resItem
|
||||
this.resData.list.unshift({ ...resItem })
|
||||
let param = JSON.parse(JSON.stringify(this.submitParam))
|
||||
param.billCode = this.resData.list.map(t=>t.billCode).join(",")
|
||||
await checkParams(param, this.submitValidConfig)
|
||||
let scCfBl = await confirmScanUpload({ scanType: scanTypeEnum.heBao, param, list: this.resData.list })
|
||||
if(scCfBl) {
|
||||
this.showToast('合包操作成功')
|
||||
this.resetForm()
|
||||
}
|
||||
},
|
||||
handleScanValChange: debounce(function(val){
|
||||
|
||||
handleScanValChange: debounce(async function(val){
|
||||
if(val) {
|
||||
let preBl = await preCheckScan({ scanType: scanTypeEnum.heBao, param: { ...this.submitParam, billCode: val }, list: this.resData.list })
|
||||
if(preBl) {
|
||||
// this.submitParam.billCode = ''
|
||||
}
|
||||
}
|
||||
}),
|
||||
resetForm() {
|
||||
this.submitParam.billCode = ''
|
||||
|
||||
Loading…
Reference in New Issue
Block a user