uu
This commit is contained in:
parent
c5f3c11343
commit
46df49c082
@ -4,7 +4,7 @@ const checkParams = (param, validConfig)=> {
|
|||||||
let errMsg = ''
|
let errMsg = ''
|
||||||
Object.keys(validConfig).map(key=> {
|
Object.keys(validConfig).map(key=> {
|
||||||
const itemConf = validConfig[key]
|
const itemConf = validConfig[key]
|
||||||
if(!errMsg && itemConf.required && !param[key]) {
|
if(!errMsg && itemConf.required && (!param[key] || param[key]?.length == 0)) {
|
||||||
errMsg = itemConf.requiredMsg || `${itemConf.label}不能为空`
|
errMsg = itemConf.requiredMsg || `${itemConf.label}不能为空`
|
||||||
}
|
}
|
||||||
let customerValidMsg = itemConf?.validMsgFun?.({ val: param })
|
let customerValidMsg = itemConf?.validMsgFun?.({ val: param })
|
||||||
|
|||||||
@ -52,6 +52,7 @@
|
|||||||
import { debounce } from "@/common/util"
|
import { debounce } from "@/common/util"
|
||||||
import * as apiService from "@/common/api"
|
import * as apiService from "@/common/api"
|
||||||
import BpeGoodphotoTmp from "@/components/buns-post-edit-templates/bpe-goodphoto-tmp"
|
import BpeGoodphotoTmp from "@/components/buns-post-edit-templates/bpe-goodphoto-tmp"
|
||||||
|
import { checkParams } from "@/common/validate"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components:{ BpeGoodphotoTmp },
|
components:{ BpeGoodphotoTmp },
|
||||||
@ -69,7 +70,14 @@
|
|||||||
problemType: '', // 问题类型
|
problemType: '', // 问题类型
|
||||||
problemCause: "", // 问题件原因
|
problemCause: "", // 问题件原因
|
||||||
sendSiteCode: "", // 通知网点代码
|
sendSiteCode: "", // 通知网点代码
|
||||||
filePath: "", // 图片路径
|
filePath: [], // 图片路径
|
||||||
|
},
|
||||||
|
submitValidConfig: {
|
||||||
|
billCode: { required: true, requiredMsg: '运单号不能为空' },
|
||||||
|
problemType: { required: true, requiredMsg: '问题类型不能为空' },
|
||||||
|
problemCause: { required: true, requiredMsg: '问题描述不能为空' },
|
||||||
|
sendSiteCode: { required: true, requiredMsg: '网点不能为空' },
|
||||||
|
filePath: { required: true, requiredMsg: '图片不能为空' },
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -100,9 +108,10 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
async handleSubmit() {
|
async handleSubmit() {
|
||||||
let params = JSON.parse(JSON.stringify(this.submitParam));
|
await checkParams(this.submitParam, this.submitValidConfig)
|
||||||
params.filePath = params.filePath?.join?.(",") || ''
|
let extParams = {}
|
||||||
await apiService.registerProblemInfo({ ...params, _loading: true })
|
extParams.filePath = this.submitParam.filePath?.join?.(",") || ''
|
||||||
|
await apiService.registerProblemInfo({ ...this.submitParam, ...extParams, _loading: true })
|
||||||
this.showToast('操作成功')
|
this.showToast('操作成功')
|
||||||
this.resetForm()
|
this.resetForm()
|
||||||
// this.goBack()
|
// this.goBack()
|
||||||
@ -110,7 +119,7 @@
|
|||||||
resetForm() {
|
resetForm() {
|
||||||
this.submitParam.billCode = ''
|
this.submitParam.billCode = ''
|
||||||
this.submitParam.sendSiteCode = ''
|
this.submitParam.sendSiteCode = ''
|
||||||
this.submitParam.filePath = ''
|
this.submitParam.filePath = []
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,6 +10,10 @@
|
|||||||
iconPos="left"></tpx-scan-input>
|
iconPos="left"></tpx-scan-input>
|
||||||
</view>
|
</view>
|
||||||
</u-row>
|
</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">
|
<view class="mt-20">
|
||||||
<bpe-goodphoto-tmp title="留仓拍照" :value="submitParam" filedName="picUrl"></bpe-goodphoto-tmp>
|
<bpe-goodphoto-tmp title="留仓拍照" :value="submitParam" filedName="picUrl"></bpe-goodphoto-tmp>
|
||||||
</view>
|
</view>
|
||||||
@ -36,25 +40,31 @@
|
|||||||
import * as apiService from "@/common/api"
|
import * as apiService from "@/common/api"
|
||||||
import BpeGoodphotoTmp from "@/components/buns-post-edit-templates/bpe-goodphoto-tmp"
|
import BpeGoodphotoTmp from "@/components/buns-post-edit-templates/bpe-goodphoto-tmp"
|
||||||
import { scanTypeEnum, getScanParams, ansScanResponse } from "@/common/scanUtil"
|
import { scanTypeEnum, getScanParams, ansScanResponse } from "@/common/scanUtil"
|
||||||
|
import { checkParams } from "@/common/validate"
|
||||||
|
|
||||||
import {
|
|
||||||
goto
|
|
||||||
} from "@/common/untool"
|
|
||||||
export default {
|
export default {
|
||||||
components:{ BpeGoodphotoTmp },
|
components:{ BpeGoodphotoTmp },
|
||||||
props: {
|
props: {
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
dicData() {
|
||||||
|
return this.$store.getters.dicData
|
||||||
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
submitParam: {
|
submitParam: {
|
||||||
billCode: '',
|
billCode: '',
|
||||||
picUrl: '',
|
keepType: '',
|
||||||
remark: ''
|
picUrl: [],
|
||||||
|
remark: '',
|
||||||
|
},
|
||||||
|
submitValidConfig: {
|
||||||
|
billCode: { required: true, requiredMsg: '运单号不能为空' },
|
||||||
|
keepType: { required: true, requiredMsg: '留仓类型不能为空' },
|
||||||
|
// picUrl: { required: true, requiredMsg: '图片不能为空' },
|
||||||
|
// remark: { required: true, requiredMsg: '备注不能为空' },
|
||||||
},
|
},
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onShareAppMessage() {
|
onShareAppMessage() {
|
||||||
@ -73,8 +83,10 @@
|
|||||||
|
|
||||||
},
|
},
|
||||||
async handleSubmit() {
|
async handleSubmit() {
|
||||||
this.submitParam.picUrl = this.submitParam.picUrl?.join?.(",") || ''
|
await checkParams(this.submitParam, this.submitValidConfig)
|
||||||
let scnParam = getScanParams(scanTypeEnum.liuCang, { ...this.submitParam })
|
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 res = await apiService.scanRecord({...scnParam, _loading: true})
|
||||||
let { bl, resItem } = ansScanResponse({ res, title: "留仓" })
|
let { bl, resItem } = ansScanResponse({ res, title: "留仓" })
|
||||||
if(bl) {
|
if(bl) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user