Bladeren bron

联调汇总页

molilang 3 jaren geleden
bovenliggende
commit
95c18472d2
2 gewijzigde bestanden met toevoegingen van 225 en 193 verwijderingen
  1. 166 91
      src/pages/main/gridDivision/approvalExamination.vue
  2. 59 102
      src/pages/main/gridDivision/workersList.vue

+ 166 - 91
src/pages/main/gridDivision/approvalExamination.vue

@@ -1,77 +1,67 @@
 <template>
-    <div class="approvalExamination-container">
-      <simple-form
-        :form="table_form"
-        :handle="table_handle"
-        @search="handleSearch"
-        @track="handleVisible('track')"
-        @batch="handleVisible('batch')"
-      >
-      </simple-form>
+  <div class="approvalExamination-container">
+    <simple-form
+      :form="table_form"
+      :handle="table_handle"
+      @search="handleSearch"
+      @track="handleQueryTrack"
+      @batch="handleBatch"
+    >
+    </simple-form>
+    <simple-table
+      :list="table_list"
+      :config="table_config"
+      :loading="table_loading"
+      :multiple="true"
+      :handle-row="table_handle_row"
+      @selection="handleSelect"
+      @approve="handleApprove"
+    ></simple-table>
+    <simple-dialog
+      title="审批"
+      width="40%"
+      @cancel="handleVisible('opinion')"
+      :visible="opinion_visible"
+    >
+      <el-form label-width="80px" :model="opinion_form" ref="opinion_ref">
+        <el-form-item label="审批意见" prop="opinion">
+          <el-input
+            :rows="8"
+            type="textarea"
+            v-model="opinion_form.opinion"
+          ></el-input>
+        </el-form-item>
+      </el-form>
+      <template v-slot:footer>
+        <div>
+          <el-button @click="handleOpinion('1')" type="default"
+            >退回修改</el-button
+          >
+          <el-button @click="handleOpinion('0')" type="primary">同意</el-button>
+        </div>
+      </template>
+    </simple-dialog>
+    <simple-dialog
+      title="审批轨迹"
+      :fullscreen="true"
+      @cancel="handleVisible('track')"
+      :visible="track_visible"
+    >
       <simple-table
-        :list="table_list"
-        :config="table_config"
-        :loading="table_loading"
-        :multiple="true"
-        :handle-row="table_handle_row"
-        @selection="handleaaa"
-        @approve="handleApprove"
+        :list="table_list_track"
+        :config="table_config_track"
+        :loading="table_loading_track"
       ></simple-table>
-      <simple-dialog
-        title="审批"
-        width="40%"
-        @cancel="handleVisible('opinion')"
-        @confirm="handleOpinion"
-        :visible="opinion_visible"
-      >
-        <el-form
-          label-width="80px"
-          :model="opinion_form"
-          ref="opinion_ref"
-        >
-          <el-form-item
-            label="审批意见"
-            prop="opinion"
-            :rules="{
-                        required: true,
-                        message: '审批意见不能为空',
-                        trigger: 'blur',
-                    }"
+      <template v-slot:footer>
+        <div>
+          <el-button @click="handleVisible('track')" type="default"
+            >退回修改</el-button
           >
-            <el-input
-              :rows="8"
-              type="textarea"
-              v-model="opinion_form.opinion"
-            ></el-input>
-          </el-form-item>
-        </el-form>
-        <template v-slot:footer>
-          <div>
-            <el-button @click="handleVisible('opinion')" type="default">退回修改</el-button>
-            <el-button @click="handleOpinion" type="primary">同意</el-button>
-          </div>
-        </template>
-      </simple-dialog>
-      <simple-dialog
-        title="审批轨迹"
-        :fullscreen="true"
-        @cancel="handleVisible('track')"
-        @confirm="handleConsent"
-        :visible="track_visible"
-      >
-        <simple-table
-          :list="table_list_track"
-          :config="table_config_track"
-          :loading="table_loading_track"
-        ></simple-table>
-        <template v-slot:footer>
-          <div>
-            <el-button @click="handleVisible('track')" type="default">退回修改</el-button>
-            <el-button @click="handleConsent" type="primary">同意</el-button>
-          </div>
-        </template>
-      </simple-dialog>
-    </div>
+          <el-button @click="handleConsent" type="primary">同意</el-button>
+        </div>
+      </template>
+    </simple-dialog>
+  </div>
 </template>
 
 <script>
@@ -92,6 +82,12 @@ export default {
       opinion_visible: false,
       track_visible: false,
       opinion_form: {},
+      // 单条审批id
+      ids: [],
+      parentId: "",
+      page: 1,
+      rows: 10,
+      total: 0,
       table_form: [
         {
           label: "公司名称",
@@ -142,31 +138,31 @@ export default {
       table_config: [
         {
           label: "序号",
-          props: "number",
+          props: "id",
         },
         {
           label: "公司名称",
-          props: "cpmName",
+          props: "companyName",
         },
         {
           label: "提出人",
-          props: "person",
+          props: "proposer",
         },
         {
           label: "联系电话",
-          props: "phone",
+          props: "telephone",
         },
         {
           label: "网格划分需求",
-          props: "need",
+          props: "wanggeText",
         },
         {
           label: "附件",
-          props: "file",
+          props: "fileNames",
         },
         {
           label: "状态",
-          props: "status",
+          props: "sts",
           type: "dictionary",
           dictionary: { 0: "待办", 1: "已办" },
         },
@@ -180,9 +176,9 @@ export default {
         {},
         {},
       ],
-      table_loading_track:false,
+      table_loading_track: false,
       // 审批轨迹内表数据
-      table_list_track:[],
+      table_list_track: [],
       // 审批轨迹内表头配置
       table_config_track: [
         {
@@ -191,31 +187,61 @@ export default {
         },
         {
           label: "流程环节",
-          props: "cpmName",
+          props: "procName",
         },
         {
           label: "处理人",
-          props: "person",
+          props: "opName",
         },
         {
           label: "处理工号",
-          props: "number",
+          props: "opNo",
         },
         {
           label: "处理时间",
-          props: "createTime",
+          props: "opTime",
           type: "date",
         },
         {
           label: "审批意见",
-          props: "status",
-          type: "dictionary",
-          dictionary: { 0: "同意", 1: "不同意" },
+          props: "remark",
+          // type: "dictionary",
+          // dictionary: { 0: "同意", 1: "不同意" },
         },
       ],
     };
   },
+  mounted() {
+    this.parentId = this.$route.query.parentId;
+    this.handleInit();
+  },
   methods: {
+    // 表格数据初始化
+    handleInit() {
+      let reqdata = {
+        ...this.table_search,
+        type: "2",
+        page: this.page,
+        parentId: this.parentId,
+        pageSize: this.rows,
+      };
+      this.$http({
+        url: "/mkWangge/queryPage",
+        method: "post",
+        headers: {
+          "Content-Type": "application/json",
+        },
+        data: reqdata,
+      }).then(({ data: { count, data } }) => {
+        this.table_loading = false;
+        this.total = count;
+        this.table_list = data.map((element) => ({
+          ...element,
+        }));
+        console.log(this.table_list);
+      });
+    },
+    // 搜索事件
     handleSearch() {},
     handleVisible(props) {
       switch (props) {
@@ -230,17 +256,66 @@ export default {
           break;
       }
     },
-    handleaaa(val) {
+    // 查询审批轨迹
+    handleQueryTrack() {
+      // let type = this.parentId === null ? "1" : "0";
+      this.$http({
+        url: "/mkWangge/getMkWanggeById",
+        method: "get",
+        headers: {
+          "Content-Type": "application/json",
+        },
+        params: {
+          id: this.parentId,
+          type: 0,
+        },
+      }).then(({ data }) => {
+        let body = data.body;
+        console.log(body, "body");
+        // this.ids = [body.id.toString()];
+        this.table_list_track = body.bpmTaskList;
+      });
+      this.handleVisible("track");
+    },
+    // 批量审批
+    handleBatch() {
+      this.handleVisible("batch");
+    },
+    handleSelect(val) {
       console.log(val);
     },
-    handleApprove() {
+    // 获取审批轨迹
+    getTrackList() {},
+    // 审批
+    handleApprove(row) {
+      // console.log(row);
+      this.ids = [row.id.toString()];
       this.handleVisible("opinion");
     },
-    handleOpinion() {
-      this.handleVisible('opinion')
+    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();
+      })
+      this.handleVisible("opinion");
     },
     handleConsent() {
-      this.handleVisible('track')
+      this.handleVisible("track");
     },
   },
 };

+ 59 - 102
src/pages/main/gridDivision/workersList.vue

@@ -14,7 +14,7 @@
       :loading="table_loading"
       :multiple="true"
       :handle-row="table_handle_row"
-      @selection="handleSlect"
+      @selection="handleSelect"
       @check="handleCheck"
       @edit="handleEdit"
       @approve="handleApprove"
@@ -102,8 +102,10 @@
           <div></div>
         </div>
         <div v-else-if="title === '发起人处理'">
-          <el-button @click="handleSubmit" type="primary">保存</el-button>
-          <el-button type="primary">重新提交</el-button>
+          <el-button @click="handleSubmit('save')" type="primary"
+            >保存</el-button
+          >
+          <el-button @click="handleSubmit('add')" type="primary">重新提交</el-button>
           <el-button @click="handleVisible('add')" type="default"
             >取消</el-button
           >
@@ -243,7 +245,7 @@ export default {
           label: "处理",
           props: "approve",
           visible: {
-            sts: ["0"],
+            deal: ["1"],
           },
         },
       ],
@@ -308,42 +310,41 @@ export default {
     };
   },
   mounted() {
-    this.handleInit({
-      ...this.table_search,
-      type: "1",
-      page: this.page,
-      pageSize: this.rows,
-    });
+    this.handleInit();
   },
   methods: {
     // 表格数据初始化
-    handleInit(data) {
+    handleInit() {
       // this.table_loading = true;
       // console.log(data);
+      let reqdata = {
+        ...this.table_search,
+        type: "1",
+        page: this.page,
+        pageSize: this.rows,
+      };
       this.$http({
         url: "/mkWangge/queryPage",
         method: "post",
         headers: {
           "Content-Type": "application/json",
         },
-        data: data,
+        data: reqdata,
       }).then(({ data: { count, data } }) => {
         this.table_loading = false;
         this.total = count;
-        this.table_list = data || [];
-        console.log(data);
+        this.table_list = data.map((element) => ({
+          ...element,
+          deal: element.draft === "1" && element.sts === "0" ? "1" : "0",
+        }));
+        console.log(this.table_list);
       });
     },
     // 搜索事件
     handleSearch(data) {
       this.table_search = data;
       this.page = 1;
-      this.handleInit({
-        ...data,
-        type: "1",
-        page: this.page,
-        pageSize: this.rows,
-      });
+      this.handleInit();
     },
     handleVisible(props) {
       this.approve_visible = false;
@@ -381,7 +382,7 @@ export default {
           break;
       }
     },
-    handleSlect(val) {
+    handleSelect(val) {
       this.summaryIds = val.map((item) => {
         return item.id.toString();
       });
@@ -392,8 +393,8 @@ export default {
       console.log(v);
       this.attList = v;
     },
-    // 查看按钮
-    handleCheck(row) {
+    // 获取模态框信息
+    getDialogData(row) {
       let id = row.id;
       let type = row.parentId === null ? "1" : "0";
       this.$http({
@@ -409,41 +410,31 @@ export default {
       }).then(({ data }) => {
         let body = data.body;
         console.log(body, "body");
+        this.ids = [body.id.toString()];
         this.add_form = {
           id: body.id,
-          proposer: body.createName,
+          proposer: body.proposer,
           telephone: body.telephone,
           wanggeText: body.wanggeText,
         };
         this.table_list_approve = body.bpmTaskList;
       });
-      this.handleVisible("check");
+    },
+    // 查看按钮
+    handleCheck(row) {
+      if (row.parentLevel === "1") {
+        this.$router.push({
+          path: "/approvalExamination",
+          query: row,
+        });
+      } else {
+        this.getDialogData(row)
+        this.handleVisible("check");
+      }
     },
     // 编辑按钮
     handleEdit(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.add_form = {
-          id: body.id,
-          proposer: body.proposer,
-          telephone: body.telephone,
-          wanggeText: body.wanggeText,
-        };
-        this.table_list_approve = body.bpmTaskList;
-      });
+      this.getDialogData(row)
       this.handleVisible("edit");
     },
     // 处理按钮
@@ -452,33 +443,12 @@ export default {
       if (row.parentLevel === "1") {
         this.$router.push({
           path: "/approvalExamination",
-          query: row,
-        });
-      } else {
-        let id = row.id;
-        let type = row.parentId === null ? "1" : "0";
-        this.$http({
-          url: "/mkWangge/getMkWanggeById",
-          method: "get",
-          headers: {
-            "Content-Type": "application/json",
+          query: {
+            parentId:row.id.toString(),
           },
-          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;
         });
+      } else {
+        this.getDialogData(row)
         this.handleVisible("approve");
       }
     },
@@ -487,9 +457,15 @@ export default {
       // let _this = this;
       let draft = "";
       if (type === "add") {
-        draft = '1'
-      }else if(type === 'save'){
-        draft = '0'
+        draft = "1";
+      } else if (type === "save") {
+        draft = "0";
+      }
+      let isAdopt = "";
+      if (type === "adopt") {
+        isAdopt = "0";
+      } else if (type === "failed") {
+        isAdopt = "1";
       }
       this.$refs.add_ref.validate((valid) => {
         if (valid) {
@@ -512,19 +488,14 @@ export default {
               data: reqdata,
             }).then((res) => {
               console.log(res);
-              this.handleInit({
-                ...this.table_search,
-                type: "1",
-                page: this.page,
-                pageSize: this.rows,
-              });
+              this.handleInit();
             });
           } else {
             // 审批
             let reqdata = {
               ids: this.ids,
               remark: this.add_form.remark,
-              type: "0",
+              type: isAdopt,
             };
             console.log(reqdata, "reqdata");
             this.$http({
@@ -536,15 +507,11 @@ export default {
               data: {
                 ...reqdata,
               },
-            });
-            this.handleInit({
-              ...this.table_search,
-              type: "1",
-              page: this.page,
-              pageSize: this.rows,
+            }).then((res) => {
+              console.log(res);
+              this.handleInit();
             });
           }
-
           this.edit_visible = false;
           this.add_visible = false;
         }
@@ -579,24 +546,14 @@ export default {
               type: "success",
             });
           }
-          this.handleInit({
-            ...this.table_search,
-            type: "1",
-            page: this.page,
-            pageSize: this.rows,
-          });
+          this.handleInit();
         });
         this.handleVisible("summary");
       }
     },
     handleChange(page) {
       this.page = page;
-      this.handleInit({
-        ...this.table_search,
-        type: "1",
-        page: this.page,
-        pageSize: this.rows,
-      });
+      this.handleInit();
     },
   },
 };