修改加密
This commit is contained in:
parent
b22a5822f3
commit
e488e51590
|
|
@ -265,9 +265,9 @@ export default {
|
|||
return
|
||||
}
|
||||
// 校验格式:最多两位小数点的数字
|
||||
const pattern = /^\d+(\.\d{1,2})?$/
|
||||
const pattern = /^\d+(\.\d{1,3})?$/
|
||||
if (!pattern.test(value)) {
|
||||
callback(new Error('请输入正确的金额格式,最多两位小数点'))
|
||||
callback(new Error('请输入正确的金额格式,最多三位小数点'))
|
||||
return
|
||||
}
|
||||
// 转换为数字进行范围校验
|
||||
|
|
@ -277,8 +277,8 @@ export default {
|
|||
return
|
||||
}
|
||||
// 校验范围:0-99999999.99
|
||||
if (numValue < 0 || numValue > 99999999.99) {
|
||||
callback(new Error('金额范围应在0-99999999.99元之间'))
|
||||
if (numValue < 0 || numValue > 99999999.999) {
|
||||
callback(new Error('金额范围应在0-99999999.999元之间'))
|
||||
return
|
||||
}
|
||||
callback()
|
||||
|
|
@ -364,57 +364,40 @@ export default {
|
|||
}
|
||||
|
||||
try {
|
||||
let dataUpdateId='';
|
||||
let dataDelFileId='';
|
||||
debugger
|
||||
// 如果是修改,添加id
|
||||
// 如果是修改,添加id和删除文件ID
|
||||
if (this.formType === 2 && this.editId) {
|
||||
dataUpdateId = this.editId
|
||||
// 找出被删除的文件id集合(判空处理)
|
||||
if (Array.isArray(this.allFileList) && this.allFileList.length > 0) {
|
||||
const delFileList = this.allFileList.filter(
|
||||
(item) => !this.paymentFailForm.fileList.some((file) => file.id === item.id)
|
||||
)
|
||||
dataDelFileId = delFileList.length > 0 ? delFileList.map((item) => item.id).join(',') : ''
|
||||
}
|
||||
}
|
||||
|
||||
// 组装FormData
|
||||
const formData = new FormData()
|
||||
|
||||
// 添加表单字段(同步config.js中的字段名)
|
||||
formData.append(
|
||||
'userName',
|
||||
this.paymentFailForm.userName,
|
||||
)
|
||||
formData.append('idCard', this.paymentFailForm.idCard)
|
||||
formData.append('proName', this.paymentFailForm.proName)
|
||||
formData.append('subName', this.paymentFailForm.subName)
|
||||
formData.append(
|
||||
'failMonth',
|
||||
this.paymentFailForm.failMonth,
|
||||
)
|
||||
formData.append('money', this.paymentFailForm.money)
|
||||
formData.append(
|
||||
'failReason',
|
||||
this.paymentFailForm.failReason,
|
||||
)
|
||||
formData.append(
|
||||
'failStatus',
|
||||
this.paymentFailForm.failStatus,
|
||||
)
|
||||
formData.append(
|
||||
'remark',
|
||||
this.paymentFailForm.remark || '',
|
||||
)
|
||||
|
||||
// 如果是修改,添加id
|
||||
if (this.formType === 2 && this.editId) {
|
||||
formData.append('id', this.editId)
|
||||
|
||||
// 找出被删除的文件id集合
|
||||
const delFileList = this.allFileList.filter(
|
||||
(item) => {
|
||||
return !this.paymentFailForm.fileList.some(
|
||||
(file) => file.id === item.id,
|
||||
)
|
||||
},
|
||||
)
|
||||
if (delFileList.length > 0) {
|
||||
formData.append(
|
||||
'delFileId',
|
||||
delFileList
|
||||
.map((item) => item.id)
|
||||
.join(','),
|
||||
)
|
||||
}
|
||||
const params = {
|
||||
userName:this.paymentFailForm.userName,
|
||||
idCard: this.paymentFailForm.idCard,
|
||||
proName:this.paymentFailForm.proName,
|
||||
subName:this.paymentFailForm.subName,
|
||||
failMonth:this.paymentFailForm.failMonth,
|
||||
money:this.paymentFailForm.money,
|
||||
failStatus:this.paymentFailForm.failStatus,
|
||||
failReason: this.paymentFailForm.failReason,
|
||||
remark: this.paymentFailForm.remark || '',
|
||||
id:dataUpdateId,
|
||||
delFileId:dataDelFileId
|
||||
}
|
||||
|
||||
console.log(params)
|
||||
//参数封装
|
||||
formData.append('params', JSON.stringify(params))
|
||||
// 添加文件
|
||||
if (
|
||||
this.paymentFailForm.fileList &&
|
||||
|
|
@ -426,7 +409,6 @@ export default {
|
|||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 调用API
|
||||
const API =
|
||||
this.formType === 1
|
||||
|
|
|
|||
Loading…
Reference in New Issue