From 655113cee1bba40c1ae9a6c761670bbd5bfdf299 Mon Sep 17 00:00:00 2001 From: lideqin <694785430@qq.com> Date: Sun, 4 Feb 2024 15:43:16 +0800 Subject: [PATCH] =?UTF-8?q?[update]=20=E4=BF=AE=E6=94=B9=E5=90=84=E9=83=A8?= =?UTF-8?q?=E9=97=A8=E4=B8=BB=E5=8A=A8=E4=B8=8A=E6=8A=A5=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E7=9A=84=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../RevisionPlanActivelyReportFlow.vue | 30 ++++++++++++------- .../modules/ContactEnterSendTaskForm.vue | 9 ++++-- .../modules/ContactEnterStandardForm.vue | 9 ++++-- 3 files changed, 31 insertions(+), 17 deletions(-) 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) {