Bläddra i källkod

Merge branch 'master' into dev

lex-xin 5 år sedan
förälder
incheckning
693b35db72

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
dist/index.html


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
dist/static/css/app.73889f56.css


+ 0 - 0
dist/static/css/chunk-libs.3dfb7769.css → dist/static/css/chunk-libs.5cf311f0.css


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
dist/static/js/app.815909d9.js


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
dist/static/js/chunk-libs.6a7009d2.js


+ 51 - 46
src/views/dashboard/index.vue

@@ -79,6 +79,9 @@
                    icon='el-icon-position'
                    v-show="paymentStatus"
                    @click="getMoney">开启缴费</el-button>
+        <!-- <el-button type='danger'
+                   icon='el-icon-position'
+                   @click="getMoney">开启缴费</el-button> -->
         <el-button type='warning'
                    icon="el-icon-news"
                    v-if='this.majorId'
@@ -96,10 +99,13 @@
                   style="width: 100%"
                   id='tableid'
                   @selection-change="handleSelectionChange">
+          <el-table-column type="index"
+                           width="45"></el-table-column>
           <el-table-column type="selection"
                            :selectable='checkboxT'
                            width="55"
                            v-if='this.majorStatus <= 2'>
+                
           </el-table-column>
           <el-table-column prop="city"
                            align="center"
@@ -206,31 +212,28 @@
     </el-dialog>
 
     <!-- 弹出框 -->
-    <el-dialog title="提示:请输入短信模板"
-               :visible.sync="isDialog"
-               width="30%">
-      <el-form v-model="dialogForm">
-        <el-form-item>
-          <el-input type="textarea"
-                    :disabled="isRadioDisabled"
-                    :rows="3"
-                    v-model="dialogForm.text"
-                    placeholder="请输入短信模板"></el-input>
-        </el-form-item>
-      </el-form>
-      <div class="radioWrap"
-           style="margin-top:20px">
-        <el-radio v-model="radio"
-                  :label="1">线上</el-radio>
-        <el-radio v-model="radio"
-                  :label="2">线下</el-radio>
-      </div>
+    <el-dialog title="提示:请输入短信模板" :visible.sync="isDialog" width="30%">
+        <div class="radioWrap" style="margin-bottom:20px">
+            <el-radio v-model="radioInstrument" :label="0">单乐器</el-radio>
+            <el-radio v-model="radioInstrument" :label="1">双乐器</el-radio>
+        </div>
+        <el-form v-model="dialogForm">
+            <el-form-item>
+                <el-input type="textarea"
+                        :disabled="isRadioDisabled"
+                        :rows="3"
+                        v-model="dialogForm.text"
+                        placeholder="请输入短信模板"></el-input>
+            </el-form-item>
+        </el-form>
+        <div class="radioWrap" style="margin-top:20px">
+            <el-radio v-model="radio" :label="1">线上</el-radio>
+            <el-radio v-model="radio" :label="2">线下</el-radio>
+        </div>
 
-      <span slot="footer"
-            class="dialog-footer">
-        <el-button type="primary"
-                   @click="gotoMoneyok">确 定</el-button>
-      </span>
+        <span slot="footer" class="dialog-footer">
+            <el-button type="primary" @click="gotoMoneyok">确 定</el-button>
+        </span>
     </el-dialog>
 
   </div>
@@ -288,6 +291,7 @@ export default {
       studentStatus: '-1', //单个学生调剂时学生状态
       isDialog: false, // 显示隐藏弹框
       radio: 2, // 线上线下的选择框
+      radioInstrument: 1, // 单乐器双乐器选择
       isRadioDisabled: false,
       dialogForm: {
         text: ''
@@ -493,29 +497,30 @@ export default {
       // window.open(`https://pay.dayaedu.com/#/order?classId=${this.majorId}&schoolName=${this.actionTearm}`)
     },
     gotoMoneyok () {
-      let val = this.dialogForm.text;
-      if (this.radio != 1) {
-        // 线上
-
-        if (!val.trim()) {
-          this.$message.error('请输入短信模板');
-          return;
-        }
-      }
-
-      updateClass(qs.stringify({ id: this.majorId, smsMsg: val, type: this.radio })).then(res => {
-        if (res.code == 200) {
-          this.$message.success("乐团报名成功请尽快缴费");
-          setTimeout(() => {
-            this.getstudentList();
-            this.majorStatus = 2;
-            this.isDialog = false;
-            this.dialogForm.text = '';
-          }, 1000);
-        } else {
-          this.$message.error(res.msg)
+        let val = this.dialogForm.text;
+        if (this.radio != 1 && !val.trim()) {
+            // 线上
+            this.$message.error('请输入短信模板');
+            return;
         }
-      });
+        updateClass(qs.stringify({ 
+            id: this.majorId, 
+            smsMsg: val, 
+            type: this.radio,
+            isSingle: this.radioInstrument })).then(res => {
+            if (res.code == 200) {
+                this.$message.success("乐团报名成功请尽快缴费");
+                setTimeout(() => {
+                    this.getstudentList();
+                    this.majorStatus = 2;
+                    this.paymentStatus = false; // 是否显示缴费
+                    this.isDialog = false;
+                    this.dialogForm.text = '';
+                }, 1000);
+            } else {
+                this.$message.error(res.msg)
+            }
+        });
     },
     qrcode () {
       let date = new Date().getTime()

+ 111 - 47
src/views/order/index.vue

@@ -2,24 +2,28 @@
   <div class='container'>
     <el-form :inline="true"
              v-model="topForm">
-      <el-form-item label="乐团"
-                    v-if='brancheList.length >0'>
-        <!-- <el-select v-model="topForm.team"
-                   placeholder="请选择乐团名称">
-          <el-option v-for='(item,index) in brancheList'
+      <el-form-item label="乐团" v-if='brancheList.length > 0'>
+        <el-select v-model="topForm.team" @change="handleItemChange"  placeholder="请选择分部名称">
+            <el-option v-for='(item,index) in brancheList'
                      :key='index'
-                     :label="item.branchName"
-                     :value="item.branchId"></el-option>
-        </el-select> -->
+                     :label="item.label"
+                     :value="item.value"></el-option>
+        </el-select>
+        <el-select v-model="topForm.instruments"  placeholder="请选择乐团名称">
+            <el-option v-for='(item,index) in instrumentList'
+                     :key='index'
+                     :label="item.label"
+                     :value="item.value"></el-option>
+        </el-select>
         <!-- :props='props' -->
-        <el-cascader :options="brancheList"
+        <!-- <el-cascader :options="brancheList"
                      clearable
                      placeholder="请选择分部已经乐团"
                      v-model="topForm.team"
                      :props='props'
                      @active-item-change="handleItemChange"
                      @change="handleChange">
-        </el-cascader>
+        </el-cascader> -->
       </el-form-item>
       <el-form-item label="收费类型">
         <el-select v-model="topForm.money"
@@ -46,12 +50,18 @@
     </el-form>
     <div class="tableWrap">
       <el-table :data='tableList'
-                id='tableid'>
+                id='tableid'
+                height="calc(100vh - 122px)"
+                show-summary
+                :summary-method="getSummaries">
+        <el-table-column type="index"
+                           width="55"></el-table-column>
         <el-table-column align="center"
                          label="学生姓名"
                          prop='userName'></el-table-column>
         <el-table-column align="center"
                          label="订单编号"
+                         width="200"
                          prop='orderNo'></el-table-column>
         <el-table-column align="center"
                          label="收款账户"
@@ -63,10 +73,6 @@
                          label="到账时间"
                          prop='payTime'></el-table-column>
         <el-table-column align="center"
-                         label="备注"
-                         :formatter="filterRemark">
-        </el-table-column>
-        <el-table-column align="center"
                          label="课程费用"
                          prop='tuiFee'></el-table-column>
         <el-table-column align="center"
@@ -75,6 +81,11 @@
         <el-table-column align="center"
                          label="教辅费用"
                          prop="sdFee"></el-table-column>
+        <el-table-column align="left"
+                         label="备注"
+                         width="300"
+                         :formatter="filterRemark">
+        </el-table-column>
       </el-table>
       <!-- <div class="paginationWrap"> -->
       <!-- <el-pagination background
@@ -97,14 +108,16 @@ export default {
   data () {
     return {
       topForm: {
-        team: [],
+        team: '', 
+        instruments: '', 
         money: ''
       },
       tableList: [],
       limit: 20,
       total: 0,
       page: 1,
-      brancheList: [],
+      brancheList: [],// 分部列表
+      instrumentList: [], // 乐团列表
       idTmr: '',
       tableId: '',
       props: {
@@ -128,7 +141,7 @@ export default {
   },
   mounted () {
     this.getBranches();
-    this.getstudentList();
+    // this.getstudentList();
   },
   methods: {
     handleCurrentChange (val) {
@@ -151,23 +164,34 @@ export default {
               children: []
             })
           })
-          // console.log(arr)
           this.brancheList = arr
-
         }
       });
     },
-    getstudentList () {
-      // this.
-      checkOrderList(qs.stringify({ branchId: this.branchId, classId: this.classId, type: this.topForm.money })).then(res => {
-        this.tableList = res.data;
-      })
+    getstudentList (callBack) {
+        // this.
+        // console.log(this.topForm.team)
+        // console.log(this.topForm.instruments)
+        // console.log(`branchId: ${this.branchId}, classId: ${this.classId}`)
+        // return false
+        let params = this.topForm
+        checkOrderList(qs.stringify({ 
+            branchId: params.team, 
+            classId: params.instruments, 
+            type: params.money })).then(res => {
+            this.tableList = res.data;
+            // 回调函数
+            if(callBack && typeof callBack == 'function') {
+                callBack()
+            }
+        })
     },
     resetStudentList () {
       this.branchId = "";
       this.classId = '';
       this.topForm.money = "";
-      this.topForm.team = [];
+      this.topForm.team = '';
+      this.topForm.instruments = '';
       this.page = 1;
       this.getstudentList();
     },
@@ -180,7 +204,14 @@ export default {
       // var curTbl = document.getElementById('tableid');
       // this.tableId = curTbl;
       // console.log(curTbl);
-      this.method5('tableid');
+      this.topForm.money = "";
+      this.topForm.team = '';
+      this.topForm.instruments = '';
+      this.getstudentList(() => {
+          setTimeout(() => {
+              this.method5('tableid');
+          }, 100);
+      })
     },
 
     // 导出
@@ -265,35 +296,68 @@ export default {
     },
     // 多选框选项卡
     handleItemChange (val) {
-      // 发请求 获取分部下的乐团
-      if (val.length > 0) {
-        getMusicTeams(qs.stringify({ branchId: val[0] })).then(res => {
-          // res.data.rows
-          // 1.格式化数据
-          // 2.追加数据到相应的位置 
-          if (res.code == 200) {
-            let arr = [];
-            res.data.rows.map(item => {
-              arr.push({
-                label: item.name,
-                value: item.id
-              })
-            })
-            for (let item in this.brancheList) {
-              if (this.brancheList[item].value == val) {
-                this.brancheList[item].children = arr;
-              }
+        // 发请求 获取分部下的乐团
+        if (!val) {
+            return false
+        }
+        getMusicTeams(qs.stringify({ branchId: val })).then(res => {
+            // res.data.rows
+            // 1.格式化数据
+            // 2.追加数据到相应的位置 
+            if (res.code == 200) {
+                let arr = [];
+                res.data.rows.map(item => {
+                    arr.push({
+                        label: item.name,
+                        value: item.id
+                    })
+                })
+                this.instrumentList = arr
+                // for (let item in this.brancheList) {
+                //     if (this.brancheList[item].value == val) {
+                //         this.brancheList[item].children = arr;
+                //     }
+                // }
             }
-          }
 
         })
-      }
     },
     handleChange (val) {
       if (val) {
         this.branchId = val[0];
         this.classId = val[1];
       }
+    },
+
+    getSummaries(param) {
+        const { columns, data } = param;
+        const sums = [];
+        columns.forEach((column, index) => {
+            if (index === 0) {
+                sums[index] = '总价';
+                return;
+            }
+            if(index === 2 || index === 3) {
+                sums[index] = 'N/A'
+                return
+            }
+            const values = data.map(item => Number(item[column.property]));
+            if (!values.every(value => isNaN(value))) {
+                sums[index] = values.reduce((prev, curr) => {
+                const value = Number(curr);
+                if (!isNaN(value)) {
+                    return prev + curr;
+                } else {
+                    return prev;
+                }
+                }, 0);
+                sums[index] += ' 元';
+            } else {
+                sums[index] = 'N/A';
+            }
+        });
+
+        return sums;
     }
   }
 }

+ 2 - 2
vue.config.js

@@ -15,8 +15,8 @@ const name = defaultSettings.title || '大雅报名管理'; // page title
 // port = 9528 npm run dev OR npm run dev --port = 9528
 const port = process.env.port || process.env.npm_config_port || 9528; // dev port
 // const targetUrl = 'http://testpay.dayaedu.com'
-const targetUrl = 'https://manage.dayaedu.com'
-// const targetUrl = 'http://192.168.3.38:8088'
+// const targetUrl = 'https://manage.dayaedu.com'
+const targetUrl = 'http://192.168.3.27:8088'
 // All configuration item explanations can be find in https://cli.vuejs.org/config/
 module.exports = {
 	/**

Vissa filer visades inte eftersom för många filer har ändrats