mo il y a 5 ans
Parent
commit
1b5aaadd8d

+ 9 - 0
src/api/buildTeam.js

@@ -444,4 +444,13 @@ export function getTeamBaseInfo (data) {
     method: 'POST',
     data: qs.stringify(data)
   })
+}
+
+// 修改乐团基本信息
+export function resetTeamBaseInfo (data) {
+  return request({
+    url: `/web-server/musicGroup/update`,
+    method: 'POST',
+    data
+  })
 }

+ 127 - 34
src/views/teamBuild/components/teamBaseInfo.vue

@@ -258,20 +258,47 @@
         <div class="checkRow">
           <el-checkbox label="学员"
                        class='classCheckBox'
-                       v-model="student.ischeck"></el-checkbox>
+                       v-model="payList.student.ischeck"></el-checkbox>
           <div class="chioseList">
             <div class="chioseItem"
-                 :class="student.chiose == 'ONE_OFF'?'active':''"
-                 @click="student.chiose='ONE_OFF'">一次性</div>
+                 :class="payList.student.chiose == 'ONE_OFF'?'active':''"
+                 @click="payList.student.chiose='ONE_OFF'">一次性</div>
             <div class="chioseItem"
-                 :class="student.chiose == 'loop'?'active':''"
-                 @click="student.chiose='loop'">周期循环</div>
+                 :class="payList.student.chiose == 'loop'?'active':''"
+                 @click="payList.student.chiose='loop'">周期循环</div>
           </div>
         </div>
+        <p class="subTitle"
+           v-if='payList.student.chiose == "loop"'>按月缴费时,将在所选月份的1号的前一周提醒用户缴费操作,单次的缴费金额为当前列表「预计收费」的设置金额</p>
+        <div class="chioseWrap"
+             v-if='payList.student.chiose == "loop"'>
+          <p>请选择缴费月份:</p>
+          <el-checkbox-group v-model="chioseMonth"
+                             fill="#14928A"
+                             text-color='#474747'>
+
+            <el-checkbox :label="1">一月</el-checkbox>
+            <el-checkbox :label="2">二月</el-checkbox>
+            <el-checkbox :label="3">三月</el-checkbox>
+            <el-checkbox :label="4">四月</el-checkbox>
+            <el-checkbox :label="5">五月</el-checkbox>
+            <el-checkbox :label="6">六月</el-checkbox>
+            <el-checkbox :label="7">七月</el-checkbox>
+            <el-checkbox :label="8">八月</el-checkbox>
+            <el-checkbox :label="9">九月</el-checkbox>
+            <el-checkbox :label="10">十月</el-checkbox>
+            <el-checkbox :label="11">十一月</el-checkbox>
+            <el-checkbox :label="12">十二月</el-checkbox>
+          </el-checkbox-group>
+        </div>
       </div>
     </div>
     <div class="btnWrap">
       <div class="nextBtn"
+           @click="resetSubmit">
+        修改
+      </div>
+      <div class="nextBtn"
            @click="gotoNext(1)">
         下一步
       </div>
@@ -327,7 +354,7 @@
   </div>
 </template>
 <script>
-import { getSection, getType, getCooperation, getTeacher, getAddress, getPayMaster, getPayStatus, getTeamBaseInfo } from '@/api/buildTeam'
+import { getSection, getType, getCooperation, getTeacher, getAddress, getPayMaster, getPayStatus, getTeamBaseInfo, resetTeamBaseInfo } from '@/api/buildTeam'
 import { scrollTo } from '@/utils/scroll-to'
 export default {
   data () {
@@ -366,7 +393,7 @@ export default {
           value: '年度安排个月共xxx课时,课时,原价xxx元,现价xxxx元/月(约 xxxx元/月 )'
         }
       }, // 选中的集合
-      chioseMonth: '', // 选中的月份
+      chioseMonth: [], // 选中的月份
       baseInfo: {},
       money: 580,
       orderInfo: {
@@ -396,11 +423,8 @@ export default {
           chiose: 'loop'
         }
       },
-      student: {
-        ischeck: true,
-        chiose: 'loop'
-      },
-      activeTeam: []
+      activeTeam: [],
+      teamid: ''
     }
   },
   created () {
@@ -408,7 +432,8 @@ export default {
     // 传过来的乐团信息
     this.activeTeam = [{ id: 191014135135001, name: '测试1团' }]
     if (this.activeTeam && this.activeTeam.length == 1) {
-      getTeamBaseInfo({ musicGroupId: '191014135135001' }).then(res => {
+      this.teamid = this.activeTeam[0].id;
+      getTeamBaseInfo({ musicGroupId: this.teamid }).then(res => {
         if (res.code == 200) {
           // 头部
           this.topFrom.name = res.data.musicGroup.name;
@@ -424,7 +449,29 @@ export default {
           this.topFrom.head = res.data.musicGroup.directorUserId;
           // 课程组成形式
           this.checkList = JSON.parse(res.data.musicGroup.courseForm);
-
+          // 付费方式和周期
+          for (let i in res.data.musicGroupPaymentEntities) {
+            if (res.data.musicGroupPaymentEntities[i].name == '学校') {
+              this.payList.school.ischeck = true;
+              /**
+               *   value: '',
+                price: '',
+               chiose: ''
+               */
+              this.payList.school.value = res.data.musicGroupPaymentEntities[i].memo;
+              this.payList.school.price = res.data.musicGroupPaymentEntities[i].amount;
+              this.payList.school.chiose = res.data.musicGroupPaymentEntities[i].paymentMethod;
+            }
+            if (res.data.months.length > 0) {
+              this.payList.student.ischeck = true;
+              this.payList.student.chiose = 'loop'
+              this.chioseMonth = res.data.months;
+              console.log(this.chioseMonth)
+            } else {
+              this.payList.student.ischeck = true;
+              this.payList.student.chiose = 'ONE_OFF'
+            }
+          }
         }
       })
     }
@@ -483,29 +530,75 @@ export default {
     gotoNext (num) {
       // 1.效验数据    判断是否数据正常=> 正常放入store存储  
       //                       不正常=>  进行效验提示
-      // this.$refs['topinfo'].validate((valid, object) => {
-      //   if (!valid) {
-      //     this.$message.error('请填写建团必要参数')
-      //   } else {
-      //     // 我存三个对象
-      //     // 1. topform
-      //     // 2. checkList
-      //     // // 3. payList
-      //     this.$store.dispatch('topinfo', this.topFrom);
-      //     this.$store.dispatch('checkinfo', this.checkList);
-      //     this.$store.dispatch('getpayInfo', this.payList);
-      //     // checkinfo getpayInfo
+      this.$refs['topinfo'].validate((valid, object) => {
+        if (!valid) {
+          this.$message.error('请填写建团必要参数')
+        } else {
+          // 我存三个对象
+          // 1. topFromm
+          // 2. checkList
+          // // 3. payList
+          this.$store.dispatch('topinfo', this.topFrom);
+          this.$store.dispatch('checkinfo', this.checkList);
+          this.$store.dispatch('getpayInfo', this.payList);
+          // checkinfo getpayInfo
 
-      //     this.$emit('chiosetab', num);
+          this.$emit('chiosetab', num);
 
-      //   }
-      // })
-      this.$store.dispatch('topinfo', this.topFrom);
-      this.$store.dispatch('checkinfo', this.checkList);
-      this.$store.dispatch('getpayInfo', this.payList);
-      // checkinfo getpayInfo
+        }
+      })
+
+    },
+    resetSubmit () {
+      this.$refs['topinfo'].validate((valid, object) => {
+        if (!valid) {
+          this.$message.error('请填写必要参数')
+        } else {
+          let obj = {};
+          this.payList.student.chiose == 'loop' ? obj.months = this.chioseMonth : obj.months = [];
+          obj.musicGroup = {
+            settlementType: this.topFrom.salary,
+            applyExpireDate: this.topFrom.time + ' 00:00:01',
+            chargeTypeId: this.topFrom.type,
+            cooperationOrganId: this.topFrom.school,
+            teamTeacherId: this.topFrom.boss,
+            educationalTeacherId: this.topFrom.teacher,
+            enrollClasses: this.topFrom.startClass.join(','),
+            name: this.topFrom.name,
+            organId: this.topFrom.section,
+            // paymentMonths:obj.months  有待确认
+            schoolId: this.topFrom.address,
+            courseForm: JSON.stringify(this.checkfor),
+            id: this.teamid
+          }
+          obj.musicGroupPaymentEntities = []
+          // 添加学校主体付费方式
+          // console.log(this.payfor.company.ischeck)
+          if (this.payList.school.ischeck) {
+
+            obj.musicGroupPaymentEntities.push({
+              'amount': this.payList.school.price,
+              'memo': this.payList.school.value,
+              'paymentMethod': this.payList.school.chiose,
+              'name': '学校'
+            })
+          }
+          // 添加公司主体付费方式
+          if (this.payList.company.ischeck) {
+            obj.musicGroupPaymentEntities.push({
+              'amount': this.payList.company.price,
+              'memo': this.payList.company.value,
+              'paymentMethod': this.payList.company.chiose,
+              'name': '公司'
+            })
+          }
+          // 发请求
+          resetTeamBaseInfo(obj).then(res => {
+
+          })
+        }
+      })
 
-      this.$emit('chiosetab', num);
     }
   },
   computed: {

+ 45 - 53
src/views/teamBuild/components/teamSoundMoney.vue

@@ -1,27 +1,5 @@
 <template>
   <div class='sound-container'>
-    <p class="subTitle">按月缴费时,将在所选月份的1号的前一周提醒用户缴费操作,单次的缴费金额为当前列表「预计收费」的设置金额</p>
-    <div class="chioseWrap"
-         v-if='isLoop=="loop"'>
-      <p>请选择缴费月份:</p>
-      <el-checkbox-group v-model="checkList"
-                         fill="#14928A"
-                         text-color='#474747'>
-
-        <el-checkbox label="1">一月</el-checkbox>
-        <el-checkbox label="2">二月</el-checkbox>
-        <el-checkbox label="3">三月</el-checkbox>
-        <el-checkbox label="4">四月</el-checkbox>
-        <el-checkbox label="5">五月</el-checkbox>
-        <el-checkbox label="6">六月</el-checkbox>
-        <el-checkbox label="7">七月</el-checkbox>
-        <el-checkbox label="8">八月</el-checkbox>
-        <el-checkbox label="9">九月</el-checkbox>
-        <el-checkbox label="10">十月</el-checkbox>
-        <el-checkbox label="11">十一月</el-checkbox>
-        <el-checkbox label="12">十二月</el-checkbox>
-      </el-checkbox-group>
-    </div>
 
     <div class="topMsg">
       <p>当前选择声部数(个):{{chioseSoundNum}}</p>
@@ -38,11 +16,16 @@
                          width="55">
         </el-table-column>
         <el-table-column label="声部"
+                         align="center"
+                         width="80"
                          prop="sound">
         </el-table-column>
         <el-table-column label="计划招生"
+                         align="center"
+                         width="100"
                          prop="jihua">
-          <template slot-scope="scope">
+          <template slot-scope="scope"
+                    width="100">
             <div>
               <el-input v-if='scope.row.type == 1'
                         type='number'
@@ -50,11 +33,13 @@
                         size='mini'
                         v-model="scope.row.jihua"
                         placeholder="请输入"></el-input>
-              <p v-if='scope.row.type == 2'>{{scope.row.jihua}}</p>
+              <!-- <p v-if='scope.row.type == 2'>{{scope.row.jihua}}</p> -->
             </div>
           </template>
         </el-table-column>
         <el-table-column label="预计收费"
+                         width="100"
+                         align="center"
                          prop="yuji">
           <template slot-scope="scope">
             <div>
@@ -64,25 +49,27 @@
                         size='mini'
                         v-model="scope.row.yuji"
                         placeholder="请输入"></el-input>
-              <p v-if='scope.row.type == 2'>{{scope.row.yuji}}</p>
+              <!-- <p v-if='scope.row.type == 2'>{{scope.row.yuji}}</p> -->
             </div>
           </template>
 
         </el-table-column>
-        <el-table-column label="可选乐器种类"
+        <el-table-column label="可选乐器规格"
+                         align="center"
                          prop="zhonglei"
                          width="300">
           <template slot-scope="scope">
             <!-- 'typeVisible':false,'provideVisible':false,'markVisible':false -->
             <div>
+              <span>{{scope.row.zhonglei | zhongleiFilter(scope.row.goodsList)}}</span>
               <el-popover placement="bottom"
                           @show='chioseType(scope.row)'
                           v-model="scope.row.typeVisible"
                           v-if='scope.row.type == 1'>
-                <div slot='reference'
-                     class='chiose'>
-                  操作
-                </div>
+                <el-button type="text"
+                           slot='reference'>
+                  修改
+                </el-button>
                 <!-- zhonglei -->
                 <el-select v-model="scope.row.zhonglei"
                            multiple
@@ -102,28 +89,29 @@
                              @click="scope.row.typeVisible  = false">确定</el-button>
                 </div>
               </el-popover>
-              <p v-if='scope.row.type == 2'>{{scope.row.zhonglei | zhongleiFilter(scope.row.goodsList)}}</p>
+
             </div>
           </template>
 
         </el-table-column>
         <el-table-column label="乐器提供方式"
+                         align="center"
                          prop="fangshi"
                          width="180">
           <template slot-scope="scope">
             <div>
               <!-- <div class="chiose"
                   >选择</div> -->
-              <p v-if='scope.row.type == 2'>{{scope.row.fangshi | fangshiFilter(scope.row.fangshiprice)}}</p>
+              <span v-if="scope.row.fangshi">{{scope.row.fangshi | fangshiFilter(scope.row.fangshiprice)}}</span>
               <el-popover placement="bottom"
                           v-model="scope.row.provideVisible"
                           v-if='scope.row.type == 1'>
-                <div class='chiose'
-                     slot='reference'>
-                  操作
-                </div>
+                <i class='el-icon-edit'
+                   slot='reference'>
+                </i>
 
-                <el-select v-model="scope.row.fangshi">
+                <el-select v-model="scope.row.fangshi"
+                           clearable>
                   <el-option label="免费"
                              value="FREE"></el-option>
                   <el-option label="租赁"
@@ -147,6 +135,7 @@
           </template>
         </el-table-column>
         <el-table-column label="教辅组合"
+                         align="center"
                          prop="jiaopu">
           <template slot-scope="scope">
             <div>
@@ -170,12 +159,9 @@
                 </div>
               </el-popover> -->
               <!-- scope.row.markVisible = true -->
-              <div class='chiose'
-                   v-if='scope.row.type == 1'
-                   @click="chioseMark(scope.row)">
-                操作
-              </div>
+
               <el-dialog :visible.sync="scope.row.markVisible"
+                         style="text-align:left;"
                          width="60%">
                 <el-button type='text'
                            @click="addMark(scope.row)">添加教辅</el-button>
@@ -220,14 +206,19 @@
                              @click="scope.row.markVisible = false">确 定</el-button>
                 </span>
               </el-dialog>
-              <div v-if='scope.row.type == 2'>
-                <p v-for='(item,index) in scope.row.markList'
-                   :key='index'>{{item.name+':'}}{{item.goods|goodsFilter(scope.row.markChioseList)}}{{' 价格 '+item.price }} </p>
-              </div>
+              <span>
+                <span v-for='(item,index) in scope.row.markList'
+                      v-if="item.name"
+                      :key='index'>{{item.name+':'}}{{item.goods|goodsFilter(scope.row.markChioseList)}}{{' 价格 '+item.price }} </span>
+              </span>
+              <i class='el-icon-edit'
+                 slot='reference'
+                 @click="chioseMark(scope.row)">
+              </i>
             </div>
           </template>
         </el-table-column>
-        <el-table-column label="操作">
+        <!-- <el-table-column label="操作">
           <template slot-scope="scope">
             <div>
               <el-button v-if='scope.row.type == 2'
@@ -238,7 +229,7 @@
                          @click="savecolumn(scope.row)">保存</el-button>
             </div>
           </template>
-        </el-table-column>
+        </el-table-column> -->
       </el-table>
       <div class="floor">
         <div class="remove"
@@ -386,6 +377,7 @@ export default {
       let id = row.id;
       getGoods({ 'subjectId': 3, 'type': 'ACCESSORIES' }).then(res => {
         if (res.code == 200) {
+          console.log(res);
           row.markChioseList = res.data;
           // console.log(row);
         }
@@ -412,7 +404,6 @@ export default {
       // 整理数据提交
       let obj = {};
       this.payfor.student.chiose == 'loop' ? obj.months = this.checkList : obj.months = [];
-      console.log(JSON.stringify(this.checkfor));
       obj.musicGroup = {
         settlementType: this.topfor.salary,
         applyExpireDate: this.topfor.time + ' 00:00:01',
@@ -429,7 +420,7 @@ export default {
       }
       obj.musicGroupPaymentEntities = []
       // 添加学校主体付费方式
-      console.log(this.payfor.company.ischeck)
+      // console.log(this.payfor.company.ischeck)
       if (this.payfor.school.ischeck) {
 
         obj.musicGroupPaymentEntities.push({
@@ -450,7 +441,6 @@ export default {
       }
       // 添加商品以及教辅
       obj.musicGroupSubjectGoodsGroups = [];
-      console.log(this.activeSoundList);
       for (let i in this.activeSoundList) {
         // 遍历声部里的乐器
         let some = {};
@@ -485,7 +475,7 @@ export default {
         item.subjectId = this.activeSoundList[i].id;
         obj.musicGroupSubjectPlans.push(item);
       }
-      console.log(obj);
+
       createTeam(obj).then(res => {
         if (res.code == 200) {
           // 成功 跳转到乐团报名详情
@@ -547,7 +537,6 @@ export default {
         getDefaultSubject({ chargeTypeId: type }).then(res => {
           if (res.code == 200) {
             this.activeSoundList = res.data.map(item => {
-              console.log(this.soundLists[0])
               this.soundLists[0].push(item.id)
               let obj = { 'id': item.id, 'sound': item.name, 'jihua': 0, 'yuji': 0, 'zhonglei': [], 'fangshi': '', 'fangshiprice': 0, 'jiaopu': '', 'type': 1, 'typeVisible': false, 'provideVisible': false, 'markVisible': false, 'goodsList': [], 'markList': [{ 'name': '', 'goods': [], 'price': '' }], 'markChioseList': [] }
               return obj;
@@ -765,4 +754,7 @@ export default {
     width: 120px;
   }
 }
+.el-icon-plus {
+  cursor: pointer;
+}
 </style>

+ 2 - 2
vue.config.js

@@ -17,10 +17,10 @@ const name = defaultSettings.title || 'vue Admin Template' // page title
 // http://47.99.212.176:8000
 // 
 // let target = 'http://192.168.3.27:8000' // 箭河
-// let target = 'http://192.168.3.28:8000' //邹璇
+let target = 'http://192.168.3.28:8000' //邹璇
 // let target = 'http://192.168.3.8:8000' //勇哥
 // let target = 'http://47.99.212.176:8000' // 测试服
-let target = 'http://192.168.3.48:8000' // 乔
+// let target = 'http://192.168.3.48:8000' // 乔
 // All configuration item explanations can be find in https://cli.vuejs.org/config/
 module.exports = {
   /**