molilang hace 3 años
padre
commit
9bd8b89c28

+ 13 - 10
src/pages/main/gridDivision/approvalExamination.vue

@@ -91,7 +91,7 @@ export default {
       opinion_visible: false,
       track_visible: false,
       opinion_form: {},
-      status:'',
+      status: "",
       isAgree: false,
       // 单条审批id
       ids: "",
@@ -164,7 +164,7 @@ export default {
         },
         {
           label: "附件",
-          props: "fileNames",
+          props: "attList",
           type: "file",
         },
         {
@@ -207,7 +207,7 @@ export default {
         },
         {
           label: "处理时间",
-          props: "createTimeStr",
+          props: "createTime",
         },
         {
           label: "审批意见",
@@ -252,7 +252,7 @@ export default {
           ? data.map((element, index) => ({
               ...element,
               No: index + 1,
-              sts:this.status + ''
+              sts: this.status + "",
             }))
           : [];
         this.table_list && this.table_list[0].sts === "0"
@@ -280,9 +280,11 @@ export default {
                 props: "track",
               },
             ]);
-        data.forEach((item) => {
-          this.adoptIds.push(item.id.toString());
-        });
+        if (data.length) {
+          data.forEach((item) => {
+            this.adoptIds.push(item.wanggeId.toString());
+          });
+        }
         // console.log(this.table_list,'table_list');
         // console.log(this.adoptIds);
       });
@@ -328,7 +330,7 @@ export default {
         headers: {
           "Content-Type": "application/json",
         },
-        data:this.parentId
+        data: this.parentId + "",
       }).then(({ data }) => {
         let body = data.body;
         console.log(body, "body");
@@ -401,14 +403,15 @@ export default {
           },
         }).then((res) => {
           console.log(res);
+          this.status = '1'
           this.handleInit();
         });
       }
 
       this.handleVisible("opinion");
     },
-    handleReturn(){
-      this.$router.go(-1)
+    handleReturn() {
+      this.$router.go(-1);
     },
     // 审批轨迹--确定关闭模态框
     handleConsent() {

+ 22 - 32
src/pages/main/gridDivision/workersList.vue

@@ -68,6 +68,7 @@
             class="upload-demo"
             drag
             :limit="3"
+            :on-remove="uploadRemove"
             :http-request="uploadBack"
             action="http://192.168.1.228:9600/spfm"
             multiple
@@ -397,7 +398,7 @@ export default {
               id: element.id + '',
               deal: element.draft === "1" && element.sts === "0" ? "1" : "0",
               isEdit:
-                element.draft === "0" && element.createId === this.loginNoStr && element.parentLevel === '1'
+                element.draft === "0" && element.createId === this.loginNoStr && element.parentLevel === '0'
                   ? "1"
                   : "0",
               No: index + 1,
@@ -457,38 +458,24 @@ export default {
     },
     //文件返回值
     uploadBack({ file }) {
-      // const fileName = [];
-      // const fileIds = [];
-      // v.forEach((element) => {
-      //   fileName.push(element.fileName);
-      //   fileIds.push(element.fileCode);
-      // });
-      // console.log(v);
-      // this.add_form.fileNames = fileName.join(",");
-      // this.add_form.fileIds = fileIds.join(",");
-      // console.log(this.add_form,'this.add_form')
-      // console.log(file,'file');
-      // let params = new FormData();
-      // params.append('file',file)
-      // console.log(file);
       this.file.push(file);
       console.log(this.file);
       this.file1 = this.file[0]
       this.file2 = this.file[1]
       this.file3 = this.file[2]
-      // this.$http({
-      //   url: "/market/mkWangge/upload",
-      //   method: "post",
-      //   headers: {
-      //     "Content-Type": "application/json",
-      //   },
-      //   data:file
-      // }).then((res)=>{
-      //   console.log(res);
-      // })
-      // let params = new FormData()
-      // params.append('file',file)
-      // console.log(params,'params');
+    },
+    // 删除文件
+    uploadRemove(file){
+      // console.log(file);
+      this.file.forEach((item,index) => {
+        if(item.uid === file.uid) {
+          this.file.splice(index,1)
+        }
+      })
+      console.log(this.file);
+      this.file1 = this.file[0]
+      this.file2 = this.file[1]
+      this.file3 = this.file[2]
     },
     // 获取模态框信息
     getDialogData(row) {
@@ -506,9 +493,9 @@ export default {
         },
       }).then(({ data: { body } }) => {
         console.log(body, "body");
-        this.ids = [body.id.toString()];
+        this.ids = [body.wanggeId.toString()];
         this.add_form = {
-          id: body.id,
+          id: body.wanggeId,
           proposer: body.proposer,
           telephone: body.telephone,
           wanggeText: body.wanggeText,
@@ -524,6 +511,7 @@ export default {
         this.fileInfo.fileList = body.attList
           ? body.attList.map((item) => ({
               ...item,
+              name:item.fileName
             }))
           : [];
       });
@@ -610,6 +598,7 @@ export default {
             }).then((res) => {
               console.log(res);
               this.handleInit();
+              this.handleVisible('add')
             });
           } else {
             // 审批
@@ -631,10 +620,11 @@ export default {
             }).then((res) => {
               console.log(res);
               this.handleInit();
+              this.handleVisible('add')
             });
           }
-          this.edit_visible = false;
-          this.add_visible = false;
+          // this.edit_visible = false;
+          // this.add_visible = false;
           this.fileInfo.fileList = [];
         }
       });

+ 6 - 6
src/pages/main/performance/components/table.vue

@@ -63,17 +63,17 @@
           {{ dictionary[scope.row[props]] }}
         </div>
         <div v-else-if="type === 'file'">
-          <div v-if="scope.row[props] && scope.row[props].length" class="flex-justify-center">
-            <span
-              v-for="(item, index) in scope.row[props].split(',')"
+          <div v-if="scope.row[props] && scope.row[props].length">
+            <div
+              v-for="({ fileName }, index) in scope.row[props]"
               :key="index"
               @click="downloadFile({index,rows:scope.row})"
                class="simple-table-click cursor-pointer margin-left-10"
             >
-              {{ item }}
-            </span>
+              {{ fileName }}
+            </div>
           </div>
-          <div v-else>{{ scope.row[props] }}</div>
+          <div v-else></div>
         </div>
         <div v-else>{{ scope.row[props] }}</div>
       </template>