Sfoglia il codice sorgente

10/02

建团所有数据同步成功
mo 5 anni fa
parent
commit
f831969bf1

+ 24 - 5
src/api/buildTeam.js

@@ -5,7 +5,7 @@ export function getSection (data) {
   return request({
     url: '/web-server/organization/queryPage',
     method: 'get',
-    data: qs.stringify(data)
+    params: qs.stringify(data)
   })
 }
 // 获取收费类型
@@ -13,7 +13,7 @@ export function getType (data) {
   return request({
     url: '/web-server/chargeType/queryPage',
     method: 'get',
-    data: qs.stringify(data)
+    params: qs.stringify(data)
   })
 }
 // 获取合作单位
@@ -21,7 +21,7 @@ export function getCooperation (data) {
   return request({
     url: '/web-server/cooperationOrgan/queryPage',
     method: 'get',
-    data: qs.stringify(data)
+    params: qs.stringify(data)
   })
 }
 
@@ -30,7 +30,7 @@ export function getTeacher (data) {
   return request({
     url: '/web-server/teacher/queryPage',
     method: 'get',
-    data: qs.stringify(data)
+    params: qs.stringify(data)
   })
 }
 
@@ -39,6 +39,25 @@ export function getSubject (data) {
   return request({
     url: '/web-server/subject/queryPageTree',
     method: 'get',
-    data: qs.stringify(data)
+    params: qs.stringify(data)
+  })
+}
+
+// 根据收费类型获取默认科目
+export function getDefaultSubject (data) {
+  return request({
+    url: '/web-server/subject/findDefaultSubByGroupId',
+    method: 'get',
+    params: qs.stringify(data)
+  })
+}
+
+// 根据科目编号查询商品或辅件
+//
+export function getGoods (data) {
+  return request({
+    url: '/web-server/goods/queryGoodsBySubId',
+    method: 'get',
+    params: data
   })
 }

+ 8 - 8
src/views/teamBuild/components/teamBaseInfo.vue

@@ -393,8 +393,8 @@ export default {
           // 2. checkList
           // // 3. payList
           this.$store.dispatch('topinfo', this.topFrom);
-          this.$store.dispatch('checkinfo', this.topFrom);
-          this.$store.dispatch('getpayInfo', this.topFrom);
+          this.$store.dispatch('checkinfo', this.checkList);
+          this.$store.dispatch('getpayInfo', this.payList);
           // checkinfo getpayInfo
           this.$emit('chioseTab', 1);
 
@@ -508,12 +508,12 @@ export default {
           color: #fff;
         }
       }
-      &:nth-child(even) {
-        background-color: #c6cbd4;
-        input {
-          background-color: #c6cbd4;
-        }
-      }
+      // &:nth-child(even) {
+      //   background-color: #c6cbd4;
+      //   input {
+      //     background-color: #c6cbd4;
+      //   }
+      // }
     }
   }
   .btnWrap {

+ 354 - 74
src/views/teamBuild/components/teamSoundMoney.vue

@@ -1,7 +1,8 @@
 <template>
   <div class='sound-container'>
     <p class="subTitle">按月缴费时,将在所选月份的1号的前一周提醒用户缴费操作,单次的缴费金额为当前列表「预计收费」的设置金额</p>
-    <div class="chioseWrap">
+    <div class="chioseWrap"
+         v-if='isLoop=="loop"'>
       <p>请选择缴费月份:</p>
       <el-checkbox-group v-model="checkList"
                          fill="#14928A"
@@ -27,11 +28,11 @@
       <p style='margin-left:30px;'>计划招生人数(个):80</p>
     </div>
     <div class="listWrap">
-      <el-table :data='tableList'
+      <el-table :data='activeSoundList'
                 ref="multipleTable"
                 :header-cell-style="{background:'#EDEEF0',color:'#444'}"
                 highlight-current-row
-                @selection='handleSelectionChange'
+                @selection-change='handleSelectionChange'
                 @row-click='handleclick'>
         <el-table-column type="selection"
                          width="55">
@@ -43,12 +44,13 @@
                          prop="jihua">
           <template slot-scope="scope">
             <div>
-              <el-input type='number'
+              <el-input v-if='scope.row.type == 1'
+                        type='number'
                         style="width:80px"
                         size='mini'
                         v-model="scope.row.jihua"
                         placeholder="请输入"></el-input>
-
+              <p v-if='scope.row.type == 2'>{{scope.row.jihua}}</p>
             </div>
           </template>
         </el-table-column>
@@ -60,9 +62,9 @@
                         type='number'
                         style="width:80px"
                         size='mini'
-                        v-model="scope.row.jihua"
+                        v-model="scope.row.yuji"
                         placeholder="请输入"></el-input>
-              <p v-if='scope.row.type == 2'>{{scope.row.jihua}}</p>
+              <p v-if='scope.row.type == 2'>{{scope.row.yuji}}</p>
             </div>
           </template>
 
@@ -71,16 +73,36 @@
                          prop="zhonglei"
                          width="300">
           <template slot-scope="scope">
+            <!-- 'typeVisible':false,'provideVisible':false,'markVisible':false -->
             <div>
-              <el-select v-model="scope.row.zhonglei"
-                         style="width:260px!important"
-                         multiple>
-                <el-option :label="1"
-                           :value="1"></el-option>
-                <el-option :label="2"
-                           :value="2"></el-option>
-              </el-select>
-              <p v-if='scope.row.type == 2'>{{scope.row.jihua}}</p>
+              <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>
+                <!-- zhonglei -->
+                <el-select v-model="scope.row.zhonglei"
+                           multiple
+                           clearable
+                           collapse-tags>;
+                  <el-option v-for="(item,index) in scope.row.goodsList"
+                             :key='index'
+                             :label="item.name"
+                             :value="item.id"></el-option>
+                </el-select>
+                <div style="text-align: right; margin-top: 20px">
+                  <!-- <el-button size="mini"
+                             type="text"
+                             @click="closechioseType(scope.row)">取消</el-button> -->
+                  <el-button type="primary"
+                             size="mini"
+                             @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>
 
@@ -92,23 +114,33 @@
             <div>
               <!-- <div class="chiose"
                   >选择</div> -->
-              <p v-if='scope.row.type == 2'>{{scope.row.fangshi}}</p>
+              <p v-if='scope.row.type == 2'>{{scope.row.fangshi | fangshiFilter(scope.row.fangshiprice)}}</p>
               <el-popover placement="bottom"
-                          v-model="scope.row.visible"
+                          v-model="scope.row.provideVisible"
                           v-if='scope.row.type == 1'>
-                <div slot='reference'
-                     class='chiose'>
+                <div class='chiose'
+                     slot='reference'>
                   操作
                 </div>
-                <el-input v-model="scope.row.fangshi"></el-input>
-                1111
-                <div style="text-align: right; margin: 0">
-                  <el-button size="mini"
+
+                <el-select v-model="scope.row.fangshi">
+                  <el-option label="免费"
+                             value="FREE"></el-option>
+                  <el-option label="租赁"
+                             value="GROUP"></el-option>
+                  <el-option label="借用"
+                             value="LEASE"></el-option>
+                </el-select>
+                <el-input placeholder="请输入费用"
+                          v-model="scope.row.fangshiprice"
+                          style='width:180px; margin-top:20px'></el-input>
+                <div style="text-align: right; margin-top: 20px">
+                  <!-- <el-button size="mini"
                              type="text"
-                             @click="scope.row.visible = false">取消</el-button>
+                             @click="scope.row.provideVisible = false">取消</el-button> -->
                   <el-button type="primary"
                              size="mini"
-                             @click="scope.row.visible  = false">确定</el-button>
+                             @click="scope.row.provideVisible  = false">确定</el-button>
                 </div>
               </el-popover>
             </div>
@@ -118,9 +150,80 @@
                          prop="jiaopu">
           <template slot-scope="scope">
             <div>
-              <div v-if='scope.row.type == 1'
-                   class="chiose">选择</div>
-              <p v-if='scope.row.type == 2'>{{scope.row.jiaopu}}</p>
+              <!-- <el-popover placement="bottom"
+                          v-model="scope.row.markVisible"
+                          @show="chioseMark"
+                          v-if='scope.row.type == 1'>
+                <div slot='reference'
+                     class='chiose'>
+                  操作
+                </div>
+                <el-input v-model="scope.row.fangshi"></el-input>
+                1111
+                <div style="text-align: right; margin: 0">
+                  <el-button size="mini"
+                             type="text"
+                             @click="scope.row.provideVisible = false">取消</el-button>
+                  <el-button type="primary"
+                             size="mini"
+                             @click="scope.row.provideVisible  = false">确定</el-button>
+                </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"
+                         width="60%">
+                <el-button type='text'
+                           @click="addMark(scope.row)">添加教辅</el-button>
+                <div class="markWrap">
+                  <div class="markItem"
+                       v-for="(item, index) in scope.row.markList"
+                       :key='index'>
+                    <el-form :model="item"
+                             :inline="true">
+                      <el-form-item label="教辅名称">
+                        <el-input type="text"
+                                  v-model="item.name"></el-input>
+                      </el-form-item>
+                      <el-form-item label="教辅商品">
+                        <el-select v-model="item.goods"
+                                   multiple
+                                   collapse-tags>
+                          <el-option v-for='(item,index) in scope.row.markChioseList'
+                                     :key='index'
+                                     :label="item.name"
+                                     :value="item.id"></el-option>
+                        </el-select>
+                      </el-form-item>
+                      <el-form-item label="教辅打包价">
+                        <el-input type='number'
+                                  v-model="item.price"></el-input>
+                      </el-form-item>
+                      <el-form-item>
+                        <el-button type="danger"
+                                   icon="el-icon-delete"
+                                   circle
+                                   @click='removeMartItem(scope.row,index)'>
+                        </el-button>
+                      </el-form-item>
+                    </el-form>
+                  </div>
+                </div>
+                <span slot="footer"
+                      class="dialog-footer">
+                  <!-- <el-button @click="scope.row.markVisible = false">取 消</el-button> -->
+                  <el-button type="primary"
+                             @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>
             </div>
           </template>
         </el-table-column>
@@ -128,17 +231,20 @@
           <template slot-scope="scope">
             <div>
               <el-button v-if='scope.row.type == 2'
-                         type="text">编辑</el-button>
+                         type="text"
+                         @click="savecolumn(scope.row)">编辑</el-button>
               <el-button v-if='scope.row.type == 1'
-                         type="text">保存</el-button>
+                         type="text"
+                         @click="savecolumn(scope.row)">保存</el-button>
             </div>
           </template>
         </el-table-column>
       </el-table>
       <div class="floor">
-        <div class="remove">删除</div>
+        <div class="remove"
+             @click="removeListItem">删除</div>
         <div class='add'
-             @click="dialogTableVisible = true">添加</div>
+             @click="addListItem">添加</div>
       </div>
     </div>
     <el-dialog title="声部选择"
@@ -150,79 +256,231 @@
                v-for="(item,index) in soundList"
                :key="index">
             <p>{{item.name }}</p>
-            <el-checkbox-group v-model="soundList[index]">
-              <el-checkbox :label="sound.name"
-                           v-for="(sound,index) in item.subjects"
-                           :key="index"
-                           :value='sound.id'></el-checkbox>
+            <el-checkbox-group v-model="soundLists[index]"
+                               @change='changeList'>
+              <!--  sound: this.activeSoundList[item].name,  // id
+                 jihua: '10', //计划招生人数
+                 yuji: '10', // 预计收费
+                 zhonglei: [], // 可选乐器种类
+                 fangshi: 2, // 乐器提供方式
+                 jiaopu: 'jiaopu1', // 教辅组合
+                 type: 1, // 操作
+                 id: this.activeSoundList[item].id, //声部id
+                 visible: false, // 当前乐器提供方式的pop提示框显示隐藏 -->
+              <el-checkbox :label="sound.id"
+                           @change="checkinlist({'id':sound.id,'sound':sound.name,'jihua':0,'yuji':0,'zhonglei':[],'fangshi':'','fangshiprice':0,'jiaopu':'','type':1,'typeVisible':false,'provideVisible':false,'markVisible':false,'goodsList':[],'markList':[{'name':'','goods':[],'price':''}],'markChioseList':[]})"
+                           v-for="(sound,indexs) in item.subjects"
+                           :key="indexs">{{sound.name }}</el-checkbox>
             </el-checkbox-group>
           </div>
         </div>
-
+      </div>
+      <p class='soundSubP'>当前选择声部数:{{chioseSoundNum}}</p>
+      <div class="btnWraps">
+        <div class="dialogBtn"
+             @click="generates">确定</div>
       </div>
     </el-dialog>
   </div>
 </template>
 <script>
 import store from '@/store'
-import { getSubject } from '@/api/buildTeam'
+import { getSubject, getDefaultSubject, getGoods } from '@/api/buildTeam'
 export default {
   data () {
     return {
+      markList: [], // 测试
       dialogTableVisible: true,
       soundList: [],
+      soundLists: [], // 存储选中项的声部id 记录变量
+      activeSoundList: [], // 记录存储后的所选中的声部列表
       checkList: [],
-      tableList: [{
-        sound: '长笛',
-        jihua: '10',
-        yuji: '10',
-        zhonglei: [],
-        fangshi: 2,
-        jiaopu: 'jiaopu1',
-        type: 1,
-        id: 1,
-        visible: false
-      },
-      {
-        sound: '短笛',
-        jihua: '10',
-        yuji: '10',
-        zhonglei: [],
-        fangshi: 9,
-        jiaopu: 'jiaopu1',
-        type: 1,
-        id: 1,
-        visible: false
-      }],
+      multipleSelection: [], // 列表选择的集合
+      isLoop: '', // 是否显示周期循环
+      tableRowData: {
+
+      } // 添加一行数据的模板
     }
   },
   methods: {
-    handleSelectionChange (e) { },
+    // 改变checkbox
+    changeList (e) {
+      // console.log(e);
+    },
+    handleSelectionChange (e) {
+      // 点击改变勾选
+      this.multipleSelection = e;
+    },
     handleclick (e) { },
     handleStatus (data) {
-      console.log(data)
-    }
+    },
+    // 点击添加按钮
+    addListItem () {
+      this.dialogTableVisible = true;
+    },
+    // 点击确认按钮生成表单
+    generates () {
+      this.dialogTableVisible = false;
+    },
+    removeListItem () {
+      // 点击删除按钮
+
+      for (let i = 0; i < this.activeSoundList.length; i++) {
+        for (let j = 0; j < this.multipleSelection.length; j++) {
 
+          if (this.activeSoundList[i].id == this.multipleSelection[j].id) {
+            this.activeSoundList.splice(i, 1);
+            // 遍历循环所有的group 删除所选id
+            for (let key in this.soundLists) {
+              if (this.soundLists[key].indexOf(this.multipleSelection[j].id) != -1) {
+                // console.log(this.soundLists[key], this.multipleSelection[j].id, this.soundLists[key].indexOf(this.multipleSelection[j].id));
+                this.soundLists[key].splice(this.soundLists[key].indexOf(this.multipleSelection[j].id), 1)
+              }
+            }
+          }
+
+        }
+      }
+    },
+    // 勾选选中框处理数据,存储勾选过的checkbox值
+    checkinlist (obj) {
+      // console.log(that);
+      let flag = false;
+      this.activeSoundList.map(item => {
+        if (item.id == obj.id) {
+          flag = true
+        }
+      })
+      if (!flag) {
+        this.activeSoundList.push(obj)
+      } else {
+        for (let i = 0; i < this.activeSoundList.length; i++) {
+          if (this.activeSoundList[i].id == obj.id) {
+            this.activeSoundList.splice(i, 1);
+          }
+        }
+      }
+    },
+    // 根据声部id获取可选乐器种类
+    chioseType (row) {
+      // 根据id查询可选类型种类
+      // let id = obj.id;
+      // console.log(row.id);
+      // 'subjectId': id, ' type'='INSTRUMENT'
+      getGoods({ 'subjectId': 3, 'type': 'INSTRUMENT' }).then(res => {
+        if (res.code == 200) {
+          row.goodsList = res.data;
+          // console.log(row);
+        }
+      })
+    },
+    // 点击关闭乐器种类
+    closechioseType (row) {
+      row.typeVisible = false;
+    },
+    // 根据声部id查询可选教辅
+    chioseMark (row) {
+      row.markVisible = true
+      let id = row.id;
+      getGoods({ 'subjectId': 3, 'type': 'ACCESSORIES' }).then(res => {
+        if (res.code == 200) {
+          row.markChioseList = res.data;
+          // console.log(row);
+        }
+      })
+    },
+    // 添加教辅
+    addMark (row) {
+      row.markList.push({ 'name': '', 'goods': [], 'price': '' })
+    },
+    // 删除教辅
+    removeMartItem (row, index) {
+      // console.log(index);
+      row.markList.splice(index, 1);
+    },
+    // 点击保存或编辑
+    savecolumn (row) {
+      row.type == 1 ? row.type = 2 : row.type = 1
+    }
+  },
+  filters: {
+    zhongleiFilter (val, list) {
+      let arr = []
+      for (let i = 0; i < list.length; i++) {
+        for (let j = 0; j < val.length; j++) {
+          if (val[j] == list[i].id) {
+            arr.push(list[i].name)
+          }
+        }
+      }
+      return arr.join(',')
+    },
+    fangshiFilter (val, price) {
+      let str = ''
+      if (val == 'FREE') {
+        str = '免费'
+      } else if (val == 'GROUP') {
+        str = '租赁'
+      } else if (val == 'LEASE') {
+        str = '借用'
+      }
+      return str + '费用:' + price
+    },
+    goodsFilter (val, list) {
+      let arr = [];
+      for (let i = 0; i < val.length; i++) {
+        for (let j = 0; j < list.length; j++) {
+          if (val[i] == list[j].id) {
+            arr.push(list[j].name);
+          }
+        }
+      }
+      return arr.join(',');
+    }
+    // markFilter(val){
+    //   for
+    //   let name = val.name;
+    //   let goods = val.goods.join(',');
+    //   let price = val.price
+    // }
   },
   mounted () {
     // console.log(store.getters.organ + '---');
     getSubject().then(res => {
-      console.log(res);
+      // console.log(res);
       this.soundList = res.data.rows;
-      // 生成动态的checkList
-      for (let key in this.this.soundList) {
-        this.$set(this.soundList, key, [])
+      // // 生成动态的checkList
+      for (let key in this.soundList) {
+        this.$set(this.soundLists, key, [])
       }
     })
     // 拿到刚才的存储的信息
     let payfor = this.$store.getters.payList;
-    console.log(payfor);
+    let topfor = this.$store.getters.topinfo;
+    let checkfor = this.$store.getters.checkinfo;
+    let type = topfor.type;
+    console.log(topfor);
+    this.isLoop = payfor.student.chiose;
+    // 获取存储的type值获取默认值
+    getDefaultSubject({ musicGroupId: type }).then(res => {
+      // console.log(res);
+    });
   },
   watch: {
-    soundList (val) {
-      console.log(val);
-    }
-  }
+
+  },
+  computed: {
+    // 返回当前选中声部数量
+    chioseSoundNum () {
+      let num = 0;
+      for (let key in this.soundList) {
+        // console.log(this.soundLists[key])
+        num += this.soundLists[key].length;
+
+      }
+      return num;
+    },
+  },
 }
 </script>
 <style lang="scss" >
@@ -362,4 +620,26 @@ export default {
     }
   }
 }
+.soundSubP {
+  height: 40px;
+  line-height: 40px;
+  background-color: #edeef0;
+  padding-left: 25px;
+}
+.btnWraps {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  margin-top: 150px;
+  .dialogBtn {
+    width: 188px;
+    height: 40px;
+    background: rgba(249, 114, 21, 1);
+    border-radius: 4px;
+    line-height: 40px;
+    color: #fff;
+    text-align: center;
+    cursor: pointer;
+  }
+}
 </style>

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

@@ -34,7 +34,7 @@
         <div v-show='activeIndex==0'>
           <teamBaseInfo @chioseTab='chioseTab' />
         </div>
-        <div v-show='activeIndex==1'>
+        <div v-if='activeIndex==1'>
           <teamSoundMoney />
         </div>
       </div>

+ 2 - 1
vue.config.js

@@ -16,7 +16,8 @@ const name = defaultSettings.title || 'vue Admin Template' // page title
 // const port = process.env.port || process.env.npm_config_port || 9528 // dev port
 // http://47.99.212.176:8000
 // http://192.168.3.28:8000
-let target = 'http://47.99.212.176:8000'
+let target = 'http://192.168.3.48:8000'
+// let target = 'http://47.99.212.176:8000'
 // let target = 'http://192.168.3.48:8000'
 // All configuration item explanations can be find in https://cli.vuejs.org/config/
 module.exports = {