index.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
  4. <el-form-item label="订单号" prop="orderno">
  5. <el-input
  6. v-model="queryParams.orderno"
  7. placeholder="请输入订单号"
  8. clearable
  9. @keyup.enter.native="handleQuery"
  10. />
  11. </el-form-item>
  12. <el-form-item label="账号类型" prop="type">
  13. <el-select v-model="queryParams.type" placeholder="请选择账号类型" clearable>
  14. <el-option
  15. v-for="dict in dict.type.app_user_cash_account"
  16. :key="dict.value"
  17. :label="dict.label"
  18. :value="dict.value"
  19. />
  20. </el-select>
  21. </el-form-item>
  22. <el-form-item label="用户ID" prop="uid">
  23. <el-input
  24. v-model="queryParams.uid"
  25. placeholder="请输入用户ID"
  26. clearable
  27. @keyup.enter.native="handleQuery"
  28. />
  29. </el-form-item>
  30. <el-form-item label="日期" prop="time">
  31. <el-date-picker
  32. v-model="daterange"
  33. style="width: 240px"
  34. value-format="yyyy-MM-dd"
  35. type="daterange"
  36. range-separator="-"
  37. start-placeholder="开始日期"
  38. end-placeholder="结束日期"
  39. @change="dateChage"
  40. ></el-date-picker>
  41. </el-form-item>
  42. <el-form-item>
  43. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  44. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  45. <el-button type="primary" size="mini" @click="reshData">{{reshBtn}}</el-button> <span style="font-size: 12px;color: red;">开启后10秒刷新一次</span>
  46. </el-form-item>
  47. </el-form>
  48. <el-row :gutter="10" class="mb8">
  49. <el-col :span="1.5">
  50. <el-button
  51. type="primary"
  52. plain
  53. icon="el-icon-plus"
  54. size="mini"
  55. @click="handleAdd"
  56. v-hasPermi="['business:cashrecord:add']"
  57. >新增</el-button>
  58. </el-col>
  59. <el-col :span="1.5">
  60. <el-button
  61. type="danger"
  62. plain
  63. icon="el-icon-delete"
  64. size="mini"
  65. :disabled="multiple"
  66. @click="handleDelete"
  67. v-hasPermi="['business:cashrecord:remove']"
  68. >删除</el-button>
  69. </el-col>
  70. <el-col :span="1.5">
  71. <el-button
  72. type="warning"
  73. plain
  74. icon="el-icon-download"
  75. size="mini"
  76. @click="handleExport"
  77. v-hasPermi="['business:cashrecord:export']"
  78. >导出</el-button>
  79. </el-col>
  80. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  81. </el-row>
  82. <el-table v-loading="loading" :data="cashrecordList" @selection-change="handleSelectionChange">
  83. <el-table-column type="selection" width="55" align="center" />
  84. <el-table-column fixed label="id" align="center" prop="id" />
  85. <el-table-column fixed label="UID" align="center" prop="uid" />
  86. <el-table-column fixed label="流水号" align="center" prop="orderno" />
  87. <el-table-column fixed label="订单号" align="center" prop="tradeNo" />
  88. <el-table-column label="货币单位类型" align="center" prop="unitType">
  89. <template slot-scope="scope">
  90. <dict-tag :options="dict.type.app_user_cash_unit" :value="scope.row.unitType"/>
  91. </template>
  92. </el-table-column>
  93. <el-table-column label="提现数量" align="center" prop="votes" />
  94. <el-table-column label="提现金额" align="center" prop="money" />
  95. <el-table-column label="实际到账金额" align="center" prop="actualMoney" />
  96. <el-table-column label="提现前金额" align="center" prop="beforeAmount" />
  97. <el-table-column label="提现后剩余余额" align="center" prop="afterAmount" />
  98. <el-table-column label="服务费" align="center" prop="service" />
  99. <el-table-column label="状态" align="center" prop="status">
  100. <template slot-scope="scope">
  101. <dict-tag :options="dict.type.app_user_cash_status" :value="scope.row.status"/>
  102. </template>
  103. </el-table-column>
  104. <el-table-column label="转出状态" align="center" prop="cashOutStatus">
  105. <template slot-scope="scope">
  106. <dict-tag :options="dict.type.app_user_cash_out_status" :value="scope.row.cashOutStatus"/>
  107. </template>
  108. </el-table-column>
  109. <el-table-column label="申请时间" align="center" prop="addtime" width="180">
  110. <template slot-scope="scope">
  111. <span>{{ parseTime(scope.row.addtime) }}</span>
  112. </template>
  113. </el-table-column>
  114. <el-table-column label="账号类型" align="center" prop="type">
  115. <template slot-scope="scope">
  116. <dict-tag :options="dict.type.app_user_cash_account" :value="scope.row.type"/>
  117. </template>
  118. </el-table-column>
  119. <el-table-column label="转出备注" align="center" prop="cashOutRemark" />
  120. <el-table-column label="审核人" align="center" prop="auditby" />
  121. <el-table-column label="银行名称" align="center" prop="accountBank" />
  122. <el-table-column label="账号" align="center" prop="account" />
  123. <el-table-column label="姓名" align="center" prop="name" />
  124. <el-table-column label="审核备注" align="center" prop="reason" />
  125. <el-table-column label="备注" align="center" prop="remarks" />
  126. <el-table-column fixed="right" label="操作" align="center" class-name="small-padding fixed-width">
  127. <template slot-scope="scope">
  128. <el-button
  129. size="mini"
  130. type="text"
  131. icon="el-icon-edit"
  132. @click="handleUpdate(scope.row,0)"
  133. v-hasPermi="['business:cashrecord:edit']"
  134. v-if="scope.row.status == 0"
  135. >审核</el-button>
  136. <el-button
  137. size="mini"
  138. type="text"
  139. icon="el-icon-edit"
  140. @click="handleUpdate(scope.row,1)"
  141. v-hasPermi="['business:cashrecord:edit']"
  142. v-if="scope.row.status == 0 || scope.row.cashOutStatus == 2"
  143. >人工审核</el-button>
  144. <el-button
  145. size="mini"
  146. type="text"
  147. icon="el-icon-delete"
  148. @click="handleDelete(scope.row)"
  149. v-hasPermi="['business:cashrecord:remove']"
  150. >删除</el-button>
  151. </template>
  152. </el-table-column>
  153. </el-table>
  154. <pagination
  155. v-show="total>0"
  156. :total="total"
  157. :page.sync="queryParams.pageNum"
  158. :limit.sync="queryParams.pageSize"
  159. @pagination="getList"
  160. />
  161. <!-- 添加或修改提现记录对话框 -->
  162. <el-dialog :title="title" :visible.sync="open" width="70%" append-to-body>
  163. <el-form ref="form" :model="form" :rules="rules" label-width="80px">
  164. <el-form-item label="id" prop="cashOutRemark">
  165. <el-input v-model="form.id" type="textarea" placeholder="请输入内容" disabled/>
  166. </el-form-item>
  167. <el-form-item label="用户ID" prop="uid">
  168. <el-input disabled v-model="form.uid" placeholder="请输入用户ID" />
  169. </el-form-item>
  170. <el-form-item label="流水号" prop="orderno">
  171. <el-input disabled v-model="form.orderno" placeholder="请输入订单号" />
  172. </el-form-item>
  173. <el-form-item label="订单号" prop="tradeNo">
  174. <el-input disabled v-model="form.tradeNo" placeholder="请输入订单号" />
  175. </el-form-item>
  176. <el-form-item label="提现数量" prop="votes">
  177. <el-input disabled v-model="form.votes" placeholder="请输入提现数量(所有类型cash_type都有值)" />
  178. </el-form-item>
  179. <el-form-item label="提现金额" prop="money">
  180. <el-input disabled v-model="form.money" placeholder="请输入提现金额" />
  181. </el-form-item>
  182. <el-form-item label="服务费" prop="service">
  183. <el-input disabled v-model="form.service" placeholder="请输入服务费" />
  184. </el-form-item>
  185. <el-form-item label="转出备注" prop="cashOutRemark">
  186. <el-input disabled v-model="form.cashOutRemark" type="textarea" placeholder="" />
  187. </el-form-item>
  188. <el-form-item label="账号类型" prop="type">
  189. <el-select disabled v-model="form.type" placeholder="请选择账号类型">
  190. <el-option
  191. v-for="dict in dict.type.app_user_cash_account"
  192. :key="dict.value"
  193. :label="dict.label"
  194. :value="dict.value"
  195. ></el-option>
  196. </el-select>
  197. </el-form-item>
  198. <el-form-item label="姓名" prop="name">
  199. <el-input disabled v-model="form.name" placeholder="请输入姓名" />
  200. </el-form-item>
  201. <el-form-item label="提现渠道" prop="accountType">
  202. <el-select v-model="form.cashChannelId" placeholder="请选择提现渠道">
  203. <el-option
  204. v-for="item in typeList"
  205. :key="item.value"
  206. :label="item.label"
  207. :value="item.value"
  208. ></el-option>
  209. </el-select>
  210. </el-form-item>
  211. <el-form-item label="状态" prop="status">
  212. <el-select v-model="form.status" placeholder="请选择状态 0:审核中 1:审核通过 2:审核拒绝">
  213. <el-option
  214. v-for="dict in dict.type.app_user_cash_status"
  215. :key="dict.value"
  216. :label="dict.label"
  217. :value="dict.value"
  218. ></el-option>
  219. </el-select>
  220. </el-form-item>
  221. <el-form-item label="审核备注" prop="reason">
  222. <el-input v-model="form.reason" placeholder="请输入审核备注" />
  223. </el-form-item>
  224. </el-form>
  225. <div slot="footer" class="dialog-footer">
  226. <el-button type="primary" @click="submitForm">确 定</el-button>
  227. <el-button @click="cancel">取 消</el-button>
  228. </div>
  229. </el-dialog>
  230. </div>
  231. </template>
  232. <script>
  233. import { listCashrecord, getCashrecord, delCashrecord, addCashrecord, updateCashrecord } from "@/api/business/cashrecord";
  234. import {channelList } from "@/api/business/charge";
  235. export default {
  236. name: "Cashrecord",
  237. dicts: ['app_user_cash_unit', 'app_user_cash_status', 'app_cash_type', 'app_user_cash_account','app_user_cash_out_status'],
  238. data() {
  239. return {
  240. // 遮罩层
  241. loading: true,
  242. // 选中数组
  243. ids: [],
  244. // 非单个禁用
  245. single: true,
  246. // 非多个禁用
  247. multiple: true,
  248. // 显示搜索条件
  249. showSearch: true,
  250. // 总条数
  251. total: 0,
  252. // 提现记录表格数据
  253. cashrecordList: [],
  254. // 弹出层标题
  255. title: "",
  256. // 是否显示弹出层
  257. open: false,
  258. daterange:[],
  259. reshBtn:"开启自动刷新",
  260. reshTimer:null,
  261. typeList:[],
  262. typeMap:{},
  263. // 查询参数
  264. queryParams: {
  265. pageNum: 1,
  266. pageSize: 10,
  267. cashType: null,
  268. orderno: null,
  269. type: null,
  270. uid: null,
  271. beginTime:null,
  272. endTime:null
  273. },
  274. // 表单参数
  275. form: {},
  276. // 表单校验
  277. rules: {
  278. }
  279. };
  280. },
  281. created() {
  282. this.getList();
  283. },
  284. methods: {
  285. reshData(){
  286. let that = this;
  287. if(!that.reshTimer){
  288. that.reshTimer = setInterval(function (){
  289. that.getList();
  290. },10000)
  291. that.reshBtn = "关闭自动刷新";
  292. }else{
  293. clearInterval(that.reshTimer);
  294. that.reshTimer = null;
  295. that.reshBtn = "开启自动刷新";
  296. }
  297. },
  298. dateChage(val){
  299. if(undefined != val && null != val && val.length > 1){
  300. this.queryParams.beginTime = val[0];
  301. this.queryParams.endTime = val[1];
  302. }else{
  303. this.queryParams.beginTime = null;
  304. this.queryParams.endTime = null;
  305. }
  306. },
  307. /** 查询提现记录列表 */
  308. getList() {
  309. this.loading = true;
  310. listCashrecord(this.queryParams).then(response => {
  311. this.cashrecordList = response.rows;
  312. this.total = response.total;
  313. this.loading = false;
  314. });
  315. },
  316. // 取消按钮
  317. cancel() {
  318. this.open = false;
  319. this.reset();
  320. },
  321. // 表单重置
  322. reset() {
  323. this.form = {
  324. id: null,
  325. account: null,
  326. accountBank: null,
  327. actualMoney: null,
  328. addtime: null,
  329. afterAmount: null,
  330. auditby: null,
  331. beforeAmount: null,
  332. cashOutBizNo: null,
  333. cashOutOrderId: null,
  334. cashOutPayOrderId: null,
  335. cashOutRemark: null,
  336. cashOutStatus: null,
  337. cashType: null,
  338. guildId: null,
  339. money: null,
  340. name: null,
  341. orderno: null,
  342. platformService: null,
  343. reason: null,
  344. remarks: null,
  345. service: null,
  346. status: null,
  347. statusName: null,
  348. tradeNo: null,
  349. type: null,
  350. uid: null,
  351. unitType: null,
  352. uptime: null,
  353. votes: null,
  354. callOther:0,
  355. accountType:null
  356. };
  357. this.resetForm("form");
  358. },
  359. /** 搜索按钮操作 */
  360. handleQuery() {
  361. this.queryParams.pageNum = 1;
  362. this.getList();
  363. },
  364. /** 重置按钮操作 */
  365. resetQuery() {
  366. this.resetForm("queryForm");
  367. this.daterange = [];
  368. this.queryParams.beginTime = null;
  369. this.queryParams.endTime = null;
  370. this.handleQuery();
  371. },
  372. // 多选框选中数据
  373. handleSelectionChange(selection) {
  374. this.ids = selection.map(item => item.id)
  375. this.single = selection.length!==1
  376. this.multiple = !selection.length
  377. },
  378. /** 新增按钮操作 */
  379. handleAdd() {
  380. this.reset();
  381. this.open = true;
  382. this.title = "添加提现记录";
  383. },
  384. /** 修改按钮操作 */
  385. handleUpdate(row,calOther) {
  386. if(!calOther){
  387. calOther = 0;
  388. }
  389. let that = this;
  390. this.reset();
  391. const id = row.id || this.ids
  392. getCashrecord(id).then(response => {
  393. this.form = response.data;
  394. this.form["cashChannelId"] = null;
  395. this.form["callOther"] = calOther;
  396. // if(calOther == 0){
  397. if(!this.form.accountType){
  398. this.open = true;
  399. }else{
  400. that.typeList = [];
  401. channelList({type:this.form.accountType}).then(response => {
  402. if(response.data){
  403. for(var i in response.data){
  404. var item = response.data[i];
  405. that.typeMap[item.id.toString()] = item.name;
  406. that.typeList.push({
  407. value:item.id,
  408. label:item.name
  409. })
  410. }
  411. }
  412. this.open = true;
  413. })
  414. }
  415. /*}else{
  416. this.open = true;
  417. }*/
  418. this.title = calOther==0?"审核":"人工审核";
  419. });
  420. },
  421. /** 提交按钮 */
  422. submitForm() {
  423. this.$refs["form"].validate(valid => {
  424. if (valid) {
  425. const loading = this.$loading({
  426. lock: true,
  427. text: 'Loading',
  428. spinner: 'el-icon-loading',
  429. background: 'rgba(0, 0, 0, 0.7)'
  430. });
  431. if (this.form.id != null) {
  432. updateCashrecord(this.form).then(response => {
  433. this.$modal.msgSuccess("修改成功");
  434. this.open = false;
  435. loading.close();
  436. this.getList();
  437. }).catch(e=>{
  438. loading.close();
  439. });
  440. } else {
  441. addCashrecord(this.form).then(response => {
  442. this.$modal.msgSuccess("新增成功");
  443. this.open = false;
  444. loading.close();
  445. this.getList();
  446. }).catch(e=>{
  447. loading.close();
  448. });
  449. }
  450. }
  451. });
  452. },
  453. /** 删除按钮操作 */
  454. handleDelete(row) {
  455. const ids = row.id || this.ids;
  456. this.$modal.confirm('是否确认删除提现记录编号为"' + ids + '"的数据项?').then(function() {
  457. return delCashrecord(ids);
  458. }).then(() => {
  459. this.getList();
  460. this.$modal.msgSuccess("删除成功");
  461. }).catch(() => {});
  462. },
  463. /** 导出按钮操作 */
  464. handleExport() {
  465. this.download('business/cashrecord/export', {
  466. ...this.queryParams
  467. }, `cashrecord_${new Date().getTime()}.xlsx`)
  468. }
  469. }
  470. };
  471. </script>