molilang 3 gadi atpakaļ
vecāks
revīzija
5fb53502f6
1 mainītis faili ar 103 papildinājumiem un 30 dzēšanām
  1. 103 30
      src/pages/main/gridDivision/workersList.vue

+ 103 - 30
src/pages/main/gridDivision/workersList.vue

@@ -17,6 +17,7 @@
       @selection="handleaaa"
       @selection="handleaaa"
       @check="handleCheck"
       @check="handleCheck"
       @edit="handleEdit"
       @edit="handleEdit"
+      @approve="handleApprove"
     ></simple-table>
     ></simple-table>
     <simple-pagination
     <simple-pagination
       :page="page"
       :page="page"
@@ -77,13 +78,18 @@
             :loading="table_loading_approve"
             :loading="table_loading_approve"
           ></simple-table>
           ></simple-table>
         </el-form-item>
         </el-form-item>
-        <el-form-item label="审批意见" prop="desc" v-if="edit_visible">
-          <el-input type="textarea" v-model="add_form.desc"></el-input>
+        <el-form-item
+          label="审批意见"
+          prop="desc"
+          v-if="edit_visible && approve_visible"
+        >
+          <el-input type="textarea" v-model="add_form.remark"></el-input>
         </el-form-item>
         </el-form-item>
       </el-form>
       </el-form>
       <template v-slot:footer>
       <template v-slot:footer>
         <div v-if="!isCheck">
         <div v-if="!isCheck">
           <el-button @click="handleSubmit" type="primary">保存</el-button>
           <el-button @click="handleSubmit" type="primary">保存</el-button>
+          <el-button type="primary">重新提交</el-button>
           <el-button @click="handleVisible('add')" type="default"
           <el-button @click="handleVisible('add')" type="default"
             >取消</el-button
             >取消</el-button
           >
           >
@@ -145,6 +151,8 @@ export default {
       add_visible: false,
       add_visible: false,
       summary_visible: false,
       summary_visible: false,
       edit_visible: false,
       edit_visible: false,
+      approve_visible: false,
+      ids:[],
       add_form: {},
       add_form: {},
       table_handle: [
       table_handle: [
         {
         {
@@ -204,10 +212,17 @@ export default {
           props: "check",
           props: "check",
         },
         },
         {
         {
-          label: "处理",
+          label: "编辑",
           props: "edit",
           props: "edit",
           visible: {
           visible: {
-            sts: ['0'],
+            sts: ["0"],
+          },
+        },
+        {
+          label: "处理",
+          props: "approve",
+          visible: {
+            sts: ["0"],
           },
           },
         },
         },
       ],
       ],
@@ -228,7 +243,6 @@ export default {
         {
         {
           label: "发起时间",
           label: "发起时间",
           props: "createTime",
           props: "createTime",
-          type: "date",
         },
         },
         {
         {
           label: "状态",
           label: "状态",
@@ -248,15 +262,15 @@ export default {
         },
         },
         {
         {
           label: "流程环节",
           label: "流程环节",
-          props: "actionName",
+          props: "procName",
         },
         },
         {
         {
           label: "处理人",
           label: "处理人",
-          props: "proposer",
+          props: "opName",
         },
         },
         {
         {
           label: "处理工号",
           label: "处理工号",
-          props: "procId",
+          props: "opNo",
         },
         },
         {
         {
           label: "处理时间",
           label: "处理时间",
@@ -265,9 +279,9 @@ export default {
         },
         },
         {
         {
           label: "审批意见",
           label: "审批意见",
-          props: "status",
-          type: "dictionary",
-          dictionary: { 0: "同意", 1: "不同意" },
+          props: "remark",
+          // type: "dictionary",
+          // dictionary: { 0: "同意", 1: "不同意" },
         },
         },
       ],
       ],
     };
     };
@@ -275,7 +289,7 @@ export default {
   mounted() {
   mounted() {
     this.handleInit({
     this.handleInit({
       ...this.table_search,
       ...this.table_search,
-      type: "0",
+      type: "1",
       page: this.page,
       page: this.page,
       pageSize: this.rows,
       pageSize: this.rows,
     });
     });
@@ -311,6 +325,7 @@ export default {
       });
       });
     },
     },
     handleVisible(props) {
     handleVisible(props) {
+      this.approve_visible = false;
       switch (props) {
       switch (props) {
         case "add":
         case "add":
           this.add_visible = !this.add_visible;
           this.add_visible = !this.add_visible;
@@ -402,28 +417,86 @@ export default {
       });
       });
       this.handleVisible("edit");
       this.handleVisible("edit");
     },
     },
+    // 处理按钮
+    handleApprove(row) {
+      let id = row.id;
+      let type = row.parentId === null ? "1" : "0";
+      this.$http({
+        url: "/mkWangge/getMkWanggeById",
+        method: "get",
+        headers: {
+          "Content-Type": "application/json",
+        },
+        params: {
+          id,
+          type,
+        },
+      }).then(({ data }) => {
+        let body = data.body;
+        console.log(body, "body");
+        this.ids = [body.id.toString()]
+        this.add_form = {
+          id: body.id,
+          proposer: body.proposer,
+          telephone: body.telephone,
+          wanggeText: body.wanggeText,
+        };
+        this.table_list_approve = body.bpmTaskList;
+      });
+      this.handleVisible("edit");
+      this.approve_visible = true;
+    },
     handleSubmit() {
     handleSubmit() {
-      console.log(this.add_form);
+      // console.log(this.add_form);
       // let _this = this;
       // let _this = this;
       this.$refs.add_ref.validate((valid) => {
       this.$refs.add_ref.validate((valid) => {
         if (valid) {
         if (valid) {
-          let reqdata = [{ ...this.add_form, procId: "729294602773110788",draft:'1',num: '1' }];
-          this.$http({
-            url: "/mkWangge/saveOrUpdateList",
-            method: "post",
-            headers: {
-              "Content-Type": "application/json",
+          let reqdata = [
+            {
+              ...this.add_form,
+              procId: "729294602773110788",
+              draft: "1",
+              num: "1",
             },
             },
-            data: reqdata,
-          }).then((res) => {
-            console.log(res);
-          });
-          this.handleInit({
-            ...this.table_search,
-            type: "0",
-            page: this.page,
-            pageSize: this.rows,
-          });
+          ];
+          if (!this.approve_visible) {
+            // 编辑
+            this.$http({
+              url: "/mkWangge/saveOrUpdateList",
+              method: "post",
+              headers: {
+                "Content-Type": "application/json",
+              },
+              data: reqdata,
+            }).then((res) => {
+              console.log(res);
+            });
+            this.handleInit({
+              ...this.table_search,
+              type: "0",
+              page: this.page,
+              pageSize: this.rows,
+            });
+          } else {
+            // 审批
+            let reqdata = {
+              ids: this.ids,
+              remark: this.add_form.remark,
+              type: '0'
+            }
+            console.log(reqdata,'reqdata');
+            this.$http({
+              url: "/mkWangge/review",
+              method: "post",
+              headers: {
+                "Content-Type": "application/json",
+              },
+              data: {
+                ...reqdata
+              },
+            });
+          }
+
           this.edit_visible = false;
           this.edit_visible = false;
           this.add_visible = false;
           this.add_visible = false;
         }
         }
@@ -452,7 +525,7 @@ export default {
               message: res.data.desc,
               message: res.data.desc,
               type: "error",
               type: "error",
             });
             });
-          }else{
+          } else {
             this.$message({
             this.$message({
               message: res.data.desc,
               message: res.data.desc,
               type: "success",
               type: "success",