Browse Source

Merge branch 'dev_info' into 'master'

Dev info

See merge request spfm/spfm-market-front!111
徐兴安 3 years ago
parent
commit
aaf7aa7ac4

+ 186 - 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-04-19 13:59:04
  * @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,145 @@
           :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="template-content">
+        <div class="template-left">
+          <div class="template-head">
+            <div
+              v-for="({ props, label, type, dictionary }, index) in form.slice(
+                0,
+                1
+              )"
+              :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>
+          </div>
+          <div class="template-head">
+            <div
+              class="margin-right-10"
+              v-for="({ props, label, type, dictionary }, index) in form.slice(
+                1
+              )"
+              :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>
+          </div>
+        </div>
+        <div class="template-right margin-top-10">
+          <el-form-item class="template-search">
+            <el-button type="primary" @click="handleSearch">搜索</el-button>
+          </el-form-item>
+        </div>
+      </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>
@@ -78,6 +224,27 @@ export default {
   data: () => ({
     object: {},
   }),
+  // watch: {
+  //   form() {
+  //     this.form.forEach((el) => {
+  //       if (el.default) {
+  //         this.object[el.props] = el.default;
+  //         console.log(this.object[el.props], "this.object[el.props]");
+  //       }
+  //     });
+  //   },
+  // },
+  created() {
+    this.form.forEach((el) => {
+      if (el.default) {
+        // this.object[el.props] = el.default;
+        this.object = {
+          ...this.object,
+          [el.props]: el.default,
+        };
+      }
+    });
+  },
   methods: {
     handleSearch() {
       this.$emit("search", this.object);
@@ -88,3 +255,18 @@ export default {
   },
 };
 </script>
+<style lang="scss" scope>
+.template {
+  &-head {
+    display: flex;
+    justify-content: space-between;
+    flex-wrap: wrap;
+    margin-left: 10px;
+    margin-top: 10px;
+  }
+  &-content {
+    display: flex;
+    justify-content: space-between;
+  }
+}
+</style>

+ 324 - 26
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-04-18 18:09:32
  * @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="['template'].includes(attribute)"
+        ><span class="sheet-container-require">*</span>模板类型:</span
+      >
+      <el-input
+        v-if="['template'].includes(attribute)"
+        v-model="templateType"
+        :disabled="type === 'view' || (type === 'edit' && attribute === 'file')"
+      ></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"
+        @click="handleSupervise('confirm')"
+        v-if="['template'].includes(attribute)"
+        >督办</el-button
+      >
       <template v-if="['edit'].includes(type)">
         <el-upload
           v-if="!id"
@@ -34,7 +50,11 @@
           >暂存</el-button
         >
         <el-button
-          v-if="status === '2' || status === '3'"
+          v-if="
+            status === '2' ||
+            status === '3' ||
+            (status === '0' && superviseFlag === '1')
+          "
           type="primary"
           @click="handleResave"
           :disabled="handleForbid()"
@@ -53,6 +73,7 @@
       </template>
     </div>
     <div id="luckysheet" class="sheet-container-block"></div>
+    <!-- 设置权限的 -->
     <simple-dialog
       title="权限设置"
       :visible="visible"
@@ -162,6 +183,7 @@
         ><div></div
       ></template>
     </simple-dialog>
+    <!-- 科室经理提交的 -->
     <simpleDialog
       title="提交"
       :visible="manager_approve"
@@ -210,6 +232,63 @@
         </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"
+            @change="handleWrite"
+            :picker-options="pickWrite"
+          >
+          </el-date-picker
+        ></el-form-item>
+        <el-form-item prop="endTime" label="截止时间">
+          <el-date-picker
+            v-model="superviseForm.endTime"
+            @change="handleEnd"
+            type="datetime"
+            :unlink-panels="true"
+            :picker-options="pickOptions"
+          >
+          </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 +312,12 @@ export default {
     id: {
       default: null,
     },
+    // 接收人
     receiver: {
       type: String,
       default: "",
     },
+    // 模板状态按钮判断
     status: { type: String, default: "" },
   },
   data() {
@@ -277,14 +358,45 @@ 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: "", // 截止时间
+      },
+      originSuperviseForm: {},
+      pickOptions: {
+        disabledDate(time) {
+          return time.getTime() < new Date().getTime() - 8.64e7;
+        },
+      },
+      pickWrite: {
+        disabledDate(time) {
+          return time.getTime() < new Date().getTime() - 8.64e7;
+        },
+      },
       // 可提交标志
       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: [],
@@ -309,6 +421,47 @@ export default {
         this.handleCreate();
       }
     },
+    // 填报日期
+    handleWrite(value) {
+      if (value) {
+        let range =
+          new Date().getTime() > value.getTime()
+            ? new Date().getTime()
+            : value.getTime();
+        this.pickOptions = {
+          disabledDate(time) {
+            return time.getTime() < range;
+          },
+        };
+      } else {
+        this.pickOptions = {
+          disabledDate(time) {
+            return time.getTime() < new Date().getTime() - 864000;
+          },
+        };
+      }
+    },
+    handleEnd(value) {
+      if (value) {
+        this.pickWrite = {
+          disabledDate(time) {
+            return time.getTime() > value.getTime();
+          },
+        };
+        if (
+          this.superviseForm.write &&
+          value.getTime() < this.superviseForm.write.getTime()
+        ) {
+          this.superviseForm.endTime = "";
+        }
+      } else {
+        this.pickWrite = {
+          disabledDate(time) {
+            return time.getTime() - 864000 < new Date().getTime();
+          },
+        };
+      }
+    },
     // // 权限选择
     // handleRadio(e){
     //     console.log(e,'e');
@@ -356,7 +509,12 @@ export default {
           issuedId,
           templateId,
           list,
+          superviseFlag,
+          templateType,
           addFlag,
+          distributeEndTime,
+          distributeTime,
+          distributeType,
         },
       } = await this.$http({
         url,
@@ -366,6 +524,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 +606,44 @@ export default {
         type: "json",
       });
     },
+    handleSupervise(data) {
+      if (data === "cancel") {
+        this.supervise = false;
+        this.superviseForm = {
+          ...this.originSuperviseForm,
+        };
+        return;
+      }
+      if (this.supervise === false) {
+        this.supervise = true;
+        this.originSuperviseForm = {
+          ...this.superviseForm,
+        };
+      } else {
+        let filled =
+          Object.keys(this.superviseForm).length === 3 &&
+          Object.values(this.superviseForm).filter((el) => el !== "").length ===
+            3;
+        if (filled) {
+          let time = new Date().getTime();
+          if (time > this.superviseForm.endTime.getTime()) {
+            this.$message.error("截止时间不能小于当前时间");
+            return;
+          }
+          this.superviseForm = {
+            ...this.superviseForm,
+            endTime: this.$formatDate(
+              this.superviseForm.endTime,
+              "YYYY-MM-DD HH:mm:ss"
+            ), // 督办设置的截止时间
+            write: this.$formatDate(this.superviseForm.write, "YYYY-MM-DD"), // 派发时间–或者叫—填报时间
+          };
+          this.supervise = false;
+        } else {
+          this.$message.error("请填写完整必要的信息");
+        }
+      }
+    },
     handleForbid() {
       // const object = {};
       const { permission_type } = this.form;
@@ -581,7 +786,7 @@ export default {
         });
         reqdata.principalId = principalId.join(",");
         reqdata.principalName = principalName.join(",");
-        reqdata.principalMent = principalName.join(",");
+        reqdata.principalMent = principalMent.join(",");
       } else {
         const { charge } = this.form;
         //  特殊权限
@@ -627,11 +832,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,36 +876,58 @@ 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");
       } else {
         // 职位
         let duty = JSON.parse(sessionStorage.userInfo).duty;
-        if (duty === "7") {
+        if (duty === "7" && type === "0") {
           this.manager_approve = true;
         } else {
           if (type === "2") {
             // 暂存
+            let value = {};
+            if (!this.templateType) {
+              this.$message.error("请输入模板类型");
+              return;
+            }
+            if (
+              Object.values(this.superviseForm).filter((el) => el !== "")
+                .length === 3
+            ) {
+              value = {
+                templateId: this.id,
+                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 = {
+                templateId: this.id,
+                superviseFlag: 0, //督办标识 0.不是 1.是
+                templateType: this.templateType, //模板类型
+                templateContent: JSON.stringify(data), //文件内容
+                templateName: workbook_name, //模板名称
+                templateUrl: "", //文件链接
+                status: type,
+              };
+            }
+
             await this.$http({
-              url: "/market/CMKFileTemplate/UptateCMKFileTemplateById", // 新增
+              url: "/market/CMKFileTemplate/UptateCMKFileTemplateById", //
               method: "post",
               headers: {
                 "Content-Type": "application/json",
               },
-              data: {
-                templateId: this.id,
-                templateContent: JSON.stringify(data),
-                templateName: workbook_name,
-                status: type,
-              },
+              data: value,
             });
             this.$emit("save");
             return;
@@ -903,19 +1161,51 @@ export default {
       const sheet_name = window.luckysheet.getSheet().name;
       const data = window.luckysheet.getSheet(sheet_name);
       const workbook_name = window.luckysheet.getWorkbookName();
+
+      let value = {};
+      if (!this.templateType) {
+        this.$message.error("请输入模板类型");
+        return;
+      }
+      if (
+        Object.values(this.superviseForm).filter((el) => el !== "").length === 3
+      ) {
+        value = {
+          templateId: this.id,
+          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: "0",
+        };
+      } else {
+        value = {
+          templateId: this.id,
+          superviseFlag: 0, //督办标识 0.不是 1.是
+          templateType: this.templateType, //模板类型
+          templateContent: JSON.stringify(data), //文件内容
+          templateName: workbook_name, //模板名称
+          templateUrl: "", //文件链接
+          status: "0",
+        };
+      }
+
       this.$http({
         url: "/market/CMKFileTemplate/UptateCMKFileTemplateById",
         method: "post",
         headers: {
           "Content-Type": "application/json",
         },
-        data: {
-          templateId: this.id,
-          templateContent: JSON.stringify(data),
-          templateName: workbook_name,
-          status: "0",
-        },
+        data: value,
       }).then(() => {
+        this.$message({
+          type: "success",
+          message: "保存成功",
+        });
         this.$emit("save");
       });
     },
@@ -936,7 +1226,8 @@ export default {
     },
   },
   mounted() {
-    console.log(this.destroy, "destroy");
+    console.log(this.attribute, "attribute");
+    console.log(this.type, "type");
     this.handleInit();
     this.handleChargeList();
   },
@@ -957,6 +1248,13 @@ export default {
     width: 100%;
     height: 75%;
   }
+  &-require {
+    color: red;
+  }
+  .el-input {
+    width: 200px;
+    margin-right: 10px;
+  }
 }
 .form {
   &-input {

+ 26 - 4
src/pages/main/performance/components/table.vue

@@ -201,11 +201,33 @@ export default {
       let visible = true;
       if (params) {
         visible = false;
-        Object.keys(params).forEach((element) => {
-          if (params[element].includes(data[element])) {
-            visible = true;
+        if (Object.keys(params).length === 1) {
+          Object.keys(params).forEach((element) => {
+            if (params[element].includes(data[element])) {
+              visible = true;
+            }
+          });
+        } else {
+          let sum = 0;
+          if (Object.keys(params).indexOf("flag") && params["flag"] === "or") {
+            Object.keys(params).forEach((element) => {
+              if (params[element].includes(data[element])) {
+                visible = true;
+              }
+            });
+          } else {
+            Object.keys(params).forEach((element) => {
+              if (params[element].includes(data[element])) {
+                sum = sum + 1;
+              }
+            });
+            if (Object.keys(params).length === sum) {
+              visible = true;
+            } else {
+              visible = false;
+            }
           }
-        });
+        }
       }
       return visible;
     },

+ 88 - 2
src/pages/main/performance/department.vue

@@ -1,7 +1,12 @@
 <template>
   <div>
     <div class="simple-container">
-      <simple-form :form="table_form" @search="handleSearch"> </simple-form>
+      <simple-form
+        :form="table_form"
+        @search="handleSearch"
+        class="department-form"
+      >
+      </simple-form>
       <simple-table
         :list="table_list"
         :config="table_config"
@@ -10,6 +15,8 @@
         @check="handleCheck"
         @edit="handleEdit"
         @delete="handleDelete"
+        @remove="handleRemove"
+        @urge="handleUrge"
         @receiverName="handleReceiver"
       ></simple-table>
       <simple-pagination
@@ -419,6 +426,22 @@ export default {
           type: "datetime",
         },
         {
+          label: "是否为督办",
+          props: "superviseFlag",
+          type: "select",
+          // 0.否  1.是
+          dictionary: [
+            {
+              label: "否",
+              value: "0",
+            },
+            {
+              label: "是",
+              value: "1",
+            },
+          ],
+        },
+        {
           label: "状态",
           props: "status",
           type: "select",
@@ -440,10 +463,19 @@ export default {
               label: "待审批",
               value: "2",
             },
+
             {
               label: "已完成",
               value: "3",
             },
+            {
+              label: "已提交",
+              value: "4",
+            },
+            {
+              label: "未提交",
+              value: "5",
+            },
           ],
         },
       ],
@@ -471,6 +503,21 @@ export default {
             withdrawFlag: ["0"],
           },
         },
+        {
+          label: "删除",
+          props: "remove",
+          popconfirm: true,
+          visible: {
+            withdrawFlag: ["0"],
+          },
+        },
+        // {
+        //   label: "催办",
+        //   props: "urge",
+        //   visible: {
+        //     superviseFlag: ["1"],
+        //   },
+        // },
       ],
       //  表头配置
       table_config: [
@@ -527,6 +574,16 @@ export default {
             5: "未提交",
           },
         },
+        {
+          label: "是否为督办",
+          props: "superviseFlag",
+          type: "dictionary",
+          dictionary: {
+            null: "否",
+            0: "否",
+            1: "是",
+          },
+        },
       ],
     };
   },
@@ -590,9 +647,10 @@ export default {
       this.table_search = {
         ...data,
         issuedDate: data.issuedDate
-          ? this.$formatDate(data.issuedDate, "YYYY-MM-DD HH:00:00")
+          ? this.$formatDate(data.issuedDate, "YYYY-MM-DD HH:mm:ss")
           : data.issuedDate,
       };
+      console.log(this.table_search,'daaad');
       this.page = 1;
       this.handleInit({
         ...this.table_search,
@@ -685,6 +743,26 @@ export default {
         });
       });
     },
+    handleRemove({ id }) {
+      console.log(id, "id");
+      this.$http({
+        url: "/market/CMKIssued/CMKRemoveIssuedById",
+        method: "post",
+        headers: {
+          "Content-Type": "application/json",
+        },
+        data: {
+          id,
+        },
+      }).then(() => {
+        this.$message.success("删除成功, 请重新创建模版");
+        this.handleInit({
+          ...this.table_search,
+          page: this.page,
+          pageSize: this.rows,
+        });
+      });
+    },
     // dialog事件
     //权限管理事件
     handleApprove() {
@@ -997,6 +1075,9 @@ export default {
       }
       return arr.join(",");
     },
+    handleUrge() {
+      console.log("这里是催办的方法");
+    },
     handleConfirm(visible) {
       console.log(visible);
       this.track_visible = visible;
@@ -1058,4 +1139,9 @@ export default {
     display: none !important;
   }
 }
+.department-form {
+  .el-form-item .el-input {
+    width: 220px;
+  }
+}
 </style>

+ 65 - 14
src/pages/main/performance/mould.vue

@@ -56,6 +56,7 @@
         <el-form-item
           label="截止时间"
           prop="endTime"
+          v-if="superviseFlag !== '1'"
           :rules="{
             required: true,
             message: '截止时间不能为空',
@@ -65,7 +66,7 @@
           <el-date-picker
             v-model="issue_form.endTime"
             type="datetime"
-            format="yyyy-MM-dd HH:00:00"
+            format="yyyy-MM-dd HH:mm:ss"
           >
           </el-date-picker>
         </el-form-item>
@@ -147,6 +148,7 @@ export default {
         precautions: "",
         endTime: "",
       },
+      superviseFlag: "",
       issue_id: null,
       // table
       table_loading: false,
@@ -157,6 +159,11 @@ export default {
           props: "templateName",
           type: "input",
         },
+        {
+          label: "模板类型",
+          props: "templateType",
+          type: "input",
+        },
       ],
       table_list: [],
       table_handle: [
@@ -170,13 +177,17 @@ export default {
           label: "下发",
           props: "issue",
           visible: {
-            status: ["0", "3"],
+            status: ["0"],
+            flag: "or",
+            superviseFlag: ["0"],
           },
         },
         {
           label: "编辑",
           props: "redit",
           visible: {
+            superviseFlag: ["1"],
+            flag: "or",
             status: ["2", "3"],
           },
         },
@@ -188,7 +199,7 @@ export default {
           label: "删除",
           props: "delete",
           visible: {
-            status: ["0", "2"],
+            status: ["0", "3"],
           },
           popconfirm: true,
         },
@@ -203,6 +214,10 @@ export default {
           props: "templateName",
         },
         {
+          label: "模板类型",
+          props: "templateType",
+        },
+        {
           label: "配置时间",
           props: "updateTime",
         },
@@ -220,6 +235,16 @@ export default {
             3: "已下发",
           },
         },
+        {
+          label: "是否为督办",
+          props: "superviseFlag",
+          type: "dictionary",
+          dictionary: {
+            null: "否",
+            0: "否",
+            1: "是",
+          },
+        },
       ],
     };
   },
@@ -235,7 +260,7 @@ export default {
         data: {
           page: this.page,
           pageSize: this.rows,
-          templateName: this.table_search.templateName,
+          ...this.table_search,
         },
       }).then(({ data: { count, data } }) => {
         this.total = count;
@@ -243,8 +268,9 @@ export default {
         this.table_loading = false;
       });
     },
-    handleSearch({ templateName }) {
-      this.table_search = { templateName };
+    handleSearch(data) {
+      console.log(data, "data");
+      this.table_search = data;
       this.handleReset();
       this.handleInit();
     },
@@ -269,6 +295,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 +329,44 @@ 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"
+                "YYYY-MM-DD HH:mm:ss"
               ),
               templateId: this.issue_id,
+            };
+            if (this.issue_form.endTime) {
+              if (
+                new Date(this.issue_form.endTime).getTime() <
+                new Date().getTime()
+              ) {
+                this.$message.error("截止时间不能小于当前时间");
+                return false;
+              }
+            }
+          }
+          this.$http({
+            url: url,
+            method: "post",
+            headers: {
+              "Content-Type": "application/json",
             },
+            data: reqdata,
           }).then(() => {
             this.handleVisible("issue");
             this.$message.success("下发成功");

+ 83 - 70
src/pages/main/performance/reply.vue

@@ -41,40 +41,26 @@ export default {
       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",
-        //         },
-        //     ],
-        // },
+          label: "统计时间",
+          props: "Time",
+          type: "dateRange",
+          default: [new Date(), new Date().setDate(new Date().getDate() + 1)],
+        },
+        {
+          label: "模板类型",
+          props: "templateType",
+          type: "input",
+        },
+        {
+          label: "模板名称",
+          props: "templateName",
+          type: "input",
+        },
+        {
+          label: "科室名称",
+          props: "deptName",
+          type: "input",
+        },
       ],
       table_list: [],
       table_handle: [
@@ -94,10 +80,18 @@ export default {
           props: "loginName",
         },
         {
-          label: "待办接收数",
+          label: "接收待办数",
           props: "number",
         },
         {
+          label: "待办完成数",
+          props: "finishAgencyNumber",
+        },
+        {
+          label: "进行中待办数",
+          props: "conductAgencyNumber",
+        },
+        {
           label: "完成回复率",
           props: "percentageReply",
         },
@@ -109,6 +103,10 @@ export default {
           label: "累计超期时间",
           props: "day",
         },
+        {
+          label: "平均超期时间(天)",
+          props: "averageDay",
+        },
       ],
     };
   },
@@ -152,61 +150,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 +226,13 @@ export default {
     },
   },
   mounted() {
-    this.handleInit({ time: "" });
+    this.handleInit({
+      startTime: this.$formatDate(new Date(), "YYYY-MM-DD"),
+      endTime: this.$formatDate(
+        new Date().setDate(new Date().getDate() + 1),
+        "YYYY-MM-DD"
+      ),
+    });
   },
 };
 </script>