withdraw.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517
  1. <template>
  2. <div v-loading="loading">
  3. <div class="white-box">
  4. <el-tabs v-model="filterStatus" @tab-click="handleFilterStatusClick">
  5. <el-tab-pane label="All" name="-1" :lazy="true"></el-tab-pane> <!-- 全部 -->
  6. <el-tab-pane label="To be reviewed" name="0" :lazy="true"></el-tab-pane> <!-- 待审核 -->
  7. <el-tab-pane label="Reviewed" name="2" :lazy="true"></el-tab-pane> <!-- 已审核 -->
  8. <el-tab-pane label="To be paid" name="3" :lazy="true"></el-tab-pane> <!-- 待付款 -->
  9. <el-tab-pane label="Paid" name="6" :lazy="true"></el-tab-pane> <!-- 已付款 -->
  10. <el-tab-pane label="Payment failed" name="4" :lazy="true"></el-tab-pane> <!-- 付款失败 -->
  11. <el-tab-pane label="Returned" name="7" :lazy="true"></el-tab-pane> <!-- 已退回 -->
  12. </el-tabs>
  13. <div class="filter-box">
  14. <filter-user :filter-types.sync="filterTypes" @select-value="handleFilterUser"></filter-user>
  15. </div>
  16. <el-table :data="tableData" stripe style="width: 100%;" @selection-change="handleSelectionChange" :height="tool.getTableHeight()">
  17. <el-table-column type="selection" width="55" v-if="tableHeaders"></el-table-column>
  18. <el-table-column v-for="(tableHeader, key) in tableHeaders" :key="key" :label="tableHeader.header" :width="tableHeader.other.width ? tableHeader.other.width : ''">
  19. <template slot-scope="scope">
  20. <template v-if="scope.row[tableHeader.index].other.tag" >
  21. <el-tag :type="scope.row[tableHeader.index].other.tag.type ? scope.row[tableHeader.index].other.tag.type : null" :size="scope.row[tableHeader.index].other.tag.size ? scope.row[tableHeader.index].other.tag.size : null" :class="scope.row[tableHeader.index].other.tag.class ? scope.row[tableHeader.index].other.tag.class : null" >{{scope.row[tableHeader.index].value}}</el-tag>
  22. </template>
  23. <template v-else-if="scope.row[tableHeader.index].other.progress" >
  24. <el-progress type="circle" :percentage="Number.parseInt(percentList['MOVE_PERCENT'][scope.row.ID])"
  25. :width="50"
  26. :stroke-width="3"></el-progress>
  27. </template>
  28. <template v-else>
  29. <div v-html="scope.row[tableHeader.index].value"></div>
  30. </template>
  31. </template>
  32. </el-table-column>
  33. <el-table-column fixed="right" label="Action" width="180"> <!-- 操作 -->
  34. <template slot-scope="scope">
  35. <el-dropdown size="small" trigger="click"
  36. v-if="scope.row.AUDIT_STATUS!=='7' && (permission.hasPermission(`finance/withdraw-status`))">
  37. <el-button type="primary" size="small" @click.stop="">
  38. Operate on this data<i class="el-icon-arrow-down el-icon--right"></i>
  39. </el-button>
  40. <el-dropdown-menu slot="dropdown">
  41. <!--<el-dropdown-item command="add"-->
  42. <!--@click.native="handleAddInvoiceShow(scope.row)"-->
  43. <!--v-show="(scope.row.AUDIT_STATUS==='0'||scope.row.AUDIT_STATUS==='1') && (permission.hasPermission(`finance/invoice-audit-add`)||permission.hasPermission(`finance/invoice-audit-edit`))">-->
  44. <!--补录发票信息-->
  45. <!--</el-dropdown-item>-->
  46. <el-dropdown-item command="status"
  47. @click.native="handleStatusShow(scope.row, 2, 'Are you sure to approve the current withdrawal?')"
  48. v-show="scope.row.AUDIT_STATUS==='0' && permission.hasPermission(`finance/withdraw-status`)"> <!-- 确定对当前提现进行审核通过操作? -->
  49. Approve <!-- 审核通过 -->
  50. </el-dropdown-item>
  51. <el-dropdown-item command="status"
  52. @click.native="handleStatusShow(scope.row, 3, 'Are you sure to set the current withdrawal as payment action?')"
  53. v-show="scope.row.AUDIT_STATUS === '2' && permission.hasPermission(`finance/withdraw-status`)"> <!-- 确定对当前提现进行设为待付款操作? -->
  54. To be paid<!-- 设为待付款 -->
  55. </el-dropdown-item>
  56. <el-dropdown-item command="status"
  57. @click.native="handleStatusShow(scope.row, 6, 'Are you sure to set the current withdrawal as paid?确定对当前提现进行设为已付款操作?')"
  58. v-show="scope.row.AUDIT_STATUS === '3' && permission.hasPermission(`finance/withdraw-status`)"> <!-- 确定对当前提现进行设为已付款操作 -->
  59. Paid<!--设为已付款-->
  60. </el-dropdown-item>
  61. <el-dropdown-item command="status"
  62. @click.native="handleStatusShow(scope.row, 3, 'Are you sure to set the current withdrawal as payment action??')"
  63. v-show="scope.row.AUDIT_STATUS === '4' && permission.hasPermission(`finance/withdraw-status`)"> <!-- 确定对当前提现进行设为待付款操作? -->
  64. To be paid<!-- 设为待付款 -->
  65. </el-dropdown-item>
  66. <el-dropdown-item command="status"
  67. @click.native="handleStatusShow(scope.row, 4, 'Are you sure to set payment failure for the current withdrawal?', 'Note')"
  68. v-show="scope.row.AUDIT_STATUS === '6' && permission.hasPermission(`finance/withdraw-status`)"> <!-- 付款失败备注 --> <!-- 确定对当前提现进行设为付款失败操作? -->
  69. Failed<!-- 设为付款失败 -->
  70. </el-dropdown-item>
  71. <el-dropdown-item command="status"
  72. @click.native="handleStatusShow(scope.row, 7, '确定对当前提现进行设为提现退回操作?', '提现退回备注')"
  73. v-show="scope.row.AUDIT_STATUS === '0' && permission.hasPermission(`finance/withdraw-status`)">
  74. Return <!-- 设为提现退回 -->
  75. </el-dropdown-item>
  76. <el-dropdown-item command="status"
  77. @click.native="handleStatusShow(scope.row, 7, '该会员已提供发票,请确认是否处理提现退回?', '提现退回备注')"
  78. v-show="(scope.row.AUDIT_STATUS === '1'||scope.row.AUDIT_STATUS === '2'||scope.row.AUDIT_STATUS === '3') && permission.hasPermission(`finance/withdraw-status`)">
  79. Return <!-- 设为提现退回 -->
  80. </el-dropdown-item>
  81. </el-dropdown-menu>
  82. </el-dropdown>
  83. </template>
  84. </el-table-column>
  85. </el-table>
  86. <div class="white-box-footer">
  87. <el-dropdown size="small" trigger="click" @command="handleMuli"
  88. v-if="filterStatus!=='-1' && filterStatus!=='7' && (permission.hasPermission(`finance/withdraw-status`))">
  89. <el-button type="primary" size="small">
  90. Selected data<!--所选数据--><i class="el-icon-arrow-down el-icon--right"></i>
  91. </el-button>
  92. <el-dropdown-menu v-if="filterStatus==='0'" slot="dropdown">
  93. <el-dropdown-item command="2">Batch audit passed</el-dropdown-item> <!-- 批量审核通过-->
  94. <el-dropdown-item command="7">Batch return</el-dropdown-item> <!-- 批量退回 -->
  95. </el-dropdown-menu>
  96. <el-dropdown-menu v-else-if="filterStatus==='2'" slot="dropdown">
  97. <el-dropdown-item command="3">批量设为待付款</el-dropdown-item>
  98. </el-dropdown-menu>
  99. <el-dropdown-menu v-else-if="filterStatus==='3'" slot="dropdown">
  100. <el-dropdown-item command="6">批量设为已付款</el-dropdown-item>
  101. <el-dropdown-item command="7">批量退回</el-dropdown-item>
  102. </el-dropdown-menu>
  103. <el-dropdown-menu v-else-if="filterStatus==='6'" slot="dropdown">
  104. <el-dropdown-item command="4">批量设为付款失败</el-dropdown-item>
  105. </el-dropdown-menu>
  106. <el-dropdown-menu v-else-if="filterStatus==='4'" slot="dropdown">
  107. <el-dropdown-item command="3">批量设为待付款</el-dropdown-item>
  108. </el-dropdown-menu>
  109. </el-dropdown>
  110. <el-button type="success" size="small" @click="handleExport"
  111. v-show="permission.hasPermission(`finance/transfer-list-export`)">Export Excel
  112. </el-button>
  113. <pagination :total="totalCount" :page_size="pageSize" @size-change="handleSizeChange"
  114. @current-change="handleCurrentChange"></pagination>
  115. <el-dialog title="修改提现信息" :visible.sync="dialogEditFormVisible">
  116. <el-form :model="form" label-width="150px" style="width:500px;" v-loading="dialogEditLoading">
  117. <el-form-item label="会员编号">
  118. <el-input v-model="form.baseInfo.USER_NAME" :disabled="true"></el-input>
  119. </el-form-item>
  120. <el-form-item label="会员姓名">
  121. <el-input v-model="form.baseInfo.REAL_NAME" :disabled="true"></el-input>
  122. </el-form-item>
  123. <el-form-item label="身份证号">
  124. <el-input v-model="form.baseInfo.ID_CARD" :disabled="true"></el-input>
  125. </el-form-item>
  126. <el-form-item label="注册类型">
  127. <el-select v-model="form.baseInfo.REG_TYPE" placeholder="请选择注册类型" :disabled="true">
  128. <el-option v-for="(item,key) in regTypes" :label="item.TYPE_NAME" :value="item.ID"
  129. :key="item.ID"></el-option>
  130. </el-select>
  131. </el-form-item>
  132. <el-form-item label="提现金额">
  133. <el-input v-model="form.amount" :disabled="true"></el-input>
  134. </el-form-item>
  135. <el-form-item label="Estimated date of payment"> <!-- 预计付款日期 -->
  136. <el-date-picker
  137. v-model="form.planPaidAt"
  138. type="date"
  139. placeholder="Select date"
  140. value-format="yyyy-MM-dd"
  141. :picker-options="pickerOptions0"
  142. >
  143. </el-date-picker>
  144. </el-form-item>
  145. <el-form-item label="Note"> <!-- 备注 -->
  146. <el-input v-model="form.createRemark"></el-input>
  147. </el-form-item>
  148. </el-form>
  149. <div slot="footer" class="dialog-footer">
  150. <el-button @click="dialogEditFormVisible = false">Cancel<!-- 取 消 --></el-button>
  151. <el-button type="primary" @click.native="handleEdit">Edit<!-- 修 改 --></el-button>
  152. </div>
  153. </el-dialog>
  154. <el-dialog title="Review withdrawal info" :visible.sync="dialogAuditFormVisible"> <!-- 审核提现信息 -->
  155. <el-alert
  156. :title="auditForm.auditTips"
  157. type="warning" :closable="false">
  158. </el-alert>
  159. <el-form :model="auditForm" label-width="150px" style="width:500px;" v-loading="dialogAuditLoading">
  160. <el-form-item label="Estimated date of payment" v-show="filterStatus==='2' || filterStatus==='4'"> <!-- 预计付款日期 -->
  161. <el-date-picker
  162. v-model="auditForm.planPaidAt"
  163. type="date"
  164. placeholder="Select date"
  165. value-format="yyyy-MM-dd"
  166. :picker-options="pickerOptions0"
  167. >
  168. </el-date-picker>
  169. </el-form-item>
  170. <el-form-item label="Date of payment" v-show="filterStatus==='3'"><!-- 付款日期 -->
  171. <el-date-picker
  172. v-model="auditForm.paidAt"
  173. type="date"
  174. placeholder="Select date"
  175. value-format="yyyy-MM-dd"
  176. :picker-options="pickerOptions1"
  177. >
  178. </el-date-picker>
  179. </el-form-item>
  180. <el-form-item :label="auditRemark">
  181. <el-input v-model="auditForm.createRemark"></el-input>
  182. </el-form-item>
  183. </el-form>
  184. <div slot="footer" class="dialog-footer">
  185. <el-button @click="dialogAuditFormVisible = false">Cancel<!-- 取 消 --></el-button>
  186. <el-button type="primary" @click.native="handleStatus">Submit<!-- 提 交 --></el-button>
  187. </div>
  188. </el-dialog>
  189. </div>
  190. </div>
  191. </div>
  192. </template>
  193. <script>
  194. import permission from '@/utils/permission'
  195. import network from '@/utils/network'
  196. import tool from '@/utils/tool'
  197. import FilterUser from '@/components/FilterUser'
  198. import baseInfo from '@/utils/baseInfo'
  199. import Pagination from '@/components/Pagination'
  200. import filterHelper from '../../utils/filterHelper'
  201. export default {
  202. name: 'finance_withdraw',
  203. components: {FilterUser, Pagination},
  204. data() {
  205. return {
  206. activeName: 'all',
  207. tableHeaders: null,
  208. baseDecLevels: baseInfo.decLevels(),
  209. allData: null,
  210. tableData: null,
  211. loading: true,
  212. multipleSelection: [],
  213. currentPage: 1,
  214. totalPages: 1,
  215. totalCount: 1,
  216. pageSize: 20,
  217. tool: tool,
  218. permission: permission,
  219. regTypes: baseInfo.regTypes(),
  220. dialogEditFormVisible: false,
  221. dialogEditLoading: false,
  222. dialogAuditFormVisible: false,
  223. dialogAuditLoading: false,
  224. dialogAddInvoiceVisible: false,
  225. dialogAddInvoiceLoading: false,
  226. auditId: null,
  227. form: {
  228. id: null,
  229. baseInfo: {USER_NAME: null, REG_TYPE: null},
  230. amount: null,
  231. planPaidAt: null,
  232. paidAt: new Date(),
  233. createRemark: null,
  234. },
  235. invoiceForm: {
  236. id: null,
  237. withdrawId: null,
  238. withdrawSn: null,
  239. invoiceCode: null,
  240. invoiceNum: null,
  241. invoiceDate: null,
  242. amount: null,
  243. taxRate: null,
  244. purchaserName: null,
  245. purchaserRegisterNum: null,
  246. purchaserAddress: null,
  247. purchaserBank: null,
  248. sellerName: null,
  249. sellerRegisterNum: null,
  250. sellerAddress: null,
  251. sellerBank: null,
  252. itemName: null,
  253. invoiceRemark: null,
  254. createRemark: null,
  255. },
  256. pickerOptions0: {
  257. disabledDate(time) {
  258. return time.getTime() < Date.now();
  259. }
  260. },
  261. pickerOptions1: {
  262. disabledDate(time) {
  263. return time.getTime() < Date.now() - 8.64e7;
  264. }
  265. },
  266. auditRemark: '',
  267. auditForm: {
  268. auditTips: '',
  269. auditStatus: null,
  270. selectedIds: [],
  271. planPaidAt: null,
  272. createRemark: null,
  273. withdrawAudit: '',
  274. },
  275. auditTips: '',
  276. filterTypes: {},
  277. filterModel: {},
  278. excelForm: {
  279. rowCount: '',
  280. },
  281. filterStatus: '0',
  282. }
  283. },
  284. mounted () {
  285. this.getData();
  286. /* if (permission.hasPermission(`finance/withdraw-7`)) {
  287. this.activeName = 'seven'
  288. }
  289. if (permission.hasPermission(`finance/withdraw-4`)) {
  290. this.activeName = 'four'
  291. }
  292. if (permission.hasPermission(`finance/withdraw-6`)) {
  293. this.activeName = 'six'
  294. }
  295. if (permission.hasPermission(`finance/withdraw-3`)) {
  296. this.activeName = 'three'
  297. }
  298. if (permission.hasPermission(`finance/withdraw-2`)) {
  299. this.activeName = 'two'
  300. }
  301. if (permission.hasPermission(`finance/withdraw-1`)) {
  302. this.activeName = 'one'
  303. }
  304. if (permission.hasPermission(`finance/withdraw-0`)) {
  305. this.activeName = 'zero'
  306. }
  307. if (permission.hasPermission(`finance/withdraw-0`) && permission.hasPermission(`finance/withdraw-1`) && permission.hasPermission(`finance/withdraw-2`) && permission.hasPermission(`finance/withdraw-3`) && permission.hasPermission(`finance/withdraw-6`) && permission.hasPermission(`finance/withdraw-4`) && permission.hasPermission(`finance/withdraw-7`)) {
  308. this.activeName = 'all'
  309. }*/
  310. },
  311. methods: {
  312. handleMuli(command) {
  313. if (this.multipleSelection.length < 1) {
  314. this.$message({
  315. message: '请选择要操作的记录',
  316. type: 'warning'
  317. })
  318. return;
  319. }
  320. this.handleAudit(null, command)
  321. },
  322. handleAudit(row = null, status) {
  323. let title = ''
  324. if (status === '2') {
  325. title = '确定要通过审核?备注:'
  326. }else if(status === '3'){
  327. title = '确定要设为待付款?备注:'
  328. }else if(status === '4'){
  329. title = '确定要设为付款失败?备注:'
  330. }else if(status === '6'){
  331. title = '确定要设为已付款?备注:'
  332. }else if(status === '7'){
  333. title = '确定要设为已退回?备注:'
  334. }
  335. this.handleStatusShow(row,status,title);
  336. },
  337. handleExpand(row, event, column) {
  338. this.$refs.multipleTable.toggleRowExpansion(row)
  339. },
  340. handleExport() {
  341. let filterData = this.filterModel
  342. // 如果有选中,导出选中ID,否则导出全部
  343. if (this.multipleSelection.length > 0) {
  344. let selectedIds = []
  345. for (let val of this.multipleSelection) {
  346. selectedIds.push(val.ID)
  347. }
  348. filterData.selectedIds = selectedIds
  349. }
  350. this.$confirm('确定要导出当前表格中的提现数据吗?', 'Hint', {
  351. confirmButtonText: 'confirm', // 确定
  352. cancelButtonText: 'cancel', // 取消
  353. type: 'warning'
  354. }).then(() => {
  355. return network.getData('finance/withdraw-export', filterData)
  356. }).then(response => {
  357. this.$message({
  358. message: response,
  359. type: 'success'
  360. })
  361. }).catch(response => {
  362. })
  363. },
  364. handleAdd() {
  365. this.$router.push({path: `/finance/withdraw-add`})
  366. },
  367. handleExcel() {
  368. },
  369. handleExcelPaidFalse() {
  370. window.open(CDN_BASE_URL + `/files/bonus_withdraw_paid_false.xlsx`)
  371. },
  372. handleEditShow(row) {
  373. this.dialogEditLoading = true
  374. this.auditId = row.ID
  375. this.dialogEditFormVisible = true
  376. let vueObj = this
  377. network.getData('finance/withdraw-get', {id: this.auditId}).then(response => {
  378. vueObj.dialogEditLoading = false
  379. vueObj.form = response
  380. })
  381. },
  382. handleEdit() {
  383. this.dialogEditFormVisible = false
  384. this.$message({
  385. message: '正在修改数据',
  386. type: 'info'
  387. })
  388. this.loading = true
  389. let path = 'finance/withdraw-edit'
  390. network.postData(path, this.form).then(response => {
  391. this.$message({
  392. message: response,
  393. type: 'success'
  394. })
  395. this.getData(this.currentPage, this.pageSize)
  396. }).catch(response => {
  397. })
  398. },
  399. handleStatusShow(row, status, title, remark = 'Note') { // 备注
  400. this.auditForm = {
  401. auditTips: '',
  402. auditStatus: null,
  403. selectedIds: [],
  404. planPaidAt: null,
  405. paidAt: new Date(),
  406. remark: null,
  407. }
  408. if (row === null) {
  409. for (let val of this.multipleSelection) {
  410. this.auditForm.selectedIds.push(val.ID)
  411. }
  412. } else {
  413. this.auditForm.selectedIds.push(row.ID)
  414. }
  415. if (this.auditForm.selectedIds.length === 0) {
  416. this.$message({
  417. message: '请选择数据',
  418. type: 'warning'
  419. })
  420. return
  421. }
  422. this.auditRemark = remark
  423. this.dialogAuditFormVisible = true
  424. this.auditForm.auditTips = title
  425. this.auditForm.auditStatus = status
  426. },
  427. handleStatus() {
  428. network.postData('finance/mult-point', {opType: 2}).then(response => {
  429. this.auditForm.withdrawAudit = response.withdrawAudit
  430. this.$confirm('Are you sure to change the state of the selected data?', 'Hint', { // 确定要对所选数据修改状态吗?
  431. confirmButtonText: 'confirm', // 确定
  432. cancelButtonText: 'cancel', // 取消
  433. type: 'warning'
  434. }).then(() => {
  435. return network.postData('finance/withdraw-status', this.auditForm)
  436. }).then(response => {
  437. this.dialogAuditFormVisible = false
  438. this.$message({
  439. message: response,
  440. type: 'success'
  441. })
  442. this.getData(this.currentPage, this.pageSize)
  443. }).catch(response => {
  444. this.dialogAuditFormVisible = false
  445. })
  446. })
  447. },
  448. handleAddInvoiceShow(row) {
  449. this.dialogAddInvoiceVisible = true
  450. this.auditId = row.INVOICE_ID
  451. this.dialogAddInvoiceLoading = true
  452. let vueObj = this
  453. network.getData('finance/invoice-audit-get', {id: this.auditId}).then(response => {
  454. vueObj.dialogAddInvoiceLoading = false
  455. vueObj.invoiceForm = response
  456. this.invoiceForm.withdrawSn = row.SN
  457. this.invoiceForm.withdrawId = row.ID
  458. })
  459. },
  460. handleAddInvoice() {
  461. let path = 'finance/invoice-audit-add'
  462. if (this.invoiceForm.id) path = 'finance/invoice-audit-edit'
  463. network.postData(path, this.invoiceForm).then(response => {
  464. this.$message({
  465. message: response,
  466. type: 'success'
  467. })
  468. this.dialogAddInvoiceVisible = false
  469. this.getData(this.currentPage, this.pageSize)
  470. }).catch(response => {
  471. })
  472. },
  473. handleSelectionChange(val) {
  474. this.multipleSelection = val
  475. },
  476. handleCurrentChange(page) {
  477. this.getData(page, this.pageSize)
  478. },
  479. handleSizeChange(pageSize) {
  480. this.getData(this.currentPage, pageSize)
  481. },
  482. handleFilterStatusClick(tab, event) {
  483. filterHelper.clearFilterOption(this)
  484. this.getData()
  485. },
  486. handleFilterUser(filterData) {
  487. filterHelper.handleFilterUser(this, filterData)
  488. },
  489. handleFilter() {
  490. this.getData()
  491. },
  492. getData(page, pageSize) {
  493. let filterData = this.filterModel
  494. filterData.filterStatus = this.filterStatus != '-1' ? `=,${this.filterStatus}` : ''
  495. let vueObj = this
  496. network.getPageData(this, 'finance/withdraw', page, pageSize, filterData, function (response) {
  497. vueObj.allData = response
  498. vueObj.filterTypes = response.filterTypes
  499. })
  500. },
  501. onMessageCallback() {
  502. this.getData(this.currentPage, this.pageSize)
  503. },
  504. }
  505. }
  506. </script>
  507. <style scoped>
  508. </style>