courses.vue 33 KB

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