Browse Source

部门工作清单

bianww 2 years ago
parent
commit
9647f7295d

+ 0 - 74
src/pages/main/departWorkLists/dialog.vue

@@ -1,74 +0,0 @@
-<template>
-  <el-dialog
-    :modal="modal"
-    :title="title"
-    :visible.sync="visible"
-    :fullscreen="fullscreen"
-    :key="reload"
-    :before-close="handleCancel"
-    :modal-append-to-body="false"
-    :width="width"
-    :destroy-on-close="destroy"
-  >
-    <!-- 表格主体部分 -->
-    <slot></slot>
-    <!-- 表格底部 -->
-    <div slot="footer">
-      <slot name="footer">
-        <el-button @click="handleCancel" size="small">取消</el-button>
-        <el-button @click="handleConfirm" type="primary" size="small"
-          >确定</el-button
-        >
-      </slot>
-    </div>
-  </el-dialog>
-</template>
-
-<script>
-export default {
-  props: {
-    visible: {
-      type: Boolean,
-      default: false,
-    },
-    title: {
-      type: String,
-      default: "",
-    },
-    reload: {
-      type: Number,
-      default: 0,
-    },
-    width: {
-      type: String,
-      default: "500px",
-    },
-    fullscreen: {
-      type: Boolean,
-      default: false,
-    },
-    modal: {
-      type: Boolean,
-      default: true,
-    },
-    destroy: {
-      type: Boolean,
-      default: false
-    }
-  },
-  mounted() {
-  },
-  methods: {
-    //   确定的回调
-    handleConfirm() {
-      this.$emit("confirm", false);
-    },
-    //   取消的回调
-    handleCancel() {
-      this.$emit("cancel", false);
-    },
-  },
-};
-</script>
-
-<style></style>

+ 1 - 1
src/pages/main/departWorkLists/index.vue

@@ -414,7 +414,7 @@ export default {
         },
         // 删除目录
         delMenu() {
-            if (!this.checkedNode || this.checkedNode.length === 0) {
+            if (!this.checkedNode || this.checkedNode.length !== 2) {
                 this.$message("请先选中要删除的目录");
             } else {
                 this.$confirm("即将删除此条数据, 是否删除?", "提示", {

File diff suppressed because it is too large
+ 0 - 1052
src/pages/main/departWorkLists/sheet.vue


+ 19 - 470
src/pages/main/departWorkLists/sheet1.vue

@@ -6,7 +6,7 @@
  * @FilePath     : \spfm-market-front\src\pages\main\performance\components\sheet.vue
 -->
 <template>
-    <fullscreen :fullscreen.sync="fullscreen" class="container" style=" background-color: #ffffff">
+    <fullscreen :fullscreen.sync="fullscreen" class="containerClass" style=" background-color: #ffffff">
     <div class="sheet-container">
         <div style="    margin-top: 20px; margin-left: 30px;" >
             <span style="  font-size: small;margin-right: 10px;">控制权限</span>
@@ -52,29 +52,8 @@
             <el-button  size="mini" type="danger" @click="handleDownload">导出</el-button>
             <el-button size="mini" type="primary" @click="returnList">返回</el-button>
             <el-button size="mini" type="primary" @click="handleFullscreen()">全屏显示</el-button>
-            <!--      <template v-if="['edit'].includes(type)">-->
-
-            <!--        <el-button-->
-            <!--          v-if="!status || status === '2'"-->
-            <!--          type="primary"-->
-            <!--          @click="handleSave('2')"-->
-            <!--          :disabled="handleForbid()"-->
-            <!--          >暂存</el-button-->
-            <!--        >-->
-
-            <!--        <el-button-->
-            <!--          v-if="addFlag === '0'"-->
-            <!--          type="primary"-->
-            <!--          @click="handleSave('0')"-->
-            <!--          :disabled="handleForbid()"-->
-            <!--          ><span>{{ id ? "提交" : "新增" }}</span-->
-            <!--          ><span>{{-->
-            <!--            handleForbid() ? `(请先设置权限)` : ""-->
-            <!--          }}</span></el-button-->
-            <!--        >-->
-            <!--      </template>-->
         </div>
-        <div id="luckysheet" class="sheet-container-block" ></div>
+        <div id="luckysheet" class="sheet-container-block_class" ></div>
     </div>
     </fullscreen>
 </template>
@@ -82,10 +61,8 @@
 <script>
 import luckyexcel from "luckyexcel";
 import { exportExcel } from "../performance/common/export";
-import simpleDialog from "../performance/components/dialog.vue";
 export default {
   components: {
-    simpleDialog,
   },
   props: {
       isCreater: {
@@ -233,60 +210,9 @@ export default {
       returnList(){
           this.$emit("save");
       },
-    // 填报日期
-    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();
-          },
-        };
-        let write = new Date(this.superviseForm.write).getTime();
-        if (this.superviseForm.write && value.getTime() < write) {
-          this.superviseForm.endTime = "";
-        }
-      } else {
-        this.pickWrite = {
-          disabledDate(time) {
-            return time.getTime() - 864000 < new Date().getTime();
-          },
-        };
-      }
-    },
-    // // 权限选择
-    // handleRadio(e){
-    //     console.log(e,'e');
-    // },
       handleAllow() {
-          // let public_permisson = (!this.form.permission_type ||
-          //     this.status === "2" ||
-          //     this.status === "3") &&
-          //   this.type === "edit";
-          // let editable = this.row_list.includes(row) && this.column_list.includes(column);
-          // // let totalBoolean = (public_permisson || editable) && this.id;
           //查看无法编辑
           return this.type=="view"?false:true;
-          // let totalBoolean = public_permisson || editable;
-          // return totalBoolean;
       },
     async handleQuery() {
         debugger
@@ -312,51 +238,13 @@ console.log("&&&&&&&&&&&&&sss:",state,templateName)
         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();
-          let endTime = new Date(this.superviseForm.endTime).getTime();
-          if (time > endTime) {
-            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("请填写完整必要的信息");
-        }
-      }
-    },
     async handleCreate({ file, json, type, name } = {}) {
       let that = this;
       const options = {
         container: "luckysheet",
         lang: "zh",
         showsheetbar: false,
+          plugins:['chart'],
         hook: {
           cellEditBefore: function ([
             { row_focus: row, column_focus: column },
@@ -450,208 +338,6 @@ console.log("&&&&&&&&&&&&&sss:",state,templateName)
         window.luckysheet.getWorkbookName()
       );
     },
-    async handleAddAuth({ id }) {
-      // const object = {};
-      const { permission_type } = this.form;
-      console.log(id, permission_type);
-      let reqdata = {
-        templateId: id,
-        type: permission_type ? 2 : 1,
-      };
-      if (!permission_type) {
-        //  公共权限
-        const { person } = this.form;
-
-        const principalId = [];
-        const principalName = [];
-        const principalMent = [];
-        person.forEach((el) => {
-          principalMent.push(el.split(",")[0].split("-")[0]);
-          principalId.push(el.split(",")[0].split("-")[1]);
-          principalName.push(el.split(",")[1]);
-        });
-        reqdata.principalId = principalId.join(",");
-        reqdata.principalName = principalName.join(",");
-        reqdata.principalMent = principalMent.join(",");
-      } else {
-        const { charge } = this.form;
-        //  特殊权限
-        reqdata.specialAuth = charge.map((el) =>
-          JSON.stringify({
-            allowEditingColumns: `${el.col_start},${el.col_end}`,
-            rowNum: `${el.row_start},${el.row_end}`,
-            principalMent: el.person.split(",")[0].split("-")[0],
-            principalId: el.person.split(",")[0].split("-")[1],
-            principalName: el.person.split(",")[1],
-          })
-        );
-      }
-      const {
-        data: { result, desc },
-      } = await this.$http({
-        url: this.id
-          ? "/market/CMKFileTemplateAuthority/CMKFileTemplateAuthorityUpdate"
-          : "/market/CMKFileTemplateAuthority/CMKFileTemplateAuthorityAdd",
-        method: "post",
-        headers: {
-          "Content-Type": "application/json",
-        },
-        data: reqdata,
-      });
-      if (result) {
-        this.$message.error(desc);
-      } else {
-        this.$message.success(desc);
-      }
-      return result;
-    },
-    async handleSave(type) {
-      let edit_url = "";
-      switch (this.attribute) {
-        case "template":
-          edit_url = "";
-          break;
-        case "order":
-          edit_url = "";
-          break;
-        case "file":
-          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({
-          url: "/market/CMKFileTemplate/CMKFileTemplateAdd", // 新增
-          method: "post",
-          headers: {
-            "Content-Type": "application/json",
-          },
-          data: value,
-        });
-        await this.handleAddAuth({ id: body });
-        this.$emit("save");
-      } else {
-        // 职位
-        let duty = JSON.parse(sessionStorage.userInfo).duty;
-        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", //
-              method: "post",
-              headers: {
-                "Content-Type": "application/json",
-              },
-              data: value,
-            });
-            this.$emit("save");
-            return;
-          }
-          // 员工提交
-          this.rowList.shift();
-          let reqdata = {
-            rowIndex: [...new Set(this.rowList)]
-              .sort(function (a, b) {
-                return a - b;
-              })
-              .join(","),
-            rowContent: [...new Set(this.rowList)]
-              .sort(function (a, b) {
-                return a - b;
-              })
-              .map((el) => {
-                return data.data[el];
-              }),
-          };
-          await this.$http({
-            url: edit_url, //提交
-            method: "post",
-            headers: {
-              "Content-Type": "application/json",
-            },
-            data: {
-              id: this.template_id,
-              templateContent: JSON.stringify(data),
-              templateName: workbook_name,
-              issuedId: this.issued_id,
-              rowJson: JSON.stringify(reqdata),
-            },
-          });
-          this.$emit("save");
-        }
-      }
-    },
     // 判断数组是否有值
     confirmArrayData(data) {
       if (data instanceof Array) {
@@ -674,20 +360,6 @@ console.log("&&&&&&&&&&&&&sss:",state,templateName)
         return false;
       }
     },
-    async handleAuth() {
-      this.$refs["form"].validate((valid) => {
-        if (valid) {
-          if (this.handleForbid()) {
-            this.$message.error("请完善可编辑信息");
-            return false;
-          }
-          if (this.id) {
-            this.handleAddAuth({ id: this.id });
-          }
-          this.handleVisible();
-        }
-      });
-    },
     // 通用方法用于转化全局
     paramsArr(start, end) {
       const arr = [];
@@ -697,128 +369,6 @@ console.log("&&&&&&&&&&&&&sss:",state,templateName)
       }
       return arr.join(",");
     },
-    filterName(id, arr) {
-      return arr.filter((el) => el.secLeaderLogin === id)[0].secLeaderName;
-    },
-    handleCharge(type) {
-      switch (type) {
-        case "add":
-          this.form.charge.push({
-            person: "",
-          });
-          this.handleForbid();
-          break;
-        case "delete":
-          this.form.charge.pop();
-          this.handleForbid();
-          break;
-      }
-    },
-    handleVisible() {
-      this.visible = !this.visible;
-    },
-    handleInput(index, name, value) {
-      let reg = /^[0-9]*$/;
-      if (!reg.test(value)) {
-        this.form.charge[index][name] = this.form.charge[index][name].substr(
-          0,
-          this.form.charge[index][name].length - 1
-        );
-        this.$message.error("该处只能填写数字");
-      }
-    },
-    async handleApprove(type) {
-      if (type) {
-        if (this.approveForm.type) {
-          if (this.approveForm.type === "3" && !this.approveForm.comments) {
-            this.$message.error("请输入其他审批意见");
-            return;
-          }
-        } else {
-          this.$message.error("请选择审批意见");
-          return;
-        }
-        const sheet_name = window.luckysheet.getSheet().name;
-        const data = window.luckysheet.getSheet(sheet_name);
-        const workbook_name = window.luckysheet.getWorkbookName();
-        // 经理提交
-        this.rowList.shift();
-        let reqdata = {
-          rowIndex: [...new Set(this.rowList)]
-            .sort(function (a, b) {
-              return a - b;
-            })
-            .join(","),
-          rowContent: [...new Set(this.rowList)]
-            .sort(function (a, b) {
-              return a - b;
-            })
-            .map((el) => {
-              return data.data[el];
-            }),
-        };
-        await this.$http({
-          url: "/market/CMKIssued/CMKIssuedSubmit", // 提交
-          method: "post",
-          headers: {
-            "Content-Type": "application/json",
-          },
-          data: {
-            id: this.template_id,
-            templateContent: JSON.stringify(data),
-            templateName: workbook_name,
-            issuedId: this.issued_id,
-            rowJson: JSON.stringify(reqdata),
-          },
-        });
-        let params = {
-          id: this.issued_id,
-          reviewOpinion:
-            this.approveForm.type === "3"
-              ? this.approveForm.comments
-              : this.approveForm.type,
-        };
-        switch (type) {
-          case "1":
-            params = {
-              ...params,
-              operateName: "结束",
-              status: 3,
-            };
-            break;
-          case "4":
-            params = {
-              ...params,
-              operateName: "转副总审批",
-              reviewType: 2,
-            };
-            break;
-          case "3":
-            params = {
-              ...params,
-              operateName: "转总经理审批",
-              reviewType: 3,
-            };
-            break;
-        }
-        await this.$http({
-          url: "/market/CMKIssued/CMKIssuedCheck", // 审批
-          method: "post",
-          headers: {
-            "Content-Type": "application/json",
-          },
-          data: params,
-        });
-        this.$message({
-          type: "success",
-          message: "审批成功",
-        });
-        this.manager_approve = false;
-        this.$emit("save");
-      } else {
-        this.manager_approve = false;
-      }
-    },
     handleFullscreen() {
         this.fullscreen = !this.fullscreen
 
@@ -850,6 +400,8 @@ console.log("&&&&&&&&&&&&&sss:",state,templateName)
           const data = window.luckysheet.getSheet(sheet_name);
           const workbook_name = window.luckysheet.getWorkbookName();
 
+          this.confirmArrayData(data.data)
+
           let value = {
               // templateId: this.id,
               templateContent: JSON.stringify(data), //文件内容
@@ -858,7 +410,7 @@ console.log("&&&&&&&&&&&&&sss:",state,templateName)
               state: this.state,
               mkdirId: this.mkdirId
           };
-          if("edit" ==this.type){
+          if("edit" === this.type){
               value.id=this.id;
           }
           this.$http({
@@ -884,27 +436,11 @@ console.log("&&&&&&&&&&&&&sss:",state,templateName)
               this.$emit("save");
           });
       },
-    handleChargeList() {
-      this.$http({
-        url: "/market/techcentergj/queryLeaderList",
-        method: "post",
-        headers: {
-          "Content-Type": "application/json",
-        },
-        data: {},
-      }).then((response) => {
-        // this.charge_list = response.data.map((element) => ({
-        //   label: `${element.ou} ${element.secLeaderName}`,
-        //   value: `${element.ou}-${element.secLeaderLogin},${element.secLeaderName}`,
-        // }));
-      });
-    },
   },
   mounted() {
     console.log(this.attribute, "attribute");
     console.log(this.type, "type");
     this.handleInit();
-    // this.handleChargeList();
   },
   destroyed() {
     window.luckysheet.destroy();
@@ -955,4 +491,17 @@ console.log("&&&&&&&&&&&&&sss:",state,templateName)
   //  }
   //}
 }
+    .containerClass{
+        background: #fff;
+        border-radius: 5px;
+        height: calc(100vh - 220px);
+        width: calc(100% - 6px);
+        float: left;
+        display: inline-block;
+        overflow: hidden;
+    }
+    .sheet-container-block_class{
+        height: 80%;
+        width: 100%;
+    }
 </style>