ソースを参照

Merge branch 'dev_info' into 'master'

Dev info

See merge request spfm/spfm-market-front!151
徐兴安 2 年 前
コミット
5fff5cf5fc

+ 7 - 7
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-25 19:11:41
+ * @LastEditTime: 2022-05-10 11:24:05
  * @FilePath     : \spfm-market-front\src\pages\main\performance\components\sheet.vue
 -->
 <template>
@@ -448,10 +448,8 @@ export default {
             return time.getTime() > value.getTime();
           },
         };
-        if (
-          this.superviseForm.write &&
-          value.getTime() < this.superviseForm.write.getTime()
-        ) {
+        let write = new Date(this.superviseForm.write).getTime();
+        if (this.superviseForm.write && value.getTime() < write) {
           this.superviseForm.endTime = "";
         }
       } else {
@@ -532,6 +530,7 @@ export default {
           endTime: distributeEndTime, // 截止时间
         };
       }
+      console.log(this.superviseForm, "this.superviseForm");
       this.templateType = templateType;
       this.template_id = templateId;
       this.issued_id = issuedId;
@@ -626,7 +625,8 @@ export default {
             3;
         if (filled) {
           let time = new Date().getTime();
-          if (time > this.superviseForm.endTime.getTime()) {
+          let endTime = new Date(this.superviseForm.endTime).getTime();
+          if (time > endTime) {
             this.$message.error("截止时间不能小于当前时间");
             return;
           }
@@ -713,7 +713,7 @@ export default {
           ]) {
             if (!that.handleAllow({ row, column })) {
               that.$message.error("您没有编辑权限");
-              return false
+              return false;
             }
           },
           updated: function ({ range }) {

+ 52 - 17
src/pages/main/performance/department.vue

@@ -83,9 +83,6 @@
           status="10"
           @save="handleSave"
         />
-        <!-- <analysis
-          :edit="edit_form.department_status === '待处理' && edit_visible"
-        /> -->
       </template>
       <template v-slot:footer><div></div></template>
     </simple-dialog>
@@ -211,7 +208,7 @@
                 ></el-option>
               </el-select>
             </div>
-            <div v-if="permission_type === 2">
+            <!-- <div v-if="permission_type === 2">
               <span class="form-content">可编辑列:</span>
               <el-select
                 class="margin-bottom-20 margin-right-10"
@@ -227,7 +224,7 @@
                   :value="item"
                 ></el-option>
               </el-select>
-            </div>
+            </div> -->
           </div>
         </el-form-item>
         <div>
@@ -735,7 +732,6 @@ export default {
     },
     // 查看按钮
     handleCheck(row) {
-      console.log(row, "row");
       this.edit_form = row;
       this.edit_visible = false;
       this.id = row.id;
@@ -812,11 +808,19 @@ export default {
     handleCharge(type) {
       switch (type) {
         case "add":
-          this.transfer_form.charge.push({
-            person: "",
-            allowEditingColumns: [],
-            rowNum: [],
-          });
+          if (
+            this.transfer_form.charge[this.transfer_form.charge.length - 1]
+              .rowNum.length
+          ) {
+            this.transfer_form.charge.push({
+              person: "",
+              allowEditingColumns: [],
+              rowNum: [],
+            });
+          } else {
+            this.$message.error("请先选择需要转派的列");
+          }
+
           break;
         case "delete":
           this.transfer_form.charge.pop();
@@ -852,13 +856,24 @@ export default {
       } else if (permission_type === 2) {
         // 特殊权限
         console.log(permission_type, "permission_type");
-        charge.forEach((el) => {
-          if (el.person && el.allowEditingColumns.length && el.rowNum.length) {
+        if (this.transfer_form.charge.length === 1) {
+          charge.forEach((el) => {
+            if (el.person) {
+              flag = flag * 1;
+            } else {
+              flag = flag * 0;
+            }
+          });
+        } else if (this.transfer_form.charge.length > 1) {
+          if (
+            this.transfer_form.charge[this.transfer_form.charge.length - 1]
+              .rowNum.length
+          ) {
             flag = flag * 1;
           } else {
             flag = flag * 0;
           }
-        });
+        }
       }
       return flag;
     },
@@ -881,8 +896,14 @@ export default {
             } else if (this.permission_type === 2) {
               params.transferAuthority = charge.map((el) =>
                 JSON.stringify({
-                  allowEditingColumns: el.allowEditingColumns.join(","),
-                  rowNum: el.rowNum.join(","),
+                  allowEditingColumns: this.transfer_cols_orgin.join(","),
+                  rowNum: el.rowNum.length
+                    ? el.rowNum
+                        .sort(function (a, b) {
+                          return a - b;
+                        })
+                        .join(",")
+                    : this.transfer_rows_orgin.join(","),
                   principalId: el.person.split(",")[0],
                   principalName: el.person.split(",")[1],
                 })
@@ -907,12 +928,26 @@ export default {
                   page: this.page,
                   pageSize: this.rows,
                 });
+                this.transfer_form.charge = [
+                  {
+                    person: "",
+                    allowEditingColumns: [],
+                    rowNum: [],
+                  },
+                ];
                 this.handleCancel("visible");
               }
             });
             console.log(params, "this.transfer_form");
           } else {
-            this.$message.error("请填写必要的信息");
+            if (
+              !this.transfer_form.charge[this.transfer_form.charge.length - 1]
+                .rowNum.length
+            ) {
+              this.$message.error("请填写完整可编辑行");
+            } else {
+              this.$message.error("请填写必要的信息");
+            }
           }
         }
       });