소스 검색

vip加重置

1
mo 3 년 전
부모
커밋
04472e61df
1개의 변경된 파일75개의 추가작업 그리고 10개의 파일을 삭제
  1. 75 10
      src/views/buildVip/index.vue

+ 75 - 10
src/views/buildVip/index.vue

@@ -613,11 +613,15 @@
         </div>
       </div>
     </el-dialog>
-    <el-row>
-      <el-col>
-        <div class="okBtn" @click="submitInfo">{{ id ? "修改" : "确定" }}</div>
-      </el-col>
-    </el-row>
+
+    <div class="btnWrap">
+      <div class="okBtn" @click="submitInfo">{{ id ? "修改" : "确定" }}</div>
+
+      <div class="okBtn" style="background-color: #14928a" @click="resetFrom">
+        重置
+      </div>
+    </div>
+
     <!-- <div class="btnWrap"> -->
     <!-- <div class="closeBtn">
         取消
@@ -861,7 +865,7 @@ export default {
     // }, 100);
     // 判断一下有没有缓存
     let sotrage = JSON.parse(localStorage.getItem(`newVip`));
-    if (sotrage.leftForm?.classOrganId) {
+    if (sotrage?.leftForm?.classOrganId) {
       this.$confirm("检测到您有未提交的数据, 是否恢复?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
@@ -906,10 +910,71 @@ export default {
       // computationalBtn:this.computationalBtn,
     };
     localStorage.setItem(`newVip`, JSON.stringify(obj));
-
-    console.log("页面即将销毁");
   },
   methods: {
+    resetFrom() {
+      this.leftForm = {
+        // name: "",
+        teacher: "",
+        subject: "",
+        courseType: "",
+        activeType: "",
+        classNum: "",
+        classTime: "",
+        // signTimer:[],
+        signUpStart: "",
+        signUpEnd: "",
+        courseStartOnline: "",
+        courseStartOffline: "",
+        section: "",
+        courseStart: "",
+        courseEnd: "",
+        educationalTeacherId: "",
+        students: [],
+
+        classOrganId: "", // 课程分部
+      };
+      this.activeStudentList = [];
+      this.studentLimit = 0;
+      this.classTimeList = [];
+      this.centerForm = {
+        allCourseNum: "",
+        onlineCourseNum: 0,
+        offlineCourseNum: 0,
+        radio: "",
+      };
+      this.maskForm = {
+        type: "",
+        week: "",
+        startTime: "",
+        endTime: "",
+      };
+      this.rightForm = {
+        onlineCourse: "",
+        offlineCourse: "",
+        onlinePrice: "",
+        offlinePrice: "",
+        allPrice: "",
+      };
+      this.hasOnline = true;
+      this.hasOffline = true;
+      this.onlineSalary = ""; // 线上课课酬结算方式
+      this.offlineSalary = ""; // 线下课课酬结算方式
+      this.hotType = "";
+      this.attribute1 = "";
+      this.attribute2 = "";
+      this.attribute3 = "";
+      this.maxCourseNum = 0;
+      this.minCourseNum = 0;
+      this.salaryReadonlyFlag = ""; // 老师课酬是否可配
+      this.paymentReadonlyFlag = ""; // 课程单价是否可配
+      this.onlinelookList = []; // 展示课表线上
+      this.offlineLookList = []; // 展示课表线下
+      this.timeTable = []; // 真正的课表
+      this.giveNum = "";
+      this.$refs["leftForm"].resetFields();
+      localStorage.removeItem("newVip");
+    },
     async init() {
       if (this.$route.query.rules) {
         this.rules = this.$route.query.rules;
@@ -1573,7 +1638,7 @@ export default {
       // 新增
       createVip(obj).then((res) => {
         if (res.code == 200) {
-          localStorage.removeItem('newVip')
+          localStorage.removeItem("newVip");
           if (res.data == "ING") {
             this.$confirm(
               "课程提交成功,已提交运营主管审批,审批通过后,课程创建成功!",
@@ -1614,7 +1679,7 @@ export default {
             obj.allowOverstepActivityStudentNum = 1;
             createVip(obj).then((res) => {
               if (res.code == 200) {
-                  localStorage.removeItem('newVip')
+                localStorage.removeItem("newVip");
                 this.$message.success("提交成功");
                 this.$store.dispatch("delVisitedViews", this.$route);
                 this.$router.push({