Browse Source

Merge branch 'dev_info' of https://git.agilestar.cn/spfm-group/spfm-market-front into dev_info

daiqisheng 3 years ago
parent
commit
2767297553

+ 33 - 28
src/pages/main/gridDivision/approvalExamination.vue

@@ -245,8 +245,14 @@ export default {
           "Content-Type": "application/json",
         },
         data: reqdata,
-      }).then(({ data: { count, data } }) => {
+      }).then(({ data: body }) => {
         this.table_loading = false;
+        console.log(body.body);
+        
+        // 列表数据回显
+        let data = body.body.page.data;
+        let count = body.body.page.count;
+
         this.total = count;
         this.table_list = data
           ? data.map((element, index) => ({
@@ -300,17 +306,17 @@ export default {
       this.page = page;
       this.handleInit();
     },
-    handleDownload({index,rows}) {
-      let fileName = ''
-      let fileCode = ''
-      rows.attList.forEach((el,no) => {
-        if(no === index) {
-          fileName = el.fileName
-          fileCode = el.id
+    handleDownload({ index, rows }) {
+      let fileName = "";
+      let fileCode = "";
+      rows.attList.forEach((el, no) => {
+        if (no === index) {
+          fileName = el.fileName;
+          fileCode = el.id;
         }
-      })
-      console.log(index,rows);
-      console.log(fileName,fileCode);
+      });
+      console.log(index, rows);
+      console.log(fileName, fileCode);
       this.$http({
         url: "/market/compatt/downfile",
         method: "post",
@@ -339,7 +345,6 @@ export default {
         }
       });
 
-
       // // /market/compatt/downfile
       // console.log(item);
     },
@@ -417,16 +422,16 @@ export default {
           },
         }).then(({ data }) => {
           console.log(data);
-          if(data.desc === '操作成功'){
+          if (data.desc === "操作成功") {
             this.$message({
-              message:'操作成功!',
-              type:'success'
-            })
-          }else if(data.desc === '操作失败'){
+              message: "操作成功!",
+              type: "success",
+            });
+          } else if (data.desc === "操作失败") {
             this.$message({
-              message:'操作失败!',
-              type:'error'
-            })
+              message: "操作失败!",
+              type: "error",
+            });
           }
           this.handleInit();
         });
@@ -451,16 +456,16 @@ export default {
         }).then(({ data }) => {
           console.log(data);
           this.status = "1";
-          if(data.desc === '操作成功'){
+          if (data.desc === "操作成功") {
             this.$message({
-              message:'操作成功!',
-              type:'success'
-            })
-          }else if(data.desc === '操作失败'){
+              message: "操作成功!",
+              type: "success",
+            });
+          } else if (data.desc === "操作失败") {
             this.$message({
-              message:'操作失败!',
-              type:'error'
-            })
+              message: "操作失败!",
+              type: "error",
+            });
           }
           this.handleInit();
         });

+ 40 - 1
src/pages/main/gridDivision/workersList.vue

@@ -397,8 +397,47 @@ export default {
           "Content-Type": "application/json",
         },
         data: reqdata,
-      }).then(({ data: { count, data } }) => {
+      }).then(({ data: body }) => {
         this.table_loading = false;
+        console.log(body.body);
+
+        // 汇总或新建权限判断是否显示按钮
+        let huiZongButton = body.body.huiZongButton;
+        let insertButton = body.body.insertButton;
+
+        if (huiZongButton && insertButton) {
+          this.table_handle = [
+            {
+              label: "工单汇总",
+              props: "summary",
+            },
+            {
+              label: "新建",
+              props: "add",
+            },
+          ];
+        }else if(huiZongButton && !insertButton){
+          this.table_handle = [
+            {
+              label: "工单汇总",
+              props: "summary",
+            },
+          ];
+        }else if(!huiZongButton && insertButton){
+          this.table_handle = [
+            {
+              label: "新建",
+              props: "add",
+            },
+          ];
+        }else{
+          this.table_handle = []
+        }
+
+        // 列表数据回显
+        let data = body.body.page.data;
+        let count = body.body.page.count;
+
         this.total = count;
         this.table_list = data
           ? data.map((element, index) => ({