Просмотр исходного кода

Merge branch 'master' of http://116.204.116.5:3000/zzw/cbjsxt-front-master

shiyanyu 1 месяц назад
Родитель
Сommit
36e917a15f

+ 2 - 4
src/api/costSurveyFdTemplate.js

@@ -52,9 +52,7 @@ export function getSurveyFdVersionsByTemplateId(params) {
   return request({
     url: `${url}/costSurveyFdTemplateVersion/v1/listByTemplateId`,
     method: 'get',
-    params: {
-      surveyTemplateId: params.surveyTemplateId,
-    },
+    params,
   })
 }
 
@@ -77,7 +75,7 @@ export function editSurveyFdForm(data) {
 export function changeSurveyFdStatus(id) {
   return request({
     url: `${url}/costSurveyFdTemplate/v1/enable`,
-    method: 'get',
+    method: 'post',
     params: { id: id },
   })
 }

+ 9 - 0
src/api/costSurveyFdTemplateItems.js

@@ -22,3 +22,12 @@ export function getCellCodesByTemplateId(surveyTemplateId) {
     },
   })
 }
+
+// /costSurveyFdTemplateItems/v1/listByCurrentTemplateId
+export function listByCurrentTemplateId(params) {
+  return request({
+    url: url + '/costSurveyFdTemplateItems/v1/listByCurrentTemplateId',
+    method: 'get',
+    params,
+  })
+}

+ 2 - 2
src/api/taskCustomizedRelease.js

@@ -83,8 +83,8 @@ export function addCostProjectMaterial(data) {
  */
 export function updateCostProjectMaterial(data) {
   return request({
-    url: `${url}/api/costProjectMaterial/v1/`,
-    method: 'put',
+    url: `${url}/api/costProjectMaterial/v1/update`,
+    method: 'post',
     data,
   })
 }

+ 1 - 1
src/components/costAudit/CostAuditDialog.vue

@@ -210,7 +210,7 @@
 
 <style scoped>
   .dialog-content {
-    max-height: 560px;
+    max-height: 520px;
     overflow-y: auto;
     overflow-x: hidden;
   }

+ 365 - 62
src/views/costAudit/baseInfo/catalogManage/surveyDialog.vue

@@ -72,7 +72,10 @@
               >
                 <template slot-scope="scope">
                   {{
-                    scope.row.fixedValues ? scope.row.fixedValues['序号'] : ''
+                    (scope.row.fixedValues && scope.row.fixedValues['序号']) ||
+                    scope.row.orderNum ||
+                    scope.row.orderText ||
+                    ''
                   }}
                 </template>
               </el-table-column>
@@ -304,58 +307,250 @@
        * @param {Object} responseData - listByCurrentTemplateId接口返回的数据
        */
       parseAndDisplayFixedTableData(responseData) {
+        console.log('开始解析固定表数据:', responseData)
+
+        // 确保数据初始化
+        if (!this.contentEditForm.fixedTable) {
+          this.contentEditForm.fixedTable = {
+            tableHeaders: [],
+            fixedTables: [],
+            fixedTablesTitle: [],
+            fixedTableHeaders: [],
+          }
+        }
+
+        // 初始化表头 - 使用默认表头配置,确保即使没有返回字段也能显示列
+        this.contentEditForm.fixedTable.fixedTablesTitle = [
+          { rkey: '序号', rvalue: '序号' },
+          { rkey: '项目', rvalue: '项目' },
+          { rkey: 'cellCode', rvalue: '指标编号' },
+          { rkey: 'calculationFormula', rvalue: '计算公式' },
+          { rkey: 'unit', rvalue: '单位' },
+        ]
+
+        // 如果API返回了字段配置,则使用API返回的字段
+        if (
+          responseData &&
+          responseData.value &&
+          responseData.value.fixedFields
+        ) {
+          const apiFields = this.stringToObjects(responseData.value.fixedFields)
+          if (apiFields.length > 0) {
+            this.contentEditForm.fixedTable.fixedTablesTitle = apiFields
+          }
+        } else if (
+          this.contentEditForm.fixedTable.tableHeaders &&
+          this.contentEditForm.fixedTable.tableHeaders.length > 0
+        ) {
+          // 尝试从tableHeaders中获取字段配置
+          let fixedFields = this.contentEditForm.fixedTable.tableHeaders
+            .map((item) => item.fieldName || '')
+            .filter(Boolean)
+            .join(',')
+
+          if (fixedFields) {
+            const headerFields = this.stringToObjects(fixedFields)
+            if (headerFields.length > 0) {
+              this.contentEditForm.fixedTable.fixedTablesTitle = headerFields
+            }
+          }
+        }
+
+        const fixedTitles = this.contentEditForm.fixedTable.fixedTablesTitle
+        console.log('生成的表头标题:', fixedTitles)
+
+        // 过滤掉序号列,创建固定表头
+        this.contentEditForm.fixedTable.fixedTableHeaders = fixedTitles.filter(
+          (title) => title.rkey !== '序号'
+        )
+        console.log(
+          '过滤后的固定表头:',
+          this.contentEditForm.fixedTable.fixedTableHeaders
+        )
+
+        // 检查数据有效性
         if (
           !responseData ||
           !responseData.value ||
           !responseData.value.itemlist
         ) {
+          console.error('无效的响应数据:', responseData)
           return
         }
         const itemList = responseData.value.itemlist
-        this.contentEditForm.fixedTable.fixedTablesTitle = this.stringToObjects(
-          responseData.value.fixedFields || ''
-        )
-        const fixedTitles = this.contentEditForm.fixedTable.fixedTablesTitle
-        this.contentEditForm.fixedTable.fixedTableHeaders =
-          this.contentEditForm.fixedTable.fixedTablesTitle.filter(
-            (title) => title.rkey !== '序号'
-          )
+        // 清空现有数据
+        this.contentEditForm.fixedTable.fixedTables = []
+
+        const allRows = []
 
         // 清空现有数据
         this.contentEditForm.fixedTable.fixedTables = []
 
         // 遍历itemList,为每个项目创建一行数据
         itemList.forEach((item, index) => {
-          const orderNum = item.orderNum
-            ? parseInt(item.orderNum, 10)
-            : index + 1
+          // 判断是否为子项(parentid不为-1且不为"-1")
+          const isSubItem =
+            item.parentid && item.parentid !== -1 && item.parentid !== '-1'
+
           const newRow = {
-            orderNum: orderNum,
+            orderText: item.orderNum || '', // 显示用序号
+            orderNum: item.orderNum || '', // 保留原始序号用于发送后端
             surveyTemplateId: item.surveyTemplateId,
             versionId: item.versionId,
+            cellCode: item.cellCode || '',
+            calculationFormula: item.calculationFormula || '',
+            unit: item.unit || '',
             fixedValues: {},
-            // 保存每行数据的id,用于更新操作
             itemId: item.id || null,
+            parentid: item.parentid || -1,
+            isChild: isSubItem,
+            isSubItem: isSubItem,
+            rowid: item.rowid || this.generateUUID(),
+            jsonstr: item.jsonstr || null,
+          }
+
+          // 确保orderNum是数字类型
+          if (item.orderNum) {
+            newRow.orderNum = parseInt(item.orderNum, 10) || 0
           }
 
           // 初始化fixedValues并填充实际值
+          newRow.fixedValues = {}
           fixedTitles.forEach((title) => {
-            newRow.fixedValues[title.rkey] = item[title.rkey] || ''
+            // 优先使用item中的对应字段值
+            if (item[title.rkey] !== undefined) {
+              newRow.fixedValues[title.rkey] = item[title.rkey]
+            }
+            // 特殊处理序号字段
+            else if (title.rkey === '序号') {
+              newRow.fixedValues[title.rkey] = item.orderNum || index + 1
+            }
+            // 默认空字符串
+            else {
+              newRow.fixedValues[title.rkey] = ''
+            }
           })
 
-          this.contentEditForm.fixedTable.fixedTables.push(newRow)
+          // 确保主要字段在fixedValues中也存在
+          if (item.cellCode) newRow.fixedValues.cellCode = item.cellCode
+          if (item.calculationFormula)
+            newRow.fixedValues.calculationFormula = item.calculationFormula
+          if (item.unit) newRow.fixedValues.unit = item.unit
+
+          console.log(
+            `处理行数据${index + 1}的fixedValues:`,
+            newRow.fixedValues
+          )
+
+          allRows.push(newRow)
+        })
+
+        // 按父子关系排序:父项在前,子项在对应的父项后面
+        allRows.sort((a, b) => {
+          // 先按orderNum排序父项
+          if (a.isChild && !b.isChild) {
+            // 如果a是子项,b是父项,需要检查a的父项是否在b之后
+            const parentOfA = allRows.find(
+              (item) => item.rowid === a.parentid || item.itemId === a.parentid
+            )
+            if (parentOfA && parentOfA.orderNum > b.orderNum) {
+              return 1
+            }
+            return -1
+          }
+          if (!a.isChild && b.isChild) {
+            // 如果a是父项,b是子项,需要检查b的父项是否在a之前
+            const parentOfB = allRows.find(
+              (item) => item.rowid === b.parentid || item.itemId === b.parentid
+            )
+            if (parentOfB && parentOfB.orderNum < a.orderNum) {
+              return -1
+            }
+            return 1
+          }
+
+          // 如果都是父项或都是子项,按orderNum排序
+          return (a.orderNum || 0) - (b.orderNum || 0)
         })
 
-        // 按orderNum排序
-        this.contentEditForm.fixedTable.fixedTables.sort(
-          (a, b) => a.orderNum - b.orderNum
+        // 重新排序,确保子项紧跟在其对应的父项后面
+        const sortedArray = []
+        const parentItems = allRows.filter((item) => !item.isChild)
+        const childItems = allRows.filter((item) => item.isChild)
+
+        parentItems.forEach((parent) => {
+          sortedArray.push(parent)
+          // 找到并添加该父项的所有子项
+          const relatedChildren = childItems.filter(
+            (child) =>
+              child.parentid === parent.rowid ||
+              child.parentid === parent.itemId
+          )
+          // 子项按orderNum排序
+          relatedChildren.sort((a, b) => (a.orderNum || 0) - (b.orderNum || 0))
+          sortedArray.push(...relatedChildren)
+        })
+
+        this.contentEditForm.fixedTable.fixedTables = sortedArray
+        console.log(
+          '最终表格数据:',
+          this.contentEditForm.fixedTable.fixedTables
         )
+        console.log('表格数据长度:', sortedArray.length)
+        if (sortedArray.length > 0) {
+          console.log('第一条数据详情:', sortedArray[0])
+          console.log('第一条数据的fixedValues:', sortedArray[0].fixedValues)
+        }
       },
       /**
        * 解析并回显动态表项目数据
        * @param {Object} responseData - listByCurrentTemplateId接口返回的数据
        */
       parseAndDisplayDynamicTableData(responseData) {
+        console.log('开始解析动态表数据:', responseData)
+
+        // 确保数据初始化
+        if (!this.contentEditForm.dynamicTable) {
+          this.contentEditForm.dynamicTable = {
+            tableHeaders: [],
+            dynamicTables: [],
+            dynamicTablesTitle: [],
+            dynamicTableHeaders: [],
+          }
+        }
+
+        // 初始化默认表头
+        this.contentEditForm.dynamicTable.dynamicTablesTitle = [
+          { rkey: '序号', rvalue: '序号' },
+          { rkey: '项目', rvalue: '项目' },
+        ]
+
+        // 使用API返回的字段配置(如果有)
+        if (responseData.value.fixedFields) {
+          this.contentEditForm.dynamicTable.dynamicTablesTitle =
+            this.stringToObjects(responseData.value.fixedFields || '')
+        } else if (
+          this.contentEditForm.dynamicTable.tableHeaders &&
+          this.contentEditForm.dynamicTable.tableHeaders.length > 0
+        ) {
+          let fixedFields = this.contentEditForm.dynamicTable.tableHeaders
+            .map((item) => item.fieldName || '')
+            .filter(Boolean)
+            .join(',')
+          if (fixedFields) {
+            this.contentEditForm.dynamicTable.dynamicTablesTitle =
+              this.stringToObjects(fixedFields || '')
+          }
+        }
+
+        console.log(
+          '动态表表头标题:',
+          this.contentEditForm.dynamicTable.dynamicTablesTitle
+        )
+        const dynamicTitles =
+          this.contentEditForm.dynamicTable.dynamicTablesTitle
+        this.contentEditForm.dynamicTable.dynamicTableHeaders =
+          dynamicTitles.filter((title) => title.rkey !== '序号')
         if (
           !responseData ||
           !responseData.value ||
@@ -365,68 +560,176 @@
         }
 
         const itemList = responseData.value.itemlist
-        this.contentEditForm.dynamicTable.dynamicTablesTitle =
-          this.stringToObjects(responseData.value.fixedFields || '')
-        const dynamicTitles =
-          this.contentEditForm.dynamicTable.dynamicTablesTitle
-        this.contentEditForm.dynamicTable.dynamicTableHeaders =
-          dynamicTitles.filter((title) => title.rkey !== '序号')
 
-        // 按orderNum分组数据
-        const groupedData = {}
-        itemList.forEach((item) => {
-          const orderNum = item.orderNum ? parseInt(item.orderNum, 10) : 1
-          if (!groupedData[orderNum]) {
-            groupedData[orderNum] = []
-          }
-          groupedData[orderNum].push(item)
-        })
+        const allRows = []
 
         // 清空现有数据
         this.contentEditForm.dynamicTable.dynamicTables = []
 
-        // 为每个orderNum创建一行数据
-        Object.keys(groupedData).forEach((orderNum) => {
-          const itemsForOrder = groupedData[orderNum]
+        // 遍历itemList,为每个项目创建一行数据
+        itemList.forEach((item, index) => {
+          // 判断是否为子项(parentid不为-1且不为"-1")
+          const isSubItem =
+            item.parentid && item.parentid !== -1 && item.parentid !== '-1'
+
           const newRow = {
-            orderNum: parseInt(orderNum, 10),
-            surveyTemplateId: itemsForOrder[0].surveyTemplateId,
-            versionId: itemsForOrder[0].versionId,
+            orderText: item.orderNum || '', // 显示用序号
+            orderNum: item.orderNum || '', // 保留原始序号用于发送后端
+            surveyTemplateId: item.surveyTemplateId,
             dynamicValues: {},
-            // 保存每行数据的id,用于更新操作(这是itemlist中每条记录的id)
-            itemId: itemsForOrder[0].id || null,
+            itemId: item.id || null,
+            parentid: item.parentid || -1,
+            isChild: isSubItem,
+            isSubItem: isSubItem,
+            rowid: item.rowid || this.generateUUID(),
+            jsonstr: item.jsonstr || null,
+          }
+
+          // 确保orderNum是数字类型
+          if (item.orderNum) {
+            newRow.orderNum = parseInt(item.orderNum, 10) || 0
           }
 
           // 初始化dynamicValues
+          newRow.dynamicValues = {}
           dynamicTitles.forEach((title) => {
-            newRow.dynamicValues[title.rkey] = ''
+            // 特殊处理序号字段
+            if (title.rkey === '序号') {
+              // 优先使用item中的序号值,如果没有则使用orderNum或index+1
+              newRow.dynamicValues[title.rkey] =
+                item[title.rkey] || item.orderNum || index + 1
+            }
+            // 排除其他序号相关字段,避免重复显示
+            else if (title.rkey !== 'ordernum' && title.rkey !== 'orderText') {
+              newRow.dynamicValues[title.rkey] = item[title.rkey] || ''
+            }
           })
 
-          // 填充实际值
-          itemsForOrder.forEach((item) => {
-            // 从item中找出对应的字段值
-            dynamicTitles.forEach((title) => {
-              if (item[title.rkey] !== undefined) {
-                newRow.dynamicValues[title.rkey] = item[title.rkey]
-              }
-            })
-          })
+          console.log(
+            `处理动态表行数据${index + 1}的dynamicValues:`,
+            newRow.dynamicValues
+          )
+
+          allRows.push(newRow)
+        })
+
+        // 按父子关系排序:父项在前,子项在对应的父项后面
+        // 1. 先创建一个映射表,方便通过ID查找父项
+        const rowMap = new Map()
+        const sortedArray = []
+        const addedItems = new Set()
+
+        // 深拷贝原始数据并过滤掉重复项
+        const uniqueRows = allRows.reduce((acc, current) => {
+          const isDuplicate = acc.some(
+            (row) =>
+              (row.rowid && current.rowid && row.rowid === current.rowid) ||
+              (row.itemId && current.itemId && row.itemId === current.itemId)
+          )
+          if (!isDuplicate) {
+            acc.push(JSON.parse(JSON.stringify(current)))
+          }
+          return acc
+        }, [])
 
-          this.contentEditForm.dynamicTable.dynamicTables.push(newRow)
+        // 填充映射表
+        uniqueRows.forEach((row) => {
+          if (row.rowid) rowMap.set(String(row.rowid), row)
+          if (row.itemId) rowMap.set(String(row.itemId), row)
         })
 
-        // 按orderNum排序
-        this.contentEditForm.dynamicTable.dynamicTables.sort(
-          (a, b) => a.orderNum - b.orderNum
+        // 先按orderNum排序所有父项
+        const parentItems = uniqueRows.filter((item) => !item.isChild)
+        parentItems.sort(
+          (a, b) => (Number(a.orderNum) || 0) - (Number(b.orderNum) || 0)
         )
+
+        // 递归添加父项及其子项的函数
+        const addItemWithChildren = (item) => {
+          // 确保项目ID唯一
+          const itemIdKey = String(
+            item.rowid || item.itemId || `temp_${Math.random()}`
+          )
+
+          // 如果已经添加过,则跳过
+          if (addedItems.has(itemIdKey)) return
+
+          // 添加当前项目
+          sortedArray.push(item)
+          addedItems.add(itemIdKey)
+
+          // 找到并添加所有子项
+          const children = uniqueRows.filter((child) => {
+            if (child.isChild) {
+              const childParentId = String(child.parentid)
+              return (
+                childParentId === String(item.rowid) ||
+                childParentId === String(item.itemId)
+              )
+            }
+            return false
+          })
+
+          // 子项按orderNum排序
+          children.sort(
+            (a, b) => (Number(a.orderNum) || 0) - (Number(b.orderNum) || 0)
+          )
+
+          // 添加所有子项
+          children.forEach((child) => addItemWithChildren(child))
+        }
+
+        // 遍历所有父项,添加父项及其子项
+        parentItems.forEach((parent) => addItemWithChildren(parent))
+
+        // 添加剩余的没有被添加的项目(应该很少,但作为兜底)
+        uniqueRows.forEach((row) => {
+          const itemIdKey = String(
+            row.rowid || row.itemId || `temp_${Math.random()}`
+          )
+          if (!addedItems.has(itemIdKey)) {
+            sortedArray.push(row)
+            addedItems.add(itemIdKey)
+          }
+        })
+
+        // 最后,重新计算显示序号,确保序号连续且正确
+        sortedArray.forEach((item, index) => {
+          item.orderText = String(index + 1)
+        })
+
+        this.contentEditForm.dynamicTable.dynamicTables = sortedArray
       },
-      //分割字符串
+      // 字符串转对象数组
       stringToObjects(str) {
-        const items = str.split(',')
-        return items.map((item) => ({
-          rkey: item,
-          rvalue: '',
-        }))
+        console.log('转换字符串为对象数组:', str)
+        if (!str || typeof str !== 'string') return []
+
+        const result = str
+          .split(',')
+          .map((item) => {
+            const trimmed = item.trim()
+            return {
+              rkey: trimmed,
+              rvalue: trimmed,
+            }
+          })
+          .filter((item) => item.rkey)
+
+        console.log('转换结果:', result)
+        return result
+      },
+
+      // 生成UUID用于临时行ID
+      generateUUID() {
+        return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(
+          /[xy]/g,
+          function (c) {
+            const r = (Math.random() * 16) | 0
+            const v = c === 'x' ? r : (r & 0x3) | 0x8
+            return v.toString(16)
+          }
+        )
       },
       // 处理选择变化
       handleSelectionChange(val) {

+ 5 - 7
src/views/costAudit/baseInfo/costFormManage/infoMaintain.vue

@@ -2027,18 +2027,16 @@
           selectedTemplate: this.selectedTemplateId,
           selectedItems: this.indicatorTableData.filter((item) => item.checked),
         }
-        const validation = this.validateFormula(this.formulaText)
-        if (!validation.valid) {
-          this.$message.error(validation.errorMsg)
-          return
-        }
-
         let _data = []
         if (this.radioType == 'current') {
           _data = this.contentEditForm.fixedTable.fixedTables
             .filter((item) => item.cellCode)
             .map((item) => item.cellCode)
         } else if (this.radioType == 'other') {
+          if (!result.selectedTemplate) {
+            this.$message.error('请选择指标编号')
+            return
+          }
           _data = this.indicatorTableData
             .filter((item) => item.cellCode)
             .map((item) => item.cellCode)
@@ -3134,7 +3132,7 @@
           }
 
           // 验证通过后,检查公式中的值是否都在data中存在
-          if (data) {
+          if (data.length > 0) {
             const values = extractValues(formulaStr)
             for (const value of values) {
               // 跳过纯数字(假设有值不在data中)

+ 61 - 7
src/views/costAudit/baseInfo/costVerifyManage/index.vue

@@ -564,6 +564,44 @@
                   </el-select>
                 </template>
               </el-table-column>
+              <el-table-column prop="isDict" label="绑定字典" min-width="150">
+                <template slot-scope="scope">
+                  <div class="bind-dict-column">
+                    <el-select
+                      v-model="scope.row.isDict"
+                      size="small"
+                      style="width: 80px"
+                      :disabled="
+                        scope.row.isReadOnly ||
+                        dialogTitle == '查看成本核定模板'
+                      "
+                      @change="handleBindDictChange(scope.row)"
+                    >
+                      <el-option label="是" value="true"></el-option>
+                      <el-option label="否" value="false"></el-option>
+                    </el-select>
+                    <el-select
+                      v-if="scope.row.isDict === 'true'"
+                      v-model="scope.row.dictid"
+                      placeholder="请选择字典"
+                      class="dict-select"
+                      size="small"
+                      style="width: 120px; margin-top: 5px"
+                      :disabled="
+                        scope.row.isReadOnly ||
+                        dialogTitle == '查看成本核定模板'
+                      "
+                    >
+                      <el-option
+                        v-for="(item, index) in dictTypeList"
+                        :key="index"
+                        :label="item.name"
+                        :value="String(item.id)"
+                      ></el-option>
+                    </el-select>
+                  </div>
+                </template>
+              </el-table-column>
 
               <el-table-column
                 label="操作"
@@ -908,7 +946,7 @@
             </template>
           </el-table-column>
           <el-table-column
-            prop="code"
+            prop="cellCode"
             label="指标编号"
             align="center"
           ></el-table-column>
@@ -1075,6 +1113,7 @@
         selectedIndicatorsPerTemplate: {},
         selectedIndicatorCodes: [],
         isAutoGeneratedFormula: false,
+        dictTypeList: [],
       }
     },
     watch: {
@@ -1199,8 +1238,17 @@
 
     mounted() {
       this.handleSearch()
+      this.loadDictTypeList()
     },
     methods: {
+      async loadDictTypeList() {
+        try {
+          const res = await getDictTypList()
+          this.dictTypeList = res || []
+        } catch (error) {
+          console.error('加载字典类型失败:', error)
+        }
+      },
       // 获取监审类别名称
       batchGetCatalogNames() {
         this.tableData.forEach((row) => {
@@ -1998,7 +2046,7 @@
               this.indicatorTableData = res.value.itemlist.map((item) => ({
                 ...item,
                 checked: false,
-                code: item.cellCode || '',
+                cellCode: item.cellCode || '',
                 name: res.value.fixedFields.split(',')[0] || '',
                 formattedCode: '', // 添加格式化代码字段
               }))
@@ -2134,11 +2182,17 @@
         }
         let _data = []
         if (this.radioType == 'current') {
-          _data = this.contentEditForm.fixedTable.fixedTables.map(
-            (item) => item.cellCode
-          )
+          _data = this.contentEditForm.fixedTable.fixedTables
+            .filter((item) => item.cellCode)
+            .map((item) => item.cellCode)
         } else if (this.radioType == 'other') {
-          _data = this.indicatorTableData.map((item) => item.code)
+          if (!result.selectedTemplate) {
+            this.$message.error('请选择指标编号')
+            return
+          }
+          _data = this.indicatorTableData
+            .filter((item) => item.cellCode)
+            .map((item) => item.cellCode)
         }
         if (!this.validateFormula(this.formulaText, _data).valid) {
           this.$message.error(
@@ -2592,7 +2646,7 @@
           }
 
           // 验证通过后,检查公式中的值是否都在data中存在
-          if (data) {
+          if (data.length > 0) {
             const values = extractValues(formulaStr)
             for (const value of values) {
               // 跳过纯数字(假设有值不在data中)

+ 6 - 7
src/views/costAudit/baseInfo/financeSheetManage/infoMaintain.vue

@@ -1521,6 +1521,7 @@
         templateName: '',
         templateList: [],
         indicatorTableData: [],
+        indicatorTableHeaders: [],
         selectedIndicatorCodes: [],
         selectedIndicatorsPerTemplate: {},
         dialogTitle: '',
@@ -2022,6 +2023,10 @@
             .filter((item) => item.cellCode)
             .map((item) => item.cellCode)
         } else if (this.radioType == 'other') {
+          if (!result.selectedTemplate) {
+            this.$message.error('请选择指标编号')
+            return
+          }
           _data = this.indicatorTableData
             .filter((item) => item.cellCode)
             .map((item) => item.cellCode)
@@ -2050,12 +2055,6 @@
 
         const jsonstr = JSON.stringify(jsonStrArray)
 
-        // 检查是否有选中的有效行,如果没有则禁止下一步操作
-        if (jsonStrArray.length === 0) {
-          this.$message.error('请至少选择一个有指标编号的数据行!')
-          return
-        }
-
         // 更新当前编辑行的计算公式值
         if (this.currentEditingRow) {
           this.$set(
@@ -2182,7 +2181,7 @@
           }
 
           // 验证通过后,检查公式中的值是否都在data中存在
-          if (data) {
+          if (data.length > 0) {
             const values = extractValues(formulaStr)
             for (const value of values) {
               // 跳过纯数字(假设有值不在data中)

+ 1 - 1
src/views/costAudit/projectInfo/auditTaskManage/taskCustomizedRelease/index.js

@@ -455,7 +455,7 @@ export const taskMixin = {
           this.getMaterialData()
           break
         case 'survey':
-          this.getSurveyData()
+          // this.getSurveyData()
           break
         case 'auditNotice':
           const res = await getWhCateList()

+ 0 - 1
src/views/costAudit/projectInfo/auditTaskManage/taskCustomizedRelease/surveyTab.vue

@@ -3,7 +3,6 @@
     <!-- 表格组件 -->
     <CostAuditTable
       style="width: 50%"
-      :data="surveyData.list"
       :table-data="surveyData.list"
       :columns="getSurveyColumns()"
       :show-action-column="true"