finishDetail.vue 36 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010
  1. <template>
  2. <div class="context">
  3. <div class="panel">
  4. <h5>下课详情
  5. <span class="current">{{form.BeginTime}} {{form.ClassName}} </span>
  6. </h5>
  7. <div class="panel-body">
  8. <div class="panel_control">
  9. <el-row :gutter="20">
  10. <el-col :span="4">
  11. <em>会员名:</em>
  12. <el-input v-model="panel.name" placeholder="请输入会员名"></el-input>
  13. </el-col>
  14. <el-col :span="4">
  15. <em>手机号:</em>
  16. <el-input v-model="panel.phone" placeholder="请输入手机号"></el-input>
  17. </el-col>
  18. <el-col :span="4">
  19. <el-button size="" type="primary" @click="query" plain>查询</el-button>
  20. </el-col>
  21. </el-row>
  22. </div>
  23. </div>
  24. </div>
  25. <div class="change">
  26. <el-button @click="addFinish">确认下课</el-button>
  27. <el-button @click="addFinishMember">添加下课会员</el-button>
  28. </div>
  29. <div class="table">
  30. <el-table
  31. :data="tableData"
  32. border
  33. is-horizontal-resize
  34. :default-sort="{prop: 'date', order: 'descending'}"
  35. element-loading-background="rgba(0, 0, 0, 0.8)"
  36. class=""
  37. @selection-change="handleSelectionChange"
  38. >
  39. <el-table-column
  40. type="index"
  41. label="序号"
  42. width="50">
  43. </el-table-column>
  44. <el-table-column
  45. prop="Name"
  46. label="会员名"
  47. >
  48. </el-table-column>
  49. <el-table-column
  50. prop="Phone"
  51. label="手机号"
  52. sortable
  53. >
  54. </el-table-column>
  55. <el-table-column
  56. prop="Status"
  57. label="状态"
  58. sortable
  59. >
  60. <template slot-scope="scope">
  61. <span v-if="scope.row.Status == 1">预约上课 </span>
  62. <span v-if="scope.row.Status == 2">预约未到</span>
  63. <span v-if="scope.row.Status == 3">上课未预约</span>
  64. </template>
  65. </el-table-column>
  66. <el-table-column
  67. prop="Status"
  68. label="操作"
  69. >
  70. <template slot-scope="scope">
  71. <el-button type="danger" round v-if="scope.row.Status == 3" size="mini"
  72. @click="pauseRow(scope.row,1)">
  73. 撤销
  74. </el-button>
  75. <el-button type="primary" round v-if="scope.row.Status == 1" size="mini"
  76. @click="pauseRow(scope.row,2)">
  77. 预约未到
  78. </el-button>
  79. <!-- <el-button type="warning" round v-if="scope.row.Status == 2" size="mini"-->
  80. <!-- @click="runRow(scope.row)">-->
  81. <!-- 删除-->
  82. <!-- </el-button>-->
  83. </template>
  84. </el-table-column>
  85. </el-table>
  86. <br>
  87. <el-pagination
  88. background
  89. :total="pageination.total"
  90. :page-size="pageination.pageItem"
  91. @current-change="pageChange"
  92. ></el-pagination>
  93. </div>
  94. <el-dialog title="确认下课" :visible.sync="dialogFinishVisible" width="640px">
  95. <div class="dialogContent">
  96. <span class="blueTitle">{{form.ClassName}} {{form.BeginTime}}</span>
  97. <div>
  98. <el-transfer filterable v-model="dialogCoachValue" :data="form.dialogCoachdata"
  99. :titles="['教练列表', '已添加教练']"></el-transfer>
  100. </div>
  101. </div>
  102. <div class="dialogFooter">
  103. <el-button type="primary" size="small" @click="confirmClassFinish">确定</el-button>
  104. <el-button size="small" @click="dialogFinishVisible = false">取消</el-button>
  105. </div>
  106. </el-dialog>
  107. <el-dialog title="添加下课会员" :visible.sync="dialogVisible" width="640px">
  108. <div class="dialogContent">
  109. <span class="blueTitle">{{form.ClassName}} {{form.BeginTime}}</span>
  110. <div>
  111. <el-transfer filterable v-model="dialogValue" :data="form.dialogdata"
  112. :titles="['会员列表', '已添加会员']"></el-transfer>
  113. </div>
  114. </div>
  115. <div class="dialogFooter">
  116. <el-button type="primary" size="small" @click="confirmMember">确定</el-button>
  117. <el-button size="small" @click="dialogVisible = false">取消</el-button>
  118. </div>
  119. </el-dialog>
  120. </div>
  121. </template>
  122. <script>
  123. import Global from '../Global.js'
  124. import {
  125. ClassOverDetailListQuery,
  126. ClassVipuserQuery,
  127. ClassOverDetailAdd,
  128. ClassVipuserEdit,
  129. ClassOverDetailStatusEdit,
  130. ClassOverConfirm,
  131. testTable,
  132. testSelect, TeacherListQuery
  133. } from "../api/getApiRes";
  134. let qs = require('qs');
  135. export default {
  136. data() {
  137. return {
  138. dialogVisible: false,//添加下课会员
  139. dialogFinishVisible: false,//确认下课dialog
  140. dialogLesson: false,//课时调整
  141. dialogGift: false,//赠送课时调整
  142. dialogExpTime: false,//有效期调整
  143. dialogLessonTable: false,//会员课程
  144. dialogTitle: '新增会员',
  145. current: getNowDate(),
  146. dialogValue: [],
  147. dialogCoachValue: [],
  148. // panel 配置项目
  149. panel: {
  150. name: '',
  151. phone: '',
  152. usercode: '',
  153. username: '',
  154. compname: '',
  155. keyword: '',
  156. USERCODE: '',
  157. endType: '',
  158. taskstatus: 99,
  159. draw: 1,
  160. start: 0,
  161. recordsTotal: 0,
  162. tableData: [],
  163. allTableData: [],
  164. limit: '10',
  165. multipleSort: false,
  166. loading: false,
  167. fileList: [],
  168. multipleSelection: [],
  169. detectedmac: '',
  170. options: [
  171. {value: 99, label: '全部'},
  172. {value: 1, label: '进行中'},
  173. {value: 2, label: '已完成'},
  174. ],
  175. endTypeOptions: [
  176. {value: 99, label: '全部'},
  177. {value: 30, label: '近一个月'},
  178. {value: 7, label: '近一周'},
  179. {value: 1, label: '当日'},
  180. ],
  181. time1: globalBt(),
  182. },
  183. multipleSelection: [],
  184. pageination: {
  185. pageItem: 100,
  186. pageoptions: pageOptions(),
  187. total: 100,
  188. pageIndex: 1,
  189. },
  190. form: {
  191. name: '',
  192. userCode: '',
  193. coach: '',
  194. coachOptions: [],
  195. shopId: '',
  196. memberType: 1,
  197. lesson: 1,
  198. gift: 1,
  199. btnType: 0,//0新建,1编辑编辑
  200. memo: '',
  201. expTime: '',
  202. dialogdata: [],//穿梭待选
  203. dialogValue: [],//穿梭已选
  204. dialogCoachdata: [],//穿梭已选
  205. },
  206. memberTypes: [
  207. {value: 1, label: '年会员'},
  208. {value: 2, label: '充值会员'},
  209. ],
  210. tableData: []
  211. }
  212. },
  213. mounted() {
  214. this.form.BeginTime = nonTfmtDatetoLength(this.$route.query.BeginTime, 16);
  215. this.form.ClassName = this.$route.query.ClassName;
  216. this.getTableQuery();
  217. // 获取教练选项
  218. this.getCoachOption();
  219. },
  220. methods: {
  221. // 获取教练选项
  222. getCoachOption() {
  223. let that = this;
  224. let param = {
  225. token: localStorage.token,
  226. name: this.panel.name,//
  227. phone: this.panel.phone,//
  228. };
  229. let postdata = qs.stringify(param);
  230. TeacherListQuery(postdata).then(res => {
  231. let json = res;
  232. if (json.Code == 0) {
  233. console.log(json.Rs);
  234. that.form.dialogCoachdata = turnResToOptionByCoach(json.Rs);
  235. } else {
  236. that.$message.error(json.Memo);
  237. }
  238. })
  239. },
  240. // 获取本课程下的会员列表
  241. getClassVipuserQuery() {
  242. let that = this;
  243. let param = {
  244. token: localStorage.token,
  245. classId: this.$route.query.classId,
  246. };
  247. let postdata = qs.stringify(param);
  248. ClassVipuserQuery(postdata).then(res => {
  249. let json = res;
  250. if (json.Code == 0) {
  251. that.form.dialogdata = turnResToOptionByViper(json.Rs);
  252. } else {
  253. that.$message.error(json.Memo);
  254. }
  255. })
  256. },
  257. // 编辑
  258. editMember(row) {
  259. let that = this;
  260. this.clearForm();
  261. this.form.userCode = row.userCode;
  262. this.form.name = row.name;
  263. this.form.memberType = row.vipType;
  264. this.form.lesson = row.Recovered;
  265. this.form.gift = row.Recovered;
  266. this.form.memo = row.memo;
  267. this.form.btnType = 1;
  268. this.form.shopId = row.Id;
  269. this.dialogFinishVisible = true
  270. this.dialogTitle = '编辑会员'
  271. },
  272. // 禁用
  273. pauseRow(row, status) {
  274. let that = this;
  275. // this.$confirm('是否禁用用户' + row.name + '?', '禁用操作', {
  276. // confirmButtonText: '确定',
  277. // cancelButtonText: '取消',
  278. // type: 'warning'
  279. // }).then(() => {
  280. let param = {
  281. token: localStorage.token,
  282. stdId: this.$route.query.id,
  283. cfId: row.CfId,
  284. status: status,
  285. };
  286. let postdata = qs.stringify(param);
  287. ClassOverDetailStatusEdit(postdata).then(res => {
  288. let json = res;
  289. if (json.Code == 0) {
  290. that.$message({
  291. showClose: true,
  292. message: '执行成功!',
  293. type: 'success'
  294. });
  295. // table 重载
  296. that.getTableQuery();
  297. } else {
  298. that.$message.error(json.Memo);
  299. }
  300. })
  301. // }).catch(() => {
  302. // this.$message({
  303. // type: 'info',
  304. // message: '已取消禁用'
  305. // });
  306. // });
  307. },
  308. // 启用
  309. runRow(row) {
  310. let that = this;
  311. this.$confirm('是否启用用户' + row.name + '?', '启用操作', {
  312. confirmButtonText: '确定',
  313. cancelButtonText: '取消',
  314. type: 'warning'
  315. }).then(() => {
  316. let param = {
  317. token: localStorage.token,
  318. Id: row.Id,
  319. status: 1,
  320. };
  321. let postdata = qs.stringify(param);
  322. testTable(postdata).then(res => {
  323. let json = res;
  324. if (json.Code == 0) {
  325. that.$message({
  326. showClose: true,
  327. message: row.name + '启用成功!',
  328. type: 'success'
  329. });
  330. // table 重载
  331. that.getTableQuery();
  332. } else {
  333. that.$message.error(json.Memo);
  334. }
  335. })
  336. }).catch(() => {
  337. this.$message({
  338. type: 'info',
  339. message: '已取消启用'
  340. });
  341. });
  342. },
  343. // 关闭所有
  344. allDialogClose() {
  345. this.dialogVisible = false;
  346. this.dialogGift = false;
  347. this.dialogLesson = false;
  348. this.dialogExpTime = false;
  349. this.dialogLessonTable = false;
  350. },
  351. // 有效期调整
  352. ExpTimeChange() {
  353. // 仅针对年费用户,使用日期格式
  354. this.allDialogClose();
  355. if (!this.multipleSelection.length) {
  356. this.$message({
  357. showClose: true,
  358. message: '错了哦,需要先选中至少一条记录',
  359. type: 'error'
  360. });
  361. return false
  362. }
  363. if (this.multipleSelection.length != 1) {
  364. this.$message({
  365. showClose: true,
  366. message: '错了哦,只能选中一条记录',
  367. type: 'error'
  368. });
  369. return false
  370. }
  371. let row = this.multipleSelection[0];
  372. if (parseInt(row.vipType) == 2) {
  373. this.$message({
  374. showClose: true,
  375. message: '错了哦,充值会员不能调整有效期',
  376. type: 'error'
  377. });
  378. return false
  379. }
  380. this.form.expTime = row.expTime;
  381. this.form.rowName = row.name;
  382. this.dialogVisible = true;
  383. this.dialogExpTime = true;
  384. },
  385. // 课时调整
  386. lessonChange() {
  387. this.allDialogClose();
  388. if (!this.multipleSelection.length) {
  389. this.$message({
  390. showClose: true,
  391. message: '错了哦,需要先选中至少一条记录',
  392. type: 'error'
  393. });
  394. return false
  395. }
  396. if (this.multipleSelection.length != 1) {
  397. this.$message({
  398. showClose: true,
  399. message: '错了哦,只能选中一条记录',
  400. type: 'error'
  401. });
  402. return false
  403. }
  404. let row = this.multipleSelection[0];
  405. this.form.lesson = row.Recovered;
  406. this.form.rowName = row.name;
  407. this.dialogVisible = true;
  408. this.dialogLesson = true;
  409. },
  410. // 赠送调整
  411. giftChange() {
  412. this.allDialogClose();
  413. if (!this.multipleSelection.length) {
  414. this.$message({
  415. showClose: true,
  416. message: '错了哦,需要先选中至少一条记录',
  417. type: 'error'
  418. });
  419. return false
  420. }
  421. if (this.multipleSelection.length != 1) {
  422. this.$message({
  423. showClose: true,
  424. message: '错了哦,只能选中一条记录',
  425. type: 'error'
  426. });
  427. return false
  428. }
  429. let row = this.multipleSelection[0];
  430. this.form.gift = row.Recovered;
  431. this.form.rowName = row.name;
  432. this.dialogVisible = true;
  433. this.dialogGift = true;
  434. },
  435. // 增删会员课程
  436. lessonStudenChange() {
  437. this.allDialogClose();
  438. if (!this.multipleSelection.length) {
  439. this.$message({
  440. showClose: true,
  441. message: '错了哦,需要先选中至少一条记录',
  442. type: 'error'
  443. });
  444. return false
  445. }
  446. if (this.multipleSelection.length != 1) {
  447. this.$message({
  448. showClose: true,
  449. message: '错了哦,只能选中一条记录',
  450. type: 'error'
  451. });
  452. return false
  453. }
  454. let row = this.multipleSelection[0];
  455. this.form.gift = row.Recovered;
  456. this.form.rowName = row.name;
  457. this.dialogVisible = true;
  458. this.dialogLessonTable = true;
  459. },
  460. // 确认提交下课会员
  461. confirmMember() {
  462. let that = this;
  463. // checkNum
  464. let userlist = that.dialogValue.toString();
  465. let param = {
  466. token: localStorage.token,
  467. stdId: this.$route.query.id,
  468. userlist: userlist
  469. };
  470. let postdata = qs.stringify(param);
  471. // 下课记录详情添加
  472. ClassOverDetailAdd(postdata).then(res => {
  473. let json = res;
  474. if (json.Code == 0) {
  475. // 关闭弹窗
  476. that.dialogVisible = false;
  477. // 重载列表
  478. that.getTableQuery();
  479. that.$message({
  480. showClose: true,
  481. message: '下课会员修改成功!',
  482. type: 'success'
  483. });
  484. that.getTableQuery()
  485. } else {
  486. that.$message.error(json.Memo);
  487. }
  488. })
  489. },
  490. // 确认下课
  491. confirmClassFinish() {
  492. let that = this;
  493. // checkNum
  494. let userlist = that.dialogCoachValue.toString();
  495. let param = {
  496. token: localStorage.token,
  497. stdId: this.$route.query.id,
  498. teacherList: userlist
  499. };
  500. let postdata = qs.stringify(param);
  501. // 下课记录详情添加
  502. ClassOverDetailAdd(postdata).then(res => {
  503. let json = res;
  504. if (json.Code == 0) {
  505. // 关闭弹窗
  506. that.dialogFinishVisible = false;
  507. // 重载列表
  508. that.getTableQuery();
  509. that.$message({
  510. showClose: true,
  511. message: '当前课程已确认下课!',
  512. type: 'success'
  513. });
  514. that.getTableQuery()
  515. } else {
  516. that.$message.error(json.Memo);
  517. }
  518. })
  519. },
  520. confirmEditMember() {
  521. console.log(123);
  522. let that = this;
  523. // checkNum
  524. if (!that.form.userCode) {
  525. this.$message.error('错了哦,手机号不能为空');
  526. return false
  527. }
  528. console.log(that.form.userCode);
  529. if (!globalCheckPhone(that.form.userCode)) {
  530. this.$message.error('错了哦,手机号格式不正确');
  531. return false
  532. }
  533. if (!that.form.name) {
  534. this.$message.error('错了哦,会员名不能为空');
  535. return false
  536. }
  537. if (that.form.name.length > 8) {
  538. this.$message.error('错了哦,会员名字数超过8个字');
  539. return false
  540. }
  541. if (that.form.memo) {
  542. if (that.form.memo.length > 200) {
  543. this.$message.error('错了哦,备注字数超过200个字');
  544. return false
  545. }
  546. }
  547. let param = {
  548. token: localStorage.token,
  549. userCode: that.form.userCode,
  550. name: that.form.name,
  551. memberType: that.form.memberType,
  552. lesson: that.form.lesson,
  553. gift: that.form.gift,
  554. memo: that.form.memo,
  555. dialogValue: that.dialogValue,
  556. };
  557. let postdata = qs.stringify(param);
  558. testSelect(postdata).then(res => {
  559. let json = res;
  560. if (json.Code == 0) {
  561. // 关闭弹窗
  562. that.dialogFinishVisible = false;
  563. // 重载列表
  564. that.getTableQuery();
  565. that.$message({
  566. showClose: true,
  567. message: '会员信息编辑成功!',
  568. type: 'success'
  569. });
  570. } else {
  571. that.$message.error(json.Memo);
  572. }
  573. })
  574. },
  575. // 确认提交课时
  576. confirmLesson() {
  577. let that = this;
  578. // checkNum
  579. let param = {
  580. token: localStorage.token,
  581. userCode: that.form.userCode,
  582. lesson: that.form.lesson,
  583. };
  584. let postdata = qs.stringify(param);
  585. testSelect(postdata).then(res => {
  586. let json = res;
  587. if (json.Code == 0) {
  588. // 关闭弹窗
  589. that.dialogVisible = false;
  590. // 重载列表
  591. that.getTableQuery();
  592. that.$message({
  593. showClose: true,
  594. message: '课时调整成功!',
  595. type: 'success'
  596. });
  597. } else {
  598. that.$message.error(json.Memo);
  599. }
  600. })
  601. },
  602. // 确认提交赠送
  603. confirmGift() {
  604. let that = this;
  605. // checkNum
  606. let param = {
  607. token: localStorage.token,
  608. userCode: that.form.userCode,
  609. gift: that.form.gift,
  610. };
  611. let postdata = qs.stringify(param);
  612. testSelect(postdata).then(res => {
  613. let json = res;
  614. if (json.Code == 0) {
  615. // 关闭弹窗
  616. that.dialogVisible = false;
  617. // 重载列表
  618. that.getTableQuery();
  619. that.$message({
  620. showClose: true,
  621. message: '赠送课时调整成功!',
  622. type: 'success'
  623. });
  624. } else {
  625. that.$message.error(json.Memo);
  626. }
  627. })
  628. },
  629. // 确认提交有效期
  630. confirmExpTime() {
  631. let that = this;
  632. // checkNum
  633. let param = {
  634. token: localStorage.token,
  635. userCode: that.form.userCode,
  636. expTime: that.form.expTime,
  637. };
  638. let postdata = qs.stringify(param);
  639. testSelect(postdata).then(res => {
  640. let json = res;
  641. if (json.Code == 0) {
  642. // 关闭弹窗
  643. that.dialogVisible = false;
  644. // 重载列表
  645. that.getTableQuery();
  646. that.$message({
  647. showClose: true,
  648. message: '赠送课时调整成功!',
  649. type: 'success'
  650. });
  651. } else {
  652. that.$message.error(json.Memo);
  653. }
  654. })
  655. },
  656. // 确认提交会员课程
  657. confirmLessonTable() {
  658. let that = this;
  659. // checkNum
  660. let param = {
  661. token: localStorage.token,
  662. userCode: that.form.userCode,
  663. dialogValue: that.form.dialogValue,
  664. };
  665. let postdata = qs.stringify(param);
  666. testSelect(postdata).then(res => {
  667. let json = res;
  668. if (json.Code == 0) {
  669. // 关闭弹窗
  670. that.dialogVisible = false;
  671. // 重载列表
  672. that.getTableQuery();
  673. that.$message({
  674. showClose: true,
  675. message: '会员课程调整成功!',
  676. type: 'success'
  677. });
  678. } else {
  679. that.$message.error(json.Memo);
  680. }
  681. })
  682. },
  683. // 加载选项
  684. panelSelect() {
  685. let that = this;
  686. let param = {
  687. token: localStorage.token,
  688. };
  689. let postdata = qs.stringify(param);
  690. testSelect(postdata).then(res => {
  691. let json = res;
  692. if (json.Code == 0) {
  693. that.form.coachOptions = json.Rs;
  694. } else {
  695. that.$message.error(json.Memo);
  696. }
  697. })
  698. },
  699. // 新增会员
  700. addFinish() {
  701. this.clearForm();
  702. this.dialogFinishVisible = true
  703. this.btnType = 0;
  704. this.dialogTitle = '新增会员'
  705. },
  706. addFinishMember() {
  707. this.clearForm();
  708. this.getClassVipuserQuery();
  709. this.dialogVisible = true
  710. },
  711. // 删除
  712. delList() {
  713. let that = this;
  714. // checkNum
  715. if (!this.multipleSelection.length) {
  716. that.$message({
  717. showClose: true,
  718. message: '错了哦,需要先选中至少一条记录',
  719. type: 'error'
  720. });
  721. return false
  722. }
  723. if (this.multipleSelection.length != 1) {
  724. that.$message({
  725. showClose: true,
  726. message: '错了哦,只能选中一条记录',
  727. type: 'error'
  728. });
  729. return false
  730. }
  731. let detectorid = that.multipleSelection[0].Id;
  732. let param = {
  733. token: localStorage.token,
  734. detectorid: detectorid,
  735. status: 9,//0禁用1启用9删除
  736. };
  737. let postdata = qs.stringify(param);
  738. this.$confirm('此操作将永久删除该会员, 是否继续?', '提示', {
  739. confirmButtonText: '确定',
  740. cancelButtonText: '取消',
  741. type: 'warning'
  742. }).then(() => {
  743. testSelect(postdata).then(res => {
  744. let json = res;
  745. if (json.Code == 0) {
  746. that.$message({
  747. showClose: true,
  748. message: '选中的会员已删除!',
  749. type: 'success'
  750. });
  751. // 重载列表
  752. that.getTableQuery();
  753. } else {
  754. that.$message.error(json.Memo);
  755. }
  756. });
  757. }).catch(() => {
  758. this.$message({
  759. type: 'info',
  760. message: '已取消删除'
  761. });
  762. });
  763. },
  764. handleSelectionChange(val) {
  765. this.multipleSelection = val;
  766. },
  767. // 查询按钮
  768. query() {
  769. this.getTableQuery();
  770. this.$message.success('查询完毕');
  771. },
  772. clearForm() {
  773. // clear
  774. this.form.name = '';
  775. this.form.userCode = '';
  776. this.form.shopId = '';
  777. },
  778. // 页面数据查询
  779. getTableQuery() {
  780. let that = this;
  781. // this.getGetChildRegionSelect(0, 1);
  782. that.loading = true;
  783. // 查询检测设备。上级区域id,区域id必传。regionid传0,查询supregionid对应所有子区域的检测设备。 如果supregionid,regionid都传0,默认查询企业ID下所有检测设备
  784. let param = {
  785. token: localStorage.token,
  786. stdId: this.$route.query.id,//标签名
  787. name: this.panel.name,//姓名
  788. phone: this.panel.phone,//手机号
  789. start: 1,//
  790. tableMax: 9999,//
  791. };
  792. let postdata = qs.stringify(param);
  793. ClassOverDetailListQuery(postdata).then(res => {
  794. let json = res;
  795. if (json.Code == 0) {
  796. that.loading = false;
  797. if (json.Rs) {
  798. that.allTableData = json.Rs;
  799. that.recordsTotal = json.Rs.length;
  800. } else {
  801. that.allTableData = [];
  802. that.recordsTotal = 0;
  803. }
  804. // 设置分页数据
  805. that.setPaginations();
  806. } else {
  807. that.$message.error(json.Memo);
  808. }
  809. })
  810. },
  811. // 设置分页数据
  812. setPaginations() {
  813. // 分页属性
  814. let that = this;
  815. that.pageination.total = that.recordsTotal;
  816. // 默认分页
  817. that.tableData = that.allTableData.filter((item, index) => {
  818. return index < that.pageination.pageItem;
  819. });
  820. },
  821. // 每页显示数量
  822. handleSizeChange() {
  823. let that = this;
  824. that.tableData = that.allTableData.filter((item, index) => {
  825. return index < that.pageination.pageItem;
  826. });
  827. that.draw = that.pageination.pageItem;
  828. that.getTableQuery();
  829. },
  830. // 翻页
  831. pageChange(pageIndex) {
  832. let that = this;
  833. // 获取当前页
  834. let index = that.pageination.pageItem * (pageIndex - 1);
  835. // 数据总数
  836. let nums = that.pageination.pageItem * pageIndex;
  837. // 容器
  838. let tables = [];
  839. for (var i = index; i < nums; i++) {
  840. if (that.allTableData[i]) {
  841. tables.push(that.allTableData[i])
  842. }
  843. this.tableData = tables;
  844. }
  845. that.start = index * that.draw;
  846. that.getTableQuery();
  847. },
  848. // 自动排序
  849. sortChange(params) {
  850. console.log(params)
  851. },
  852. // 过滤时间
  853. filterFmtDate(value, row, column) {
  854. let that = this;
  855. return nonTfmtDate(column, 11);
  856. },
  857. // 过滤金额
  858. filterMoney(value, row, column) {
  859. let that = this;
  860. return parseFloat(column).toFixed(2);
  861. },
  862. },
  863. watch: {
  864. $route(to) {
  865. if (to.name == 'finishDetail') {
  866. this.form.BeginTime = nonTfmtDatetoLength(this.$route.query.BeginTime, 16);
  867. this.form.ClassName = this.$route.query.ClassName;
  868. }
  869. },
  870. },
  871. }
  872. </script>
  873. <style scoped>
  874. @import "../assets/css/panel.css";
  875. .context {
  876. overflow: hidden;
  877. display: block;
  878. margin: 0 auto;
  879. background-color: #fff !important;
  880. padding: 30px;
  881. }
  882. .panel-body {
  883. padding: 20px;
  884. background: #F0F2F5;
  885. }
  886. .change {
  887. width: 100%;
  888. overflow: hidden;
  889. display: block;
  890. margin: 0 auto;
  891. padding-top: 10px;
  892. padding-bottom: 10px;
  893. }
  894. .change button {
  895. float: left;
  896. }
  897. .change button.pull-right {
  898. float: right;
  899. }
  900. .dialogTitle {
  901. width: 100%;
  902. overflow: hidden;
  903. display: block;
  904. margin: 0 auto;
  905. color: #000000;
  906. font-size: 18px;
  907. text-align: center;
  908. }
  909. .dialogTitle em {
  910. float: none;
  911. font-style: normal;
  912. color: #3799FF;
  913. margin: 0;
  914. }
  915. /deep/ .el-transfer-panel__item .el-checkbox__input {
  916. left: 40px;
  917. }
  918. .dialogFooter {
  919. width: 90%;
  920. overflow: hidden;
  921. display: block;
  922. margin: 0 auto;
  923. margin-top: 10px;
  924. }
  925. .dialogFooter button {
  926. float: right;
  927. margin-left: 10px;
  928. }
  929. .dialogContent {
  930. width: 100%;
  931. overflow: hidden;
  932. display: block;
  933. margin: 0 auto;
  934. }
  935. .dialogContent .pull-left {
  936. width: 30%;
  937. float: left;
  938. }
  939. .dialogContent .pull-right {
  940. width: 70%;
  941. float: right;
  942. }
  943. .blueTitle {
  944. width: 200px;
  945. overflow: hidden;
  946. display: block;
  947. margin: 0 auto;
  948. margin-top: 10px;
  949. margin-bottom: 40px;
  950. background: #F0F2F5;
  951. border-radius: 19px;
  952. text-align: center;
  953. color: #3799FF;
  954. font-size: 16px;
  955. padding: 5px 24px;
  956. }
  957. .current {
  958. width: 158px;
  959. height: 23px;
  960. border-radius: 250px;
  961. text-align: center;
  962. background: #F0F2F5;
  963. color: #545454;
  964. font-size: 14px;
  965. padding: 3px 10px;
  966. margin-left: 20px;
  967. }
  968. /deep/ .el-checkbox__inner {
  969. left: -20px;
  970. }
  971. </style>