daiqisheng 3 vuotta sitten
vanhempi
commit
34971808ef

+ 5 - 0
src/pages/main/gridDivision/approvalExamination.vue

@@ -13,6 +13,7 @@
       :config="table_config"
       :loading="table_loading"
       :handle-row="table_handle_row"
+      @download="handleDownload"
       @selection="handleSelect"
       @back="handleBack"
     ></simple-table>
@@ -167,6 +168,7 @@ export default {
         {
           label: "附件",
           props: "fileNames",
+          type:'file'
         },
         {
           label: "状态",
@@ -263,6 +265,9 @@ export default {
       this.page = page;
       this.handleInit();
     },
+    handleDownload(data){
+      console.log(data,'data');
+    },
     handleVisible(props) {
       switch (props) {
         case "opinion":

+ 15 - 17
src/pages/main/gridDivision/workersList.vue

@@ -336,10 +336,10 @@ export default {
       }).then(({ data: { count, data } }) => {
         this.table_loading = false;
         this.total = count;
-        this.table_list = data.map((element,index) => ({
+        this.table_list = data.map((element, index) => ({
           ...element,
           deal: element.draft === "1" && element.sts === "0" ? "1" : "0",
-          No: index + 1
+          No: index + 1,
         }));
         console.log(this.table_list);
       });
@@ -360,7 +360,7 @@ export default {
           this.title = "新建";
           this.isCheck = false;
           this.add_form = {};
-          this.fileInfo.fileList = []
+          this.fileInfo.fileList = [];
           break;
         case "summary":
           this.summary_visible = !this.summary_visible;
@@ -401,14 +401,9 @@ export default {
         fileName.push(element.fileName);
         fileIds.push(element.fileCode);
       });
-      // this.add_form = {
-      //   fileNames: fileName.join(","),
-      //   fileIds: fileIds.join(","),
-      // };
-      this.fileInfo.fileList = v
-      this.add_form.fileNames = fileName.join(",")
-      this.add_form.fileIds = fileIds.join(",")
-      console.log(this.fileInfo.fileList);
+      this.add_form.fileNames = fileName.join(",");
+      this.add_form.fileIds = fileIds.join(",");
+      console.log(this.add_form,'this.add_form')
     },
     // 获取模态框信息
     getDialogData(row) {
@@ -424,8 +419,7 @@ export default {
           id,
           type,
         },
-      }).then(({ data }) => {
-        let body = data.body;
+      }).then(({ data: { body } }) => {
         console.log(body, "body");
         this.ids = [body.id.toString()];
         this.add_form = {
@@ -436,10 +430,14 @@ export default {
           fileNames: body.fileNames,
           fileIds: body.fileIds,
         };
-        // this.fileInfo.fileList = body.fileNames.split(',')
-        this.table_list_approve = body.bpmTaskList.map((item,index) => ({
+        this.fileInfo.fileList = body.fileNames.split(",").map((el, index) => ({
+          fileName: el,
+          name: el,
+          fileCode: body.fileIds.split(",")[index],
+        }));
+        this.table_list_approve = body.bpmTaskList.map((item, index) => ({
           ...item,
-          No: index + 1
+          No: index + 1,
         }));
       });
     },
@@ -538,7 +536,7 @@ export default {
           }
           this.edit_visible = false;
           this.add_visible = false;
-          this.fileInfo.fileList = []
+          this.fileInfo.fileList = [];
         }
       });
     },

+ 18 - 2
src/pages/main/performance/components/table.vue

@@ -2,7 +2,7 @@
  * @Author       : yuanrunwei
  * @Date         : 2021-11-01 18:02:58
  * @LastEditors: Please set LastEditors
- * @LastEditTime: 2022-01-11 18:42:02
+ * @LastEditTime: 2022-01-12 13:19:40
  * @FilePath     : /spfm-market-front/src/pages/main/performance/components/table.vue
 -->
 <template>
@@ -53,7 +53,7 @@
         </div>
         <div v-else-if="type === 'click'">
           <div
-            class="simple-table-click cursor-pointer"
+            class="simple-table-click cursor-pointer flex"
             @click="handleClick(props, scope.row)"
           >
             {{ scope.row[props] }}
@@ -62,6 +62,19 @@
         <div v-else-if="type === 'dictionary'">
           {{ dictionary[scope.row[props]] }}
         </div>
+        <div v-else-if="type === 'file'">
+          <div v-if="scope.row[props] && scope.row[props].length">
+            <span
+              v-for="(item, index) in scope.row[props].split(',')"
+              :key="index"
+              @click="downloadFile(item)"
+               class="simple-table-click cursor-pointer margin-left-10"
+            >
+              {{ item }}
+            </span>
+          </div>
+          <div v-else>{{ scope.row[props] }}</div>
+        </div>
         <div v-else>{{ scope.row[props] }}</div>
       </template>
       <template v-if="children">
@@ -182,6 +195,9 @@ export default {
     handleSelectionChange(val) {
       this.$emit("selection", val);
     },
+    downloadFile(val) {
+      this.$emit("download", val);
+    },
     handleModify() {
       this.$emit("modify", this.computed_list);
     },