Explorar o código

fix: 修改bug

shiyanyu hai 2 semanas
pai
achega
fde2482e50

+ 9 - 4
src/views/costAudit/auditInfo/auditManage/costAudit.vue

@@ -18,7 +18,7 @@
                   label="1"
                   @change="handleTemplateTypeChange"
                 >
-                  选择调查表修改核定表
+                  选择调查表生成核定表
                 </el-radio>
                 <el-select
                   v-model="auditForm.dataTable"
@@ -81,7 +81,7 @@
         size="small"
         @click="handleSaveTemplate"
       >
-        保存核定模
+        保存核定模
       </el-button>
       <el-button
         v-if="showButtons"
@@ -89,7 +89,7 @@
         size="small"
         @click="handleExportTemplate"
       >
-        导出模
+        导出模
       </el-button>
       <el-button
         v-if="showButtons"
@@ -695,8 +695,13 @@
         }
       },
       handleGenerateTemplate() {
+        // 先校验是否选择了“核定表生成方式”
+        if (!this.auditForm || !this.auditForm.templateType) {
+          this.$message.error('请先选择核定表生成方式')
+          return
+        }
         this.$confirm(
-          '生成后不能修改根据调查表生成还是根据历史核定模板生成,确定生成模板吗?',
+          '核定表生成后,不再支持修改生成方式。确定生成模板吗?',
           '提示',
           {
             confirmButtonText: '确定',

+ 2 - 1
src/views/costAudit/auditInfo/auditManage/details.vue

@@ -872,9 +872,10 @@
           }
 
           const response = await doProcessBtn(params)
+          console.log('操作结果:', response)
 
           if (response && response.code === 200) {
-            this.$message.success(this.project.currentNodeName + '通过')
+            this.$message.success(response.value)
             // 关闭所有弹窗
             this.showSupplementDialog = false
             this.showAbortDialog = false

+ 33 - 15
src/views/costAudit/auditInfo/auditManage/mainDetails.vue

@@ -162,6 +162,7 @@
               style="width: 100%"
               filterable
               clearable
+              multiple
             >
               <el-option
                 v-for="(item, index) in nextUserList"
@@ -420,7 +421,7 @@
         // 流转/退回操作参数
         processParams: {
           content: '', // 意见
-          userIds: '', // 下一步环节办理人员
+          userIds: [], // 下一步环节从办人员(多选)
           leaderIds: '',
           // sendType: [], // 发送方式
         },
@@ -559,7 +560,7 @@
         this.currentProcessType = ''
         this.processParams = {
           content: '',
-          userIds: '',
+          userIds: [],
           leaderIds: '',
           userIdNames: '',
         }
@@ -614,12 +615,24 @@
         } catch (e) {}
       },
       // 根据选择的 userId 反查 fullname(用于提交 userIdNames)
-      getSelectedNextUserFullname(userId) {
-        if (!userId) return ''
-        const matched = (this.nextUserList || []).find(
-          (u) => String(u.userId) === String(userId)
-        )
-        return matched?.fullname || ''
+      getSelectedNextUserFullname(userIds) {
+        if (!userIds) return ''
+        const ids = Array.isArray(userIds)
+          ? userIds
+          : String(userIds)
+              .split(',')
+              .map((s) => s.trim())
+              .filter(Boolean)
+        if (!ids.length) return ''
+        return ids
+          .map((id) => {
+            const matched = (this.nextUserList || []).find(
+              (u) => String(u.userId) === String(id)
+            )
+            return matched?.fullname || ''
+          })
+          .filter(Boolean)
+          .join(',')
       },
       handleClose() {
         // 关闭弹窗时更新本地状态并触发事件
@@ -659,7 +672,7 @@
         this.currentProcessType = 'next'
         this.processParams = {
           content: '',
-          userIds: '',
+          userIds: [],
           leaderIds: '',
           userIdNames: '',
           // sendType: [],
@@ -674,7 +687,7 @@
         this.currentProcessType = 'prev'
         this.processParams = {
           content: '',
-          userIds: '',
+          userIds: [],
           leaderIds: '',
           userIdNames: '',
           // userIds: [],
@@ -687,7 +700,7 @@
         this.currentProcessType = 'complete'
         this.processParams = {
           content: '',
-          userIds: '',
+          userIds: [],
           leaderIds: '',
           userIdNames: '',
           // sendType: [],
@@ -702,11 +715,14 @@
           return
         }
         // 主办人员和从办人员必须选择 缺一不可
-        if (!this.processParams.userIds && this.processParams.leaderIds) {
+        const userIdsEmpty = Array.isArray(this.processParams.userIds)
+          ? this.processParams.userIds.length === 0
+          : !this.processParams.userIds
+        if (userIdsEmpty && this.processParams.leaderIds) {
           this.$message.warning('请选择从办人员')
           return
         }
-        if (this.processParams.userIds && !this.processParams.leaderIds) {
+        if (!userIdsEmpty && !this.processParams.leaderIds) {
           this.$message.warning('请选择主办人员')
           return
         }
@@ -742,7 +758,9 @@
             key: keyValue,
             // sendType: this.processParams.sendType.join(','), // 发送方式用","分割
             content: this.processParams.content || '', // 意见
-            userIds: this.processParams.userIds || '',
+            userIds: Array.isArray(this.processParams.userIds)
+              ? this.processParams.userIds.join(',')
+              : this.processParams.userIds || '',
             leaderIds: this.processParams.leaderIds || '',
           }
 
@@ -771,7 +789,7 @@
             // 重置参数
             this.processParams = {
               content: '',
-              userIds: '',
+              userIds: [],
               leaderIds: '',
               userIdNames: '',
               // sendType: [],

+ 4 - 3
src/views/costAudit/auditInfo/auditManage/workDraft.vue

@@ -161,6 +161,7 @@
         <el-form-item label="日期">
           <el-date-picker
             v-model="workingPaperForm.auditDate"
+            :disabled="true"
             type="date"
             placeholder="选择日期"
             style="width: 100%"
@@ -263,7 +264,7 @@
         workingPaperRecords: [],
         // 工作底稿弹窗
         workingPaperDialogVisible: false,
-        workingPaperDialogTitle: '添加工作底稿',
+        workingPaperDialogTitle: '新增核增核减记录',
         isEditWorkingPaper: false,
         workingPaperForm: {
           id: '',
@@ -539,7 +540,7 @@
       // 工作底稿操作
       handleAddWorkingPaper() {
         this.isEditWorkingPaper = false
-        this.workingPaperDialogTitle = '添加工作底稿'
+        this.workingPaperDialogTitle = '新增核增核减记录'
         this.workingPaperForm = {
           id: '',
           subject: '',
@@ -561,7 +562,7 @@
 
       handleEditWorkingPaper(row) {
         this.isEditWorkingPaper = true
-        this.workingPaperDialogTitle = '修改工作底稿'
+        this.workingPaperDialogTitle = '修改核增核减记录'
         // 解析时间字符串
         let auditDate = new Date()
         let startTime = null

+ 85 - 11
src/views/costAudit/baseInfo/costFormManage/infoMaintain.vue

@@ -1001,7 +1001,12 @@
                     ></el-input>
                   </template>
                 </el-table-column> -->
-                <el-table-column label="操作" align="center" fixed="right">
+                <el-table-column
+                  label="操作"
+                  align="center"
+                  fixed="right"
+                  width="180"
+                >
                   <template slot-scope="scope">
                     <div class="table-actions">
                       <el-button
@@ -3817,6 +3822,79 @@
         // 防止重复点击
         if (this.contentSaving) return
 
+        // 表头“格式”必填校验(布尔值除外)
+        const validateHeaderFormatRequired = (headers, tableLabel = '') => {
+          if (!Array.isArray(headers) || headers.length === 0) return true
+
+          // 仅校验:字段类型非 boolean 时,格式相关字段必填
+          for (let i = 0; i < headers.length; i++) {
+            const h = headers[i] || {}
+            const fieldName = h.fieldName || `第${i + 1}行`
+            const fieldType = String(h.fieldType || '').trim()
+            if (fieldType === 'boolean') continue
+
+            let ok = true
+            let msg = ''
+
+            if (fieldType === 'string') {
+              ok = String(h.format || '').trim() !== ''
+              msg = `【${tableLabel}】字段“${fieldName}”的格式(长度)为必填`
+            } else if (fieldType === 'integer') {
+              ok = String(h.fieldTypelen || '').trim() !== ''
+              msg = `【${tableLabel}】字段“${fieldName}”的格式(整数位数)为必填`
+            } else if (fieldType === 'double') {
+              ok = String(h.fieldTypenointlen || '').trim() !== ''
+              msg = `【${tableLabel}】字段“${fieldName}”的格式(小数位数)为必填`
+            } else if (fieldType === 'datetime') {
+              ok = String(h.format || '').trim() !== ''
+              msg = `【${tableLabel}】字段“${fieldName}”的格式(日期格式)为必填`
+            } else {
+              // 兜底:其它类型(若后续扩展)统一要求 format
+              ok = String(h.format || '').trim() !== ''
+              msg = `【${tableLabel}】字段“${fieldName}”的格式为必填`
+            }
+
+            if (!ok) {
+              this.$message && this.$message.error && this.$message.error(msg)
+              this.scrollToErrorRow && this.scrollToErrorRow(i)
+              return false
+            }
+          }
+          return true
+        }
+
+        // 仅在可编辑且保存表头时校验(内容维护“格式”列)
+        if (!this.viewDetail) {
+          if (type === '单记录') {
+            if (
+              !validateHeaderFormatRequired(
+                this.contentEditForm.tableHeaders,
+                '单记录'
+              )
+            ) {
+              return
+            }
+          } else if (type === '固定表表头') {
+            if (
+              !validateHeaderFormatRequired(
+                this.contentEditForm.fixedTable.tableHeaders,
+                '固定表表头'
+              )
+            ) {
+              return
+            }
+          } else if (type === '动态表表头') {
+            if (
+              !validateHeaderFormatRequired(
+                this.contentEditForm.dynamicTable.tableHeaders,
+                '动态表表头'
+              )
+            ) {
+              return
+            }
+          }
+        }
+
         this.loading = true
         this.contentSaving = true
         let isValid = false
@@ -4336,8 +4414,8 @@
           // 递归处理子节点 - 修复:按orderNum排序后再处理
           if (node.children && node.children.length > 0) {
             // 按orderNum排序子项,确保发送给后端的数据顺序正确
-            const sortedChildren = [...node.children].sort((a, b) =>
-              (a.orderNum || 0) - (b.orderNum || 0)
+            const sortedChildren = [...node.children].sort(
+              (a, b) => (a.orderNum || 0) - (b.orderNum || 0)
             )
             sortedChildren.forEach((childNode) => {
               processNode(childNode)
@@ -4430,8 +4508,8 @@
           // 递归处理子节点 - 修复:按orderNum排序后再处理
           if (node.children && node.children.length > 0) {
             // 按orderNum排序子项,确保发送给后端的数据顺序正确
-            const sortedChildren = [...node.children].sort((a, b) =>
-              (a.orderNum || 0) - (b.orderNum || 0)
+            const sortedChildren = [...node.children].sort(
+              (a, b) => (a.orderNum || 0) - (b.orderNum || 0)
             )
             sortedChildren.forEach((childNode) => {
               processNode(childNode)
@@ -4677,9 +4755,7 @@
 
         // 对子项进行排序 - 修复:启用子项排序
         parentItems.forEach((parent) => {
-          parent.children.sort(
-            (a, b) => (a.orderNum || 0) - (b.orderNum || 0)
-          )
+          parent.children.sort((a, b) => (a.orderNum || 0) - (b.orderNum || 0))
           treeData.push(parent)
         })
 
@@ -4814,9 +4890,7 @@
 
         // 对子项进行排序 - 修复:启用子项排序
         parentItems.forEach((parent) => {
-          parent.children.sort(
-            (a, b) => (a.orderNum || 0) - (b.orderNum || 0)
-          )
+          parent.children.sort((a, b) => (a.orderNum || 0) - (b.orderNum || 0))
           treeData.push(parent)
         })
 

+ 71 - 0
src/views/costAudit/baseInfo/financeSheetManage/infoMaintain.vue

@@ -3473,6 +3473,77 @@
       },
       // 保存内容
       handleSaveContent(type, action) {
+        // 表头“格式”必填校验(布尔值除外)
+        const validateHeaderFormatRequired = (headers, tableLabel = '') => {
+          if (!Array.isArray(headers) || headers.length === 0) return true
+
+          for (let i = 0; i < headers.length; i++) {
+            const h = headers[i] || {}
+            const fieldName = h.fieldName || `第${i + 1}行`
+            const fieldType = String(h.fieldType || '').trim()
+            if (fieldType === 'boolean') continue
+
+            let ok = true
+            let msg = ''
+
+            if (fieldType === 'string') {
+              ok = String(h.format || '').trim() !== ''
+              msg = `【${tableLabel}】字段“${fieldName}”的格式(长度)为必填`
+            } else if (fieldType === 'integer') {
+              ok = String(h.fieldTypelen || '').trim() !== ''
+              msg = `【${tableLabel}】字段“${fieldName}”的格式(整数位数)为必填`
+            } else if (fieldType === 'double') {
+              ok = String(h.fieldTypenointlen || '').trim() !== ''
+              msg = `【${tableLabel}】字段“${fieldName}”的格式(小数位数)为必填`
+            } else if (fieldType === 'datetime') {
+              ok = String(h.format || '').trim() !== ''
+              msg = `【${tableLabel}】字段“${fieldName}”的格式(日期格式)为必填`
+            } else {
+              ok = String(h.format || '').trim() !== ''
+              msg = `【${tableLabel}】字段“${fieldName}”的格式为必填`
+            }
+
+            if (!ok) {
+              this.$message && this.$message.error && this.$message.error(msg)
+              this.scrollToErrorRow && this.scrollToErrorRow(i)
+              return false
+            }
+          }
+          return true
+        }
+
+        // 仅在可编辑且保存表头时校验(内容维护“格式”列)
+        if (!this.viewDetail) {
+          if (type === '单记录') {
+            if (
+              !validateHeaderFormatRequired(
+                this.contentEditForm.tableHeaders,
+                '单记录'
+              )
+            ) {
+              return
+            }
+          } else if (type === '固定表表头') {
+            if (
+              !validateHeaderFormatRequired(
+                this.contentEditForm.fixedTable.tableHeaders,
+                '固定表表头'
+              )
+            ) {
+              return
+            }
+          } else if (type === '动态表表头') {
+            if (
+              !validateHeaderFormatRequired(
+                this.contentEditForm.dynamicTable.tableHeaders,
+                '动态表表头'
+              )
+            ) {
+              return
+            }
+          }
+        }
+
         this.loading = true
         let isValid = false
         try {