withdrawal.php 18 KB

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