Parcourir la source

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

noob il y a 3 ans
Parent
commit
4271e76824
2 fichiers modifiés avec 184 ajouts et 141 suppressions
  1. 33 6
      src/pages/main/performance/department.vue
  2. 151 135
      src/pages/main/performance/reply.vue

+ 33 - 6
src/pages/main/performance/department.vue

@@ -75,7 +75,11 @@
         <simple-sheet
           v-if="visible"
           :id="edit_form.id"
-          :type="edit_visible&&edit_form.status === '1' && duty === '9' ? 'edit' : 'view'"
+          :type="
+            edit_visible && edit_form.status === '1' && duty === '9'
+              ? 'edit'
+              : 'view'
+          "
           attribute="file"
         />
         <!-- <analysis
@@ -497,6 +501,11 @@ export default {
                 message: desc,
               });
               this.transfer_visible = false;
+              this.handleInit({
+                ...this.table_search,
+                page: this.page,
+                pageSize: this.rows,
+              });
               this.handleCancel("visible");
             }
           });
@@ -556,20 +565,25 @@ export default {
         case "finish":
           // status 0.打回 3.结束
           reqdata.status = "3";
+          request = 1;
           break;
         case "transfer":
           // reviewType 2.副总经理 3.经理
           if (this.duty === "7") {
             reqdata.reviewType = 2;
+            request = 1;
           } else {
             reqdata.reviewType = 3;
+            request = 1;
           }
           break;
         case "back":
           reqdata.status = "0";
+          request = 1;
           break;
         case "agree":
           reqdata.status = "3";
+          request = 1;
           break;
       }
       console.log(reqdata, "reqdata");
@@ -578,8 +592,8 @@ export default {
         page: this.page,
         pageSize: this.rows,
       });
-      this.handleCancel("visible");
-      this.handleCancel("approve_visible");
+      // this.handleCancel("visible");
+      // this.handleCancel("approve_visible");
       if (request) {
         // 这里调接口
         this.$http({
@@ -589,8 +603,21 @@ export default {
             "Content-Type": "application/json",
           },
           data: reqdata,
-        }).then((res) => {
-          console.log(res, "res");
+        }).then(({ data: { desc } }) => {
+          if (desc === "审批成功") {
+            this.$message({
+              type: "success",
+              message: desc,
+            });
+            // this.page = 1;
+            this.handleCancel("visible");
+            this.handleCancel("approve_visible");
+            this.handleInit({
+              ...this.table_search,
+              page: this.page,
+              pageSize: this.rows,
+            });
+          }
         });
       }
       // this.$http({
@@ -688,7 +715,7 @@ export default {
           this.$message.success("提交成功");
           this.handleCancel("visible");
         } else {
-            this.$message.error("提交失败");
+          this.$message.error("提交失败");
         }
       });
     },

+ 151 - 135
src/pages/main/performance/reply.vue

@@ -1,152 +1,168 @@
 <template>
-    <div>
-        <div class="simple-container">
-            <simple-form
-                :form="table_form"
-                :handle="table_handle"
-                @search="handleSearch"
-            ></simple-form>
-            <simple-table
-                :list="table_list"
-                :config="table_config"
-                :loading="table_loading"
-                :handle-row="table_handle_row"
-            ></simple-table>
-            <simple-pagination
-                :page="page"
-                :total="total"
-                @change="handleChange"
-            ></simple-pagination>
-        </div>
+  <div>
+    <div class="simple-container">
+      <simple-form
+        :form="table_form"
+        :handle="table_handle"
+        @search="handleSearch"
+      ></simple-form>
+      <simple-table
+        :list="table_list"
+        :config="table_config"
+        :loading="table_loading"
+        :handle-row="table_handle_row"
+      ></simple-table>
+      <!-- <simple-pagination
+        :page="page"
+        :total="total"
+        @change="handleChange"
+      ></simple-pagination> -->
     </div>
+  </div>
 </template>
 
 <script>
 import simpleForm from "./components/form.vue";
 import simpleTable from "./components/table.vue";
-import simplePagination from "./components/pagination.vue";
+// import simplePagination from "./components/pagination.vue";
 export default {
-    components: {
-        simpleTable,
-        simpleForm,
-        simplePagination,
-    },
-    data() {
-        return {
-            page: 1,
-            rows: 10,
-            total: 0,
-            table_loading: false,
-            table_search: {},
-            table_form: [
-                {
-                    label: "统计月份",
-                    props: "date",
-                    type: "month",
-                },
-                {
-                    label: "绩效类型",
-                    props: "performance_type",
-                    type: "select",
-                    dictionary: [
-                        {
-                            label: "部门绩效",
-                            value: "部门绩效",
-                        },
-                        {
-                            label: "员工绩效",
-                            value: "员工绩效",
-                        },
-                    ],
-                },
-                {
-                    label: "绩效分类",
-                    props: "performance_class",
-                    type: "select",
-                    dictionary: [
-                        {
-                            label: "GS",
-                            value: "GS",
-                        },
-                        {
-                            label: "KPI",
-                            value: "KPI",
-                        },
-                    ],
-                },
-            ],
-            table_list: [],
-            table_handle: [
-                {
-                    label: "导出",
-                    props: "download",
-                },
-            ],
-            table_handle_row: [],
-            table_config: [
-                {
-                    label: "科室名称",
-                    props: "department_name",
-                },
-                {
-                    label: "科室经理",
-                    props: "department_manager",
-                },
-                {
-                    label: "代办接收数",
-                    props: "received_umber",
-                },
-                {
-                    label: "完成回复率",
-                    props: "response_rate",
-                },
-                {
-                    label: "超期率",
-                    props: "overdue_rate",
-                },
-                {
-                    label: "累计超期时间",
-                    props: "cumulative_overtime",
-                },
-            ],
-        };
-    },
-    methods: {
-        async handleInit() {
-            this.table_loading = true;
-            const data = [];
-            let index = 0;
-            while (index < 10) {
-                data.push({
-                    department_name: `科室${index}`,
-                    department_manager: `经理${index}`,
-                    received_umber: `${index}`,
-                    response_rate: `${index + 1}0`,
-                    overdue_rate: `50%`,
-                    cumulative_overtime: `3`,
-                });
-                index = index + 1;
-            }
-            this.total = index;
-            this.table_list = data;
-            this.table_loading = false;
+  components: {
+    simpleTable,
+    simpleForm,
+    // simplePagination,
+  },
+  data() {
+    return {
+      page: 1,
+      rows: 10,
+      total: 0,
+      table_loading: false,
+      table_search: {},
+      table_form: [
+        {
+          label: "统计月份",
+          props: "time",
+          type: "month",
+        },
+        // {
+        //     label: "绩效类型",
+        //     props: "performance_type",
+        //     type: "select",
+        //     dictionary: [
+        //         {
+        //             label: "部门绩效",
+        //             value: "部门绩效",
+        //         },
+        //         {
+        //             label: "员工绩效",
+        //             value: "员工绩效",
+        //         },
+        //     ],
+        // },
+        // {
+        //     label: "绩效分类",
+        //     props: "performance_class",
+        //     type: "select",
+        //     dictionary: [
+        //         {
+        //             label: "GS",
+        //             value: "GS",
+        //         },
+        //         {
+        //             label: "KPI",
+        //             value: "KPI",
+        //         },
+        //     ],
+        // },
+      ],
+      table_list: [],
+      table_handle: [
+        {
+          label: "导出",
+          props: "download",
+        },
+      ],
+      table_handle_row: [],
+      table_config: [
+        {
+          label: "科室名称",
+          props: "dept",
+        },
+        {
+          label: "科室经理",
+          props: "loginName",
         },
-        handleSearch({ template_name }) {
-            this.table_search = { template_name };
-            this.handleReset();
-            this.handleInit();
+        {
+          label: "待办接收数",
+          props: "number",
         },
-        handleChange(page) {
-            this.page = page;
-            this.handleInit();
+        {
+          label: "完成回复率",
+          props: "percentageReply",
         },
-        handleReset() {
-            this.page = 1;
+        {
+          label: "超期率",
+          props: "percentageTimeOut",
         },
+        {
+          label: "累计超期时间",
+          props: "day",
+        },
+      ],
+    };
+  },
+  methods: {
+    handleInit(data) {
+      this.table_loading = true;
+      this.$http({
+        url: "/market/CMKIssued/CMKIssuedReplyStatistics",
+        method: "post",
+        headers: {
+          "Content-Type": "application/json",
+        },
+        data: data,
+      }).then(({ data }) => {
+        //   console.log(res,'data');
+        // this.total = count;
+        this.table_list = data;
+        this.table_loading = false;
+      });
+      // const data = [];
+      // let index = 0;
+      // while (index < 10) {
+      //     data.push({
+      //         department_name: `科室${index}`,
+      //         department_manager: `经理${index}`,
+      //         received_umber: `${index}`,
+      //         response_rate: `${index + 1}0`,
+      //         overdue_rate: `50%`,
+      //         cumulative_overtime: `3`,
+      //     });
+      //     index = index + 1;
+      // }
+    },
+    handleSearch(data) {
+      let obj = {
+        ...data,
+        time: data.time
+          ? this.$formatDate(this.table_search.time, "YYYY-MM")
+          : "",
+      };
+      this.table_search = data;
+      this.handleReset();
+      this.handleInit({ ...obj });
+    },
+    handleChange(page) {
+      this.page = page;
+      this.handleInit({ ...this.table_search });
     },
-    mounted() {
-        this.handleInit();
+    handleReset() {
+      this.page = 1;
     },
+  },
+  mounted() {
+    this.handleInit({ time: "" });
+  },
 };
 </script>