Member.vue 61 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541
  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="4">
  9. <em>姓名:</em>
  10. <el-input v-model="panel.name" placeholder="请输入姓名"></el-input>
  11. </el-col>
  12. <el-col :span="4">
  13. <em>手机号:</em>
  14. <el-input v-model="panel.phone" placeholder="请输入手机号" type="number"></el-input>
  15. </el-col>
  16. <el-col :span="4">
  17. <em>会员类型:</em>
  18. <el-select v-model="panel.vipType">
  19. <el-option
  20. v-for="item in panel.vipOptions"
  21. :key="item.value"
  22. :label="item.label"
  23. :value="item.value">
  24. </el-option>
  25. </el-select>
  26. </el-col>
  27. <el-col :span="4">
  28. <em>到期日:</em>
  29. <el-select v-model="panel.expDay">
  30. <el-option
  31. v-for="item in panel.endTypeOptions"
  32. :key="item.value"
  33. :label="item.label"
  34. :value="item.value">
  35. </el-option>
  36. </el-select>
  37. </el-col>
  38. <el-col :span="4">
  39. <el-button size="" type="primary" @click="query" plain :disabled="serachBtnStatus">查询
  40. </el-button>
  41. </el-col>
  42. </el-row>
  43. </div>
  44. </div>
  45. </div>
  46. <div class="change">
  47. <el-button @click="addMember" v-if="userLevel != 4" type="primary">新增会员</el-button>
  48. <el-button @click="delList" v-if="userLevel != 4">删除会员</el-button>
  49. <el-button @click="lessonChange" v-if="userLevel != 4">课时调整</el-button>
  50. <el-button @click="giftChange" v-if="userLevel != 4">赠送课时调整</el-button>
  51. <el-button @click="ExpTimeChange" v-if="userLevel != 4">有效期调整</el-button>
  52. <el-button @click="lessonStudenChange" v-if="userLevel != 4">增删会员可预约课程</el-button>
  53. <!-- <el-button class="pull-right" icon="el-icon-position">导出</el-button>-->
  54. </div>
  55. <div class="table">
  56. <el-table
  57. :data="tableData"
  58. border
  59. is-horizontal-resize
  60. :default-sort="{prop: 'date', order: 'descending'}"
  61. element-loading-background="rgba(0, 0, 0, 0.8)"
  62. @selection-change="handleSelectionChange" @current-change="clickChange"
  63. >
  64. >
  65. <el-table-column label="选择" width="55">
  66. <template slot-scope="scope">
  67. <el-radio v-model="tableRadio" :label="scope.row"><i></i></el-radio>
  68. </template>
  69. </el-table-column>
  70. <el-table-column
  71. type="index"
  72. label="序号"
  73. align="center"
  74. width="50"
  75. >
  76. </el-table-column>
  77. <el-table-column
  78. prop="UserInfo.head"
  79. label="头像"
  80. width="50"
  81. >
  82. <template slot-scope="scope">
  83. <div class="demo-image__preview" v-if="scope.row.UserInfo.Head">
  84. <el-image
  85. style="width: 25px; height: 25px"
  86. :src="scope.row.UserInfo.Head"
  87. :preview-src-list="[scope.row.UserInfo.Head]"
  88. >
  89. </el-image>
  90. </div>
  91. <img src="../assets/img/nav/head.png" alt="" v-else width="25px" height="25px">
  92. </template>
  93. </el-table-column>
  94. <el-table-column
  95. prop="UserInfo.Name"
  96. label="会员名"
  97. width="90"
  98. >
  99. </el-table-column>
  100. <el-table-column
  101. prop="UserInfo.Phone"
  102. label="手机号"
  103. width="110"
  104. sortable
  105. >
  106. </el-table-column>
  107. <el-table-column
  108. prop="UserInfo.VipType"
  109. label="类型"
  110. align="center"
  111. width="80px"
  112. sortable
  113. >
  114. <template slot-scope="scope">
  115. <span v-if="scope.row.UserInfo.VipType == 1">年费</span>
  116. <span v-if="scope.row.UserInfo.VipType == 2">充值</span>
  117. </template>
  118. </el-table-column>
  119. <el-table-column
  120. prop="UserInfo.ExpTime"
  121. label="会员有效期"
  122. width="115"
  123. :formatter="filterFmtDate"
  124. sortable
  125. >
  126. </el-table-column>
  127. <el-table-column
  128. prop="UserInfo.RemainNormalhour"
  129. label="剩余课时"
  130. width="105"
  131. sortable
  132. >
  133. </el-table-column>
  134. <el-table-column
  135. prop="UserInfo.RemainGifthour"
  136. label="剩余赠送"
  137. width="105"
  138. sortable
  139. >
  140. </el-table-column>
  141. <el-table-column
  142. prop="UserInfo.ConsumeNormalhour"
  143. label="消费课时"
  144. width="105"
  145. sortable
  146. >
  147. </el-table-column>
  148. <el-table-column
  149. prop="UserInfo.ConsumeGifthour"
  150. label="消费赠送"
  151. width="105"
  152. sortable
  153. >
  154. </el-table-column>
  155. <el-table-column
  156. prop="ClassInfo"
  157. label="会员课程"
  158. width="220px"
  159. >
  160. <template slot-scope="scope">
  161. <span class="lessonSpan" :style="{background:lesson.ClassColor}"
  162. v-for="lesson in scope.row.ClassInfo">{{ lesson.ClassName }}</span>
  163. </template>
  164. </el-table-column>
  165. <el-table-column
  166. prop="UserInfo.IsAcross"
  167. label="跨店会员"
  168. width="105"
  169. sortable
  170. >
  171. <template slot-scope="scope">
  172. <span v-if="scope.row.UserInfo.IsAcross == 0" class="green">本店用户</span>
  173. <span v-else class="red">跨店用户</span>
  174. </template>
  175. </el-table-column>
  176. <el-table-column
  177. prop="TakeId"
  178. label="Take绑定"
  179. width="105"
  180. sortable
  181. >
  182. <template slot-scope="scope">
  183. <span v-if="scope.row.UserInfo.TakeId == 0" class="red">未绑定</span>
  184. <span v-else>已绑定</span>
  185. </template>
  186. </el-table-column>
  187. <el-table-column
  188. prop="UserInfo.Memo"
  189. label="备注">
  190. <template slot-scope="scope">
  191. <el-popover
  192. placement="top"
  193. title=""
  194. width="200"
  195. trigger="hover"
  196. :content="scope.row.UserInfo.Memo">
  197. <span slot="reference"
  198. v-if="scope.row.UserInfo.Memo.length > 6">{{ scope.row.UserInfo.Memo.substr(0, 6) }} ....</span>
  199. </el-popover>
  200. <span v-if="scope.row.UserInfo.Memo.length <= 6">{{ scope.row.UserInfo.Memo }}</span>
  201. </template>
  202. </el-table-column>
  203. <el-table-column
  204. prop="UserInfo.Status"
  205. label="操作"
  206. width="160px"
  207. >
  208. <template slot-scope="scope">
  209. <el-button class="btn" type="default" size="mini" @click="editMember(scope.row)"
  210. v-if="userLevel != 4">编辑
  211. </el-button>
  212. <el-button class="btn" type="danger" v-if="scope.row.UserInfo.Status == 1" size="mini"
  213. @click="pauseRow(scope.row)">
  214. 禁用
  215. </el-button>
  216. <el-button class="btn" type="success" v-if="scope.row.UserInfo.Status == 8" size="mini"
  217. @click="runRow(scope.row)">
  218. 启用
  219. </el-button>
  220. <el-button class="btn" type="primary" size="mini"
  221. @click="addTake(scope.row)">Take绑定
  222. </el-button>
  223. <el-button class="btn relevance" type="default" size="mini"
  224. @click="goRelevance(scope.row)">关联手机号
  225. </el-button>
  226. </template>
  227. </el-table-column>
  228. </el-table>
  229. <br>
  230. <div v-if="pageshow">
  231. <el-pagination
  232. background
  233. :total="pageination.total"
  234. :page-size="pageination.pageItem"
  235. @current-change="pageChange"
  236. :current-page.sync="cur_page"
  237. ></el-pagination>
  238. </div>
  239. </div>
  240. <el-dialog :title="dialogTitle" :visible.sync="dialogMemberVisible"
  241. :width="form.btnType == 1 ?'650px':'1200px'">
  242. <div class="dialogContent">
  243. <div :class="['pull-left',{'tabwild':form.btnType == 1}]">
  244. <el-form ref="form" :model="form" label-width="80px">
  245. <el-form-item label="手机号" :required="true">
  246. <el-input v-model="form.phone" @blur="getUsrInfoList()"></el-input>
  247. </el-form-item>
  248. <el-form-item label="会员名" :required="true">
  249. <el-input v-model="form.name"></el-input>
  250. </el-form-item>
  251. <el-form-item label="会员类型" v-if="form.btnType == 0">
  252. <el-select v-model="form.vipType" placeholder="请选择所属门店">
  253. <el-option
  254. v-for="item in memberTypes"
  255. :key="item.value"
  256. :label="item.label"
  257. :value="item.value"
  258. ></el-option>
  259. </el-select>
  260. </el-form-item>
  261. <el-form-item label="课时" v-if="form.btnType == 0">
  262. <el-input-number v-model="form.normalhour " :min="0" :max="99999"
  263. label="(天)"></el-input-number>
  264. </el-form-item>
  265. <el-form-item label="赠送课时" v-if="form.btnType == 0">
  266. <el-input-number v-model="form.gifthour " :min="0" :max="99999"
  267. label="(天)"></el-input-number>
  268. </el-form-item>
  269. <el-form-item label="备注">
  270. <el-input v-model="form.memo"></el-input>
  271. </el-form-item>
  272. <el-form-item label="身高" :required="true">
  273. <el-input v-model="form.height" placeholder="cm" type="number"></el-input>
  274. </el-form-item>
  275. <el-form-item label="体重" :required="true">
  276. <el-input v-model="form.weight" placeholder="kg" type="number"></el-input>
  277. </el-form-item>
  278. <el-form-item label="静态心率" >
  279. <el-input v-model="form.staticHr" placeholder="请输入" type="number"></el-input>
  280. </el-form-item>
  281. <el-form-item label="性别" :required="true">
  282. <el-select v-model="form.sex " placeholder="">
  283. <el-option
  284. v-for="item in sexOptions"
  285. :key="item.value"
  286. :label="item.label"
  287. :value="item.value"
  288. ></el-option>
  289. </el-select>
  290. </el-form-item>
  291. <el-form-item label="头像" :required="true">
  292. <!-- <div class="upload">-->
  293. <!-- <el-upload-->
  294. <!-- class="avatar-uploader"-->
  295. <!-- :action=domain-->
  296. <!-- :http-request=upqiniu-->
  297. <!-- :show-file-list="false"-->
  298. <!-- :before-upload="beforeUpload">-->
  299. <!-- &lt;!&ndash;<i v-else class="el-icon-plus avatar-uploader-icon"></i>&ndash;&gt;-->
  300. <!-- </el-upload>-->
  301. <img v-if="imageUrl" :src="imageUrl" class="avatar">
  302. <cropper
  303. :width="300"
  304. :height="300"
  305. :fixed-number="[1,1]"
  306. @subUploadSucceed="getShopImages"
  307. ></cropper>
  308. <!--<ImgCutter v-on:cutDown="cutDown"></ImgCutter>-->
  309. <!-- </div>-->
  310. </el-form-item>
  311. <el-form-item label="出生年份" :required="true">
  312. <el-date-picker
  313. v-model="form.birthday"
  314. align="right"
  315. type="date"
  316. placeholder="选择日期"
  317. >
  318. </el-date-picker>
  319. </el-form-item>
  320. </el-form>
  321. </div>
  322. <div class="pull-right" v-if="form.btnType == 0 && pullRight">
  323. <el-form ref="form" :model="form" label-width="100px">
  324. <el-form-item label="会员课程">
  325. <el-transfer filterable v-model="form.classlist" :data="form.dialogdata"
  326. :titles="['全部课程','已选课程']"></el-transfer>
  327. </el-form-item>
  328. </el-form>
  329. </div>
  330. </div>
  331. <div class="dialogFooter">
  332. <el-button :disabled="addDisabled" type="primary" size="small" v-if="form.btnType == 0"
  333. @click="confirmMember">确定
  334. </el-button>
  335. <el-button type="primary" size="small" v-if="form.btnType == 1" @click="confirmEditMember">确定
  336. </el-button>
  337. <el-button size="small" @click="dialogMemberVisible = false">取消</el-button>
  338. </div>
  339. </el-dialog>
  340. <el-dialog :visible.sync="dialogVisible" width="650px">
  341. <div class="dialogTitle">
  342. <h5>
  343. 用户:
  344. <em class="blue">【 {{ form.rowName }}】</em>
  345. <br>
  346. <br>
  347. <span v-if="dialogLesson">当前课时 {{ form.normalhour }}</span>
  348. <span v-if="dialogGift">赠送课时 {{ form.gifthour }}</span>
  349. <span v-if="dialogExpTime">当前到期时间</span>
  350. <span v-if="dialogLessonTable">增删会员可预约课程</span>
  351. </h5>
  352. </div>
  353. <div v-if="dialogLesson">
  354. <el-input-number v-model="form.newnormalhour" :min="-9999" :max="9999" label="课时调整"></el-input-number>
  355. </div>
  356. <div v-if="dialogGift">
  357. <el-input-number v-model="form.newgifthour" :min="-9999" :max="9999" label="赠送课时调整"></el-input-number>
  358. </div>
  359. <div v-if="dialogExpTime">
  360. <el-date-picker
  361. v-model="form.expTime"
  362. type="date"
  363. placeholder="选择日期">
  364. </el-date-picker>
  365. </div>
  366. <div v-if="dialogLessonTable">
  367. <el-transfer filterable v-model="form.dialogValue" :data="form.dialogdata"
  368. :titles="['全部课程','已选课程']"></el-transfer>
  369. </div>
  370. <div class="dialogFooter">
  371. <!--课时调整-->
  372. <el-button type="primary" size="small" @click="confirmLesson" v-if="dialogLesson">确定</el-button>
  373. <!--赠送课时调整-->
  374. <el-button type="primary" size="small" @click="confirmGift" v-if="dialogGift">确定</el-button>
  375. <!-- 有效期调整-->
  376. <el-button type="primary" size="small" @click="confirmExpTime" v-if="dialogExpTime">确定</el-button>
  377. <!-- 课程增删-->
  378. <el-button type="primary" size="small" @click="confirmLessonTable" v-if="dialogLessonTable">确定
  379. </el-button>
  380. <el-button size="small" @click="dialogVisible = false">取消</el-button>
  381. </div>
  382. </el-dialog>
  383. <el-dialog title="Take绑定" :visible.sync="TakeVisible" width="650px">
  384. <div>
  385. <el-select v-model="Takevalue" placeholder="请选择">
  386. <el-option
  387. v-for="item in Takeoptions"
  388. :key="item.Id"
  389. :label="item.Name + item.PhoneNo"
  390. :value="item.Id">
  391. </el-option>
  392. </el-select>
  393. </div>
  394. <div class="dialogFooter">
  395. <!--take绑定调整-->
  396. <el-button type="primary" size="small" @click="confirmTake">确定</el-button>
  397. <el-button size="small" @click="TakeVisible = false">取消</el-button>
  398. </div>
  399. </el-dialog>
  400. </div>
  401. </template>
  402. <script>
  403. import Global from '../Global.js'
  404. import ImgCutter from 'vue-img-cutter'
  405. import {
  406. VipUserListQuery,
  407. ClassListQuery,
  408. VipUserAdd,
  409. VipUserStatusEdit,
  410. VipUserEdit,
  411. VipUserHourEdit,
  412. VipUserExpEdit,
  413. VipUserClassEdit,
  414. QueryTakeCustomerByName,
  415. BindTakeCustomer,
  416. VipUserQueryByPhone,
  417. testTable,
  418. testSelect
  419. } from "../api/getApiRes";
  420. import cropper from '@/components/cropper.vue'
  421. let qs = require('qs');
  422. export default {
  423. data() {
  424. return {
  425. imageUrl: '',
  426. token: {}, // 七牛云的上传地址,根据自己所在地区选择,我这里是华南区
  427. domain: 'https://up-z1.qiniup.com', // 这是七牛云空间的外链默认域名
  428. qiniuaddr: 'xhead.beswell.com',//xhead.beswell.com 旧的 qjzpcd34v.hb-bkt.clouddn.com
  429. pullRight: true,//其他dialog
  430. addDisabled: true,//禁止添加新用户
  431. dialogVisible: false,//其他dialog
  432. TakeVisible: false,//take dialog
  433. dialogMemberVisible: false,//新增会员dialog
  434. dialogLesson: false,//课时调整
  435. dialogGift: false,//赠送课时调整
  436. dialogExpTime: false,//有效期调整
  437. dialogLessonTable: false,//会员课程
  438. dialogTitle: '新增会员',
  439. dialogValue: [],
  440. Takevalue: 0,
  441. Takeoptions: [],
  442. TakeHid: 0,
  443. start: 0,
  444. draw: 1,
  445. cur_page: 1,
  446. pageshow: true,
  447. sexOptions: [
  448. {value: 1, label: '男'},//性别 1:男, 2:女
  449. {value: 2, label: '女'},
  450. ],
  451. yearOptions: getyearOptions(15),
  452. // panel 配置项目
  453. panel: {
  454. usercode: '',
  455. username: '',
  456. compname: '',
  457. keyword: '',
  458. USERCODE: '',
  459. endType: '',
  460. taskstatus: 99,
  461. draw: 1,
  462. start: 0,
  463. recordsTotal: 0,
  464. tableData: [],
  465. allTableData: [],
  466. limit: '10',
  467. multipleSort: false,
  468. loading: false,
  469. fileList: [],
  470. multipleSelection: [],
  471. detectedmac: '',
  472. vipType: '',
  473. expDay: '',
  474. vipOptions: vipOptions(0),
  475. endTypeOptions: endTypeOptions(),
  476. time1: globalBt(),
  477. },
  478. multipleSelection: [],
  479. pageination: {
  480. pageItem: 20,
  481. pageoptions: pageOptions(),
  482. total: 100,
  483. pageIndex: 1,
  484. },
  485. form: {
  486. phone: '',
  487. name: '',
  488. userCode: '',
  489. shopId: '',
  490. Id: '',
  491. userId: '',
  492. height: '',
  493. weight: '',
  494. staticHr: '',
  495. head: '',
  496. birthday: '',
  497. sex: 1,
  498. vipType: 1,
  499. normalhour: 0,
  500. newnormalhour: 0,
  501. gifthour: 0,
  502. newgifthour: 0,
  503. btnType: 0,//0新建,1编辑编辑
  504. memo: '',
  505. expTime: '',
  506. classlist: [],
  507. dialogdata: [],//穿梭待选
  508. dialogValue: [],//穿梭已选
  509. },
  510. memberTypes: vipOptions(1),
  511. tableData: [],
  512. tableRadio: [],
  513. userLevel: localStorage.userLevel,
  514. serachBtnStatus: false
  515. }
  516. },
  517. mounted() {
  518. // 加载课程选项
  519. this.panelSelect();
  520. // 读取列表
  521. this.getTableQuery();
  522. },
  523. watch: {
  524. $route(to) {
  525. if (to.name == 'Member') {
  526. // 加载课程选项
  527. this.panelSelect();
  528. // 读取列表
  529. this.getTableQuery();
  530. }
  531. },
  532. },
  533. methods: {
  534. // 查询用户是否乃跨店用户
  535. // todo 逻辑
  536. // 1.新用户正常注册
  537. // 2.
  538. getUsrInfoList() {
  539. // 只有新增的时候启用当前功能
  540. if (this.form.btnType == 1) {
  541. return false
  542. }
  543. let that = this;
  544. let param = {
  545. token: localStorage.token,
  546. phone: this.form.phone,
  547. };
  548. let postdata = qs.stringify(param);
  549. VipUserQueryByPhone(postdata).then(res => {
  550. let json = res;
  551. if (json.Code == 0) {
  552. let Status = json.Status;
  553. let Info = json.Info;
  554. // clear info
  555. that.pullRight = true;
  556. that.addDisabled = false;
  557. that.pullRight = true;
  558. that.form.name = '';
  559. that.form.height = '';
  560. that.form.weight = '';
  561. that.form.birthday = '';
  562. that.imageUrl = '';
  563. that.form.head = '';
  564. this.form.sex = 1;
  565. switch (parseInt(Status)) {
  566. case 1:
  567. that.$message.error('用户已存在,手机号不能重复添加');
  568. that.addDisabled = true;
  569. break;
  570. case 2:
  571. that.$message.success('已读取到当前用户信息');
  572. // 关掉右侧
  573. that.pullRight = false;
  574. that.form.name = Info.UserName;
  575. that.form.height = Info.Height;
  576. that.form.weight = parseInt(Info.Weight) / 10;
  577. that.form.birthday = Info.Birthday;
  578. that.imageUrl = Info.Head;
  579. that.form.head = Info.Head;
  580. this.form.sex = Info.Sex;
  581. break;
  582. case 3:
  583. that.$message.error('手机号已经关联其他用户不能重复添加');
  584. that.addDisabled = true;
  585. break;
  586. case 4:
  587. // 手机号在本店不存在,在其他店也不存在,前台应允许用户填写
  588. break;
  589. }
  590. } else {
  591. that.$message.error(json.Memo);
  592. }
  593. })
  594. },
  595. // 关联手机号跳转
  596. goRelevance(row) {
  597. this.$router.push({path: '/relevancePhone', query: {userId: row.UserInfo.Id}});
  598. },
  599. cutDown(e){
  600. console.log(e);
  601. this.imageUrl = e.dataURL;
  602. this.upqiniu(e);
  603. },
  604. // 上传文件到七牛云
  605. upqiniu(req) {
  606. let that = this;
  607. const config = {
  608. headers: {'Content-Type': 'multipart/form-data'}
  609. };
  610. let filetype = '';
  611. if (req.file.type === 'image/png') {
  612. filetype = 'png'
  613. } else {
  614. filetype = 'jpg'
  615. }
  616. // 重命名要上传的文件
  617. const keyname = 'GoAllOut' + new Date().valueOf() + Math.floor(Math.random() * 100) + '.' + filetype;
  618. // 从后端获取上传凭证token
  619. let param = {
  620. token: localStorage.token,
  621. };
  622. let postdata = qs.stringify(param);
  623. this.axios.post(headapi + 'v1/QiNiu/GetSimpleQiNiuToken', postdata).then(res => {
  624. const formdata = new FormData();
  625. formdata.append('file', req.file);
  626. formdata.append('token', res.data.QiNinToken);
  627. formdata.append('key', keyname);
  628. // 获取到凭证之后再将文件上传到七牛云空间
  629. this.axios.post(this.domain, formdata, config).then(res => {
  630. this.imageUrl = 'http://' + this.qiniuaddr + '/' + res.data.key;
  631. this.form.head = 'http://' + this.qiniuaddr + '/' + keyname;
  632. })
  633. })
  634. },
  635. // 验证文件合法性
  636. beforeUpload(file) {
  637. const isJPG = file.type === 'image/jpeg' || file.type === 'image/png';
  638. const isLt2M = file.size / 1024 / 1024 < 70;
  639. if (!isJPG) {
  640. this.$message.error('上传头像图片只能是 JPG 格式!')
  641. }
  642. if (!isLt2M) {
  643. this.$message.error('上传头像图片大小不能超过 70MB!')
  644. }
  645. return isJPG && isLt2M
  646. },
  647. // 打开take绑定和拉取take数据
  648. addTake(row) {
  649. let that = this;
  650. let param = {
  651. token: localStorage.token,
  652. userId: row.UserInfo.Id,
  653. };
  654. this.TakeHid = row.UserInfo.HId;
  655. let postdata = qs.stringify(param);
  656. QueryTakeCustomerByName(postdata).then(res => {
  657. let json = res;
  658. if (json.Code == 0) {
  659. if (json.Rs != '') {
  660. that.Takeoptions = json.Rs;
  661. that.Takevalue = json.Rs[0].Id;
  662. // 有值才能打开
  663. this.TakeVisible = true;
  664. } else {
  665. that.$message.error('当前用户没有可用的Take账号');
  666. this.TakeVisible = false;
  667. console.log('null');
  668. }
  669. } else {
  670. that.$message.error(json.Memo + ' 错误码:' + json.Code);
  671. }
  672. })
  673. },
  674. // 绑定take
  675. confirmTake() {
  676. let that = this;
  677. let param = {
  678. token: localStorage.token,
  679. hId: this.TakeHid,
  680. customerId: this.Takevalue,
  681. memo: '后台管理手动绑定',
  682. };
  683. let postdata = qs.stringify(param);
  684. BindTakeCustomer(postdata).then(res => {
  685. let json = res;
  686. if (json.Code == 0) {
  687. that.$message({
  688. showClose: true,
  689. message: 'Take绑定成功!',
  690. type: 'success'
  691. });
  692. this.TakeVisible = false;
  693. // 读取列表
  694. this.getTableQuery();
  695. } else {
  696. that.$message.error(json.Memo + ' 错误码:' + json.Code);
  697. }
  698. })
  699. },
  700. clickChange(item) {
  701. this.tableRadio = item
  702. },
  703. // 编辑
  704. editMember(row) {
  705. let that = this;
  706. this.clearForm();
  707. this.form.phone = row.UserInfo.Phone;
  708. this.form.name = row.UserInfo.Name;
  709. this.form.memo = row.UserInfo.Memo;
  710. this.imageUrl = row.UserInfo.Head;
  711. this.form.height = row.UserInfo.Height;
  712. this.form.weight = parseInt(row.UserInfo.Weight) / 10;
  713. this.form.staticHr = row.UserInfo.StaticHr;
  714. this.form.sex = row.UserInfo.Sex;
  715. this.form.birthday = row.UserInfo.Birthday;
  716. this.form.ubId = row.UserInfo.UbId;
  717. this.form.btnType = 1;
  718. this.form.shopId = row.UserInfo.ShopId;
  719. this.form.Id = row.UserInfo.Id;
  720. this.dialogMemberVisible = true;
  721. this.dialogTitle = '编辑会员'
  722. },
  723. // 禁用
  724. pauseRow(row) {
  725. let that = this;
  726. this.$confirm('是否禁用用户' + row.UserInfo.Name + '?', '禁用操作', {
  727. confirmButtonText: '确定',
  728. cancelButtonText: '取消',
  729. type: 'warning'
  730. }).then(() => {
  731. let param = {
  732. token: localStorage.token,
  733. userId: row.UserInfo.Id,
  734. status: 8,//状态 8:禁用 1:启用 9:删除
  735. };
  736. let postdata = qs.stringify(param);
  737. VipUserStatusEdit(postdata).then(res => {
  738. let json = res;
  739. if (json.Code == 0) {
  740. that.$message({
  741. showClose: true,
  742. message: row.UserInfo.Name + '禁用成功!',
  743. type: 'success'
  744. });
  745. // table 重载
  746. that.getTableQuery();
  747. } else {
  748. that.$message.error(json.Memo + ' 错误码:' + json.Code);
  749. }
  750. })
  751. }).catch(() => {
  752. this.$message({
  753. type: 'info',
  754. message: '已取消禁用'
  755. });
  756. });
  757. },
  758. // 启用
  759. runRow(row) {
  760. let that = this;
  761. this.$confirm('是否启用用户' + row.UserInfo.Name + '?', '启用操作', {
  762. confirmButtonText: '确定',
  763. cancelButtonText: '取消',
  764. type: 'warning'
  765. }).then(() => {
  766. let param = {
  767. token: localStorage.token,
  768. userId: row.UserInfo.Id,
  769. status: 1,//状态 8:禁用 1:启用 9:删除
  770. };
  771. let postdata = qs.stringify(param);
  772. VipUserStatusEdit(postdata).then(res => {
  773. let json = res;
  774. if (json.Code == 0) {
  775. that.$message({
  776. showClose: true,
  777. message: row.UserInfo.Name + '启用成功!',
  778. type: 'success'
  779. });
  780. // table 重载
  781. that.getTableQuery();
  782. } else {
  783. that.$message.error(json.Memo + ' 错误码:' + json.Code);
  784. }
  785. })
  786. }).catch(() => {
  787. this.$message({
  788. type: 'info',
  789. message: '已取消启用'
  790. });
  791. });
  792. },
  793. // 关闭所有
  794. allDialogClose() {
  795. this.dialogVisible = false;
  796. this.dialogGift = false;
  797. this.dialogLesson = false;
  798. this.dialogExpTime = false;
  799. this.dialogLessonTable = false;
  800. },
  801. // 有效期调整
  802. ExpTimeChange() {
  803. // 仅针对年费用户,使用日期格式
  804. this.allDialogClose();
  805. if (this.tableRadio.length == 0) {
  806. this.$message.error("请先选中一条记录");
  807. return false
  808. }
  809. let row = this.tableRadio;
  810. if (parseInt(row.UserInfo.VipType) == 2) {
  811. this.$message({
  812. showClose: true,
  813. message: '错了哦,充值会员不能调整有效期',
  814. type: 'error'
  815. });
  816. return false
  817. }
  818. this.form.rowName = row.UserInfo.Name;
  819. this.form.userId = row.UserInfo.Id;
  820. this.form.expTime = row.UserInfo.ExpTime
  821. this.dialogVisible = true;
  822. this.dialogExpTime = true;
  823. },
  824. // 课时调整
  825. lessonChange() {
  826. this.allDialogClose();
  827. if (this.tableRadio.length == 0) {
  828. this.$message.error("请先选中一条记录");
  829. return false
  830. }
  831. let row = this.tableRadio;
  832. this.form.normalhour = row.UserInfo.RemainNormalhour;
  833. this.form.newnormalhour = 0;
  834. this.form.rowName = row.UserInfo.Name;
  835. this.form.userId = row.UserInfo.Id;
  836. this.dialogVisible = true;
  837. this.dialogLesson = true;
  838. },
  839. // 赠送调整
  840. giftChange() {
  841. this.allDialogClose();
  842. if (this.tableRadio.length == 0) {
  843. this.$message.error("请先选中一条记录");
  844. return false
  845. }
  846. let row = this.tableRadio;
  847. this.form.gifthour = row.UserInfo.RemainGifthour;
  848. this.form.newgifthour = 0;
  849. this.form.rowName = row.UserInfo.Name;
  850. this.form.userId = row.UserInfo.Id;
  851. this.dialogVisible = true;
  852. this.dialogGift = true;
  853. },
  854. // 增删会员课程
  855. lessonStudenChange() {
  856. let that = this;
  857. this.allDialogClose();
  858. // 重载课程列表选项
  859. this.form.dialogValue = [];
  860. this.panelSelect();
  861. if (this.tableRadio.length == 0) {
  862. that.$message.error("请先选中一条记录");
  863. return false
  864. }
  865. let row = this.tableRadio;
  866. this.form.rowName = row.UserInfo.Name;
  867. this.form.userId = row.UserInfo.Id;
  868. if (row.ClassInfo) {
  869. row.ClassInfo.map(function (item) {
  870. that.form.dialogValue.push(item.ClassId)
  871. })
  872. }
  873. this.dialogVisible = true;
  874. this.dialogLessonTable = true;
  875. },
  876. // 确认提交新增会员
  877. confirmMember() {
  878. let that = this;
  879. // checkNum
  880. if (!that.form.phone) {
  881. this.$message.error('错了哦,手机号不能为空');
  882. return false
  883. }
  884. if (!globalCheckPhone(that.form.phone)) {
  885. this.$message.error('错了哦,手机号格式不正确');
  886. return false
  887. }
  888. if (!that.form.name) {
  889. this.$message.error('错了哦,会员名不能为空');
  890. return false
  891. }
  892. if (that.form.name.length > 8) {
  893. this.$message.error('错了哦,会员名字数超过8个字');
  894. return false
  895. }
  896. if (that.form.memo) {
  897. if (that.form.memo.length > 200) {
  898. this.$message.error('错了哦,备注字数超过200个字');
  899. return false
  900. }
  901. }
  902. if (!that.form.height) {
  903. this.$message.error('错了哦,身高不能为空');
  904. return false
  905. }
  906. if (!that.form.weight) {
  907. this.$message.error('错了哦,体重不能为空');
  908. return false
  909. }
  910. // if (!that.form.staticHr) {
  911. // this.$message.error('错了哦,静态心率不能为空');
  912. // return false
  913. // }
  914. if (!that.form.birthday) {
  915. this.$message.error('错了哦,出生年份不能为空');
  916. return false
  917. }
  918. // 课程添加使用字符串形式
  919. let curClasslist = '';
  920. if (that.form.classlist) {
  921. curClasslist = that.form.classlist.toString();
  922. }
  923. let param = {
  924. token: localStorage.token,
  925. shopId: localStorage.shopId,
  926. phone: that.form.phone,
  927. name: that.form.name,
  928. vipType: that.form.vipType,
  929. normalhour: that.form.normalhour,
  930. gifthour: that.form.gifthour,
  931. classlist: curClasslist,
  932. memo: that.form.memo,
  933. height: that.form.height,
  934. weight: that.form.weight,
  935. staticHr: that.form.staticHr,
  936. sex: that.form.sex,
  937. head: that.form.head,
  938. birthday: nonTfmtDatetoLength(that.form.birthday, 10),
  939. };
  940. let postdata = qs.stringify(param);
  941. VipUserAdd(postdata).then(res => {
  942. let json = res;
  943. if (json.Code == 0) {
  944. // 关闭弹窗
  945. that.dialogMemberVisible = false;
  946. // 重载列表
  947. that.getTableQuery();
  948. that.$message({
  949. showClose: true,
  950. message: '会员添加成功!',
  951. type: 'success'
  952. });
  953. } else {
  954. that.$message.error(json.Memo + ' 错误码:' + json.Code);
  955. }
  956. })
  957. },
  958. confirmEditMember() {
  959. let that = this;
  960. // checkNum
  961. if (!that.form.phone) {
  962. this.$message.error('错了哦,手机号不能为空');
  963. return false
  964. }
  965. if (!globalCheckPhone(that.form.phone)) {
  966. this.$message.error('错了哦,手机号格式不正确');
  967. return false
  968. }
  969. if (!that.form.name) {
  970. this.$message.error('错了哦,会员名不能为空');
  971. return false
  972. }
  973. if (that.form.name.length > 8) {
  974. this.$message.error('错了哦,会员名字数超过8个字');
  975. return false
  976. }
  977. if (that.form.memo) {
  978. if (that.form.memo.length > 200) {
  979. this.$message.error('错了哦,备注字数超过200个字');
  980. return false
  981. }
  982. }
  983. if (!that.form.height) {
  984. this.$message.error('错了哦,身高不能为空');
  985. return false
  986. }
  987. if (!that.form.weight) {
  988. this.$message.error('错了哦,体重不能为空');
  989. return false
  990. }
  991. // if (!that.form.staticHr) {
  992. // this.$message.error('错了哦,静态心率不能为空');
  993. // return false
  994. // }
  995. if (!that.form.birthday) {
  996. this.$message.error('错了哦,出生年份不能为空');
  997. return false
  998. }
  999. let param = {
  1000. token: localStorage.token,
  1001. userId: that.form.Id,
  1002. phone: that.form.phone,
  1003. name: that.form.name,
  1004. memo: that.form.memo,
  1005. head: that.form.head,
  1006. height: that.form.height,
  1007. weight: that.form.weight,
  1008. staticHr: that.form.staticHr,
  1009. sex: that.form.sex,
  1010. birthday: nonTfmtDatetoLength(that.form.birthday, 10),
  1011. ubId: that.form.ubId
  1012. };
  1013. let postdata = qs.stringify(param);
  1014. console.log(param);
  1015. VipUserEdit(postdata).then(res => {
  1016. let json = res;
  1017. if (json.Code == 0) {
  1018. // 关闭弹窗
  1019. that.dialogMemberVisible = false;
  1020. // 重载列表
  1021. that.getTableQuery();
  1022. that.$message({
  1023. showClose: true,
  1024. message: '会员信息编辑成功!',
  1025. type: 'success'
  1026. });
  1027. } else {
  1028. that.$message.error(json.Memo + ' 错误码:' + json.Code);
  1029. }
  1030. })
  1031. },
  1032. // 确认提交课时
  1033. confirmLesson() {
  1034. let that = this;
  1035. // checkNum
  1036. let param = {
  1037. token: localStorage.token,
  1038. userId: that.form.userId,
  1039. chgHour: that.form.newnormalhour,
  1040. chgType: 1,//课时类型 1:普通课时 2:赠送课时
  1041. };
  1042. let postdata = qs.stringify(param);
  1043. VipUserHourEdit(postdata).then(res => {
  1044. let json = res;
  1045. if (json.Code == 0) {
  1046. // 关闭弹窗
  1047. that.dialogVisible = false;
  1048. // 重载列表
  1049. that.getTableQuery();
  1050. that.$message({
  1051. showClose: true,
  1052. message: '课时调整成功!',
  1053. type: 'success'
  1054. });
  1055. } else {
  1056. that.$message.error(json.Memo + ' 错误码:' + json.Code);
  1057. }
  1058. })
  1059. },
  1060. // 确认提交赠送
  1061. confirmGift() {
  1062. let that = this;
  1063. let param = {
  1064. token: localStorage.token,
  1065. userId: that.form.userId,
  1066. chgHour: that.form.newgifthour,
  1067. chgType: 2,//课时类型 1:普通课时 2:赠送课时
  1068. };
  1069. let postdata = qs.stringify(param);
  1070. VipUserHourEdit(postdata).then(res => {
  1071. let json = res;
  1072. if (json.Code == 0) {
  1073. // 关闭弹窗
  1074. that.dialogVisible = false;
  1075. // 重载列表
  1076. that.getTableQuery();
  1077. that.$message({
  1078. showClose: true,
  1079. message: '赠送课时调整成功!',
  1080. type: 'success'
  1081. });
  1082. } else {
  1083. that.$message.error(json.Memo + ' 错误码:' + json.Code);
  1084. }
  1085. })
  1086. },
  1087. // 确认提交有效期
  1088. confirmExpTime() {
  1089. let that = this;
  1090. // checkNum
  1091. let param = {
  1092. token: localStorage.token,
  1093. userId: that.form.userId,
  1094. expTime: nonTfmtDate(that.form.expTime, 16),
  1095. };
  1096. let postdata = qs.stringify(param);
  1097. VipUserExpEdit(postdata).then(res => {
  1098. let json = res;
  1099. if (json.Code == 0) {
  1100. // 关闭弹窗
  1101. that.dialogVisible = false;
  1102. // 重载列表
  1103. that.getTableQuery();
  1104. that.$message({
  1105. showClose: true,
  1106. message: '赠送课时调整成功!',
  1107. type: 'success'
  1108. });
  1109. } else {
  1110. that.$message.error(json.Memo + ' 错误码:' + json.Code);
  1111. }
  1112. })
  1113. },
  1114. // 确认提交会员课程
  1115. confirmLessonTable() {
  1116. let that = this;
  1117. // checkNum
  1118. let classList = that.form.dialogValue ? that.form.dialogValue.toString() : '';
  1119. let param = {
  1120. token: localStorage.token,
  1121. userId: that.form.userId,
  1122. classList: classList,
  1123. };
  1124. let postdata = qs.stringify(param);
  1125. VipUserClassEdit(postdata).then(res => {
  1126. let json = res;
  1127. if (json.Code == 0) {
  1128. // 关闭弹窗
  1129. that.dialogVisible = false;
  1130. // 重载列表
  1131. that.getTableQuery();
  1132. that.$message({
  1133. showClose: true,
  1134. message: '会员课程调整成功!',
  1135. type: 'success'
  1136. });
  1137. } else {
  1138. that.$message.error(json.Memo + ' 错误码:' + json.Code);
  1139. }
  1140. })
  1141. },
  1142. // 加载课程列表选项
  1143. panelSelect() {
  1144. let that = this;
  1145. let param = {
  1146. token: localStorage.token,
  1147. vipType: '',
  1148. classType: 1,//不显示 午饭类 课程
  1149. start: 1,
  1150. expDay: 0,
  1151. tableMax: 9999,
  1152. };
  1153. let postdata = qs.stringify(param);
  1154. ClassListQuery(postdata).then(res => {
  1155. let json = res;
  1156. if (json.Code == 0) {
  1157. if (json.Rs == null) return false
  1158. that.form.dialogdata = turnClassResToOption(json.Rs);
  1159. } else {
  1160. that.$message.error(json.Memo + ' 错误码:' + json.Code);
  1161. }
  1162. })
  1163. },
  1164. // 新增会员
  1165. addMember() {
  1166. this.clearForm();
  1167. this.panelSelect();
  1168. this.dialogMemberVisible = true;
  1169. this.btnType = 0;
  1170. this.form.btnType = 0;
  1171. this.dialogTitle = '新增会员'
  1172. },
  1173. // 删除
  1174. delList() {
  1175. let that = this;
  1176. if (this.tableRadio.length == 0) {
  1177. that.$message.error("请先选中一条记录");
  1178. return false
  1179. }
  1180. let detectorid = this.tableRadio.UserInfo.Id;
  1181. let param = {
  1182. token: localStorage.token,
  1183. userId: detectorid,
  1184. status: 9,//0禁用1启用9删除
  1185. };
  1186. let postdata = qs.stringify(param);
  1187. this.$confirm('此操作将永久删除该会员, 是否继续?', '提示', {
  1188. confirmButtonText: '确定',
  1189. cancelButtonText: '取消',
  1190. type: 'warning'
  1191. }).then(() => {
  1192. VipUserStatusEdit(postdata).then(res => {
  1193. let json = res;
  1194. if (json.Code == 0) {
  1195. that.$message({
  1196. showClose: true,
  1197. message: '选中的会员已删除!',
  1198. type: 'success'
  1199. });
  1200. // 重载列表
  1201. that.getTableQuery();
  1202. } else {
  1203. that.$message.error(json.Memo + ' 错误码:' + json.Code);
  1204. }
  1205. });
  1206. }).catch(() => {
  1207. this.$message({
  1208. type: 'info',
  1209. message: '已取消删除'
  1210. });
  1211. });
  1212. },
  1213. handleSelectionChange(val) {
  1214. this.multipleSelection = val;
  1215. },
  1216. // 查询按钮
  1217. query() {
  1218. let that = this;
  1219. that.start = 0;
  1220. that.cur_page = 1;
  1221. that.serachBtnStatus = true;
  1222. that.getTableQuery();
  1223. this.pageshow = false;//让分页隐藏
  1224. this.$nextTick(() => {//重新渲染分页
  1225. this.pageshow = true;
  1226. });
  1227. that.$message.success('查询完毕');
  1228. let totalTime = 2;
  1229. let clock = window.setInterval(() => {
  1230. totalTime--;
  1231. if (totalTime < 0) {
  1232. totalTime = 2;
  1233. that.serachBtnStatus = false;
  1234. }
  1235. }, 1000)
  1236. },
  1237. clearForm() {
  1238. // clear
  1239. this.form.name = '';
  1240. this.form.head = '';
  1241. this.imageUrl = '';
  1242. this.form.phone = '';
  1243. this.form.memo = '';
  1244. this.form.normalhour = 0;
  1245. this.form.gifthour = 0;
  1246. this.form.height = '';
  1247. this.form.weight = '';
  1248. this.form.staticHr = '';
  1249. this.form.sex = 1;
  1250. this.form.birthday = '';
  1251. this.form.userCode = '';
  1252. this.form.shopId = '';
  1253. this.form.classlist = [];
  1254. },
  1255. // 页面数据查询
  1256. getTableQuery() {
  1257. let that = this;
  1258. that.loading = true;
  1259. let param = {
  1260. token: localStorage.token,
  1261. vipType: that.panel.vipType,//
  1262. phone: that.panel.phone,//
  1263. name: that.panel.name,//
  1264. expDay: that.panel.expDay,//
  1265. start: that.start,//
  1266. tableMax: 20,//
  1267. };
  1268. that.allTableData = [];
  1269. that.recordsTotal = 0;
  1270. let postdata = qs.stringify(param);
  1271. VipUserListQuery(postdata).then(res => {
  1272. let json = res;
  1273. if (json.Code == 0) {
  1274. that.loading = false;
  1275. if (json.Rs) {
  1276. that.allTableData = json.Rs;
  1277. that.recordsTotal = json.PageCount * that.pageination.pageItem;
  1278. } else {
  1279. that.allTableData = [];
  1280. that.recordsTotal = 0;
  1281. }
  1282. // 设置分页数据
  1283. that.setPaginations();
  1284. } else {
  1285. that.$message.error(json.Memo + ' 错误码:' + json.Code);
  1286. }
  1287. })
  1288. },
  1289. // 设置分页数据
  1290. setPaginations() {
  1291. // 分页属性
  1292. let that = this;
  1293. that.pageination.total = that.recordsTotal;
  1294. // 默认分页
  1295. that.tableData = that.allTableData.filter((item, index) => {
  1296. return index < that.pageination.pageItem;
  1297. });
  1298. },
  1299. // 每页显示数量
  1300. handleSizeChange() {
  1301. let that = this;
  1302. that.tableData = that.allTableData.filter((item, index) => {
  1303. return index < that.pageination.pageItem;
  1304. });
  1305. that.draw = that.pageination.pageItem;
  1306. // that.getTableQuery();
  1307. },
  1308. // 翻页
  1309. pageChange(pageIndex) {
  1310. let that = this;
  1311. // 获取当前页
  1312. let index = that.pageination.pageItem * (pageIndex - 1);
  1313. // 数据总数
  1314. let nums = that.pageination.pageItem * pageIndex;
  1315. // 容器
  1316. let tables = [];
  1317. for (var i = index; i < nums; i++) {
  1318. if (that.allTableData[i]) {
  1319. tables.push(that.allTableData[i])
  1320. }
  1321. this.tableData = tables;
  1322. }
  1323. that.start = index * that.draw;
  1324. console.log(index);
  1325. console.log(that.draw);
  1326. that.getTableQuery();
  1327. },
  1328. // 过滤时间
  1329. filterFmtDate(value, row, column) {
  1330. let that = this;
  1331. if (column == "0001-01-01T08:05:43+08:05" || column == "0001-01-01T00:00:00Z") {
  1332. return '无有效期';
  1333. } else {
  1334. return nonTfmtDatetoLength(column, 10);
  1335. }
  1336. },
  1337. // 海报上传成功
  1338. getShopImages(url) {
  1339. this.imageUrl = url;
  1340. this.form.head = url;
  1341. }
  1342. },
  1343. components: {
  1344. cropper
  1345. }
  1346. }
  1347. </script>
  1348. <style scoped>
  1349. @import "../assets/css/panel.css";
  1350. .context {
  1351. border-radius: 12px;
  1352. height: 770px;
  1353. overflow-y: scroll;
  1354. display: block;
  1355. margin: 0 auto;
  1356. background-color: #fff !important;
  1357. padding: 30px;
  1358. padding-bottom: 30px;
  1359. }
  1360. .panel-body {
  1361. padding: 20px;
  1362. background: #F0F2F5;
  1363. }
  1364. .change {
  1365. width: 100%;
  1366. overflow: hidden;
  1367. display: block;
  1368. margin: 0 auto;
  1369. padding-top: 10px;
  1370. padding-bottom: 10px;
  1371. }
  1372. .change button {
  1373. float: left;
  1374. }
  1375. .change button.pull-right {
  1376. float: right;
  1377. }
  1378. .dialogTitle {
  1379. width: 100%;
  1380. overflow: hidden;
  1381. display: block;
  1382. margin: 0 auto;
  1383. color: #000000;
  1384. font-size: 18px;
  1385. text-align: center;
  1386. }
  1387. .dialogTitle em {
  1388. float: none;
  1389. font-style: normal;
  1390. color: #3799FF;
  1391. margin: 0;
  1392. }
  1393. /deep/ .el-transfer-panel__item .el-checkbox__input {
  1394. left: 40px;
  1395. }
  1396. .dialogFooter {
  1397. width: 90%;
  1398. overflow: hidden;
  1399. display: block;
  1400. margin: 0 auto;
  1401. margin-top: 10px;
  1402. }
  1403. .dialogFooter button {
  1404. float: right;
  1405. margin-left: 10px;
  1406. }
  1407. .dialogContent {
  1408. width: 100%;
  1409. overflow: hidden;
  1410. display: block;
  1411. margin: 0 auto;
  1412. }
  1413. .dialogContent .pull-left {
  1414. width: 40%;
  1415. float: left;
  1416. }
  1417. .dialogContent .pull-right {
  1418. width: 60%;
  1419. float: right;
  1420. }
  1421. .tabwild {
  1422. width: 100% !important;
  1423. overflow: hidden;
  1424. display: block;
  1425. margin: 0 auto;
  1426. }
  1427. .lessonSpan {
  1428. width: 78px;
  1429. height: 22px;
  1430. border-radius: 11px;
  1431. margin-right: 5px;
  1432. float: left;
  1433. margin-bottom: 3px;
  1434. text-align: center;
  1435. color: #000;
  1436. font-size: 12px;
  1437. }
  1438. .btn {
  1439. float: left !important;
  1440. margin-right: 5px;
  1441. }
  1442. /deep/ table .el-button + .el-button {
  1443. margin-left: 0;
  1444. margin-right: 3px;
  1445. /*float: left;*/
  1446. padding: 7px 6px;
  1447. }
  1448. table {
  1449. width: 100%;
  1450. display: block;
  1451. margin: 0 auto;
  1452. overflow: scroll;
  1453. }
  1454. .pull-left /deep/ .el-form .el-form-item {
  1455. width: 50%;
  1456. float: left;
  1457. }
  1458. .pull-left /deep/ .el-form-item__content {
  1459. margin-left: 20px;
  1460. }
  1461. .pull-left .el-input-number {
  1462. width: 130px;
  1463. }
  1464. .cell img {
  1465. overflow: hidden;
  1466. display: block;
  1467. margin: 0 auto;
  1468. }
  1469. .el-date-editor.el-input__inner {
  1470. width: 156px;
  1471. }
  1472. .avatar-uploader {
  1473. /*border: 1px solid #ccc;*/
  1474. cursor: pointer;
  1475. border-radius: 5px;
  1476. }
  1477. /deep/ .el-upload {
  1478. width: 100%;
  1479. overflow: hidden;
  1480. display: block;
  1481. margin: 0 auto;
  1482. }
  1483. /deep/ .el-upload img {
  1484. width: 70px;
  1485. height: 70px;
  1486. float: left;
  1487. }
  1488. .relevance {
  1489. margin-top: 10px;
  1490. }
  1491. </style>