Selaa lähdekoodia

汇总审批及退回审批

molilang 3 vuotta sitten
vanhempi
commit
6d862b40fb

+ 86 - 32
src/pages/main/gridDivision/approvalExamination.vue

@@ -12,11 +12,15 @@
       :list="table_list"
       :config="table_config"
       :loading="table_loading"
-      :multiple="true"
       :handle-row="table_handle_row"
       @selection="handleSelect"
       @back="handleBack"
     ></simple-table>
+    <simple-pagination
+      :page="page"
+      :total="total"
+      @change="handleChange"
+    ></simple-pagination>
     <simple-dialog
       title="审批"
       width="40%"
@@ -37,7 +41,9 @@
           <el-button v-if="!isAgree" @click="handleOpinion('1')" type="default"
             >退回修改</el-button
           >
-          <el-button v-else @click="handleOpinion('0')" type="primary">同意</el-button>
+          <el-button v-else @click="handleOpinion('0')" type="primary"
+            >同意</el-button
+          >
         </div>
       </template>
     </simple-dialog>
@@ -68,13 +74,13 @@
 import simpleForm from "../performance/components/form.vue";
 import simpleTable from "../performance/components/table.vue";
 import simpleDialog from "../performance/components/dialog.vue";
-// import simplePagination from "../performance/components/pagination.vue";
+import simplePagination from "../performance/components/pagination.vue";
 export default {
   components: {
     simpleForm,
     simpleDialog,
     simpleTable,
-    // simplePagination,
+    simplePagination,
   },
   data() {
     return {
@@ -84,20 +90,21 @@ export default {
       opinion_form: {},
       isAgree: false,
       // 单条审批id
-      ids: [],
+      ids: '',
       parentId: "",
+      adoptIds: [],
       page: 1,
       rows: 10,
       total: 0,
       table_form: [
         {
           label: "公司名称",
-          props: "name",
+          props: "companyName",
           type: "input",
         },
         {
           label: "状态",
-          props: "status",
+          props: "sts",
           type: "select",
           // 0.待办  1.已办
           dictionary: [
@@ -239,21 +246,36 @@ export default {
         this.table_list = data.map((element) => ({
           ...element,
         }));
-        console.log(this.table_list);
+        data.forEach((item) => {
+          this.adoptIds.push(item.id.toString());
+        });
+        // console.log(this.table_list,'table_list');
+        // console.log(this.adoptIds);
       });
     },
     // 搜索事件
-    handleSearch() {},
+    handleSearch(data) {
+      this.table_search = data;
+      this.page = 1;
+      this.handleInit();
+    },
+    handleChange(page) {
+      this.page = page;
+      this.handleInit();
+    },
     handleVisible(props) {
       switch (props) {
         case "opinion":
           this.opinion_visible = !this.opinion_visible;
+          this.isAgree = false;
+          this.opinion_form = {};
           break;
         case "track":
           this.track_visible = !this.track_visible;
           break;
         case "batch":
           this.opinion_visible = !this.opinion_visible;
+          this.isAgree = true;
           break;
       }
     },
@@ -285,36 +307,68 @@ export default {
     handleSelect(val) {
       console.log(val);
     },
-    // 获取审批轨迹
-    getTrackList() {},
-    // 审批
+    // 审批不通过
     handleBack(row) {
       // console.log(row);
-      this.ids = [row.id.toString()];
+      this.ids = row.id.toString();
       this.handleVisible("opinion");
+      this.isAgree = false;
     },
+    // 审批意见提交
     handleOpinion(type) {
-      let reqdata = {
-        ids: this.ids,
-        remark: this.opinion_form.opinion,
-        type: type,
-      };
-      // console.log(reqdata);
-      this.$http({
-        url: "/mkWangge/review",
-        method: "post",
-        headers: {
-          "Content-Type": "application/json",
-        },
-        data: {
-          ...reqdata,
-        },
-      }).then((res) => {
-        console.log(res);
-        this.handleInit();
-      })
+      let reqdata = {};
+      if (type === '1') {
+        // 批量退回
+        reqdata = {
+          parentId: this.parentId,
+          mkWanggeList: [
+            {
+              id: this.ids,
+              remark: this.opinion_form.opinion
+            },
+          ],
+        }
+        console.log(reqdata);
+        this.$http({
+          url: "/mkWangge/backList",
+          method: "post",
+          headers: {
+            "Content-Type": "application/json",
+          },
+          data: {
+            ...reqdata,
+          },
+        }).then((res) => {
+          console.log(res);
+          this.handleInit();
+        });
+      } else {
+        // 批量审批(多条)
+        reqdata = {
+          adoptIds: this.adoptIds,
+          remark: this.opinion_form.opinion,
+          parentId: this.parentId,
+          type: type,
+        };
+        console.log(reqdata);
+        this.$http({
+          url: "/mkWangge/reviewMore",
+          method: "post",
+          headers: {
+            "Content-Type": "application/json",
+          },
+          data: {
+            ...reqdata,
+          },
+        }).then((res) => {
+          console.log(res);
+          this.handleInit();
+        });
+      }
+
       this.handleVisible("opinion");
     },
+    // 审批轨迹--同意
     handleConsent() {
       this.handleVisible("track");
     },

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

@@ -405,8 +405,10 @@ export default {
       //   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);
     },
     // 获取模态框信息
     getDialogData(row) {
@@ -446,7 +448,9 @@ export default {
       if (row.parentLevel === "1") {
         this.$router.push({
           path: "/approvalExamination",
-          query: row,
+          query: {
+            parentId: row.id.toString(),
+          },
         });
       } else {
         this.getDialogData(row);