浏览代码

替换成字母

daiqisheng 3 年之前
父节点
当前提交
51b6bf759e
共有 1 个文件被更改,包括 44 次插入20 次删除
  1. 44 20
      src/pages/main/performance/components/sheet.vue

+ 44 - 20
src/pages/main/performance/components/sheet.vue

@@ -1,8 +1,8 @@
 <!--
  * @Author       : yuanrunwei
  * @Date         : 2021-12-04 14:23:58
- * @LastEditors: Please set LastEditors
- * @LastEditTime: 2022-02-10 19:30:09
+ * @LastEditors: daiqisheng
+ * @LastEditTime: 2022-02-14 14:48:49
  * @FilePath     : \spfm-market-front\src\pages\main\performance\components\sheet.vue
 -->
 <template>
@@ -117,11 +117,13 @@
                   <span class="form-content">可编辑行:从</span>
                   <el-input
                     v-model="item.row_start"
+                    @input="(params) => handleInput(index, 'row_start', params)"
                     :disabled="type !== 'edit'"
                   />
                   <span class="form-content">到</span>
                   <el-input
                     v-model="item.row_end"
+                    @input="(params) => handleInput(index, 'row_end', params)"
                     :disabled="type !== 'edit'"
                   />
                 </div>
@@ -130,13 +132,12 @@
                   <el-input
                     :disabled="type !== 'edit'"
                     v-model="item.col_start"
-                    @input="(params) => handleInput(index, 'col_start', params)"
                   />
+                  <!-- @input="(params) => handleInput(index, 'col_start', params)" -->
                   <span class="form-content">到</span>
                   <el-input
                     :disabled="type !== 'edit'"
                     v-model="item.col_end"
-                    @input="(params) => handleInput(index, 'col_end', params)"
                   />
                 </div>
               </div>
@@ -310,8 +311,11 @@ export default {
     //     console.log(e,'e');
     // },
     handleAllow({ row, column }) {
-      let public_permisson = (!this.form.permission_type||this.status==='2') && this.type === "edit";
-      let editable = this.row_list.includes(row) && this.column_list.includes(column);
+      let public_permisson =
+        (!this.form.permission_type || this.status === "2") &&
+        this.type === "edit";
+      let editable =
+        this.row_list.includes(row) && this.column_list.includes(column);
       let totalBoolean = (public_permisson || editable) && this.id;
       return totalBoolean;
     },
@@ -406,12 +410,21 @@ export default {
                 .split(",")
                 .map((element) => JSON.parse(element) - 1)
             : [];
-        this.column_list =
-          this.type === "edit" && list[0].allowEditingColumns
-            ? list[0].allowEditingColumns
+        if (this.type === "edit" && list[0].allowEditingColumns) {
+          this.column_list = list[0].allowEditingColumns
+            .split(",")
+            .map((element) => JSON.parse(element) - 1);
+          this.column_list = list[0].allowEditingColumnsFlag
+            ? list[0].allowEditingColumnsShuzi
                 .split(",")
                 .map((element) => JSON.parse(element) - 1)
-            : [];
+            : list[0].allowEditingColumns
+                .split(",")
+                .map((element) => JSON.parse(element) - 1);
+        } else {
+          this.column_list = [];
+        }
+        // this.formateNumber(list[0].allowEditingColumns);
       }
       this.handleCreate({
         json: templateContent ? JSON.parse(templateContent) : {},
@@ -419,6 +432,10 @@ export default {
         type: "json",
       });
     },
+    // formateNumber(String) {
+    //   console.log(String, "daa");
+    //   if(String.split(','))
+    // },
     handleForbid() {
       // const object = {};
       const { permission_type } = this.form;
@@ -562,7 +579,9 @@ export default {
           })
         );
       }
-      await this.$http({
+      const {
+        data: { result, desc },
+      } = await this.$http({
         url: this.id
           ? "/market/CMKFileTemplateAuthority/CMKFileTemplateAuthorityUpdate"
           : "/market/CMKFileTemplateAuthority/CMKFileTemplateAuthorityAdd",
@@ -572,7 +591,12 @@ export default {
         },
         data: reqdata,
       });
-      this.$message.success("操作成功");
+      if (result) {
+        this.$message.error(desc);
+      } else {
+        this.$message.success(desc);
+      }
+      return result;
     },
     async handleSave(type) {
       let edit_url = "";
@@ -608,7 +632,7 @@ export default {
             status: type,
           },
         });
-        this.handleAddAuth({ id: body });
+        await this.handleAddAuth({ id: body });
         this.$emit("save");
       } else {
         // 职位
@@ -724,19 +748,17 @@ export default {
         return false;
       }
     },
-    handleAuth() {
+    async handleAuth() {
       this.$refs["form"].validate((valid) => {
         if (valid) {
           if (this.handleForbid()) {
             this.$message.error("请完善可编辑信息");
             return false;
           }
-          this.handleVisible();
           if (this.id) {
             this.handleAddAuth({ id: this.id });
-          } else {
-            this.$message.success("设置成功");
           }
+          this.handleVisible();
         }
       });
     },
@@ -767,14 +789,16 @@ export default {
       }
     },
     handleVisible() {
-      console.log(this.form, "aada");
       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("请输入纯数字");
+        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) {