index.vue 37 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312
  1. <template>
  2. <div class="order">
  3. <div class="warp">
  4. <div class="refreshBtn">
  5. <el-button
  6. class="refresh"
  7. type="primary"
  8. @click="refreshList"
  9. :loading="refresh"
  10. >{{ refresh ? "加载中..." : "刷新" }}</el-button>
  11. </div>
  12. <el-tabs type="border-card" @tab-click="changeTab" v-model="activeName">
  13. <el-tab-pane label="项目订单" name="first">
  14. <div class="user-list">
  15. <el-table
  16. ref="multipleTable"
  17. :data="projectData"
  18. tooltip-effect="dark"
  19. height="354"
  20. style="width: 100%; border-radius: 8px"
  21. @row-click="handleSelectionChange"
  22. >
  23. <el-table-column prop="goods" label="项目名称" width="200">
  24. <template slot-scope="scope">
  25. <div v-for="(val, index) in scope.row.goods" :key="index">
  26. <div>{{ val.name }}</div>
  27. </div>
  28. </template>
  29. </el-table-column>
  30. <el-table-column prop="goods" label="数量" show-overflow-tooltip>
  31. <template slot-scope="scope">
  32. <div>{{ scope.row.goods.length }}</div>
  33. </template>
  34. </el-table-column>
  35. <el-table-column prop="price" label="总价格" show-overflow-tooltip></el-table-column>
  36. <el-table-column prop="order_time" label="预约时间" width="180" show-overflow-tooltip></el-table-column>
  37. <el-table-column prop="store_name" label="预约店铺" show-overflow-tooltip></el-table-column>
  38. <el-table-column prop="status" label="状态" show-overflow-tooltip>
  39. <template slot-scope="scope">
  40. <div :class="'color' + scope.row.status">
  41. <!-- 状态:0已预约,未支付,1已支付,待使用,2正在使用,3已结算,-1已取消,-2退款审核中,-3已退款 -->
  42. {{
  43. scope.row.status == 0
  44. ? "已预约"
  45. : scope.row.status == 1
  46. ? "待使用"
  47. : scope.row.status == 2
  48. ? "正在使用"
  49. : scope.row.status == 3
  50. ? "已结算"
  51. : scope.row.status == -1
  52. ? "已取消"
  53. : scope.row.status == -2
  54. ? "退款审核中"
  55. : "已退款"
  56. }}
  57. </div>
  58. </template>
  59. </el-table-column>
  60. </el-table>
  61. <div class="pagin">
  62. <el-pagination
  63. background
  64. layout="prev, pager, next"
  65. @current-change="handleCurrentChange"
  66. :current-page.sync="currentPage1"
  67. :total="total"
  68. ></el-pagination>
  69. </div>
  70. </div>
  71. </el-tab-pane>
  72. <el-tab-pane label="次卡订单" name="second">
  73. <div class="user-list">
  74. <el-table
  75. ref="multipleTable"
  76. :data="cardListData"
  77. tooltip-effect="dark"
  78. height="354"
  79. @row-click="openDetail"
  80. style="width: 100%; border-radius: 8px"
  81. >
  82. <el-table-column prop="card_name" label="卡券名称" width="200">
  83. <template slot-scope="scope">
  84. <div>{{ scope.row.card_name | ellipsis(8) }}</div>
  85. </template>
  86. </el-table-column>
  87. <el-table-column prop="total_num" label="总次数" show-overflow-tooltip align="center">
  88. <template slot-scope="{ row }" v-if="row.card_type == 1">
  89. {{
  90. row.total_num
  91. }}
  92. </template>
  93. </el-table-column>
  94. <el-table-column prop="num" label="剩余次数" show-overflow-tooltip align="center">
  95. <template slot-scope="{ row }" v-if="row.card_type == 1">
  96. {{
  97. row.num
  98. }}
  99. </template>
  100. </el-table-column>
  101. <el-table-column
  102. prop="used_num"
  103. label="已用次数"
  104. width="180"
  105. show-overflow-tooltip
  106. align="center"
  107. ></el-table-column>
  108. <el-table-column prop="expir_time" label="过期时间" width="180" show-overflow-tooltip>
  109. <template slot-scope="{ row }">
  110. <div class="expir_time" @click.stop="amendCardTime(row)">{{ row.expir_time }}</div>
  111. </template>
  112. </el-table-column>
  113. <el-table-column prop="create_time" label="创建时间" width="180" show-overflow-tooltip></el-table-column>
  114. <el-table-column prop="status" label="状态" show-overflow-tooltip>
  115. <template slot-scope="scope">
  116. <div :class="'colorB' + scope.row.status">
  117. {{
  118. scope.row.status == -2
  119. ? "已注销"
  120. : scope.row.status == -1
  121. ? "已过期"
  122. : scope.row.status == -0
  123. ? "已使用"
  124. : "待使用"
  125. }}
  126. </div>
  127. </template>
  128. </el-table-column>
  129. <el-table-column prop label="操作" width="100" show-overflow-tooltip>
  130. <template slot-scope="scope" v-if="scope.row.status == 1">
  131. <div class="cancleCoupon" @click.stop="cancleCard(scope.row)">操作</div>
  132. </template>
  133. </el-table-column>
  134. </el-table>
  135. <div class="pagin">
  136. <el-pagination
  137. background
  138. layout="prev, pager, next"
  139. @current-change="handleCurrentChange"
  140. :current-page.sync="currentPage1"
  141. :total="total"
  142. ></el-pagination>
  143. </div>
  144. </div>
  145. </el-tab-pane>
  146. <el-tab-pane label="商品订单" name="third">
  147. <div class="user-list">
  148. <el-table
  149. ref="multipleTable"
  150. :data="goodData"
  151. tooltip-effect="dark"
  152. height="354"
  153. style="width: 100%; border-radius: 8px"
  154. >
  155. <!-- create_time: "2022-03-19 22:53:40"
  156. goods: [{order_id: 47, name: "润百颜玻尿酸屏障调理面膜", num: 1}]
  157. id: 47
  158. price: "0.01"
  159. status: 5-->
  160. <el-table-column prop="goods" label="商品名称" width="200">
  161. <template slot-scope="scope">
  162. <div v-for="(val, index) in scope.row.goods" :key="index">
  163. <div>{{ val.name }}</div>
  164. </div>
  165. </template>
  166. </el-table-column>
  167. <el-table-column prop="goods" label="数量" show-overflow-tooltip>
  168. <template slot-scope="scope">
  169. <div>{{ scope.row.goods.length }}</div>
  170. </template>
  171. </el-table-column>
  172. <el-table-column prop="price" label="实付款" show-overflow-tooltip></el-table-column>
  173. <el-table-column prop="create_time" label="下单时间" width="180" show-overflow-tooltip></el-table-column>
  174. <el-table-column prop="status" label="状态" show-overflow-tooltip>
  175. <template slot-scope="scope">
  176. <div :class="'color' + scope.row.status">
  177. {{
  178. scope.row.status == 0
  179. ? "未支付"
  180. : scope.row.status == 1
  181. ? "待取货"
  182. : scope.row.status == 2
  183. ? "已取货"
  184. : scope.row.status == -1
  185. ? "已取消"
  186. : scope.row.status == -2
  187. ? "退款审核中"
  188. : "已退款"
  189. }}
  190. </div>
  191. </template>
  192. </el-table-column>
  193. </el-table>
  194. <div class="pagin">
  195. <el-pagination
  196. background
  197. layout="prev, pager, next"
  198. @current-change="handleCurrentChange"
  199. :current-page.sync="currentPage1"
  200. :total="total"
  201. ></el-pagination>
  202. </div>
  203. </div>
  204. </el-tab-pane>
  205. <el-tab-pane label="优惠券" name="fourth">
  206. <div class="user-list">
  207. <el-table
  208. ref="multipleTable"
  209. :data="couponData"
  210. tooltip-effect="dark"
  211. height="354"
  212. style="width: 100%; border-radius: 8px"
  213. >
  214. <!-- create_time: "2022-03-10 10:39:19"
  215. ex_time: "2022.03.17 23:59"
  216. id: 2517
  217. name: "新人体验券"
  218. status: 2
  219. type: "全额券"-->
  220. <el-table-column prop="name" label="卡卷名称" width="200"></el-table-column>
  221. <el-table-column prop="type" label="卡卷类型" show-overflow-tooltip></el-table-column>
  222. <el-table-column prop="create_time" label="到期时间" width="180" show-overflow-tooltip></el-table-column>
  223. <el-table-column prop="create_time" label="创建时间" width="180" show-overflow-tooltipA></el-table-column>
  224. <el-table-column prop="status" label="状态" show-overflow-tooltip>
  225. <template slot-scope="scope">
  226. <div :class="'colorA' + scope.row.status">{{ couponStatus[scope.row.status] }}</div>
  227. </template>
  228. </el-table-column>
  229. <el-table-column prop label="备注" width="90" show-overflow-tooltip>
  230. <template slot-scope="scope" v-if="scope.row.is_send == 1">
  231. <button class="examineCoupon" @click.stop="cancleCoupon(scope.row,true)">查看</button>
  232. </template>
  233. </el-table-column>
  234. <el-table-column prop label="操作" width="80" show-overflow-tooltip>
  235. <template slot-scope="scope" v-if="scope.row.status == 0">
  236. <div class="cancleCoupon" @click.stop="cancleCoupon(scope.row,false)">操作</div>
  237. </template>
  238. </el-table-column>
  239. </el-table>
  240. <div class="pagin">
  241. <el-pagination
  242. background
  243. layout="prev, pager, next"
  244. @current-change="handleCurrentChange"
  245. :current-page.sync="currentPage1"
  246. :total="total"
  247. ></el-pagination>
  248. </div>
  249. </div>
  250. </el-tab-pane>
  251. <el-tab-pane label="余额记录" name="five">
  252. <div class="user-list">
  253. <el-table
  254. ref="multipleTable"
  255. :data="balanceListData"
  256. tooltip-effect="dark"
  257. height="354"
  258. style="width: 100%; border-radius: 8px"
  259. >
  260. <el-table-column prop="goods" label="变更时间" width="200">
  261. <template slot-scope="scope">
  262. <div>{{ scope.row.create_time }}</div>
  263. </template>
  264. </el-table-column>
  265. <el-table-column prop="goods" label="变更前金额">
  266. <template slot-scope="scope">
  267. <div>{{ scope.row.before_amount }}</div>
  268. </template>
  269. </el-table-column>
  270. <el-table-column prop="goods" label="变更后金额" show-overflow-tooltip>
  271. <template slot-scope="scope">
  272. <div>{{ scope.row.after_amount }}</div>
  273. </template>
  274. </el-table-column>
  275. <el-table-column prop="price" label="变更金额" show-overflow-tooltip>
  276. <template slot-scope="scope">
  277. <div>
  278. {{ scope.row.is_add == 1 ? "+" : "-"
  279. }}{{ scope.row.amount }}
  280. </div>
  281. </template>
  282. </el-table-column>
  283. <!-- <el-table-column prop="status" label="状态" show-overflow-tooltip>
  284. <template slot-scope="scope">
  285. <div>{{ scope.row.msg }}</div>
  286. </template>
  287. </el-table-column>-->
  288. <!-- 余额类型(记录类型,1充值,2充值赠送,3订单退款,5提现驳回,-1消费,-2提现冻结,10客服添加,-10客服扣除) -->
  289. <el-table-column prop="status" label="类型" show-overflow-tooltip>
  290. <template slot-scope="scope">
  291. <div>
  292. {{
  293. scope.row.type == 1
  294. ? "充值"
  295. : scope.row.type == 2
  296. ? "充值赠送"
  297. : scope.row.type == 3
  298. ? "订单退款"
  299. : scope.row.type == 5
  300. ? "提现驳回"
  301. : scope.row.type == -1
  302. ? "消费"
  303. : scope.row.type == -2
  304. ? "提现冻结"
  305. : scope.row.type == 10
  306. ? "客服添加"
  307. : scope.row.type == -10
  308. ? "客服扣除"
  309. : ""
  310. }}
  311. </div>
  312. </template>
  313. </el-table-column>
  314. </el-table>
  315. <div class="pagin">
  316. <el-pagination
  317. background
  318. layout="prev, pager, next"
  319. @current-change="handleCurrentChange"
  320. :current-page.sync="currentPage1"
  321. :total="total"
  322. ></el-pagination>
  323. </div>
  324. </div>
  325. </el-tab-pane>
  326. </el-tabs>
  327. </div>
  328. <!-- 次卡详情 -->
  329. <mine-pupop :show="isPore">
  330. <div class="pore-block">
  331. <div class="delete-pupop" @click="isPore = false">
  332. <img
  333. src="https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/icon/slices/delete.png"
  334. alt
  335. />
  336. </div>
  337. <div class="pore-content">
  338. <div class="card-title">订单详情</div>
  339. <div class="project">
  340. <div class="project-title">项目名称:</div>
  341. <div class="project-list">
  342. <div class="project-info" v-for="(item, index) in cardInfo.project_list" :key="index">
  343. <div class="name-text">{{ item.project_name }}</div>
  344. <div class="change-num" v-if="cardInfo.card_type == 1">
  345. <div class="num-content">
  346. <div class="content-left" @click="reduce(index)">-</div>
  347. <div class="content-num">{{ item.num || 0 }}</div>
  348. <div class="content-right" @click="item.num++">+</div>
  349. </div>
  350. </div>
  351. </div>
  352. </div>
  353. </div>
  354. <div class="common">
  355. <span class="common-title">支付方式:</span>
  356. <span>{{ cardInfo.pay_way }}</span>
  357. </div>
  358. <div class="common">
  359. <span class="common-title">有效期限:</span>
  360. <span>{{ cardInfo.ex_time }}</span>
  361. </div>
  362. <div class="common">
  363. <span class="common-title">实付金额:</span>
  364. <span>¥{{ cardInfo.price }}</span>
  365. </div>
  366. <div class="consume-list">
  367. <div class="consume-title">消耗信息:</div>
  368. <div class="consume-info min-size" v-for="(item, index) in cardLogList" :key="index">
  369. <div class="shop">{{ item.store_name }}</div>
  370. <div class="project-tips">{{ item.remark }}</div>
  371. <div class="project-ts">{{ item.create_time }}</div>
  372. </div>
  373. </div>
  374. </div>
  375. <div v-if="cardInfo.card_type == 1" class="confirm" @click="confirm">确定</div>
  376. </div>
  377. </mine-pupop>
  378. <!-- 修改次卡时间 -->
  379. <mine-pupop :show="isAmend">
  380. <div class="amendTime">
  381. <div class="image">
  382. <img
  383. src="https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/icon/slices/delete.png"
  384. alt
  385. @click="closeAmend"
  386. />
  387. </div>
  388. <div class="admendTime-content">
  389. <div class="oldTime">
  390. 次卡过期时间 :
  391. <span>{{ amendCardInfo.expir_time }}</span>
  392. </div>
  393. <div class="newTime">
  394. 选择更改日期:
  395. <el-date-picker
  396. class="date"
  397. v-model="cardTime"
  398. type="date"
  399. placeholder="选择日期"
  400. value-format="yyyy-MM-dd"
  401. @focus="forbid"
  402. ></el-date-picker>
  403. </div>
  404. <div class="radio">
  405. <button class="cancelBtn" @click="cancel">取消</button>
  406. <button class="affirmBtn" @click="affirm">确定</button>
  407. </div>
  408. </div>
  409. </div>
  410. </mine-pupop>
  411. <!-- 操作核销优惠券 -->
  412. <mine-pupop :show="isCancelCoupon">
  413. <div class="CouponPop">
  414. <div class="image">
  415. <img
  416. src="https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/icon/slices/delete.png"
  417. alt
  418. @click="closeCouponPop"
  419. />
  420. </div>
  421. <div class="title">{{examineCoupon?'发券备注信息':'核销优惠券'}}</div>
  422. <div class="couponName">
  423. <div class="one">{{examineCoupon?'发券人:':'优惠券名称:'}}</div>
  424. <div>{{ examineCoupon?cancelCouponInfo.send_name:cancelCouponInfo.name }}</div>
  425. </div>
  426. <div class="couponRemark">
  427. <div class="one">备注信息:</div>
  428. <el-input v-if="!examineCoupon" v-model.trim="couponRemark"></el-input>
  429. <div v-else>{{cancelCouponInfo.send_remark}}</div>
  430. </div>
  431. <div class="radio">
  432. <button class="affirmBtn" @click="checkCoupon">确定</button>
  433. </div>
  434. </div>
  435. </mine-pupop>
  436. <!-- 操作核销次卡 -->
  437. <mine-pupop :show="isCancelCard">
  438. <div class="CancelCard">
  439. <div class="image">
  440. <img
  441. src="https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/icon/slices/delete.png"
  442. alt
  443. @click="closeCardPop"
  444. />
  445. </div>
  446. <div class="title">核销次卡</div>
  447. <div class="CardName">
  448. <div class="one">次卡名称:</div>
  449. <div>{{ cancelCardInfo.card_name }}</div>
  450. </div>
  451. <div class="cardRemark">
  452. <div class="one">备注信息:</div>
  453. <el-input v-model.trim="cardRemark"></el-input>
  454. </div>
  455. <div class="radio">
  456. <button class="affirmBtn" @click="checkCard">确定</button>
  457. </div>
  458. </div>
  459. </mine-pupop>
  460. </div>
  461. </template>
  462. <script>
  463. import api from "../../../server/home";
  464. import minePupop from "../../../components/minePupop/index.vue";
  465. import { log } from "console";
  466. export default {
  467. components: {
  468. minePupop
  469. },
  470. data() {
  471. return {
  472. couponList: [
  473. {
  474. value: "选项1",
  475. label: "黄金糕"
  476. },
  477. {
  478. value: "选项2",
  479. label: "双皮奶"
  480. }
  481. ],
  482. tableData: [
  483. {
  484. date: "2022.04.25 14:30",
  485. name: "滴滴滴",
  486. headImg:
  487. "https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/home/unpaid.png",
  488. phone: "13346783645",
  489. numberList: 2,
  490. price: 100,
  491. shop: "运用店",
  492. status: 2
  493. },
  494. {
  495. date: "2022.04.25 14:30",
  496. name: "滴滴滴",
  497. headImg:
  498. "https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/home/unpaid.png",
  499. phone: "13346783645",
  500. numberList: 5,
  501. price: 800,
  502. shop: "武昌店",
  503. status: 1
  504. }
  505. ],
  506. couponStatus: ["待使用", "已使用", "已过期"],
  507. goodStatus: ["未支付", "已支付", "已取货"],
  508. activeName: "first",
  509. currentPage1: 1,
  510. couponData: [],
  511. goodData: [],
  512. projectData: [],
  513. cardOrderData: [],
  514. total: 100,
  515. limit: 10,
  516. isPore: false,
  517. cardInfo: {}, //订单详情
  518. cardLogList: [], //次卡消耗记录
  519. cardListData: [], //用户次卡列表
  520. balanceListData: [], //用户余额变更记录
  521. isAmend: false, //修改次卡时间弹窗
  522. amendCardInfo: "", // 要修改次卡的信息
  523. cardTime: "", //次卡修改时间(年月日)
  524. isCancelCoupon: false, //核销优惠券界面
  525. cancelCouponInfo: "", //核销优惠券信息
  526. couponRemark: "", //核销优惠券备注信息
  527. refresh: false, //刷新页面数据
  528. isCancelCard: false, //核销次卡界面
  529. cancelCardInfo: "", //核销次卡信息
  530. cardRemark: "", //核销次卡备注信息
  531. examineCoupon: false //是否是查看优惠券
  532. };
  533. },
  534. computed: {},
  535. watch: {},
  536. methods: {
  537. // 刷新页面数据
  538. refreshList() {
  539. this.currentPage1 = 1;
  540. this.refresh = true;
  541. if (this.activeName == "first") {
  542. this.getUserProject();
  543. } else if (this.activeName == "second") {
  544. this.getCardList();
  545. } else if (this.activeName == "third") {
  546. this.getUserGoods();
  547. } else if (this.activeName == "fourth") {
  548. this.getUserCoupon();
  549. } else if (this.activeName == "five") {
  550. this.getBalanceRecord();
  551. }
  552. },
  553. // 打开核销优惠券界面
  554. cancleCoupon(e, examineCoupon) {
  555. this.examineCoupon = examineCoupon;
  556. this.isCancelCoupon = true;
  557. this.cancelCouponInfo = e;
  558. },
  559. // 关闭核销优惠券页面
  560. closeCouponPop() {
  561. this.isCancelCoupon = false;
  562. this.couponRemark = "";
  563. },
  564. // 核销优惠券
  565. checkCoupon() {
  566. if (this.examineCoupon) {
  567. this.isCancelCoupon = false;
  568. return;
  569. }
  570. if (this.couponRemark == "") {
  571. this.$message.error("请填写备注信息");
  572. return;
  573. }
  574. api
  575. .checkCoupon({
  576. id: this.cancelCouponInfo.id,
  577. remark: this.couponRemark
  578. })
  579. .then(res => {
  580. if (res.code == 200) {
  581. this.$message.success("核销成功");
  582. this.isCancelCoupon = false;
  583. // 刷新优惠券列表
  584. this.getUserCoupon();
  585. }
  586. });
  587. },
  588. // 打开次卡弹窗
  589. cancleCard(e) {
  590. this.isCancelCard = true;
  591. this.cancelCardInfo = e;
  592. },
  593. // 关闭次卡弹窗
  594. closeCardPop() {
  595. this.isCancelCard = false;
  596. },
  597. // 核销次卡
  598. checkCard() {
  599. if (this.cardRemark == "") {
  600. this.$message.error("请填写备注信息");
  601. return;
  602. }
  603. api
  604. .checkCard({
  605. id: this.cancelCardInfo.id,
  606. remark: this.cardRemark
  607. })
  608. .then(res => {
  609. if (res.code == 200) {
  610. this.$message.success("核销成功");
  611. this.isCancelCard = false;
  612. // 刷新次卡列表
  613. this.getCardList();
  614. }
  615. });
  616. },
  617. // 阻止修改次卡时间时键盘弹出
  618. forbid() {
  619. //禁止软键盘弹出
  620. document.activeElement.blur();
  621. },
  622. // 修改次卡时间取消
  623. cancel() {
  624. this.isAmend = false;
  625. this.cardTime = "";
  626. },
  627. // 修改次卡时间确定
  628. affirm() {
  629. this.amendCardTimeApi();
  630. },
  631. // 修改次卡时间
  632. amendCardTime(e) {
  633. if (e.status == -2) {
  634. this.$message({
  635. message: "该次卡已注销",
  636. type: "error"
  637. });
  638. return;
  639. }
  640. this.isAmend = true;
  641. this.amendCardInfo = e;
  642. console.log(e);
  643. },
  644. // 关闭修改次卡时间弹窗
  645. closeAmend() {
  646. this.isAmend = false;
  647. this.cardTime = "";
  648. },
  649. // 发起修改次卡订单请求
  650. amendCardTimeApi() {
  651. api
  652. .amendCardTime({
  653. id: this.amendCardInfo.id,
  654. expire_date: this.cardTime
  655. })
  656. .then(res => {
  657. if (res.code == 200) {
  658. this.$message({
  659. message: res.msg,
  660. type: "success"
  661. });
  662. this.isAmend = false;
  663. // 更新次卡列表
  664. this.getCardList();
  665. }
  666. });
  667. },
  668. // 获取优惠券订单
  669. getUserCoupon() {
  670. let params = {
  671. page: this.currentPage1,
  672. limit: this.limit,
  673. id: this.id
  674. };
  675. api.getUserCoupon(params).then(res => {
  676. this.couponData = res.data.list;
  677. this.total = res.data.total;
  678. // 关闭刷新动画
  679. this.refresh = false;
  680. });
  681. },
  682. reduce(index) {
  683. this.cardInfo.project_list[index].num--;
  684. if (this.cardInfo.project_list[index].num < 0) {
  685. this.cardInfo.project_list[index].num = 0;
  686. }
  687. },
  688. //次卡订单详情
  689. openDetail(row, column, event) {
  690. if (row.status == -2) {
  691. this.$message({
  692. message: "该次卡已注销",
  693. type: "error"
  694. });
  695. return;
  696. }
  697. this.isPore = true;
  698. api.cardInfo({ id: row.id }).then(res => {
  699. if (res.code == 200) {
  700. res.data.card_type = row.card_type;
  701. this.cardInfo = res.data;
  702. }
  703. });
  704. api.cardLog({ id: row.id }).then(res => {
  705. if (res.code == 200) {
  706. this.cardLogList = res.data.list;
  707. }
  708. });
  709. },
  710. confirm() {
  711. // 项目ID,json字符,格式如:[{"project_id":"10","num":5}],project_id:适用项目ID,num:剩余次数
  712. let project_data = [],
  713. project_info = {};
  714. this.cardInfo.project_list.forEach(res => {
  715. project_info = {
  716. project_id: res.id,
  717. num: res.num
  718. };
  719. project_data.push(project_info);
  720. });
  721. api
  722. .cardUpdate({
  723. id: this.cardInfo.id,
  724. project_data: JSON.stringify(project_data)
  725. })
  726. .then(res => {
  727. if (res.code == 200) {
  728. this.$message.success("更改成功!");
  729. this.isPore = false;
  730. // 刷新次卡列表
  731. this.getCardList();
  732. }
  733. });
  734. },
  735. // 获取商品订单
  736. getUserGoods() {
  737. let params = {
  738. page: this.currentPage1,
  739. limit: this.limit,
  740. id: this.id
  741. };
  742. api.getUserGoods(params).then(res => {
  743. this.goodData = res.data.list;
  744. this.total = res.data.total;
  745. // 关闭刷新动画
  746. this.refresh = false;
  747. });
  748. },
  749. // 获取获取项目订单
  750. getUserProject() {
  751. let params = {
  752. page: this.currentPage1,
  753. limit: this.limit,
  754. id: this.id
  755. };
  756. api.getUserProject(params).then(res => {
  757. this.projectData = res.data.list;
  758. this.total = res.data.total;
  759. // 关闭刷新动画
  760. this.refresh = false;
  761. });
  762. },
  763. // 获取卡券订单
  764. // async getCardOrders() {
  765. // let params = {
  766. // page: this.currentPage1,
  767. // limit: this.limit,
  768. // id: this.id,
  769. // };
  770. // let resp = await api.getCardOrders(params);
  771. // if (resp.code === 200) {
  772. // console.log(resp, "adadasdasdadsadsadasd");
  773. // this.cardOrderData = resp.data.list;
  774. // this.total = resp.data.total;
  775. // }
  776. // },
  777. //获取用户次卡列表
  778. async getCardList() {
  779. let params = {
  780. page: this.currentPage1,
  781. limit: this.limit,
  782. id: this.id
  783. };
  784. let resp = await api.getCardList(params);
  785. if (resp.code === 200) {
  786. this.cardListData = resp.data.list;
  787. this.total = resp.data.total;
  788. // 关闭刷新动画
  789. this.refresh = false;
  790. }
  791. },
  792. // 获取余额变更记录
  793. async getBalanceRecord() {
  794. let params = {
  795. page: this.currentPage1,
  796. limit: this.limit,
  797. id: this.id
  798. };
  799. let resp = await api.getBalanceRecord(params);
  800. if (resp.code === 200) {
  801. this.balanceListData = resp.data.list;
  802. this.total = resp.data.count;
  803. // 关闭刷新动画
  804. this.refresh = false;
  805. }
  806. },
  807. handleCurrentChange(val) {
  808. this.currentPage1 = val;
  809. if (this.activeName == "first") {
  810. this.getUserProject();
  811. } else if (this.activeName == "second") {
  812. // this.getCardOrders();
  813. this.getCardList();
  814. } else if (this.activeName == "third") {
  815. this.getUserGoods();
  816. } else if (this.activeName == "fourth") {
  817. this.getUserCoupon();
  818. } else if (this.activeName == "five") {
  819. this.getBalanceRecord();
  820. }
  821. },
  822. handleSelectionChange(row, column, event) {
  823. this.$router.push({
  824. path: "/historicalOrder/details",
  825. query: {
  826. id: row.id
  827. }
  828. });
  829. },
  830. onSubmit() {},
  831. submitFrequency() {},
  832. changeTab(e) {
  833. this.currentPage1 = 1;
  834. console.log(this.currentPage1);
  835. if (e.index == 0) {
  836. this.getUserProject();
  837. } else if (e.index == 1) {
  838. // this.getCardOrders();
  839. this.getCardList();
  840. } else if (e.index == 2) {
  841. this.getUserGoods();
  842. } else if (e.index == 3) {
  843. this.getUserCoupon();
  844. } else if (e.index == 4) {
  845. this.getBalanceRecord();
  846. }
  847. }
  848. },
  849. created() {
  850. let id = this.$route.query.id;
  851. let activeName = this.$route.query.activeName;
  852. this.activeName = activeName;
  853. this.id = id;
  854. if (this.activeName == "first") {
  855. this.getUserProject();
  856. } else if (this.activeName == "second") {
  857. // this.getCardOrders();
  858. this.getCardList();
  859. } else if (this.activeName == "third") {
  860. this.getUserGoods();
  861. } else if (this.activeName == "fourth") {
  862. this.getUserCoupon();
  863. } else if (this.activeName == "five") {
  864. this.getBalanceRecord();
  865. }
  866. },
  867. activated() {
  868. let id = this.$route.query.id;
  869. let activeName = this.$route.query.activeName;
  870. this.activeName = activeName;
  871. this.id = id;
  872. if (this.activeName == "first") {
  873. this.getUserProject();
  874. } else if (this.activeName == "second") {
  875. this.getCardList();
  876. } else if (this.activeName == "third") {
  877. this.getUserGoods();
  878. } else if (this.activeName == "fourth") {
  879. this.getUserCoupon();
  880. } else if (this.activeName == "five") {
  881. this.getBalanceRecord();
  882. }
  883. },
  884. mounted() {}
  885. };
  886. </script>
  887. <style lang='less' scoped>
  888. .order {
  889. height: 100%;
  890. width: 100%;
  891. .refreshBtn {
  892. width: 100%;
  893. display: flex;
  894. justify-content: flex-end;
  895. margin-bottom: 10px;
  896. .refresh {
  897. width: 100px;
  898. background: #fa7d22;
  899. border-radius: 2px;
  900. border-color: #fa7d22;
  901. }
  902. }
  903. .cancleCoupon {
  904. width: 50px;
  905. height: 25px;
  906. background: #fa7d22;
  907. border-radius: 2px;
  908. line-height: 25px;
  909. text-align: center;
  910. color: #fff;
  911. }
  912. .examineCoupon {
  913. width: 50px;
  914. height: 25px;
  915. }
  916. .pagin {
  917. padding: 20px 0;
  918. .el-pagination {
  919. text-align: center;
  920. }
  921. }
  922. .colorList {
  923. color: green;
  924. }
  925. }
  926. .color0 {
  927. color: #3ef3ed;
  928. }
  929. .color1 {
  930. color: #61d09d;
  931. }
  932. .color2 {
  933. color: #00eeee;
  934. }
  935. .color3 {
  936. color: #a999ea;
  937. }
  938. .color-2 {
  939. color: #3115cc;
  940. }
  941. .color-1 {
  942. color: #fc3019;
  943. }
  944. .color-3 {
  945. color: #fc3019;
  946. }
  947. .colorA1 {
  948. color: #333;
  949. }
  950. .colorA2 {
  951. color: #fc3019;
  952. }
  953. .colorA0 {
  954. color: #61d09d;
  955. }
  956. .colorB0 {
  957. color: #3ef3ed;
  958. }
  959. .colorB1 {
  960. color: #61d09d;
  961. }
  962. .colorB-1 {
  963. color: #fc3019;
  964. }
  965. .colorB-2 {
  966. color: #333;
  967. }
  968. .priceColor {
  969. color: #ff3007;
  970. }
  971. .pore-block {
  972. width: 540px;
  973. height: 400px;
  974. background: #ffffff;
  975. border-radius: 8px;
  976. position: relative;
  977. padding: 26px 72px 80px 30px;
  978. .delete-pupop {
  979. width: 32px;
  980. position: absolute;
  981. right: 5px;
  982. top: 5px;
  983. img {
  984. width: 100%;
  985. }
  986. }
  987. .pore-content {
  988. overflow: scroll;
  989. height: 310px;
  990. .card-title {
  991. font-size: 14px;
  992. font-family: PingFangSC-Medium, PingFang SC;
  993. font-weight: 500;
  994. color: #333333;
  995. line-height: 20px;
  996. text-align: center;
  997. }
  998. .project {
  999. display: flex;
  1000. font-size: 13px;
  1001. font-family: PingFangSC-Regular, PingFang SC;
  1002. font-weight: 400;
  1003. color: #333333;
  1004. line-height: 18px;
  1005. .project-title {
  1006. color: #999999;
  1007. }
  1008. .project-list {
  1009. flex: 1;
  1010. .project-info {
  1011. flex: 1;
  1012. .change-num {
  1013. margin-top: 6px;
  1014. width: 100%;
  1015. display: flex;
  1016. justify-content: end;
  1017. .num-content {
  1018. width: 104px;
  1019. height: 28px;
  1020. background: #ffffff;
  1021. border-radius: 2px;
  1022. border: 1px solid #fa7d22;
  1023. display: flex;
  1024. align-items: center;
  1025. .content-left,
  1026. .content-right {
  1027. width: 28px;
  1028. height: 100%;
  1029. background: #fa7d22;
  1030. font-size: 20px;
  1031. line-height: 24px;
  1032. color: #ffffff;
  1033. text-align: center;
  1034. }
  1035. .content-num {
  1036. flex: 1;
  1037. font-size: 12px;
  1038. font-family: PingFangSC-Regular, PingFang SC;
  1039. font-weight: 400;
  1040. color: rgba(0, 0, 0, 0.65);
  1041. text-align: center;
  1042. }
  1043. }
  1044. }
  1045. }
  1046. }
  1047. }
  1048. .common {
  1049. margin-top: 6px;
  1050. font-size: 13px;
  1051. font-family: PingFangSC-Regular, PingFang SC;
  1052. font-weight: 400;
  1053. color: #333333;
  1054. line-height: 18px;
  1055. .common-title {
  1056. color: #999999;
  1057. }
  1058. }
  1059. .consume-list {
  1060. margin-top: 6px;
  1061. .consume-title {
  1062. font-size: 13px;
  1063. font-family: PingFangSC-Regular, PingFang SC;
  1064. font-weight: 400;
  1065. color: #999999;
  1066. line-height: 18px;
  1067. }
  1068. .consume-info {
  1069. margin-top: 6px;
  1070. font-size: 10px;
  1071. font-family: PingFangSC-Regular, PingFang SC;
  1072. font-weight: 400;
  1073. color: #333333;
  1074. line-height: 14px;
  1075. display: flex;
  1076. justify-content: space-between;
  1077. .shop {
  1078. }
  1079. .project-tips {
  1080. flex: 1;
  1081. margin: 0 10px;
  1082. }
  1083. .project-ts {
  1084. }
  1085. }
  1086. }
  1087. }
  1088. .confirm {
  1089. background: #fa7d22;
  1090. border-radius: 14px;
  1091. position: absolute;
  1092. bottom: 42px;
  1093. left: 50%;
  1094. transform: translateX(-50%);
  1095. width: 176px;
  1096. height: 28px;
  1097. font-size: 14px;
  1098. font-family: PingFangSC-Medium, PingFang SC;
  1099. font-weight: 500;
  1100. color: #ffffff;
  1101. line-height: 28px;
  1102. text-align: center;
  1103. }
  1104. }
  1105. // 修改次卡时间
  1106. .amendTime {
  1107. width: 440px;
  1108. height: 300px;
  1109. background-color: #fff;
  1110. border-radius: 12px;
  1111. padding: 15px;
  1112. .image {
  1113. height: 30px;
  1114. width: 30px;
  1115. img {
  1116. width: 100%;
  1117. }
  1118. }
  1119. .oldTime {
  1120. color: #333;
  1121. margin-left: 20px;
  1122. margin-top: 30px;
  1123. span {
  1124. margin-left: 20px;
  1125. }
  1126. }
  1127. .newTime {
  1128. margin-left: 20px;
  1129. margin-top: 10px;
  1130. .time {
  1131. margin-top: 20px;
  1132. margin-left: 110px;
  1133. }
  1134. .date {
  1135. margin-top: 20px;
  1136. margin-left: 20px;
  1137. }
  1138. }
  1139. .radio {
  1140. width: 100%;
  1141. display: flex;
  1142. justify-content: space-evenly;
  1143. button {
  1144. width: 176px;
  1145. height: 28px;
  1146. border-radius: 14px;
  1147. background-color: #fff;
  1148. border: none;
  1149. margin-top: 90px;
  1150. }
  1151. .cancelBtn {
  1152. border: 1px solid #fa7d22;
  1153. color: #fa7d22;
  1154. }
  1155. .affirmBtn {
  1156. background-color: #fa7d22;
  1157. color: #fff;
  1158. margin-left: 15px;
  1159. }
  1160. }
  1161. }
  1162. // 核销优惠券
  1163. .CouponPop {
  1164. width: 440px;
  1165. height: 300px;
  1166. background-color: #fff;
  1167. border-radius: 12px;
  1168. padding: 15px;
  1169. .image {
  1170. height: 30px;
  1171. width: 30px;
  1172. img {
  1173. width: 100%;
  1174. }
  1175. }
  1176. .title {
  1177. text-align: center;
  1178. font-weight: 700;
  1179. font-size: 16px;
  1180. margin-bottom: 40px;
  1181. }
  1182. .couponName {
  1183. display: flex;
  1184. margin-bottom: 40px;
  1185. .one {
  1186. font-weight: 600;
  1187. margin-right: 20px;
  1188. width: 90px;
  1189. }
  1190. }
  1191. .couponRemark {
  1192. display: flex;
  1193. align-items: center;
  1194. .one {
  1195. margin-right: 22px;
  1196. font-weight: 600;
  1197. width: 90px;
  1198. }
  1199. .el-input {
  1200. width: 300px;
  1201. /deep/.el-input__inner:focus {
  1202. // el-input输入时设置边框颜色
  1203. border: #fa7d22 1px solid;
  1204. }
  1205. }
  1206. }
  1207. .radio {
  1208. width: 100%;
  1209. display: flex;
  1210. justify-content: space-evenly;
  1211. button {
  1212. width: 176px;
  1213. height: 28px;
  1214. border-radius: 14px;
  1215. background-color: #fff;
  1216. border: none;
  1217. margin-top: 50px;
  1218. }
  1219. .affirmBtn {
  1220. background-color: #fa7d22;
  1221. color: #fff;
  1222. margin-left: 15px;
  1223. }
  1224. }
  1225. }
  1226. // 核销次卡界面
  1227. .CancelCard {
  1228. width: 440px;
  1229. height: 300px;
  1230. background-color: #fff;
  1231. border-radius: 12px;
  1232. padding: 15px;
  1233. .image {
  1234. height: 30px;
  1235. width: 30px;
  1236. img {
  1237. width: 100%;
  1238. }
  1239. }
  1240. .title {
  1241. text-align: center;
  1242. font-weight: 700;
  1243. font-size: 16px;
  1244. margin-bottom: 40px;
  1245. }
  1246. .CardName {
  1247. display: flex;
  1248. margin-bottom: 40px;
  1249. .one {
  1250. font-weight: 600;
  1251. margin-right: 10px;
  1252. width: 90px;
  1253. }
  1254. }
  1255. .cardRemark {
  1256. display: flex;
  1257. align-items: center;
  1258. .one {
  1259. margin-right: 22px;
  1260. font-weight: 600;
  1261. width: 90px;
  1262. }
  1263. .el-input {
  1264. width: 300px;
  1265. /deep/.el-input__inner:focus {
  1266. // el-input输入时设置边框颜色
  1267. border: #fa7d22 1px solid;
  1268. }
  1269. }
  1270. }
  1271. .radio {
  1272. width: 100%;
  1273. display: flex;
  1274. justify-content: space-evenly;
  1275. button {
  1276. width: 176px;
  1277. height: 28px;
  1278. border-radius: 14px;
  1279. background-color: #fff;
  1280. border: none;
  1281. margin-top: 50px;
  1282. }
  1283. .affirmBtn {
  1284. background-color: #fa7d22;
  1285. color: #fff;
  1286. margin-left: 15px;
  1287. }
  1288. }
  1289. }
  1290. .expir_time {
  1291. color: #3115cc;
  1292. }
  1293. </style>