lex il y a 2 ans
Parent
commit
61f32abb12

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

@@ -143,6 +143,9 @@
                 @click="onGradeOperation('update', scope.row)"
                 >修改</el-button
               >
+              <el-button type="text" @click="onCreateQrCode(scope.row)"
+                >链接</el-button
+              >
             </template>
           </el-table-column>
         </el-table>
@@ -158,9 +161,14 @@
     </div>
 
     <gradeOperation ref="gradeOperation" @getList="getList" />
+
+    <!-- 预报名链接 -->
+    <qr-code v-model="codeStatus" title="考级报名链接" :codeUrl="qrCodeUrl" />
   </div>
 </template>
 <script>
+import { vaildStudentUrl } from "@/utils/validate";
+import qrCode from "@/components/QrCode/index";
 import pagination from "@/components/Pagination/index";
 import gradeOperation from "./model/grade-operation";
 import { degreePage } from "./levelManageApi";
@@ -168,10 +176,12 @@ import { getTimes } from "@/utils";
 import { levelStatusList } from "@/utils/searchArray";
 import dayjs from "dayjs";
 export default {
-  components: { pagination, gradeOperation },
+  components: { pagination, gradeOperation, qrCode },
   name: "helpCategory",
   data() {
     return {
+      codeStatus: false,
+      qrCodeUrl: null,
       levelStatusList,
       searchForm: {
         keyword: null,
@@ -230,6 +240,10 @@ export default {
     onGradeOperation(type, row) {
       const dialogType = type || "create";
       this.$refs.gradeOperation.openDialog(dialogType, row);
+    },
+    onCreateQrCode(row) {
+      this.codeStatus = true;
+      this.qrCodeUrl = vaildStudentUrl() + "/#/level-apply-new?id=" + row.id;
     }
   }
 };

+ 9 - 0
src/views/levelManager/model/information-operation.vue

@@ -68,7 +68,16 @@
         :rules="[{ required: true, message: '请输入内容' }]"
         prop="content"
       >
+        <el-input
+          v-if="forms.type === 'GRADING_NOTICE'"
+          v-model="forms.content"
+          maxlength="500"
+          placeholder="请输入内容"
+          type="textarea"
+          rows="5"
+        />
         <Editor
+          v-else
           :form="forms.content"
           id="EditorInformation"
           alias="EditorInformation"

+ 73 - 51
src/views/resetTeaming/modals/extra-class.vue

@@ -1,8 +1,5 @@
 <template>
-  <el-form
-    ref="form"
-    :model="list"
-  >
+  <el-form ref="form" :model="list">
     <el-table
       :data="form"
       style="width: 100%;text-alogn: center;"
@@ -12,15 +9,19 @@
         label="课程类型"
         prop="courseType"
         key="courseType"
-        width="150">
+        width="150"
+      >
         <template slot-scope="scope">
           <el-form-item
             :prop="'form.' + scope.$index + '.courseType'"
-            :rules="{ required: true, message: '请选择课程类型', trigger: 'change' }"
+            :rules="{
+              required: true,
+              message: '请选择课程类型',
+              trigger: 'change'
+            }"
           >
             <el-select
               style="width: 90%!important;"
-
               v-model="list.form[scope.$index].courseType"
               placeholder="课程类型"
               clearable
@@ -43,15 +44,19 @@
         v-if="isCommon"
         prop="isStudentOptional"
         key="isStudentOptional"
-        width="150">
+        width="150"
+      >
         <template slot-scope="scope">
           <el-form-item
             :prop="'form.' + scope.$index + '.isStudentOptional'"
-            :rules="{ required: true, message: '请选择是否可选', trigger: 'change' }"
+            :rules="{
+              required: true,
+              message: '请选择是否可选',
+              trigger: 'change'
+            }"
           >
             <el-select
               style="width: 90%!important;"
-
               v-model="list.form[scope.$index].isStudentOptional"
               placeholder="是否可选"
               :disabled="isDisabled"
@@ -71,16 +76,16 @@
         label="课程时长(分钟)"
         prop="courseTotalMinuties"
         key="courseTotalMinuties"
-        width="150">
+        width="150"
+      >
         <template slot-scope="scope">
           <el-form-item
             :prop="'form.' + scope.$index + '.courseTotalMinuties'"
             :rules="[
-              { required: true, message: '请输入课程时长', trigger: 'blur' },
+              { required: true, message: '请输入课程时长', trigger: 'blur' }
             ]"
           >
             <el-input-number
-
               style="width: 90%!important;"
               class="number-input"
               v-model="list.form[scope.$index].courseTotalMinuties"
@@ -98,7 +103,8 @@
         label="现价(元)"
         prop="courseCurrentPrice"
         key="courseCurrentPrice"
-        width="150">
+        width="150"
+      >
         <template slot="header">
           <p style="position: relative">
             现价(元)
@@ -118,7 +124,6 @@
           >
             <!-- $listeners.moneyChange -->
             <el-input-number
-
               style="width: 90%!important;"
               class="number-input"
               v-model="list.form[scope.$index].courseCurrentPrice"
@@ -134,14 +139,14 @@
       <el-table-column
         prop="courseOriginalPrice"
         key="courseOriginalPrice"
-        label="原价(元)">
+        label="原价(元)"
+      >
         <template slot-scope="scope">
           <el-form-item
             :prop="'form.' + scope.$index + '.courseOriginalPrice'"
             :rules="{ required: true, message: '请输入原价', trigger: 'blur' }"
           >
             <el-input-number
-
               style="width: 90%!important;"
               class="number-input"
               v-model="list.form[scope.$index].courseOriginalPrice"
@@ -153,11 +158,7 @@
           </el-form-item>
         </template>
       </el-table-column>
-      <el-table-column
-        v-if="clearable"
-        prop="close"
-        key="close"
-        width="60">
+      <el-table-column v-if="clearable" prop="close" key="close" width="60">
         <template slot-scope="scope">
           <i
             v-if="form.length > 1"
@@ -173,68 +174,89 @@
       plain
       v-if="!isCommon && $listeners.create"
       type="info"
-
       style="width: 100%;margin: 20px 0;"
       @click="$listeners.create"
-    >新增课程类型</el-button>
+      >新增课程类型</el-button
+    >
   </el-form>
 </template>
 <script>
-import { courseType, boolOptions } from '@/constant'
-import { objectToOptions } from '@/utils'
-import { classTimeList, array2object } from '@/utils/searchArray'
-import numeral from 'numeral'
-import MusicStore from '@/views/resetTeaming/store'
+import { courseType, boolOptions } from "@/constant";
+import { objectToOptions } from "@/utils";
+import { classTimeList, array2object } from "@/utils/searchArray";
+import numeral from "numeral";
+import MusicStore from "@/views/resetTeaming/store";
 export default {
-  props: ['form', 'isCommon', 'isDisabled', 'isUserType', 'courseUnitPriceSettingsByType', 'clearable'],
+  props: [
+    "form",
+    "isCommon",
+    "isDisabled",
+    "isUserType",
+    "courseUnitPriceSettingsByType",
+    "clearable"
+  ],
   data() {
     return {
       courseType,
       courseTypeOptions: this.courseUnitPriceSettingsByType,
-      boolOptionsOptions: objectToOptions(boolOptions),
-    }
+      boolOptionsOptions: objectToOptions(boolOptions)
+    };
   },
   computed: {
     list() {
       return {
         form: this.form
-      }
+      };
     },
     classTimeList() {
-      return array2object(classTimeList)
-    },
+      return array2object(classTimeList);
+    }
+  },
+  mounted() {
+    console.log(this.list, "list");
+    console.log(this.courseTypeOptions, "courseTypeOptions");
   },
   methods: {
     change(val) {
-      this.$listeners.moneyChange()
+      this.$listeners.moneyChange();
     },
     isOptionDisabled(key) {
-      const selected = this.form.map(item => item.courseType)
-      return selected.includes(key)
+      const selected = this.form.map(item => item.courseType);
+      return selected.includes(key);
     },
     getOldMoney(index) {
-      return numeral(this.list.form[index].courseTotalMinuties * this.list.form[index].unitPrice).format('0,0.00')
+      return numeral(
+        this.list.form[index].courseTotalMinuties *
+          this.list.form[index].unitPrice
+      ).format("0,0.00");
     },
     courseItemChange(item, index) {
-      this.$listeners.priceChange(item, index)
-      this.$refs.form.validateField(`form.${index}.courseTotalMinuties`)
+      this.$listeners.priceChange(item, index);
+      this.$refs.form.validateField(`form.${index}.courseTotalMinuties`);
     },
     validatorCourseTotalMinuties(index) {
       return (rule, value, callback) => {
-        const { courseType } = this.list.form[index]
-        if (courseType && value > 1 && this.classTimeList[courseType] &&  value < this.classTimeList[courseType]) {
-          callback(new Error(`单节课不得少于${this.classTimeList[courseType]}分钟`))
-          return
+        const { courseType } = this.list.form[index];
+        if (
+          courseType &&
+          value > 1 &&
+          this.classTimeList[courseType] &&
+          value < this.classTimeList[courseType]
+        ) {
+          callback(
+            new Error(`单节课不得少于${this.classTimeList[courseType]}分钟`)
+          );
+          return;
         }
-        callback()
-      }
+        callback();
+      };
     }
-  },
-}
+  }
+};
 </script>
 <style lang="less" scoped>
-.number-input{
-  ::v-deep  .el-input__inner {
+.number-input {
+  ::v-deep .el-input__inner {
     text-align: left;
   }
 }