| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935 |
- <template>
- <div class="container">
- <div class="lt">
- <div class="top">
- <ul>
- <li @click="goPage('member')">
- <img src="../assets/img/main/member.png" height="54" width="54"/>
- <div class="liRight">
- <h5>会员人数</h5>
- <span>{{AllCount}}</span>
- </div>
- <div class="btLine">
- <em class="emlt">
- <i class="el-icon-caret-top"></i>
- 今日新增 {{NowCount}}
- </em>
- <em class="emrt">
- <i class="el-icon-caret-top"></i>
- 昨日新增 {{CountAdd}}
- </em>
- </div>
- </li>
- <li @click="goPage('record')">
- <img src="../assets/img/main/appoint.png" height="54" width="54"/>
- <div class="liRight">
- <h5>今日预约人数</h5>
- <span>{{TodayOrderNum}}</span>
- </div>
- <div class="btLine">
- <em class="emlt">
- <i class="el-icon-caret-top"></i>
- 昨日预约 {{YestodayOrderNum}}
- </em>
- <em class="emrt">
- <i class="el-icon-caret-top"></i>
- 较昨日新增 {{TodayIncreaseNum}}
- </em>
- </div>
- </li>
- <li @click="goPage('lesson')">
- <img src="../assets/img/main/lesson.png" height="54" width="54"/>
- <div class="liRight">
- <h5>课程数量</h5>
- <span>{{ClassNum}}</span>
- </div>
- <div class="btLine">
- <em class="emlt">
- <i class="el-icon-caret-top"></i>
- 已预约课程 {{TodayOrderSttNum}}
- </em>
- </div>
- </li>
- </ul>
- </div>
- <div class="finish">
- <div class="title">
- <h5>下课管理</h5>
- <!-- <span>{{getNowDate}}</span>-->
- </div>
- <ul>
- <li v-for="c in PreFinishList">
- <div class="finListTitle" :style="{ background:c.ClassColor }">
- {{c.ClassName}}
- </div>
- <div class="context">
- <div class="ctl">
- <span>上课时间:{{c.BeginStr}} - {{c.EndStr}}</span>
- <span>预约人数:{{c.OrderNum}} 人</span>
- </div>
- <em>{{c.BeginTime|parseDate}}</em>
- <el-button type="primary" plain @click="checkClassOverPrepare(c)">下课</el-button>
- </div>
- </li>
- <span class="tips" v-if="PreFinishList == 0">
- <img src="../assets/img/main/empty.jpg" height="116" width="92"/>
- <br>
- 暂无下课课程
- </span>
- </ul>
- </div>
- <div class="appoint">
- <div class="title">
- <h5>预约课程</h5>
- <span>{{getNowDate}}</span>
- </div>
- <div class="appointCard">
- <el-card class="box-card" v-for="c in classList" @click.native="goLesson">
- <div class="cardTitle blue" :style="{ color:c.ClassColor }">
- {{c.ClassName}}
- </div>
- <span>
- {{c.BeginStr}}
- </span>
- <em>最大预约人数 <i>{{c.OrderToplimit}}</i></em>
- <em>已预约人数 <i>{{c.OrderNum}}</i></em>
- <em>预约状态
- <s class="blue" v-if="c.WxOrder > 0">可预约</s>
- <s class="red" v-if="c.WxOrder == 0">不可预约</s>
- </em>
- </el-card>
- <span class="tips" v-if="classList == 0">
- <img src="../assets/img/main/empty.jpg" height="116" width="92"/>
- <br>
- 暂无预约课程,请先添加
- <router-link to="/lessonManage">课程表</router-link>
- </span>
- </div>
- </div>
- </div>
- <div class="rt">
- <div class="rtContext">
- <div class="rtTitle">
- <h5>最新预约</h5>
- <span @click="goPage('appoint','second')">查看全部</span>
- </div>
- <ul>
- <!-- TodayVipOrder-->
- <li v-for="as in appointList" @click="goAppointDetail(as.UserName)">
- <div class="asTitle">
- <img src="../assets/img/main/Oval.png" alt="">
- <span>
- {{as.UserName}}
- {{as.Phone}}
- <em>预约时间: {{as.Base.CreatedAt |parseDate}}</em>
- </span>
- </div>
- <div class="asContent">
- <span>上课时间:<em>{{as.CurrentDate.substr(5,6)}} {{as.BeginStr}}</em></span>
- <span>预约状态:
- <em v-if="as.Status == 1" class="green">已预约</em>
- <em v-if="as.Status == 2" class="red">已取消</em>
- <em v-if="as.Status == 3" class="yellow">预约未到</em>
- <em v-if="as.Status == 4">已完成</em>
- </span>
- <span>预约课程:<s class="blue"
- :style="{ background:as.ClassColor }"> {{as.ClassName}}</s></span>
- <span>剩余课时:<em :class="[{'red':as.RemainHour == 0}]">{{as.RemainHour}}课时</em></span>
- </div>
- </li>
- <span class="tips middleTips" v-if="appointList == 0">
- <img src="../assets/img/main/empty.jpg" height="116" width="92"/>
- <br>
- 暂无预约,可进入
- <router-link to="/appoint">预约管理</router-link>
- </span>
- </ul>
- </div>
- </div>
- </div>
- </template>
- <script>
- import {
- ClassPreFinishListQuery,
- WaitingBeginClassList,
- ClassOngoingList,
- OrderStatistics,
- VipUserStatistics,
- ClassStatistics,
- ClassOverPrepare,
- VipUserOrderQuery,
- LastOrderQuery,
- } from "../api/getApiRes";
- let qs = require('qs');
- export default {
- data() {
- return {
- editableTabsValue: '1',
- getNowDate: getNowDate(),
- classList: [],
- PreFinishList: [],
- appointList: [],
- TodayClassOrder: [],
- TodayVipOrder: [],
- AllCount: 0,
- YesterdayCount: 0,
- YestodayOrderNum: 0,
- NowCount: 0,
- CountAdd: 0,
- TodayIncreaseNum: 0,
- TodayOrderNum: 0,
- ClassNum: 0,
- TodayOrderSttNum: 0,
- }
- },
- mounted() {
- let that = this;
- // 下课管理
- this.getVipUserStatistics();
- this.getClassStatistics();
- this.ClassQuery();
- this.getVipUserOrderQuery();
- // 预约统计
- this.getOrderStatistics();
- this.getWaitingBeginClassList();
- this.timer = setInterval(() => {
- that.getVipUserOrderQuery();
- this.getVipUserStatistics();
- this.getClassStatistics();
- this.ClassQuery();
- this.getOrderStatistics();
- this.getWaitingBeginClassList();
- }, 10000);
- },
- destroyed() {
- clearInterval(this.timer);//页面销毁时清除定时器
- },
- methods: {
- goLesson(){
- this.$router.push({
- path: '/appoint',
- })
- },
- goAppointDetail(name){
- this.$router.push({
- path: '/appoint',
- query: {
- page:'second',
- name:name
- }
- })
- },
- goPage(url,page) {
- this.$router.push({
- path: '/' + url,
- query: {
- page:page
- }
- })
- },
- // 会员统计
- getVipUserStatistics() {
- let that = this;
- let param = {
- token: localStorage.token,
- };
- let postdata = qs.stringify(param);
- VipUserStatistics(postdata).then(res => {
- let json = res;
- if (json.Code == 0) {
- that.AllCount = json.Rs.AllCount;
- that.YesterdayCount = json.Rs.YesterdayCount;
- that.NowCount = json.Rs.NowCount;
- that.CountAdd = json.Rs.CountAdd;
- } else {
- if (json.Code == 1010) {
- that.$message.error(json.Memo);
- that.$router.push({path: '/login', query: {status: 1}});
- return false
- }else{
- that.$message.error(json.Memo);
- }
- }
- })
- },
- // 课程统计
- getClassStatistics() {
- let that = this;
- let param = {
- token: localStorage.token,
- };
- let postdata = qs.stringify(param);
- ClassStatistics(postdata).then(res => {
- let json = res;
- if (json.Code == 0) {
- that.ClassNum = json.Rs.ClassNum;
- that.TodayOrderSttNum = json.Rs.TodayOrderSttNum;
- } else {
- that.$message.error(json.Memo);
- }
- })
- },
- getOrderStatistics() {
- let that = this;
- that.loading = true;
- let param = {
- token: localStorage.token,
- };
- let postdata = qs.stringify(param);
- OrderStatistics(postdata).then(res => {
- let json = res;
- if (json.Code == 0) {
- that.loading = false;
- if (json.Rs) {
- that.TodayIncreaseNum = json.Rs.TodayIncreaseNum;
- that.TodayOrderNum = json.Rs.TodayOrderNum;
- that.YestodayOrderNum = json.Rs.YestodayOrderNum;
- }
- } else {
- that.$message.error(json.Memo);
- }
- })
- },
- checkClassOverPrepare(row) {
- let that = this;
- let param = {
- token: localStorage.token,
- stdId: row.StdId,
- };
- let postdata = qs.stringify(param);
- ClassOverPrepare(postdata).then(res => {
- let json = res;
- if (json.Code == 0) {
- that.goFinish(row);
- } else {
- that.$message.error(json.Memo);
- }
- })
- },
- goFinish(row) {
- this.$router.push({
- path: '/finishDetail', query: {
- id: row.StdId,
- classId: row.ClassId,
- ClassName: row.ClassName,
- BeginTime: row.BeginTime,
- }
- });
- },
- getWaitingBeginClassList() {
- let that = this;
- that.loading = true;
- let param = {
- token: localStorage.token,
- };
- let postdata = qs.stringify(param);
- WaitingBeginClassList(postdata).then(res => {
- let json = res;
- if (json.Code == 0) {
- that.loading = false;
- that.classList = json.Rs;
- } else {
- that.$message.error(json.Memo);
- }
- })
- },
- // 下课管理
- ClassQuery() {
- let that = this;
- that.loading = true;
- let param = {
- token: localStorage.token,
- };
- let postdata = qs.stringify(param);
- ClassOngoingList(postdata).then(res => {
- let json = res;
- if (json.Code == 0) {
- that.loading = false;
- if (json.Rs) {
- that.PreFinishList = json.Rs;
- }
- } else {
- that.$message.error(json.Memo);
- }
- })
- },
- // 最新预约
- getVipUserOrderQuery() {
- let that = this;
- that.loading = true;
- let param = {
- token: localStorage.token,
- classId: 0,
- orderDate: globalcurrent(),
- stdId: 0,
- };
- let postdata = qs.stringify(param);
- // VipUserOrderQuery(postdata).then(res => {
- LastOrderQuery(postdata).then(res => {
- let json = res;
- if (json.Code == 0) {
- that.loading = false;
- if (json.Rs) {
- that.appointList = json.Rs;
- }
- } else {
- that.$message.error(json.Memo);
- }
- })
- }
- },
- filters: {
- parseDate: function (value) {
- if (!value) {
- return false
- } else {
- let res = nonTfmtDatetoLength(value, 10).substr(5, 10)
- return res;
- }
- },
- },
- watch: {
- $route(to) {
- if (to.name == 'Main') {
- this.getVipUserStatistics();
- this.getClassStatistics();
- this.ClassQuery();
- this.getVipUserOrderQuery();
- this.getOrderStatistics();
- this.getWaitingBeginClassList();
- } else {
- clearInterval(this.timer);//页面销毁时清除定时器
- }
- },
- },
- }
- </script>
- <style scoped>
- ul, li {
- list-style: none;
- margin: 0;
- padding: 0;
- }
- em {
- font-style: normal;
- }
- .container {
- width: 100%;
- overflow: hidden;
- display: block;
- margin: 0 auto;
- padding-bottom: 60px;
- }
- .container .lt {
- width: 1173px;
- float: left;
- margin-top: 0px;
- }
- .container .rt {
- width: 436px;
- height: 100%;
- float: right;
- }
- .lt .top {
- width: 100%;
- overflow: hidden;
- display: block;
- margin: 0 auto;
- }
- .lt .top li {
- width: 377px;
- height: 140px;
- float: left;
- background: #fff;
- border-radius: 12px;
- margin-right: 20px;
- cursor: pointer;
- }
- .lt .top li:nth-child(3) {
- margin-right: 0;
- }
- .top li img {
- float: left;
- margin-top: 17px;
- margin-left: 30px;
- margin-right: 24px;
- }
- .top li .liRight {
- width: 200px;
- float: left;
- margin-top: 17px;
- }
- .top .liRight h5 {
- margin: 0;
- padding: 0;
- text-align: left;
- }
- .top .liRight span {
- width: 100%;
- overflow: hidden;
- display: block;
- margin: 0 auto;
- text-align: left;
- font-size: 26px;
- font-family: Arial;
- margin-top: 7px;
- margin-bottom: 20px;
- }
- .btLine {
- width: 84%;
- overflow: hidden;
- display: block;
- margin: 0 auto;
- border-top: 1px solid #F0F2F5;
- padding-top: 17px;
- }
- .btLine em {
- font-size: 14px;
- }
- .btLine .emlt {
- width: 50%;
- float: left;
- text-align: left;
- }
- .btLine i {
- font-size: 18px;
- color: #BDBDBD;
- }
- .emlt i {
- float: left;
- }
- .finish {
- width: 100%;
- min-height: 358px;
- overflow: hidden;
- display: block;
- margin: 0 auto;
- background: #fff;
- margin-top: 15px;
- border-radius: 12px;
- padding-top: 15px;
- padding-bottom: 0px;
- }
- .finish .title {
- overflow: hidden;
- display: block;
- margin: 0 auto;
- padding-left: 30px;
- }
- .finish .title h5 {
- margin: 0;
- float: left;
- font-size: 18px;
- }
- .finish .title span {
- float: right;
- margin-right: 43px;
- font-size: 14px;
- color: #717171;
- }
- .finish ul {
- overflow: hidden;
- display: block;
- margin: 0 auto;
- padding-left: 30px;
- padding-right: 30px;
- margin: 0 auto;
- margin-top: 10px;
- }
- .finish ul li {
- width: 347px;
- height: 149px;
- overflow: hidden;
- float: left;
- margin-bottom: 14px;
- }
- .finish ul li:nth-child(2) {
- margin-left: 24px;
- margin-right: 24px;
- }
- .finish ul li:nth-child(5) {
- margin-left: 24px;
- margin-right: 24px;
- }
- .finish li .finListTitle {
- width: 100%;
- height: 35px;
- line-height: 35px;
- overflow: hidden;
- display: block;
- margin: 0 auto;
- background-color: #3799FF;
- border-top-left-radius: 7px;
- border-top-right-radius: 7px;
- color: #fff;
- }
- .finish li .context {
- width: 344px;
- overflow: hidden;
- display: block;
- margin: 0 auto;
- border: 1px solid #E8E8E8;
- border-top: none;
- padding-top: 16px;
- padding-bottom: 16px;
- border-bottom-left-radius: 7px;
- border-bottom-right-radius: 7px;
- }
- .finish .context em {
- width: 85px;
- overflow: hidden;
- display: block;
- margin: 0 auto;
- height: 40px;
- line-height: 30px;
- color: #BDBDBD;
- }
- .context .ctl {
- width: 211px;
- float: left;
- padding-left: 16px;
- margin-right: 20px;
- }
- .ctl span {
- width: 100%;
- height: 30px;
- line-height: 30px;
- overflow: hidden;
- display: block;
- margin: 0 auto;
- background-color: #F8F8F8;
- color: #404040;
- font-size: 14px;
- text-align: left;
- padding-left: 20px;
- margin-bottom: 15px;
- }
- .ctl span:nth-child(2) {
- margin-bottom: 0px;
- }
- /deep/ .el-button--primary.is-plain {
- background-color: #fff;
- }
- /deep/ .el-button--primary.is-plain:hover {
- color: #005EA2 !important;
- }
- .blue {
- color: #3799FF;
- }
- .appoint {
- width: 100%;
- overflow: hidden;
- display: block;
- margin: 0 auto;
- background: #fff;
- margin-top: 15px;
- border-radius: 12px;
- padding-top: 15px;
- padding-bottom: 1px;
- }
- .appoint .title {
- overflow: hidden;
- display: block;
- margin: 0 auto;
- padding-left: 30px;
- }
- .appoint .title h5 {
- margin: 0;
- float: left;
- font-size: 18px;
- }
- .appoint .title span {
- float: right;
- margin-right: 43px;
- font-size: 14px;
- color: #717171;
- }
- .appoint .appointCard {
- min-height: 195px;
- overflow: hidden;
- display: block;
- margin: 0 auto;
- padding-top: 25px;
- padding-bottom: 25px;
- padding-left: 30px;
- padding-right: 30px;
- }
- /deep/ .el-card {
- width: 150px;
- float: left;
- margin-right: 31px;
- padding: 0;
- border-radius: 12px;
- }
- /deep/ .el-card:nth-child(last) {
- margin-right: 0;
- }
- /deep/ .el-card__body {
- padding: 0;
- }
- .cardTitle {
- width: 100%;
- overflow: hidden;
- display: block;
- margin: 0 auto;
- height: 40px;
- line-height: 40px;
- background: #F0F2F5;
- }
- .appointCard span {
- width: 100%;
- overflow: hidden;
- display: block;
- margin: 0 auto;
- color: #777777;
- font-family: Arial;
- margin-top: 10px;
- margin-bottom: 10px;
- font-size: 16px;
- }
- .appointCard em {
- overflow: hidden;
- display: block;
- margin: 0 auto;
- font-size: 12px;
- margin-bottom: 20px;
- text-align: left;
- padding-left: 16px;
- padding-right: 16px;
- }
- .appointCard em i {
- float: right;
- color: #000000;
- padding-right: 3px;
- }
- .appointCard em s {
- /*width: 47px;*/
- height: 20px;
- line-height: 20px;
- text-align: center;
- font-style: normal;
- text-decoration: none;
- float: right;
- border-radius: 3px;
- padding: 0 3px;
- }
- .appointCard em s.blue {
- background-color: #E5F2FF;
- color: #3799FF;
- }
- .appointCard em s.red {
- background-color: #E5F2FF;
- color: rgb(204,2,2);
- }
- .rtContext {
- width: 100%;
- overflow: hidden;
- display: block;
- margin: 0 auto;
- margin-top: 0px;
- background: #fff;
- padding: 0;
- border-radius: 12px;
- min-height: 826px;
- background: #fff;
- }
- .rtContext .rtTitle {
- overflow: hidden;
- display: block;
- margin: 0 auto;
- padding: 10px 30px;
- }
- .rtTitle h5 {
- margin: 0;
- float: left;
- font-size: 18px;
- }
- .rtTitle span {
- float: right;
- font-size: 14px;
- color: #BDBDBD;
- cursor: pointer;
- }
- .rtContext ul {
- width: 100%;
- overflow: hidden;
- display: block;
- height: 100%;
- overflow: hidden;
- overflow-y: scroll;
- margin: 0 auto;
- padding-left: 30px;
- padding-right: 30px;
- }
- .rtContext li {
- width: 100%;
- overflow: hidden;
- display: block;
- margin: 0 auto;
- border-bottom: 1px solid #F0F2F5;
- padding-top: 30px;
- padding-bottom: 10px;
- cursor: pointer;
- }
- .asTitle {
- width: 100%;
- height: 30px;
- overflow: hidden;
- display: block;
- margin: 0 auto;
- text-align: left;
- line-height: 20px;
- color: #000000;
- font-size: 14px;
- }
- .asTitle img {
- float: left;
- margin-right: 5px;
- }
- .asTitle span {
- /*width: 26px;*/
- min-width: 300px;
- height: 30px;
- line-height: 26px;
- float: left;
- margin-right: 10px;
- }
- .asTitle em {
- float: right;
- text-align: right;
- }
- .asContent {
- width: 100%;
- overflow: hidden;
- display: block;
- margin: 0 auto;
- }
- .asContent span {
- width: 50%;
- float: left;
- font-size: 14px;
- color: #BDBDBD;
- margin-bottom: 10px;
- text-align: left;
- text-indent: 8px;
- }
- .asContent span em {
- color: #000;
- text-align: left;
- }
- .asContent span s {
- text-decoration: none;
- color: #000;
- border-radius: 250px;
- padding: 3px 5px;
- }
- .asContent span s.blue {
- background-color: #E5F2FF;
- }
- .box-card {
- cursor: pointer;
- }
- .box-card em {
- font-style: normal;
- }
- i {
- font-style: normal;
- }
- .asContent .green {
- color: #25CC42;
- }
- .asContent .red {
- color: red;
- }
- .asContent .yellow {
- color: #FFDD00;
- }
- /deep/ a {
- color: #03B1FF;
- }
- .tips {
- color: #333;
- font-size: 14px!important;
- overflow: hidden;
- display: block;
- margin: 0 auto;
- margin-top: 10px;
- line-height: 30px;
- }
- .middleTips {
- margin-top: 180px;
- }
- </style>
|