Просмотр исходного кода

Merge branch '10/23-test' into yuetuan

wolyshaw 4 лет назад
Родитель
Сommit
31abe71bfe

+ 1 - 0
package.json

@@ -27,6 +27,7 @@
     "i": "^0.3.6",
     "js-cookie": "2.2.0",
     "linq": "^3.2.2",
+    "lodash": "^4.17.20",
     "node-sass": "^4.13.1",
     "normalize.css": "7.0.0",
     "npm": "^6.13.0",

+ 1 - 1
src/App.vue

@@ -319,7 +319,7 @@ input[type="number"] {
   .nextBtn {
     width: 120px;
     height: 40px;
-    background-color: #444;
+    background-color: #13817a;
   }
   .okBtn {
     width: 120px;

+ 8 - 0
src/api/specialSetting.js

@@ -261,3 +261,11 @@ export function musicGroupOrganizationCourseSettingsQueryPage (data) {
   })
 }
 
+// 课程费用查询
+export function getOrganizationCourseUnitPriceSettings (data) {
+  return request({
+    url: api + `/organizationCourseUnitPriceSettings/queryPage`,
+    method: 'get',
+    params: data
+  })
+}

+ 16 - 2
src/utils/searchArray.js

@@ -17,11 +17,24 @@ const courseType = [
   { label: "课堂课", value: "CLASSROOM" },
   { label: "对外课", value: "COMM" }
 ]
+
+const musicCourseType = [
+  { label: "单技课", value: "SINGLE" },
+  { label: "合奏课", value: "MIX" },
+  { label: "基础技能课", value: "HIGH" },
+  { label: "线上基础技能课", value: "HIGH_ONLINE" },
+  { label: "网管课", value: "PRACTICE" },
+  { label: "乐团网管课", value: "MUSIC_NETWORK" },
+  { label: "启蒙课", value: "ENLIGHTENMENT" },
+  { label: "集训单技课", value: "TRAINING_SINGLE" },
+  { label: "集训合奏课", value: "TRAINING_MIX" },
+  { label: "课堂课", value: "CLASSROOM" },
+]
 const courseListType = [
   { label: "乐团课", value: "MUSIC" },
   { label: "VIP课", value: "VIP" },
   { label: "网管课", value: "PRACTICE" },
-
+  { label: "综合课", value: "COMPREHENSIVE" },
 ]
 
 // 考勤状态
@@ -216,5 +229,6 @@ export {
   goodsType,
   classStatus,
   stockType,
-  classTimeList
+  classTimeList,
+  musicCourseType
 }

+ 1 - 1
src/views/accompanyManager/accompanys.vue

@@ -810,7 +810,7 @@ export default {
       });
     },
     getList () {
-      findPracticeGroupCourseSchedules({ practiceId: this.practiceId }).then(
+      findPracticeGroupCourseSchedules({ practiceId: this.practiceId, page: this.pageInfo.page, rows: this.pageInfo.limit }).then(
         res => {
           if (res.code == 200) {
             this.tableList = res.data.pageInfo.rows;

+ 51 - 21
src/views/categroyManager/globalConfig.vue

@@ -5,39 +5,67 @@
     </h2>
     <div class="m-core">
       <!-- navMenu -->
-      <el-tabs v-model.trim="activeIndex" type="card" @tab-click="handleClick">
+      <el-tabs v-model.trim="activeIndex"
+               type="card"
+               @tab-click="handleClick">
 
-        <el-tab-pane label="声部设置(对内)" name="0" v-if="permissionList.musicalManager">
-            <musicalManager v-if="activeIndex == 0" />
+        <el-tab-pane label="声部设置(对内)"
+                     name="0"
+                     v-if="permissionList.musicalManager">
+          <musicalManager v-if="activeIndex == 0" />
         </el-tab-pane>
-        <el-tab-pane label="声部设置(对外)" name="1" v-if="permissionList.musicalManagerOut">
-            <musicalManagerOut v-if="activeIndex == 1" />
+        <el-tab-pane label="声部设置(对外)"
+                     name="1"
+                     v-if="permissionList.musicalManagerOut">
+          <musicalManagerOut v-if="activeIndex == 1" />
         </el-tab-pane>
-        <el-tab-pane label="乐团收费类型" name="2" v-if="permissionList.typesManager">
-            <typesManager v-if="activeIndex == 2" />
+        <el-tab-pane label="乐团收费类型"
+                     name="2"
+                     v-if="permissionList.typesManager">
+          <typesManager v-if="activeIndex == 2" />
         </el-tab-pane>
-        <el-tab-pane label="折扣设置" name="9" v-if="permissionList.typesManager">
-            <discountManage v-if="activeIndex == 9" />
+        <el-tab-pane label="折扣设置"
+                     name="9"
+                     v-if="permissionList.typesManager">
+          <discountManage v-if="activeIndex == 9" />
         </el-tab-pane>
-        <el-tab-pane label="乐团收费标准" name="3" v-if="permissionList.chargesList">
+        <el-tab-pane label="乐团收费标准"
+                     name="3"
+                     v-if="permissionList.chargesList">
           <chargesList v-if="activeIndex == 3" />
         </el-tab-pane>
-        <el-tab-pane label="乐团作业模板" name="4" v-if="permissionList.jobTemplateSetting">
-            <jobTemplateSetting v-if="activeIndex == 4" />
+        <el-tab-pane label="乐团课程费用"
+                     name="10"
+                     v-if="permissionList.holidaySetting">
+          <musicCourseFee v-if="activeIndex == 10" />
         </el-tab-pane>
-        <el-tab-pane label="热词标签" name="5" v-if="permissionList.errorManager">
+        <el-tab-pane label="乐团作业模板"
+                     name="4"
+                     v-if="permissionList.jobTemplateSetting">
+          <jobTemplateSetting v-if="activeIndex == 4" />
+        </el-tab-pane>
+        <el-tab-pane label="热词标签"
+                     name="5"
+                     v-if="permissionList.errorManager">
           <errorManager v-if="activeIndex == 5" />
         </el-tab-pane>
-        <el-tab-pane label="参数设置" name="6" v-if="permissionList.overallManager">
-            <overallManager v-if="activeIndex == 6" />
+        <el-tab-pane label="参数设置"
+                     name="6"
+                     v-if="permissionList.overallManager">
+          <overallManager v-if="activeIndex == 6" />
         </el-tab-pane>
-        <el-tab-pane label="收费分润配置" name="7" v-if="permissionList.overallManagerTwo">
-            <overallManagerTwo v-if="activeIndex == 7" />
+        <el-tab-pane label="收费分润配置"
+                     name="7"
+                     v-if="permissionList.overallManagerTwo">
+          <overallManagerTwo v-if="activeIndex == 7" />
         </el-tab-pane>
         <!-- holiday_setting -->
-        <el-tab-pane label="节假日设置" name="8" v-if="permissionList.holidaySetting">
-            <holidaySetting v-if="activeIndex == 8" />
+        <el-tab-pane label="节假日设置"
+                     name="8"
+                     v-if="permissionList.holidaySetting">
+          <holidaySetting v-if="activeIndex == 8" />
         </el-tab-pane>
+
       </el-tabs>
     </div>
   </div>
@@ -53,6 +81,7 @@ import discountManage from './specialSetup/discountManage'
 import jobTemplateSetting from './specialSetup/jobTemplateSetting'
 import errorManager from './generalSettings/errorManager'
 import chargesList from './specialSetup/chargesList'
+import musicCourseFee from './specialSetup/musicCourseFee'
 import { permission } from '@/utils/directivePage'
 export default {
   components: {
@@ -65,7 +94,8 @@ export default {
     discountManage,
     jobTemplateSetting,
     errorManager,
-    chargesList
+    chargesList,
+    musicCourseFee
   },
   name: 'globalConfig',
   data () {
@@ -93,6 +123,6 @@ export default {
 </script>
 <style lang="scss" scoped>
 /deep/.m-container {
-  padding: 0 10px 40px
+  padding: 0 10px 40px;
 }
 </style>

+ 244 - 0
src/views/categroyManager/specialSetup/musicCourseFee.vue

@@ -0,0 +1,244 @@
+<template>
+  <div class='m-container'>
+    <!-- <h2>折扣设置</h2> -->
+    <div class="m-core">
+      <el-form :inline="true"
+               :model="searchForm">
+        <el-form-item>
+          <el-select placeholder="请选择分部"
+                     v-model="searchForm.organId"
+                     clearable>
+            <el-option v-for="(item,index) in organList"
+                       :label="item.name"
+                       :value="item.id"
+                       :key="index"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item>
+          <el-select placeholder="课程类型"
+                     v-model="searchForm.courseScheduleType"
+                     clearable
+                     filterable>
+            <el-option v-for="(item,index) in musicCourseType"
+                       :label="item.label"
+                       :value="item.value"
+                       :key="index"></el-option>
+          </el-select>
+        </el-form-item>
+
+        <el-form-item>
+          <el-button type="danger"
+                     @click="search">搜索</el-button>
+          <el-button @click="onReSet"
+                     type="primary">重置</el-button>
+        </el-form-item>
+      </el-form>
+      <div class='newBand'
+           v-permission="'chargeType/upSet'"
+           @click="newVisiable = true">添加</div>
+      <!-- 列表 -->
+      <div class="tableWrap">
+        <el-table :data='tableList'
+                  :header-cell-style="{background:'#EDEEF0',color:'#444'}">
+          <el-table-column align='center'
+                           prop="chargeTypeId"
+                           label="分部">
+            <template slot-scope="scope">{{ typesListById[scope.row.chargeTypeId] }}</template>
+          </el-table-column>
+          <el-table-column align='center'
+                           prop="chargeTypeId"
+                           label="课程类型">
+            <template slot-scope="scope">{{ typesListById[scope.row.chargeTypeId] }}</template>
+          </el-table-column>
+          <el-table-column align='center'
+                           prop="subjectId"
+                           label="缴费形态">
+            <template slot-scope="scope">{{ subjectListById[scope.row.subjectId] }}</template>
+          </el-table-column>
+          <el-table-column align='center'
+                           prop="goodsDiscountRate"
+                           label="缴费金额">
+          </el-table-column>
+          <el-table-column align='center'
+                           label="操作">
+            <template slot-scope="scope">
+              <el-button @click="openTypes('update', scope.row)"
+                         v-permission="'chargeType/upSet'"
+                         type="text">修改</el-button>
+              <el-button @click="onTypesDel(scope.row)"
+                         v-permission="'chargeType/del'"
+                         type="text">删除</el-button>
+            </template>
+          </el-table-column>
+        </el-table>
+        <pagination :total="pageInfo.total"
+                    :page.sync="pageInfo.page"
+                    :limit.sync="pageInfo.limit"
+                    :page-sizes="pageInfo.page_size"
+                    @pagination="getList" />
+      </div>
+    </div>
+    <el-dialog title="新建"
+               :visible.sync="newVisiable"
+               width="500px">
+      <el-form :model="createForm"
+               class="createForm"
+               ref="ruleForm">
+        <el-form-item label="所属分部"
+                      prop="chargeTypeId"
+                      :label-width="formLabelWidth">
+          <el-select placeholder="请选择分部"
+                     v-model="createForm.organId"
+                     clearable>
+            <el-option v-for="(item,index) in organList"
+                       :label="item.name"
+                       :value="item.id"
+                       :key="index"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="收费类型"
+                      prop="chargeTypeId"
+                      :label-width="formLabelWidth">
+          <el-select v-model.trim="createForm.chargeTypeId"
+                     filterable
+                     placeholder="请选择收费类型"
+                     clearable>
+            <el-option v-for="item in musicCourseType"
+                       :key="item.value"
+                       :label="item.label"
+                       :value="item.value">
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <div v-for="(item,index) in dataList"
+             :key="index">
+          <el-form-item :label="`${item.name}每分钟费用`"
+                        :label-width="formLabelWidth">
+            <el-input v-model="createForm[item.name]">
+              <template slot="append">元</template>
+            </el-input>
+          </el-form-item>
+        </div>
+
+      </el-form>
+      <span slot="footer"
+            class="dialog-footer">
+        <el-button @click="newVisiable = false">取 消</el-button>
+        <el-button type="primary">确 定</el-button>
+      </span>
+    </el-dialog>
+
+  </div>
+</template>
+<script>
+import pagination from '@/components/Pagination/index'
+import { getEmployeeOrgan } from "@/api/buildTeam";
+import { chargeTypeList, getOrganizationCourseUnitPriceSettings } from '@/api/specialSetting'
+import createDiscount from './modals/create-discount'
+import { musicCourseType } from '@/utils/searchArray'
+export default {
+  name: 'typesManager',
+  components: { pagination, createDiscount },
+  data () {
+    return {
+      musicCourseType,
+      newVisiable: false,
+      tableList: [],
+      dataList: [],
+      organList: [],
+      searchForm: {
+        organId: null,
+        courseScheduleType: null
+      },
+      createForm: {
+        organId: null,
+        courseScheduleType: null,
+      },
+      pageInfo: {
+        // 分页规则
+        limit: 10, // 限制显示条数
+        page: 1, // 当前页
+        total: 0, // 总条数
+        page_size: [10, 20, 40, 50] // 选择限制显示条数
+      },
+      formLabelWidth: '120px'
+    }
+  },
+  mounted () {
+    chargeTypeList({
+      rows: 99999,
+      page: 1
+    }).then(res => {
+      if (res.code == 200) {
+        this.dataList = res.data.rows
+        this.dataList.forEach(item => {
+          this.$set(this.createForm, item.name, null)
+        })
+        console.log('111')
+        console.log(this.createForm)
+      }
+    })
+    getEmployeeOrgan().then(res => {
+      if (res.code == 200) {
+        this.organList = res.data;
+      }
+    });
+    this.getList()
+  },
+  methods: {
+    search () { },
+    onReSet () { },
+
+    async onTypesDel (row) {
+      try {
+        await this.$confirm('是否删除此条数据?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        })
+        delChargeTypeSubjectMapper({ id: row.id }).then(res => {
+          this.messageTips('删除', res)
+        })
+      } catch (error) { }
+    },
+
+    getList () {
+      getOrganizationCourseUnitPriceSettings({
+        rows: this.pageInfo.limit,
+        page: this.pageInfo.page
+      }).then(res => {
+        let result = res.data
+        this.tableList = result.rows
+        this.pageInfo.total = result.total
+        // }
+      })
+    },
+
+  },
+}
+</script>
+<style lang="scss" scoped>
+.el-button--primary {
+  background: #14928a;
+  border-color: #14928a;
+  color: #fff;
+  &:hover,
+  &:active,
+  &:focus {
+    background: #14928a;
+    border-color: #14928a;
+    color: #fff;
+  }
+}
+/deep/.el-date-editor.el-input {
+  width: 100% !important;
+}
+.el-select {
+  width: 100% !important;
+}
+.createForm {
+  /deep/.el-input {
+    width: 340px !important;
+  }
+}
+</style>

+ 35 - 0
src/views/resetTeaming/components/resetSoundv2.vue

@@ -0,0 +1,35 @@
+<template>
+  <div>
+    <soundSetCore ref="soundSetCore" />
+    <div class="btnWrap"
+         v-if="lookType!=='look'"
+         style="margin-top:30px">
+      <div class="closeBtn"
+           @click="getSound">取消</div>
+      <div class="okBtn"
+           v-permission="{child: 'musicGroup/updateSubjectInfo', parent: '/resetTeaming/resetSound'}"
+           @click="saveInfo">保存</div>
+    </div>
+  </div>
+</template>
+<script>
+import soundSetCore from '@/views/teamBuild/components/soundSetComponents/soundSetCore'
+export default {
+  components: { soundSetCore },
+  data () {
+    return {
+      lookType: ''
+    }
+  },
+  methods: {
+    saveInfo () {
+      this.$refs.soundSetCore.submitInfo()
+    },
+    getSound () {
+      this.$refs.soundSetCore.init()
+    },
+  }
+}
+</script>
+<style lang="scss" scoped>
+</style>

+ 1 - 1
src/views/resetTeaming/index.vue

@@ -56,7 +56,7 @@
 </template>
 <script>
 import teamBaseInfo from '@/views/teamBuild/components/teamBaseInfo'
-import resetSound from '@/views/resetTeaming/components/resetSound'
+import resetSound from '@/views/resetTeaming/components/resetSoundv2'
 import resetClass from '@/views/teamDetail/components/resetClass'
 // import coursePlan from '@/views/teamBuild/teamSeting/components/coursePlan'
 // import lookCourse from '@/views/teamBuild/teamSeting/components/lookCourse'

+ 77 - 46
src/views/teamBuild/components/soundSetComponents/chioseMusic.vue

@@ -1,40 +1,59 @@
 <template>
   <div>
+    <div v-for="(music,index) in item.chioseMusic">
 
-    <div class="chioseMusic coreItemRow"
-         v-for="(music,index) in item.chioseMusic">
-      <p class="title">可选乐器{{index+1}}:</p>
-      <el-select style="width:180px"
-                 v-model="music.musical"
-                 @change="(val)=>{chioseMusic(val,music)}">
-        <el-option v-for="(item,index) in item.goodsList"
-                   :key="index"
-                   :label="item.name"
-                   :value="item.id"></el-option>
-      </el-select>
-      <el-radio-group v-model="music.type"
-                      class="marginLeft10">
-        <el-radio label="GROUP">团购</el-radio>
-        <el-radio label="LEASE">租赁</el-radio>
-        <el-radio label="FREE">免费</el-radio>
-      </el-radio-group>
-      <el-input type="number"
-                v-if="music.type == 'GROUP'"
-                class="marginLeft10"
-                v-model="music.groupPrice"
-                disabled
-                style="width:140px"> <template slot="append">元</template></el-input>
-      <el-input type="number"
-                v-else-if="music.type == 'LEASE'"
-                v-model="music.borrowPrice"
-                class="marginLeft10"
-                style="width:140px"> <template slot="append">元</template></el-input>
-      <div style="width:150px"
-           v-else></div>
-      <i class="el-icon-close marginLeft10"
-         v-if="item.chioseMusic.length >1"
-         @click="deleteMusic(music)"
-         style="font-size:20px; cursor: pointer;"></i>
+      </el-row class="chioseMusic">
+      <el-col>
+        <div class="flexRow">
+          <p class="title">可选乐器{{index+1}}:</p>
+          <el-select style="width:180px"
+                     v-model="music.musical"
+                     @change="(val)=>{chioseMusic(val,music)}">
+            <el-option v-for="(item,index) in item.goodsList"
+                       :key="index"
+                       :label="item.name"
+                       :value="item.id"></el-option>
+          </el-select>
+          <el-checkbox-group v-model="music.type"
+                             class="marginLeft10">
+            <el-checkbox label="GROUP">团购</el-checkbox>
+            <el-checkbox label="LEASE">租赁</el-checkbox>
+            <el-checkbox label="FREE">免费</el-checkbox>
+          </el-checkbox-group>
+        </div>
+      </el-col>
+      <el-col :xs="24"
+              :sm="24"
+              :md="18"
+              :lg="12">
+        <div class="flexRow">
+          <p class="title">团购价:</p>
+          <el-input type="number"
+                    v-if="music.type&&music.type.length>0?music.type.includes('GROUP'):false"
+                    v-model="music.groupPrice"
+                    disabled
+                    style="width:180px"> <template slot="append">元</template></el-input>
+          <el-input value="--"
+                    v-else
+                    disabled
+                    style="width:180px"> <template slot="append">元</template></el-input>
+          <p class="title">租赁押金:</p>
+          <el-input type="number"
+                    v-if="music.type&&music.type.length>0?music.type.includes('LEASE'):false"
+                    v-model="music.borrowPrice"
+                    style="width:180px"> <template slot="append">元</template></el-input>
+          <el-input value="--"
+                    v-else
+                    disabled
+                    style="width:180px"> <template slot="append">元</template></el-input>
+          <i class="el-icon-close marginLeft10"
+             v-if="item.chioseMusic.length >1"
+             @click="deleteMusic(music)"
+             style="font-size:20px; cursor: pointer;"></i>
+        </div>
+
+      </el-col>
+      </el-row>
     </div>
     <div class="coreItemRow">
       <p class="title"></p>
@@ -56,11 +75,12 @@ export default {
       goods: ''
     }
   },
-  mounted () { },
+  created () { console.log(this.item) },
+  mounted () {
+
+  },
   methods: {
     chioseMusic (val, music) {
-
-
       this.item.goodsList.map((some, index) => {
         if (some.id == val) {
           music.groupPrice = some.groupPurchasePrice
@@ -69,7 +89,7 @@ export default {
       })
     },
     addMusic () {
-      this.item.chioseMusic.push({ musical: '', type: 'GROUP', groupPrice: 0, borrowPrice: 1500 })
+      this.item.chioseMusic.push({ musical: '', type: ['GROUP'], groupPrice: null, borrowPrice: 1500 })
       this.$emit('lookMusic')
     },
     deleteMusic (music) {
@@ -85,6 +105,9 @@ export default {
 }
 </script>
 <style lang="scss" scoped>
+.chioseMusic {
+  width: 100%;
+}
 .coreItemRow {
   padding-left: 20px;
   height: 50px;
@@ -92,16 +115,24 @@ export default {
   display: flex;
   flex-direction: row;
   align-items: center;
-  p {
-    margin-right: 10px;
-  }
-  .title {
-    width: 100px;
-    text-align: right;
-  }
+  width: 100%;
+}
+p {
+  margin-right: 10px;
+}
+.title {
+  width: 100px;
+  text-align: right;
+  margin-right: 10px;
 }
-
 .marginLeft10 {
   margin-left: 10px;
 }
+.flexRow {
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  padding-left: 20px;
+  margin-top: 10px;
+}
 </style>

+ 9 - 4
src/views/teamBuild/components/soundSetComponents/chioseSoundList.vue

@@ -8,11 +8,12 @@
           <div class="categroy"
                v-for="(item,index) in soundList"
                :key="index">
-            <p>{{item.name }}</p>
+            <p>{{item.name}}</p>
             <el-checkbox :label="sound.id"
                          @change="changeCheck"
+                         :disabled="activeSound.includes(sound.id)"
                          v-for="(sound,indexs) in item.subjects"
-                         :key="indexs">{{sound.name }}</el-checkbox>
+                         :key="indexs">{{sound.name}}</el-checkbox>
           </div>
         </div>
       </el-checkbox-group>
@@ -34,18 +35,20 @@ export default {
   data () {
     return {
       chioseSoundNum: '',
-      activeSoundList: this.activeSound,
+      activeSoundList: this.activeSound || [],
     }
   },
   mounted () {
     console.log(this.soundList)
   },
+  activated () {
+    console.log(this.soundList)
+  },
   methods: {
     generates () {
       this.$emit('chioseSound', this.activeSoundList)
     },
     changeCheck () {
-      console.log(this.activeSoundList)
     }
   }
 }
@@ -64,8 +67,10 @@ export default {
     max-height: 300px;
     overflow: auto;
     .categroy {
+      z-index: 100;
       width: 150px;
       min-width: 150px;
+      color: #606266;
       .el-checkbox {
         height: 30px;
         line-height: 30px;

+ 457 - 0
src/views/teamBuild/components/soundSetComponents/soundSetCore.vue

@@ -0,0 +1,457 @@
+<template>
+  <div>
+    <div class="soundBtnWrap">
+      <el-button type="primary"
+                 @click="allin"
+                 v-if="teamStatus != 'resetTeam'">全选</el-button>
+      <el-button type="danger"
+                 @click="deleteRow"
+                 v-if="teamStatus != 'resetTeam'">删除</el-button>
+      <el-button type="primary"
+                 @click="soundVisible = true">添加</el-button>
+    </div>
+    <div class="coreWrap">
+      <el-checkbox-group v-model="checkList"
+                         @change='lookCheck'>
+        <el-collapse v-model="chioseActiveSound"
+                     accordion
+                     @change="changeActiveSound">
+          <el-collapse-item v-for="(item,index) in activeSoundList"
+                            :name="item.id"
+                            :key="index">
+            <template slot="title">
+              <div class="coreItemTitle">
+                <el-checkbox :label="item.id">{{item.sound}}</el-checkbox>
+              </div>
+            </template>
+            <div class="coreItem">
+              <div class="coreItemRow">
+                <p class="title">计划招生人数:</p>
+                <el-input style="width:180px"
+                          v-model="item.expectedStudentNum"></el-input>
+              </div>
+            </div>
+            <chioseMusic :item="item"
+                         @lookMusic="lookMusic" />
+            <div class="coreItemRow">
+              <p class="title">教辅:</p>
+              <el-select style="width:558px!important;"
+                         v-model="item.markChioseList"
+                         clearable
+                         filterable
+                         multiple>
+                <el-option v-for="(item,index) in item.markList"
+                           :key="index"
+                           :label="item.name"
+                           :value="item.id"></el-option>
+              </el-select>
+            </div>
+          </el-collapse-item>
+
+        </el-collapse>
+      </el-checkbox-group>
+    </div>
+    <el-dialog title="声部选择"
+               :visible.sync="soundVisible"
+               destroy-on-close>
+      <chioseSoundList :soundList="soundList"
+                       :activeSound='activeSound'
+                       @chioseSound="chioseSound" />
+    </el-dialog>
+  </div>
+</template>
+<script>
+import store from "@/store";
+import { formatData } from '@/utils/utils'
+import {
+  getSubject,
+  getDefaultSubject,
+  getGoods,
+  createTeam,
+  getSoundTree,
+  findMusicGroupSubjectInfo,
+  updateSubjectInfo,
+  auditSuccess,
+  auditFailed,
+  getSubjectGoods
+} from "@/api/buildTeam";
+import dayjs from 'dayjs'
+import chioseSoundList from './chioseSoundList'
+import chioseMusic from './chioseMusic'
+import { findIndex } from 'lodash'
+export default {
+  components: { chioseSoundList, chioseMusic },
+  data () {
+    return {
+      soundList: [], // 接口返回的一级二级声部
+      soundVisible: false, // 设置声部弹窗
+      childSoundList: [],
+      activeSoundList: [], //列表上的声部
+      activeSound: null, // 展开的列表
+      chioseActiveSound: null,
+      soundList: [], // 接口返回的一级二级声部
+      childSoundList: [],
+      teamStatus: '',// 乐团状态
+      checkList: [],
+    }
+  }, mounted () {
+    this.init()
+  },
+  activated () {
+    this.init()
+  },
+  methods: {
+    init () {
+      // 获取第一页的数据
+      this.topfor = this.$store.getters.topinfo;
+      let type = this.topfor.type;
+      this.teamStatus = this.$route.query.type;
+      if (this.$route.query.search) {
+        this.Fsearch = this.$route.query.search;
+      }
+      if (this.$route.query.rules) {
+        this.Frules = this.$route.query.rules;
+      }
+      getSoundTree({ tenantId: 1 }).then(res => {
+        if (res.code == 200) {
+          this.soundList = res.data.rows
+          if (this.teamStatus == "newTeam") {
+            getDefaultSubject({
+              chargeTypeId: type,
+              organId: this.topfor.section,
+              number: 1
+            }).then(res => {
+              if (res.code == 200) {
+                let activeSound = []
+                this.activeSoundList = res.data.map(item => {
+                  activeSound.push(item.id)
+                  return this.initSound(item);
+                });
+                this.activeSound = activeSound;
+                this.chioseActiveSound = activeSound[0]
+                this.changeActiveSound(activeSound[0])
+              }
+            });
+          } else {
+            this.$nextTick(res => {
+              this.teamid = this.$route.query.id;
+              findMusicGroupSubjectInfo({ musicGroupId: this.teamid }).then(
+                res => {
+                  if (res.code == 200) {
+                    let activeSound = []
+                    this.activeSoundList = res.data?.musicGroupSubjectPlans.map(item => {
+                      activeSound.push(item.subjectId)
+                      return {
+                        id: parseInt(item.subjectId),
+                        sound: item.subName,
+                        expectedStudentNum: item.expectedStudentNum,
+                        chioseMusic: [],
+                        markChioseList: [],
+                        goodsList: [],
+                        markList: [],
+                      }
+                    })
+                    this.activeSound = activeSound;
+                    this.chioseActiveSound = activeSound[0]
+                    this.changeActiveSound(activeSound[0])
+                    // 格式化商品和教辅
+
+                    res.data.musicGroupSubjectGoodsGroups.forEach(shop => {
+                      let index = findIndex(this.activeSoundList, (o) => {
+                        return o.id == shop.subjectId
+                      })
+
+                      if (index != -1) {
+                        if (shop.type == 'ACCESSORIES') {
+                          shop.goodsIdList.split(',').forEach(item => {
+                            this.activeSoundList[index].markChioseList.push(parseInt(item))
+                          })
+                        } else if (shop.type == 'INSTRUMENT') {
+                          // 商品
+                          let typeJson = Object.keys(JSON.parse(shop.kitGroupPurchaseTypeJson))
+                          this.activeSoundList[index].chioseMusic.push({
+                            musical: parseInt(shop.goodsIdList),
+                            type: typeJson,
+                            groupPrice: shop.price,
+                            borrowPrice: shop.depositFee
+                          })
+                        }
+
+                      }
+
+
+                    })
+
+
+                  }
+                })
+            })
+          }
+        }
+      });
+      getSubject({ tenantId: 1 }).then(res => {
+        if (res.code == 200) {
+          this.childSoundList = res.data
+        }
+      })
+    },
+    lookCheck (val) {
+      this.checkList = [...new Set(val)]
+    },
+    chioseSound (activeSound) {
+      // 同步数据
+      this.activeSound = [...new Set(activeSound)];
+      let newSoundList = []
+
+      for (let i in this.childSoundList) {
+        if (this.activeSound.includes(this.childSoundList[i].id)) {
+          newSoundList.push(this.initSound(this.childSoundList[i]))
+        }
+      }
+      let idList = this.activeSoundList.map(item => {
+        return item.id
+      })
+      for (let x in newSoundList) {
+        const indexof = idList.indexOf(newSoundList[x]?.id)
+        if (indexof > -1) {
+          newSoundList[x] = this.activeSoundList[indexof]
+        }
+      }
+      this.activeSoundList = newSoundList
+      this.soundVisible = false
+    },
+    initSound (item) {
+      let obj = {
+        id: item.id,
+        sound: item.name,
+        expectedStudentNum: item.expectedStudentNum,
+        chioseMusic: [{ musical: '', type: ["GROUP"], groupPrice: 0, borrowPrice: 1500 }],
+        markChioseList: [],
+        goodsList: [],
+        markList: [],
+
+      }
+      return obj
+    },
+    changeActiveSound (val) {
+      this.activeSoundList.forEach(item => {
+        if (item.id == val) {
+          if (item.goodsList.length < 1 || item.markList.length < 1) {
+            getSubjectGoods({ subjectId: item.id, chargeTypeId: this.topfor.type }).then(res => {
+              if (res.code == 200) {
+                let goodList = []
+                let markList = []
+                res.data.forEach(item => {
+                  if (item.type == 'INSTRUMENT') {
+                    goodList.push(item)
+                  } else if (item.type == 'ACCESSORIES') {
+                    markList.push(item)
+                  }
+                })
+                item.goodsList = goodList;
+                item.markList = markList;
+              }
+            });
+          }
+
+        }
+      })
+    },
+    lookMusic () {
+
+    },
+
+    submitInfo () {
+      // 计划招生人数
+      // 可选乐器
+      // 教辅
+      this.activeSoundList.forEach(item => {
+        if (!item.expectedStudentNum) {
+          this.$message.error(`请填写${item.sound}的预计招生人数`)
+          return
+        }
+        if (!item.chioseMusic[0].musical) {
+          this.$message.error(`请至少一个选择${item.sound}的可选乐器`)
+          return
+        }
+      })
+      // 新建团
+      let obj = {}
+      if (this.teamStatus == "newTeam") {
+        this.initCreateTeam(obj)
+      }
+      //  初始化声部
+      obj.musicGroupSubjectGoodsGroups = [];
+      obj.musicGroupSubjectPlans = [];
+      this.activeSoundList.forEach(active => {
+        // 格式化声部数据
+        let item = {
+          expectedStudentNum: active.expectedStudentNum,
+          subName: active.sound,
+          subjectId: active.id
+        };
+        obj.musicGroupSubjectPlans.push(item);
+        // 格式化商品数据 chioseMusic: [{ musical: '', type: ["GROUP"], groupPrice: 0, borrowPrice: 1500 }],
+        active.chioseMusic.forEach(music => {
+          let goodsItem = null;
+          let depositFee = music.borrowPrice
+          let price = music.groupPrice
+          let index = findIndex(active.goodsList, (o) => {
+            return o.id == music.musical
+          })
+          if (index != -1) {
+            goodsItem = active.goodsList[index]
+          }
+          let kitGroupPurchaseTypeJson = {}
+          music.type.forEach(type => {
+            kitGroupPurchaseTypeJson[type] = 0
+          })
+          kitGroupPurchaseTypeJson = JSON.stringify(kitGroupPurchaseTypeJson)
+          if (goodsItem) {
+            let some = {
+              subjectId: active.id,
+              type: "INSTRUMENT",
+              goodsIdList: music.musical,
+              name: goodsItem.name,
+              kitGroupPurchaseTypeJson,
+              depositFee,
+              price
+            };
+            obj.musicGroupSubjectGoodsGroups.push(some);
+          }
+        })
+        // 格式化辅件
+        //  markChioseList: [],
+        // goodsList: [],
+        // markList: [],
+        active.markChioseList.forEach(ass => {
+          let index = findIndex(active.markList, (o) => {
+            return o.id == ass
+          })
+          let goodsItem = null;
+          if (index != -1) {
+            goodsItem = active.markList[index]
+          }
+          if (goodsItem) {
+            let some = {
+              subjectId: active.id,
+              type: "ACCESSORIES",
+              goodsIdList: ass,
+              name: goodsItem.name,
+              price: goodsItem.groupPurchasePrice,
+            };
+            obj.musicGroupSubjectGoodsGroups.push(some);
+          }
+
+        })
+        if (this.teamStatus == 'newTeam') {
+          createTeam(obj).then(res => {
+            if (res.code == 200) {
+              // 成功 跳转到乐团报名详情
+            }
+          });
+        } else {
+          obj.musicGroupId = this.teamid
+          obj.musicGroupStatus = "DRAFT"
+          updateSubjectInfo(obj).then(res => {
+            if (res.code == 200) {
+              this.$message.success("提交成功");
+            }
+          });
+        }
+      })
+    },
+    deleteRow () {
+      if (this.checkList.length < 1) {
+        this.$message.error('请至少勾选一个')
+        return
+      }
+      for (let i = 0; i < this.activeSoundList.length; i++) {
+        let index = this.checkList.indexOf(this.activeSoundList[i].id)
+        if (index != -1) {
+          this.activeSoundList.splice(i, 1)
+          this.activeSound.splice(i, 1)
+          i--
+        }
+      }
+      this.checkList = []
+
+
+    },
+    allin () {
+      this.checkList = []
+      this.activeSoundList.forEach((item, index) => {
+        this.checkList.push(item.id)
+      })
+
+    },
+
+    initCreateTeam (obj) {
+      let enrollClasses;
+      this.topfor.startClass
+        ? (enrollClasses = this.topfor.startClass.join(","))
+        : (enrollClasses = null);
+      obj.musicGroup = {
+        settlementType: this.topfor.salary,
+        applyExpireDate: dayjs(this.topfor.time).format('YYYY-MM-DD HH:mm:ss'),
+        chargeTypeId: this.topfor.type,
+        cooperationOrganId: this.topfor.school,
+        teamTeacherId: this.topfor.boss,
+        educationalTeacherId: this.topfor.teacher,
+        enrollClasses,
+        name: this.topfor.name,
+        organId: this.topfor.section,
+        paymentPattern: this.topfor.paymentPattern,
+        paymentValidStartDate: this.topfor.paymentValidStartDate ? dayjs(this.topfor.paymentValidStartDate).format('YYYY-MM-DD') : this.topfor.paymentValidStartDate,
+        paymentValidEndDate: this.topfor.paymentValidEndDate ? dayjs(this.topfor.paymentValidEndDate).format('YYYY-MM-DD') : this.topfor.paymentValidEndDate,
+        // paymentMonths:obj.months  有待确认
+        schoolId: this.topfor.address,
+        expectStartGroupDate: this.topfor.startTime,
+        isClassroomLessons: this.topfor.isClass,
+        status,
+        ownershipType: this.topfor.ownershipType,
+        repairUserId: this.topfor.repairUserId,
+        feeType: this.topfor.feeType
+      };
+      return obj
+    }
+  },
+}
+</script>
+<style lang="scss" scoped>
+.soundBtnWrap {
+  margin-bottom: 20px;
+}
+/deep/.el-collapse-item__header {
+  background-color: #edeef0;
+}
+.coreItemTitle {
+  background-color: #edeef0;
+  height: 46px;
+  line-height: 46px;
+  padding: 0 20px;
+}
+.coreItem {
+  padding: 25px 0 0;
+}
+.coreItemRow {
+  padding: 0 20px;
+  line-height: 50px;
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  p {
+    margin-right: 10px;
+  }
+  .title {
+    width: 100px;
+    text-align: right;
+  }
+}
+.marginLeft10 {
+  margin-left: 10px;
+}
+/deep/.el-collapse-item__header {
+  border-bottom: 1px solid #fff;
+}
+</style>

+ 0 - 0
src/views/teamBuild/components/teamPayInfo.vue


+ 47 - 178
src/views/teamBuild/components/teamSoundSet.vue

@@ -4,60 +4,16 @@
       <p>当前选择声部数(个):{{chioseSoundNum}}</p>
       <p style="margin-left:30px;">计划招生人数(个):{{PlannedCount}}</p>
     </div>
-    <div class="soundBtnWrap">
-      <el-button type="primary">全选</el-button>
-      <el-button type="danger">删除</el-button>
-      <el-button type="primary"
-                 @click="soundVisible = true">添加</el-button>
+    <soundSetCore ref='soundSetCore' />
+    <div class="btnWrap">
+      <div class="PrevBtn"
+           @click="goback">上一步</div>
+      <!--  v-if="teamStatus != 'teamAudit'" -->
+      <div class="submitBtn"
+           v-permission="{child: 'musicGroup/createGroup', parent: '/teamBuild/soundMoney'}"
+           @click="submitInfo()">下一步</div>
     </div>
-    <div class="coreWrap">
-      <el-checkbox-group v-model="checkList"
-                         @change='lookCheck'>
-        <el-collapse v-model="activeSound"
-                     accordion
-                     @change="changeActiveSound">
-          <el-collapse-item v-for="(item,index) in activeSoundList"
-                            :name="item.id"
-                            :key="index">
-            <template slot="title">
-              <div class="coreItemTitle">
-                <el-checkbox :label="item.id">{{item.sound}}</el-checkbox>
-              </div>
-            </template>
-            <div class="coreItem">
-              <div class="coreItemRow">
-                <p class="title">计划招生人数:</p>
-                <el-input style="width:180px"
-                          v-model="item.expectedStudentNum"></el-input>
-              </div>
-            </div>
-            <chioseMusic :item="item"
-                         @lookMusic="lookMusic" />
-            <div class="coreItemRow">
-              <p class="title">教辅:</p>
-              <el-select style="width:558px!important;"
-                         v-model="item.markChioseList"
-                         clearable
-                         filterable
-                         multiple>
-                <el-option v-for="(item,index) in item.markList"
-                           :key="index"
-                           :label="item.name"
-                           :value="item.id"></el-option>
-              </el-select>
-            </div>
-          </el-collapse-item>
 
-        </el-collapse>
-      </el-checkbox-group>
-    </div>
-    <el-dialog title="声部选择"
-               :visible.sync="soundVisible"
-               :modal-append-to-body="false">
-      <chioseSoundList :soundList="soundList"
-                       :activeSound='activeSound'
-                       @chioseSound="chioseSound" />
-    </el-dialog>
   </div>
 </template>
 <script>
@@ -76,149 +32,48 @@ import {
   getSubjectGoods
 } from "@/api/buildTeam";
 import dayjs from 'dayjs'
-import chioseMusic from './soundSetComponents/chioseMusic'
-import chioseAccessory from './soundSetComponents/chioseAccessory'
-import chioseSoundList from './soundSetComponents/chioseSoundList'
+
+
+
+import soundSetCore from './soundSetComponents/soundSetCore'
+
 export default {
-  components: { chioseMusic, chioseAccessory, chioseSoundList },
+  components: { soundSetCore },
   data () {
     return {
       topfor: null, // 第一页的数据
-      chioseSoundNum: 0,
-      PlannedCount: 0,
-      checkList: [],
       Fsearch: null,
       Frules: null,
-      soundList: [], // 接口返回的一级二级声部
-      soundVisible: false, // 设置声部弹窗
-      childSoundList: [],
-      teamStatus: '',// 乐团状态
-      activeSoundList: [], //列表上的声部
-      activeSound: null, // 展开的列表
+      activeSoundList: []
     }
   },
   mounted () {
-    this.init()
+
   },
   activated () { },
   methods: {
-    init () {
-      // 获取第一页的数据
-      this.topfor = this.$store.getters.topinfo;
-      let type = this.topfor.type;
-      this.teamStatus = this.$route.query.type;
-      if (this.$route.query.search) {
-        this.Fsearch = this.$route.query.search;
-      }
-      if (this.$route.query.rules) {
-        this.Frules = this.$route.query.rules;
-      }
-      getSoundTree({ tenantId: 1 }).then(res => {
-        if (res.code == 200) {
-          this.soundList = res.data.rows
-          if (this.teamStatus == "newTeam") {
-            getDefaultSubject({
-              chargeTypeId: type,
-              organId: this.topfor.section,
-              number: 1
-            }).then(res => {
-              if (res.code == 200) {
-                let activeSound = []
-                this.activeSoundList = res.data.map(item => {
-                  activeSound.push(item.id)
-                  return this.initSound(item);
-                });
-                this.activeSound = activeSound;
-
-                //  = arr;
-                // this.soundList.forEach((item, i) => {
-                //   item.subjects.forEach((some, j) => {
-                //     res.data.forEach((sub, x) => {
-                //       if (sub.id == some.id) {
-                //         this.soundLists[i].push(some.id);
-                //       }
-                //     });
-                //   });
-                // });
-                // 并且把所有soundLists 里面
-              }
-            });
-          }
-        }
-      });
-      getSubject({ tenantId: 1 }).then(res => {
-        if (res.code == 200) {
-          this.childSoundList = res.data
-        }
-      })
+    goback () {
+      this.$emit("chiosetab", 0);
     },
-    lookCheck (val) {
-      console.log(val)
-    },
-    chioseSound (activeSound) {
-      // 同步数据
-      this.activeSound = activeSound;
-      let newSoundList = []
+    submitInfo () {
+      this.$refs.soundSetCore.submitInfo()
+    }
+  },
 
-      for (let i in this.childSoundList) {
-        if (activeSound.includes(this.childSoundList[i].id)) {
-          console.log(this.childSoundList[i])
-          newSoundList.push(this.initSound(this.childSoundList[i]))
+  computed: {
+    PlannedCount () {
+      let Count = 0;
+      if (this.activeSoundList.length > 0) {
+        for (let item in this.activeSoundList) {
+          Count += parseInt(this.activeSoundList[item]?.expectedStudentNum) || 0;
         }
-
       }
 
-      let idList = this.activeSoundList.map(item => {
-        console.log(item)
-        return item.id
-      })
-      console.log(newSoundList, idList, this.activeSoundList)
-      for (let x in newSoundList) {
-        if (idList.includes(newSoundList[x].id)) {
-          console.log(x)
-          newSoundList[x] = this.activeSoundList[x]
-        }
-      }
-      this.activeSoundList = newSoundList
-      this.soundVisible = false
-    },
-    initSound (item) {
-      let obj = {
-        id: item.id,
-        sound: item.name,
-        expectedStudentNum: item.expectedStudentNum,
-        chioseMusic: [{ musical: '', type: 'GROUP', groupPrice: 0, borrowPrice: 1500 }],
-        markChioseList: [],
-        goodsList: [],
-        markList: [],
+      return Count;
+    }, chioseSoundNum () {
 
-      }
-      return obj
-    },
-    changeActiveSound (val) {
-      this.activeSoundList.map(item => {
-        if (item.id == val) {
-          getSubjectGoods({ subjectId: item.id, chargeTypeId: this.topfor.type }).then(res => {
-            if (res.code == 200) {
-              let goodList = []
-              let markList = []
-              res.data.forEach(item => {
-                if (item.type == 'INSTRUMENT') {
-                  goodList.push(item)
-                } else if (item.type == 'ACCESSORIES') {
-                  markList.push(item)
-                }
-              })
-              item.goodsList = goodList;
-              item.markList = markList;
-            }
-          });
-        }
-      })
+      return this.activeSoundList.length;
     },
-    lookMusic () {
-      console.log(this.activeSoundList)
-    }
   }
 }
 </script>
@@ -240,8 +95,8 @@ export default {
 }
 .coreItemTitle {
   background-color: #edeef0;
-  height: 48px;
-  line-height: 48px;
+  height: 46px;
+  line-height: 46px;
   padding: 0 20px;
 }
 .coreItem {
@@ -264,4 +119,18 @@ export default {
 .marginLeft10 {
   margin-left: 10px;
 }
+/deep/.el-collapse-item__header {
+  border-bottom: 1px solid #fff;
+}
+.btnWrap {
+  margin-top: 40px;
+  .PrevBtn {
+    background-color: #13817a;
+    width: 120px;
+  }
+  .submitBtn {
+    background-color: #13817a;
+    width: 120px;
+  }
+}
 </style>