Browse Source

Merge branch 'master' of http://119.23.210.103:3000/wy/zdqy_firm_former

tianxinyu 4 months ago
parent
commit
4d23afcd2e
1 changed files with 38 additions and 6 deletions
  1. 38 6
      src/views/component/sjzlpjjhx/sjzlpjjhx.vue

+ 38 - 6
src/views/component/sjzlpjjhx/sjzlpjjhx.vue

@@ -37,7 +37,7 @@
                 icon="ibps-icon-sign-out"
                 @click="handleActionEvent('exportData')"
               >
-                导出模板
+                导出数据
               </el-button>
               <el-button
                 :key="4"
@@ -387,11 +387,43 @@ export default {
           this.showImportTable = true
           break
         case 'exportData':
-          this.handleExport(
-            this.getColumns(),
-            [],
-            '参加外部质量评价活动计划项目详情(模板)'
-          )
+          this.$confirm('选择导出类型', '提示', {
+            confirmButtonText: '导出全部数据',
+            cancelButtonText: '导出模板',
+            type: 'success'
+          })
+            .then(() => {
+              const exportData =
+                JSON.parse(JSON.stringify(this.sjzlpjjhxData)) || []
+              const { userList = [] } = this.$store.getters || {}
+              for (let i of exportData) {
+                if (i.canYuRenYuan) {
+                  const userNames = []
+                  for (let j of i.canYuRenYuan.split(',')) {
+                    const result = userList.find(
+                      (a) => a.userId.trim() == j.trim()
+                    )
+                    userNames.push(result?.userName)
+                  }
+                  i.canYuRenYuan = userNames.join(',')
+                  console.log(i.canYuRenYuan, 'qqqqqqqqq')
+                }
+              }
+
+              this.handleExport(
+                this.getColumns(),
+                exportData,
+                '参加外部质量评价活动计划项目详情'
+              )
+            })
+            .catch(() => {
+              this.handleExport(
+                this.getColumns(),
+                [],
+                '参加外部质量评价活动计划项目详情(模板)'
+              )
+            })
+
           break
         case 'copy':
           if (this.multipleSelection.length > 0) {