index.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442
  1. <template>
  2. <div>
  3. <el-card :bordered="false" shadow="never" class="ivu-mb-16">
  4. <el-form
  5. ref="formValidate"
  6. :model="formValidate"
  7. :label-width="labelWidth"
  8. :label-position="labelPosition"
  9. class="tabform"
  10. @submit.native.prevent
  11. >
  12. <el-row :gutter="24">
  13. <el-col :span="24">
  14. <el-form-item label="时间选择:">
  15. <el-radio-group
  16. v-model="formValidate.data"
  17. type="button"
  18. @change="selectChange(formValidate.data)"
  19. class="mr"
  20. >
  21. <el-radio-button :label="item.val" v-for="(item, i) in fromList.fromTxt" :key="i">{{
  22. item.text
  23. }}</el-radio-button>
  24. </el-radio-group>
  25. <el-date-picker
  26. :editable="false"
  27. @change="onchangeTime"
  28. v-model="timeVal"
  29. format="yyyy/MM/dd"
  30. type="daterange"
  31. value-format="yyyy/MM/dd"
  32. range-separator="至"
  33. start-placeholder="开始日期"
  34. end-placeholder="结束日期"
  35. style="width: 200px"
  36. ></el-date-picker>
  37. </el-form-item>
  38. </el-col>
  39. <el-col :span="24">
  40. <el-form-item label="提现状态:">
  41. <el-radio-group type="button" v-model="formValidate.status" class="mr15" @change="selChange">
  42. <el-radio-button :label="itemn.value" v-for="(itemn, indexn) in treeData.withdrawal" :key="indexn">{{
  43. itemn.title
  44. }}</el-radio-button>
  45. </el-radio-group>
  46. </el-form-item>
  47. </el-col>
  48. <el-col :span="24">
  49. <el-form-item label="提现方式:">
  50. <el-radio-group type="button" v-model="formValidate.extract_type" class="mr15" @change="selChange">
  51. <el-radio-button :label="itemn.value" v-for="(itemn, indexn) in treeData.payment" :key="indexn">{{
  52. itemn.title
  53. }}</el-radio-button>
  54. </el-radio-group>
  55. </el-form-item>
  56. </el-col>
  57. <el-col :span="24">
  58. <el-form-item label="搜索:">
  59. <div class="acea-row row-middle">
  60. <el-input
  61. search
  62. enter-button
  63. @on-search="selChange"
  64. placeholder="微信昵称/姓名/支付宝账号/银行卡号"
  65. element-id="name"
  66. v-model="formValidate.nireid"
  67. style="width: 30%"
  68. />
  69. <router-link :to="$routeProStr + '/finance/finance/commission'" class="ml20">佣金记录</router-link>
  70. </div>
  71. </el-form-item>
  72. </el-col>
  73. </el-row>
  74. </el-form>
  75. </el-card>
  76. <cards-data :cardLists="cardLists" v-if="extractStatistics"></cards-data>
  77. <el-card :bordered="false" shadow="never">
  78. <el-table ref="table" :data="tabList" class="ivu-mt" :loading="loading" empty-text="暂无数据">
  79. <el-table-column label="ID" width="80">
  80. <template slot-scope="scope">
  81. <span>{{ scope.row.id }}</span>
  82. </template>
  83. </el-table-column>
  84. <el-table-column label="用户信息" min-width="130">
  85. <template slot-scope="scope">
  86. <div>
  87. 用户昵称: {{ scope.row.nickname }} <br />
  88. 用户id:{{ scope.row.uid }}
  89. </div>
  90. </template>
  91. </el-table-column>
  92. <el-table-column label="提现金额" min-width="130">
  93. <template slot-scope="scope">
  94. <div>{{ scope.row.extract_price }}</div>
  95. </template>
  96. </el-table-column>
  97. <el-table-column label="提现方式" min-width="130">
  98. <template slot-scope="scope">
  99. <div class="type" v-if="scope.row.extract_type === 'bank'">
  100. <div class="item">姓名:{{ scope.row.real_name }}</div>
  101. <div class="item">银行卡号:{{ scope.row.bank_code }}</div>
  102. <div class="item">银行开户地址:{{ scope.row.bank_address }}</div>
  103. </div>
  104. <div class="type" v-if="scope.row.extract_type === 'weixin'">
  105. <div class="item">昵称:{{ scope.row.nickname }}</div>
  106. <div class="item">微信号:{{ scope.row.wechat }}</div>
  107. </div>
  108. <div class="type" v-if="scope.row.extract_type === 'alipay'">
  109. <div class="item">姓名:{{ scope.row.real_name }}</div>
  110. <div class="item">支付宝号:{{ scope.row.alipay_code }}</div>
  111. </div>
  112. <div class="type" v-if="scope.row.extract_type === 'balance'">
  113. <div class="item">姓名:{{ scope.row.real_name }}</div>
  114. <div class="item">提现方式:佣金转入余额</div>
  115. </div>
  116. </template>
  117. </el-table-column>
  118. <el-table-column label="收款码" min-width="90">
  119. <template slot-scope="scope">
  120. <div
  121. class="tabBox_img"
  122. v-viewer
  123. v-if="scope.row.extract_type === 'weixin' || scope.row.extract_type === 'alipay'"
  124. >
  125. <img v-lazy="scope.row.qrcode_url" />
  126. </div>
  127. </template>
  128. </el-table-column>
  129. <el-table-column label="添加时间" min-width="130">
  130. <template slot-scope="scope">
  131. <span>{{ scope.row.add_time | formatDate }}</span>
  132. </template>
  133. </el-table-column>
  134. <el-table-column label="备注" min-width="130">
  135. <template slot-scope="scope">
  136. <span>{{ scope.row.mark }}</span>
  137. </template>
  138. </el-table-column>
  139. <el-table-column label="审核状态" min-width="130">
  140. <template slot-scope="scope">
  141. <div class="status" v-if="scope.row.status === 0">
  142. <div class="statusVal">申请中</div>
  143. <div>
  144. <el-button type="error" icon="md-close" size="small" class="item" @click="invalid(scope.row)"
  145. >驳回</el-button
  146. >
  147. <el-button
  148. type="info"
  149. icon="md-checkmark"
  150. size="small"
  151. class="item"
  152. @click="adopt(scope.row, '审核通过', index)"
  153. >通过</el-button
  154. >
  155. </div>
  156. </div>
  157. <div class="statusVal" v-if="scope.row.status === 1">提现通过</div>
  158. <div class="statusVal" v-if="scope.row.status === -1">
  159. 提现未通过<br />未通过原因:{{ scope.row.fail_msg }}
  160. </div>
  161. </template>
  162. </el-table-column>
  163. <el-table-column label="操作" fixed="right" width="170">
  164. <template slot-scope="scope">
  165. <a href="javascript:void(0);" @click="edit(scope.row)">编辑</a>
  166. </template>
  167. </el-table-column>
  168. </el-table>
  169. <div class="acea-row row-right page">
  170. <pagination
  171. v-if="total"
  172. :total="total"
  173. :page.sync="formValidate.page"
  174. :limit.sync="formValidate.limit"
  175. @pagination="getList"
  176. />
  177. </div>
  178. </el-card>
  179. <!-- 编辑表单-->
  180. <edit-from ref="edits" :FromData="FromData" @submitFail="submitFail"></edit-from>
  181. <!-- 拒绝通过-->
  182. <el-dialog :visible.sync="modals" title="未通过原因" :close-on-click-modal="false">
  183. <el-input v-model="fail_msg.message" type="textarea" :rows="4" placeholder="请输入未通过原因" />
  184. <div slot="footer">
  185. <el-button type="primary" size="large" long :loading="modal_loading" @click="oks">确定</el-button>
  186. </div>
  187. </el-dialog>
  188. </div>
  189. </template>
  190. <script>
  191. import cardsData from '@/components/cards/cards';
  192. import searchFrom from '@/components/publicSearchFrom';
  193. import { mapState } from 'vuex';
  194. import { cashListApi, cashEditApi, refuseApi } from '@/api/finance';
  195. import { formatDate } from '@/utils/validate';
  196. import editFrom from '@/components/from/from';
  197. export default {
  198. name: 'cashApply',
  199. components: { cardsData, searchFrom, editFrom },
  200. filters: {
  201. formatDate(time) {
  202. if (time !== 0) {
  203. let date = new Date(time * 1000);
  204. return formatDate(date, 'yyyy-MM-dd hh:mm');
  205. }
  206. },
  207. },
  208. data() {
  209. return {
  210. images: ['1.jpg', '2.jpg'],
  211. modal_loading: false,
  212. fail_msg: {
  213. message: '输入信息不完整或有误!',
  214. },
  215. modals: false,
  216. total: 0,
  217. cardLists: [],
  218. loading: false,
  219. tabList: [],
  220. fromList: {
  221. title: '选择时间',
  222. custom: true,
  223. fromTxt: [
  224. { text: '全部', val: '' },
  225. { text: '今天', val: 'today' },
  226. { text: '昨天', val: 'yesterday' },
  227. { text: '本周', val: 'week' },
  228. { text: '本月', val: 'month' },
  229. { text: '本季度', val: 'quarter' },
  230. { text: '本年', val: 'year' },
  231. ],
  232. },
  233. treeData: {
  234. withdrawal: [
  235. {
  236. title: '全部',
  237. value: '',
  238. },
  239. {
  240. title: '未通过',
  241. value: -1,
  242. },
  243. {
  244. title: '申请中',
  245. value: 0,
  246. },
  247. {
  248. title: '已通过',
  249. value: 1,
  250. },
  251. ],
  252. payment: [
  253. {
  254. title: '全部',
  255. value: '',
  256. },
  257. {
  258. title: '微信',
  259. value: 'wx',
  260. },
  261. {
  262. title: '支付宝',
  263. value: 'alipay',
  264. },
  265. {
  266. title: '银行卡',
  267. value: 'bank',
  268. },
  269. ],
  270. },
  271. formValidate: {
  272. status: '',
  273. extract_type: '',
  274. nireid: '',
  275. data: '',
  276. page: 1,
  277. limit: 20,
  278. },
  279. extractStatistics: {},
  280. timeVal: [],
  281. FromData: null,
  282. extractId: 0,
  283. };
  284. },
  285. watch: {
  286. $route() {
  287. if (this.$route.fullPath === this.$routeProStr + '/finance/user_extract/index?status=0') {
  288. this.getPath();
  289. }
  290. },
  291. },
  292. computed: {
  293. ...mapState('media', ['isMobile']),
  294. labelWidth() {
  295. return this.isMobile ? undefined : '85px';
  296. },
  297. labelPosition() {
  298. return this.isMobile ? 'top' : 'left';
  299. },
  300. },
  301. mounted() {
  302. if (this.$route.fullPath === this.$routeProStr + '/finance/user_extract/index?status=0') {
  303. this.getPath();
  304. } else {
  305. this.getList();
  306. }
  307. },
  308. methods: {
  309. getPath() {
  310. this.formValidate.page = 1;
  311. this.formValidate.status = parseInt(this.$route.query.status);
  312. this.getList();
  313. },
  314. // 无效
  315. invalid(row) {
  316. this.extractId = row.id;
  317. this.modals = true;
  318. },
  319. // 确定
  320. oks() {
  321. this.modal_loading = true;
  322. refuseApi(this.extractId, this.fail_msg)
  323. .then(async (res) => {
  324. this.$message.success(res.msg);
  325. this.modal_loading = false;
  326. this.modals = false;
  327. this.getList();
  328. })
  329. .catch((res) => {
  330. this.$message.error(res.msg);
  331. });
  332. },
  333. // 通过
  334. adopt(row, tit, num) {
  335. let delfromData = {
  336. title: tit,
  337. num: num,
  338. url: `finance/extract/adopt/${row.id}`,
  339. method: 'put',
  340. ids: '',
  341. };
  342. this.$modalSure(delfromData)
  343. .then((res) => {
  344. this.$message.success(res.msg);
  345. this.getList();
  346. })
  347. .catch((res) => {
  348. this.$message.error(res.msg);
  349. });
  350. },
  351. // 具体日期
  352. onchangeTime(e) {
  353. this.timeVal = e;
  354. this.formValidate.data = this.timeVal ? this.timeVal.join('-') : '';
  355. this.formValidate.page = 1;
  356. this.getList();
  357. },
  358. // 选择时间
  359. selectChange(tab) {
  360. this.formValidate.page = 1;
  361. this.formValidate.data = tab;
  362. this.timeVal = [];
  363. this.getList();
  364. },
  365. // 选择
  366. selChange() {
  367. this.formValidate.page = 1;
  368. this.getList();
  369. },
  370. // 列表
  371. getList() {
  372. this.loading = true;
  373. cashListApi(this.formValidate)
  374. .then(async (res) => {
  375. let data = res.data;
  376. this.tabList = data.list.list;
  377. this.total = data.list.count;
  378. this.extractStatistics = data.extract_statistics;
  379. this.cardLists = [
  380. { col: 6, count: this.extractStatistics.brokerage_count, name: '佣金总金额', className: 'md-pricetags' },
  381. { col: 6, count: this.extractStatistics.price, name: '待提现金额', className: 'md-basket' },
  382. { col: 6, count: this.extractStatistics.priced, name: '已提现金额', className: 'md-cash' },
  383. { col: 6, count: this.extractStatistics.brokerage_not, name: '未提现金额', className: 'ios-cash' },
  384. ];
  385. this.loading = false;
  386. })
  387. .catch((res) => {
  388. this.loading = false;
  389. this.$message.error(res.msg);
  390. });
  391. },
  392. // 编辑
  393. edit(row) {
  394. cashEditApi(row.id)
  395. .then(async (res) => {
  396. if (res.data.status === false) {
  397. return this.$authLapse(res.data);
  398. }
  399. this.FromData = res.data;
  400. this.$refs.edits.modals = true;
  401. })
  402. .catch((res) => {
  403. this.$message.error(res.msg);
  404. });
  405. },
  406. // 编辑提交成功
  407. submitFail() {
  408. this.getList();
  409. },
  410. },
  411. };
  412. </script>
  413. <style scoped lang="stylus">
  414. .ivu-mt .type .item
  415. margin:3px 0;
  416. .tabform
  417. margin-bottom 10px
  418. .Refresh
  419. font-size 12px
  420. color #1890FF
  421. cursor pointer
  422. .ivu-form-item
  423. margin-bottom 10px
  424. .status >>> .item~.item
  425. margin-left 6px
  426. .status >>> .statusVal
  427. margin-bottom 7px
  428. /*.ivu-mt >>> .ivu-table-header*/
  429. /* border-top:1px dashed #ddd!important*/
  430. .type
  431. padding 3px 0
  432. box-sizing border-box
  433. .tabBox_img
  434. width 36px
  435. height 36px
  436. border-radius:4px
  437. cursor pointer
  438. img
  439. width 100%
  440. height 100%
  441. </style>