浏览代码

督办的下发

daiqisheng 3 年之前
父节点
当前提交
446b8c4d25

+ 9 - 9
src/pages/main/performance/components/form.vue

@@ -2,7 +2,7 @@
  * @Author       : yuanrunwei
  * @Date         : 2021-11-01 18:03:02
  * @LastEditors: daiqisheng
- * @LastEditTime: 2022-04-07 12:06:14
+ * @LastEditTime: 2022-04-07 15:28:13
  * @FilePath     : \spfm-market-front\src\pages\main\performance\components\form.vue
 -->
 <template>
@@ -75,9 +75,9 @@
       </el-col>
     </el-row>
     <div v-else>
-      <div class="form-content">
-        <div class="form-left">
-          <div class="form-header">
+      <div class="template-content">
+        <div class="template-left">
+          <div class="template-head">
             <div
               v-for="({ props, label, type, dictionary }, index) in form.slice(
                 0,
@@ -132,7 +132,7 @@
               </el-form-item>
             </div>
           </div>
-          <div class="form-header">
+          <div class="template-head">
             <div
               class="margin-right-10"
               v-for="({ props, label, type, dictionary }, index) in form.slice(
@@ -188,8 +188,8 @@
             </div>
           </div>
         </div>
-        <div class="form-right margin-top-10">
-          <el-form-item class="form-search">
+        <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>
@@ -255,8 +255,8 @@ export default {
 };
 </script>
 <style lang="scss" scope>
-.form {
-  &-header {
+.template{
+  &-head {
     display: flex;
     justify-content: space-between;
     flex-wrap: wrap;

+ 75 - 15
src/pages/main/performance/components/sheet.vue

@@ -2,7 +2,7 @@
  * @Author       : yuanrunwei
  * @Date         : 2021-12-04 14:23:58
  * @LastEditors: daiqisheng
- * @LastEditTime: 2022-04-05 17:41:20
+ * @LastEditTime: 2022-04-07 14:42:33
  * @FilePath     : \spfm-market-front\src\pages\main\performance\components\sheet.vue
 -->
 <template>
@@ -28,7 +28,7 @@
       <el-button type="primary" @click="handleFullscreen()">全屏显示</el-button>
       <el-button
         type="primary"
-        v-if="!status || superviseFlag === '1'"
+        v-if="!status || status === '2' || superviseFlag === '1'"
         @click="handleSupervise('confirm')"
         >督办</el-button
       >
@@ -814,18 +814,46 @@ export default {
         } 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;
@@ -1059,19 +1087,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");
       });
     },

+ 28 - 6
src/pages/main/performance/components/table.vue

@@ -1,8 +1,8 @@
 <!--
  * @Author       : yuanrunwei
  * @Date         : 2021-11-01 18:02:58
- * @LastEditors: Please set LastEditors
- * @LastEditTime: 2022-02-10 11:17:50
+ * @LastEditors: daiqisheng
+ * @LastEditTime: 2022-04-07 15:21:38
  * @FilePath     : /spfm-market-front/src/pages/main/performance/components/table.vue
 -->
 <template>
@@ -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;
     },

+ 5 - 2
src/pages/main/performance/mould.vue

@@ -178,13 +178,16 @@ export default {
           props: "issue",
           visible: {
             status: ["0", "3"],
+            superviseFlag: ["0"],
           },
         },
         {
           label: "编辑",
           props: "redit",
           visible: {
-            status: ["2", "3"],
+            superviseFlag: ["1"],
+            flag: "or",
+            status: ["2"],
           },
         },
         {
@@ -195,7 +198,7 @@ export default {
           label: "删除",
           props: "delete",
           visible: {
-            status: ["0", "2"],
+            status: ["0", "3"],
           },
           popconfirm: true,
         },