Преглед изворни кода

班级合并学员班级设置

1
mo пре 4 година
родитељ
комит
878d878155

+ 4 - 2
src/components/remote-search/index.vue

@@ -77,18 +77,18 @@ export default {
         let flag;
         this.options = this.list.filter((item) => {
           flag =
-            item.userName.toLowerCase().indexOf(query.toLowerCase()) > -1 ||
+            item.userName.toLowerCase().indexOf(query.toString().toLowerCase()) > -1 ||
             item.userId == query;
           if (this.multiple) {
             return flag || this.value.includes(item.userId);
           } else {
+            console.log(query,this.value)
             return flag || item.userId == this.value;
           }
         });
       } else {
           try{
              await this.getList()
-             console.log(this.options)
           const optionids = this.options.map(item => item.userId)
 
           const valueItem = this.listById[this.value]
@@ -128,6 +128,8 @@ export default {
         } else {
           if (val && this.isFirst) {
             this.getOptions('')
+          }else{
+             this.getOptions(val)
           }
         }
       },

+ 56 - 17
src/views/teamDetail/componentClass/calenderStudentList.vue

@@ -10,7 +10,7 @@
     />
     <otherform :form="other" ref="other" />
     <el-table
-      :data="mergeInfoList"
+      :data="dataList"
       :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
       max-height="300px"
     >
@@ -28,22 +28,38 @@
       ></el-table-column>
       <el-table-column prop="phone" align="center" width="120" label="课程类型">
         <template slot-scope="scope">
-          <div>
-            {{ scope.row.courseType | coursesType }}
+          <div
+            v-for="(item, index) in scope.row.courseList"
+            :key="index"
+            class="courseDiv"
+          >
+            {{ item.courseType | coursesType }}
           </div>
         </template>
       </el-table-column>
-      <el-table-column prop="subjectNames" align="center" label="原价">
+      <el-table-column align="center" label="现价">
         <template slot-scope="scope">
-          <div>
-            <el-input v-model="scope.row.courseOriginalPrice"></el-input>
+          <div >
+            <div
+              class="courseDiv"
+              v-for="(item, index) in scope.row.courseList"
+              :key="index"
+            >
+              <el-input v-model="item.courseCurrentPrice"></el-input>
+            </div>
           </div>
         </template>
       </el-table-column>
-      <el-table-column align="center" label="现价">
+      <el-table-column prop="subjectNames" align="center" label="原价">
         <template slot-scope="scope">
           <div>
-            <el-input v-model="scope.row.courseCurrentPrice"></el-input>
+            <div
+              class="courseDiv"
+              v-for="(item, index) in scope.row.courseList"
+              :key="index"
+            >
+              <el-input v-model="item.courseOriginalPrice"></el-input>
+            </div>
           </div>
         </template>
       </el-table-column>
@@ -76,6 +92,7 @@ export default {
         paymentPattern: null,
       },
       other: {},
+      dataList: [],
     };
   },
   mounted() {
@@ -87,6 +104,7 @@ export default {
     for (let merge in this.mergeInfo) {
       this.mergeInfoList = this.mergeInfoList.concat(this.mergeInfo[merge]);
     }
+    this.concatCourseLst(this.mergeInfoList);
   },
   methods: {
     getCLassName(key) {
@@ -100,13 +118,12 @@ export default {
     },
     async submit() {
       let obj = {};
-      let some = this.getData()
-      console.log(some)
-      if(some){
+      let some = this.getData();
+      console.log(some);
+      if (some) {
         obj.musicGroupPaymentCalenderDtos = [some];
-
-      }else{
-        return
+      } else {
+        return;
       }
 
       obj.classGroupIds = this.classList.map((classes) => {
@@ -114,15 +131,14 @@ export default {
       });
       obj.masterClassGroupId = this.masterClassGroupId;
       obj.classGroupStudents = this.classGroupStudents;
-      obj.studentIds = this.studentIds
-      // console.log(obj);
+      obj.studentIds = this.studentIds;
       try {
         const reset = await spanGroupMergeClassSplitClassAffirm(obj);
         this.$message.success("合并成功");
         // 1.关闭弹窗
         // 2.清空合并班
         // 3.刷新列表
-        this.$emit('refresh')
+        this.$emit("refresh");
         console.log(reset);
       } catch (e) {
         console.log(e);
@@ -187,10 +203,33 @@ export default {
         return null;
       }
     },
+    concatCourseLst(arr) {
+      let data = {};
+      arr.forEach((some) => {
+        if (data[some.userId]) {
+          // data[some.userId].push(some)
+          data[some.userId].courseList.push(some);
+        } else {
+          data[some.userId] = {};
+          data[some.userId].userId = some.userId;
+          data[some.userId].username = some.username;
+          data[some.userId].courseList = [];
+          data[some.userId].courseList.push(some);
+        }
+      });
+      this.dataList = Object.values(data);
+    },
   },
 };
 </script>
 <style lang="scss" scoped>
+.courseDiv {
+  height: 45px;
+  line-height: 45px;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+}
 /deep/ .header {
   display: flex;
   align-items: center;

+ 0 - 1
src/views/teamDetail/componentClass/classCompound.vue

@@ -55,7 +55,6 @@
                     </div>
                   </template>
                 </el-table-column>
-
                 <el-table-column align="center" label="操作" width="200px">
                   <template slot-scope="scope">
                     <el-button type="text" @click="cancleCom(scope.row)"

+ 2 - 2
src/views/teamDetail/componentCourse/gpsLocation.vue

@@ -30,7 +30,7 @@
                     :offset="[-50,0]"></el-amap-text>
     </el-amap>
   </div>
-</template> 
+</template>
 <script>
 import VueAMap from 'vue-amap'
 // 地图
@@ -175,4 +175,4 @@ export default {
 .amap-demo {
   height: 500px;
 }
-</style>
+</style>

+ 1 - 1
src/views/teamDetail/components/modals/school-location.vue

@@ -2,7 +2,7 @@
   <el-amap
     :zoom="14"
     ref="map"
-    vid="amapDemo"
+    vid="amapDemo1"
     style="height: 300px;"
     :amap-manager="amapManager"
     :center="center"