tempUser.vue 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800
  1. <template>
  2. <div class="context">
  3. <div class="panel">
  4. <h5>临时会员</h5>
  5. <div class="panel-body">
  6. <div class="panel_control">
  7. <el-row :gutter="20">
  8. <el-col :span="5">
  9. <em>姓名:</em>
  10. <el-input v-model="panel.name" placeholder="请输入姓名"></el-input>
  11. </el-col>
  12. <el-col :span="5">
  13. <em>手机号:</em>
  14. <el-input v-model="panel.phone" placeholder="请输入手机号" type="number"></el-input>
  15. </el-col>
  16. <el-col :span="3">
  17. <el-button size="" type="primary" @click="query" plain :disabled="serachBtnStatus">查询
  18. </el-button>
  19. </el-col>
  20. </el-row>
  21. </div>
  22. </div>
  23. </div>
  24. <div class="change">
  25. <el-button @click="addMember" type="primary" size="mini">新增临时会员</el-button>
  26. <el-button @click="delList" size="mini">删除临时会员</el-button>
  27. </div>
  28. <div class="table">
  29. <el-table
  30. :data="tableData"
  31. border
  32. is-horizontal-resize
  33. :default-sort="{prop: 'date', order: 'descending'}"
  34. element-loading-background="rgba(0, 0, 0, 0.8)"
  35. @selection-change="handleSelectionChange" @current-change="clickChange"
  36. >
  37. >
  38. <el-table-column label="选择" width="55">
  39. <template slot-scope="scope">
  40. <el-radio v-model="tableRadio" :label="scope.row"><i></i></el-radio>
  41. </template>
  42. </el-table-column>
  43. <el-table-column
  44. type="index"
  45. label="序号"
  46. align="center"
  47. width="50"
  48. >
  49. </el-table-column>
  50. <el-table-column
  51. prop="UserInfo.head"
  52. label="头像"
  53. width="50"
  54. >
  55. <template slot-scope="scope">
  56. <div class="demo-image__preview" v-if="scope.row.Head">
  57. <el-image
  58. style="width: 25px; height: 25px"
  59. :src="scope.row.Head"
  60. :preview-src-list="[scope.row.Head]"
  61. >
  62. </el-image>
  63. </div>
  64. <img src="../assets/img/nav/head.png" alt="" v-else width="25px" height="25px">
  65. </template>
  66. </el-table-column>
  67. <el-table-column
  68. prop="UserName"
  69. label="会员名"
  70. width="90"
  71. >
  72. </el-table-column>
  73. <el-table-column
  74. prop="Phone"
  75. label="手机号"
  76. width="110"
  77. >
  78. </el-table-column>
  79. <el-table-column
  80. prop="StaticHr"
  81. label="静态心率"
  82. width="110"
  83. sortable
  84. >
  85. </el-table-column>
  86. <el-table-column
  87. prop="Height"
  88. label="身高(CM)"
  89. width="110"
  90. sortable
  91. >
  92. </el-table-column>
  93. <el-table-column
  94. prop="Weight"
  95. label="体重(KG)"
  96. width="110"
  97. sortable
  98. >
  99. <template slot-scope="scope">
  100. <span>{{scope.row.Weight / 10}}</span>
  101. </template>
  102. </el-table-column>
  103. <el-table-column
  104. prop="Sex"
  105. label="类型"
  106. align="center"
  107. width="80px"
  108. sortable
  109. >
  110. <template slot-scope="scope">
  111. <span v-if="scope.row.Sex == 1">男</span>
  112. <span v-if="scope.row.Sex == 2">女</span>
  113. </template>
  114. </el-table-column>
  115. <el-table-column
  116. prop="Birthday"
  117. label="生日"
  118. width="110"
  119. :formatter="filterFmtDate"
  120. sortable
  121. >
  122. </el-table-column>
  123. <!--<el-table-column-->
  124. <!--prop="ClassInfo"-->
  125. <!--label="会员课程"-->
  126. <!--width="220px"-->
  127. <!--&gt;-->
  128. <!--<template slot-scope="scope">-->
  129. <!--<span class="lessonSpan" :style="{background:lesson.ClassColor}"-->
  130. <!--v-for="lesson in scope.row.ClassInfo">{{ lesson.ClassName }}</span>-->
  131. <!--</template>-->
  132. <!--</el-table-column>-->
  133. <el-table-column
  134. prop="UserInfo.Memo"
  135. label="备注">
  136. <template slot-scope="scope">
  137. <el-popover
  138. placement="top"
  139. title=""
  140. width="200"
  141. trigger="hover"
  142. :content="scope.row.Memo">
  143. <span slot="reference"
  144. v-if="scope.row.Memo.length > 6">{{ scope.row.Memo.substr(0, 6) }} ....</span>
  145. </el-popover>
  146. <span v-if="scope.row.Memo.length <= 6">{{ scope.row.Memo }}</span>
  147. </template>
  148. </el-table-column>
  149. <el-table-column
  150. prop="UserInfo.Status"
  151. label="操作"
  152. width="160px"
  153. >
  154. <template slot-scope="scope">
  155. <el-button class="btn" type="default" size="mini" @click="editMember(scope.row)"
  156. v-if="userLevel != 4">编辑
  157. </el-button>
  158. </template>
  159. </el-table-column>
  160. </el-table>
  161. <br>
  162. <el-pagination
  163. background
  164. :total="pageination.total"
  165. :page-size="pageination.pageItem"
  166. @current-change="pageChange"
  167. ></el-pagination>
  168. </div>
  169. <el-dialog :title="dialogTitle" :visible.sync="dialogMemberVisible"
  170. :width="form.btnType == 1 ?'650px':'650px'">
  171. <div class="dialogContent">
  172. <div :class="['pull-left',{'tabwild':form.btnType == 1}]">
  173. <el-form ref="form" :model="form" label-width="80px">
  174. <el-form-item label="手机号" :required="true">
  175. <el-input v-model="form.phone"></el-input>
  176. </el-form-item>
  177. <el-form-item label="会员名" :required="true">
  178. <el-input v-model="form.name"></el-input>
  179. </el-form-item>
  180. <el-form-item label="备注">
  181. <el-input v-model="form.memo"></el-input>
  182. </el-form-item>
  183. <el-form-item label="身高" :required="true">
  184. <el-input v-model="form.height" placeholder="cm" type="number"></el-input>
  185. </el-form-item>
  186. <el-form-item label="体重" :required="true">
  187. <el-input v-model="form.weight" placeholder="kg" type="number"></el-input>
  188. </el-form-item>
  189. <el-form-item label="静态心率">
  190. <el-input v-model="form.staticHr" placeholder="请输入" type="number"></el-input>
  191. </el-form-item>
  192. <el-form-item label="性别" :required="true">
  193. <el-select v-model="form.sex " placeholder="">
  194. <el-option
  195. v-for="item in sexOptions"
  196. :key="item.value"
  197. :label="item.label"
  198. :value="item.value"
  199. ></el-option>
  200. </el-select>
  201. </el-form-item>
  202. <el-form-item label="出生年份" :required="true">
  203. <el-date-picker
  204. v-model="form.birthday"
  205. align="right"
  206. type="date"
  207. placeholder="选择日期"
  208. >
  209. </el-date-picker>
  210. </el-form-item>
  211. <el-form-item label="头像">
  212. <div class="upload">
  213. <el-upload
  214. class="avatar-uploader"
  215. :action=domain
  216. :http-request=upqiniu
  217. :show-file-list="false"
  218. :before-upload="beforeUpload">
  219. <!--<i v-else class="el-icon-plus avatar-uploader-icon"></i>-->
  220. </el-upload>
  221. <img v-if="imageUrl" :src="imageUrl" class="avatar">
  222. <cropper
  223. :width="300"
  224. :height="300"
  225. :fixed-number="[1,1]"
  226. @subUploadSucceed="getShopImages"
  227. ></cropper>
  228. <!--<ImgCutter v-on:cutDown="cutDown"></ImgCutter>-->
  229. </div>
  230. </el-form-item>
  231. </el-form>
  232. </div>
  233. </div>
  234. <div class="dialogFooter">
  235. <el-button :disabled="addDisabled" :loading="addDisabled" type="primary" size="small"
  236. v-if="form.btnType == 0"
  237. @click="confirmMember">确定
  238. </el-button>
  239. <el-button type="primary" size="small" v-if="form.btnType == 1" @click="confirmEditMember">确定
  240. </el-button>
  241. <el-button size="small" @click="dialogMemberVisible = false">取消</el-button>
  242. </div>
  243. </el-dialog>
  244. </div>
  245. </template>
  246. <script>
  247. import Global from '../Global.js'
  248. import ImgCutter from 'vue-img-cutter'
  249. import {
  250. TmpUserQuery,
  251. TmpUserAdd,
  252. TmpUserEdit,
  253. TmpUserDel,
  254. testTable,
  255. testSelect
  256. } from "../api/getApiRes";
  257. import cropper from '@/components/cropper.vue'
  258. let qs = require('qs');
  259. export default {
  260. data() {
  261. return {
  262. imageUrl: '',
  263. token: {}, // 七牛云的上传地址,根据自己所在地区选择,我这里是华南区
  264. domain: 'https://up-z1.qiniup.com', // 这是七牛云空间的外链默认域名
  265. qiniuaddr: 'xhead.beswell.com',//xhead.beswell.com 旧的 qjzpcd34v.hb-bkt.clouddn.com
  266. tableData: [],
  267. tableRadio: [],
  268. userLevel: localStorage.userLevel,
  269. serachBtnStatus: false,
  270. addDisabled: false,
  271. start: 0,
  272. draw: 1,
  273. dialogTitle: '新增临时会员',
  274. dialogMemberVisible: false,//新增会员dialog
  275. sexOptions: [
  276. {value: 1, label: '男'},//性别 1:男, 2:女
  277. {value: 2, label: '女'},
  278. ],
  279. panel: {
  280. usercode: '',
  281. username: '',
  282. compname: '',
  283. keyword: '',
  284. USERCODE: '',
  285. endType: '',
  286. taskstatus: 99,
  287. draw: 1,
  288. start: 0,
  289. recordsTotal: 0,
  290. tableData: [],
  291. allTableData: [],
  292. limit: '10',
  293. multipleSort: false,
  294. loading: false,
  295. fileList: [],
  296. multipleSelection: [],
  297. detectedmac: '',
  298. vipType: '',
  299. expDay: '',
  300. vipOptions: vipOptions(0),
  301. endTypeOptions: endTypeOptions(),
  302. time1: globalBt(),
  303. },
  304. multipleSelection: [],
  305. pageination: {
  306. pageItem: 10,
  307. pageoptions: pageOptions(),
  308. total: 100,
  309. pageIndex: 1,
  310. },
  311. form: {
  312. phone: '',
  313. name: '',
  314. userCode: '',
  315. shopId: '',
  316. Id: '',
  317. userId: '',
  318. height: '',
  319. weight: '',
  320. staticHr: '',
  321. head: '',
  322. birthday: '',
  323. sex: 1,
  324. vipType: 1,
  325. normalhour: 0,
  326. newnormalhour: 0,
  327. gifthour: 0,
  328. newgifthour: 0,
  329. btnType: 0,//0新建,1编辑编辑
  330. memo: '',
  331. expTime: '',
  332. classlist: [],
  333. dialogdata: [],//穿梭待选
  334. dialogValue: [],//穿梭已选
  335. },
  336. }
  337. },
  338. mounted() {
  339. // 读取列表
  340. this.getTableQuery();
  341. },
  342. watch: {
  343. $route(to) {
  344. if (to.name == 'tempUser') {
  345. // 读取列表
  346. this.getTableQuery();
  347. }
  348. },
  349. },
  350. methods: {
  351. addMember() {
  352. this.clearForm();
  353. this.dialogMemberVisible = true;
  354. this.btnType = 0;
  355. this.form.btnType = 0;
  356. this.dialogTitle = '新增临时会员'
  357. },
  358. delList() {
  359. let that = this;
  360. if (this.tableRadio.length == 0) {
  361. that.$message.error("请先选中一条记录");
  362. return false
  363. }
  364. let detectorid = this.tableRadio.TuId;
  365. let param = {
  366. token: localStorage.token,
  367. tuId: detectorid,
  368. };
  369. let postdata = qs.stringify(param);
  370. this.$confirm('此操作将永久删除该临时会员, 是否继续?', '提示', {
  371. confirmButtonText: '确定',
  372. cancelButtonText: '取消',
  373. type: 'warning'
  374. }).then(() => {
  375. TmpUserDel(postdata).then(res => {
  376. let json = res;
  377. if (json.Code == 0) {
  378. that.$message({
  379. showClose: true,
  380. message: '选中的临时会员已删除!',
  381. type: 'success'
  382. });
  383. // 重载列表
  384. that.getTableQuery();
  385. } else {
  386. that.$message.error(json.Memo + ' 错误码:' + json.Code);
  387. }
  388. });
  389. }).catch(() => {
  390. this.$message({
  391. type: 'info',
  392. message: '已取消删除'
  393. });
  394. });
  395. },
  396. clickChange(item) {
  397. this.tableRadio = item
  398. },
  399. // 确认提交新增会员
  400. confirmMember() {
  401. let that = this;
  402. // checkNum
  403. if (!that.form.phone) {
  404. this.$message.error('错了哦,手机号不能为空');
  405. return false
  406. }
  407. if (!globalCheckPhone(that.form.phone)) {
  408. this.$message.error('错了哦,手机号格式不正确');
  409. return false
  410. }
  411. if (!that.form.name) {
  412. this.$message.error('错了哦,会员名不能为空');
  413. return false
  414. }
  415. if (that.form.name.length > 8) {
  416. this.$message.error('错了哦,会员名字数超过8个字');
  417. return false
  418. }
  419. if (that.form.memo) {
  420. if (that.form.memo.length > 200) {
  421. this.$message.error('错了哦,备注字数超过200个字');
  422. return false
  423. }
  424. }
  425. if (!that.form.height) {
  426. this.$message.error('错了哦,身高不能为空');
  427. return false
  428. }
  429. if (!that.form.weight) {
  430. this.$message.error('错了哦,体重不能为空');
  431. return false
  432. }
  433. // if (!that.form.staticHr) {
  434. // this.$message.error('错了哦,静态心率不能为空');
  435. // return false
  436. // }
  437. if (!that.form.birthday) {
  438. this.$message.error('错了哦,出生年份不能为空');
  439. return false
  440. }
  441. let param = {
  442. token: localStorage.token,
  443. shopId: localStorage.shopId,
  444. phone: that.form.phone,
  445. name: that.form.name,
  446. sex: that.form.sex,
  447. birthday: nonTfmtDatetoLength(that.form.birthday, 10),
  448. height: that.form.height,
  449. weight: that.form.weight,
  450. staticHr: that.form.staticHr,
  451. head: that.form.head,
  452. memo: that.form.memo,
  453. };
  454. let postdata = qs.stringify(param);
  455. TmpUserAdd(postdata).then(res => {
  456. let json = res;
  457. if (json.Code == 0) {
  458. // 关闭弹窗
  459. that.dialogMemberVisible = false;
  460. // 重载列表
  461. that.getTableQuery();
  462. that.$message({
  463. showClose: true,
  464. message: '临时会员添加成功!',
  465. type: 'success'
  466. });
  467. } else {
  468. that.$message.error(json.Memo + ' 错误码:' + json.Code);
  469. }
  470. })
  471. },
  472. // 编辑
  473. editMember(row) {
  474. let that = this;
  475. this.clearForm();
  476. this.form.phone = row.Phone;
  477. this.form.name = row.UserName;
  478. this.form.memo = row.Memo;
  479. this.imageUrl = row.Head;
  480. this.form.height = row.Height;
  481. this.form.weight = parseInt(row.Weight) / 10;
  482. this.form.staticHr = row.StaticHr;
  483. this.form.sex = row.Sex;
  484. this.form.birthday = row.Birthday;
  485. this.form.tuId = row.TuId;
  486. this.form.btnType = 1;
  487. this.form.shopId = localStorage.shopId;
  488. this.form.Id = row.Id;
  489. this.dialogMemberVisible = true;
  490. this.dialogTitle = '编辑会员'
  491. },
  492. confirmEditMember() {
  493. let that = this;
  494. // checkNum
  495. if (!that.form.phone) {
  496. this.$message.error('错了哦,手机号不能为空');
  497. return false
  498. }
  499. if (!globalCheckPhone(that.form.phone)) {
  500. this.$message.error('错了哦,手机号格式不正确');
  501. return false
  502. }
  503. if (!that.form.name) {
  504. this.$message.error('错了哦,会员名不能为空');
  505. return false
  506. }
  507. if (that.form.name.length > 8) {
  508. this.$message.error('错了哦,会员名字数超过8个字');
  509. return false
  510. }
  511. if (that.form.memo) {
  512. if (that.form.memo.length > 200) {
  513. this.$message.error('错了哦,备注字数超过200个字');
  514. return false
  515. }
  516. }
  517. if (!that.form.height) {
  518. this.$message.error('错了哦,身高不能为空');
  519. return false
  520. }
  521. if (!that.form.weight) {
  522. this.$message.error('错了哦,体重不能为空');
  523. return false
  524. }
  525. // if (!that.form.staticHr) {
  526. // this.$message.error('错了哦,静态心率不能为空');
  527. // return false
  528. // }
  529. if (!that.form.birthday) {
  530. this.$message.error('错了哦,出生年份不能为空');
  531. return false
  532. }
  533. let param = {
  534. token: localStorage.token,
  535. shopId: that.form.shopId,
  536. userId: that.form.Id,
  537. phone: that.form.phone,
  538. name: that.form.name,
  539. memo: that.form.memo,
  540. head: that.form.head,
  541. height: that.form.height,
  542. weight: that.form.weight,
  543. staticHr: that.form.staticHr,
  544. sex: that.form.sex,
  545. birthday: nonTfmtDatetoLength(that.form.birthday, 10),
  546. tuId: that.form.tuId
  547. };
  548. let postdata = qs.stringify(param);
  549. TmpUserEdit(postdata).then(res => {
  550. let json = res;
  551. if (json.Code == 0) {
  552. // 关闭弹窗
  553. that.dialogMemberVisible = false;
  554. // 重载列表
  555. that.getTableQuery();
  556. that.$message({
  557. showClose: true,
  558. message: '会员信息编辑成功!',
  559. type: 'success'
  560. });
  561. } else {
  562. that.$message.error(json.Memo + ' 错误码:' + json.Code);
  563. }
  564. })
  565. },
  566. // 验证文件合法性
  567. beforeUpload(file) {
  568. const isJPG = file.type === 'image/jpeg' || file.type === 'image/png';
  569. const isLt2M = file.size / 1024 / 1024 < 70;
  570. if (!isJPG) {
  571. this.$message.error('上传头像图片只能是 JPG 格式!')
  572. }
  573. if (!isLt2M) {
  574. this.$message.error('上传头像图片大小不能超过 70MB!')
  575. }
  576. return isJPG && isLt2M
  577. },
  578. cutDown(e) {
  579. console.log(e);
  580. this.imageUrl = e.dataURL;
  581. this.upqiniu(e);
  582. },
  583. // 上传文件到七牛云
  584. upqiniu(req) {
  585. let that = this;
  586. const config = {
  587. headers: {'Content-Type': 'multipart/form-data'}
  588. };
  589. let filetype = '';
  590. if (req.file.type === 'image/png') {
  591. filetype = 'png'
  592. } else {
  593. filetype = 'jpg'
  594. }
  595. // 重命名要上传的文件
  596. const keyname = 'GoAllOut' + new Date().valueOf() + Math.floor(Math.random() * 100) + '.' + filetype;
  597. // 从后端获取上传凭证token
  598. let param = {
  599. token: localStorage.token,
  600. };
  601. let postdata = qs.stringify(param);
  602. this.axios.post(headapi + 'v1/QiNiu/GetSimpleQiNiuToken', postdata).then(res => {
  603. const formdata = new FormData();
  604. formdata.append('file', req.file);
  605. formdata.append('token', res.data.QiNinToken);
  606. formdata.append('key', keyname);
  607. // 获取到凭证之后再将文件上传到七牛云空间
  608. this.axios.post(this.domain, formdata, config).then(res => {
  609. this.imageUrl = 'http://' + this.qiniuaddr + '/' + res.data.key;
  610. this.form.head = 'http://' + this.qiniuaddr + '/' + keyname;
  611. })
  612. })
  613. },
  614. // 查询按钮
  615. query() {
  616. let that = this;
  617. that.serachBtnStatus = true;
  618. that.getTableQuery();
  619. that.$message.success('查询完毕');
  620. let totalTime = 2
  621. let clock = window.setInterval(() => {
  622. totalTime--
  623. if (totalTime < 0) {
  624. totalTime = 2;
  625. that.serachBtnStatus = false;
  626. }
  627. }, 1000)
  628. },
  629. // 页面数据查询
  630. getTableQuery() {
  631. let that = this;
  632. that.loading = true;
  633. let param = {
  634. token: localStorage.token,
  635. shopId: that.panel.shopId,//
  636. name: that.panel.name,//
  637. expDay: that.panel.expDay,//
  638. start: that.start,//
  639. tableMax: 20,//
  640. };
  641. let postdata = qs.stringify(param);
  642. TmpUserQuery(postdata).then(res => {
  643. let json = res;
  644. if (json.Code == 0) {
  645. that.loading = false;
  646. if (json.Rs) {
  647. that.allTableData = json.Rs;
  648. that.recordsTotal = json.PageCount * that.pageination.pageItem;
  649. } else {
  650. that.allTableData = [];
  651. that.recordsTotal = 0;
  652. }
  653. // 设置分页数据
  654. that.setPaginations();
  655. } else {
  656. that.$message.error(json.Memo + ' 错误码:' + json.Code);
  657. }
  658. })
  659. },
  660. clearForm() {
  661. // clear
  662. this.form.name = '';
  663. this.form.head = '';
  664. this.imageUrl = '';
  665. this.form.phone = '';
  666. this.form.memo = '';
  667. this.form.normalhour = 0;
  668. this.form.gifthour = 0;
  669. this.form.height = '';
  670. this.form.weight = '';
  671. this.form.staticHr = '';
  672. this.form.sex = 1;
  673. this.form.birthday = '';
  674. this.form.userCode = '';
  675. this.form.shopId = '';
  676. this.form.classlist = [];
  677. },
  678. handleSelectionChange(val) {
  679. this.multipleSelection = val;
  680. },
  681. // 设置分页数据
  682. setPaginations() {
  683. // 分页属性
  684. let that = this;
  685. that.pageination.total = that.recordsTotal;
  686. // 默认分页
  687. that.tableData = that.allTableData.filter((item, index) => {
  688. return index < that.pageination.pageItem;
  689. });
  690. },
  691. // 每页显示数量
  692. handleSizeChange() {
  693. let that = this;
  694. that.tableData = that.allTableData.filter((item, index) => {
  695. return index < that.pageination.pageItem;
  696. });
  697. that.draw = that.pageination.pageItem;
  698. // that.getTableQuery();
  699. },
  700. // 翻页
  701. pageChange(pageIndex) {
  702. let that = this;
  703. // 获取当前页
  704. let index = that.pageination.pageItem * (pageIndex - 1);
  705. // 数据总数
  706. let nums = that.pageination.pageItem * pageIndex;
  707. // 容器
  708. let tables = [];
  709. for (var i = index; i < nums; i++) {
  710. if (that.allTableData[i]) {
  711. tables.push(that.allTableData[i])
  712. }
  713. this.tableData = tables;
  714. }
  715. that.start = index * that.draw;
  716. console.log(index);
  717. console.log(that.draw);
  718. that.getTableQuery();
  719. },
  720. // 过滤时间
  721. filterFmtDate(value, row, column) {
  722. return nonTfmtDatetoLength(column, 11);
  723. },
  724. // 海报上传成功
  725. getShopImages(url) {
  726. this.imageUrl = url;
  727. this.form.head = url;
  728. }
  729. },
  730. components: {
  731. cropper
  732. }
  733. }
  734. </script>
  735. <style scoped>
  736. @import "../assets/css/panel.css";
  737. .context {
  738. border-radius: 12px;
  739. /* height: 770px; */
  740. overflow-y: scroll;
  741. display: block;
  742. margin: 0 auto;
  743. background-color: #fff !important;
  744. padding: 30px;
  745. padding-bottom: 30px;
  746. }
  747. .panel-body {
  748. padding: 20px;
  749. background: #F0F2F5;
  750. }
  751. .change {
  752. width: 100%;
  753. overflow: hidden;
  754. display: block;
  755. margin: 0 auto;
  756. padding-top: 10px;
  757. padding-bottom: 10px;
  758. }
  759. .change button {
  760. float: left;
  761. }
  762. .change button.pull-right {
  763. float: right;
  764. }
  765. .dialogContent {
  766. width: 100%;
  767. overflow: hidden;
  768. display: block;
  769. margin: 0 auto;
  770. }
  771. .dialogContent .pull-left {
  772. width: 100%;
  773. float: left;
  774. }
  775. .el-form-item {
  776. width: 50%;
  777. float: left;
  778. }
  779. </style>