Pārlūkot izejas kodu

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

shiyanyu 1 mēnesi atpakaļ
vecāks
revīzija
7eb98d807d

+ 11 - 1
src/components/task/cbjsInfo.vue

@@ -20,7 +20,11 @@
           label="成本审核"
           name="costAudit"
         >
-          <cost-audit :id="id" :disabled="true" />
+          <cost-audit
+            :id="id"
+            :disabled="true"
+            :selected-project="selectedProject"
+          />
         </el-tab-pane>
         <el-tab-pane
           v-if="currentNode !== 'clcs'"
@@ -85,6 +89,12 @@
         type: [String, Number],
         default: null,
       },
+      selectedProject: {
+        type: Object,
+        default: () => {
+          return {}
+        },
+      },
       currentNode: {
         type: String,
         default: '',

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 754 - 216
src/components/task/components/costAudit.vue


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 1797 - 159
src/views/costAudit/auditInfo/auditManage/costAudit.vue


+ 5 - 0
src/views/costAudit/auditInfo/auditManage/details.vue

@@ -51,6 +51,7 @@
         >
           <cost-audit
             :id="id"
+            :selected-project="selectedProject"
             :current-node="currentNode"
             :current-status="currentStatus"
           />
@@ -229,6 +230,10 @@
         type: [String, Number],
         default: null,
       },
+      selectedProject: {
+        type: Object,
+        default: () => ({}),
+      },
       currentNode: {
         type: String,
         default: '',

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

@@ -172,6 +172,7 @@
     <details-dialog
       :id="selectedProject && selectedProject.id"
       ref="detailsRef"
+      :selected-project="selectedProject"
       :visible.sync="detailsVisible"
       :current-node="selectedProject && selectedProject.currentNode"
       :current-status="selectedProject && selectedProject.status"
@@ -193,6 +194,7 @@
     <!-- 成本监审信息弹窗 -->
     <cbjs-info
       :id="cbjsInfoData && cbjsInfoData.id"
+      :selected-project="selectedProject"
       :visible.sync="cbjsInfoVisible"
       :current-node="cbjsInfoData && cbjsInfoData.currentNode"
       :current-status="cbjsInfoData && cbjsInfoData.status"

+ 10 - 10
src/views/costAudit/baseInfo/auditEntityManage/index.vue

@@ -59,20 +59,20 @@
       >
         <!-- 操作列插槽 -->
         <template #action="{ row }">
-          <el-button
-            v-region-permission="{
-              category: 'auditEntityManage',
-              action: 'view',
-            }"
-            type="text"
-            @click="handleView(row)"
-          >
-            查看
-          </el-button>
           <div class="action-buttons">
             <el-button
               v-region-permission="{
                 category: 'auditEntityManage',
+                action: 'view',
+              }"
+              type="text"
+              @click="handleView(row)"
+            >
+              查看
+            </el-button>
+            <el-button
+              v-region-permission="{
+                category: 'auditEntityManage',
                 action: 'edit',
               }"
               type="text"

+ 220 - 60
src/views/costAudit/baseInfo/costFormManage/infoMaintain.vue

@@ -52,7 +52,6 @@
         v-region-permission="{
           category: 'costFormManage',
           action: 'delete',
-          targetData: row,
         }"
         plain
         type="danger"
@@ -500,6 +499,7 @@
                       type="text"
                       size="mini"
                       :disabled="viewDetail"
+                      class="delete-btn"
                       @click="
                         handleDeleteHeader(scope.$index, '单记录', scope.row)
                       "
@@ -767,6 +767,7 @@
                       type="text"
                       size="mini"
                       :disabled="scope.row.isDisabled || viewDetail"
+                      class="delete-btn"
                       @click="
                         handleDeleteHeader(
                           scope.$index,
@@ -959,6 +960,7 @@
                         type="text"
                         size="mini"
                         :disabled="viewDetail"
+                        class="delete-btn"
                         @click="
                           handleDeleteHeader(
                             scope.$index,
@@ -1216,6 +1218,7 @@
                       type="text"
                       size="mini"
                       :disabled="scope.row.isDisabled || viewDetail"
+                      class="delete-btn"
                       @click="
                         handleDeleteHeader(
                           scope.$index,
@@ -1388,6 +1391,7 @@
                         type="text"
                         size="mini"
                         :disabled="viewDetail"
+                        class="delete-btn"
                         @click="
                           handleDeleteHeader(
                             scope.$index,
@@ -2620,6 +2624,7 @@
               tabtype: this.templateType,
               surveyTemplateId: this.surveyTemplateId,
               versionId: this.versionId,
+              orderNum: this.contentEditForm.tableHeaders.length + 1,
             })
             break
           case '固定表表头':
@@ -2735,7 +2740,6 @@
 
       // 删除表头
       handleDeleteHeader(index, type, row) {
-        // 提取重复的删除逻辑为内部函数
         const handleDelete = () => {
           const data = {
             deleteheadersList: [row],
@@ -2754,7 +2758,6 @@
             })
             .finally(() => {})
         }
-
         switch (type) {
           case '固定表表头':
             if (this.contentEditForm.fixedTable.tableHeaders.length <= 1) {
@@ -2772,59 +2775,108 @@
               this.contentEditForm.fixedTable.fixedTablesTitle.filter(
                 (title) => title.rkey !== '序号'
               )
+            handleDelete()
             // 重新排序
             this.updateTableHeadersOrderNumbers()
-            handleDelete()
             break
 
           case '固定表项目':
-            // 检查是否是删除子项
-            const isChildItem = row.isChild || row.isSubItem || false
-
-            if (isChildItem) {
-              // 查找父项
-              const parentItem =
-                this.contentEditForm.fixedTable.fixedTables.find(
-                  (item) =>
-                    item.children &&
-                    item.children.some((child) => child.rowid === row.rowid)
-                )
+            this.$confirm(
+              '确定要删除此行数据吗?如果删除的是父项,将同时删除其所有子项。',
+              '确认删除',
+              {
+                confirmButtonText: '确定',
+                cancelButtonText: '取消',
+                type: 'warning',
+              }
+            )
+              .then(() => {
+                // 检查是否是删除子项
+                const isChildItem = row.isChild || row.isSubItem || false
+                console.log('isChildItem', isChildItem)
+                console.log('row', row)
+                if (isChildItem) {
+                  // 查找父项
+                  const parentItem =
+                    this.contentEditForm.fixedTable.fixedTables.find(
+                      (item) =>
+                        item.children &&
+                        item.children.some((child) => child.rowid === row.rowid)
+                    )
 
-              if (parentItem && parentItem.children) {
-                // 从父项的children数组中删除子项
-                const childIndex = parentItem.children.findIndex(
-                  (child) => child.rowid === row.rowid
-                )
-                if (childIndex > -1) {
-                  parentItem.children.splice(childIndex, 1)
-
-                  // 如果children数组为空,将hasChildren设为false
-                  if (parentItem.children.length === 0) {
-                    this.$set(parentItem, 'hasChildren', false)
-                  } else {
-                    // 重新计算子项序号
-                    parentItem.children.forEach((child, idx) => {
-                      child.orderText = idx + 1
-                      child.orderNum = idx + 1
-                    })
+                  if (parentItem && parentItem.children) {
+                    // 从父项的children数组中删除子项
+                    const childIndex = parentItem.children.findIndex(
+                      (child) => child.rowid === row.rowid
+                    )
+                    if (childIndex > -1) {
+                      parentItem.children.splice(childIndex, 1)
+
+                      // 如果children数组为空,将hasChildren设为false
+                      if (parentItem.children.length === 0) {
+                        this.$set(parentItem, 'hasChildren', false)
+                      } else {
+                        // 重新计算子项序号
+                        parentItem.children.forEach((child, idx) => {
+                          child.orderText = idx + 1
+                          child.orderNum = idx + 1
+                        })
+                      }
+
+                      // 确保Vue响应式系统检测到变化
+                      const children = [...parentItem.children]
+                      this.$set(parentItem, 'children', children)
+
+                      this.handleSaveContent('固定表项目', 'delete') // 保存数据
+                    }
+                  }
+                } else {
+                  // 处理删除父项的情况
+                  if (this.contentEditForm.fixedTable.fixedTables.length <= 1) {
+                    this.$message.warning('至少保留一个项目')
+                    return
                   }
 
-                  // 确保Vue响应式系统检测到变化
-                  const children = [...parentItem.children]
-                  this.$set(parentItem, 'children', children)
+                  // 获取要删除的行
+                  index =
+                    this.contentEditForm.fixedTable.fixedTables.indexOf(row)
+                  const rowToDelete =
+                    this.contentEditForm.fixedTable.fixedTables[index]
+                  // 先删除所有子项(parentid等于当前行的rowid或itemId的项)
+                  // 从后往前删除,避免索引偏移
+                  const rowsToDelete = []
+
+                  // 找出所有需要删除的行(包括父项和子项)
+                  for (
+                    let i = 0;
+                    i < this.contentEditForm.fixedTable.fixedTables.length;
+                    i++
+                  ) {
+                    const currentRow =
+                      this.contentEditForm.fixedTable.fixedTables[i]
+                    // 是当前行或其子项(子项的parentid等于当前行的rowid或itemId)
+                    if (
+                      i === index ||
+                      (currentRow.parentid &&
+                        (currentRow.parentid === rowToDelete.rowid ||
+                          currentRow.parentid === rowToDelete.itemId))
+                    ) {
+                      rowsToDelete.push(i)
+                    }
+                  }
+
+                  // 从后往前删除,避免索引偏移
+                  for (let i = rowsToDelete.length - 1; i >= 0; i--) {
+                    this.contentEditForm.fixedTable.fixedTables.splice(
+                      rowsToDelete[i],
+                      1
+                    )
+                  }
 
-                  handleDelete() // 执行删除逻辑
+                  this.handleSaveContent('固定表项目', 'delete') // 保存数据
                 }
-              }
-            } else {
-              // 处理删除父项的情况
-              if (this.contentEditForm.fixedTable.fixedTables.length <= 1) {
-                this.$message.warning('至少保留一个项目')
-                return
-              }
-              this.contentEditForm.fixedTable.fixedTables.splice(index, 1)
-              handleDelete() // 执行删除逻辑
-            }
+              })
+              .catch(() => {})
             break
           case '动态表表头':
             if (this.contentEditForm.dynamicTable.tableHeaders.length <= 1) {
@@ -2841,17 +2893,113 @@
               this.contentEditForm.dynamicTable.dynamicTablesTitle.filter(
                 (title) => title.rkey !== '序号'
               )
+            handleDelete()
             // 重新排序
             this.updateTableHeadersOrderNumbers()
-            handleDelete() // 执行删除逻辑
             break
           case '动态表项目':
             if (this.contentEditForm.dynamicTable.dynamicTables.length <= 1) {
               this.$message.warning('至少保留一个项目')
               return
             }
-            this.contentEditForm.dynamicTable.dynamicTables.splice(index, 1)
-            handleDelete() // 执行删除逻辑
+            this.$confirm(
+              '确定要删除此行数据吗?如果删除的是父项,将同时删除其所有子项。',
+              '确认删除',
+              {
+                confirmButtonText: '确定',
+                cancelButtonText: '取消',
+                type: 'warning',
+              }
+            )
+              .then(() => {
+                // 检查是否是删除子项
+                const isChildItem = row.isChild || row.isSubItem || false
+
+                if (isChildItem) {
+                  // 查找父项
+                  const parentItem =
+                    this.contentEditForm.dynamicTable.dynamicTables.find(
+                      (item) =>
+                        item.children &&
+                        item.children.some((child) => child.rowid === row.rowid)
+                    )
+
+                  if (parentItem && parentItem.children) {
+                    // 从父项的children数组中删除子项
+                    const childIndex = parentItem.children.findIndex(
+                      (child) => child.rowid === row.rowid
+                    )
+                    if (childIndex > -1) {
+                      parentItem.children.splice(childIndex, 1)
+
+                      // 如果children数组为空,将hasChildren设为false
+                      if (parentItem.children.length === 0) {
+                        this.$set(parentItem, 'hasChildren', false)
+                      } else {
+                        // 重新计算子项序号
+                        parentItem.children.forEach((child, idx) => {
+                          child.orderText = idx + 1
+                          child.orderNum = idx + 1
+                        })
+                      }
+
+                      // 确保Vue响应式系统检测到变化
+                      const children = [...parentItem.children]
+                      this.$set(parentItem, 'children', children)
+
+                      this.handleSaveContent('动态表项目', 'delete') // 保存数据
+                    }
+                  }
+                } else {
+                  // 处理删除父项的情况
+                  if (
+                    this.contentEditForm.dynamicTable.dynamicTables.length <= 1
+                  ) {
+                    this.$message.warning('至少保留一个项目')
+                    return
+                  }
+
+                  // 获取要删除的行
+                  index =
+                    this.contentEditForm.dynamicTable.dynamicTables.indexOf(row)
+                  const rowToDelete =
+                    this.contentEditForm.dynamicTable.dynamicTables[index]
+
+                  // 先删除所有子项(parentid等于当前行的rowid或itemId的项)
+                  // 从后往前删除,避免索引偏移
+                  const rowsToDelete = []
+
+                  // 找出所有需要删除的行(包括父项和子项)
+                  for (
+                    let i = 0;
+                    i < this.contentEditForm.dynamicTable.dynamicTables.length;
+                    i++
+                  ) {
+                    const currentRow =
+                      this.contentEditForm.dynamicTable.dynamicTables[i]
+                    // 是当前行或其子项(子项的parentid等于当前行的rowid或itemId)
+                    if (
+                      i === index ||
+                      (currentRow.parentid &&
+                        (currentRow.parentid === rowToDelete.rowid ||
+                          currentRow.parentid === rowToDelete.itemId))
+                    ) {
+                      rowsToDelete.push(i)
+                    }
+                  }
+
+                  // 从后往前删除,避免索引偏移
+                  for (let i = rowsToDelete.length - 1; i >= 0; i--) {
+                    this.contentEditForm.dynamicTable.dynamicTables.splice(
+                      rowsToDelete[i],
+                      1
+                    )
+                  }
+
+                  this.handleSaveContent('动态表项目', 'delete') // 保存数据
+                }
+              })
+              .catch(() => {})
             break
           case '单记录':
             if (this.contentEditForm.tableHeaders.length <= 1) {
@@ -2859,7 +3007,7 @@
               return
             }
             this.contentEditForm.tableHeaders.splice(index, 1)
-            handleDelete() // 执行删除逻辑
+            handleDelete()
             break
           default:
             break
@@ -3127,7 +3275,7 @@
         })
       },
       // 保存内容
-      handleSaveContent(type) {
+      handleSaveContent(type, action) {
         this.loading = true
         let isValid = false
         try {
@@ -3138,8 +3286,10 @@
             getBatchSaveOrUpdate(data)
               .then((res) => {
                 if (res.code === 200) {
-                  this.$message.success('保存成功')
-                  this.contentEditDialogVisible = false
+                  if (action != 'delete') {
+                    this.$message.success('保存成功')
+                    this.contentEditDialogVisible = false
+                  }
                 } else {
                   this.$message.error(`保存失败:${res.message || '未知错误'}`)
                 }
@@ -3210,7 +3360,7 @@
                 this.loading = false
               })
           } else if (type === '固定表项目') {
-            this.saveFixedTableData()
+            this.saveFixedTableData(action)
           } else if (type === '动态表表头') {
             var data = {
               headersList: this.contentEditForm.dynamicTable.tableHeaders,
@@ -3277,7 +3427,7 @@
                 this.loading = false
               })
           } else if (type === '动态表项目') {
-            this.saveDynamicTableData()
+            this.saveDynamicTableData(action)
           }
         } catch (error) {
           console.error('保存处理异常:', error)
@@ -3697,7 +3847,7 @@
         return result
       },
       //保存固定表项目数据
-      saveFixedTableData() {
+      saveFixedTableData(action = '') {
         try {
           // 获取拆分后的数据
           const splitData = this.splitFixedTableDataForSave()
@@ -3711,8 +3861,16 @@
           getBatchSaveOrUpdate(saveData)
             .then((res) => {
               if (res.code === 200) {
-                this.$message.success('固定表数据保存成功')
-                this.contentEditDialogVisible = false
+                // 如果是删除操作,不显示成功提示且不关闭对话框
+                if (action !== 'delete') {
+                  this.$message.success('固定表数据保存成功')
+                  this.contentEditDialogVisible = false
+                }
+                // 刷新数据以确保UI更新
+                this.getListBySurveyTemplateIdAndVersion(
+                  this.surveyTemplateId,
+                  this.versionId
+                )
               } else {
                 this.$message.error(`保存失败:${res.message || '未知错误'}`)
               }
@@ -3747,8 +3905,10 @@
           getBatchSaveOrUpdate(saveData)
             .then((res) => {
               if (res.code === 200) {
-                this.$message.success('动态表数据保存成功')
-                this.contentEditDialogVisible = false
+                if (action != 'delete') {
+                  this.$message.success('动态表数据保存成功')
+                  this.contentEditDialogVisible = false
+                }
               } else {
                 this.$message.error(`保存失败:${res.message || '未知错误'}`)
               }

+ 109 - 6
src/views/costAudit/baseInfo/costVerifyManage/index.vue

@@ -1854,10 +1854,13 @@
             .then((res) => {
               if (res.code === 200) {
                 this.$message.success('删除成功')
+              } else {
+                this.$message.error(`删除失败:${res.message || '未知错误'}`)
               }
             })
             .catch((error) => {
               console.error('删除接口异常:', error)
+              this.$message.error('删除接口异常,请重试')
             })
             .finally(() => {})
         }
@@ -1867,17 +1870,117 @@
               this.$message.warning('至少保留一个表头')
               return
             }
+
             this.contentEditForm.fixedTable.tableHeaders.splice(index, 1)
+            let fixedFields = this.contentEditForm.fixedTable.tableHeaders
+              .map((item) => item.fieldName)
+              .join(',')
+            this.contentEditForm.fixedTable.fixedTablesTitle =
+              this.stringToObjects(fixedFields || '')
+            this.contentEditForm.fixedTable.fixedTableHeaders =
+              this.contentEditForm.fixedTable.fixedTablesTitle.filter(
+                (title) => title.rkey !== '序号'
+              )
             handleDelete()
+            // 重新排序
+            this.updateTableHeadersOrderNumbers()
             break
 
           case '固定表项目':
-            if (this.contentEditForm.fixedTable.fixedTables.length <= 1) {
-              this.$message.warning('至少保留一个项目')
-              return
-            }
-            this.contentEditForm.fixedTable.fixedTables.splice(index, 1)
-            handleDelete() // 执行删除逻辑
+            this.$confirm(
+              '确定要删除此行数据吗?如果删除的是父项,将同时删除其所有子项。',
+              '确认删除',
+              {
+                confirmButtonText: '确定',
+                cancelButtonText: '取消',
+                type: 'warning',
+              }
+            )
+              .then(() => {
+                // 检查是否是删除子项
+                const isChildItem = row.isChild || row.isSubItem || false
+                if (isChildItem) {
+                  // 查找父项
+                  const parentItem =
+                    this.contentEditForm.fixedTable.fixedTables.find(
+                      (item) =>
+                        item.children &&
+                        item.children.some((child) => child.rowid === row.rowid)
+                    )
+
+                  if (parentItem && parentItem.children) {
+                    // 从父项的children数组中删除子项
+                    const childIndex = parentItem.children.findIndex(
+                      (child) => child.rowid === row.rowid
+                    )
+                    if (childIndex > -1) {
+                      parentItem.children.splice(childIndex, 1)
+
+                      // 如果children数组为空,将hasChildren设为false
+                      if (parentItem.children.length === 0) {
+                        this.$set(parentItem, 'hasChildren', false)
+                      } else {
+                        // 重新计算子项序号
+                        parentItem.children.forEach((child, idx) => {
+                          child.orderText = idx + 1
+                          child.orderNum = idx + 1
+                        })
+                      }
+
+                      // 确保Vue响应式系统检测到变化
+                      const children = [...parentItem.children]
+                      this.$set(parentItem, 'children', children)
+
+                      this.handleSaveContent('固定表项目', 'delete') // 保存数据
+                    }
+                  }
+                } else {
+                  // 处理删除父项的情况
+                  if (this.contentEditForm.fixedTable.fixedTables.length <= 1) {
+                    this.$message.warning('至少保留一个项目')
+                    return
+                  }
+
+                  // 获取要删除的行
+                  index =
+                    this.contentEditForm.fixedTable.fixedTables.indexOf(row)
+                  const rowToDelete =
+                    this.contentEditForm.fixedTable.fixedTables[index]
+                  // 先删除所有子项(parentid等于当前行的rowid或itemId的项)
+                  // 从后往前删除,避免索引偏移
+                  const rowsToDelete = []
+
+                  // 找出所有需要删除的行(包括父项和子项)
+                  for (
+                    let i = 0;
+                    i < this.contentEditForm.fixedTable.fixedTables.length;
+                    i++
+                  ) {
+                    const currentRow =
+                      this.contentEditForm.fixedTable.fixedTables[i]
+                    // 是当前行或其子项(子项的parentid等于当前行的rowid或itemId)
+                    if (
+                      i === index ||
+                      (currentRow.parentid &&
+                        (currentRow.parentid === rowToDelete.rowid ||
+                          currentRow.parentid === rowToDelete.itemId))
+                    ) {
+                      rowsToDelete.push(i)
+                    }
+                  }
+
+                  // 从后往前删除,避免索引偏移
+                  for (let i = rowsToDelete.length - 1; i >= 0; i--) {
+                    this.contentEditForm.fixedTable.fixedTables.splice(
+                      rowsToDelete[i],
+                      1
+                    )
+                  }
+
+                  this.handleSaveContent('固定表项目', 'delete') // 保存数据
+                }
+              })
+              .catch(() => {})
             break
           default:
             break

+ 223 - 25
src/views/costAudit/baseInfo/financeSheetManage/infoMaintain.vue

@@ -458,6 +458,7 @@
                       type="text"
                       size="mini"
                       :disabled="viewDetail"
+                      class="delete-btn"
                       @click="
                         handleDeleteHeader(scope.$index, '单记录', scope.row)
                       "
@@ -723,6 +724,7 @@
                       type="text"
                       size="mini"
                       :disabled="scope.row.isDisabled || viewDetail"
+                      class="delete-btn"
                       @click="
                         handleDeleteHeader(
                           scope.$index,
@@ -918,6 +920,7 @@
                         type="text"
                         size="mini"
                         :disabled="viewDetail"
+                        class="delete-btn"
                         @click="
                           handleDeleteHeader(
                             scope.$index,
@@ -1174,6 +1177,7 @@
                       type="text"
                       size="mini"
                       :disabled="scope.row.isDisabled || viewDetail"
+                      class="delete-btn"
                       @click="
                         handleDeleteHeader(
                           scope.$index,
@@ -1335,6 +1339,7 @@
                         type="text"
                         size="mini"
                         :disabled="viewDetail"
+                        class="delete-btn"
                         @click="
                           handleDeleteHeader(
                             scope.$index,
@@ -2687,6 +2692,7 @@
               tabtype: this.templateType,
               surveyTemplateId: this.surveyTemplateId,
               versionId: this.versionId,
+              orderNum: this.contentEditForm.tableHeaders.length + 1,
             })
             break
           case '固定表表头':
@@ -2702,6 +2708,7 @@
               tabtype: this.templateType,
               surveyTemplateId: this.surveyTemplateId,
               versionId: this.versionId,
+              orderNum: this.contentEditForm.fixedTable.tableHeaders.length + 1,
             })
             break
 
@@ -2750,6 +2757,8 @@
               tabtype: this.templateType,
               surveyTemplateId: this.surveyTemplateId,
               versionId: this.versionId,
+              orderNum:
+                this.contentEditForm.dynamicTable.tableHeaders.length + 1,
             })
             break
           case '动态表项目':
@@ -2813,7 +2822,6 @@
             })
             .finally(() => {})
         }
-
         switch (type) {
           case '固定表表头':
             if (this.contentEditForm.fixedTable.tableHeaders.length <= 1) {
@@ -2831,20 +2839,106 @@
               this.contentEditForm.fixedTable.fixedTablesTitle.filter(
                 (title) => title.rkey !== '序号'
               )
+            handleDelete()
             // 重新排序
             this.updateTableHeadersOrderNumbers()
-            handleDelete()
             break
 
           case '固定表项目':
-            if (this.contentEditForm.fixedTable.fixedTables.length <= 1) {
-              this.$message.warning('至少保留一个项目')
-              return
-            }
-            this.contentEditForm.fixedTable.fixedTables.splice(index, 1)
-            // 重新排序
-            this.updateTableHeadersOrderNumbers()
-            handleDelete() // 执行删除逻辑
+            this.$confirm(
+              '确定要删除此行数据吗?如果删除的是父项,将同时删除其所有子项。',
+              '确认删除',
+              {
+                confirmButtonText: '确定',
+                cancelButtonText: '取消',
+                type: 'warning',
+              }
+            )
+              .then(() => {
+                // 检查是否是删除子项
+                const isChildItem = row.isChild || row.isSubItem || false
+                if (isChildItem) {
+                  // 查找父项
+                  const parentItem =
+                    this.contentEditForm.fixedTable.fixedTables.find(
+                      (item) =>
+                        item.children &&
+                        item.children.some((child) => child.rowid === row.rowid)
+                    )
+
+                  if (parentItem && parentItem.children) {
+                    // 从父项的children数组中删除子项
+                    const childIndex = parentItem.children.findIndex(
+                      (child) => child.rowid === row.rowid
+                    )
+                    if (childIndex > -1) {
+                      parentItem.children.splice(childIndex, 1)
+
+                      // 如果children数组为空,将hasChildren设为false
+                      if (parentItem.children.length === 0) {
+                        this.$set(parentItem, 'hasChildren', false)
+                      } else {
+                        // 重新计算子项序号
+                        parentItem.children.forEach((child, idx) => {
+                          child.orderText = idx + 1
+                          child.orderNum = idx + 1
+                        })
+                      }
+
+                      // 确保Vue响应式系统检测到变化
+                      const children = [...parentItem.children]
+                      this.$set(parentItem, 'children', children)
+
+                      this.handleSaveContent('固定表项目', 'delete') // 保存数据
+                    }
+                  }
+                } else {
+                  // 处理删除父项的情况
+                  if (this.contentEditForm.fixedTable.fixedTables.length <= 1) {
+                    this.$message.warning('至少保留一个项目')
+                    return
+                  }
+
+                  // 获取要删除的行
+                  index =
+                    this.contentEditForm.fixedTable.fixedTables.indexOf(row)
+                  const rowToDelete =
+                    this.contentEditForm.fixedTable.fixedTables[index]
+                  // 先删除所有子项(parentid等于当前行的rowid或itemId的项)
+                  // 从后往前删除,避免索引偏移
+                  const rowsToDelete = []
+
+                  // 找出所有需要删除的行(包括父项和子项)
+                  for (
+                    let i = 0;
+                    i < this.contentEditForm.fixedTable.fixedTables.length;
+                    i++
+                  ) {
+                    const currentRow =
+                      this.contentEditForm.fixedTable.fixedTables[i]
+                    // 是当前行或其子项(子项的parentid等于当前行的rowid或itemId)
+                    if (
+                      i === index ||
+                      (currentRow.parentid &&
+                        (currentRow.parentid === rowToDelete.rowid ||
+                          currentRow.parentid === rowToDelete.itemId))
+                    ) {
+                      rowsToDelete.push(i)
+                    }
+                  }
+
+                  // 从后往前删除,避免索引偏移
+                  for (let i = rowsToDelete.length - 1; i >= 0; i--) {
+                    this.contentEditForm.fixedTable.fixedTables.splice(
+                      rowsToDelete[i],
+                      1
+                    )
+                  }
+
+                  this.handleSaveContent('固定表项目', 'delete') // 保存数据
+                }
+              })
+              .catch(() => {})
             break
           case '动态表表头':
             if (this.contentEditForm.dynamicTable.tableHeaders.length <= 1) {
@@ -2861,15 +2955,113 @@
               this.contentEditForm.dynamicTable.dynamicTablesTitle.filter(
                 (title) => title.rkey !== '序号'
               )
-            handleDelete() // 执行删除逻辑
+            handleDelete()
+            // 重新排序
+            this.updateTableHeadersOrderNumbers()
             break
           case '动态表项目':
             if (this.contentEditForm.dynamicTable.dynamicTables.length <= 1) {
               this.$message.warning('至少保留一个项目')
               return
             }
-            this.contentEditForm.dynamicTable.dynamicTables.splice(index, 1)
-            handleDelete() // 执行删除逻辑
+            this.$confirm(
+              '确定要删除此行数据吗?如果删除的是父项,将同时删除其所有子项。',
+              '确认删除',
+              {
+                confirmButtonText: '确定',
+                cancelButtonText: '取消',
+                type: 'warning',
+              }
+            )
+              .then(() => {
+                // 检查是否是删除子项
+                const isChildItem = row.isChild || row.isSubItem || false
+
+                if (isChildItem) {
+                  // 查找父项
+                  const parentItem =
+                    this.contentEditForm.dynamicTable.dynamicTables.find(
+                      (item) =>
+                        item.children &&
+                        item.children.some((child) => child.rowid === row.rowid)
+                    )
+
+                  if (parentItem && parentItem.children) {
+                    // 从父项的children数组中删除子项
+                    const childIndex = parentItem.children.findIndex(
+                      (child) => child.rowid === row.rowid
+                    )
+                    if (childIndex > -1) {
+                      parentItem.children.splice(childIndex, 1)
+
+                      // 如果children数组为空,将hasChildren设为false
+                      if (parentItem.children.length === 0) {
+                        this.$set(parentItem, 'hasChildren', false)
+                      } else {
+                        // 重新计算子项序号
+                        parentItem.children.forEach((child, idx) => {
+                          child.orderText = idx + 1
+                          child.orderNum = idx + 1
+                        })
+                      }
+
+                      // 确保Vue响应式系统检测到变化
+                      const children = [...parentItem.children]
+                      this.$set(parentItem, 'children', children)
+
+                      this.handleSaveContent('动态表项目', 'delete') // 保存数据
+                    }
+                  }
+                } else {
+                  // 处理删除父项的情况
+                  if (
+                    this.contentEditForm.dynamicTable.dynamicTables.length <= 1
+                  ) {
+                    this.$message.warning('至少保留一个项目')
+                    return
+                  }
+
+                  // 获取要删除的行
+                  index =
+                    this.contentEditForm.dynamicTable.dynamicTables.indexOf(row)
+                  const rowToDelete =
+                    this.contentEditForm.dynamicTable.dynamicTables[index]
+
+                  // 先删除所有子项(parentid等于当前行的rowid或itemId的项)
+                  // 从后往前删除,避免索引偏移
+                  const rowsToDelete = []
+
+                  // 找出所有需要删除的行(包括父项和子项)
+                  for (
+                    let i = 0;
+                    i < this.contentEditForm.dynamicTable.dynamicTables.length;
+                    i++
+                  ) {
+                    const currentRow =
+                      this.contentEditForm.dynamicTable.dynamicTables[i]
+                    // 是当前行或其子项(子项的parentid等于当前行的rowid或itemId)
+                    if (
+                      i === index ||
+                      (currentRow.parentid &&
+                        (currentRow.parentid === rowToDelete.rowid ||
+                          currentRow.parentid === rowToDelete.itemId))
+                    ) {
+                      rowsToDelete.push(i)
+                    }
+                  }
+
+                  // 从后往前删除,避免索引偏移
+                  for (let i = rowsToDelete.length - 1; i >= 0; i--) {
+                    this.contentEditForm.dynamicTable.dynamicTables.splice(
+                      rowsToDelete[i],
+                      1
+                    )
+                  }
+
+                  this.handleSaveContent('动态表项目', 'delete') // 保存数据
+                }
+              })
+              .catch(() => {})
             break
           case '单记录':
             if (this.contentEditForm.tableHeaders.length <= 1) {
@@ -2877,7 +3069,7 @@
               return
             }
             this.contentEditForm.tableHeaders.splice(index, 1)
-            handleDelete() // 执行删除逻辑
+            handleDelete()
             break
           default:
             break
@@ -3076,7 +3268,7 @@
         })
       },
       // 保存内容
-      handleSaveContent(type) {
+      handleSaveContent(type, action) {
         this.loading = true
         let isValid = false
         try {
@@ -3087,8 +3279,10 @@
             getFdBatchSaveOrUpdate(data)
               .then((res) => {
                 if (res.code === 200) {
-                  this.$message.success('保存成功')
-                  this.contentEditDialogVisible = false
+                  if (action != 'delete') {
+                    this.$message.success('保存成功')
+                    this.contentEditDialogVisible = false
+                  }
                 } else {
                   this.$message.error(`保存失败:${res.message || '未知错误'}`)
                 }
@@ -3157,7 +3351,7 @@
                 this.loading = false
               })
           } else if (type === '固定表项目') {
-            this.saveFixedTableData()
+            this.saveFixedTableData(action)
           } else if (type === '动态表表头') {
             var data = {
               headersList: this.contentEditForm.dynamicTable.tableHeaders,
@@ -3222,7 +3416,7 @@
                 this.loading = false
               })
           } else if (type === '动态表项目') {
-            this.saveDynamicTableData()
+            this.saveDynamicTableData(action)
           }
         } catch (error) {
           console.error('保存处理异常:', error)
@@ -3518,7 +3712,7 @@
         return result
       },
       //保存固定表项目数据
-      saveFixedTableData() {
+      saveFixedTableData(action) {
         try {
           // 获取拆分后的数据
           const splitData = this.splitFixedTableDataForSave()
@@ -3532,8 +3726,10 @@
           getFdBatchSaveOrUpdate(saveData)
             .then((res) => {
               if (res.code === 200) {
-                this.$message.success('固定表数据保存成功')
-                this.contentEditDialogVisible = false
+                if (action != 'delete') {
+                  this.$message.success('固定表数据保存成功')
+                  this.contentEditDialogVisible = false
+                }
               } else {
                 this.$message.error(`保存失败:${res.message || '未知错误'}`)
               }
@@ -3554,7 +3750,7 @@
         }
       },
       //保存动态表项目数据
-      saveDynamicTableData() {
+      saveDynamicTableData(action) {
         try {
           // 获取拆分后的数据
           const splitData = this.splitDynamicTableDataForSave()
@@ -3568,8 +3764,10 @@
           getFdBatchSaveOrUpdate(saveData)
             .then((res) => {
               if (res.code === 200) {
-                this.$message.success('动态表数据保存成功')
-                this.contentEditDialogVisible = false
+                if (action != 'delete') {
+                  this.$message.success('动态表数据保存成功')
+                  this.contentEditDialogVisible = false
+                }
               } else {
                 this.$message.error(`保存失败:${res.message || '未知错误'}`)
               }

+ 34 - 0
src/views/costAudit/baseInfo/statistics/historyAnalysis.vue

@@ -73,12 +73,46 @@
           <div class="chart-item">
             <div class="sub-title">成本变化趋势分析</div>
             <div id="trendChart" style="height: 300px"></div>
+            <!-- 轮播指示器 -->
+            <div class="carousel-indicators">
+              <ul
+                class="carousel"
+                @mouseenter="pauseTrendCarousel"
+                @mouseleave="resumeTrendCarousel"
+              >
+                <li
+                  v-for="index in trendTotalPages"
+                  :key="index"
+                  @click="goToTrendPage(index - 1)"
+                >
+                  <i :class="{ active: trendCurrentPage === index - 1 }"></i>
+                </li>
+              </ul>
+            </div>
           </div>
 
           <!-- 成本构成分析图表 -->
           <div class="chart-item">
             <div class="sub-title">成本构成分析</div>
             <div id="compositionChart" style="height: 300px"></div>
+            <!-- 轮播指示器 -->
+            <div class="carousel-indicators">
+              <ul
+                class="carousel"
+                @mouseenter="pauseCompositionCarousel"
+                @mouseleave="resumeCompositionCarousel"
+              >
+                <li
+                  v-for="index in compositionTotalPages"
+                  :key="index"
+                  @click="goToCompositionPage(index - 1)"
+                >
+                  <i
+                    :class="{ active: compositionCurrentPage === index - 1 }"
+                  ></i>
+                </li>
+              </ul>
+            </div>
           </div>
         </div>
       </div>

Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels