Browse Source

修改逻辑

lex 2 years ago
parent
commit
ca6855e029

+ 47 - 38
src/views/baseRulesManager/components/otherRules.vue

@@ -18,15 +18,16 @@
             :rules="[
               {
                 required: false,
-                pattern:
-                  /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
-                message: '请输入正确的人数',
-              },
+                pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
+                message: '请输入正确的人数'
+              }
             ]"
           >
             基本课酬:
             <el-input v-model="form['91']" placeholder="请输入金额">
-              <template slot="append">元</template>
+              <template slot="append"
+                >元</template
+              >
             </el-input>
           </el-form-item>
         </el-row>
@@ -36,15 +37,16 @@
             :rules="[
               {
                 required: false,
-                pattern:
-                  /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
-                message: '请输入正确的人数',
-              },
+                pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
+                message: '请输入正确的人数'
+              }
             ]"
           >
             全职资源公摊金额:
             <el-input v-model="form['73']" placeholder="请输入金额">
-              <template slot="append">元</template>
+              <template slot="append"
+                >元</template
+              >
             </el-input>
           </el-form-item>
         </el-row>
@@ -111,7 +113,7 @@
             />
           </el-form-item>
         </el-row> -->
-        <el-row>
+        <!-- <el-row>
           <el-form-item prop="115">
             支持考级活动报名的分部编号
             <el-input
@@ -149,7 +151,7 @@
             >
             </el-date-picker>
           </el-form-item>
-        </el-row>
+        </el-row> -->
         <!-- <el-row>
           <el-form-item
             prop="203"
@@ -178,13 +180,15 @@
               {
                 required: false,
                 pattern: /^[1-9][0-9]*$/,
-                message: '请输入正确的分钟数',
-              },
+                message: '请输入正确的分钟数'
+              }
             ]"
           >
             云教室可提前:
             <el-input v-model="form['61']" placeholder="请输入分钟数">
-              <template slot="append">分钟</template>
+              <template slot="append"
+                >分钟</template
+              >
             </el-input>
             进入教室。
           </el-form-item>
@@ -196,33 +200,38 @@
               {
                 required: false,
                 pattern: /^[1-9][0-9]*$/,
-                message: '请输入正确的分钟数',
-              },
+                message: '请输入正确的分钟数'
+              }
             ]"
           >
             课程结束后:
             <el-input v-model="form['60']" placeholder="请输入分钟数">
-              <template slot="append">分钟</template>
+              <template slot="append"
+                >分钟</template
+              >
             </el-input>
             网络教室自动关闭。
           </el-form-item>
         </el-row>
         <el-row>
-
           <el-form-item
             prop="232"
             :rules="[
               {
                 required: true,
-                message: '请输入系统消息用户编号',
-              },
+                message: '请输入系统消息用户编号'
+              }
             ]"
           >
-              系统消息用户编号:
-            <el-input class="marginLR5"  style="width: 180px"  v-model="form['232']" placeholder="请输入系统消息用户编号">
-
-            </el-input>。
-
+            系统消息用户编号:
+            <el-input
+              class="marginLR5"
+              style="width: 180px"
+              v-model="form['232']"
+              placeholder="请输入系统消息用户编号"
+            >
+            </el-input
+            >。
           </el-form-item>
         </el-row>
       </el-form>
@@ -249,7 +258,7 @@
 import {
   getSysTenantConfig,
   questionnaireTopicQueryPage,
-  setSysTenantConfig,
+  setSysTenantConfig
 } from "@/views/courseRulersManager/api";
 import { sysConfigList, sysConfigUpdate } from "@/api/generalSettings"; // 平台的修改和查
 export default {
@@ -258,17 +267,17 @@ export default {
     return {
       form: {},
       questionList: [],
-      rulesVisiable: false,
+      rulesVisiable: false
     };
   },
   async mounted() {
     this.getRules();
     try {
       const res = await questionnaireTopicQueryPage({ page: 1, rows: 999 });
-      this.questionList = res.data.rows.map((item) => {
+      this.questionList = res.data.rows.map(item => {
         return {
           label: item.title,
-          value: String(item.id),
+          value: String(item.id)
         };
       });
     } catch (e) {
@@ -286,7 +295,7 @@ export default {
     async getPlatformRules() {
       try {
         const res = await sysConfigList({ group: "DAYA_BASIC" });
-        res.data.forEach((item) => {
+        res.data.forEach(item => {
           // this.form[item.paramName] = item.paranValue
           this.$set(this.form, item.id, item.paranValue);
         });
@@ -299,7 +308,7 @@ export default {
     async getInstitutionRules() {
       try {
         const res = await getSysTenantConfig({ group: "DAYA_BASIC" });
-        res.data.forEach((item) => {
+        res.data.forEach(item => {
           // this.form[item.paramName] = item.paranValue
           this.$set(this.form, item.id, item.paranValue);
         });
@@ -310,13 +319,13 @@ export default {
       }
     },
     savePlatform() {
-      this.$refs.form.validate(async (valid) => {
+      this.$refs.form.validate(async valid => {
         if (valid) {
           let param = [];
           for (let i in this.form) {
             param.push({
               id: i,
-              paranValue: this.form[i],
+              paranValue: this.form[i]
             });
           }
           try {
@@ -330,13 +339,13 @@ export default {
       });
     },
     saveInstitution() {
-      this.$refs.form.validate(async (valid) => {
+      this.$refs.form.validate(async valid => {
         if (valid) {
           let param = [];
           for (let i in this.form) {
             param.push({
               id: i,
-              paranValue: this.form[i],
+              paranValue: this.form[i]
             });
           }
           try {
@@ -355,8 +364,8 @@ export default {
       } else {
         this.saveInstitution();
       }
-    },
-  },
+    }
+  }
 };
 </script>
 <style lang="scss" scoped>

+ 14 - 12
src/views/levelManager/components/level-notice.vue

@@ -77,18 +77,20 @@
               @click="onChangeStatus(scope.row)"
               >{{ scope.row.status == 1 ? "停用" : "启用" }}</el-button
             >
-            <el-button
-              type="text"
-              v-if="$helpers.permission('degreeNews/update')"
-              @click="onOperation('update', scope.row)"
-              >修改</el-button
-            >
-            <el-button
-              type="text"
-              v-if="$helpers.permission('degreeNews/remove')"
-              @click="onRemove(scope.row)"
-              >删除</el-button
-            >
+            <template v-if="scope.row.status != 1">
+              <el-button
+                type="text"
+                v-if="$helpers.permission('degreeNews/update')"
+                @click="onOperation('update', scope.row)"
+                >修改</el-button
+              >
+              <el-button
+                type="text"
+                v-if="$helpers.permission('degreeNews/remove')"
+                @click="onRemove(scope.row)"
+                >删除</el-button
+              >
+            </template>
           </template>
         </el-table-column>
       </el-table>

+ 14 - 12
src/views/levelManager/components/level-regulations.vue

@@ -77,18 +77,20 @@
               @click="onChangeStatus(scope.row)"
               >{{ scope.row.status == 1 ? "停用" : "启用" }}</el-button
             >
-            <el-button
-              type="text"
-              v-if="$helpers.permission('degreeNews/update')"
-              @click="onOperation('update', scope.row)"
-              >修改</el-button
-            >
-            <el-button
-              type="text"
-              v-if="$helpers.permission('degreeNews/remove')"
-              @click="onRemove(scope.row)"
-              >删除</el-button
-            >
+            <template v-if="scope.row.status != 1">
+              <el-button
+                type="text"
+                v-if="$helpers.permission('degreeNews/update')"
+                @click="onOperation('update', scope.row)"
+                >修改</el-button
+              >
+              <el-button
+                type="text"
+                v-if="$helpers.permission('degreeNews/remove')"
+                @click="onRemove(scope.row)"
+                >删除</el-button
+              >
+            </template>
           </template>
         </el-table-column>
       </el-table>

+ 14 - 12
src/views/levelManager/components/student-rule.vue

@@ -93,18 +93,20 @@
               @click="onChangeStatus(scope.row)"
               >{{ scope.row.status == 1 ? "停用" : "启用" }}</el-button
             >
-            <el-button
-              type="text"
-              v-if="$helpers.permission('degreeNews/update')"
-              @click="onOperation('update', scope.row)"
-              >修改</el-button
-            >
-            <el-button
-              type="text"
-              v-if="$helpers.permission('degreeNews/remove')"
-              @click="onRemove(scope.row)"
-              >删除</el-button
-            >
+            <template v-if="scope.row.status != 1">
+              <el-button
+                type="text"
+                v-if="$helpers.permission('degreeNews/update')"
+                @click="onOperation('update', scope.row)"
+                >修改</el-button
+              >
+              <el-button
+                type="text"
+                v-if="$helpers.permission('degreeNews/remove')"
+                @click="onRemove(scope.row)"
+                >删除</el-button
+              >
+            </template>
           </template>
         </el-table-column>
       </el-table>

+ 1 - 1
src/views/levelManager/gradeManager.vue

@@ -67,7 +67,7 @@
       <el-button
         v-permission="'/teacherOperationAdd'"
         type="primary"
-        @click="onGradeOperation"
+        @click="onGradeOperation('create')"
         style="margin-bottom:20px"
       >
         新增考级

+ 29 - 20
src/views/levelManager/model/grade-operation.vue

@@ -60,6 +60,12 @@
           value-format="yyyy-MM-dd"
           placeholder="请选择考级开始日期"
           :picker-options="startBigin()"
+          :disabled="status != 'NOT_START'"
+          @change="
+            () => {
+              forms.endTime = null;
+            }
+          "
         ></el-date-picker>
       </el-form-item>
       <el-form-item
@@ -73,11 +79,6 @@
           value-format="yyyy-MM-dd"
           placeholder="请选择考级结束日期"
           :picker-options="beginDate()"
-          @change="
-            () => {
-              forms.endTime = null;
-            }
-          "
         ></el-date-picker>
       </el-form-item>
       <el-form-item
@@ -94,7 +95,7 @@
       </el-form-item>
     </el-form>
     <div slot="footer" class="dialog-footer">
-      <el-button @click="operationVisible = false">取 消</el-button>
+      <el-button @click="onClose()">取 消</el-button>
       <el-button type="primary" @click="onSubmit">确 定</el-button>
     </div>
   </el-dialog>
@@ -108,6 +109,7 @@ export default {
   data() {
     return {
       dialogTitle: "",
+      status: "NOT_START",
       dialogType: "create",
       operationVisible: false,
       forms: {
@@ -128,7 +130,7 @@ export default {
       return {
         firstDayOfWeek: 1,
         disabledDate(time) {
-          return dayjs(timer).valueOf() > dayjs(time).valueOf();
+          return dayjs(timer).valueOf() >= dayjs(time).valueOf();
         }
       };
     },
@@ -148,6 +150,7 @@ export default {
     },
     onClose() {
       this.$refs.elForm && this.$refs.elForm.resetFields();
+      this.status = "NOT_START";
       this.operationVisible = false;
     },
     onSubmit() {
@@ -170,26 +173,32 @@ export default {
             this.$message.success("修改成功");
           }
           this.operationVisible = false;
+          this.onClose();
           this.$emit("getList");
         } catch {}
       });
     },
     openDialog(type, row) {
+      console.log(type, row);
       this.dialogTitle = type === "update" ? "修改考级" : "新增考级";
-      this.dialogType = type;
-      if (type === "update") {
-        this.forms = {
-          id: row.id,
-          name: row.name,
-          organIds: row.organIds
-            ? row.organIds.split(",").map(value => Number(value))
-            : [],
-          startTime: row.startTime,
-          endTime: row.endTime,
-          registrationTime: row.registrationTime
-        };
-      }
+      this.dialogType = type || "create";
+
       this.operationVisible = true;
+      this.$nextTick(() => {
+        if (type === "update") {
+          this.status = row.status;
+          this.forms = {
+            id: row.id,
+            name: row.name,
+            organIds: row.organIds
+              ? row.organIds.split(",").map(value => Number(value))
+              : [],
+            startTime: row.startTime,
+            endTime: row.endTime,
+            registrationTime: row.registrationTime
+          };
+        }
+      });
     }
   }
 };

+ 29 - 28
src/views/levelManager/model/information-operation.vue

@@ -129,16 +129,15 @@ export default {
       this.forms.coverImage = data.data.url;
     },
     onClose() {
+      console.log(this.$refs.elForm, "this.$refs.elForm");
       this.$refs.elForm && this.$refs.elForm.resetFields();
       this.operationVisible = false;
     },
     onEditorChange(html) {
-      console.log(html, "html");
       this.forms.content = html;
     },
     onSubmit() {
       this.$refs.elForm.validate(async res => {
-        console.log(res, this.forms, "res");
         if (!res) return;
         try {
           const { organIds, ...other } = this.forms;
@@ -157,38 +156,40 @@ export default {
           }
 
           this.$emit("getList");
+          this.onClose();
           this.operationVisible = false;
         } catch {}
       });
     },
     openDialog(dialogType, type, row) {
-      if (type === "rule") {
-        this.dialogTitle = dialogType === "update" ? "修改风采" : "新增风采";
-        this.forms.type = "EXAMINEE_STYLE";
-        // EXAMINEE_STYLE("EXAMINEE_STYLE", "考生风采"),
-        // GRADE_EXAMINATION_BRIEF("GRADE_EXAMINATION_BRIEF", "考级简章"),
-        // GRADING_NOTICE("GRADING_NOTICE", "考级须知");
-      } else if (type === "regulations") {
-        this.dialogTitle = dialogType === "update" ? "修改简章" : "新增简章";
-        this.forms.type = "GRADE_EXAMINATION_BRIEF";
-      } else if (type === "notice") {
-        this.dialogTitle = dialogType === "update" ? "修改帮助" : "新增帮助";
-        this.forms.type = "GRADING_NOTICE";
-      }
-
-      this.dialogType = dialogType;
-      if (dialogType === "update") {
-        this.forms.title = row.title;
-        this.forms.content = row.content;
-        this.forms.coverImage = row.coverImage;
-        this.status = row.status;
-        this.forms.id = row.id;
-        this.forms.organIds = row.organIds
-          ? row.organIds.split(",").map(value => Number(value))
-          : [];
-      }
-      console.log(this.forms, "this.forms");
       this.operationVisible = true;
+      this.$nextTick(() => {
+        if (type === "rule") {
+          this.dialogTitle = dialogType === "update" ? "修改风采" : "新增风采";
+          this.forms.type = "EXAMINEE_STYLE";
+          // EXAMINEE_STYLE("EXAMINEE_STYLE", "考生风采"),
+          // GRADE_EXAMINATION_BRIEF("GRADE_EXAMINATION_BRIEF", "考级简章"),
+          // GRADING_NOTICE("GRADING_NOTICE", "考级须知");
+        } else if (type === "regulations") {
+          this.dialogTitle = dialogType === "update" ? "修改简章" : "新增简章";
+          this.forms.type = "GRADE_EXAMINATION_BRIEF";
+        } else if (type === "notice") {
+          this.dialogTitle = dialogType === "update" ? "修改帮助" : "新增帮助";
+          this.forms.type = "GRADING_NOTICE";
+        }
+
+        this.dialogType = dialogType;
+        if (dialogType === "update") {
+          this.forms.title = row.title;
+          this.forms.content = row.content;
+          this.forms.coverImage = row.coverImage;
+          this.status = row.status;
+          this.forms.id = row.id;
+          this.forms.organIds = row.organIds
+            ? row.organIds.split(",").map(value => Number(value))
+            : [];
+        }
+      });
     }
   }
 };

+ 1 - 0
src/views/levelManager/model/levelSettingAdd.vue

@@ -233,6 +233,7 @@ export default {
 
           this.$message.success("添加成功");
           this.updateVisible = false;
+          this.onClose();
           this.$emit("getList");
         } catch {}
       });

+ 12 - 8
src/views/levelManager/model/levelSettingUpdate.vue

@@ -142,6 +142,7 @@ export default {
           await degreeLevelFeeUpdate(this.forms);
           this.$message.success("修改成功");
           this.updateVisible = false;
+          this.onClose();
           this.$emit("getList");
         } catch {}
       });
@@ -155,20 +156,23 @@ export default {
       this.forms.level = "";
     },
     openDialog(row) {
-      this.forms = {
-        id: row.id,
-        degreeType: row.degreeType,
-        subjectId: row.subjectId ? Number(row.subjectId) : null,
-        level: row.level,
-        fee: row.fee,
-        credentials: row.credentials
-      };
       if (row.degreeType === "GRADE") {
         this.degreeLevel = degreeLevel;
       } else if (row.degreeType === "THEORY") {
         this.degreeLevel = degreeTheory;
       }
       this.updateVisible = true;
+
+      this.$nextTick(() => {
+        this.forms = {
+          id: row.id,
+          degreeType: row.degreeType,
+          subjectId: row.subjectId ? Number(row.subjectId) : null,
+          level: row.level,
+          fee: row.fee,
+          credentials: row.credentials
+        };
+      });
     }
   }
 };