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

成本审核管理列表添加查看并显示弹窗详情

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

+ 9 - 3
src/components/task/taskInfo.vue

@@ -946,7 +946,9 @@
           .catch(() => {})
       },
       // 对外暴露的打开方法
-      open(data) {
+      open(data, type) {
+        console.log('data', data)
+        console.log('type', type)
         this.dialogVisible = true
         this.activeTab = 'projectInfo'
 
@@ -964,8 +966,11 @@
         if (data) {
           // 保存任务信息
           this.currentTaskInfo = {
-            projectId: data.projectId || data.id,
-            taskId: data.userTask?.id || data.taskId,
+            projectId: type === 'chengben' ? data.projectId : data.id,
+            taskId:
+              type === 'chengben'
+                ? data.taskId
+                : data.userTask?.id || data.taskId,
             currentNode: data.currentNode,
             ...data,
           }
@@ -1012,6 +1017,7 @@
       },
       // 加载立项信息
       async loadProjectInfo() {
+        console.log(this.currentTaskInfo.projectId)
         if (!this.currentTaskInfo?.projectId) {
           return
         }

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

@@ -150,6 +150,12 @@
               >
                 恢复
               </el-button>
+              <el-button
+                type="text"
+                @click="handleMessage(scope.row, 'chengben')"
+              >
+                查看
+              </el-button>
             </span>
           </template>
         </el-table-column>
@@ -176,6 +182,7 @@
       @close="handleDetailsClose"
       @refresh="handleRefresh"
     />
+    <taskInfo ref="taskInfo" />
   </div>
 </template>
 <script>
@@ -184,10 +191,12 @@
   import taskMixins from './taskMixins.js'
   // 成本监审任务列表API
   import { getReviewTaskList } from '@/api/audit/auditIndex'
+  import taskInfo from '@/components/task/taskInfo.vue'
   export default {
     name: 'CostAuditManagement',
     components: {
       detailsDialog,
+      taskInfo,
     },
     mixins: [taskMixins],
     data() {
@@ -264,6 +273,9 @@
                       currentNode: child.currentNode,
                       status: child.status,
                       isSubTask: true,
+                      projectId: child.projectId,
+                      auditedUnitId: child.auditedUnitId,
+                      taskId: child.id,
                     }))
                   : [],
               }
@@ -401,6 +413,10 @@
         this.currentPage = current
         this.loadAuditProjectList()
       },
+      // 查看
+      handleMessage(row, type) {
+        this.$refs.taskInfo.open(row, type)
+      },
     },
   }
 </script>