courses.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873
  1. <template>
  2. <div class="context">
  3. <div class="panel">
  4. <h5>课程管理
  5. </h5>
  6. <div class="likeTab">
  7. <el-button type="primary" @click="goType('courses')" size="mini">当前课程</el-button>
  8. <el-button type="" @click="goType('coursesHistory')" size="mini">历史记录</el-button>
  9. </div>
  10. <div class="panel-body">
  11. <div class="panel_control">
  12. <el-row :gutter="20">
  13. <el-col :span="7">
  14. <el-date-picker v-model="panel.timeScope" type="daterange" range-separator="至"
  15. start-placeholder="开始日期" end-placeholder="结束日期">
  16. </el-date-picker>
  17. </el-col>
  18. <el-col :span="4">
  19. <el-button size="" type="primary" @click="query" :disabled="serachBtnStatus" plain>查询
  20. </el-button>
  21. </el-col>
  22. </el-row>
  23. </div>
  24. </div>
  25. </div>
  26. <div class="table">
  27. <el-table :data="tableData" border is-horizontal-resize :default-sort="{prop: 'date', order: 'descending'}"
  28. element-loading-background="rgba(0, 0, 0, 0.8)" class="" @selection-change="handleSelectionChange">
  29. >
  30. <el-table-column label="序号" type="index" width="50" align="center" fixed>
  31. <template scope="scope">
  32. <span>{{ (start) + scope.$index + 1 }}</span>
  33. </template>
  34. </el-table-column>
  35. <el-table-column prop="BeginTime" label="上课时间" width="160" :formatter="filterFmtDate" fixed>
  36. </el-table-column>
  37. <el-table-column prop="ClassName" label="课程" sortable width="120" fixed>
  38. <template slot-scope="scope">
  39. <span class="lessonSpan"
  40. :style="{background:scope.row.ClassColor}">{{ scope.row.ClassName }}</span>
  41. </template>
  42. </el-table-column>
  43. <el-table-column prop="AgName" label="评分课程" width="110" sortable/>
  44. <el-table-column prop="ConsumeHour" label="消耗课时" width="110" sortable>
  45. </el-table-column>
  46. <el-table-column prop="OrderNum" label="实际预约" width="110" sortable>
  47. </el-table-column>
  48. <el-table-column prop="SvName" label="区域" width="110" sortable>
  49. </el-table-column>
  50. <el-table-column prop="WxOrder" label="预约状态" width="110" sortable>
  51. <template slot-scope="scope">
  52. <span v-if="scope.row.WxOrder == 1" style="color: yellowgreen">可约</span>
  53. <span v-if="scope.row.WxOrder == 0" style="color: red">不可约</span>
  54. </template>
  55. </el-table-column>
  56. <el-table-column prop="ClassType" label="课程类型" width="110" sortable>
  57. <template slot-scope="scope">
  58. <span v-if="scope.row.ClassType == 1">团课</span>
  59. <span v-if="scope.row.ClassType == 3">私教</span>
  60. <span v-if="scope.row.ClassType == 2 && scope.row.PkNum == 2">两队PK</span>
  61. <span v-if="scope.row.ClassType == 2 && scope.row.PkNum == 3">三队PK</span>
  62. </template>
  63. </el-table-column>
  64. <el-table-column prop="FinishClass" label="当前状态" width="110" sortable>
  65. <template slot-scope="scope">
  66. <span v-if="scope.row.FinishClass == 0" style="color: red">未上课</span>
  67. <span v-if="scope.row.FinishClass == 1">已下课</span>
  68. <span v-if="scope.row.FinishClass == 2" style="color: yellowgreen">已上课</span>
  69. <span v-if="scope.row.FinishClass == 3">准备上课</span>
  70. <span v-if="scope.row.FinishClass == 4">已完成</span>
  71. </template>
  72. </el-table-column>
  73. <el-table-column prop="Status" label="操作">
  74. <template slot-scope="scope">
  75. <el-button type="primary" round size="mini" v-if="scope.row.FinishClass == 0"
  76. @click="showDialogMemberVisible(scope.row)">
  77. 上课
  78. </el-button>
  79. <el-button type="primary" round size="mini"
  80. v-if="scope.row.FinishClass == 3 || scope.row.FinishClass == 2" @click="seeEdit(scope.row)">
  81. 管理
  82. </el-button>
  83. <!--修改区域 todo-->
  84. <el-button type="primary" round plain size="mini" v-if="scope.row.FinishClass == 3"
  85. @click="changeShopVenue(scope.row)">
  86. 编辑
  87. </el-button>
  88. <!--已完成才能看详情-->
  89. <el-button type="primary" round plain size="mini"
  90. v-if="scope.row.FinishClass == 1 || scope.row.FinishClass == 4"
  91. @click="seeDetail(scope.row)">
  92. 详情
  93. </el-button>
  94. </template>
  95. </el-table-column>
  96. </el-table>
  97. <br>
  98. <el-pagination background :total="pageination.total" :page-size="pageination.pageItem"
  99. @current-change="pageChange" :current-page.sync="cur_page"></el-pagination>
  100. </div>
  101. <el-dialog :title="dialogTitle" :visible.sync="dialogMemberVisible" width="650px">
  102. <div class="dialogContent">
  103. <h5 class="classNames">{{ className }}</h5>
  104. <div class="">
  105. <el-form ref="form" :model="form" label-width="160px">
  106. <el-form-item label="评分" :required="true">
  107. <el-radio-group v-model="form.isScore" style="margin-left: -180px">
  108. <el-radio label="0">关闭</el-radio>
  109. <el-radio label="1">开启</el-radio>
  110. </el-radio-group>
  111. </el-form-item>
  112. <el-form-item v-if="form.isScore == 1" label="动作分组" :required="true">
  113. <el-select v-model="form.agId" filterable placeholder="请选择">
  114. <el-option v-for="item in form.actionList" :key="item.AgId" :label="item.AgName"
  115. :value="item.AgId">
  116. </el-option>
  117. </el-select>
  118. </el-form-item>
  119. <el-form-item label="区域" :required="true">
  120. <el-select v-model="form.svId" filterable placeholder="请选择" @change="changeLocationValue">
  121. <el-option v-for="item in form.svList" :key="item.SvId" :label="item.Name"
  122. :value="item.SvId">
  123. </el-option>
  124. </el-select>
  125. </el-form-item>
  126. <el-form-item label="类型" :required="true">
  127. <el-select v-model="form.classType" filterable placeholder="请选择">
  128. <el-option v-for="item in form.ClassTypeOptions" :key="item.value" :label="item.label"
  129. :value="item.value">
  130. </el-option>
  131. </el-select>
  132. </el-form-item>
  133. <el-form-item label="组队方式" v-if="form.classType == 2">
  134. <el-select v-model="form.pkNum" filterable placeholder="请选择">
  135. <el-option v-for="item in form.PKTypeOptions" :key="item.value" :label="item.label"
  136. :value="item.value">
  137. </el-option>
  138. </el-select>
  139. </el-form-item>
  140. <!--选教练,非必选-->
  141. <el-form-item label="上课教练">
  142. <!--<el-transfer filterable v-model="dialogCoachValue" :data="form.dialogCoachdata"-->
  143. <!--:titles="['教练列表', '已添加教练']"></el-transfer>-->
  144. <el-select v-model="dialogCoachValue" filterable placeholder="请选择">
  145. <el-option v-for="item in form.dialogCoachdata" :key="item.key" :label="item.label"
  146. :value="item.value">
  147. </el-option>
  148. </el-select>
  149. </el-form-item>
  150. </el-form>
  151. </div>
  152. </div>
  153. <div class="dialogFooter">
  154. <el-button type="primary" size="small" v-if="form.btnType == 0" @click="getClassStartPrepare()"
  155. :disabled="PrepareBtnStatus">确定
  156. </el-button>
  157. <el-button type="primary" size="small" v-if="form.btnType == 1" @click="getClassStartPrepareForEdit()">
  158. 确定
  159. </el-button>
  160. <el-button size="small" @click="dialogMemberVisible = false">取消</el-button>
  161. </div>
  162. </el-dialog>
  163. </div>
  164. </template>
  165. <script>
  166. import Global from '../Global.js'
  167. import {
  168. ActionGroupQuery,
  169. ClassOverPrepare,
  170. ClassDetailQuery,
  171. QueryShopVenue,
  172. ClassStartPrepare,
  173. DispPlanInfoEdit,
  174. ShopManagerListQuery,
  175. } from "../api/getApiRes";
  176. let qs = require('qs');
  177. export default {
  178. data() {
  179. return {
  180. dialogMemberVisible: false,
  181. serachBtnStatus: false,
  182. PrepareBtnStatus: false,
  183. dialogVisible: false,//其他dialog
  184. dialogFinishVisible: false,//确认下课dialog
  185. dialogLesson: false,//课时调整
  186. dialogGift: false,//赠送课时调整
  187. dialogExpTime: false,//有效期调整
  188. dialogLessonTable: false,//会员课程
  189. dialogTitle: '上课准备',
  190. dialogCoachValue: [],
  191. className: '',
  192. current: getNowDate(),
  193. dialogValue: [],
  194. start: 0,
  195. draw: 1,
  196. cur_page: 1,
  197. // panel 配置项目
  198. panel: {
  199. usercode: '',
  200. username: '',
  201. compname: '',
  202. keyword: '',
  203. USERCODE: '',
  204. endType: '',
  205. taskstatus: 99,
  206. draw: 1,
  207. start: 0,
  208. recordsTotal: 0,
  209. tableData: [],
  210. allTableData: [],
  211. limit: '10',
  212. multipleSort: false,
  213. loading: false,
  214. fileList: [],
  215. multipleSelection: [],
  216. detectedmac: '',
  217. options: [
  218. {value: 99, label: '全部'},
  219. {value: 1, label: '进行中'},
  220. {value: 2, label: '已完成'},
  221. ],
  222. endTypeOptions: [
  223. {value: 99, label: '全部'},
  224. {value: 30, label: '近一个月'},
  225. {value: 7, label: '近一周'},
  226. {value: 1, label: '当日'},
  227. ],
  228. time1: globalBt(),
  229. timeScope: globalBt2(0),
  230. },
  231. multipleSelection: [],
  232. pageination: {
  233. pageItem: 10,
  234. pageoptions: pageOptions(),
  235. total: 100,
  236. pageIndex: 1,
  237. },
  238. form: {
  239. name: '',
  240. svId: '',
  241. agId: '',
  242. isScore: "0",
  243. svName: '',
  244. classType: 1,
  245. userCode: '',
  246. coach: '',
  247. coachOptions: [],
  248. shopId: '',
  249. memberType: 1,
  250. lesson: 1,
  251. gift: 1,
  252. pktype: 1,
  253. pkNum: 2,
  254. btnType: 0,//0新建,1编辑
  255. memo: '',
  256. expTime: '',
  257. StdId: '',
  258. svList: [],//区域列表
  259. actionList: [],//动作列表
  260. dialogdata: [],//穿梭待选
  261. dialogValue: [],//穿梭已选
  262. dialogCoachdata: [],//穿梭已选
  263. ClassTypeOptions: [
  264. {value: 1, label: '团课'},
  265. {value: 2, label: '竞技PK'},
  266. // {value: 3, label: '私教'},
  267. ],
  268. PKTypeOptions: [
  269. {value: 2, label: '2队PK'},
  270. {value: 3, label: '3队PK'},
  271. ],
  272. },
  273. memberTypes: [
  274. {value: 1, label: '年会员'},
  275. {value: 2, label: '充值会员'},
  276. ],
  277. tableData: []
  278. }
  279. },
  280. mounted() {
  281. this.getTableQuery();
  282. },
  283. methods: {
  284. goType(url) {
  285. this.$router.push({path: '/' + url});
  286. },
  287. // 更改上课区域
  288. changeShopVenue(row) {
  289. this.dialogMemberVisible = true;
  290. this.form.btnType = 1;//0新建,1编辑
  291. // 读取本行信息
  292. this.dialogMemberVisible = true;
  293. this.className = row.ClassName + ' ' + row.BeginStr + ' - ' + row.EndStr;
  294. this.form.StdId = row.StdId;
  295. this.form.svId = row.SvId;
  296. this.form.svName = row.SvName;
  297. this.form.classType = row.ClassType;
  298. this.form.pkNum = row.PkNum;
  299. if (row.AgId != 0) {
  300. this.form.isScore = "1";
  301. this.form.agId = row.AgId;
  302. } else {
  303. this.form.agId = "";
  304. }
  305. this.getQueryShopVenue();
  306. this.getQueryShopActionGroup();
  307. },
  308. // 准备上课
  309. getClassStartPrepare() {
  310. let that = this;
  311. if (!that.form.svId) {
  312. that.$message.error('上课区域不能为空');
  313. return false
  314. }
  315. that.PrepareBtnStatus = true;
  316. // 不是竞技pk的时候为0
  317. let uppkNum = that.form.classType == 2 ? that.form.pkNum : 0;
  318. let tid = that.dialogCoachValue.toString();
  319. let param = {
  320. token: localStorage.token,
  321. stdId: that.form.StdId,
  322. svId: that.form.svId,
  323. agId: that.form.agId == "" ? 0 : that.form.agId,
  324. svName: that.form.svName,
  325. classType: that.form.classType,
  326. pkNum: uppkNum,
  327. tid: tid,//教练id
  328. };
  329. that.serachBtnStatus = true;
  330. let totalTime = 2;
  331. let clock = window.setInterval(() => {
  332. totalTime--;
  333. if (totalTime < 0) {
  334. totalTime = 2;
  335. that.serachBtnStatus = false;
  336. }
  337. }, 1000);
  338. let postdata = qs.stringify(param);
  339. ClassStartPrepare(postdata).then(res => {
  340. that.PrepareBtnStatus = false;
  341. let json = res;
  342. if (json.Code == 0) {
  343. this.$router.push({
  344. path: '/courseEdit',
  345. query: {
  346. AgId: that.form.agId,
  347. ScoreIsFinish: that.form.ScoreIsFinish,
  348. StdId: that.form.StdId,
  349. ClassName: that.form.ClassName,
  350. BeginStr: that.form.BeginStr,
  351. EndStr: that.form.EndStr,
  352. FinishClass: 3,
  353. ClassType: that.form.classType,
  354. PkNum: uppkNum,
  355. }
  356. });
  357. that.dialogMemberVisible = false;
  358. this.getTableQuery();
  359. } else {
  360. that.$message.error(json.Memo + ' 错误码:' + json.Code);
  361. }
  362. })
  363. },
  364. // 编辑
  365. getClassStartPrepareForEdit() {
  366. let that = this;
  367. if (!that.form.svId) {
  368. that.$message.error('上课区域不能为空');
  369. return false
  370. }
  371. // 不是竞技pk的时候为0
  372. let uppkNum = that.form.classType == 2 ? that.form.pkNum : 0;
  373. if (that.form.isScore === "0") {
  374. that.form.agId = 0;
  375. }
  376. let param = {
  377. token: localStorage.token,
  378. stdId: that.form.StdId,
  379. svId: that.form.svId,
  380. agId: that.form.agId,
  381. svName: that.form.svName,
  382. classType: that.form.classType,
  383. pkNum: uppkNum,
  384. };
  385. let postdata = qs.stringify(param);
  386. DispPlanInfoEdit(postdata).then(res => {
  387. let json = res;
  388. if (json.Code == 0) {
  389. // NewId: 0
  390. that.dialogMemberVisible = false;
  391. this.getTableQuery();
  392. } else {
  393. that.$message.error(json.Memo + ' 错误码:' + json.Code);
  394. }
  395. })
  396. },
  397. seeDetail(row) {
  398. this.$router.push({
  399. path: '/classInfoDetail', query: {
  400. StdId: row.StdId,
  401. ClassName: row.ClassName,
  402. BeginStr: row.BeginStr,
  403. EndStr: row.EndStr,
  404. }
  405. });
  406. },
  407. seeEdit(row) {
  408. this.$router.push({
  409. path: '/courseEdit', query: {
  410. StdId: row.StdId,
  411. ClassName: row.ClassName,
  412. BeginStr: row.BeginStr,
  413. EndStr: row.EndStr,
  414. FinishClass: row.FinishClass,
  415. ClassType: row.ClassType,
  416. PkNum: row.PkNum,
  417. AgId: row.AgId,
  418. ScoreIsFinish: row.ScoreIsFinish,
  419. }
  420. });
  421. },
  422. // 获取select的label
  423. changeLocationValue(val) {
  424. //locations是v-for里面的也是datas里面的值
  425. let obj = {};
  426. obj = this.form.svList.find((item) => {
  427. return item.SvId === val;
  428. });
  429. this.form.svName = obj.Name;
  430. },
  431. // 获取区域列表
  432. getQueryShopVenue() {
  433. let that = this;
  434. let param = {
  435. key: localStorage.ServiceKey,
  436. shopId: localStorage.ServiceId,
  437. };
  438. if (!localStorage.ServiceKey) {
  439. that.$message.error('还未与心率系统对接,请联系管理员');
  440. return false
  441. }
  442. let postdata = qs.stringify(param);
  443. QueryShopVenue(postdata).then(res => {
  444. let json = res;
  445. if (json.Code == 0) {
  446. that.form.svList = json.Rs;
  447. } else {
  448. that.$message.error(json.Memo + ' 错误码:' + json.Code);
  449. }
  450. })
  451. },
  452. // 获取商家下动作列表
  453. getQueryShopActionGroup() {
  454. let that = this;
  455. let param = {
  456. token: localStorage.token,
  457. shopId: localStorage.ShopId
  458. };
  459. let postdata = qs.stringify(param);
  460. ActionGroupQuery(postdata).then(res => {
  461. let json = res;
  462. if (json.Code == 0) {
  463. that.form.actionList = json.Rs;
  464. } else {
  465. that.$message.error(json.Memo + ' 错误码:' + json.Code);
  466. }
  467. })
  468. },
  469. vipSelect(stdId) {
  470. let that = this;
  471. // 筛选相同的stdid的classId
  472. that.form.stdList.map(function (item) {
  473. if (item.value == stdId) {
  474. let param = {
  475. token: localStorage.token,
  476. // classId: item.classId
  477. };
  478. let postdata = qs.stringify(param);
  479. // VipUserListQuery
  480. VipUserSimpleQuery(postdata).then(res => {
  481. let json = res;
  482. if (json.Code == 0) {
  483. that.form.userId = '';
  484. that.form.userList = turnResToOptionBySimViper(json.Rs);
  485. } else {
  486. that.$message.error(json.Memo + ' 错误码:' + json.Code);
  487. }
  488. })
  489. }
  490. })
  491. },
  492. showDialogMemberVisible(row) {
  493. this.dialogMemberVisible = true;
  494. this.form.btnType = 0;//0新建,1编辑
  495. // clear
  496. this.form.svList = "";
  497. this.form.actionList = "";
  498. this.form.classType = 1;
  499. this.form.pkNum = 2;
  500. this.form.StdId = row.StdId;
  501. this.form.ClassName = row.ClassName;
  502. this.form.BeginStr = row.BeginStr;
  503. this.form.EndStr = row.EndStr;
  504. this.form.FinishClass = row.FinishClass;
  505. this.form.ClassType = row.ClassType;
  506. this.form.PkNum = row.PkNum;
  507. this.className = row.ClassName + ' ' + row.BeginStr + ' - ' + row.EndStr;
  508. this.form.StdId = row.StdId;
  509. this.getCoachOption();
  510. this.getQueryShopVenue();
  511. this.getQueryShopActionGroup();
  512. },
  513. // 获取教练选项
  514. getCoachOption() {
  515. let that = this;
  516. let param = {
  517. token: localStorage.token,
  518. name: this.panel.name,//
  519. phone: this.panel.phone,//
  520. shopId: localStorage.ShopId,//
  521. adminType: 4,//
  522. start: 1,//
  523. tableMax: 299,//
  524. };
  525. let postdata = qs.stringify(param);
  526. ShopManagerListQuery(postdata).then(res => {
  527. let json = res;
  528. if (json.Code == 0) {
  529. that.form.dialogCoachdata = turnResToOptionByUsers(json.Rs);
  530. } else {
  531. that.$message.error(json.Memo + ' 错误码:' + json.Code);
  532. }
  533. })
  534. },
  535. // 检测当前课是否处于可改变状态
  536. // 固定下当前已预约人数列表
  537. checkClassOverPrepare(row) {
  538. let that = this;
  539. let param = {
  540. token: localStorage.token,
  541. stdId: row.StdId,
  542. };
  543. let postdata = qs.stringify(param);
  544. ClassOverPrepare(postdata).then(res => {
  545. let json = res;
  546. if (json.Code == 0) {
  547. that.goFinish(row);
  548. } else {
  549. that.$message.error(json.Memo + ' 错误码:' + json.Code);
  550. }
  551. })
  552. },
  553. goFinish(row) {
  554. this.$router.push({
  555. path: '/finishDetail', query: {
  556. id: row.StdId,
  557. classId: row.ClassId,
  558. ClassName: row.ClassName,
  559. BeginTime: row.BeginTime,
  560. }
  561. });
  562. },
  563. handleSelectionChange(val) {
  564. this.multipleSelection = val;
  565. },
  566. // 查询按钮
  567. query() {
  568. let that = this;
  569. that.start = 0;
  570. that.cur_page = 1;
  571. that.serachBtnStatus = true;
  572. let totalTime = 2;
  573. let clock = window.setInterval(() => {
  574. totalTime--;
  575. if (totalTime < 0) {
  576. totalTime = 2;
  577. that.serachBtnStatus = false;
  578. }
  579. }, 1000);
  580. this.getTableQuery();
  581. this.$message.success('查询完毕');
  582. },
  583. // 页面数据查询
  584. getTableQuery() {
  585. let that = this;
  586. that.loading = true;
  587. let param = {
  588. token: localStorage.token,
  589. tagname: that.panel.tagname,//标签名
  590. bt: nonTfmtDatetoLength(that.panel.timeScope[0], 10) + " 00:00:00",
  591. et: nonTfmtDatetoLength(that.panel.timeScope[1], 10) + " 23:59:59",
  592. fcStatus: '0,3,2',//状态字符串,空是全部 或 0,3,2 是待上课 或 1,4 已下课
  593. start: 1,//
  594. tableMax: 9999,//
  595. };
  596. let postdata = qs.stringify(param);
  597. ClassDetailQuery(postdata).then(res => {
  598. let json = res;
  599. if (json.Code == 0) {
  600. that.loading = false;
  601. if (json.Rs) {
  602. that.allTableData = json.Rs;
  603. that.recordsTotal = json.Rs.length;
  604. } else {
  605. that.allTableData = [];
  606. that.recordsTotal = 0;
  607. }
  608. // 设置分页数据
  609. that.setPaginations();
  610. } else {
  611. that.$message.error(json.Memo + ' 错误码:' + json.Code);
  612. }
  613. })
  614. },
  615. // 设置分页数据
  616. setPaginations() {
  617. // 分页属性
  618. let that = this;
  619. that.pageination.total = that.recordsTotal;
  620. // 默认分页
  621. that.tableData = that.allTableData.filter((item, index) => {
  622. return index < that.pageination.pageItem;
  623. });
  624. },
  625. // 每页显示数量
  626. handleSizeChange() {
  627. let that = this;
  628. that.tableData = that.allTableData.filter((item, index) => {
  629. return index < that.pageination.pageItem;
  630. });
  631. that.draw = that.pageination.pageItem;
  632. // that.getTableQuery();
  633. },
  634. // 翻页
  635. pageChange(pageIndex) {
  636. let that = this;
  637. // 获取当前页
  638. let index = that.pageination.pageItem * (pageIndex - 1);
  639. // 数据总数
  640. let nums = that.pageination.pageItem * pageIndex;
  641. // 容器
  642. let tables = [];
  643. for (var i = index; i < nums; i++) {
  644. if (that.allTableData[i]) {
  645. tables.push(that.allTableData[i])
  646. }
  647. this.tableData = tables;
  648. }
  649. that.start = index * that.draw;
  650. // that.getTableQuery();
  651. },
  652. // 过滤时间
  653. filterFmtDate(value, row, column) {
  654. let that = this;
  655. return nonTfmtDate(column, 11);
  656. },
  657. },
  658. watch: {
  659. $route(to) {
  660. if (to.name == 'courses') {
  661. this.getTableQuery();
  662. }
  663. },
  664. },
  665. }
  666. </script>
  667. <style scoped>
  668. @import "../assets/css/panel.css";
  669. .context {
  670. display: block;
  671. margin: 0 auto;
  672. background-color: #fff !important;
  673. padding: 30px;
  674. }
  675. .panel-body {
  676. padding: 20px;
  677. background: #F0F2F5;
  678. }
  679. .change {
  680. width: 100%;
  681. overflow: hidden;
  682. display: block;
  683. margin: 0 auto;
  684. padding-top: 10px;
  685. padding-bottom: 10px;
  686. }
  687. .change button {
  688. float: left;
  689. }
  690. .change button.pull-right {
  691. float: right;
  692. }
  693. .dialogTitle {
  694. width: 100%;
  695. overflow: hidden;
  696. display: block;
  697. margin: 0 auto;
  698. color: #000000;
  699. font-size: 18px;
  700. text-align: center;
  701. }
  702. .dialogTitle em {
  703. float: none;
  704. font-style: normal;
  705. color: #3799FF;
  706. margin: 0;
  707. }
  708. /deep/ .el-transfer-panel__item .el-checkbox__input {
  709. left: 40px;
  710. }
  711. .dialogFooter {
  712. width: 90%;
  713. overflow: hidden;
  714. display: block;
  715. margin: 0 auto;
  716. margin-top: 10px;
  717. }
  718. .dialogFooter button {
  719. float: right;
  720. margin-left: 10px;
  721. }
  722. .dialogContent {
  723. width: 100%;
  724. overflow: hidden;
  725. display: block;
  726. margin: 0 auto;
  727. }
  728. .dialogContent .pull-left {
  729. width: 30%;
  730. float: left;
  731. }
  732. .dialogContent .pull-right {
  733. width: 70%;
  734. float: right;
  735. }
  736. .blueTitle {
  737. width: 200px;
  738. overflow: hidden;
  739. display: block;
  740. margin: 0 auto;
  741. margin-top: 10px;
  742. margin-bottom: 40px;
  743. background: #F0F2F5;
  744. border-radius: 19px;
  745. text-align: center;
  746. color: #3799FF;
  747. font-size: 16px;
  748. padding: 5px 24px;
  749. }
  750. .current {
  751. width: 158px;
  752. height: 23px;
  753. /*float: left;*/
  754. border-radius: 250px;
  755. text-align: center;
  756. background: #F0F2F5;
  757. color: #545454;
  758. font-size: 14px;
  759. padding: 3px 10px;
  760. margin-left: 20px;
  761. }
  762. .lessonSpan {
  763. width: 78px;
  764. height: 22px;
  765. border-radius: 11px;
  766. margin-right: 5px;
  767. float: left;
  768. margin-bottom: 3px;
  769. text-align: center;
  770. color: #000;
  771. font-size: 12px;
  772. }
  773. .classNames {
  774. width: 211px;
  775. height: 25px;
  776. background: #f0f2f5;
  777. font-family: "Source Han Sans CN";
  778. font-weight: normal;
  779. font-size: 16px;
  780. color: #3799ff;
  781. border-radius: 250px;
  782. text-align: center;
  783. margin: 0 auto;
  784. margin-bottom: 10px;
  785. }
  786. /deep/ .el-date-editor .el-range-separator {
  787. line-height: 25px;
  788. }
  789. .likeTab {
  790. width: 100%;
  791. overflow: hidden;
  792. display: block;
  793. margin: 0 auto;
  794. padding-top: 10px;
  795. padding-bottom: 0;
  796. border-bottom: 1px solid #ccc;
  797. margin-bottom: 10px;
  798. }
  799. .likeTab button {
  800. float: left;
  801. border-radius: 0;
  802. }
  803. .likeTab button.pull-right {
  804. float: right;
  805. }
  806. .el-dialog__body .el-date-editor.el-input__inner {
  807. width: 156px;
  808. }
  809. .el-transfer-panel__item.el-checkbox .el-checkbox__label {
  810. width: 156px;
  811. }
  812. /deep/ .el-dialog__body .el-transfer-panel__item .el-checkbox__input {
  813. left: 10px;
  814. }
  815. /deep/ .el-dialog__body .el-form-item__content .el-select {
  816. float: left;
  817. margin-left: 50px;
  818. }
  819. /deep/ .el-dialog__body .el-transfer {
  820. float: left;
  821. margin-left: 50px;
  822. }
  823. @media (min-width: 320px) and (max-width: 1367px) {
  824. .panel /deep/ .el-date-editor--daterange {
  825. max-width: 240px;
  826. }
  827. .panel /deep/ .el-date-editor .el-range-separator {
  828. line-height: 35px;
  829. }
  830. }
  831. </style>