ソースを参照

文件部分修改

daiqisheng 3 年 前
コミット
b55a474bca

+ 91 - 4
src/pages/main/performance/components/form.vue

@@ -1,13 +1,13 @@
 <!--
  * @Author       : yuanrunwei
  * @Date         : 2021-11-01 18:03:02
- * @LastEditors: Please set LastEditors
- * @LastEditTime: 2022-01-10 19:27:43
+ * @LastEditors: daiqisheng
+ * @LastEditTime: 2022-03-31 16:39:39
  * @FilePath     : \spfm-market-front\src\pages\main\performance\components\form.vue
 -->
 <template>
   <el-form :inline="true" :model="object">
-    <el-row :gutter="24">
+    <el-row :gutter="24" v-if="form.length < 4">
       <el-col
         v-for="({ props, label, type, dictionary }, index) in form"
         :key="index"
@@ -37,6 +37,16 @@
             >
             </el-date-picker>
           </template>
+          <template v-else-if="type === 'dateRange'">
+            <el-date-picker
+              v-model="object[props]"
+              type="datetimerange"
+              range-separator="至"
+              start-placeholder="开始日期"
+              end-placeholder="结束日期"
+            >
+            </el-date-picker>
+          </template>
           <template v-else>
             <el-input
               v-model="object[props]"
@@ -46,6 +56,7 @@
           </template>
         </el-form-item>
       </el-col>
+      <div v-if="form.length < 4"></div>
       <el-col :span="6">
         <el-form-item>
           <el-button type="primary" @click="handleSearch">搜索</el-button>
@@ -57,10 +68,78 @@
           :key="index"
           @click="handleSubmit(props)"
         >
-          <i v-if="!unlogo" class="el-icon-document-add font-weight-bold" />{{ label }}
+          <i v-if="!unlogo" class="el-icon-document-add font-weight-bold" />{{
+            label
+          }}
         </el-button>
       </el-col>
     </el-row>
+    <div v-else>
+      <div class="form-header">
+        <div
+          v-for="({ props, label, type, dictionary }, index) in form"
+          :key="index"
+          :span="6"
+        >
+          <el-form-item :label="label">
+            <template v-if="type === 'select'">
+              <el-select
+                v-model="object[props]"
+                :placeholder="label"
+                filterable
+                clearable
+              >
+                <el-option
+                  :label="label"
+                  :value="value"
+                  v-for="({ label, value }, index) in dictionary"
+                  :key="index"
+                ></el-option>
+              </el-select>
+            </template>
+            <template v-else-if="['datetime', 'date', 'month'].includes(type)">
+              <el-date-picker
+                v-model="object[props]"
+                :type="type"
+                :placeholder="label"
+              >
+              </el-date-picker>
+            </template>
+            <template v-else-if="type === 'dateRange'">
+              <el-date-picker
+                v-model="object[props]"
+                type="datetimerange"
+                range-separator="至"
+                start-placeholder="开始日期"
+                end-placeholder="结束日期"
+              >
+              </el-date-picker>
+            </template>
+            <template v-else>
+              <el-input
+                v-model="object[props]"
+                :placeholder="label"
+                clearable
+              ></el-input>
+            </template>
+          </el-form-item>
+        </div>
+        <el-form-item>
+          <el-button type="primary" @click="handleSearch">搜索</el-button>
+        </el-form-item>
+      </div>
+      <div class="flex-justify-align-end margin-top-40 margin-bottom-20">
+        <el-button
+          v-for="({ label, props, unlogo }, index) in handle"
+          :key="index"
+          @click="handleSubmit(props)"
+        >
+          <i v-if="!unlogo" class="el-icon-document-add font-weight-bold" />{{
+            label
+          }}
+        </el-button>
+      </div>
+    </div>
   </el-form>
 </template>
 <script>
@@ -88,3 +167,11 @@ export default {
   },
 };
 </script>
+<style lang="scss" scope>
+.form-header {
+  display: flex;
+  justify-content: space-between;
+  flex-wrap: wrap;
+  margin-left: 10px;
+}
+</style>

+ 172 - 10
src/pages/main/performance/components/sheet.vue

@@ -2,12 +2,22 @@
  * @Author       : yuanrunwei
  * @Date         : 2021-12-04 14:23:58
  * @LastEditors: daiqisheng
- * @LastEditTime: 2022-03-07 17:40:14
+ * @LastEditTime: 2022-03-31 14:57:06
  * @FilePath     : \spfm-market-front\src\pages\main\performance\components\sheet.vue
 -->
 <template>
   <div class="sheet-container">
     <div class="flex-justify-align-end margin-bottom-20">
+      <span
+        class="margin-right-10 font-size-16"
+        v-if="!status || status === '2'"
+        ><span class="sheet-container-require">*</span>模板类型:</span
+      >
+      <el-input
+        v-model="templateType"
+        :disabled="type === 'view'"
+        v-if="!status || status === '2'"
+      ></el-input>
       <el-button
         type="primary"
         @click="handleVisible"
@@ -16,6 +26,12 @@
       >
       <el-button type="primary" @click="handleDownload">导出</el-button>
       <el-button type="primary" @click="handleFullscreen()">全屏显示</el-button>
+      <el-button
+        type="primary"
+        v-if="!status || superviseFlag === '1'"
+        @click="handleSupervise('confirm')"
+        >督办</el-button
+      >
       <template v-if="['edit'].includes(type)">
         <el-upload
           v-if="!id"
@@ -53,6 +69,7 @@
       </template>
     </div>
     <div id="luckysheet" class="sheet-container-block"></div>
+    <!-- 设置权限的 -->
     <simple-dialog
       title="权限设置"
       :visible="visible"
@@ -162,6 +179,7 @@
         ><div></div
       ></template>
     </simple-dialog>
+    <!-- 科室经理提交的 -->
     <simpleDialog
       title="提交"
       :visible="manager_approve"
@@ -210,6 +228,56 @@
         </div>
       </template>
     </simpleDialog>
+    <simpleDialog
+      title="督办"
+      :visible="supervise"
+      :modal="false"
+      @confirm="handleSupervise('confirm')"
+      @cancel="handleSupervise('cancel')"
+    >
+      <span class="margin-left-20"
+        >注:设置督办后,系统会按照设定的周期自动派发</span
+      >
+      <el-form
+        :rules="superviserules"
+        :model="superviseForm"
+        ref="superviseForm"
+        class="margin-top-20"
+        label-width="120px"
+      >
+        <el-form-item prop="distribute" label="派发周期">
+          <el-select v-model="superviseForm.distribute" filterable>
+            <!-- 0.月 1.季度 2.半年 3.年 -->
+            <el-option
+              v-for="({ label, value }, index) in [
+                { label: '月', value: '0' },
+                { label: '季度', value: '1' },
+                { label: '半年', value: '2' },
+                { label: '年', value: '3' },
+              ]"
+              :key="index"
+              :label="label"
+              :value="value"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item prop="write" label="填报周期">
+          <el-date-picker v-model="superviseForm.write" type="date">
+          </el-date-picker
+        ></el-form-item>
+        <el-form-item prop="endTime" label="截止时间">
+          <el-date-picker
+            v-model="superviseForm.endTime"
+            type="datetime"
+            format="yyyy-MM-dd HH:00:00"
+          >
+          </el-date-picker
+        ></el-form-item>
+      </el-form>
+      <template v-if="id && type === 'view'" v-slot:footer
+        ><div></div
+      ></template>
+    </simpleDialog>
   </div>
 </template>
 
@@ -233,10 +301,12 @@ export default {
     id: {
       default: null,
     },
+    // 接收人
     receiver: {
       type: String,
       default: "",
     },
+    // 模板状态按钮判断
     status: { type: String, default: "" },
   },
   data() {
@@ -277,14 +347,34 @@ export default {
           },
         ],
       },
-
+      superviserules: {
+        distribute: [
+          { required: true, message: "请选择派发周期", trigger: "change" },
+        ],
+        write: [
+          { required: true, message: "请选择填报周期", trigger: "change" },
+        ],
+        endTime: [
+          { required: true, message: "请选择截止时间", trigger: "change" },
+        ],
+      },
+      superviseForm: {
+        distribute: "", // 派单周期
+        write: "", // 填写周期
+        endTime: "", // 截止时间
+      },
       // 可提交标志
       addFlag: "0",
+      // 督办标志
+      superviseFlag: null,
       rowList: [],
       isDisable: true,
       issued_id: null,
       template_id: null,
       visible: false,
+      templateType: "",
+      // 督办
+      supervise: false,
       manager_approve: false,
       row_list: [],
       column_list: [],
@@ -356,7 +446,12 @@ export default {
           issuedId,
           templateId,
           list,
+          superviseFlag,
+          templateType,
           addFlag,
+          distributeEndTime,
+          distributeTime,
+          distributeType,
         },
       } = await this.$http({
         url,
@@ -366,6 +461,15 @@ export default {
         },
         data: params,
       });
+      this.superviseFlag = superviseFlag;
+      if (superviseFlag === "1") {
+        this.superviseForm = {
+          distribute: distributeType, // 派单周期
+          write: distributeTime, // 填写周期
+          endTime: distributeEndTime, // 截止时间
+        };
+      }
+      this.templateType = templateType;
       this.template_id = templateId;
       this.issued_id = issuedId;
       this.addFlag = addFlag;
@@ -439,6 +543,33 @@ export default {
         type: "json",
       });
     },
+    handleSupervise(data) {
+      if (data === "cancel") {
+        this.supervise = false;
+        return;
+      }
+      if (this.supervise === false) {
+        this.supervise = true;
+      } else {
+        let filled =
+          Object.keys(this.superviseForm).length === 3 &&
+          Object.values(this.superviseForm).filter((el) => el !== "").length ===
+            3;
+        if (filled) {
+          this.superviseForm = {
+            ...this.superviseForm,
+            endTime: this.$formatDate(
+              this.superviseForm.endTime,
+              "YYYY-MM-DD HH:00:00"
+            ), // 督办设置的截止时间
+            write: this.$formatDate(this.superviseForm.write, "YYYY-MM-DD"), // 派发时间–或者叫—填报时间
+          };
+          this.supervise = false;
+        } else {
+          this.$message.error("请填写完整必要的信息");
+        }
+      }
+    },
     handleForbid() {
       // const object = {};
       const { permission_type } = this.form;
@@ -627,11 +758,42 @@ export default {
           edit_url = "/market/CMKIssued/CMKIssuedSubmit";
           break;
       }
+
       const sheet_name = window.luckysheet.getSheet().name;
       const data = window.luckysheet.getSheet(sheet_name);
       const workbook_name = window.luckysheet.getWorkbookName();
       if (!this.id) {
         // 新增时添加权限
+        let value = {};
+        if (!this.templateType) {
+          this.$message.error("请输入模板类型");
+          return;
+        }
+        if (
+          Object.values(this.superviseForm).filter((el) => el !== "").length ===
+          3
+        ) {
+          value = {
+            distributeEndTime: this.superviseForm.endTime, // 督办设置的截止时间
+            distributeTime: this.superviseForm.write, // 派发时间–或者叫—填报时间
+            distributeType: this.superviseForm.distribute, //派发周期类型 派发周期类型 0.月 1.季度 2.半年 3.年
+            superviseFlag: 1, //督办标识 0.不是 1.是
+            templateType: this.templateType, //模板类型
+            templateContent: JSON.stringify(data), //文件内容
+            templateName: workbook_name, //模板名称
+            templateUrl: "", //文件链接
+            status: type,
+          };
+        } else {
+          value = {
+            superviseFlag: 0, //督办标识 0.不是 1.是
+            templateType: this.templateType, //模板类型
+            templateContent: JSON.stringify(data), //文件内容
+            templateName: workbook_name, //模板名称
+            templateUrl: "", //文件链接
+            status: type,
+          };
+        }
         const {
           data: { body },
         } = await this.$http({
@@ -640,13 +802,7 @@ export default {
           headers: {
             "Content-Type": "application/json",
           },
-          data: {
-            id: this.template_id,
-            templateContent: JSON.stringify(data),
-            templateName: workbook_name,
-            issuedId: this.issued_id,
-            status: type,
-          },
+          data: value,
         });
         await this.handleAddAuth({ id: body });
         this.$emit("save");
@@ -936,7 +1092,6 @@ export default {
     },
   },
   mounted() {
-    console.log(this.destroy, "destroy");
     this.handleInit();
     this.handleChargeList();
   },
@@ -957,6 +1112,13 @@ export default {
     width: 100%;
     height: 75%;
   }
+  &-require {
+    color: red;
+  }
+  .el-input {
+    width: 200px;
+    margin-right: 10px;
+  }
 }
 .form {
   &-input {

+ 37 - 0
src/pages/main/performance/department.vue

@@ -10,6 +10,7 @@
         @check="handleCheck"
         @edit="handleEdit"
         @delete="handleDelete"
+        @urge="handleUrge"
         @receiverName="handleReceiver"
       ></simple-table>
       <simple-pagination
@@ -419,6 +420,22 @@ export default {
           type: "datetime",
         },
         {
+          label: "是否为督办",
+          props: "superviseFlag",
+          type: "select",
+          // 0.否  1.是
+          dictionary: [
+            {
+              label: "否",
+              value: "0",
+            },
+            {
+              label: "是",
+              value: "1",
+            },
+          ],
+        },
+        {
           label: "状态",
           props: "status",
           type: "select",
@@ -464,6 +481,13 @@ export default {
           },
         },
         {
+          label: "催办",
+          props: "urge",
+          visible: {
+            superviseFlag: ["1"],
+          },
+        },
+        {
           label: "撤回",
           props: "delete",
           popconfirm: true,
@@ -527,6 +551,16 @@ export default {
             5: "未提交",
           },
         },
+        {
+          label: "是否为督办",
+          props: "superviseFlag",
+          type: "dictionary",
+          dictionary: {
+            null: "否",
+            0: "否",
+            1: "是",
+          },
+        },
       ],
     };
   },
@@ -997,6 +1031,9 @@ export default {
       }
       return arr.join(",");
     },
+    handleUrge(){
+      console.log("这里是催办的方法");
+    },
     handleConfirm(visible) {
       console.log(visible);
       this.track_visible = visible;

+ 39 - 7
src/pages/main/performance/mould.vue

@@ -56,6 +56,7 @@
         <el-form-item
           label="截止时间"
           prop="endTime"
+          v-if="superviseFlag !== '1'"
           :rules="{
             required: true,
             message: '截止时间不能为空',
@@ -147,6 +148,7 @@ export default {
         precautions: "",
         endTime: "",
       },
+      superviseFlag: "",
       issue_id: null,
       // table
       table_loading: false,
@@ -203,6 +205,10 @@ export default {
           props: "templateName",
         },
         {
+          label: "模板类型",
+          props: "templateType",
+        },
+        {
           label: "配置时间",
           props: "updateTime",
         },
@@ -220,6 +226,16 @@ export default {
             3: "已下发",
           },
         },
+        {
+          label: "是否为督办",
+          props: "superviseFlag",
+          type: "dictionary",
+          dictionary: {
+            null: "否",
+            0: "否",
+            1: "是",
+          },
+        },
       ],
     };
   },
@@ -269,6 +285,7 @@ export default {
           this.template_id = params ? params.id : null;
           break;
         case "issue":
+          this.superviseFlag = params ? params.superviseFlag : "";
           this.issue_visible = !this.issue_visible;
           this.issue_id = params ? params.id : null;
           if (this.issue_visible) {
@@ -302,20 +319,35 @@ export default {
     handleIssue() {
       this.$refs["issue_ref"].validate((valid) => {
         if (valid) {
-          this.$http({
-            url: "/market/CMKFileTemplate/issuedCMKFileTemplateById",
-            method: "post",
-            headers: {
-              "Content-Type": "application/json",
-            },
-            data: {
+          let url = "";
+          let reqdata = {};
+          if (this.superviseFlag === "1") {
+            //  调用督办的下发
+            console.log("这里调用督办的下发");
+            url = "/market/CMKFileTemplate/issuedCMKFileTemplateBySuperviseId";
+            reqdata = {
+              ...this.issue_form,
+              templateId: this.issue_id,
+            };
+          } else {
+            //  调用普通的下发
+            url = "/market/CMKFileTemplate/issuedCMKFileTemplateById";
+            reqdata = {
               ...this.issue_form,
               endTime: this.$formatDate(
                 this.issue_form.endTime,
                 "YYYY-MM-DD HH:00:00"
               ),
               templateId: this.issue_id,
+            };
+          }
+          this.$http({
+            url: url,
+            method: "post",
+            headers: {
+              "Content-Type": "application/json",
             },
+            data: reqdata,
           }).then(() => {
             this.handleVisible("issue");
             this.$message.success("下发成功");

+ 75 - 69
src/pages/main/performance/reply.vue

@@ -42,39 +42,24 @@ export default {
       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",
-        //         },
-        //     ],
-        // },
+          props: "Time",
+          type: "dateRange",
+        },
+        {
+          label: "模板类型",
+          props: "templateType",
+          type: "input",
+        },
+        {
+          label: "模板名称",
+          props: "templateName",
+          type: "input",
+        },
+        {
+          label: "科室名称",
+          props: "deptName",
+          type: "input",
+        },
       ],
       table_list: [],
       table_handle: [
@@ -94,10 +79,18 @@ export default {
           props: "loginName",
         },
         {
-          label: "待办接收数",
+          label: "接收待办数",
           props: "number",
         },
         {
+          label: "待办完成数",
+          props: "finishAgencyNumber",
+        },
+        {
+          label: "进行中待办数",
+          props: "conductAgencyNumber",
+        },
+        {
           label: "完成回复率",
           props: "percentageReply",
         },
@@ -109,6 +102,10 @@ export default {
           label: "累计超期时间",
           props: "day",
         },
+        {
+          label: "平均超期时间(天)",
+          props: "averageDay",
+        },
       ],
     };
   },
@@ -152,61 +149,70 @@ export default {
         responseType: "blob",
         data: {
           ...this.table_search,
-          time: this.table_search.time ? this.$formatDate(this.table_search.time, "YYYY-MM") : '',
         },
       }).then((response) => {
         if (window.navigator && window.navigator.msSaveOrOpenBlob) {
           let blob = new Blob([response.data], {
             type: "application/vnd.ms-excel",
           });
-          let month = this.table_search.time ? this.$formatDate(this.table_search.time, "YYYY年MM月") : ''
-          window.navigator.msSaveOrOpenBlob(
-            blob,`${month}回复统计.xlsx`
-          );
+          // let month = this.table_search.time
+          //   ? this.$formatDate(this.table_search.time, "YYYY年MM月")
+          //   : "";
+          window.navigator.msSaveOrOpenBlob(blob, `回复统计.xlsx`);
         } else {
           /* 火狐谷歌的文件下载方式 */
           var blob = new Blob([response.data]);
           var downloadElement = document.createElement("a");
           var href = window.URL.createObjectURL(blob);
           downloadElement.href = href;
-          let month = this.table_search.time ? this.$formatDate(this.table_search.time, "YYYY年MM月") : ''
-          downloadElement.download =  `${month}回复统计.xlsx`;
+          // let month = this.table_search.time
+          //   ? this.$formatDate(this.table_search.time, "YYYY年MM月")
+          //   : "";
+          downloadElement.download = `回复统计.xlsx`;
           document.body.appendChild(downloadElement);
           downloadElement.click();
           document.body.removeChild(downloadElement);
           window.URL.revokeObjectURL(href);
         }
       });
-        // this.$http({
-        //   url: "/CMKIssued/exportCMKIssuedReplyStatistics",
-        //   method: "post",
-        //   headers: {
-        //     "Content-Type": "application/json",
-        //   },
-        //   data: {
-        //     ...this.table_search,
-        //     time: this.table_search.time ? this.table_search.time : "",
-        //   },
-        //   responseType: "blob", // 解决下载的文件乱码空白等问题
-        // }).then(({ data }) => {
-        //   console.log(data,'data');
-        //   let url = window.URL.createObjectURL(new Blob([data]));
-        //   let a = document.createElement("a");
-        //   a.setAttribute("href", url);
-        //   //   a.setAttribute('download', scope.row.fileName)
-        //   a.click();
-        // });
+      // this.$http({
+      //   url: "/CMKIssued/exportCMKIssuedReplyStatistics",
+      //   method: "post",
+      //   headers: {
+      //     "Content-Type": "application/json",
+      //   },
+      //   data: {
+      //     ...this.table_search,
+      //     time: this.table_search.time ? this.table_search.time : "",
+      //   },
+      //   responseType: "blob", // 解决下载的文件乱码空白等问题
+      // }).then(({ data }) => {
+      //   console.log(data,'data');
+      //   let url = window.URL.createObjectURL(new Blob([data]));
+      //   let a = document.createElement("a");
+      //   a.setAttribute("href", url);
+      //   //   a.setAttribute('download', scope.row.fileName)
+      //   a.click();
+      // });
       console.log("我下载了");
     },
     handleSearch(data) {
-      let obj = {
-        ...data,
-        time: data.time
-          ? this.$formatDate(data.time, "YYYY-MM")
-          : "",
-      };
-      console.log(obj,'obj');
-      this.table_search = data;
+      let obj = data;
+      Object.values(data).forEach((el, index) => {
+        if (el instanceof Array) {
+          obj[`start${Object.keys(data)[index]}`] = this.$formatDate(
+            el[0],
+            "YYYY-MM-DD HH:mm:ss"
+          );
+          obj[`end${Object.keys(data)[index]}`] = this.$formatDate(
+            el[1],
+            "YYYY-MM-DD HH:mm:ss"
+          );
+          delete data[`${Object.keys(data)[index]}`];
+        }
+      });
+      console.log(obj);
+      this.table_search = obj;
       this.handleReset();
       this.handleInit({ ...obj });
     },
@@ -219,7 +225,7 @@ export default {
     },
   },
   mounted() {
-    this.handleInit({ time: "" });
+    this.handleInit({});
   },
 };
 </script>