daiqisheng 3 lat temu
rodzic
commit
77668b7091

+ 7 - 140
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-23 19:07:42
+ * @LastEditTime: 2022-01-23 19:41:44
  * @FilePath     : \spfm-market-front\src\pages\main\performance\components\sheet.vue
 -->
 
@@ -81,18 +81,6 @@
                 ></el-option>
               </el-select>
             </div>
-            <!-- <div class="form-input">
-              <span class="form-content"> 可编辑行:从</span>
-              <el-input v-model="form.col_start" />
-              <span class="form-content">到</span
-              ><el-input v-model="form.col_end" />
-            </div>
-            <div class="form-input">
-              <span class="form-content">可编辑列:从</span>
-              <el-input v-model="form.row_start" />
-              <span class="form-content">到</span>
-              <el-input v-model="form.row_end" />
-            </div> -->
           </el-form-item>
           <el-form-item>
             <el-radio :label="1"><span>特殊权限:</span></el-radio>
@@ -145,93 +133,6 @@
             </div>
           </el-form-item>
         </el-radio-group>
-        <!-- <el-form-item
-                    label="可编辑列"
-                    prop="array"
-                    ><el-select
-                        v-model="form.array"
-                        placeholder="可编辑列"
-                        multiple
-                    >
-                        <el-option
-                            v-for="(value, index) in 10"
-                            :key="index"
-                            :label="index + 1"
-                            :value="index + 1"
-                        >
-                        </el-option> </el-select
-                ></el-form-item>
-                <el-form-item
-                    label="权限规则"
-                    prop="type"
-                    :rules="{
-                        required: true,
-                        message: '权限规则不能为空',
-                        trigger: 'change',
-                    }"
-                >
-                    <el-select v-model="form.type">
-                        <el-option
-                            v-for="item in type_options"
-                            :key="item.value"
-                            :label="item.label"
-                            :value="item.value"
-                        ></el-option> </el-select
-                ></el-form-item>
-                <el-form-item
-                    label="负责人"
-                    prop="charge"
-                    :rules="{
-                        required: true,
-                        message: '负责人不能为空',
-                        trigger: 'blur',
-                    }"
-                >
-                    <div
-                        class="flex-justify-start"
-                        v-for="(item, index) in form.charge"
-                        :key="index"
-                    >
-                        <el-select
-                            v-model="item.key"
-                            class="margin-bottom-20 margin-right-10 flex-1"
-                            placeholder="请选择指定列/行"
-                            multiple
-                        >
-                            <el-option
-                                v-for="(value, index) in 10"
-                                :key="index"
-                                :label="index + 1"
-                                :value="index + 1"
-                            >
-                            </el-option>
-                        </el-select>
-                        <el-select
-                            class="margin-bottom-20"
-                            placeholder="请选择负责人"
-                            v-model="item.value"
-                            filterable
-                        >
-                            <el-option
-                                v-for="({ label, value }, index) in charge_list"
-                                :key="index"
-                                :label="label"
-                                :value="value"
-                            ></el-option>
-                        </el-select>
-                    </div>
-
-                    <div>
-                        <el-button @click.prevent="handleCharge('add')"
-                            >添加</el-button
-                        >
-                        <el-button
-                            v-if="form.charge.length - 1"
-                            @click.prevent="handleCharge('delete')"
-                            >删除</el-button
-                        >
-                    </div>
-                </el-form-item> -->
       </el-form>
       <template v-if="id && status !== '2'" v-slot:footer><div></div></template>
     </simple-dialog>
@@ -389,7 +290,7 @@ export default {
       return (
         (!this.form.permission_type && this.type === "edit") ||
         (this.row_list.includes(row) && this.column_list.includes(column)) ||
-        (!(this.status === "2" && this.type === "edit"))
+        (this.status === "2" && this.type === "edit")
       );
     },
     async handleQuery() {
@@ -477,16 +378,6 @@ export default {
             })),
           };
         }
-        // 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" && list[0].rowNum
             ? list[0].rowNum
@@ -535,32 +426,6 @@ export default {
       } else {
         return true;
       }
-      //  form: {
-      //   charge: [
-      //     {
-      //       person: "",
-      //       col_start: "",
-      //       col_End: "",
-      //       row_start: "",
-      //       row_end: "",
-      //     },
-      //   ],
-      //   array: [],
-      //   type: null,
-      //   permission_type: 0,
-      //   col_start: "",
-      //   col_end: "",
-      //   row_start: "",
-      //   row_end: "",
-      // },
-
-      // charge.map(({ key }) => {
-      //   console.log(key);
-      //   // if (key && value) {
-      //   //   object[key] = value;
-      //   // }
-      // });
-      // return !(Object.keys(object).length && type);
     },
     async handleCreate({ file, json, type, name } = {}) {
       let that = this;
@@ -729,13 +594,13 @@ export default {
           if (type === "2") {
             // 暂存
             await this.$http({
-              url: "/CMKFileTemplate/UptateCMKFileTemplateById", // 新增
+              url: "/market/CMKFileTemplate/UptateCMKFileTemplateById", // 新增
               method: "post",
               headers: {
                 "Content-Type": "application/json",
               },
               data: {
-                id: this.template_id,
+                templateId: this.id,
                 templateContent: JSON.stringify(data),
                 templateName: workbook_name,
                 status: type,
@@ -917,11 +782,13 @@ export default {
           "Content-Type": "application/json",
         },
         data: {
-          template_id: this.id,
+          templateId: this.id,
           templateContent: JSON.stringify(data),
           templateName: workbook_name,
           status: "0",
         },
+      }).then(() => {
+        this.$emit("save");
       });
     },
     handleChargeList() {

+ 13 - 7
src/pages/main/performance/department.vue

@@ -90,6 +90,7 @@
               : 'view'
           "
           attribute="file"
+          status="10"
           @save="handleSave"
         />
         <!-- <analysis
@@ -687,13 +688,18 @@ export default {
     handleCheck(row) {
       console.log(row, "row");
       this.edit_form = row;
-      this.menager_visible = true;
-      this.receiverList = row.receiverName
-        ? row.receiverId.split(",").map((el, index) => ({
-            label: row.receiverName.split(",")[index],
-            value: el,
-          }))
-        : [];
+      if (row.receiverId && row.receiverId.split(",").length > 1) {
+        this.menager_visible = true;
+        this.receiverList = row.receiverName
+          ? row.receiverId.split(",").map((el, index) => ({
+              label: row.receiverName.split(",")[index],
+              value: el,
+            }))
+          : [];
+      } else {
+        this.id = row.id;
+        this.visible = true;
+      }
     },
     confirmManger() {
       this.visible = true;