index.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
  4. <el-form-item label="会员昵称" prop="nickname">
  5. <el-input
  6. v-model="queryParams.nickname"
  7. placeholder="请输入会员昵称"
  8. clearable
  9. size="small"
  10. @keyup.enter.native="handleQuery"
  11. />
  12. </el-form-item>
  13. <el-form-item label="手机号码" prop="phone">
  14. <el-input
  15. v-model="queryParams.phone"
  16. placeholder="请输入手机号码"
  17. clearable
  18. size="small"
  19. @keyup.enter.native="handleQuery"
  20. />
  21. </el-form-item>
  22. <el-form-item label="提交时间" prop="createTime">
  23. <el-date-picker clearable size="small" style="width: 205.4px"
  24. v-model="queryParams.createTime"
  25. type="date"
  26. value-format="yyyy-MM-dd"
  27. placeholder="选择提交时间">
  28. </el-date-picker>
  29. </el-form-item>
  30. <el-form-item label="状态" prop="status">
  31. <el-select style="width: 200px" v-model="queryParams.status" placeholder="请选择状态" clearable size="small" >
  32. <el-option
  33. v-for="item in statusOptions"
  34. :key="item.dictValue"
  35. :label="item.dictLabel"
  36. :value="item.dictValue"
  37. />
  38. </el-select>
  39. </el-form-item>
  40. <el-form-item>
  41. <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  42. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  43. </el-form-item>
  44. </el-form>
  45. <!-- <el-row :gutter="10" class="mb8">
  46. <el-col :span="1.5">
  47. <el-button
  48. type="warning"
  49. icon="el-icon-download"
  50. size="mini"
  51. @click="handleExport"
  52. v-hasPermi="['store:userExtract:export']"
  53. >导出</el-button>
  54. </el-col>
  55. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  56. </el-row> -->
  57. <el-table height="500" border v-loading="loading" :data="userExtractList" @selection-change="handleSelectionChange">
  58. <el-table-column type="selection" width="55" align="center" />
  59. <el-table-column label="ID" align="center" prop="id" />
  60. <el-table-column label="会员昵称" align="center" prop="nickname" />
  61. <el-table-column label="会员手机号" align="center" prop="phone" />
  62. <el-table-column label="提现类型" align="center" prop="extractType" />
  63. <!-- <el-table-column label="银行卡" align="center" prop="bankCode" />
  64. <el-table-column label="开户地址" align="center" prop="bankAddress" />
  65. <el-table-column label="支付宝账号" align="center" prop="alipayCode" /> -->
  66. <el-table-column label="提现金额" align="center" prop="extractPrice" />
  67. <el-table-column label="余额" align="center" prop="balance" />
  68. <el-table-column label="审核原因" align="center" prop="failMsg" />
  69. <el-table-column label="状态" align="center" prop="status" >
  70. <template slot-scope="scope">
  71. <el-tag prop="status" v-for="(item, index) in statusOptions" v-if="scope.row.status==item.dictValue">{{item.dictLabel}}</el-tag>
  72. </template>
  73. </el-table-column>
  74. <el-table-column label="提交时间" align="center" prop="createTime" />
  75. <el-table-column label="审核时间" align="center" prop="updateTime" />
  76. <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  77. <template slot-scope="scope">
  78. <el-button
  79. v-if="scope.row.status==0"
  80. size="mini"
  81. type="text"
  82. icon="el-icon-edit"
  83. @click="handleAudit(scope.row)"
  84. v-hasPermi="['store:userExtract:audit']"
  85. >审核</el-button>
  86. </template>
  87. </el-table-column>
  88. </el-table>
  89. <pagination
  90. v-show="total>0"
  91. :total="total"
  92. :page.sync="queryParams.pageNum"
  93. :limit.sync="queryParams.pageSize"
  94. @pagination="getList"
  95. />
  96. <!-- 添加或修改用户提现对话框 -->
  97. <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
  98. <el-form ref="form" :model="form" :rules="rules" label-width="100px">
  99. <el-form-item label="会员昵称" prop="nickname">
  100. <el-input v-model="form.nickname" disabled />
  101. </el-form-item>
  102. <el-form-item label="会员手机号" prop="phone">
  103. <el-input v-model="form.phone" disabled />
  104. </el-form-item>
  105. <el-form-item label="提现金额" prop="extractPrice">
  106. <el-input v-model="form.extractPrice" disabled placeholder="请输入提现金额" />
  107. </el-form-item>
  108. <el-form-item label="余额" prop="balance">
  109. <el-input v-model="form.balance" disabled placeholder="请输入提现金额" />
  110. </el-form-item>
  111. <el-form-item label="审核状态">
  112. <el-radio-group v-model="form.status">
  113. <el-radio label="1">通过</el-radio>
  114. <el-radio label="-1">驳回</el-radio>
  115. </el-radio-group>
  116. </el-form-item>
  117. <el-form-item label="审核原因" v-if="form.status==-1" prop="failMsg">
  118. <el-input type="textarea" :row="5" v-model="form.failMsg" placeholder="请输入审核原因" />
  119. </el-form-item>
  120. </el-form>
  121. <div slot="footer" class="dialog-footer">
  122. <el-button type="primary" @click="submitForm">确 定</el-button>
  123. <el-button @click="cancel">取 消</el-button>
  124. </div>
  125. </el-dialog>
  126. </div>
  127. </template>
  128. <script>
  129. import { listUserExtract, getUserExtract, audit,delUserExtract, addUserExtract, updateUserExtract, exportUserExtract } from "@/api/hisStore/userExtract";
  130. export default {
  131. name: "UserExtract",
  132. data() {
  133. return {
  134. statusOptions:[],
  135. // 遮罩层
  136. loading: true,
  137. // 选中数组
  138. ids: [],
  139. // 非单个禁用
  140. single: true,
  141. // 非多个禁用
  142. multiple: true,
  143. // 显示搜索条件
  144. showSearch: true,
  145. // 总条数
  146. total: 0,
  147. // 用户提现表格数据
  148. userExtractList: [],
  149. // 弹出层标题
  150. title: "",
  151. // 是否显示弹出层
  152. open: false,
  153. // 查询参数
  154. queryParams: {
  155. pageNum: 1,
  156. pageSize: 10,
  157. userId: null,
  158. realName: null,
  159. extractType: null,
  160. bankCode: null,
  161. bankAddress: null,
  162. alipayCode: null,
  163. extractPrice: null,
  164. mark: null,
  165. balance: null,
  166. failMsg: null,
  167. failTime: null,
  168. status: null,
  169. wechat: null,
  170. isDel: null
  171. },
  172. // 表单参数
  173. form: {},
  174. // 表单校验
  175. rules: {
  176. status: [
  177. { required: true, message: "状态不能为空", trigger: "blur" }
  178. ],
  179. failMsg: [
  180. { required: true, message: "原因不能为空", trigger: "blur" }
  181. ],
  182. }
  183. };
  184. },
  185. created() {
  186. this.getDicts("user_extract_status").then((response) => {
  187. this.statusOptions = response.data;
  188. });
  189. this.getList();
  190. },
  191. methods: {
  192. /** 查询用户提现列表 */
  193. getList() {
  194. this.loading = true;
  195. listUserExtract(this.queryParams).then(response => {
  196. this.userExtractList = response.rows;
  197. this.total = response.total;
  198. this.loading = false;
  199. });
  200. },
  201. // 取消按钮
  202. cancel() {
  203. this.open = false;
  204. this.reset();
  205. },
  206. // 表单重置
  207. reset() {
  208. this.form = {
  209. id: null,
  210. userId: null,
  211. realName: null,
  212. extractType: null,
  213. bankCode: null,
  214. bankAddress: null,
  215. alipayCode: null,
  216. extractPrice: null,
  217. mark: null,
  218. balance: null,
  219. failMsg: null,
  220. failTime: null,
  221. createTime: null,
  222. updateTime: null,
  223. status: 0,
  224. wechat: null,
  225. isDel: null
  226. };
  227. this.resetForm("form");
  228. },
  229. /** 搜索按钮操作 */
  230. handleQuery() {
  231. this.queryParams.pageNum = 1;
  232. this.getList();
  233. },
  234. /** 重置按钮操作 */
  235. resetQuery() {
  236. this.resetForm("queryForm");
  237. this.handleQuery();
  238. },
  239. // 多选框选中数据
  240. handleSelectionChange(selection) {
  241. this.ids = selection.map(item => item.id)
  242. this.single = selection.length!==1
  243. this.multiple = !selection.length
  244. },
  245. /** 修改按钮操作 */
  246. handleAudit(row) {
  247. this.reset();
  248. const id = row.id;
  249. console.log(id)
  250. getUserExtract(id).then(response => {
  251. this.form = response.data;
  252. this.form.nickname=row.nickname
  253. this.form.phone=row.phone
  254. this.form.status="1"
  255. this.open = true;
  256. this.title = "审核提现";
  257. });
  258. },
  259. /** 提交按钮 */
  260. submitForm() {
  261. this.$refs["form"].validate(valid => {
  262. if (valid) {
  263. audit(this.form).then(response => {
  264. if (response.code === 200) {
  265. this.msgSuccess("操作成功");
  266. this.open = false;
  267. this.getList();
  268. }
  269. });
  270. }
  271. });
  272. },
  273. /** 删除按钮操作 */
  274. handleDelete(row) {
  275. const ids = row.id || this.ids;
  276. this.$confirm('是否确认删除用户提现编号为"' + ids + '"的数据项?', "警告", {
  277. confirmButtonText: "确定",
  278. cancelButtonText: "取消",
  279. type: "warning"
  280. }).then(function() {
  281. return delUserExtract(ids);
  282. }).then(() => {
  283. this.getList();
  284. this.msgSuccess("删除成功");
  285. }).catch(function() {});
  286. },
  287. /** 导出按钮操作 */
  288. handleExport() {
  289. const queryParams = this.queryParams;
  290. this.$confirm('是否确认导出所有用户提现数据项?', "警告", {
  291. confirmButtonText: "确定",
  292. cancelButtonText: "取消",
  293. type: "warning"
  294. }).then(function() {
  295. return exportUserExtract(queryParams);
  296. }).then(response => {
  297. this.download(response.msg);
  298. }).catch(function() {});
  299. }
  300. }
  301. };
  302. </script>