Ver Fonte

Merge branch '03/03GRADE' into test

lex-xin há 3 anos atrás
pai
commit
e4613d88b2

+ 35 - 23
src/views/teamBuild/modals/change-voice.vue

@@ -94,27 +94,31 @@
           kitGroupPurchaseTypeFormater[changeInfo.kitGroupPurchaseType]
         }}</span>
       </el-form-item>
-      <el-form-item
-        v-if="activeAccessories.length || groupList.length || changeInfo"
-        label="更换教辅"
-        prop="name"
-      >
-        <accessories
-          :list.sync="activeAccessories"
-          :groupList.sync="groupList"
-          @change="accessoriesChange"
-          v-if="!changeInfo"
-        />
-        <span v-else-if="changeInfo">{{ changeAccessoriesGoods }}</span>
-        <!-- <el-select style="width: 100%" v-model="form.accessories" clearable placeholder="请选择教辅">
-          <el-option
-            v-for="item in accessories"
-            :key="item.id"
-            :label="item.name"
-            :value="item.id">
-          </el-option>
-        </el-select> -->
-      </el-form-item>
+      <template >
+        <el-form-item
+          v-show="(courseViewType == 2 && form.musicalGoods == 'OWNED') || courseViewType != 2"
+          v-if="activeAccessories.length || groupList.length || changeInfo"
+          label="更换教辅"
+          class="is-required"
+        >
+          <accessories
+            :list.sync="activeAccessories"
+            :groupList.sync="groupList"
+            @change="accessoriesChange"
+            v-if="!changeInfo"
+          />
+          <span v-else-if="changeInfo">{{ changeAccessoriesGoods }}</span>
+          <!-- <el-select style="width: 100%" v-model="form.accessories" clearable placeholder="请选择教辅">
+            <el-option
+              v-for="item in accessories"
+              :key="item.id"
+              :label="item.name"
+              :value="item.id">
+            </el-option>
+          </el-select> -->
+        </el-form-item>
+      </template>
+
       <el-form-item label="查看链接" prop="name" v-if="changeInfo">
         <div class="viewlink">
           <el-tooltip
@@ -278,7 +282,7 @@ const typeAndprice = {
 };
 
 export default {
-  props: ["detail", "musicGroupId", "voiceList"],
+  props: ["detail", "musicGroupId", "voiceList", "courseViewType"],
   components: {
     accessories,
   },
@@ -406,7 +410,6 @@ export default {
     },
   },
   mounted() {
-    console.log(this.detail)
     if (this.detail && (this.detail.userId)) {
       this.fetchDetail();
     }
@@ -471,6 +474,11 @@ export default {
       this.musicalGoodsChange();
     },
     musicalGoodsChange(val) {
+      this.$refs["form"].clearValidate()
+      if(val != 'OWNED') {
+        this.selectAccessories = []
+        this.selectAccessoriesMoney = 0
+      }
       const item = this.musicalGoodsById[val];
       if (item) {
         this.musicalPrice = this.numFormat(
@@ -517,6 +525,10 @@ export default {
       this.$refs["form"].validate((valid) => {
         this.detail.subjectId
         if (valid) {
+          if(this.courseViewType == 2 && this.form.musicalGoods == 'OWNED' && this.selectAccessories && this.selectAccessories.length <= 0) {
+            this.$message.error('请至少选择一个教辅')
+            return
+          }
           subjectChangeAdd({
             changeCourseFee: this.numFormat(
               this.musicGroupSubjectPlanFee -

+ 3 - 0
src/views/teamBuild/signupList.vue

@@ -924,6 +924,7 @@
         @close="closeChangeVoice"
         @submited="getList"
         :detail.sync="rowDetail"
+        :courseViewType="courseViewType"
         :musicGroupId="id"
         :voiceList="leftList"
       />
@@ -1118,6 +1119,7 @@ export default {
       detail: null,
       gradeList: [],
       ischeckCanReg: false,
+      courseViewType: null, // 乐团模式
     };
   },
   created() {},
@@ -1173,6 +1175,7 @@ export default {
       getTeamBaseInfo({ musicGroupId: this.id }).then((res) => {
         if (res.code == 200) {
           this.organId = res.data.musicGroup.organId;
+          this.courseViewType = res.data.musicGroup.courseViewType;
           this.applyExpireDate = res.data.musicGroup.applyExpireDate;
           this.paymentExpireDate = res.data.musicGroup.paymentExpireDate;
         }