heartEquipPerson.vue 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897
  1. <template>
  2. <div class="context">
  3. <div class="panel">
  4. <h5>心率设备</h5>
  5. <div class="likeTab">
  6. <el-button type="" @click="goType('heartEquip')">场馆心率设备</el-button>
  7. <el-button type="primary" @click="goType('heartEquipPerson')">私有心率设备</el-button>
  8. </div>
  9. <div class="panel-body">
  10. <div class="panel_control">
  11. <el-row :gutter="20">
  12. <el-col :span="4">
  13. <em>心率设备:</em>
  14. <el-input v-model="panel.str" placeholder="请输入编号" type="number"></el-input>
  15. </el-col>
  16. <el-col :span="5">
  17. <em>设备状态:</em>
  18. <!--status-->
  19. <el-select v-model="panel.status" placeholder="请选择">
  20. <el-option
  21. v-for="item in panel.statusOptions"
  22. :key="item.value"
  23. :label="item.label"
  24. :value="item.value">
  25. </el-option>
  26. </el-select>
  27. </el-col>
  28. <el-col :span="4">
  29. <el-button size="" type="primary" @click="query" plain>查询</el-button>
  30. </el-col>
  31. </el-row>
  32. </div>
  33. </div>
  34. </div>
  35. <div class="change">
  36. <el-button @click="addMember" type="primary">新增心率设备</el-button>
  37. <el-button @click="editList">编辑心率设备</el-button>
  38. <!--<el-button @click="delList" type="danger">删除心率设备</el-button>-->
  39. </div>
  40. <div class="table">
  41. <el-table
  42. :data="tableData"
  43. border
  44. is-horizontal-resize
  45. :default-sort="{prop: 'date', order: 'descending'}"
  46. element-loading-background="rgba(0, 0, 0, 0.8)"
  47. class=""
  48. @selection-change="handleSelectionChange" @current-change="clickChange"
  49. >
  50. >
  51. <el-table-column label="选择" width="55">
  52. <template slot-scope="scope">
  53. <el-radio v-model="tableRadio" :label="scope.row"><i></i></el-radio>
  54. </template>
  55. </el-table-column>
  56. <!--<el-table-column-->
  57. <!--type="index"-->
  58. <!--label="序号"-->
  59. <!--align="center"-->
  60. <!--width="50">-->
  61. <!--</el-table-column>-->
  62. <el-table-column
  63. prop="Sn"
  64. label="序列号"
  65. align="InVenueNo"
  66. >
  67. </el-table-column>
  68. <el-table-column
  69. prop="UserName"
  70. label="用户"
  71. align="center"
  72. sortable
  73. >
  74. <template slot-scope="scope">
  75. {{scope.row.UserName}}
  76. <!--<el-select v-model="scope.row.BindUserId" @change="getRowTop(scope.row)" filterable v-if="scope.row.BindUserId">-->
  77. <!--<el-option-->
  78. <!--v-for="item in panel.options"-->
  79. <!--:key="item.value"-->
  80. <!--:label="item.label"-->
  81. <!--:value="item.value">-->
  82. <!--</el-option>-->
  83. <!--</el-select>-->
  84. <!--<el-button @click="takeBack(scope.row)" type="danger" v-if="!scope.row.BindUserId">{{scope.row.UserName}} 设备收回</el-button>-->
  85. </template>
  86. </el-table-column>
  87. <!--<el-table-column-->
  88. <!--prop="Status"-->
  89. <!--label="状态"-->
  90. <!--align="center"-->
  91. <!--width="90"-->
  92. <!--&gt;-->
  93. <!--<template slot-scope="scope">-->
  94. <!--&lt;!&ndash;1:启用 8:暂停 9:删除&ndash;&gt;-->
  95. <!--<span v-if="scope.row.Status == 1" style="color: #67c23a">已启用</span>-->
  96. <!--<span v-if="scope.row.Status == 8" style="color: #E6A23C">已暂停</span>-->
  97. <!--<span v-if="scope.row.Status == 9" style="color: red">已删除</span>-->
  98. <!--</template>-->
  99. <!--</el-table-column>-->
  100. <el-table-column
  101. prop="id"
  102. label="操作"
  103. >
  104. <template slot-scope="scope">
  105. <!--<el-button type="success" v-if="scope.row.Status == 8" size="mini"-->
  106. <!--@click="pauseRow(scope.row,1)">-->
  107. <!--启用-->
  108. <!--</el-button>-->
  109. <!--<el-button type="warning" v-if="scope.row.Status == 1" size="mini"-->
  110. <!--@click="pauseRow(scope.row,8)">-->
  111. <!--暂停-->
  112. <!--</el-button>-->
  113. <el-button type="danger" size="mini"
  114. @click="pauseRowDel(scope.row)">
  115. 删除
  116. </el-button>
  117. <el-button type="text" @click="goPage(scope.row)">记录</el-button>
  118. </template>
  119. </el-table-column>
  120. </el-table>
  121. <br>
  122. <el-pagination
  123. background
  124. :total="pageination.total"
  125. :page-size="pageination.pageItem"
  126. @current-change="pageChange"
  127. ></el-pagination>
  128. </div>
  129. <el-dialog :title="dialogTitle" :visible.sync="dialogMemberVisible" width="650px">
  130. <div class="dialogContent">
  131. <div class="">
  132. <el-form ref="form" :model="form" label-width="160px">
  133. <el-form-item label="会员账号" :required="true" >
  134. <!--userId-->
  135. <el-select v-model="form.userId" placeholder="请选择" :disabled ="form.btnType == 1" filterable>
  136. <el-option
  137. v-for="item in form.userList"
  138. :key="item.value"
  139. :label="item.label"
  140. :value="item.value">
  141. </el-option>
  142. </el-select>
  143. </el-form-item>
  144. <el-form-item label="序列号" :required="true">
  145. <el-input v-model="form.sn"></el-input>
  146. </el-form-item>
  147. </el-form>
  148. </div>
  149. </div>
  150. <div class="dialogFooter">
  151. <el-button type="primary" size="small" v-if="form.btnType == 0" @click="confirmMember">确定</el-button>
  152. <el-button type="primary" size="small" v-if="form.btnType == 1" @click="confirmEditMember">确定
  153. </el-button>
  154. <el-button size="small" @click="dialogMemberVisible = false">取消</el-button>
  155. </div>
  156. </el-dialog>
  157. </div>
  158. </template>
  159. <script>
  160. import Global from '../Global.js'
  161. import {
  162. testTable,
  163. testSelect,
  164. ShopManagerStatusEdit,
  165. ClassDetailOne,
  166. QueryPvtHrSensors,
  167. AddPvtHrSensors,
  168. HrSensorsStatusEdit,
  169. EditHrSensors,
  170. UnBindHrSensorsToUser,
  171. VipUserSimpleQuery,
  172. } from "../api/getApiRes";
  173. let qs = require('qs');
  174. export default {
  175. data() {
  176. return {
  177. activeName: 'comm',
  178. dialogVisible: false,//其他dialog
  179. dialogMemberVisible: false,//新增心率设备dialog
  180. dialogLesson: false,//课时调整
  181. dialogGift: false,//赠送课时调整
  182. dialogExpTime: false,//有效期调整
  183. dialogLessonTable: false,//心率设备课程
  184. dialogTitle: '新增心率设备',
  185. dialogValue: [],
  186. tableRadio: [],
  187. // panel 配置项目
  188. panel: {
  189. str: '',
  190. phone: '',
  191. compname: '',
  192. keyword: '',
  193. USERCODE: '',
  194. endType: '',
  195. taskstatus: 99,
  196. status: "",
  197. draw: 1,
  198. start: 0,
  199. recordsTotal: 0,
  200. tableData: [],
  201. allTableData: [],
  202. limit: '10',
  203. multipleSort: false,
  204. loading: false,
  205. fileList: [],
  206. multipleSelection: [],
  207. detectedmac: '',
  208. statusOptions: [
  209. {value: "", label: '全部'},
  210. {value: 1, label: '启用'},
  211. {value: 8, label: '暂停'},
  212. {value: 9, label: '删除'},
  213. ], options: [
  214. {value: 99, label: '全部'},
  215. {value: 1, label: '进行中'},
  216. {value: 2, label: '已完成'},
  217. ],
  218. endTypeOptions: [
  219. {value: 99, label: '全部'},
  220. {value: 30, label: '近一个月'},
  221. {value: 7, label: '近一周'},
  222. {value: 1, label: '当日'},
  223. ],
  224. time1: globalBt(),
  225. },
  226. multipleSelection: [],
  227. pageination: {
  228. pageItem: 100,
  229. pageoptions: pageOptions(),
  230. total: 100,
  231. pageIndex: 1,
  232. },
  233. form: {
  234. name: '',
  235. userCode: '',
  236. sn: '',
  237. venueNo: '',
  238. shopId: '',
  239. teacherId: 0,
  240. memberType: 1,
  241. lesson: 1,
  242. gift: 1,
  243. btnType: 0,//0新建,1编辑编辑
  244. memo: '',
  245. phone: '',
  246. expTime: '',
  247. userId: '',
  248. userList: [],//穿梭待选
  249. dialogdata: [],//穿梭待选
  250. dialogValue: [],//穿梭已选
  251. },
  252. memberTypes: [
  253. {value: 1, label: '年心率设备'},
  254. {value: 2, label: '充值心率设备'},
  255. ],
  256. tableData: []
  257. }
  258. },
  259. mounted() {
  260. this.vipSelect();
  261. this.getTableQuery();
  262. },
  263. methods: {
  264. vipSelect() {
  265. let that = this;
  266. let param = {
  267. token: localStorage.token,
  268. };
  269. let postdata = qs.stringify(param);
  270. VipUserSimpleQuery(postdata).then(res => {
  271. let json = res;
  272. if (json.Code == 0) {
  273. that.form.userId = '';
  274. that.form.userList = turnResToOptionBySimViper(json.Rs);
  275. } else {
  276. that.$message.error(json.Memo);
  277. }
  278. })
  279. },
  280. handleClick(tab, event) {
  281. let that = this;
  282. if (tab.name == "personal") {
  283. // 私有
  284. that.$router.push({path: '/heartEquipPerson'});
  285. } else {
  286. // 公共
  287. that.$router.push({path: '/heartEquip'});
  288. }
  289. },
  290. // 设备回收
  291. takeBack(row) {
  292. let that = this;
  293. this.$confirm('是否回收用户' + row.name + '的心率设备?', '回收操作', {
  294. confirmButtonText: '确定',
  295. cancelButtonText: '取消',
  296. type: 'warning'
  297. }).then(() => {
  298. let param = {
  299. token: localStorage.token,
  300. Id: row.Id,
  301. status: 0,
  302. };
  303. let postdata = qs.stringify(param);
  304. UnBindHrSensorsToUser(postdata).then(res => {
  305. let json = res;
  306. if (json.Code == 0) {
  307. that.$message({
  308. showClose: true,
  309. message: row.name + '回收成功!',
  310. type: 'success'
  311. });
  312. // table 重载
  313. that.getTableQuery();
  314. } else {
  315. that.$message.error(json.Memo);
  316. }
  317. })
  318. }).catch(() => {
  319. this.$message({
  320. type: 'info',
  321. message: '已取消回收'
  322. });
  323. });
  324. },
  325. goPage(row) {
  326. // 查看绑定记录
  327. this.$router.push({path: '/bindRecord', query: {hrId: row.HrId}});
  328. },
  329. goType(url) {
  330. this.$router.push({path: '/' + url});
  331. },
  332. // 编辑
  333. editList() {
  334. let that = this;
  335. this.clearForm();
  336. console.log(this.tableRadio);
  337. if (this.tableRadio.length == 0) {
  338. this.$message.error("请先选中一条记录");
  339. return false
  340. }
  341. let row = this.tableRadio;
  342. this.form.shopid = row.ShopId;
  343. this.form.userId = row.UserId;
  344. this.form.name = row.Name;
  345. this.form.userCode = row.Usercode;
  346. this.form.password = '';
  347. this.form.hrId = row.HrId;
  348. this.form.sn = row.Sn;
  349. this.form.venueNo = row.InVenueNo;
  350. this.dialogVisible = true;
  351. this.dialogTitle = '编辑心率设备';
  352. this.form.btnType = 1;
  353. this.dialogMemberVisible = true
  354. },
  355. clickChange(item) {
  356. this.tableRadio = item
  357. },
  358. // 选择课程后,获取当前课程的建议上课人数和课时消耗
  359. getRowTop(row) {
  360. let that = this;
  361. console.log(row);
  362. let param = {
  363. token: localStorage.token,
  364. classId: row.ClassId,
  365. };
  366. let postdata = qs.stringify(param);
  367. ClassDetailOne(postdata).then(res => {
  368. let json = res;
  369. if (json.Code == 0) {
  370. row.TopLimit = json.Rs.TopLimit;
  371. row.ConsumeHour = json.Rs.ConsumeHour;
  372. } else {
  373. that.$message.error(json.Memo);
  374. }
  375. })
  376. },
  377. // 编辑
  378. editMember(row) {
  379. this.clearForm();
  380. this.form.name = row.Name;
  381. this.form.phone = row.Phone;
  382. this.form.shopId = row.ShopId;
  383. this.form.teacherId = row.TeacherId;
  384. this.form.btnType = 1;
  385. this.dialogMemberVisible = true
  386. this.dialogTitle = '编辑心率设备'
  387. },
  388. // 禁用
  389. pauseRow(row, status) {
  390. let that = this;
  391. let param = {
  392. token: localStorage.token,
  393. hrId: row.HrId,
  394. status: status,//1:启用 8:暂停 9:删除
  395. };
  396. let postdata = qs.stringify(param);
  397. HrSensorsStatusEdit(postdata).then(res => {
  398. let json = res;
  399. if (json.Code == 0) {
  400. that.$message({
  401. showClose: true,
  402. message: '执行成功!',
  403. type: 'success'
  404. });
  405. // table 重载
  406. that.getTableQuery();
  407. that.vipSelect();
  408. } else {
  409. that.$message.error(json.Memo);
  410. }
  411. })
  412. },
  413. // pauseRow(row) {
  414. // let that = this;
  415. // this.$confirm('是否禁用心率设备' + row.Sn + '?', '禁用操作', {
  416. // confirmButtonText: '确定',
  417. // cancelButtonText: '取消',
  418. // type: 'warning'
  419. // }).then(() => {
  420. // let param = {
  421. // token: localStorage.token,
  422. // shopId : localStorage.token,
  423. // status: 8,
  424. // };
  425. // let postdata = qs.stringify(param);
  426. // ShopVenueEquipEditStatus(postdata).then(res => {
  427. // let json = res;
  428. // if (json.Code == 0) {
  429. // that.$message({
  430. // showClose: true,
  431. // message: row.name + '禁用成功!',
  432. // type: 'success'
  433. // });
  434. // // table 重载
  435. // that.getTableQuery();
  436. // } else {
  437. // that.$message.error(json.Memo);
  438. // }
  439. // })
  440. // }).catch(() => {
  441. // this.$message({
  442. // type: 'info',
  443. // message: '已取消禁用'
  444. // });
  445. // });
  446. // },
  447. // 启用
  448. runRow(row) {
  449. let that = this;
  450. this.$confirm('是否启用心率设备' + row.Sn + '?', '启用操作', {
  451. confirmButtonText: '确定',
  452. cancelButtonText: '取消',
  453. type: 'warning'
  454. }).then(() => {
  455. let param = {
  456. token: localStorage.token,
  457. Id: row.Id,
  458. status: 1,
  459. };
  460. let postdata = qs.stringify(param);
  461. testTable(postdata).then(res => {
  462. let json = res;
  463. if (json.Code == 0) {
  464. that.$message({
  465. showClose: true,
  466. message: row.name + '启用成功!',
  467. type: 'success'
  468. });
  469. // table 重载
  470. that.getTableQuery();
  471. } else {
  472. that.$message.error(json.Memo);
  473. }
  474. })
  475. }).catch(() => {
  476. this.$message({
  477. type: 'info',
  478. message: '已取消启用'
  479. });
  480. });
  481. },
  482. // 删除
  483. pauseRowDel(row) {
  484. let that = this;
  485. let param = {
  486. token: localStorage.token,
  487. hrId: row.HrId,
  488. status: 9,//1:启用,8:暂停,9:删除
  489. };
  490. let postdata = qs.stringify(param);
  491. this.$confirm('此操作将永久删除该心率设备, 是否继续?', '提示', {
  492. confirmButtonText: '确定',
  493. cancelButtonText: '取消',
  494. type: 'warning'
  495. }).then(() => {
  496. HrSensorsStatusEdit(postdata).then(res => {
  497. let json = res;
  498. if (json.Code == 0) {
  499. that.$message({
  500. showClose: true,
  501. message: '选中的心率设备已删除!',
  502. type: 'success'
  503. });
  504. // 重载列表
  505. that.getTableQuery();
  506. } else {
  507. that.$message.error(json.Memo);
  508. }
  509. });
  510. }).catch(() => {
  511. this.$message({
  512. type: 'info',
  513. message: '已取消删除'
  514. });
  515. });
  516. },
  517. // 关闭所有
  518. allDialogClose() {
  519. this.dialogVisible = false;
  520. this.dialogGift = false;
  521. this.dialogLesson = false;
  522. this.dialogExpTime = false;
  523. this.dialogLessonTable = false;
  524. },
  525. // 确认提交新增心率设备
  526. confirmMember() {
  527. let that = this;
  528. // checkNum
  529. if (!that.form.sn) {
  530. this.$message.error('错了哦,编号不能为空');
  531. return false
  532. }
  533. if (that.form.sn.length > 20) {
  534. this.$message.error('错了哦,编号不能超过20个字符');
  535. return false
  536. }
  537. let param = {
  538. token: localStorage.token,
  539. shopId: localStorage.shopId,
  540. sn: that.form.sn,
  541. userId: that.form.userId,
  542. };
  543. let postdata = qs.stringify(param);
  544. AddPvtHrSensors(postdata).then(res => {
  545. let json = res;
  546. if (json.Code == 0) {
  547. // 关闭弹窗
  548. that.dialogMemberVisible = false;
  549. // 重载列表
  550. that.getTableQuery();
  551. that.$message({
  552. showClose: true,
  553. message: '心率设备添加成功!',
  554. type: 'success'
  555. });
  556. } else {
  557. that.$message.error(json.Memo);
  558. }
  559. })
  560. },
  561. confirmEditMember() {
  562. let that = this;
  563. // checkNum
  564. if (!that.form.sn) {
  565. this.$message.error('错了哦,编号不能为空');
  566. return false
  567. }
  568. if (that.form.sn.length > 20) {
  569. this.$message.error('错了哦,编号不能超过20个字符');
  570. return false
  571. }
  572. let param = {
  573. token: localStorage.token,
  574. shopId: localStorage.shopId,
  575. hrId: that.form.hrId,
  576. sn: that.form.sn,
  577. venueNo: 0,
  578. };
  579. let postdata = qs.stringify(param);
  580. EditHrSensors(postdata).then(res => {
  581. let json = res;
  582. if (json.Code == 0) {
  583. // 关闭弹窗
  584. that.dialogMemberVisible = false;
  585. // 重载列表
  586. that.getTableQuery();
  587. that.$message({
  588. showClose: true,
  589. message: '心率设备信息编辑成功!',
  590. type: 'success'
  591. });
  592. } else {
  593. that.$message.error(json.Memo);
  594. }
  595. })
  596. },
  597. // 确认提交课时
  598. confirmLesson() {
  599. let that = this;
  600. // checkNum
  601. let param = {
  602. token: localStorage.token,
  603. userCode: that.form.userCode,
  604. lesson: that.form.lesson,
  605. };
  606. let postdata = qs.stringify(param);
  607. testSelect(postdata).then(res => {
  608. let json = res;
  609. if (json.Code == 0) {
  610. // 关闭弹窗
  611. that.dialogVisible = false;
  612. // 重载列表
  613. that.getTableQuery();
  614. that.$message({
  615. showClose: true,
  616. message: '课时调整成功!',
  617. type: 'success'
  618. });
  619. } else {
  620. that.$message.error(json.Memo);
  621. }
  622. })
  623. },
  624. // 新增心率设备
  625. addMember() {
  626. this.clearForm();
  627. this.dialogMemberVisible = true;
  628. this.form.btnType = 0;
  629. this.dialogTitle = '新增心率设备'
  630. },
  631. // 删除
  632. delList() {
  633. let that = this;
  634. if (this.tableRadio.length == 0) {
  635. this.$message.error("请先选中一条记录");
  636. return false
  637. }
  638. let hrId = this.tableRadio.HrId;
  639. let param = {
  640. token: localStorage.token,
  641. hrId: hrId,
  642. status: 9,//1:启用,8:暂停,9:删除
  643. };
  644. let postdata = qs.stringify(param);
  645. this.$confirm('此操作将永久删除该心率设备, 是否继续?', '提示', {
  646. confirmButtonText: '确定',
  647. cancelButtonText: '取消',
  648. type: 'warning'
  649. }).then(() => {
  650. HrSensorsStatusEdit(postdata).then(res => {
  651. let json = res;
  652. if (json.Code == 0) {
  653. that.$message({
  654. showClose: true,
  655. message: '选中的心率设备已删除!',
  656. type: 'success'
  657. });
  658. // 重载列表
  659. that.getTableQuery();
  660. } else {
  661. that.$message.error(json.Memo);
  662. }
  663. });
  664. }).catch(() => {
  665. this.$message({
  666. type: 'info',
  667. message: '已取消删除'
  668. });
  669. });
  670. },
  671. handleSelectionChange(val) {
  672. this.multipleSelection = val;
  673. },
  674. // 查询按钮
  675. query() {
  676. this.getTableQuery();
  677. this.$message.success('查询完毕');
  678. },
  679. clearForm() {
  680. // clear
  681. this.form.name = '';
  682. this.form.sn = '';
  683. this.form.venueNo = '';
  684. this.form.phone = '';
  685. this.form.userCode = '';
  686. this.form.shopId = '';
  687. },
  688. // 页面数据查询
  689. getTableQuery() {
  690. let that = this;
  691. that.loading = true;
  692. let param = {
  693. token: localStorage.token,
  694. str: this.panel.str,//
  695. status: this.panel.status,//
  696. shopId: localStorage.shopId,//
  697. };
  698. let postdata = qs.stringify(param);
  699. QueryPvtHrSensors(postdata).then(res => {
  700. let json = res;
  701. if (json.Code == 0) {
  702. that.loading = false;
  703. if (json.Rs) {
  704. that.allTableData = json.Rs;
  705. that.recordsTotal = json.Rs.length;
  706. } else {
  707. that.allTableData = [];
  708. that.recordsTotal = 0;
  709. }
  710. // 设置分页数据
  711. that.setPaginations();
  712. } else {
  713. that.$message.error(json.Memo);
  714. }
  715. })
  716. },
  717. // 设置分页数据
  718. setPaginations() {
  719. // 分页属性
  720. let that = this;
  721. that.pageination.total = that.recordsTotal;
  722. // 默认分页
  723. that.tableData = that.allTableData.filter((item, index) => {
  724. return index < that.pageination.pageItem;
  725. });
  726. },
  727. // 每页显示数量
  728. handleSizeChange() {
  729. let that = this;
  730. that.tableData = that.allTableData.filter((item, index) => {
  731. return index < that.pageination.pageItem;
  732. });
  733. that.draw = that.pageination.pageItem;
  734. // that.getTableQuery();
  735. },
  736. // 翻页
  737. pageChange(pageIndex) {
  738. let that = this;
  739. // 获取当前页
  740. let index = that.pageination.pageItem * (pageIndex - 1);
  741. // 数据总数
  742. let nums = that.pageination.pageItem * pageIndex;
  743. // 容器
  744. let tables = [];
  745. for (var i = index; i < nums; i++) {
  746. if (that.allTableData[i]) {
  747. tables.push(that.allTableData[i])
  748. }
  749. this.tableData = tables;
  750. }
  751. that.start = index * that.draw;
  752. // that.getTableQuery();
  753. },
  754. // 自动排序
  755. sortChange(params) {
  756. console.log(params)
  757. },
  758. }
  759. ,
  760. watch: {
  761. $route(to) {
  762. if (to.name == 'heartEquipPerson') {
  763. if (this.$route.query.page == 'second') {
  764. this.getTableQuery();
  765. this.vipSelect();
  766. }
  767. }
  768. }
  769. ,
  770. }
  771. }
  772. </script>
  773. <style scoped>
  774. @import "../assets/css/panel.css";
  775. .context {
  776. height: 770px;
  777. overflow-y: scroll;
  778. display: block;
  779. margin: 0 auto;
  780. background-color: #fff !important;
  781. padding: 30px;
  782. }
  783. .panel-body {
  784. padding: 20px;
  785. background: #F0F2F5;
  786. }
  787. .change {
  788. width: 100%;
  789. overflow: hidden;
  790. display: block;
  791. margin: 0 auto;
  792. padding-top: 10px;
  793. padding-bottom: 10px;
  794. }
  795. .change button {
  796. float: left;
  797. }
  798. .change button.pull-right {
  799. float: right;
  800. }
  801. .likeTab {
  802. width: 100%;
  803. overflow: hidden;
  804. display: block;
  805. margin: 0 auto;
  806. padding-top: 10px;
  807. padding-bottom: 0;
  808. border-bottom: 1px solid #ccc;
  809. margin-bottom: 10px;
  810. }
  811. .likeTab button {
  812. float: left;
  813. border-radius: 0;
  814. }
  815. .likeTab button.pull-right {
  816. float: right;
  817. }
  818. .dialogTitle {
  819. width: 100%;
  820. overflow: hidden;
  821. display: block;
  822. margin: 0 auto;
  823. color: #000000;
  824. font-size: 18px;
  825. text-align: center;
  826. }
  827. .dialogTitle em {
  828. float: none;
  829. font-style: normal;
  830. color: #3799FF;
  831. margin: 0;
  832. }
  833. /deep/ .el-transfer-panel__item .el-checkbox__input {
  834. left: 40px;
  835. }
  836. .dialogFooter {
  837. width: 90%;
  838. overflow: hidden;
  839. display: block;
  840. margin: 0 auto;
  841. margin-top: 10px;
  842. }
  843. .dialogFooter button {
  844. float: right;
  845. margin-left: 10px;
  846. }
  847. .dialogContent {
  848. width: 100%;
  849. overflow: hidden;
  850. display: block;
  851. margin: 0 auto;
  852. }
  853. .dialogContent .pull-left {
  854. width: 30%;
  855. float: left;
  856. }
  857. .dialogContent .pull-right {
  858. width: 70%;
  859. float: right;
  860. }
  861. /deep/ .el-dialog .el-select {
  862. width: 100%;
  863. }
  864. </style>