禅道bug修复
This commit is contained in:
parent
42bfc87215
commit
ab2574e691
|
|
@ -962,6 +962,7 @@ export default {
|
||||||
async submitForm(formName, submitType) {
|
async submitForm(formName, submitType) {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
let isReturn = true
|
let isReturn = true
|
||||||
|
|
||||||
if (submitType === '提交' || submitType === '保存') {
|
if (submitType === '提交' || submitType === '保存') {
|
||||||
const param = {
|
const param = {
|
||||||
...this.getParams(),
|
...this.getParams(),
|
||||||
|
|
@ -1012,6 +1013,71 @@ export default {
|
||||||
// // return false
|
// // return false
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
if (submitType === '保存') {
|
||||||
|
const reqData = new FormData()
|
||||||
|
this.formData.proId = this.$store.state.user.thisIds.proId
|
||||||
|
this.formData.supId = this.$store.state.user.thisIds.supId
|
||||||
|
this.formData.supUuid = this.$store.state.user.thisIds.supUuid
|
||||||
|
this.formData.uuid = this.$store.state.user.thisIds.uuid
|
||||||
|
this.formData.delFileIds = this.delFileIds.join(',')
|
||||||
|
this.formData.submitType = submitType
|
||||||
|
reqData.append('params', JSON.stringify(this.formData))
|
||||||
|
|
||||||
|
// 使用 Promise.all 并行处理文件数据获取,提高效率
|
||||||
|
Promise.all([
|
||||||
|
this.getFileData(this.formData.enterpriseQualificationFiles),
|
||||||
|
this.getFileData(this.formData.securityAgreementFiles),
|
||||||
|
this.getFileData(this.formData.supervisionPlanningFiles),
|
||||||
|
this.getFileData(this.formData.implementationRulesFiles),
|
||||||
|
]).then(
|
||||||
|
([
|
||||||
|
enterpriseQualificationFiles,
|
||||||
|
securityAgreementFiles,
|
||||||
|
supervisionPlanningFiles,
|
||||||
|
implementationRulesFiles,
|
||||||
|
]) => {
|
||||||
|
if (!enterpriseQualificationFiles || enterpriseQualificationFiles.length === 0) {
|
||||||
|
reqData.append('enterpriseQualificationFiles', new Blob())
|
||||||
|
} else {
|
||||||
|
enterpriseQualificationFiles.forEach(item => reqData.append('enterpriseQualificationFiles', item))
|
||||||
|
}
|
||||||
|
if (!securityAgreementFiles || securityAgreementFiles.length === 0) {
|
||||||
|
reqData.append('securityAgreementFiles', new Blob())
|
||||||
|
} else {
|
||||||
|
securityAgreementFiles.forEach(item => reqData.append('securityAgreementFiles', item))
|
||||||
|
}
|
||||||
|
if (!supervisionPlanningFiles || supervisionPlanningFiles.length === 0) {
|
||||||
|
reqData.append('supervisionPlanningFiles', new Blob())
|
||||||
|
} else {
|
||||||
|
supervisionPlanningFiles.forEach(item => reqData.append('supervisionPlanningFiles', item))
|
||||||
|
}
|
||||||
|
if (!implementationRulesFiles || implementationRulesFiles.length === 0) {
|
||||||
|
reqData.append('implementationRulesFiles', new Blob())
|
||||||
|
} else {
|
||||||
|
implementationRulesFiles.forEach(item => reqData.append('implementationRulesFiles', item))
|
||||||
|
}
|
||||||
|
addSupervisoryApply(reqData)
|
||||||
|
.then(response => {
|
||||||
|
if (submitType === '提交') {
|
||||||
|
this.loading = false
|
||||||
|
this.submitApply()
|
||||||
|
} else {
|
||||||
|
this.loading = false
|
||||||
|
this.$modal.msgSuccess('保存成功')
|
||||||
|
this.$tab.closePage()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
// 增加错误处理
|
||||||
|
this.loading = false
|
||||||
|
this.$modal.msgError('提交失败')
|
||||||
|
})
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (submitType === '保存') return
|
||||||
|
|
||||||
judgeIsFileComplete(param)
|
judgeIsFileComplete(param)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
this.$refs[formName].validate(valid => {
|
this.$refs[formName].validate(valid => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue