Browse Source

feat: 成本调查表固定表完成,修改立项信息数据显示,注释发送方式

shiyanyu 1 month ago
parent
commit
73ed2c464d

+ 1 - 1
src/api/audit/survey.js

@@ -11,7 +11,7 @@ export function getSurveyList(data) {
   })
 }
 
-// 记录成本调查表
+// 记录成本调查表
 export function getSingleRecordSurveyList(data) {
   return request({
     url: url + '/api/enterprise/castTaskInfo/listItemsByCurrentTemplateId',

+ 4 - 4
src/components/task/taskComponents/basicInfoTab.vue

@@ -146,16 +146,16 @@
       <!-- 是否参加听证 -->
       <el-form-item label="是否参加听证:" prop="needHearing">
         <el-radio-group v-model="formData.basicInfo.needHearing">
-          <el-radio label="0">是</el-radio>
-          <el-radio label="1">否</el-radio>
+          <el-radio :label="'0'">是</el-radio>
+          <el-radio :label="'1'">否</el-radio>
         </el-radio-group>
       </el-form-item>
 
       <!-- 是否应急项目 -->
       <el-form-item label="是否应急项目:" prop="isEmergency">
         <el-radio-group v-model="formData.basicInfo.isEmergency">
-          <el-radio label="0">是</el-radio>
-          <el-radio label="1">否</el-radio>
+          <el-radio :label="'0'">是</el-radio>
+          <el-radio :label="'1'">否</el-radio>
         </el-radio-group>
       </el-form-item>
 

+ 4 - 4
src/components/task/taskInfo.vue

@@ -178,14 +178,14 @@
               </el-form-item>
               <el-form-item label="是否参加听证:">
                 <el-radio-group v-model="formData.basicInfo.needHearing">
-                  <el-radio :label="0">是</el-radio>
-                  <el-radio :label="1">否</el-radio>
+                  <el-radio :label="'0'">是</el-radio>
+                  <el-radio :label="'1'">否</el-radio>
                 </el-radio-group>
               </el-form-item>
               <el-form-item label="是否应急项目:">
                 <el-radio-group v-model="formData.basicInfo.isEmergency">
-                  <el-radio :label="0">是</el-radio>
-                  <el-radio :label="1">否</el-radio>
+                  <el-radio :label="'0'">是</el-radio>
+                  <el-radio :label="'1'">否</el-radio>
                 </el-radio-group>
               </el-form-item>
               <el-form-item label="立项理由:">

+ 87 - 7
src/views/EntDeclaration/auditTaskManagement/components/CostSurveyTab.vue

@@ -27,7 +27,18 @@
       :table-items="tableItems"
       :audit-periods="auditPeriods"
       :is-view-mode="isViewMode"
+      :audited-unit-id="auditedUnitId"
+      :upload-id="
+        currentSurveyRow && currentSurveyRow.id ? currentSurveyRow.id : uploadId
+      "
+      :survey-template-id="
+        currentSurveyRow && currentSurveyRow.surveyTemplateId
+          ? currentSurveyRow.surveyTemplateId
+          : surveyTemplateId
+      "
+      :catalog-id="catalogId"
       @save="handleFixedTableSave"
+      @refresh="handleRefresh"
     />
 
     <!-- 动态表填报弹窗 -->
@@ -247,6 +258,11 @@
         type: String,
         default: '',
       },
+      // 监审期间(从立项信息中获取)
+      auditPeriod: {
+        type: [String, Array],
+        default: null,
+      },
     },
     data() {
       return {
@@ -314,8 +330,9 @@
           // 接口调用完成后会自动打开弹窗(在 initFormFields 中处理)
         } else if (row.tableType === '固定表') {
           // 如果表格类型是"固定表",弹出固定表填报弹窗
-          this.initFixedTableData()
-          this.fixedTableDialogVisible = true
+          // 调用接口获取固定表配置
+          await this.initFixedTableData()
+          // 接口调用完成后会自动打开弹窗(在 initFixedTableData 中处理)
         } else if (row.tableType === '动态表') {
           // 如果表格类型是"动态表",弹出动态表填报弹窗
           this.initDynamicTableData()
@@ -532,17 +549,77 @@
         ]
       },
       // 初始化固定表数据
-      initFixedTableData() {
-        // 如果当前行有表格配置,则使用
-        if (this.currentSurveyRow && this.currentSurveyRow.tableItems) {
+      async initFixedTableData() {
+        // 如果是固定表类型,调用接口获取固定表配置
+        if (
+          this.currentSurveyRow &&
+          this.currentSurveyRow.tableType === '固定表' &&
+          this.currentSurveyRow.surveyTemplateId
+        ) {
+          try {
+            const params = {
+              surveyTemplateId: this.currentSurveyRow.surveyTemplateId,
+            }
+            const res = await getSingleRecordSurveyList(params)
+            console.log('固定表配置数据', res)
+            if (res && res.code === 200 && res.value) {
+              // 将接口返回的数据转换为固定表配置格式
+              // 固定表使用 itemlist,不使用 fixedFields 和 fixedFieldids
+              const { itemlist } = res.value
+              console.log('itemlist', itemlist)
+              // 如果有 itemlist,使用 itemlist 作为表格项配置
+              if (itemlist && Array.isArray(itemlist) && itemlist.length > 0) {
+                this.tableItems = itemlist.map((item, index) => ({
+                  id: item.id || item.itemId || '',
+                  rowid: item.rowid || item.id || item.itemId || '', // rowid 用于父子关系
+                  seq: item.序号, // 序号就是序号
+                  itemName: item.项目 || '', // 项目就是项目
+                  unit: item.unit || '', // 单位是 unit
+                  isCategory: item.isCategory || false,
+                  categorySeq: item.categorySeq || '',
+                  categoryId: item.categoryId || '',
+                  parentid:
+                    item.parentid !== undefined
+                      ? item.parentid
+                      : item.parentId !== undefined
+                      ? item.parentId
+                      : '-1', // 父项ID,默认为 '-1'(父项)
+                  validateRules: item.validateRules || {},
+                  linkageRules: item.linkageRules || {},
+                  children: item.children || [],
+                  ...item, // 保留其他字段
+                }))
+              } else {
+                // 如果没有 itemlist,使用假数据
+                this.tableItems = this.getMockTableItems()
+              }
+            } else {
+              // 接口返回失败,使用默认配置
+              this.tableItems = this.getMockTableItems()
+            }
+          } catch (err) {
+            console.error('获取固定表配置失败', err)
+            // 出错时使用默认配置
+            this.tableItems = this.getMockTableItems()
+          }
+        } else if (this.currentSurveyRow && this.currentSurveyRow.tableItems) {
+          // 如果当前行有表格配置,则使用
           this.tableItems = this.currentSurveyRow.tableItems
         } else {
           // 使用假数据作为测试(实际开发中应该从后台获取)
           this.tableItems = this.getMockTableItems()
         }
 
-        // 初始化监审期间
-        if (this.currentSurveyRow && this.currentSurveyRow.auditPeriod) {
+        // 初始化监审期间(从立项信息中获取)
+        if (this.auditPeriod) {
+          // 如果传入了监审期间,使用传入的值
+          if (Array.isArray(this.auditPeriod)) {
+            this.auditPeriods = this.auditPeriod.map((p) => String(p))
+          } else {
+            this.auditPeriods = this.parseAuditPeriod(this.auditPeriod)
+          }
+        } else if (this.currentSurveyRow && this.currentSurveyRow.auditPeriod) {
+          // 如果当前行有监审期间,使用当前行的
           this.auditPeriods = this.parseAuditPeriod(
             this.currentSurveyRow.auditPeriod
           )
@@ -555,6 +632,9 @@
             String(currentYear),
           ]
         }
+
+        // 打开弹窗
+        this.fixedTableDialogVisible = true
       },
       // 解析监审期间字符串(如 "2022,2023,2024" 或 "2022-2024")
       parseAuditPeriod(periodStr) {

+ 320 - 96
src/views/EntDeclaration/auditTaskManagement/components/FixedTableDialog.vue

@@ -18,10 +18,7 @@
       <!-- 序号列 -->
       <el-table-column prop="seq" label="序号" width="80" align="center">
         <template slot-scope="scope">
-          <span v-if="scope.row.isCategory" class="category-seq">
-            {{ scope.row.categorySeq }}
-          </span>
-          <span v-else>{{ scope.row.seq }}</span>
+          <span>{{ scope.row.seq }}</span>
         </template>
       </el-table-column>
 
@@ -90,6 +87,7 @@
 
 <script>
   import { Message } from 'element-ui'
+  import { saveSingleRecordSurvey, getSurveyDetail } from '@/api/audit/survey'
 
   export default {
     name: 'FixedTableDialog',
@@ -146,6 +144,26 @@
         type: Boolean,
         default: false,
       },
+      // 被监审单位ID
+      auditedUnitId: {
+        type: String,
+        default: '',
+      },
+      // 上传记录ID
+      uploadId: {
+        type: String,
+        default: '',
+      },
+      // 成本调查表模板ID
+      surveyTemplateId: {
+        type: String,
+        default: '',
+      },
+      // 目录ID
+      catalogId: {
+        type: String,
+        default: '',
+      },
     },
     data() {
       return {
@@ -157,10 +175,14 @@
     },
     watch: {
       visible: {
-        handler(newVal) {
+        async handler(newVal) {
           this.dialogVisible = newVal
           if (newVal) {
+            // 先初始化表格数据
             this.initTableData()
+            // 等待 DOM 更新后,如果有 uploadId,调用接口获取详情数据并回显
+            await this.$nextTick()
+            this.loadDetailData()
           }
         },
         immediate: true,
@@ -245,96 +267,215 @@
           return
         }
 
-        // 将嵌套结构转换为扁平结构(递归处理)
+        // 根据 parentid 关系排列:parentid 为 '-1' 的是父项,子项的 parentid 等于父项的 rowid/id
         const flatData = []
-        let seq = 1
+        const processedIds = new Set()
 
-        const processItem = (item, parentCategory = null) => {
-          if (item.isCategory) {
-            // 分类行
-            const categoryRow = {
-              ...item,
-              seq: item.categorySeq || item.id,
-              isCategory: true,
-              categorySeq: item.categorySeq || item.id,
-            }
+        // 先处理所有父项(parentid 为 '-1')
+        this.tableItems.forEach((item) => {
+          const parentid = item.parentid
+          const rowid = item.rowid || item.id
 
-            // 初始化年份数据(分类行也可以有数据)
-            this.yearColumns.forEach((year) => {
-              categoryRow[`year_${year}`] = item[`year_${year}`] || ''
-            })
+          if (parentid === '-1' || parentid === -1) {
+            const rowData = this.createRowData(item, false, rowid)
+            flatData.push(rowData)
+            processedIds.add(rowid)
+          }
+        })
 
-            // 如果有传入的数据,填充值
-            if (this.surveyData && this.surveyData[item.id]) {
-              const savedData = this.surveyData[item.id]
-              this.yearColumns.forEach((year) => {
-                if (savedData[year] !== undefined) {
-                  categoryRow[`year_${year}`] = savedData[year]
-                }
-              })
-            }
+        // 再处理所有子项,紧跟在父项后面,按正序排列
+        // 先收集所有子项,按序号或顺序排序
+        const childItems = this.tableItems.filter((item) => {
+          const rowid = item.rowid || item.id
+          const parentid = item.parentid
+          return (
+            !processedIds.has(rowid) && parentid !== '-1' && parentid !== -1
+          )
+        })
 
-            flatData.push(categoryRow)
+        // 对子项按序号正序排序
+        childItems.sort((a, b) => {
+          const seqA =
+            a.seq !== undefined
+              ? typeof a.seq === 'number'
+                ? a.seq
+                : parseInt(a.seq) || 0
+              : 0
+          const seqB =
+            b.seq !== undefined
+              ? typeof b.seq === 'number'
+                ? b.seq
+                : parseInt(b.seq) || 0
+              : 0
+          return seqA - seqB
+        })
 
-            // 处理分类下的子项
-            if (item.children && Array.isArray(item.children)) {
-              item.children.forEach((child) => {
-                processItem(child, item)
-              })
-            }
-          } else {
-            // 普通行
-            const rowData = {
-              ...item,
-              seq: seq++,
-              isCategory: false,
-            }
+        // 需要多次遍历,确保所有子项都能找到父项
+        let hasUnprocessed = true
+        while (hasUnprocessed && childItems.length > 0) {
+          hasUnprocessed = false
+          const remainingItems = []
 
-            // 如果有父分类,设置分类信息
-            if (parentCategory) {
-              rowData.categoryId = parentCategory.id
-              rowData.categorySeq =
-                parentCategory.categorySeq || parentCategory.id
+          childItems.forEach((item) => {
+            const rowid = item.rowid || item.id
+            const parentid = item.parentid
+
+            // 跳过已处理的项
+            if (processedIds.has(rowid)) {
+              return
             }
 
-            // 初始化年份数据
-            this.yearColumns.forEach((year) => {
-              rowData[`year_${year}`] = item[`year_${year}`] || ''
+            // 查找父项在 flatData 中的位置
+            const parentIndex = flatData.findIndex((row) => {
+              const parentRowid = row.rowid || row.id
+              return parentRowid === parentid
             })
 
-            // 初始化备注
-            rowData.remark = item.remark || ''
-
-            // 如果有传入的数据,填充值
-            if (this.surveyData && this.surveyData[item.id]) {
-              const savedData = this.surveyData[item.id]
-              this.yearColumns.forEach((year) => {
-                if (savedData[year] !== undefined) {
-                  rowData[`year_${year}`] = savedData[year]
-                }
-              })
-              if (savedData.remark !== undefined) {
-                rowData.remark = savedData.remark
+            if (parentIndex >= 0) {
+              // 找到父项,插入到父项后面
+              // 找到父项后面最后一个子项的位置
+              let insertIndex = parentIndex + 1
+              while (
+                insertIndex < flatData.length &&
+                (flatData[insertIndex].rowid || flatData[insertIndex].id) !==
+                  parentid &&
+                flatData[insertIndex].parentid === parentid
+              ) {
+                insertIndex++
               }
+              const rowData = this.createRowData(item, true, rowid)
+              flatData.splice(insertIndex, 0, rowData)
+              processedIds.add(rowid)
+            } else {
+              // 如果找不到父项,标记为未处理,等待下一轮
+              remainingItems.push(item)
+              hasUnprocessed = true
             }
+          })
+
+          // 更新待处理的子项列表
+          childItems.length = 0
+          childItems.push(...remainingItems)
+        }
 
+        // 处理剩余未找到父项的项(可能是数据异常)
+        this.tableItems.forEach((item) => {
+          const rowid = item.rowid || item.id
+          if (!processedIds.has(rowid)) {
+            const rowData = this.createRowData(item, false, rowid)
             flatData.push(rowData)
+            processedIds.add(rowid)
+          }
+        })
 
-            // 如果有子项,递归处理
-            if (item.children && Array.isArray(item.children)) {
-              item.children.forEach((child) => {
-                processItem(child, item)
-              })
+        this.tableData = flatData
+      },
+      // 创建行数据
+      createRowData(item, isChild, rowid) {
+        const rowData = {
+          ...item,
+          rowid: rowid || item.rowid || item.id,
+          seq:
+            item.seq !== undefined
+              ? item.seq
+              : isChild
+              ? ''
+              : item.categorySeq || item.id || '',
+          isCategory: item.isCategory || false,
+        }
+
+        // 初始化年份数据
+        this.yearColumns.forEach((year) => {
+          rowData[`year_${year}`] = item[`year_${year}`] || ''
+        })
+
+        // 初始化备注
+        rowData.remark = item.remark || ''
+
+        // 如果有传入的数据,填充值
+        if (this.surveyData && this.surveyData[rowid]) {
+          const savedData = this.surveyData[rowid]
+          this.yearColumns.forEach((year) => {
+            if (savedData[year] !== undefined) {
+              rowData[`year_${year}`] = savedData[year]
             }
+          })
+          if (savedData.remark !== undefined) {
+            rowData.remark = savedData.remark
           }
         }
 
-        // 处理所有项
-        this.tableItems.forEach((item) => {
-          processItem(item)
-        })
+        return rowData
+      },
+      // 加载详情数据并回显
+      async loadDetailData() {
+        // 如果有 uploadId 和 auditedUnitId,调用接口获取详情数据
+        const uploadId =
+          this.uploadId || this.surveyData.uploadId || this.surveyData.id
+        const auditedUnitId =
+          this.auditedUnitId || this.surveyData.auditedUnitId
+
+        if (uploadId && auditedUnitId) {
+          try {
+            const params = {
+              uploadId: uploadId,
+              auditedUnitId: auditedUnitId,
+            }
+            const res = await getSurveyDetail(params)
+            console.log('固定表详情数据', res)
+            if (res && res.code === 200 && res.value) {
+              // 将接口返回的数据转换为表格数据格式
+              const detailData = Array.isArray(res.value)
+                ? res.value
+                : res.value.items || res.value.records || []
+
+              // 按 rowid 分组数据
+              const dataByRowid = {}
+              detailData.forEach((item) => {
+                if (item.rowid) {
+                  if (!dataByRowid[item.rowid]) {
+                    dataByRowid[item.rowid] = {}
+                  }
+                  dataByRowid[item.rowid][item.rkey] = item.rvalue
+                }
+              })
 
-        this.tableData = flatData
+              // 回显数据到表格
+              this.tableData.forEach((row) => {
+                const rowid = row.rowid || row.id
+                const rowData = dataByRowid[rowid]
+
+                if (rowData) {
+                  // 回显基本信息
+                  if (rowData['序号'] !== undefined) {
+                    row.seq = rowData['序号']
+                  }
+                  if (rowData['项目'] !== undefined) {
+                    row.itemName = rowData['项目']
+                  }
+                  if (rowData['单位'] !== undefined) {
+                    row.unit = rowData['单位']
+                  }
+                  if (rowData['备注'] !== undefined) {
+                    row.remark = rowData['备注']
+                  }
+
+                  // 回显年份数据
+                  this.yearColumns.forEach((year) => {
+                    if (rowData[year] !== undefined) {
+                      row[`year_${year}`] = rowData[year]
+                    }
+                  })
+                }
+              })
+
+              // 强制更新视图
+              this.$forceUpdate()
+            }
+          } catch (err) {
+            console.error('获取固定表详情失败', err)
+          }
+        }
       },
       // 获取假数据(用于测试)
       getMockTableData() {
@@ -589,7 +730,7 @@
         this.handleClose()
       },
       // 保存
-      handleSave() {
+      async handleSave() {
         // 验证数据
         if (!this.validateBeforeSave()) {
           const errorMessages = this.validationErrors
@@ -599,37 +740,120 @@
           return
         }
 
-        // 格式化保存数据
-        const saveData = {
-          items: this.tableData.map((row) => {
-            const itemData = {
-              id: row.id,
-              itemName: row.itemName,
+        try {
+          // 判断是否有数据(编辑模式):如果有 uploadId,说明是编辑已有数据
+          const hasData = !!(
+            this.uploadId ||
+            this.surveyData.uploadId ||
+            this.surveyData.id
+          )
+
+          // 格式化保存数据为接口需要的格式
+          const saveData = []
+
+          // 遍历所有行数据
+          this.tableData.forEach((row) => {
+            const rowid = row.rowid || row.id
+
+            // 跳过分类行(如果分类行不需要保存基本信息)
+            if (!row.isCategory) {
+              // 保存基本信息:序号、项目、单位
+              if (row.seq !== undefined && row.seq !== null && row.seq !== '') {
+                saveData.push({
+                  rowid: rowid,
+                  rkey: '序号',
+                  rvalue: String(row.seq),
+                })
+              }
+
+              if (row.itemName) {
+                saveData.push({
+                  rowid: rowid,
+                  rkey: '项目',
+                  rvalue: String(row.itemName),
+                })
+              }
+
+              if (row.unit) {
+                saveData.push({
+                  rowid: rowid,
+                  rkey: '单位',
+                  rvalue: String(row.unit),
+                })
+              }
             }
 
-            // 添加年份数据
+            // 保存年份数据(所有行都可以有年份数据)
             this.yearColumns.forEach((year) => {
-              if (!row.isCategory) {
-                itemData[year] = row[`year_${year}`] || ''
+              const yearValue = row[`year_${year}`]
+              if (
+                yearValue !== undefined &&
+                yearValue !== null &&
+                yearValue !== ''
+              ) {
+                saveData.push({
+                  rowid: rowid,
+                  rkey: String(year),
+                  rvalue: String(yearValue),
+                })
               }
             })
 
-            // 添加备注
-            if (!row.isCategory) {
-              itemData.remark = row.remark || ''
+            // 保存备注(所有行都可以有备注)
+            if (
+              row.remark !== undefined &&
+              row.remark !== null &&
+              row.remark !== ''
+            ) {
+              saveData.push({
+                rowid: rowid,
+                rkey: '备注',
+                rvalue: String(row.remark),
+              })
+            }
+          })
+
+          // 为每条数据添加公共字段
+          const finalSaveData = saveData.map((item) => {
+            const dataItem = {
+              ...item,
+              auditedUnitId:
+                this.auditedUnitId || this.surveyData.auditedUnitId || '',
+              surveyTemplateId:
+                this.surveyTemplateId || this.surveyData.surveyTemplateId || '',
+              catalogId: this.catalogId || this.surveyData.catalogId || '',
             }
 
-            return itemData
-          }),
-          yearColumns: this.yearColumns,
-        }
+            // 如果有数据(编辑模式),添加 uploadId 字段
+            if (hasData) {
+              dataItem.uploadId =
+                this.uploadId ||
+                this.surveyData.uploadId ||
+                this.surveyData.id ||
+                ''
+            }
 
-        console.log('保存数据:', saveData)
-        Message.success('保存成功')
+            return dataItem
+          })
 
-        // 触发保存事件
-        this.$emit('save', saveData)
-        this.handleClose()
+          console.log('保存数据:', finalSaveData)
+
+          // 调用保存接口
+          const res = await saveSingleRecordSurvey(finalSaveData)
+          if (res && res.code === 200) {
+            Message.success('保存成功')
+            // 触发保存事件
+            this.$emit('save', finalSaveData)
+            // 触发刷新事件
+            this.$emit('refresh')
+            this.handleClose()
+          } else {
+            Message.error(res.message || '保存失败')
+          }
+        } catch (err) {
+          console.error('保存失败', err)
+          Message.error(err.message || '保存失败')
+        }
       },
     },
   }

+ 20 - 4
src/views/EntDeclaration/auditTaskManagement/components/ProjectInfoTab.vue

@@ -153,8 +153,8 @@
         v-model="localFormData.needHearing"
         :disabled="isViewMode"
       >
-        <el-radio :label="0">是</el-radio>
-        <el-radio :label="1">否</el-radio>
+        <el-radio :label="'0'">是</el-radio>
+        <el-radio :label="'1'">否</el-radio>
       </el-radio-group>
     </el-form-item>
     <el-form-item label="是否应急项目:">
@@ -162,8 +162,8 @@
         v-model="localFormData.isEmergency"
         :disabled="isViewMode"
       >
-        <el-radio :label="0">是</el-radio>
-        <el-radio :label="1">否</el-radio>
+        <el-radio :label="'0'">是</el-radio>
+        <el-radio :label="'1'">否</el-radio>
       </el-radio-group>
     </el-form-item>
     <el-form-item label="立项理由:">
@@ -178,6 +178,7 @@
     </el-form-item>
     <el-form-item label="监审任务负责人:">
       <el-select
+        v-if="localFormData.leaderName === ''"
         v-model="localFormData.leaderId"
         placeholder="请选择负责人"
         style="width: 100%"
@@ -190,9 +191,17 @@
           :value="item.userId"
         ></el-option>
       </el-select>
+      <el-input
+        v-else
+        v-model="localFormData.leaderName"
+        placeholder="请输入负责人"
+        style="width: 100%"
+        :disabled="isViewMode"
+      ></el-input>
     </el-form-item>
     <el-form-item label="监审任务组成员:">
       <el-select
+        v-if="localFormData.projectMembersName === ''"
         v-model="localFormData.auditTeamMembers"
         placeholder="请选择成员"
         multiple
@@ -206,6 +215,13 @@
           :value="item.userId"
         ></el-option>
       </el-select>
+      <el-input
+        v-else
+        v-model="localFormData.projectMembersName"
+        placeholder="请输入成员"
+        style="width: 100%"
+        :disabled="isViewMode"
+      ></el-input>
     </el-form-item>
     <el-form-item label="其他专家:">
       <el-input

+ 96 - 49
src/views/EntDeclaration/auditTaskManagement/taskFillIn.vue

@@ -102,6 +102,7 @@
               :is-view-mode="isViewMode"
               :audited-unit-id="auditedUnitId"
               :catalog-id="taskInfo.catalogId"
+              :audit-period="getAuditPeriodArray()"
               @handle-modify="handleModify"
               @handle-data-download="handleDataDownload"
               @handle-data-upload="handleDataUpload"
@@ -1155,55 +1156,55 @@
       // 提交
       handleSubmit() {
         // 验证必填的报送资料(仅在 clcs 或 tjcl 节点时验证)
-        if (this.currentNode === 'clcs' || this.currentNode === 'tjcl') {
-          // 验证报送资料必填项
-          const requiredItems = this.formData.dataRequirements.filter(
-            (item) => {
-              // 只检查非类别标题行的数据项
-              if (item.isCategoryHeader) {
-                return false
-              }
-              // 只检查是否为必填项
-              const isRequired =
-                item.isRequired === '1' || item.isRequired === 1
-              return isRequired
-            }
-          )
-
-          if (requiredItems.length > 0) {
-            // 获取必填项名称列表
-            const itemNames = requiredItems
-              .map((item) => item.informationName || '未命名资料')
-              .join('、')
-            Message.warning(
-              `有必填数据必须先填完,请先完成以下报送资料:${itemNames}`
-            )
-            return
-          }
-
-          // 验证成本调查表必填项
-          const requiredCostSurveys = this.formData.costSurveyData.filter(
-            (item) => {
-              // 只检查是否为必填项
-              const isRequired =
-                item.isRequired === '1' ||
-                item.isRequired === 1 ||
-                item.isRequired === '是'
-              return isRequired
-            }
-          )
-
-          if (requiredCostSurveys.length > 0) {
-            // 获取必填项名称列表
-            const itemNames = requiredCostSurveys
-              .map((item) => item.name || '未命名调查表')
-              .join('、')
-            Message.warning(
-              `有必填数据必须先填完,请先完成以下成本调查表:${itemNames}`
-            )
-            return
-          }
-        }
+        // if (this.currentNode === 'clcs' || this.currentNode === 'tjcl') {
+        //   // 验证报送资料必填项
+        //   const requiredItems = this.formData.dataRequirements.filter(
+        //     (item) => {
+        //       // 只检查非类别标题行的数据项
+        //       if (item.isCategoryHeader) {
+        //         return false
+        //       }
+        //       // 只检查是否为必填项
+        //       const isRequired =
+        //         item.isRequired === '1' || item.isRequired === 1
+        //       return isRequired
+        //     }
+        //   )
+
+        //   if (requiredItems.length > 0) {
+        //     // 获取必填项名称列表
+        //     const itemNames = requiredItems
+        //       .map((item) => item.informationName || '未命名资料')
+        //       .join('、')
+        //     Message.warning(
+        //       `有必填数据必须先填完,请先完成以下报送资料:${itemNames}`
+        //     )
+        //     return
+        //   }
+
+        //   // 验证成本调查表必填项
+        //   const requiredCostSurveys = this.formData.costSurveyData.filter(
+        //     (item) => {
+        //       // 只检查是否为必填项
+        //       const isRequired =
+        //         item.isRequired === '1' ||
+        //         item.isRequired === 1 ||
+        //         item.isRequired === '是'
+        //       return isRequired
+        //     }
+        //   )
+
+        //   if (requiredCostSurveys.length > 0) {
+        //     // 获取必填项名称列表
+        //     const itemNames = requiredCostSurveys
+        //       .map((item) => item.name || '未命名调查表')
+        //       .join('、')
+        //     Message.warning(
+        //       `有必填数据必须先填完,请先完成以下成本调查表:${itemNames}`
+        //     )
+        //     return
+        //   }
+        // }
 
         this.loading.submit = true
 
@@ -1875,6 +1876,52 @@
         // 保存成功后刷新列表
         this.getCostSurveyList()
       },
+
+      // 获取监审期间数组(从立项信息中获取)
+      getAuditPeriodArray() {
+        // 优先从 formData.basicInfo.auditPeriodArray 获取
+        if (
+          this.formData &&
+          this.formData.basicInfo &&
+          this.formData.basicInfo.auditPeriodArray &&
+          Array.isArray(this.formData.basicInfo.auditPeriodArray)
+        ) {
+          const periods = this.formData.basicInfo.auditPeriodArray
+            .map((item) => item.value)
+            .filter((val) => val && val.trim())
+          if (periods.length > 0) {
+            return periods
+          }
+        }
+        // 其次从 taskInfo.auditPeriod 获取
+        if (this.taskInfo && this.taskInfo.auditPeriod) {
+          if (Array.isArray(this.taskInfo.auditPeriod)) {
+            return this.taskInfo.auditPeriod
+          } else if (typeof this.taskInfo.auditPeriod === 'string') {
+            // 如果是字符串,尝试解析
+            return this.taskInfo.auditPeriod
+              .split(',')
+              .map((p) => p.trim())
+              .filter((p) => p)
+          }
+        }
+        // 最后从 formData.basicInfo.auditPeriod 获取
+        if (
+          this.formData &&
+          this.formData.basicInfo &&
+          this.formData.basicInfo.auditPeriod
+        ) {
+          if (Array.isArray(this.formData.basicInfo.auditPeriod)) {
+            return this.formData.basicInfo.auditPeriod
+          } else if (typeof this.formData.basicInfo.auditPeriod === 'string') {
+            return this.formData.basicInfo.auditPeriod
+              .split(',')
+              .map((p) => p.trim())
+              .filter((p) => p)
+          }
+        }
+        return null
+      },
     },
   }
 </script>

+ 21 - 21
src/views/costAudit/auditInfo/auditManage/collectiveMain.vue

@@ -309,13 +309,13 @@
             />
           </el-select>
         </div>
-        <div class="supplement-form-item">
+        <!-- <div class="supplement-form-item">
           <label class="supplement-form-label required">发送方式:</label>
           <el-checkbox-group v-model="additionalParams.sendType">
             <el-checkbox label="site">站内消息</el-checkbox>
             <el-checkbox label="sms">短信通知</el-checkbox>
           </el-checkbox-group>
-        </div>
+        </div> -->
       </div>
       <div slot="footer" class="supplement-dialog-footer">
         <el-button @click="showSupplementDialog = false">取消</el-button>
@@ -396,7 +396,7 @@
         // 补充资料弹窗数据
         additionalParams: {
           content: '',
-          sendType: [],
+          // sendType: [],
           selectedSubUnits: [],
         },
         // 子单位列表
@@ -559,7 +559,7 @@
       handlePrint() {
         this.additionalParams = {
           content: '',
-          sendType: [],
+          // sendType: [],
           selectedSubUnits: [],
         }
         this.loadSubUnitList()
@@ -617,24 +617,24 @@
         }
 
         // 验证发送方式
-        if (
-          !this.additionalParams.sendType ||
-          this.additionalParams.sendType.length === 0
-        ) {
-          this.$message.error('请选择发送方式')
-          return
-        }
+        // if (
+        //   !this.additionalParams.sendType ||
+        //   this.additionalParams.sendType.length === 0
+        // ) {
+        //   this.$message.error('请选择发送方式')
+        //   return
+        // }
 
         try {
           // 转换发送方式:site -> 1, sms -> 2
-          const sendTypeMap = {
-            site: '1',
-            sms: '2',
-          }
-          const sendTypeStr = this.additionalParams.sendType
-            .map((type) => sendTypeMap[type])
-            .filter(Boolean)
-            .join(',')
+          // const sendTypeMap = {
+          //   site: '1',
+          //   sms: '2',
+          // }
+          // const sendTypeStr = this.additionalParams.sendType
+          //   .map((type) => sendTypeMap[type])
+          //   .filter(Boolean)
+          //   .join(',')
 
           // 获取子任务ID(选中的子单位ID)
           const childTaskId = this.additionalParams.selectedSubUnits.join(',')
@@ -643,7 +643,7 @@
             taskId: this.id,
             processNodeKey: this.currentNode || '',
             key: 1,
-            sendType: sendTypeStr,
+            // sendType: sendTypeStr,
             content: this.additionalParams.content,
             childTaskId: childTaskId,
           }
@@ -657,7 +657,7 @@
             // 重置表单数据
             this.additionalParams = {
               content: '',
-              sendType: [],
+              // sendType: [],
               selectedSubUnits: [],
             }
           } else {

+ 8 - 8
src/views/costAudit/auditInfo/auditManage/details.vue

@@ -103,13 +103,13 @@
             show-word-limit
           />
         </div>
-        <div class="form-item">
+        <!-- <div class="form-item">
           <label class="form-label">发送方式:</label>
           <el-checkbox-group v-model="additionalParams.sendType">
             <el-checkbox label="site">站内消息</el-checkbox>
             <el-checkbox label="sms">短信通知</el-checkbox>
           </el-checkbox-group>
-        </div>
+        </div> -->
       </div>
       <div slot="footer" class="dialog-footer">
         <el-button @click="showSupplementDialog = false">取消</el-button>
@@ -136,13 +136,13 @@
             show-word-limit
           />
         </div>
-        <div class="form-item">
+        <!-- <div class="form-item">
           <label class="form-label">发送方式:</label>
           <el-checkbox-group v-model="additionalParams.sendType">
             <el-checkbox label="site">站内消息</el-checkbox>
             <el-checkbox label="sms">短信通知</el-checkbox>
           </el-checkbox-group>
-        </div>
+        </div> -->
       </div>
       <div slot="footer" class="dialog-footer">
         <el-button @click="showAbortDialog = false">取消</el-button>
@@ -169,13 +169,13 @@
             show-word-limit
           />
         </div>
-        <div class="form-item">
+        <!-- <div class="form-item">
           <label class="form-label">发送方式:</label>
           <el-checkbox-group v-model="additionalParams.sendType">
             <el-checkbox label="site">站内消息</el-checkbox>
             <el-checkbox label="sms">短信通知</el-checkbox>
           </el-checkbox-group>
-        </div>
+        </div> -->
       </div>
       <div slot="footer" class="dialog-footer">
         <el-button @click="showRejectDialog = false">取消</el-button>
@@ -375,7 +375,7 @@
       handleAuditPass(item) {
         this.additionalParams = {
           content: '',
-          sendType: [], // 默认选中站内消息和短信通知
+          // sendType: [], // 默认选中站内消息和短信通知
         }
         this.currentButton = item // 保存当前按钮信息
         console.log('点击的按钮数据:', item)
@@ -424,7 +424,7 @@
             taskId: this.id,
             processNodeKey: this.currentNode,
             key: this.currentButton.key,
-            sendType: this.additionalParams.sendType?.join(','),
+            // sendType: this.additionalParams.sendType?.join(','),
             content: this.additionalParams.content,
           }
 

+ 4 - 2
src/views/costAudit/auditInfo/auditManage/index.vue

@@ -75,11 +75,13 @@
           prop="currentNodeName"
           label="状态"
           align="center"
-          width="80"
+          width="150"
         >
           <template slot-scope="scope">
             <span v-if="!scope.row.isSubTask">
-              {{ scope.row.currentNodeName }}
+              <span>
+                {{ scope.row.currentNodeName }}-{{ scope.row.statusName }}
+              </span>
             </span>
             <span v-else>{{ scope.row.status }}</span>
           </template>

+ 16 - 16
src/views/costAudit/auditInfo/auditManage/mainDetails.vue

@@ -84,7 +84,7 @@
             />
           </div>
         </div>
-        <div class="form-item process-form-item">
+        <!-- <div class="form-item process-form-item">
           <label class="form-label">发送方式:</label>
           <div class="form-content">
             <el-checkbox-group v-model="processParams.sendType">
@@ -92,7 +92,7 @@
               <el-checkbox label="2">短信通知</el-checkbox>
             </el-checkbox-group>
           </div>
-        </div>
+        </div> -->
       </div>
       <div slot="footer" class="dialog-footer">
         <el-button @click="showProcessDialog = false">取消</el-button>
@@ -159,7 +159,7 @@
         // 流转/退回操作参数
         processParams: {
           content: '', // 意见
-          sendType: [], // 发送方式
+          // sendType: [], // 发送方式
         },
         // 当前操作类型:'next' 流转下一步, 'prev' 退回上一步
         currentProcessType: '',
@@ -328,7 +328,7 @@
         this.currentProcessType = 'next'
         this.processParams = {
           content: '',
-          sendType: [],
+          // sendType: [],
         }
         this.showProcessDialog = true
       },
@@ -338,7 +338,7 @@
         this.currentProcessType = 'prev'
         this.processParams = {
           content: '',
-          sendType: [],
+          // sendType: [],
         }
         this.showProcessDialog = true
       },
@@ -348,7 +348,7 @@
         this.currentProcessType = 'complete'
         this.processParams = {
           content: '',
-          sendType: [],
+          // sendType: [],
         }
         this.showProcessDialog = true
       },
@@ -361,13 +361,13 @@
         }
 
         // 验证发送方式
-        if (
-          !this.processParams.sendType ||
-          this.processParams.sendType.length === 0
-        ) {
-          this.$message.warning('请选择至少一种发送方式')
-          return
-        }
+        // if (
+        //   !this.processParams.sendType ||
+        //   this.processParams.sendType.length === 0
+        // ) {
+        //   this.$message.warning('请选择至少一种发送方式')
+        //   return
+        // }
 
         try {
           // 根据操作类型确定key值
@@ -384,7 +384,7 @@
             taskId: this.id,
             processNodeKey: this.currentNode,
             key: keyValue,
-            sendType: this.processParams.sendType.join(','), // 发送方式用","分割
+            // sendType: this.processParams.sendType.join(','), // 发送方式用","分割
             content: this.processParams.content || '', // 意见
           }
 
@@ -406,7 +406,7 @@
             // 重置参数
             this.processParams = {
               content: '',
-              sendType: [],
+              // sendType: [],
             }
             this.currentProcessType = ''
             // 关闭主弹窗
@@ -444,7 +444,7 @@
             taskId: this.id,
             processNodeKey: this.currentNode,
             key: this.currentButton.key,
-            sendType: this.additionalParams.sendType?.join(','),
+            // sendType: this.additionalParams.sendType?.join(','),
             content: this.additionalParams.content,
           }
 

+ 12 - 12
src/views/costAudit/projectInfo/auditTaskManage/taskCustomizedRelease/index.vue

@@ -135,14 +135,14 @@
             style="width: 100%"
           ></el-input>
         </el-form-item>
-        <el-form-item label="发送方式:" prop="sendType">
+        <!-- <el-form-item label="发送方式:" prop="sendType">
           <el-checkbox-group v-model="publishForm.sendType" style="width: 100%">
             <el-checkbox label="1" style="margin-right: 20px">
               站内消息
             </el-checkbox>
             <el-checkbox label="2">短信通知</el-checkbox>
           </el-checkbox-group>
-        </el-form-item>
+        </el-form-item> -->
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="confirmTaskPublish">确认</el-button>
@@ -218,7 +218,7 @@
           auditedUnit: '',
           auditTeam: '',
           noticeContent: '',
-          sendType: ['1', '2'],
+          // sendType: ['1', '2'],
         },
         publishFormRules: {
           content: [
@@ -228,13 +228,13 @@
               trigger: 'blur',
             },
           ],
-          sendType: [
-            {
-              required: true,
-              message: '请选择发送方式',
-              trigger: 'blur',
-            },
-          ],
+          // sendType: [
+          //   {
+          //     required: true,
+          //     message: '请选择发送方式',
+          //     trigger: 'blur',
+          //   },
+          // ],
         },
         userList: [],
         unitList: [],
@@ -376,7 +376,7 @@
           auditedUnitName: this.getUnitName(row.auditedUnitId) || '',
           auditGroup: row.projectMembers ? row.projectMembers.split(',') : [],
           content: `${row.projectYear}年${row.projectName}已发布,请及时办理。`,
-          sendType: row.sendType ? row.sendType.split(',') : ['1'],
+          // sendType: row.sendType ? row.sendType.split(',') : ['1'],
         }
         this.publishDialogVisible = true
       },
@@ -393,7 +393,7 @@
           projectId: this.publishForm.projectId,
           auditGroup: this.publishForm.auditGroup.join(','),
           content: this.publishForm.content,
-          sendType: this.publishForm.sendType.join(','),
+          // sendType: this.publishForm.sendType.join(','),
         }).then(() => {
           Message.success('任务发布成功')
           this.publishDialogVisible = false

+ 14 - 14
src/views/costAudit/projectInfo/auditTaskManage/taskProgressManage/index.vue

@@ -163,12 +163,12 @@
               placeholder="请输入督办要求"
             ></el-input>
           </el-form-item>
-          <el-form-item label="发送方式:">
+          <!-- <el-form-item label="发送方式:">
             <el-checkbox-group v-model="urgeForm.sendType">
               <el-checkbox label="站内消息">站内消息</el-checkbox>
               <el-checkbox label="短信通知">短信通知</el-checkbox>
             </el-checkbox-group>
-          </el-form-item>
+          </el-form-item> -->
         </el-form>
       </div>
       <div slot="footer" class="dialog-footer">
@@ -209,12 +209,12 @@
               placeholder="请输入代为内容"
             ></el-input>
           </el-form-item>
-          <el-form-item label="发送方式:">
+          <!-- <el-form-item label="发送方式:">
             <el-checkbox-group v-model="delegateForm.sendType">
               <el-checkbox label="站内消息">站内消息</el-checkbox>
               <el-checkbox label="短信通知">短信通知</el-checkbox>
             </el-checkbox-group>
-          </el-form-item>
+          </el-form-item> -->
         </el-form>
       </div>
       <div slot="footer" class="dialog-footer">
@@ -354,12 +354,12 @@
         urgeForm: {
           remindPerson: '',
           content: '',
-          sendType: '站内消息',
+          // sendType: '站内消息',
         },
         delegateForm: {
           agentPerson: '',
           content: '',
-          sendType: '站内消息',
+          // sendType: '站内消息',
         },
         unitList: [],
         userList: [],
@@ -526,7 +526,7 @@
         this.urgeForm = {
           remindPerson: '',
           content: '',
-          sendType: [],
+          // sendType: [],
         }
         this.showUrgeForm = true
       },
@@ -535,22 +535,22 @@
         this.urgeForm = {
           remindPerson: '',
           content: '',
-          sendType: [],
+          // sendType: [],
         }
       },
       handleUrgeSubmit() {
         // 提交前将数组转换为逗号分隔字符串
         const submitForm = { ...this.urgeForm }
-        if (Array.isArray(submitForm.sendType)) {
-          submitForm.sendType = submitForm.sendType.join(',')
-        }
+        // if (Array.isArray(submitForm.sendType)) {
+        //   submitForm.sendType = submitForm.sendType.join(',')
+        // }
         console.log('提交督办:', submitForm)
         // 这里可以添加提交逻辑
         this.showUrgeForm = false
         this.urgeForm = {
           remindPerson: '',
           content: '',
-          sendType: [],
+          // sendType: [],
         }
         this.currentTask = null
         this.$message.success('督办信息已发送')
@@ -566,7 +566,7 @@
         this.delegateForm = {
           agentPerson: '',
           content: '',
-          sendType: '站内消息',
+          // sendType: '站内消息',
         }
       },
       handleDelegateSubmit() {
@@ -576,7 +576,7 @@
         this.delegateForm = {
           agentPerson: '',
           content: '',
-          sendType: '站内消息',
+          // sendType: '站内消息',
         }
         this.currentTask = null
         this.$message.success('代办信息已发送')