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