Przeglądaj źródła

up:后台修改

yangdamao 3 lat temu
rodzic
commit
9f61ceb9e1
1 zmienionych plików z 66 dodań i 0 usunięć
  1. 66 0
      src/views/2Cport/referralManageMent/tab2/addGL.vue

+ 66 - 0
src/views/2Cport/referralManageMent/tab2/addGL.vue

@@ -62,6 +62,46 @@
               </el-option>
             </el-select>
           </el-form-item>
+                    <el-form-item
+          label=""
+          prop="majorId"
+          v-if="listData.businessId"
+        >
+          <el-select 
+            v-model="listData.majorId"
+            :disabled="listData.goodsList.length > 0"
+            placeholder="请选择专业">
+            <el-option
+              v-for="(item, index) in newMajorOption"
+              :key="index"
+              :label="item.categoryName"
+              :value="item.id"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item
+          label=""
+          prop="subjectIds"
+          v-if="listData.businessId"
+        >
+          <el-select
+            v-model="listData.subjectIds"
+            :disabled="listData.goodsList.length > 0"
+            placeholder="请选择科目"
+            multiple
+            collapse-tags
+          @change="subjectChanges"
+          >
+            <el-option
+              v-for="(item, index) in newSubjectOption"
+              :key="index"
+              :label="item.subjectName"
+              :value="item.id"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
           <div v-if="listData.businessId" style="margin-bottom: 10px">
             <p class="p_sty">
               <span style="color: red">注:推荐位最多显示15个商品</span>
@@ -244,6 +284,8 @@ export default {
         },
       ],
       newBusinessLevel: [],
+      newMajorOption: [],
+      newSubjectOption: [],
       activeNum: [], //已选商品ID
       newActiveNum: [],
       goodsList: [], //商品列表
@@ -261,6 +303,7 @@ export default {
             break;
           }
         }
+        this.getInitBabelList(val);
       }
     },
   },
@@ -298,6 +341,27 @@ export default {
     },
     loadingClose() {
       this.disabledBtn = false;
+    },
+      /**
+     * 根据条件获取院校、专业列表
+     */
+    getInitBabelList(val) {
+      /**
+       * 专业
+       */
+      this.$api
+        .inquireCourseMajor({ status: 1, businessId: val })
+        .then((res) => {
+          this.newMajorOption = res.rows;
+        });
+      /**
+       * 科目
+       */
+      this.$api
+        .inquireCourseSubject({ status: 1, businessId: val })
+        .then((res) => {
+          this.newSubjectOption = res.rows;
+        });
     },
     submitForm(formName) {
       this.$refs[formName].validate((valid) => {
@@ -381,6 +445,8 @@ export default {
       this.$api
         .inquireGoods({
           businessId: this.listData.businessId,
+           majorId: this.listData.majorId,
+          subjectIdList: this.listData.subjectIds,
           status: 1,
           goodsType: this.$parent.activeName === "first" ? 1 : 2,
         })