withdrawal.php 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647
  1. <?php
  2. use common\helpers\ComponentHelper;
  3. ?>
  4. <div id="app" v-cloak>
  5. <el-card v-loading="loading" style="border:0" shadow="never" body-style="background-color: #f3f3f3;padding: 0 0;">
  6. <el-tabs v-model="activeName" @tab-click="handleClick">
  7. <el-tab-pane label="提现" name="withdrawal-edit">
  8. <?php ComponentHelper::loadComponentView('withdrawal-edit', __DIR__ . '/'); ?>
  9. </el-tab-pane>
  10. <el-tab-pane label="提现记录" name="withdrawal-log">
  11. <?php ComponentHelper::loadComponentView('withdrawal-log', __DIR__ . '/'); ?>
  12. </el-tab-pane>
  13. </el-tabs>
  14. </el-card>
  15. </div>
  16. <script>
  17. const app = new Vue({
  18. el: '#app',
  19. data() {
  20. return {
  21. activeName: 'withdrawal-edit',
  22. basicForm:{
  23. withdrawal_type:0,
  24. withdrawal_money:0,
  25. user:{},
  26. store:{},
  27. select_card_id:0,
  28. store_banks:{},
  29. select_bank:{},
  30. cash__type_name:{},
  31. },
  32. submitForm:{
  33. type:'',
  34. price:0,
  35. wechat_qrcode:'',
  36. content:'',
  37. bank_account:'',
  38. bank_account_type:'',
  39. bank_name:'',
  40. from:2,
  41. id_card:'',
  42. mobile:'',
  43. name:'',
  44. receive_bank_chanel_no:'',
  45. huifu_no:'',
  46. },
  47. basicFormRules:{},
  48. loading:false,
  49. listLoading:false,
  50. submitLoading:false,
  51. dialogFormVisible:false,
  52. dialogFormVisiblePay:false,
  53. dialogFormVisiblePaySms:false,
  54. store_bank_form:{},
  55. store_bank_form_pay:{},
  56. formLabelWidth: '120px',
  57. withdrawLogList:[],
  58. pageCount: 0,
  59. pagination: null,
  60. page:1,
  61. searchData: {
  62. withdraw_status: '',
  63. start: '',
  64. end: '',
  65. },
  66. datetime:'',
  67. is_show_join_pay:0,
  68. sms_code:'',
  69. card_id:'',
  70. };
  71. },
  72. mounted: function() {
  73. this.loadData();
  74. },
  75. methods: {
  76. loadData() {
  77. let self = this;
  78. request({
  79. params: {
  80. r: 'happiness/client/finance/withdrawal',
  81. },
  82. }).then(e => {
  83. self.loading = false;
  84. if (e.data.code === 0) {
  85. if (e.data.data.user) {
  86. self.basicForm.user = e.data.data.user;
  87. self.basicForm.store = e.data.data.store;
  88. self.basicForm.store_banks = e.data.data.store_banks;
  89. self.basicForm.cash__type_name = e.data.data.cash__type_name;
  90. self.basicForm.join_pay_banks = e.data.data.join_pay_banks;
  91. self.is_show_join_pay = e.data.data.is_show_join_pay;
  92. self.submitForm.huifu_no = e.data.data.store.huifu_no;
  93. }
  94. } else {
  95. self.$message.error(e.data.msg);
  96. }
  97. }).catch(e => {
  98. self.$message.error('网络错误');
  99. });
  100. },
  101. submit(){
  102. request({
  103. params: {
  104. r: 'happiness/client/finance/withdrawal',
  105. },
  106. method: 'post',
  107. data: {
  108. form: this.submitForm
  109. }
  110. }).then(e => {
  111. this.loading = false;
  112. if (e.data.code === 0) {
  113. this.$message.success(e.data.msg);
  114. //刷新页面
  115. this.basicForm.store.balance = (this.basicForm.store.balance - this.submitForm.price).toFixed(2)
  116. this.submitForm.price=0;
  117. } else {
  118. this.$message.error(e.data.msg);
  119. }
  120. }).catch(e => {
  121. this.$message.error('网络错误');
  122. });
  123. },
  124. handleClick(tab, event){
  125. if(tab.name=='withdrawal-log'){
  126. this.getWithdrawLog();
  127. }
  128. },
  129. getWithdrawLog(){
  130. request({
  131. params: {
  132. r: 'happiness/client/finance/withdrawal-log',
  133. page: this.page,
  134. withdraw_status: this.searchData.withdraw_status,
  135. start: this.searchData.start,
  136. end: this.searchData.end,
  137. },
  138. method: 'get',
  139. }).then(e => {
  140. this.loading = false;
  141. if (e.data.code === 0) {
  142. this.withdrawLogList = e.data.data.list;
  143. this.pagination = e.data.data.pagination;
  144. this.pageCount = e.data.data.page_count;
  145. console.log(this.withdrawLogList);
  146. } else {
  147. this.$message.error(e.data.msg);
  148. }
  149. }).catch(e => {
  150. this.$message.error('网络错误');
  151. });
  152. },
  153. addStoreBank(){
  154. this.dialogFormVisible = true;
  155. },
  156. postStoreBank(){
  157. request({
  158. params: {
  159. r: 'happiness/client/finance/edit-store-bank',
  160. id: getQuery('id')
  161. },
  162. method: 'post',
  163. data: {
  164. form: this.store_bank_form
  165. }
  166. }).then(e => {
  167. if (e.data.code == 0) {
  168. this.$message.success(e.data.msg);
  169. this.dialogFormVisible = false;
  170. this.loadData();
  171. } else {
  172. this.$message.error(e.data.msg);
  173. }
  174. }).catch(e => {
  175. this.btnLoading = false;
  176. this.$message.error(e.data.msg);
  177. });
  178. },
  179. handleCurrentChange(val) {
  180. this.basicForm.select_bank = val;
  181. this.submitForm.bank_account = val.card_no;
  182. this.submitForm.bank_name = val.bank;
  183. this.submitForm.name = val.username;
  184. },
  185. handleCurrentChangePay(val) {
  186. this.basicForm.select_card_id = val.id;
  187. this.basicForm.select_bank = val;
  188. },
  189. deleteRow(index, rows){
  190. request({
  191. params: {
  192. r: 'happiness/client/finance/del-store-bank',
  193. id: rows.id
  194. },
  195. method: 'get',
  196. }).then(e => {
  197. if (e.data.code == 0) {
  198. this.$message.success(e.data.msg);
  199. this.loadData();
  200. } else {
  201. this.$message.error(e.data.msg);
  202. }
  203. }).catch(e => {
  204. this.$message.error(e.data.msg);
  205. });
  206. },
  207. updateRow(index, rows){
  208. request({
  209. params: {
  210. r: 'happiness/client/finance/edit-store-bank',
  211. id: rows.id
  212. },
  213. method: 'get',
  214. }).then(e => {
  215. if (e.data.code == 0) {
  216. this.dialogFormVisible = true;
  217. this.store_bank_form = e.data.data.store_bank_info;
  218. } else {
  219. this.$message.error(e.data.msg);
  220. }
  221. }).catch(e => {
  222. this.$message.error(e.data.msg);
  223. });
  224. },
  225. pageChange(currentPage) {
  226. this.page = currentPage;
  227. this.getWithdrawLog();
  228. },
  229. search() {
  230. this.page = 1;
  231. if (this.date == null) {
  232. this.date = ''
  233. }
  234. this.getWithdrawLog();
  235. },
  236. changeTime(e) {
  237. this.searchData.start = e[0]
  238. this.searchData.end = e[1]
  239. },
  240. coverPic(e) { // 选择图片
  241. this.submitForm.wechat_qrcode = e[0].url
  242. },
  243. delPic(type, index) { // 删除图片
  244. switch (type) {
  245. case 'wechat_qrcode':
  246. this.submitForm.wechat_qrcode = ''
  247. break;
  248. default:
  249. break;
  250. }
  251. },
  252. //汇聚部分
  253. addStoreBankPay(){
  254. this.dialogFormVisiblePay = true;
  255. },
  256. postStoreBankPay(){
  257. request({
  258. params: {
  259. r: 'happiness/client/finance/edit-store-bank-pay',
  260. id: getQuery('id')
  261. },
  262. method: 'post',
  263. data: {
  264. form: this.store_bank_form_pay
  265. }
  266. }).then(e => {
  267. if (e.data.code == 0) {
  268. this.dialogFormVisiblePay = false;
  269. this.dialogFormVisiblePaySms = true;
  270. this.card_id = e.data.data.card_id;
  271. } else {
  272. this.$message.error(e.data.msg);
  273. }
  274. }).catch(e => {
  275. this.btnLoading = false;
  276. this.$message.error(e.data.msg);
  277. });
  278. },
  279. postStoreBankPaySms(){
  280. request({
  281. params: {
  282. r: 'happiness/client/finance/sign-contract',
  283. id: getQuery('id')
  284. },
  285. method: 'post',
  286. data: {
  287. card_id: this.card_id,
  288. sms_code: this.sms_code,
  289. }
  290. }).then(e => {
  291. if (e.data.code == 0) {
  292. this.$message.success(e.data.msg);
  293. this.dialogFormVisiblePaySms = false;
  294. this.loadData();
  295. } else {
  296. this.$message.error(e.data.msg);
  297. }
  298. }).catch(e => {
  299. this.btnLoading = false;
  300. this.$message.error(e.data.msg);
  301. });
  302. },
  303. deleteRowPay(index, rows){
  304. request({
  305. params: {
  306. r: 'happiness/client/finance/contract-relieve',
  307. },
  308. data: {
  309. card_id: rows.card_id,
  310. },
  311. method: 'post',
  312. }).then(e => {
  313. if (e.data.code == 0) {
  314. this.$message.success(e.data.msg);
  315. this.loadData();
  316. } else {
  317. this.$message.error(e.data.msg);
  318. }
  319. }).catch(e => {
  320. this.$message.error(e.data.msg);
  321. });
  322. },
  323. getSmsCode(index, rows){
  324. request({
  325. params: {
  326. r: 'happiness/client/finance/get-sms-code',
  327. },
  328. data: {
  329. card_id: rows.card_id,
  330. },
  331. method: 'post',
  332. }).then(e => {
  333. if (e.data.code == 0) {
  334. this.dialogFormVisiblePaySms = true;
  335. this.card_id = rows.card_id;
  336. } else {
  337. this.$message.error(e.data.msg);
  338. }
  339. }).catch(e => {
  340. this.$message.error(e.data.msg);
  341. });
  342. },
  343. },
  344. computed: {
  345. }
  346. });
  347. </script>
  348. <style>
  349. .el-tabs__header {
  350. padding: 0 20px;
  351. height: 56px;
  352. line-height: 56px;
  353. background-color: #fff;
  354. margin-bottom: 0;
  355. }
  356. .title {
  357. padding: 0px 8px;
  358. border-left: 5px solid #1479F0;
  359. background-color: #fff;
  360. font-size: 18px;
  361. position: relative;
  362. left: 32px;
  363. margin: 20px 0;
  364. }
  365. .form-body {
  366. background-color: #fff;
  367. padding: 20px 50% 20px 0;
  368. }
  369. .button-item {
  370. padding: 9px 25px;
  371. margin-bottom: 15px;
  372. }
  373. .form-body .item {
  374. width: 300px;
  375. margin-bottom: 50px;
  376. margin-right: 25px;
  377. }
  378. .item-img {
  379. height: 550px;
  380. padding: 25px 10px;
  381. border-radius: 30px;
  382. border: 1px solid #CCCCCC;
  383. background-color: #fff;
  384. }
  385. .item .el-form-item {
  386. width: 300px;
  387. margin: 20px auto;
  388. }
  389. .left-setting-menu {
  390. width: 260px;
  391. }
  392. .left-setting-menu .el-form-item {
  393. height: 60px;
  394. padding-left: 20px;
  395. display: flex;
  396. align-items: center;
  397. margin-bottom: 0;
  398. cursor: pointer;
  399. }
  400. .left-setting-menu .el-form-item .el-form-item__label {
  401. cursor: pointer;
  402. }
  403. .left-setting-menu .el-form-item.active {
  404. background-color: #F3F5F6;
  405. border-top-left-radius: 10px;
  406. width: 105%;
  407. border-bottom-left-radius: 10px;
  408. }
  409. .left-setting-menu .el-form-item .el-form-item__content {
  410. margin-left: 0 !important
  411. }
  412. .no-radius {
  413. border-top-left-radius: 0 !important;
  414. }
  415. .del-btn {
  416. position: absolute;
  417. right: -8px;
  418. top: -8px;
  419. padding: 4px 4px;
  420. }
  421. .reset {
  422. position: absolute;
  423. top: 3px;
  424. left: 90px;
  425. }
  426. .app-tip {
  427. position: absolute;
  428. right: 24px;
  429. top: 16px;
  430. height: 72px;
  431. line-height: 72px;
  432. max-width: calc(100% - 78px);
  433. }
  434. .app-tip:before {
  435. content: ' ';
  436. width: 0;
  437. height: 0;
  438. border-color: inherit;
  439. position: absolute;
  440. top: -32px;
  441. right: 100px;
  442. border-width: 16px;
  443. border-style: solid;
  444. }
  445. .tip-content {
  446. display: block;
  447. white-space: nowrap;
  448. width: 100%;
  449. overflow: hidden;
  450. text-overflow: ellipsis;
  451. margin: 0 28px;
  452. font-size: 28px;
  453. }
  454. .btn-abs {
  455. position: absolute;
  456. top: 12px;
  457. right: 18px;
  458. }
  459. .form-body .app-share {
  460. padding-top: 12px;
  461. border-top: 1px solid #e2e2e2;
  462. margin-top: -20px;
  463. }
  464. .form-body .app-share .app-share-bg {
  465. position: relative;
  466. width: 310px;
  467. height: 360px;
  468. background-repeat: no-repeat;
  469. background-size: contain;
  470. background-position: center
  471. }
  472. .form-body .app-share .app-share-bg .title {
  473. width: 160px;
  474. height: 29px;
  475. line-height: 1;
  476. word-break: break-all;
  477. text-overflow: ellipsis;
  478. display: -webkit-box;
  479. -webkit-box-orient: vertical;
  480. -webkit-line-clamp: 2;
  481. overflow: hidden;
  482. }
  483. .form-body .app-share .app-share-bg .pic-image {
  484. background-repeat: no-repeat;
  485. background-position: 0 0;
  486. background-size: cover;
  487. width: 160px;
  488. height: 130px;
  489. }
  490. .cashier-tabs .el-tabs__header {
  491. padding: 0;
  492. height: 45px;
  493. line-height: 45px;
  494. /* background-color: #F5F7FA; */
  495. margin-bottom: 0;
  496. }
  497. .cashier-tabs .el-tabs__item {
  498. height: 43px;
  499. line-height: 43px;
  500. }
  501. .cashier-tabs .el-tabs__content {
  502. margin-top: 20px;
  503. }
  504. .form-body {
  505. background-color: #fff;
  506. padding: 20px 50% 20px 0;
  507. }
  508. .button-item {
  509. margin-top: 12px;
  510. padding: 9px 25px;
  511. }
  512. .form-body .item {
  513. width: 300px;
  514. margin-bottom: 50px;
  515. margin-right: 25px;
  516. }
  517. .item-img {
  518. height: 550px;
  519. padding: 25px 10px;
  520. border-radius: 30px;
  521. border: 1px solid #CCCCCC;
  522. background-color: #fff;
  523. }
  524. .item .el-form-item {
  525. width: 300px;
  526. margin: 20px auto;
  527. }
  528. .left-setting-menu {
  529. width: 260px;
  530. }
  531. .left-setting-menu .el-form-item {
  532. height: 60px;
  533. padding-left: 20px;
  534. display: flex;
  535. align-items: center;
  536. margin-bottom: 0;
  537. cursor: pointer;
  538. }
  539. .left-setting-menu .el-form-item .el-form-item__label {
  540. cursor: pointer;
  541. }
  542. .left-setting-menu .el-form-item.active {
  543. background-color: #F3F5F6;
  544. border-top-left-radius: 10px;
  545. width: 105%;
  546. border-bottom-left-radius: 10px;
  547. }
  548. .left-setting-menu .el-form-item .el-form-item__content {
  549. margin-left: 0 !important
  550. }
  551. .no-radius {
  552. border-top-left-radius: 0 !important;
  553. }
  554. .del-btn {
  555. position: absolute;
  556. right: -8px;
  557. top: -8px;
  558. padding: 4px 4px;
  559. }
  560. .reset {
  561. position: absolute;
  562. top: 3px;
  563. left: 90px;
  564. }
  565. .app-tip {
  566. position: absolute;
  567. right: 24px;
  568. top: 16px;
  569. height: 72px;
  570. line-height: 72px;
  571. max-width: calc(100% - 78px);
  572. }
  573. .app-tip:before {
  574. content: ' ';
  575. width: 0;
  576. height: 0;
  577. border-color: inherit;
  578. position: absolute;
  579. top: -32px;
  580. right: 100px;
  581. border-width: 16px;
  582. border-style: solid;
  583. }
  584. .tip-content {
  585. display: block;
  586. white-space: nowrap;
  587. width: 100%;
  588. overflow: hidden;
  589. text-overflow: ellipsis;
  590. margin: 0 28px;
  591. font-size: 28px;
  592. }
  593. </style>