| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444 |
- <template>
- <basic-container>
- <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" :permission="permissionList"
- :before-open="beforeOpen" v-model="form" ref="crud" @row-update="rowUpdate" @row-save="rowSave" @row-del="rowDel"
- @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange"
- @current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad">
- <template slot="menuLeft">
- <el-button type="danger" size="small" icon="el-icon-delete" plain v-if="permission.withdrawrecords_delete"
- @click="handleDelete">删 除
- </el-button>
- </template>
- <template slot="userInfo" slot-scope="scope">
- <div style="display: flex;">
- <div style="display: flex;justify-content: center;align-items: center;">
- <el-avatar size="large" :src="scope.row.avatar"></el-avatar>
- </div>
- <div style="padding: 10px;">
- <div>昵称:{{scope.row.nickName}}</div>
- <div>手机:{{scope.row.phone}}</div>
- </div>
- </div>
- </template>
- <!-- 操作菜单 -->
- <template slot="timeInfo" slot-scope="scope">
- <div>下单时间:{{scope.row.orderTime}}</div>
- <div>完成时间:{{scope.row.finishTime}}</div>
- </template>
- <template slot="accountInfo" slot-scope="scope">
- <div>银行账号:{{scope.row.receiverAccountNo}}</div>
- <div>开户姓名:{{scope.row.receiverAccountName}}</div>
- </template>
- <template slot="cashInfo" slot-scope="scope">
- <div>提现金额:<span style="color: #ff0000;padding-right: 5px;">{{scope.row.cashValue}}</span> 元</div>
- <div>到账金额:<span style="color: #ff0000;padding-right: 5px;">{{scope.row.receiveAmount}}</span> 元 </div>
- <div>手续费:<span style="color: #ff0000;padding-right: 5px;">{{scope.row.fee}}</span> 元</div>
- </template>
- <template slot="receiveType" slot-scope="scope">
- <el-tag type="success" v-if="scope.row.receiveType=='REAL_TIME'">实时到账</el-tag>
- </template>
- <template slot="withdrawStatus" slot-scope="scope">
- <el-tag type="warning" v-if="scope.row.withdrawStatus==0">处理中</el-tag>
- <el-tag type="success" v-if="scope.row.withdrawStatus==1">已处理</el-tag>
- <el-tag type="danger" v-if="scope.row.withdrawStatus==2">提现失败</el-tag>
- </template>
- </avue-crud>
- </basic-container>
- </template>
- <script>
- import {
- getList,
- getDetail,
- add,
- update,
- remove
- } from "@/api/withdrawrecords/withdrawrecords";
- import {
- dateFormat
- } from "../../util/date.js"
- import {
- mapGetters
- } from "vuex";
- export default {
- data() {
- return {
- form: {},
- query: {},
- loading: true,
- page: {
- pageSize: 10,
- currentPage: 1,
- total: 0
- },
- selectionList: [],
- option: {
- height: 'auto',
- calcHeight: 30,
- tip: false,
- searchShow: true,
- searchMenuSpan: 6,
- border: true,
- index: true,
- viewBtn: false,
- selection: true,
- dialogClickModal: false,
- column: [{
- label: "用户id",
- hide: true,
- prop: "userId",
- rules: [{
- required: true,
- message: "请输入用户id",
- trigger: "blur"
- }]
- },
- {
- slot: true,
- width:180,
- label: "用户信息",
- prop: "userInfo"
- },
- {
- label:"账户信息",
- width:200,
- slot:true,
- prop:"accountInfo"
- },
- {
- hide:true,
- label: "手机号",
- prop: "phone",
- search: true
- },
- {
- hide:true,
- label: "昵称",
- prop: "nickName",
- search: true
- },
- {
- label: "openid",
- hide:true,
- prop: "openid",
- rules: [{
- required: true,
- message: "请输入用户id",
- trigger: "blur"
- }]
- },
- {
- label: "提现状态",
- width:100,
- search: true,
- type: "select",
- dicData: [{
- label: '处理中',
- value: 0
- },
- {
- label: '已处理',
- value: 1
- },
- {
- label: '提现失败',
- value: 2
- }
- ],
- prop: 'withdrawStatus'
- },
- {
- label: "备注说明",
- width:100,
- prop: "note",
- rules: [{
- required: true,
- message: "请输入备注说明",
- trigger: "blur"
- }]
- },
- {
- label: "消耗的热力值",
- width:100,
- prop: "hotValue",
- rules: [{
- required: true,
- message: "请输入消耗的热力值",
- trigger: "blur"
- }]
- },
- {
- label:"金额信息",
- prop:'cashInfo',
- slot:true
- },
- {
- hide:true,
- label: "提现金额",
- prop: "cashValue",
- rules: [{
- required: true,
- message: "请输入提现金额",
- trigger: "blur"
- }]
- },
- {
- hide:true,
- label: "提现到账的金额",
- prop: "receiveAmount",
- rules: [{
- required: true,
- message: "请输入提现到账的金额",
- trigger: "blur"
- }]
- },
- {
- hide:true,
- label: "提现手续费",
- prop: "fee",
- rules: [{
- required: true,
- message: "请输入提现手续费",
- trigger: "blur"
- }]
- },
- {
- label:"时间",
- width:210,
- prop:'timeInfo',
- slot:true
- },
- {
- label: "订单时间",
- hide:true,
- prop: "orderTime",
- rules: [{
- required: true,
- message: "请输入订单时间",
- trigger: "blur"
- }]
- },
- {
- label: "完成时间",
- hide:true,
- prop: "finishTime",
- rules: [{
- required: true,
- message: "请输入完成时间",
- trigger: "blur"
- }]
- },
- {
- label: "接收人真实姓名",
- hide:true,
- prop: "receiverAccountName",
- rules: [{
- required: true,
- message: "请输入接收人真实姓名",
- trigger: "blur"
- }]
- },
- {
- label: "接收人的银行账号",
- hide:true,
- prop: "receiverAccountNo",
- rules: [{
- required: true,
- message: "请输入接收人的银行账号",
- trigger: "blur"
- }]
- },
- {
- label: "到账类型",
- slot:true,
- prop: "receiveType",
- rules: [{
- required: true,
- message: "请输入到账类型,默认实时到账",
- trigger: "blur"
- }]
- },
- {
- label: "失败的原因",
- prop: "failReason",
- rules: [{
- required: true,
- message: "请输入失败的原因",
- trigger: "blur"
- }]
- },
- ]
- },
- data: []
- };
- },
- computed: {
- ...mapGetters(["permission"]),
- permissionList() {
- return {
- addBtn: this.vaildData(this.permission.withdrawrecords_add, false),
- viewBtn: this.vaildData(this.permission.withdrawrecords_view, false),
- delBtn: this.vaildData(this.permission.withdrawrecords_delete, false),
- editBtn: this.vaildData(this.permission.withdrawrecords_edit, false)
- };
- },
- ids() {
- let ids = [];
- this.selectionList.forEach(ele => {
- ids.push(ele.id);
- });
- return ids.join(",");
- }
- },
- methods: {
- confirm(row) {
- let _this = this
- this.$alert('确定发款?', '提示', {
- confirmButtonText: '确定',
- callback: () => {
- _this.doConfirm(row)
- }
- });
- },
- async doConfirm(row) {
- let grantTime = dateFormat(new Date())
- let params = {
- id: row.id,
- grantTime,
- withdrawStatus: 1
- }
- let res = await update(params)
- if (res.data.success) {
- this.onLoad(this.page);
- this.$message({
- type: 'success',
- message: "发款成功!"
- });
- }
- },
- rowSave(row, done, loading) {
- add(row).then(() => {
- this.onLoad(this.page);
- this.$message({
- type: "success",
- message: "操作成功!"
- });
- done();
- }, error => {
- loading();
- window.console.log(error);
- });
- },
- rowUpdate(row, index, done, loading) {
- update(row).then(() => {
- this.onLoad(this.page);
- this.$message({
- type: "success",
- message: "操作成功!"
- });
- done();
- }, error => {
- loading();
- console.log(error);
- });
- },
- rowDel(row) {
- this.$confirm("确定将选择数据删除?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- })
- .then(() => {
- return remove(row.id);
- })
- .then(() => {
- this.onLoad(this.page);
- this.$message({
- type: "success",
- message: "操作成功!"
- });
- });
- },
- handleDelete() {
- if (this.selectionList.length === 0) {
- this.$message.warning("请选择至少一条数据");
- return;
- }
- this.$confirm("确定将选择数据删除?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- })
- .then(() => {
- return remove(this.ids);
- })
- .then(() => {
- this.onLoad(this.page);
- this.$message({
- type: "success",
- message: "操作成功!"
- });
- this.$refs.crud.toggleSelection();
- });
- },
- beforeOpen(done, type) {
- if (["edit", "view"].includes(type)) {
- getDetail(this.form.id).then(res => {
- this.form = res.data.data;
- });
- }
- done();
- },
- searchReset() {
- this.query = {};
- this.onLoad(this.page);
- },
- searchChange(params, done) {
- this.query = params;
- this.page.currentPage = 1;
- this.onLoad(this.page, params);
- done();
- },
- selectionChange(list) {
- this.selectionList = list;
- },
- selectionClear() {
- this.selectionList = [];
- this.$refs.crud.toggleSelection();
- },
- currentChange(currentPage) {
- this.page.currentPage = currentPage;
- },
- sizeChange(pageSize) {
- this.page.pageSize = pageSize;
- },
- refreshChange() {
- this.onLoad(this.page, this.query);
- },
- onLoad(page, params = {}) {
- this.loading = true;
- getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
- const data = res.data.data;
- this.page.total = data.total;
- this.data = data.records;
- this.loading = false;
- this.selectionClear();
- });
- }
- }
- };
- </script>
- <style>
- </style>
|