猫妈狗爸伴宠师小程序后端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

441 lines
15 KiB

1 month ago
1 month ago
1 week ago
2 weeks ago
1 week ago
2 weeks ago
1 day ago
1 month ago
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px" size="medium" class="ry_form">
  4. <el-form-item label="提现者姓名" prop="nameValue">
  5. <el-input
  6. v-model="queryParams.nameValue"
  7. placeholder="请输入提现者姓名"
  8. clearable
  9. size="small"
  10. @keyup.enter.native="handleQuery"
  11. />
  12. </el-form-item>
  13. <el-form-item label="审核状态" prop="auditStatus">
  14. <el-select v-model="queryParams.auditStatus" placeholder="请选择审核状态" clearable size="small">
  15. <el-option label="待审核" value="0" />
  16. <el-option label="审核通过" value="1" />
  17. <el-option label="审核不通过" value="2" />
  18. </el-select>
  19. </el-form-item>
  20. <el-form-item label="钱包类型" prop="moneyType">
  21. <el-select v-model="queryParams.moneyType" placeholder="请选择钱包类型" clearable size="small">
  22. <el-option
  23. v-for="dict in dict.type.money_type"
  24. :key="dict.value"
  25. :label="dict.label"
  26. :value="dict.value"
  27. />
  28. </el-select>
  29. </el-form-item>
  30. <el-form-item label="用户标识" prop="userId">
  31. <el-input
  32. v-model="queryParams.userId"
  33. placeholder="请输入用户标识"
  34. clearable
  35. size="small"
  36. @keyup.enter.native="handleQuery"
  37. />
  38. </el-form-item>
  39. <el-form-item class="flex_one tr">
  40. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  41. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  42. </el-form-item>
  43. </el-form>
  44. <el-row :gutter="10" class="mb8">
  45. <el-col :span="1.5">
  46. <el-button
  47. type="success"
  48. plain
  49. icon="el-icon-check"
  50. size="mini"
  51. :disabled="multiple"
  52. @click="handleBatchAudit(1)"
  53. v-hasPermi="['model:AppletAmountLog:audit']"
  54. >批量通过</el-button>
  55. </el-col>
  56. <el-col :span="1.5">
  57. <el-button
  58. type="danger"
  59. plain
  60. icon="el-icon-close"
  61. size="mini"
  62. :disabled="multiple"
  63. @click="handleBatchAudit(2)"
  64. v-hasPermi="['model:AppletAmountLog:audit']"
  65. >批量拒绝</el-button>
  66. </el-col>
  67. <el-col :span="1.5">
  68. <el-button
  69. type="warning"
  70. plain
  71. icon="el-icon-download"
  72. size="mini"
  73. :loading="exportLoading"
  74. @click="handleExport"
  75. v-hasPermi="['model:AppletAmountLog:export']"
  76. >导出</el-button>
  77. </el-col>
  78. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  79. </el-row>
  80. <el-table v-loading="loading" :data="AppletAmountLogList" @selection-change="handleSelectionChange">
  81. <el-table-column type="selection" width="55" align="center" />
  82. <el-table-column label="唯一标识" align="center" prop="id" />
  83. <el-table-column label="创建时间" align="center" prop="createTime" width="180" />
  84. <el-table-column label="提现者姓名" align="center" prop="nameValue" />
  85. <el-table-column label="用户标识" align="center" prop="userId" />
  86. <el-table-column label="标题" align="center" prop="title" />
  87. <el-table-column label="提现金额" align="center" prop="amount" width="120">
  88. <template slot-scope="scope">
  89. <span style="color: #f56c6c; font-weight: bold;">{{ scope.row.amount }}</span>
  90. </template>
  91. </el-table-column>
  92. <el-table-column label="钱包类型" align="center" prop="moneyType" width="100">
  93. <template slot-scope="scope">
  94. <dict-tag :options="dict.type.money_type" :value="scope.row.moneyType"/>
  95. </template>
  96. </el-table-column>
  97. <el-table-column label="审核状态" align="center" prop="auditStatus" width="100">
  98. <template slot-scope="scope">
  99. <el-tag v-if="scope.row.auditStatus == 0" type="warning">待审核</el-tag>
  100. <el-tag v-else-if="scope.row.auditStatus == 1" type="success">审核通过</el-tag>
  101. <el-tag v-else-if="scope.row.auditStatus == 2" type="danger">审核不通过</el-tag>
  102. <el-tag v-else type="info">未知状态</el-tag>
  103. </template>
  104. </el-table-column>
  105. <el-table-column label="处理状态" align="center" prop="state" width="100">
  106. <template slot-scope="scope">
  107. <el-tag v-if="scope.row.state == 0" type="warning">未到账</el-tag>
  108. <el-tag v-else-if="scope.row.state == 1" type="success">已到账</el-tag>
  109. <el-tag v-else-if="scope.row.state == 2" type="danger">失败</el-tag>
  110. <el-tag v-else type="info">未知</el-tag>
  111. </template>
  112. </el-table-column>
  113. <!-- <el-table-column label="提现参数" align="center" prop="packageInfo" width="200" show-overflow-tooltip /> -->
  114. <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="200">
  115. <template slot-scope="scope">
  116. <el-button
  117. size="mini"
  118. type="text"
  119. icon="el-icon-view"
  120. @click="handleView(scope.row)"
  121. v-hasPermi="['model:AppletAmountLog:view']"
  122. >查看</el-button>
  123. <el-button
  124. v-if="scope.row.auditStatus === 0"
  125. size="mini"
  126. type="text"
  127. icon="el-icon-check"
  128. @click="handleAudit(scope.row, 1)"
  129. v-hasPermi="['model:AppletAmountLog:audit']"
  130. style="color: #67C23A;"
  131. >通过</el-button>
  132. <el-button
  133. v-if="scope.row.auditStatus === 0"
  134. size="mini"
  135. type="text"
  136. icon="el-icon-close"
  137. @click="handleAudit(scope.row, 2)"
  138. v-hasPermi="['model:AppletAmountLog:audit']"
  139. style="color: #F56C6C;"
  140. >拒绝</el-button>
  141. </template>
  142. </el-table-column>
  143. </el-table>
  144. <pagination
  145. v-show="total>0"
  146. :total="total"
  147. :page.sync="queryParams.pageNum"
  148. :limit.sync="queryParams.pageSize"
  149. @pagination="getList"
  150. />
  151. <!-- 查看详情对话框 -->
  152. <el-dialog :title="title" :visible.sync="open" width="60%" append-to-body>
  153. <el-form ref="form" :model="form" label-width="120px" class="dialog-form-two">
  154. <el-row>
  155. <el-col :span="12">
  156. <el-form-item label="唯一标识">
  157. <el-input v-model="form.id" readonly />
  158. </el-form-item>
  159. </el-col>
  160. <el-col :span="12">
  161. <el-form-item label="创建时间">
  162. <el-input v-model="form.createTime" readonly />
  163. </el-form-item>
  164. </el-col>
  165. </el-row>
  166. <el-row>
  167. <el-col :span="12">
  168. <el-form-item label="提现者姓名">
  169. <el-input v-model="form.nameValue" readonly />
  170. </el-form-item>
  171. </el-col>
  172. <el-col :span="12">
  173. <el-form-item label="用户标识">
  174. <el-input v-model="form.userId" readonly />
  175. </el-form-item>
  176. </el-col>
  177. </el-row>
  178. <el-row>
  179. <el-col :span="12">
  180. <el-form-item label="标题">
  181. <el-input v-model="form.title" readonly />
  182. </el-form-item>
  183. </el-col>
  184. <el-col :span="12">
  185. <el-form-item label="提现金额">
  186. <el-input v-model="form.amount" readonly />
  187. </el-form-item>
  188. </el-col>
  189. </el-row>
  190. <el-row>
  191. <el-col :span="12">
  192. <el-form-item label="钱包类型">
  193. <dict-tag :options="dict.type.money_type" :value="form.moneyType"/>
  194. </el-form-item>
  195. </el-col>
  196. <el-col :span="12">
  197. <el-form-item label="审核状态">
  198. <el-tag v-if="form.auditStatus == 0" type="warning">待审核</el-tag>
  199. <el-tag v-else-if="form.auditStatus == 1" type="success">审核通过</el-tag>
  200. <el-tag v-else-if="form.auditStatus == 2" type="danger">审核不通过</el-tag>
  201. <el-tag v-else type="info">未知状态</el-tag>
  202. </el-form-item>
  203. </el-col>
  204. </el-row>
  205. <el-row>
  206. <el-col :span="12">
  207. <el-form-item label="处理状态">
  208. <el-tag v-if="form.state === 0" type="warning">处理中</el-tag>
  209. <el-tag v-else-if="form.state === 1" type="success">成功</el-tag>
  210. <el-tag v-else-if="form.state === 2" type="danger">失败</el-tag>
  211. <el-tag v-else type="info">未知</el-tag>
  212. </el-form-item>
  213. </el-col>
  214. <el-col :span="12">
  215. <el-form-item label="类型">
  216. <el-tag v-if="form.type === 0" type="success">收入</el-tag>
  217. <el-tag v-else-if="form.type === 1" type="warning">支出</el-tag>
  218. <el-tag v-else type="info">未知</el-tag>
  219. </el-form-item>
  220. </el-col>
  221. </el-row>
  222. <el-row v-if="form.auditRemark">
  223. <el-col :span="24">
  224. <el-form-item label="审核备注">
  225. <el-input v-model="form.auditRemark" type="textarea" rows="3" readonly />
  226. </el-form-item>
  227. </el-col>
  228. </el-row>
  229. <el-row v-if="form.errorInfo">
  230. <el-col :span="24">
  231. <el-form-item label="错误信息">
  232. {{ form.errorInfo }}
  233. </el-form-item>
  234. </el-col>
  235. </el-row>
  236. </el-form>
  237. <div slot="footer" class="dialog-footer">
  238. <el-button @click="cancel"> </el-button>
  239. </div>
  240. </el-dialog>
  241. <!-- 审核对话框 -->
  242. <el-dialog :title="auditTitle" :visible.sync="auditOpen" width="40%" append-to-body>
  243. <el-form ref="auditForm" :model="auditForm" :rules="auditRules" label-width="120px">
  244. <el-form-item label="审核状态">
  245. <el-tag v-if="auditForm.auditStatus === 1" type="success">通过</el-tag>
  246. <el-tag v-else-if="auditForm.auditStatus === 2" type="danger">不通过</el-tag>
  247. </el-form-item>
  248. <el-form-item label="审核备注" prop="auditRemark">
  249. <el-input v-model="auditForm.auditRemark" type="textarea" rows="4" placeholder="请输入审核备注" />
  250. </el-form-item>
  251. </el-form>
  252. <div slot="footer" class="dialog-footer">
  253. <el-button type="primary" @click="submitAudit"> </el-button>
  254. <el-button @click="cancelAudit"> </el-button>
  255. </div>
  256. </el-dialog>
  257. </div>
  258. </template>
  259. <script>
  260. import { listAppletAmountLog, getAppletAmountLog, exportAppletAmountLog, auditAppletAmountLog } from "@/api/model/AppletAmountLog";
  261. export default {
  262. name: "AppletAmountLogAudit",
  263. dicts: ['money_type'],
  264. data() {
  265. return {
  266. // 遮罩层
  267. loading: true,
  268. // 导出遮罩层
  269. exportLoading: false,
  270. // 选中数组
  271. ids: [],
  272. // 非多个禁用
  273. multiple: true,
  274. // 显示搜索条件
  275. showSearch: true,
  276. // 总条数
  277. total: 0,
  278. // 金额明细表格数据
  279. AppletAmountLogList: [],
  280. // 弹出层标题
  281. title: "",
  282. // 是否显示弹出层
  283. open: false,
  284. // 审核弹出层标题
  285. auditTitle: "",
  286. // 是否显示审核弹出层
  287. auditOpen: false,
  288. // 查询参数
  289. queryParams: {
  290. pageNum: 1,
  291. pageSize: 10,
  292. nameValue: null,
  293. auditStatus: null,
  294. moneyType: null,
  295. userId: null
  296. },
  297. // 表单参数
  298. form: {},
  299. // 审核表单参数
  300. auditForm: {},
  301. // 审核表单校验
  302. auditRules: {
  303. auditRemark: [
  304. // { required: true, message: "审核备注不能为空", trigger: "blur" }
  305. ]
  306. }
  307. };
  308. },
  309. created() {
  310. this.getList();
  311. },
  312. methods: {
  313. /** 查询提现审核列表 */
  314. getList() {
  315. this.loading = true;
  316. // 只查询提现类型的记录 (type=1表示支出,这里是提现记录)
  317. const params = { ...this.queryParams, type: 1, audit: true}
  318. listAppletAmountLog(params).then(response => {
  319. // 过滤出需要审核的提现记录(有auditStatus字段且nameValue不为空的记录)
  320. this.AppletAmountLogList = response.rows
  321. this.total = response.total;
  322. this.loading = false;
  323. });
  324. },
  325. // 取消按钮
  326. cancel() {
  327. this.open = false;
  328. this.reset();
  329. },
  330. // 表单重置
  331. reset() {
  332. this.form = {
  333. id: null,
  334. title: null,
  335. amount: null,
  336. type: null,
  337. userId: null,
  338. auditStatus: null,
  339. moneyType: null,
  340. nameValue: null,
  341. packageInfo: null,
  342. createTime: null,
  343. state: null,
  344. auditRemark: null
  345. };
  346. this.resetForm("form");
  347. },
  348. /** 搜索按钮操作 */
  349. handleQuery() {
  350. this.queryParams.pageNum = 1;
  351. this.getList();
  352. },
  353. /** 重置按钮操作 */
  354. resetQuery() {
  355. this.resetForm("queryForm");
  356. this.handleQuery();
  357. },
  358. // 多选框选中数据
  359. handleSelectionChange(selection) {
  360. this.ids = selection.map(item => item.id);
  361. this.multiple = !selection.length;
  362. },
  363. /** 查看按钮操作 */
  364. handleView(row) {
  365. this.reset();
  366. const id = row.id;
  367. getAppletAmountLog(id).then(response => {
  368. this.form = response.data;
  369. this.open = true;
  370. this.title = "查看提现详情";
  371. });
  372. },
  373. /** 审核按钮操作 */
  374. handleAudit(row, status) {
  375. this.auditForm = {
  376. id: row.id,
  377. auditStatus: status,
  378. auditRemark: ""
  379. };
  380. this.auditOpen = true;
  381. this.auditTitle = status === 1 ? "审核通过" : "审核拒绝";
  382. },
  383. /** 批量审核操作 */
  384. handleBatchAudit(status) {
  385. if (this.ids.length === 0) {
  386. this.$modal.msgError("请选择要审核的记录");
  387. return;
  388. }
  389. this.auditForm = {
  390. ids: this.ids,
  391. auditStatus: status,
  392. auditRemark: ""
  393. };
  394. this.auditOpen = true;
  395. this.auditTitle = status === 1 ? "批量审核通过" : "批量审核拒绝";
  396. },
  397. /** 提交审核 */
  398. submitAudit() {
  399. this.$refs["auditForm"].validate(valid => {
  400. if (valid) {
  401. auditAppletAmountLog(this.auditForm).then(response => {
  402. this.$modal.msgSuccess("审核成功");
  403. this.auditOpen = false;
  404. this.getList();
  405. });
  406. }
  407. });
  408. },
  409. /** 取消审核 */
  410. cancelAudit() {
  411. this.auditOpen = false;
  412. this.auditForm = {};
  413. },
  414. /** 导出按钮操作 */
  415. handleExport() {
  416. const queryParams = { ...this.queryParams, type: 1 };
  417. this.$modal.confirm('是否确认导出所有提现审核数据项?').then(() => {
  418. this.exportLoading = true;
  419. return exportAppletAmountLog(queryParams);
  420. }).then(response => {
  421. this.download(response.msg);
  422. this.exportLoading = false;
  423. }).catch(() => {});
  424. }
  425. }
  426. };
  427. </script>
  428. <style scoped>
  429. .el-tag {
  430. margin: 0 5px;
  431. }
  432. </style>