Selaa lähdekoodia

档案管理——批量/个人/记录(导出)调整

xiexaing 1 vuosi sitten
vanhempi
commit
292a658686

+ 7 - 7
src/store/modules/user.js

@@ -51,13 +51,13 @@ const user = {
         api.userdangAndatadownloadlist().then((res) => {
           let data = res.data || []
           commit('set_downLoadlist', data)
-          data.forEach(i => {
-            if (i.taskStatus == 3) {
-              api.userdangAndatadownloadup({ taskCode: i.taskCode }).then(result => {
-                methods.exportData(i.taskPath, false)
-              })
-            }
-          })
+          // data.forEach(i => {
+          //   if (i.taskStatus == 3) {
+          //     api.userdangAndatadownloadup({ taskCode: i.taskCode }).then(result => {
+          //       methods.exportData(i.taskPath, false)
+          //     })
+          //   }
+          // })
         }).catch(() => {
           clearInterval(this.state.downLoadlistInterval)
         })

+ 2 - 0
src/views/education/archives/downListRW.vue

@@ -15,6 +15,8 @@
         </el-table-column>
         <el-table-column prop="taskCode" label="文件编码" align="center">
         </el-table-column>
+        <el-table-column prop="fileName" label="文件名称" align="center">
+        </el-table-column>
         <el-table-column prop="taskStatus" label="状态" align="center">
           <template slot-scope="scope">
             {{ taskStatus(scope.row.taskStatus) }}

+ 42 - 21
src/views/education/archives/fileDownload.vue

@@ -7,21 +7,21 @@
       :title="userList.length > 1 ? '档案批量下载' : '档案下载'"
       @close="close"
     >
-      <el-button
+      <!-- <el-button
         size="small"
         type="primary"
         style="margin-bottom: 14px"
         @click="plDown"
         >批量下载</el-button
-      >
+      > -->
       <el-table :data="tableData" style="width: 100%" border ref="table">
-        <el-table-column type="selection" width="55" align="center">
-        </el-table-column>
+        <!-- <el-table-column type="selection" width="55" align="center">
+        </el-table-column> -->
         <el-table-column prop="name" label="文件名称" align="center">
         </el-table-column>
         <el-table-column fixed="right" label="操作" width="100" align="center">
           <template slot-scope="scope">
-            <el-button type="text" size="small" @click="down([scope.row.value])"
+            <el-button type="text" size="small" @click="handleDown(scope.row.value)"
               >下载</el-button
             >
           </template>
@@ -38,23 +38,23 @@ export default {
       isShow: false,
       tableData: [
         {
-          name: "个人资料",
+          name: "学员信息",
           value: 1,
         },
         {
-          name: "证件照",
+          name: "个人资料",
           value: 2,
         },
         {
-          name: "身份证",
+          name: "订单记录",
           value: 3,
         },
         {
-          name: "订单记录",
+          name: "报名记录",
           value: 4,
         },
         {
-          name: "报名记录",
+          name: "学员记录",
           value: 5,
         },
         {
@@ -98,16 +98,9 @@ export default {
       this.userList = item || [];
       this.isShow = true;
     },
-    plDown() {
-      let len = this.$refs.table.selection;
-      if (len.length > 0) {
-        this.down(len.map((i) => i.value));
-      } else {
-        this.$message.error("请勾选需要下载的选项");
-      }
-    },
-    down(i) {
-      this.$confirm(`确定${i.length > 1 ? "批量" : ""}下载吗?`, "提示", {
+    handleDown(val) {
+      const isDownRecord = [6, 7, 8].includes(val)
+      this.$confirm(`${ isDownRecord ? "文件过大,需到下载记录完成下载。" : "确定下载吗?"}`, "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         type: "warning",
@@ -116,15 +109,43 @@ export default {
           this.$api
             .userdangAndatadownload({
               userIds: this.userList,
-              types: i,
+              types: [val],
             })
             .then((res) => {
               this.$message.success("操作成功,正在下载");
+              if (!isDownRecord) this.$methodsTools.exportData(res.msg, false)
               this.$store.dispatch("downloadlist", true);
             });
         })
         .catch(() => {});
     },
+    // plDown() {
+    //   let len = this.$refs.table.selection;
+    //   if (len.length > 0) {
+    //     this.down(len.map((i) => i.value));
+    //   } else {
+    //     this.$message.error("请勾选需要下载的选项");
+    //   }
+    // },
+    // down(i) {
+    //   this.$confirm(`确定${i.length > 1 ? "批量" : ""}下载吗?`, "提示", {
+    //     confirmButtonText: "确定",
+    //     cancelButtonText: "取消",
+    //     type: "warning",
+    //   })
+    //     .then(() => {
+    //       this.$api
+    //         .userdangAndatadownload({
+    //           userIds: this.userList,
+    //           types: i,
+    //         })
+    //         .then((res) => {
+    //           this.$message.success("操作成功,正在下载");
+    //           this.$store.dispatch("downloadlist", true);
+    //         });
+    //     })
+    //     .catch(() => {});
+    // },
     close() {
       this.$refs.table.clearSelection();
     },