Procházet zdrojové kódy

fix: 任务统计查询、督办任务管理详情及查看,成本审核管理任务详情

shiyanyu před 1 měsícem
rodič
revize
ab97bd60c0

+ 15 - 5
src/components/task/mounTaskComponents/surveyTab.vue

@@ -2,10 +2,11 @@
   <div>
     <!-- 表格组件 -->
     <CostAuditTable
-      style="width: 50%"
+      v-loading="loading"
       :table-data="surveyData.list"
       :columns="getSurveyColumns()"
       :show-action-column="true"
+      style="width: 100%"
     ></CostAuditTable>
     <!-- 成本调查表查看弹窗 -->
     <SurveyDialog
@@ -40,6 +41,7 @@
     },
     data() {
       return {
+        loading: false,
         // 内容编辑弹窗相关
         contentEditDialogVisible: false,
         contentEditDialogTitle: '内容维护',
@@ -99,20 +101,24 @@
           console.warn('项目ID不存在,无法加载调查模板数据')
           return
         }
-
+        this.loading = true
         const params = {
           catalogId: this.project.catalogId,
         }
         getCostSurveyTemplates(params)
           .then((res) => {
             if (res && res.value) {
-              this.surveyData.list = Array.isArray(res.value) ? res.value : []
+              const arr = Array.isArray(res.value) ? res.value : []
+              this.surveyData.list = arr
             }
           })
           .catch((error) => {
             console.error('加载调查模板数据失败:', error)
             this.surveyData.list = []
           })
+          .finally(() => {
+            this.loading = false
+          })
       },
 
       // 获取带操作按钮的表格列配置
@@ -121,14 +127,17 @@
           {
             prop: 'surveyTemplateName',
             label: '模板名称',
-            minWidth: 180,
+            minWidth: 220,
             align: 'left',
+            headerAlign: 'center',
+            showOverflowTooltip: true,
           },
           {
             prop: 'templateType',
             label: '模板类型',
             width: 120,
             align: 'center',
+            headerAlign: 'center',
             formatter: (row) => {
               return row.templateType == '1'
                 ? '单记录'
@@ -141,7 +150,8 @@
             prop: 'action',
             label: '操作',
             align: 'center',
-            width: 120,
+            headerAlign: 'center',
+            width: 140,
             actions: [
               {
                 name: 'view',

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

@@ -201,6 +201,14 @@
       :current-status="cbjsInfoData && cbjsInfoData.status"
     />
     <taskDetail ref="taskDetail" />
+    <!-- 成本监审任务制定弹窗(用于“任务详情”只读查看) -->
+    <task-customized-release-dialog
+      :visible.sync="taskReleaseDialogVisible"
+      :project="project"
+      :is-view="true"
+      @backToList="taskReleaseDialogVisible = false"
+      @close="taskReleaseDialogVisible = false"
+    />
   </div>
 </template>
 <script>
@@ -212,6 +220,8 @@
   import taskInfo from '@/components/task/taskInfo.vue'
   import cbjsInfo from '@/components/task/cbjsInfo.vue'
   import taskDetail from '@/components/task/taskDetail.vue'
+  import TaskCustomizedReleaseDialog from '@/components/task/TaskCustomizedReleaseDialog.vue'
+  import { getCostProjectDetail } from '@/api/taskCustomizedRelease.js'
   export default {
     name: 'CostAuditManagement',
     components: {
@@ -220,6 +230,7 @@
       cbjsInfo,
       mainDetailsDialog,
       taskDetail,
+      TaskCustomizedReleaseDialog,
     },
     data() {
       return {
@@ -240,6 +251,10 @@
         cbjsInfoVisible: false,
         cbjsInfoData: null,
         mainDetailsVisible: false,
+        // 任务详情(项目)弹窗
+        taskReleaseDialogVisible: false,
+        project: {},
+        isView: true,
       }
     },
 
@@ -365,10 +380,31 @@
 
       // 查看任务详情
       handleViewTaskDetail(row) {
-        // this.selectedTask = row
-        // this.activeTab = 'detail'
-        // this.showTaskDetail = true
-        this.$refs.taskDetail.open(row, 'chengben')
+        // 使用成本监审任务制定弹窗(只读)
+        this.openTaskReleaseDialog(row)
+      },
+      // 打开成本监审任务制定弹窗(只读查看)
+      openTaskReleaseDialog(row) {
+        if (!row) return
+        const projectId =
+          row.projectId || row.projectID || row.id || row.taskId || ''
+        if (!projectId) {
+          this.$message &&
+            this.$message.warning &&
+            this.$message.warning('缺少项目ID,无法查看详情')
+          return
+        }
+        this.isView = true
+        getCostProjectDetail({ id: projectId })
+          .then((res) => {
+            this.project = (res && res.value) || {}
+            this.taskReleaseDialogVisible = true
+          })
+          .catch(() => {
+            // 回退:接口失败时至少展示当前行数据
+            this.project = row || {}
+            this.taskReleaseDialogVisible = true
+          })
       },
 
       // 打开详情弹窗

+ 6 - 0
src/views/costAudit/baseInfo/catalogManage/surveyDialog.vue

@@ -8,6 +8,7 @@
       :show-confirm-btn="false"
       cancel-text="关闭"
       append-to-body
+      :z-index="dialogZIndex"
       @cancel="handleCancel"
     >
       <div class="content-edit-container">
@@ -243,6 +244,11 @@
         type: Boolean,
         default: true,
       },
+      // 弹窗层级
+      dialogZIndex: {
+        type: Number,
+        default: 4000,
+      },
     },
     data() {
       return {

+ 51 - 3
src/views/costAudit/projectInfo/auditTaskManage/taskQueryStatistics/index.vue

@@ -98,9 +98,20 @@
       >
         <!-- 操作列自定义模板 -->
         <template #operation="{ row }">
-          <el-button size="mini" type="text" @click="handleView(row)">
-            查看
-          </el-button>
+          <template v-if="row.isSubTask">
+            <el-button size="mini" type="text" @click="handleView(row)">
+              查看
+            </el-button>
+          </template>
+          <template v-else>
+            <el-button
+              size="mini"
+              type="text"
+              @click="handleViewTaskDetail(row)"
+            >
+              详情
+            </el-button>
+          </template>
         </template>
       </cost-audit-table>
       <!-- 分页 -->
@@ -132,6 +143,15 @@
       :visible.sync="taskDetailVisible"
       :is-view="isView"
     />
+
+    <!-- 成本监审任务制定弹窗(列表“详情/查看”入口使用) -->
+    <task-customized-release-dialog
+      :visible.sync="taskReleaseDialogVisible"
+      :project="project"
+      :is-view="true"
+      @backToList="taskReleaseDialogVisible = false"
+      @close="taskReleaseDialogVisible = false"
+    />
   </div>
 </template>
 
@@ -141,11 +161,14 @@
   import CostAuditTable from '@/components/costAudit/CostAuditTable.vue'
   import { getTaskListStatistics, getItemsCount } from '@/api/home'
   import TaskDetail from '@/components/task/taskDetail.vue'
+  import TaskCustomizedReleaseDialog from '@/components/task/TaskCustomizedReleaseDialog.vue'
+  import { getCostProjectDetail } from '@/api/taskCustomizedRelease.js'
   export default {
     components: {
       detailTabs,
       CostAuditTable,
       TaskDetail,
+      TaskCustomizedReleaseDialog,
     },
     mixins: [dictMixin, regionMixin],
     data() {
@@ -177,6 +200,7 @@
         taskData: {},
         unitList: [],
         taskDetailVisible: false,
+        taskReleaseDialogVisible: false,
         // 表格列配置
         tableColumns: [
           {
@@ -392,6 +416,30 @@
           this.$refs.taskDetail && this.$refs.taskDetail.open(row, 'chengben')
         })
       },
+      handleViewTaskDetail(row) {
+        this.openTaskReleaseDialog(row)
+      },
+      openTaskReleaseDialog(row) {
+        if (!row) return
+        const projectId =
+          row.projectId || row.projectID || row.id || row.taskId || ''
+        if (!projectId) {
+          this.$message &&
+            this.$message.warning &&
+            this.$message.warning('缺少项目ID,无法查看详情')
+          return
+        }
+        this.isView = true
+        getCostProjectDetail({ id: projectId })
+          .then((res) => {
+            this.project = (res && res.value) || {}
+            this.taskReleaseDialogVisible = true
+          })
+          .catch(() => {
+            this.project = row || {}
+            this.taskReleaseDialogVisible = true
+          })
+      },
       handleDetailClose() {
         this.activeView = 'list'
       },

+ 54 - 15
src/views/costAudit/projectInfo/taskSuperviseManage/superviseMattersManage/index.vue

@@ -196,17 +196,21 @@
         <el-button @click="handleCancel">取消</el-button>
       </div>
     </el-dialog>
-    <!-- isDetail -->
+    <!-- 任务详情弹窗(子项“查看”) -->
+    <task-detail
+      ref="taskDetail"
+      :visible.sync="taskDetailVisible"
+      :is-view="isView"
+    />
 
-    <el-dialog
-      title="查看子任务"
-      :visible.sync="isView"
-      width="80%"
-      @close="handleViewDialogClose"
-    >
-      <!-- todo -->
-      详情内容
-    </el-dialog>
+    <!-- 成本监审任务制定弹窗(母项“详情”) -->
+    <task-customized-release-dialog
+      :visible.sync="taskReleaseDialogVisible"
+      :project="project"
+      :is-view="true"
+      @backToList="taskReleaseDialogVisible = false"
+      @close="taskReleaseDialogVisible = false"
+    />
   </div>
 </template>
 
@@ -215,11 +219,16 @@
   import { dictMixin } from '@/mixins/useDict'
   import UploadComponent from '@/components/costAudit/UploadComponent.vue'
   import { updateSuperviseTask } from '@/api/audit/supervise'
+  import TaskDetail from '@/components/task/taskDetail.vue'
+  import TaskCustomizedReleaseDialog from '@/components/task/TaskCustomizedReleaseDialog.vue'
+  import { getCostProjectDetail } from '@/api/taskCustomizedRelease.js'
 
   export default {
     name: 'TaskSupervision',
     components: {
       UploadComponent,
+      TaskDetail,
+      TaskCustomizedReleaseDialog,
     },
     mixins: [dictMixin],
     data() {
@@ -243,7 +252,12 @@
         currentTask: null,
         activeTab: '0',
         isReport: false,
-        isView: false,
+        isView: true,
+        // 任务详情弹窗(子项)
+        taskDetailVisible: false,
+        // 成本监审任务制定弹窗(母项)
+        taskReleaseDialogVisible: false,
+        project: {},
         isDetail: false,
       }
     },
@@ -330,12 +344,37 @@
         return v
       },
       handleView(row) {
-        console.log('查看子任务:', row)
+        // 子项查看:打开任务详情弹窗
         this.isView = true
+        this.taskDetailVisible = true
+        this.$nextTick(() => {
+          this.$refs.taskDetail && this.$refs.taskDetail.open(row, 'chengben')
+        })
       },
       handleDetails(row) {
-        this.isDetail = true
-        console.log('查看详情:', row)
+        // 母项详情:打开成本监审任务制定弹窗(只读)
+        this.openTaskReleaseDialog(row)
+      },
+      openTaskReleaseDialog(row) {
+        if (!row) return
+        const projectId =
+          row.projectId || row.projectID || row.id || row.taskId || ''
+        if (!projectId) {
+          this.$message &&
+            this.$message.warning &&
+            this.$message.warning('缺少项目ID,无法查看详情')
+          return
+        }
+        this.isView = true
+        getCostProjectDetail({ id: projectId })
+          .then((res) => {
+            this.project = (res && res.value) || {}
+            this.taskReleaseDialogVisible = true
+          })
+          .catch(() => {
+            this.project = row || {}
+            this.taskReleaseDialogVisible = true
+          })
       },
       handleReport(row) {
         this.currentTask = row
@@ -431,7 +470,7 @@
         this.isDetail = false
       },
       handleViewDialogClose() {
-        this.isView = false
+        this.taskDetailVisible = false
       },
     },
   }

+ 52 - 6
src/views/costAudit/projectInfo/taskSuperviseManage/superviseResultManage/index.vue

@@ -236,6 +236,21 @@
         </div>
       </div>
     </el-dialog>
+    <!-- 任务详情弹窗(子项“查看”) -->
+    <task-detail
+      ref="taskDetail"
+      :visible.sync="taskDetailVisible"
+      :is-view="isView"
+    />
+
+    <!-- 成本监审任务制定弹窗(母项“任务详情”) -->
+    <task-customized-release-dialog
+      :visible.sync="taskReleaseDialogVisible"
+      :project="project"
+      :is-view="true"
+      @backToList="taskReleaseDialogVisible = false"
+      @close="taskReleaseDialogVisible = false"
+    />
   </div>
 </template>
 
@@ -245,6 +260,9 @@
     getSuperviseReportList,
     getSuperviseReportDetail,
   } from '@/api/audit/supervise'
+  import TaskDetail from '@/components/task/taskDetail.vue'
+  import TaskCustomizedReleaseDialog from '@/components/task/TaskCustomizedReleaseDialog.vue'
+  import { getCostProjectDetail } from '@/api/taskCustomizedRelease.js'
   export default {
     data() {
       return {
@@ -350,8 +368,11 @@
         currentTask: null,
         supervisionRecords: [],
         isSupervisionDetail: false,
-        isTaskDetails: false,
-        isViewDetails: false,
+        // 统一与其它页面一致的弹窗控制
+        isView: true,
+        taskDetailVisible: false,
+        taskReleaseDialogVisible: false,
+        project: {},
       }
     },
     mounted() {
@@ -489,12 +510,37 @@
         this.generateTableData()
       },
       handleView(row) {
-        this.isViewDetails = true
-        console.log('查看子任务:', row)
+        // 子项“查看”:打开任务详情弹窗
+        this.isView = true
+        this.taskDetailVisible = true
+        this.$nextTick(() => {
+          this.$refs.taskDetail && this.$refs.taskDetail.open(row, 'chengben')
+        })
       },
       handleTaskDetail(row) {
-        this.isTaskDetails = true
-        console.log('查看任务详情:', row)
+        // 母项“任务详情”:打开成本监审任务制定弹窗(只读)
+        this.openTaskReleaseDialog(row)
+      },
+      openTaskReleaseDialog(row) {
+        if (!row) return
+        const projectId =
+          row.projectId || row.projectID || row.id || row.taskId || ''
+        if (!projectId) {
+          this.$message &&
+            this.$message.warning &&
+            this.$message.warning('缺少项目ID,无法查看详情')
+          return
+        }
+        this.isView = true
+        getCostProjectDetail({ id: projectId })
+          .then((res) => {
+            this.project = (res && res.value) || {}
+            this.taskReleaseDialogVisible = true
+          })
+          .catch(() => {
+            this.project = row || {}
+            this.taskReleaseDialogVisible = true
+          })
       },
       handleSupervisionDetail(row) {
         this.isSupervisionDetail = true