diff --git a/src/views/workCenter/annualRevisionPlanActivelyReport/RevisionPlanActivelyReportFlow.vue b/src/views/workCenter/annualRevisionPlanActivelyReport/RevisionPlanActivelyReportFlow.vue index 6672c2a6..d5d63909 100644 --- a/src/views/workCenter/annualRevisionPlanActivelyReport/RevisionPlanActivelyReportFlow.vue +++ b/src/views/workCenter/annualRevisionPlanActivelyReport/RevisionPlanActivelyReportFlow.vue @@ -421,12 +421,12 @@ export default { // 业务基本信息有表单,可能有表格也可能没有 const param = { ...processInfoForm, ...approvalInfoForm, ...personnelObj, ...ruleForm.formInline } const flag = Object.values(param).some(v => !!v || v === 0) - if (!flag || (ruleForm.dataSource && ruleForm.dataSource.length <= 0)) { + if (!flag && (ruleForm.dataSource && ruleForm.dataSource.length <= 0)) { // 提示至少填写一项 this.$message.warning(this.$t('pleaseFillInAtLeastOneItem')) return } - if (ruleForm.dataSource) { + if (ruleForm.dataSource && ruleForm.dataSource.length > 0) { paramObj.infoJsonStr = JSON.stringify({ dataList: ruleForm.dataSource.map(item => { return { ...item, ...ruleForm.formInline } @@ -445,22 +445,30 @@ export default { // 业务基本信息有表单也有表格 const param = { ...processInfoForm, ...approvalInfoForm, ...personnelObj, ...ruleForm.formInline } const flag = Object.values(param).some(v => !!v || v === 0) - if (!flag || ruleForm.dataSource.length <= 0) { + if (!flag && ruleForm.dataSource.length <= 0) { // 提示至少填写一项 this.$message.warning(this.$t('pleaseFillInAtLeastOneItem')) return } - paramObj.infoJsonStr = JSON.stringify({ - dataList: ruleForm.dataSource.map(item => { - return { ...item, ...ruleForm.formInline } - }), - personnelObj: personnelObj, - processDescription: this.processInfoForm.getFieldValue('processDescription') - }) + if (ruleForm.dataSource && ruleForm.dataSource.length > 0) { + paramObj.infoJsonStr = JSON.stringify({ + dataList: ruleForm.dataSource.map(item => { + return { ...item, ...ruleForm.formInline } + }), + personnelObj: personnelObj, + processDescription: this.processInfoForm.getFieldValue('processDescription') + }) + } else { + paramObj.infoJsonStr = JSON.stringify({ + dataList: [ruleForm.formInline], + personnelObj: personnelObj, + processDescription: this.processInfoForm.getFieldValue('processDescription') + }) + } } else if (this.currentNode === 5) { const param = { ...processInfoForm, ...approvalInfoForm, ...personnelObj } const flag = Object.values(param).some(v => !!v || v === 0) - if (!flag || ruleForm.dataSource.length <= 0) { + if (!flag && ruleForm.dataSource.length <= 0) { // 提示至少填写一项 this.$message.warning(this.$t('pleaseFillInAtLeastOneItem')) return diff --git a/src/views/workCenter/annualRevisionPlanActivelyReport/modules/ContactEnterSendTaskForm.vue b/src/views/workCenter/annualRevisionPlanActivelyReport/modules/ContactEnterSendTaskForm.vue index 77640f3d..de10e347 100644 --- a/src/views/workCenter/annualRevisionPlanActivelyReport/modules/ContactEnterSendTaskForm.vue +++ b/src/views/workCenter/annualRevisionPlanActivelyReport/modules/ContactEnterSendTaskForm.vue @@ -139,9 +139,12 @@ export default { this.formInline.contactUserLeaderLeader_dictText = data.flowUser ? data.flowUser.contactUserLeaderLeader_dictText : data.dataList[0].contactUserLeaderLeader_dictText this.formInline = Object.assign({}, this.formInline) // 给表格赋值 - this.$nextTick(() => { - this.$refs.tableRef.initData(data) - }) + if (data.dataList.length > 0 && data.dataList[0].applicationType) { + // 第一行数据有申请类型字段说明才有表格数据,否则有可能是保存没有填表格信息的情况 + this.$nextTick(() => { + this.$refs.tableRef.initData(data) + }) + } } else { // 下发联络人,没有表格 this.formInline.distributeFlag = data.dataList[0].distributeFlag diff --git a/src/views/workCenter/annualRevisionPlanActivelyReport/modules/ContactEnterStandardForm.vue b/src/views/workCenter/annualRevisionPlanActivelyReport/modules/ContactEnterStandardForm.vue index b78a6578..3b420964 100644 --- a/src/views/workCenter/annualRevisionPlanActivelyReport/modules/ContactEnterStandardForm.vue +++ b/src/views/workCenter/annualRevisionPlanActivelyReport/modules/ContactEnterStandardForm.vue @@ -78,9 +78,12 @@ export default { this.formInline.collectUserLeader_dictText = data.dataList[0].collectUserLeader_dictText this.formInline = Object.assign({}, this.formInline) // 给表格赋值 - this.$nextTick(() => { - this.$refs.tableRef.initData(data) - }) + if (data.dataList.length > 0 && data.dataList[0].applicationType) { + // 第一行数据有申请类型字段说明才有表格数据,否则有可能是保存没有填表格信息的情况 + this.$nextTick(() => { + this.$refs.tableRef.initData(data) + }) + } } }, initTableData (data) {