daiqisheng 3 éve
szülő
commit
f9a29e148f

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

@@ -1,8 +1,8 @@
 <!--
  * @Author       : yuanrunwei
  * @Date         : 2021-11-01 18:03:02
- * @LastEditors  : yuanrunwei
- * @LastEditTime : 2021-12-04 17:53:54
+ * @LastEditors: Please set LastEditors
+ * @LastEditTime: 2022-01-07 19:16:35
  * @FilePath     : \spfm-market-front\src\pages\main\performance\components\form.vue
 -->
 <template>
@@ -29,7 +29,7 @@
                             ></el-option>
                         </el-select>
                     </template>
-                    <template v-else-if="['date', 'month'].includes(type)">
+                    <template v-else-if="['datetime','date', 'month'].includes(type)">
                         <el-date-picker
                             v-model="object[props]"
                             :type="type"

+ 92 - 26
src/pages/main/performance/components/sheet.vue

@@ -2,7 +2,7 @@
  * @Author       : yuanrunwei
  * @Date         : 2021-12-04 14:23:58
  * @LastEditors: Please set LastEditors
- * @LastEditTime: 2022-01-06 17:06:48
+ * @LastEditTime: 2022-01-07 18:43:09
  * @FilePath     : \spfm-market-front\src\pages\main\performance\components\sheet.vue
 -->
 
@@ -312,16 +312,59 @@ export default {
       this.template_id = templateId;
       this.issued_id = issuedId;
       if (list && list.length) {
-        const [{ type, allowEditingColumns, rowNum }] = list;
-        this.form = {
-          ...this.form,
-          type: JSON.parse(type),
-          array: allowEditingColumns ? allowEditingColumns.split(",") : [],
-          charge: list.map(({ principalId, principalName, rowNum }) => ({
-            value: `${principalId},${principalName}`,
-            key: rowNum.split(","),
-          })),
-        };
+        const { type } = list[0];
+        if (type === "1") {
+          // 公共权限
+          const { allowEditingColumns, rowNum } = list[0];
+          this.form = {
+            permission_type: Number(type) - 1,
+            col_start: allowEditingColumns.split(",")[0],
+            col_end:
+              allowEditingColumns.split(",")[
+                allowEditingColumns.split(",").length - 1
+              ],
+            row_start: rowNum.split(",")[0],
+            row_end: rowNum.split(",")[rowNum.split(",").length - 1],
+            charge: [
+              {
+                person: "",
+                col_start: "",
+                col_end: "",
+                row_start: "",
+                row_end: "",
+              },
+            ],
+          };
+        } else {
+          // 特殊权限
+          this.form = {
+            permission_type: Number(type) - 1,
+            col_start: "",
+            col_end: "",
+            row_start: "",
+            row_end: "",
+            charge: list.map((el) => ({
+              person: el.principalId + "," + el.principalName,
+              col_start: el.allowEditingColumns.split(",")[0],
+              col_end:
+                el.allowEditingColumns.split(",")[
+                  el.allowEditingColumns.split(",").length - 1
+                ],
+              row_start: el.rowNum.split(",")[0],
+              row_end: el.rowNum.split(",")[el.rowNum.split(",").length - 1],
+            })),
+          };
+        }
+        // this.form = {
+        //   ...this.form,
+        //   type: type,
+        //   array: allowEditingColumns ? allowEditingColumns.split(",") : [],
+        //   charge: list.map(({ principalId, principalName, rowNum }) => ({
+        //     value: `${principalId},${principalName}`,
+        //     key: rowNum.split(","),
+        //   })),
+        // };
+        // this.form = {};
         this.row_list =
           this.type === "edit"
             ? rowNum.split(",").map((element) => JSON.parse(element) - 1)
@@ -350,7 +393,6 @@ export default {
         }
         return true;
       } else if (permission_type === 1) {
-        console.log("特殊权限");
         // 特殊权限
         let flag = 1;
         const { charge } = this.form;
@@ -473,13 +515,30 @@ export default {
       );
     },
     async handleAddAuth({ id }) {
-      const object = {};
-      const { array, charge, type } = this.form;
-      charge.map(({ key, value }) => {
-        if (key && value) {
-          object[key] = value;
-        }
-      });
+      // 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 { col_start, col_end, row_start, row_end } = this.form;
+        reqdata.allowEditingColumns = this.paramsArr(col_start, col_end);
+        reqdata.rowNum = this.paramsArr(row_start, row_end);
+      } else {
+        const { charge } = this.form;
+        //  特殊权限
+        reqdata.specialAuth = charge.map((el) =>
+          JSON.stringify({
+            allowEditingColumns: this.paramsArr(el.col_start, el.col_end),
+            rowNum: this.paramsArr(el.row_start, el.row_end),
+            principalId: el.person.split(",")[0],
+            principalName: el.person.split(",")[1],
+          })
+        );
+      }
       await this.$http({
         url: this.id
           ? "/market/CMKFileTemplateAuthority/CMKFileTemplateAuthorityUpdate"
@@ -488,12 +547,7 @@ export default {
         headers: {
           "Content-Type": "application/json",
         },
-        data: {
-          allowEditingColumns: array.join(","),
-          auth: JSON.stringify(object),
-          templateId: id,
-          type,
-        },
+        data: reqdata,
       });
       this.$message.success("操作成功");
     },
@@ -543,7 +597,7 @@ export default {
       this.$refs["form"].validate((valid) => {
         if (valid) {
           if (this.handleForbid()) {
-            this.$message.error("请选择负责人编辑权限");
+            this.$message.error("请完善可编辑信息");
             return false;
           }
           this.handleVisible();
@@ -555,6 +609,18 @@ export default {
         }
       });
     },
+    // 通用方法用于转化全局
+    paramsArr(start, end) {
+      const arr = [];
+      console.log(start, end);
+      for (let i = Number(start); i <= Number(end); i++) {
+        arr.push(i);
+      }
+      return arr.join(",");
+    },
+    filterName(id, arr) {
+      return arr.filter((el) => el.secLeaderLogin === id)[0].secLeaderName;
+    },
     handleCharge(type) {
       switch (type) {
         case "add":

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

@@ -2,11 +2,11 @@
  * @Author       : yuanrunwei
  * @Date         : 2021-11-01 18:02:58
  * @LastEditors: Please set LastEditors
- * @LastEditTime: 2022-01-06 17:50:58
+ * @LastEditTime: 2022-01-07 19:02:35
  * @FilePath     : \spfm-market-front\src\pages\main\performance\components\table.vue
 -->
 <template>
-  <el-table class="simple-table" :data="computed_list" v-loading="loading" >
+  <el-table class="simple-table" :data="computed_list" v-loading="loading">
     <el-table-column
       v-for="(
         { props, label, type, width, align, children, dictionary }, index
@@ -33,7 +33,10 @@
         <div v-else-if="type === 'date'">
           <div>{{ $formatDate(scope.row[props], "YYYY-MM-DD") }}</div>
         </div>
-        <div v-if="type === 'number'">{{scope.$index+1}}</div>
+        <div v-else-if="type === 'time'">
+          <div>{{ $formatDate(scope.row[props], "YYYY-MM-DD HH:00:00") }}</div>
+        </div>
+        <div v-if="type === 'number'">{{ scope.$index + 1 }}</div>
         <div v-else-if="type === 'click'">
           <div
             class="simple-table-click cursor-pointer"

+ 41 - 24
src/pages/main/performance/department.vue

@@ -116,6 +116,7 @@
           </div>
           <div v-else-if="type === '2'">
             <el-button @click="handleTurn('finish')">结束</el-button>
+            <el-button @click="handleTurn('back')">退回</el-button>
             <el-button @click="handleTurn('back')">打回</el-button>
             <el-button @click="handleTurn('transfer')" type="primary"
               >转总经理审批</el-button
@@ -159,7 +160,7 @@
             </el-option>
           </el-select>
         </el-form-item>
-        <el-form-item label="可编辑行" prop="rows">
+        <el-form-item label="可编辑行" prop="col_start">
           <div class="form-select">
             <span class="form-content">从</span>
             <el-input v-model="transfer_form.col_start" />
@@ -180,7 +181,7 @@
             </el-option>
           </el-select> -->
         </el-form-item>
-        <el-form-item label="可编辑列" prop="rows">
+        <el-form-item label="可编辑列" prop="row_start">
           <div class="form-select">
             <span class="form-content">从</span>
             <el-input v-model="transfer_form.row_start" />
@@ -338,13 +339,20 @@ export default {
             trigger: "change",
           },
         ],
-        rows: [
+        col_start: [
           {
             required: true,
             message: "请选择行",
             trigger: "change",
           },
         ],
+        row_start: [
+          {
+            required: true,
+            message: "请选择列",
+            trigger: "change",
+          },
+        ],
       },
       // 审批意见
       approveForm: { comments: "" },
@@ -357,9 +365,9 @@ export default {
           type: "input",
         },
         {
-          label: "下发月份",
+          label: "截止时间",
           props: "issuedDate",
-          type: "month",
+          type: "datetime",
         },
         {
           label: "状态",
@@ -432,7 +440,7 @@ export default {
         {
           label: "截止时间",
           props: "endTime",
-          type: "date",
+          // type: "time",
         },
         {
           label: "发起人",
@@ -504,9 +512,18 @@ export default {
     },
     // 搜索事件
     handleSearch(data) {
-      this.table_search = data;
+      this.table_search = {
+        ...data,
+        issuedDate: data.issuedDate
+          ? this.$formatDate(data.issuedDate, "YYYY-MM-DD HH:00:00")
+          : data.issuedDate,
+      };
       this.page = 1;
-      this.handleInit({ ...data, page: this.page, pageSize: this.rows });
+      this.handleInit({
+        ...this.table_search,
+        page: this.page,
+        pageSize: this.rows,
+      });
     },
     // 编辑按钮
     handleEdit(row) {
@@ -645,22 +662,22 @@ export default {
           }));
         // 可编辑行
       });
-      await this.$http({
-        url: "/market/CMKIssued/CMKIssuedRow",
-        method: "post",
-        headers: {
-          "Content-Type": "application/json",
-        },
-        data: {
-          id: this.edit_form.id,
-        },
-      }).then(({ data }) => {
-        console.log(data);
-        this.transfer_rows = data.map((el) => ({
-          label: el,
-          value: el,
-        }));
-      });
+      // await this.$http({
+      //   url: "/market/CMKIssued/CMKIssuedRow",
+      //   method: "post",
+      //   headers: {
+      //     "Content-Type": "application/json",
+      //   },
+      //   data: {
+      //     id: this.edit_form.id,
+      //   },
+      // }).then(({ data }) => {
+      //   console.log(data);
+      //   // this.transfer_rows = data.map((el) => ({
+      //   //   label: el,
+      //   //   value: el,
+      //   // }));
+      // });
       this.transfer_visible = true;
     },
     handleTurn(type) {

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

@@ -61,7 +61,7 @@
             trigger: 'change',
           }"
         >
-          <el-date-picker v-model="issue_form.endTime" type="date">
+          <el-date-picker v-model="issue_form.endTime" type="datetime" format="yyyy-MM-dd HH">
           </el-date-picker>
         </el-form-item>
       </el-form>
@@ -255,7 +255,7 @@ export default {
             },
             data: {
               ...this.issue_form,
-              endTime: this.$formatDate(this.issue_form.endTime, "YYYY-MM-DD"),
+              endTime: this.$formatDate(this.issue_form.endTime, "YYYY-MM-DD HH:00:00"),
               templateId: this.issue_id,
             },
           }).then(() => {