withdraw.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549
  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="$t('financial.all')" name="-1" :lazy="true"></el-tab-pane> <!-- 全部 -->
  6. <el-tab-pane :label="$t('financial.toBeReviewed')" name="0" :lazy="true"></el-tab-pane> <!-- 待审核 -->
  7. <el-tab-pane :label="$t('financial.reviewed')" name="2" :lazy="true"></el-tab-pane> <!-- 已审核 -->
  8. <el-tab-pane :label="$t('financial.toBePaid')" name="3" :lazy="true"></el-tab-pane> <!-- 待付款 -->
  9. <el-tab-pane :label="$t('financial.paid')" name="6" :lazy="true"></el-tab-pane> <!-- 已付款 -->
  10. <el-tab-pane :label="$t('financial.paymentFailed')" name="4" :lazy="true"></el-tab-pane> <!-- 付款失败 -->
  11. <el-tab-pane :label="$t('financial.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(true)">
  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="fixedColumn" :label="$t('financial.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. {{ $t('financial.action') }}<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, $t('financial.approveWithdrawalNotice'))"
  48. v-show="scope.row.AUDIT_STATUS==='0' && permission.hasPermission(`finance/withdraw-status`)"> <!-- 确定对当前提现进行审核通过操作? -->
  49. {{ $t('financial.approve') }} <!-- 审核通过 -->
  50. </el-dropdown-item>
  51. <el-dropdown-item command="status"
  52. @click.native="handleStatusShow(scope.row, 3, $t('financial.setWithdrawalPaymentAction'))"
  53. v-show="scope.row.AUDIT_STATUS === '2' && permission.hasPermission(`finance/withdraw-status`)"> <!-- 确定对当前提现进行设为待付款操作? -->
  54. {{ $t('financial.toBePaid') }}<!-- 设为待付款 -->
  55. </el-dropdown-item>
  56. <el-dropdown-item command="status"
  57. @click.native="handleStatusShow(scope.row, 6, $t('financial.setWithdrawalPaidNotice'))"
  58. v-show="scope.row.AUDIT_STATUS === '3' && permission.hasPermission(`finance/withdraw-status`)"> <!-- 确定对当前提现进行设为已付款操作 -->
  59. {{ $t('financial.paid') }}<!--设为已付款-->
  60. </el-dropdown-item>
  61. <el-dropdown-item command="status"
  62. @click.native="handleStatusShow(scope.row, 3, $t('financial.setWithdrawalPaymentAction'))"
  63. v-show="scope.row.AUDIT_STATUS === '4' && permission.hasPermission(`finance/withdraw-status`)"> <!-- 确定对当前提现进行设为待付款操作? -->
  64. {{ $t('financial.toBePaid') }}<!-- 设为待付款 -->
  65. </el-dropdown-item>
  66. <el-dropdown-item command="status"
  67. @click.native="handleStatusShow(scope.row, 4, $t('financial.setPayFailedWithdrawal'), $t('common.note'))"
  68. v-show="scope.row.AUDIT_STATUS === '6' && permission.hasPermission(`finance/withdraw-status`)"> <!-- 付款失败备注 --> <!-- 确定对当前提现进行设为付款失败操作? -->
  69. {{ $t('financial.withdrawSetFailed') }}<!-- 设为付款失败 -->
  70. </el-dropdown-item>
  71. <el-dropdown-item command="status"
  72. @click.native="handleStatusShow(scope.row, 7, $t('financial.setWithdrawalReturnNotice'), $t('financial.noteWithdrawalReturn'))"
  73. v-show="scope.row.AUDIT_STATUS === '0' && permission.hasPermission(`finance/withdraw-status`)"> <!-- 确定对当前提现进行设为提现退回操作? --> <!-- 提现退回备注 -->
  74. {{ $t('financial.withdrawSetReturn') }} <!-- 设为提现退回 -->
  75. </el-dropdown-item>
  76. <el-dropdown-item command="status"
  77. @click.native="handleStatusShow(scope.row, 7, $t('financial.memberInvoiceWithdrawalReturnNotice'), $t('financial.noteWithdrawalReturn'))"
  78. v-show="(scope.row.AUDIT_STATUS === '1'||scope.row.AUDIT_STATUS === '2'||scope.row.AUDIT_STATUS === '3') && permission.hasPermission(`finance/withdraw-status`)"><!-- 提现退回备注 -->
  79. {{ $t('financial.withdrawSetReturn') }} <!-- 该会员已提供发票,请确认是否处理提现退回 --> <!-- 设为提现退回 -->
  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 style="margin-right:10px;" 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. {{ $t('financial.selectedData') }}<!--所选数据--><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">{{ $t('financial.batchAuditPassed') }}</el-dropdown-item> <!-- 批量审核通过-->
  94. <el-dropdown-item command="7">{{ $t('financial.batchReturn') }}</el-dropdown-item> <!-- 批量退回 -->
  95. </el-dropdown-menu>
  96. <el-dropdown-menu v-else-if="filterStatus==='2'" slot="dropdown">
  97. <el-dropdown-item command="3">{{ $t('financial.batchSetToBePaid') }}</el-dropdown-item><!-- 批量设为待付款 -->
  98. </el-dropdown-menu>
  99. <el-dropdown-menu v-else-if="filterStatus==='3'" slot="dropdown">
  100. <el-dropdown-item command="6">{{ $t('financial.batchSetPaid') }}</el-dropdown-item><!--批量设为已付款-->
  101. <el-dropdown-item command="7">{{ $t('financial.batchReturn') }}</el-dropdown-item><!--批量退回-->
  102. </el-dropdown-menu>
  103. <el-dropdown-menu v-else-if="filterStatus==='6'" slot="dropdown">
  104. <el-dropdown-item command="4">{{ $t('financial.batchSetPaymentFailure') }}</el-dropdown-item><!--批量设为付款失败-->
  105. </el-dropdown-menu>
  106. <el-dropdown-menu v-else-if="filterStatus==='4'" slot="dropdown">
  107. <el-dropdown-item command="3">{{ $t('financial.batchSetToBePaid') }}</el-dropdown-item><!-- 批量设为待付款 -->
  108. </el-dropdown-menu>
  109. </el-dropdown>
  110. <el-button type="success" size="small" @click="handleExport" style="margin-right:10px;"
  111. v-show="permission.hasPermission(`finance/transfer-list-export`)">{{ $t('common.exportExcel') }}
  112. </el-button>
  113. <pagination :total="totalCount" :page_size="pageSize" :page_sizes="pageSizes" @size-change="handleSizeChange"
  114. @current-change="handleCurrentChange"></pagination>
  115. <el-dialog :title="$t('financial.modifyWithdrawalInfo')" :visible.sync="dialogEditFormVisible">
  116. <el-form :model="form" label-width="150px" v-loading="dialogEditLoading">
  117. <el-form-item :label="$t('financial.memberCode')">
  118. <el-input v-model="form.baseInfo.USER_NAME" :disabled="true"></el-input>
  119. </el-form-item>
  120. <el-form-item :label="$t('financial.memberName')">
  121. <el-input v-model="form.baseInfo.REAL_NAME" :disabled="true"></el-input>
  122. </el-form-item>
  123. <el-form-item :label="$t('financial.idCardNumber')">
  124. <el-input v-model="form.baseInfo.ID_CARD" :disabled="true"></el-input>
  125. </el-form-item>
  126. <el-form-item :label="$t('financial.registerType')">
  127. <el-select v-model="form.baseInfo.REG_TYPE" :placeholder="$t('financial.pleaseSelectRegisterType')" :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="$t('financial.withdrawAmount')">
  133. <el-input v-model="form.amount" :disabled="true"></el-input>
  134. </el-form-item>
  135. <el-form-item :label="$t('financial.estimatedDatePayment')" label-width="180"> <!-- 预计付款日期 -->
  136. <el-date-picker
  137. v-model="form.planPaidAt"
  138. type="date"
  139. :placeholder="$t('financial.selectDate')"
  140. value-format="yyyy-MM-dd"
  141. :picker-options="pickerOptions0"
  142. >
  143. </el-date-picker>
  144. </el-form-item>
  145. <el-form-item :label="$t('table.remark')"> <!-- 备注 -->
  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">{{ $t('common.cancel') }}<!-- 取 消 --></el-button>
  151. <el-button type="primary" @click.native="handleEdit">{{ $t('common.edit') }}<!-- 修 改 --></el-button>
  152. </div>
  153. </el-dialog><!--修改提现信息-->
  154. <el-dialog :title="$t('financial.reviewWithdrawalInfoNotice')" :visible.sync="dialogAuditFormVisible"> <!-- 审核提现信息 -->
  155. <el-alert
  156. :title="auditForm.auditTips"
  157. type="warning" :closable="false">
  158. </el-alert>
  159. <el-form :model="auditForm" v-loading="dialogAuditLoading">
  160. <el-form-item :label="$t('financial.estimatedDatePayment')" v-show="filterStatus==='2' || filterStatus==='4'"> <!-- 预计付款日期 -->
  161. <el-date-picker
  162. v-model="auditForm.planPaidAt"
  163. type="date"
  164. :placeholder="$t('financial.selectDate')"
  165. value-format="yyyy-MM-dd"
  166. :picker-options="pickerOptions0"
  167. >
  168. </el-date-picker>
  169. </el-form-item>
  170. <el-form-item :label="$t('financial.datePayment')" v-show="filterStatus==='3'"><!-- 付款日期 -->
  171. <el-date-picker
  172. v-model="auditForm.paidAt"
  173. type="date"
  174. :placeholder="$t('financial.selectDate')"
  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">{{ $t('common.cancel') }}<!-- 取 消 --></el-button>
  186. <el-button type="primary" @click.native="handleStatus">{{ $t('common.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 tool from '@/utils/tool'
  196. import FilterUser from '@/components/FilterUser'
  197. import baseInfo from '@/utils/baseInfo'
  198. import Pagination from '@/components/Pagination'
  199. import filterHelper from '@/utils/filterHelper'
  200. import { withdrawList, withdrawExport, multPoint, postWithdrawStatus } from '@/api/finance'
  201. import {getOperatingSystem} from "@/utils"
  202. export default {
  203. name: 'finance_withdraw',
  204. components: {FilterUser, Pagination},
  205. data () {
  206. return {
  207. fixedColumn:false, // 固定,当手机端不固定,pc固定
  208. activeName: 'all',
  209. tableHeaders: null,
  210. baseDecLevels: baseInfo.decLevels(),
  211. allData: null,
  212. tableData: null,
  213. loading: true,
  214. multipleSelection: [],
  215. currentPage: 1,
  216. totalPages: 1,
  217. totalCount: 1,
  218. pageSize: 20,
  219. pageSizes: [1, 2, 5, 10, 20, 50, 100],
  220. tool: tool,
  221. permission: permission,
  222. regTypes: baseInfo.regTypes(),
  223. dialogEditFormVisible: false,
  224. dialogEditLoading: false,
  225. dialogAuditFormVisible: false,
  226. dialogAuditLoading: false,
  227. dialogAddInvoiceVisible: false,
  228. dialogAddInvoiceLoading: false,
  229. auditId: null,
  230. form: {
  231. id: null,
  232. baseInfo: {USER_NAME: null, REG_TYPE: null},
  233. amount: null,
  234. planPaidAt: null,
  235. paidAt: new Date(),
  236. createRemark: null,
  237. },
  238. invoiceForm: {
  239. id: null,
  240. withdrawId: null,
  241. withdrawSn: null,
  242. invoiceCode: null,
  243. invoiceNum: null,
  244. invoiceDate: null,
  245. amount: null,
  246. taxRate: null,
  247. purchaserName: null,
  248. purchaserRegisterNum: null,
  249. purchaserAddress: null,
  250. purchaserBank: null,
  251. sellerName: null,
  252. sellerRegisterNum: null,
  253. sellerAddress: null,
  254. sellerBank: null,
  255. itemName: null,
  256. invoiceRemark: null,
  257. createRemark: null,
  258. },
  259. pickerOptions0: {
  260. disabledDate(time) {
  261. return time.getTime() < Date.now();
  262. }
  263. },
  264. pickerOptions1: {
  265. disabledDate(time) {
  266. return time.getTime() < Date.now() - 8.64e7;
  267. }
  268. },
  269. auditRemark: '',
  270. auditForm: {
  271. auditTips: '',
  272. auditStatus: null,
  273. selectedIds: [],
  274. planPaidAt: null,
  275. createRemark: null,
  276. withdrawAudit: '',
  277. },
  278. auditTips: '',
  279. filterTypes: {},
  280. filterModel: {},
  281. excelForm: {
  282. rowCount: '',
  283. },
  284. filterStatus: '0',
  285. }
  286. },
  287. mounted () {
  288. this.getData();
  289. let system = getOperatingSystem()
  290. if (system == "Android" || system == 'ios') {
  291. this.fixedColumn = false
  292. } else {
  293. this.fixedColumn = 'right'
  294. }
  295. // if (permission.hasPermission(`finance/withdraw-7`)) {
  296. // this.activeName = 'seven'
  297. // }
  298. // if (permission.hasPermission(`finance/withdraw-4`)) {
  299. // this.activeName = 'four'
  300. // }
  301. // if (permission.hasPermission(`finance/withdraw-6`)) {
  302. // this.activeName = 'six'
  303. // }
  304. // if (permission.hasPermission(`finance/withdraw-3`)) {
  305. // this.activeName = 'three'
  306. // }
  307. // if (permission.hasPermission(`finance/withdraw-2`)) {
  308. // this.activeName = 'two'
  309. // }
  310. // if (permission.hasPermission(`finance/withdraw-1`)) {
  311. // this.activeName = 'one'
  312. // }
  313. // if (permission.hasPermission(`finance/withdraw-0`)) {
  314. // this.activeName = 'zero'
  315. // }
  316. // 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`)) {
  317. // this.activeName = 'all'
  318. // }
  319. },
  320. methods: {
  321. handleMuli (command) {
  322. if (this.multipleSelection.length < 1) {
  323. this.$message({
  324. message: this.$t('financial.selectRecordOperateNotice'), // 请选择要操作的记录
  325. type: 'warning'
  326. })
  327. return;
  328. }
  329. this.handleAudit(null, command)
  330. },
  331. handleAudit (row = null, status) {
  332. let title = ''
  333. if (status === '2') {
  334. title = this.$t('financial.surePassReviewNoteNotice') // 确定要通过审核?备注:
  335. }else if(status === '3') {
  336. title = this.$t('financial.sureUnpaidReviewNotice') // 确定要设为待付款?备注:
  337. }else if(status === '4') {
  338. title = this.$t('financial.surePaymentFailureReview')// 确定要设为付款失败?备注:
  339. }else if(status === '6') {
  340. title = this.$t('financial.surePaidReviewNotice')// 确定要设为已付款?备注:
  341. }else if(status === '7') {
  342. title = this.$t('financial.sureReturnReviewNotice')//确定要设为已退回?备注:
  343. }
  344. this.handleStatusShow(row,status,title);
  345. },
  346. handleExpand (row, event, column) {
  347. this.$refs.multipleTable.toggleRowExpansion(row)
  348. },
  349. handleExport () {
  350. let filterData = this.filterModel
  351. // 如果有选中,导出选中ID,否则导出全部
  352. if (this.multipleSelection.length > 0) {
  353. let selectedIds = []
  354. for (let val of this.multipleSelection) {
  355. selectedIds.push(val.ID)
  356. }
  357. filterData.selectedIds = selectedIds
  358. }
  359. this.$confirm(this.$t('financial.exportNotice'), this.$t('common.hint'), {
  360. confirmButtonText: this.$t('common.confirm'), // 确定
  361. cancelButtonText: this.$t('common.cancel'), // 取消
  362. type: 'warning'
  363. }).then(() => {
  364. withdrawExport(filterData).then(response => {
  365. this.$message({
  366. message: response.data,
  367. type: 'success'
  368. })
  369. }).catch(err => {
  370. this.$message({
  371. message: err,
  372. type: 'error'
  373. })
  374. })
  375. })
  376. },
  377. handleAdd () {
  378. this.$router.push({path: `/finance/withdraw-add`})
  379. },
  380. handleExcel () {
  381. },
  382. handleExcelPaidFalse () {
  383. window.open(CDN_BASE_URL + `/files/bonus_withdraw_paid_false.xlsx`)
  384. },
  385. handleEditShow (row) {
  386. this.dialogEditLoading = true
  387. this.auditId = row.ID
  388. this.dialogEditFormVisible = true
  389. let vueObj = this
  390. network.getData('finance/withdraw-get', {id: this.auditId}).then(response => {
  391. vueObj.dialogEditLoading = false
  392. vueObj.form = response
  393. })
  394. },
  395. handleEdit () {
  396. this.dialogEditFormVisible = false
  397. this.$message({
  398. message: this.$t('financial.modifyData'),//正在修改数据
  399. type: 'info'
  400. })
  401. this.loading = true
  402. let path = 'finance/withdraw-edit'
  403. network.postData(path, this.form).then(response => {
  404. this.$message({
  405. message: response,
  406. type: 'success'
  407. })
  408. this.getData(this.currentPage, this.pageSize)
  409. }).catch(response => {
  410. })
  411. },
  412. handleStatusShow(row, status, title, remark = this.$t('table.remark')) { // 备注
  413. this.auditForm = {
  414. auditTips: '',
  415. auditStatus: null,
  416. selectedIds: [],
  417. planPaidAt: null,
  418. paidAt: new Date(),
  419. remark: null,
  420. }
  421. if (row === null) {
  422. for (let val of this.multipleSelection) {
  423. this.auditForm.selectedIds.push(val.ID)
  424. }
  425. } else {
  426. this.auditForm.selectedIds.push(row.ID)
  427. }
  428. if (this.auditForm.selectedIds.length === 0) {
  429. this.$message({
  430. message: this.$t('financial.selectRecordOperateNotice'),// 请选择数据
  431. type: 'warning'
  432. })
  433. return
  434. }
  435. this.auditRemark = remark
  436. this.dialogAuditFormVisible = true
  437. this.auditForm.auditTips = title
  438. this.auditForm.auditStatus = status
  439. },
  440. handleStatus () {
  441. multPoint({opType: 2}).then(response => {
  442. this.auditForm.withdrawAudit = response.data.withdrawAudit
  443. this.$confirm(this.$t('financial.changeStateSelectedDataNotice'), this.$t('common.hint'), {
  444. confirmButtonText: this.$t('common.confirm'),
  445. cancelButtonText: this.$t('common.cancel'),
  446. type: 'warning'
  447. }).then(() => {
  448. postWithdrawStatus(this.auditForm).then(response => {
  449. this.dialogAuditFormVisible = false
  450. this.$message({
  451. message: response.data,
  452. type: 'success'
  453. })
  454. this.getData(this.currentPage, this.pageSize)
  455. }).catch(err => {
  456. this.dialogAuditFormVisible = false
  457. this.$message({
  458. message: err,
  459. type: 'error'
  460. })
  461. })
  462. })
  463. })
  464. },
  465. handleAddInvoiceShow (row) {
  466. this.dialogAddInvoiceVisible = true
  467. this.auditId = row.INVOICE_ID
  468. this.dialogAddInvoiceLoading = true
  469. let vueObj = this
  470. network.getData('finance/invoice-audit-get', {id: this.auditId}).then(response => {
  471. vueObj.dialogAddInvoiceLoading = false
  472. vueObj.invoiceForm = response
  473. this.invoiceForm.withdrawSn = row.SN
  474. this.invoiceForm.withdrawId = row.ID
  475. })
  476. },
  477. handleAddInvoice () {
  478. let path = 'finance/invoice-audit-add'
  479. if (this.invoiceForm.id) path = 'finance/invoice-audit-edit'
  480. network.postData(path, this.invoiceForm).then(response => {
  481. this.$message({
  482. message: response,
  483. type: 'success'
  484. })
  485. this.dialogAddInvoiceVisible = false
  486. this.getData(this.currentPage, this.pageSize)
  487. }).catch(response => {
  488. })
  489. },
  490. handleSelectionChange(val) {
  491. this.multipleSelection = val
  492. },
  493. handleCurrentChange(page) {
  494. this.getData(page, this.pageSize)
  495. },
  496. handleSizeChange(pageSize) {
  497. this.getData(this.currentPage, pageSize)
  498. },
  499. handleFilterStatusClick(tab, event) {
  500. filterHelper.clearFilterOption(this)
  501. this.getData()
  502. },
  503. handleFilterUser(filterData) {
  504. filterHelper.handleFilterUser(this, filterData)
  505. },
  506. handleFilter() {
  507. this.getData()
  508. },
  509. getData(page, pageSize) {
  510. let filterData = this.filterModel
  511. filterData.filterStatus = this.filterStatus != '-1' ? `=,${this.filterStatus}` : ''
  512. let vueObj = this
  513. const paramsData = Object.assign({
  514. page: (page === null || page == undefined) ? 1 : page,
  515. pageSize: (pageSize === null || pageSize == undefined) ? vueObj.pageSize : pageSize
  516. }, filterData)
  517. withdrawList(paramsData).then(response => {
  518. vueObj.tableHeaders = response.data.columnsShow ? response.data.columnsShow : []
  519. vueObj.tableData = response.data.list
  520. vueObj.filterTypes = response.data.filterTypes
  521. vueObj.currentPage = page
  522. vueObj.totalPages = parseInt(response.data.totalPages)
  523. vueObj.totalCount = parseInt(response.data.totalCount)
  524. vueObj.pageSize = pageSize
  525. this.loading = false
  526. }).catch(err => {
  527. console.log('err=============' + err)
  528. this.loading = false
  529. })
  530. },
  531. onMessageCallback() {
  532. this.getData(this.currentPage, this.pageSize)
  533. },
  534. }
  535. }
  536. </script>
  537. <style scoped>
  538. /deep/ .el-date-editor.el-input {
  539. width:100% !important;
  540. }
  541. </style>