withdrawal.php 18 KB

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