Commit 0e7b7c31 authored by pengyunqian's avatar pengyunqian

feature:黑名单

parent a687e17d
const WITHDRAWAL_URI = require("../config").WITHDRAWAL_URI;
const req = require("../utils/request").httpReq;
// const controller_utils = require('./utils')
/**
* 示例
......@@ -27,7 +28,7 @@ exports.getApplyList = async ctx => {
};
// 获取黑名单冻结账户
exports.getBlackList = async ctx => {
const url = `${WITHDRAWAL_URI}/wallet//background/blacklist`;
const url = `${WITHDRAWAL_URI}/wallet/background/blacklist`;
const opts = {
url,
method: "POST",
......@@ -42,8 +43,47 @@ exports.getWithdrawAudit = async ctx => {
const opts = {
url,
method: "POST",
json:true,
body:ctx.request.body
json: true,
body: ctx.request.body
}
ctx.body = await req(ctx, opts)
}
// 获取提现失败冻结
exports.getFreezingFund = async ctx => {
const url = `${WITHDRAWAL_URI}/wallet/background/back_freezing_fund`;
const opts = {
url,
method: "POST",
json: true,
body: ctx.request.body
}
ctx.body = await req(ctx,opts)
ctx.body = await req(ctx, opts)
}
// 获取提现审核详情
exports.getApplyDetail = async ctx => {
const url = `${WITHDRAWAL_URI}/wallet/background/apply_detail`;
const opts = {
url,
method: "GET",
qs: ctx.request.query
}
ctx.body = await req(ctx, opts)
}
const getUserPermission = async (ctx) => {
const url = `${WITHDRAWAL_URI}/merchant/authority/get_role_list`;
const { email, op_cur_user } = ctx.request.query;
const user = email || op_cur_user;
const opts = {
url,
method: "GET",
qs: {
// user_email: "jianghaiming@126.com"
user_email: user
}
};
return await req(ctx, opts);
}
exports.getAll_role_list = async (ctx, next) => {
ctx.body = await getUserPermission(ctx);
}
\ No newline at end of file
......@@ -6,7 +6,7 @@ const enterprise = require("./controllers/enterprise");
const role = require('./controllers/role')
const life = require('./controllers/life-no');
const goods = require('./controllers/goods');
const withdrawal = require('./controllers/withdraw/withdrawal');
const withdrawal = require('./controllers/withdrawal');
const router = Router();
const API_VERSION = "/api/v1";
......@@ -63,9 +63,11 @@ router.get(`${API_VERSION}/merchant/lifeinner/life_list`, life.get_life_list)
//用户
router.post(`${API_VERSION}/merchant/authority/get_user_info`, user.getUser_detail)
// 钱包提现审核
router.post(`${API_VERSION}/get_withdrawal_apply_list`, withdrawal.getApplyList)
// 钱包提现审核 wallet/background/apply_detail
router.get(`${API_VERSION}/get_withdrawal_apply_list`, withdrawal.getApplyList)
router.post(`${API_VERSION}/get_withdrawal_black_list`, withdrawal.getBlackList)
router.post(`${API_VERSION}/get_withdraw_audit`, withdrawal.getWithdrawAudit)
router.post(`${API_VERSION}/get_freezing_fund`, withdrawal.getFreezingFund)
router.get(`${API_VERSION}/get_apply_detail`, withdrawal.getApplyDetail)
module.exports = router;
......@@ -35,7 +35,10 @@
<el-form-item label="用户id">
<el-input v-model="searchProps.user_id"></el-input>
</el-form-item>
<el-button type="primary" style="margin-left: 30px; margin-bottom: 22px"
<el-button
type="primary"
style="margin-left: 30px; margin-bottom: 22px"
@click="findProducts"
>查询</el-button
>
<!-- <el-form-item label="审核状态">
......@@ -114,15 +117,11 @@
prop="create_time"
align="center"
></el-table-column>
<el-table-column
label="状态"
prop="withdraw_apply_status_text"
align="center"
>
<el-table-column label="状态" prop="status_text" align="center">
</el-table-column>
<el-table-column
label="审核时间"
prop="withdraw_apply_success_time.user_id"
prop="withdraw_audit_time"
align="center"
></el-table-column>
<el-table-column
......@@ -135,26 +134,27 @@
<template #default="scope">
<el-button
type="text"
@click="handleDetail('look', scope.row)"
@click="handleDetail('look', scope.row.id)"
v-if="searchProps.withdraw_apply_status !== '3'"
>查看</el-button
>
<el-button
type="text"
v-if="searchProps.withdraw_apply_status == '0'"
@click="handleDetail('audit', scope.row)"
@click="handleDetail('audit', scope.row.id)"
>审核</el-button
>
<el-button
type="text"
v-if="searchProps.withdraw_apply_status == '3'"
@click="handleFinzingFind(scope.row.wallet_id)"
>解冻</el-button
>
<el-button
<!-- <el-button
type="text"
v-if="searchProps.withdraw_apply_status == '3'"
>重新发起</el-button
>
> -->
</template>
</el-table-column>
</el-table>
......@@ -196,11 +196,11 @@
v-show="dialogData.showMode === 'audit'"
>黑名单</el-button
>
<el-button
<!-- <el-button
@click="handleButtonlist('白名单')"
v-show="dialogData.showMode === 'audit'"
>白名单</el-button
>
> -->
<ul class="listShow">
<li>
<span class="list-left">提现金额 :</span>
......@@ -227,29 +227,30 @@
</ul>
<el-form-item class="text-area" label="奖励明细:">
<el-table
:data="data"
:data="dialogData.showData.record_list || []"
border
align="center"
style="width: 100%"
max-height="200"
size="small"
>
<el-table-column
align="center"
prop="prop"
prop="create_time"
label="流水时间"
width="120"
>
</el-table-column>
<el-table-column
align="center"
prop="prop"
prop="amount"
label="分享用户量"
width="120"
>
</el-table-column>
<el-table-column
align="center"
prop="prop"
prop="third_order_desc"
label="分享额外奖励x.xx元"
width="150"
>
......@@ -262,14 +263,14 @@
<div class="dialog-footer">
<el-button
type="primary"
@click="handleAdoptList('通过')"
v-show="dialogData.showMode === 'audit'&& searchProps.withdraw_apply_status === '1'"
@click="handleAdoptRefuse('通过')"
v-show="dialogData.showMode === 'audit'"
>通过</el-button
>
<el-button
type="danger"
@click="handleRefuseList('拒绝')"
v-show="dialogData.showMode === 'audit' && searchProps.withdraw_apply_status === '2'"
@click="handleAdoptRefuse('拒绝')"
v-show="dialogData.showMode === 'audit'"
>拒绝</el-button
>
<el-button @click="outerVisible = false">{{
......@@ -285,7 +286,11 @@ import {
getApplyList,
getBlackList,
getWithdrawAudit,
} from "@/service/Withdrawal/withdrawal";
getApplyDetail,
getFreezingFund,
// getAll_role_list
} from "../../../service/Withdrawal/withdrawal";
import { ElMessage } from "element-plus";
export default {
name: "Audit",
components: { Layout },
......@@ -303,8 +308,8 @@ export default {
history_download: "7", //历史分享下载量
history_download_keep: "4", //历史分享留存
create_time: "2021-5-4", //申请时间
withdraw_apply_status_text: "待审核", //状态
//审核时间
status_text: "待审核", //状态
withdraw_audit_time: "", //审核时间
audit_user_name: "我", //审核人
},
],
......@@ -333,20 +338,38 @@ export default {
loading: false, //加载中
};
},
mounted() {},
created() {
this.getApplyList();
// this.getPermissionsAll();
},
methods: {
// getPermissionsAll () {
// // this.user_info = this.$store.state.userInfo
// let { email } = this.$store.state.userInfo
// getAll_role_list(email).then(res => {
// this.permissionsAll = res
// })
// },
// tab切换
handleTabChange() {
this.getApplyList();
},
// 分页
handleCurrentChange() {},
// 跳转提现申请审核
handleDetail(showMode, showData) {
// 提现申请审核详情
async handleDetail(showMode,id) {
try {
const res = await getApplyDetail({id});
const showData = res.info || {};
this.dialogData = { ...this.dialogData, showMode, showData };
this.outerVisible = true;
} catch (error) {
ElMessage.error('请求获取信息失败');
}
},
// 二次确认弹框
handleConfirm(action, url, params) {
handleConfirm(action, params) {
const urlObj = {
黑名单: getBlackList,
通过: getWithdrawAudit,
......@@ -363,55 +386,62 @@ export default {
showClose: false,
type: "warning",
})
.then(async () => {
try {
const res = await urlObj[url](params);
console.log(res);
} catch (error) {
console.log(error);
}
.then(() => {
this.$message({
type: "info",
message: "已取消操作",
});
})
.catch(() => {
.catch(async () => {
try {
const res = await urlObj[action](params);
this.$message({
type: "success",
message: "操作成功",
});
console.log(res);
} catch (error) {
this.$message({
type: "error",
message: "请求操作失败",
});
}
});
},
//获取黑名单
handleBlackList() {
handleBlackList(action) {
const { user_id, wallet_id } = this.dialogData.showData;
const params = {
user_id,
id: user_id,
wallet_id,
is_freezing: val===,
is_freezing: action === "黑名单" ? 1 : 0,
opt_desc: "",
};
this.handleConfirm("黑名单", params);
this.handleConfirm(action, params);
},
// 通过 & 拒绝
handleAdoptList() {
const { withdraw_apply_id } =this.dialogData.showData;
handleAdoptRefuse(action) {
const { withdraw_apply_id: id } = this.dialogData.showData;
const params = {
withdraw_apply_id,
withdraw_apply_status: 1,
id,
withdraw_apply_status: action === "通过" ? 1 : 2,
};
this.handleConfirm("确定", params);
this.handleConfirm(action, params);
},
// 获取提现审核列表
async getApplyList() {
this.loading = true;
// setTimeout(() => {
// this.loading = false;
// }, 2000);
const { user_id, page_size, withdraw_apply_status } = this.searchProps;
// 整理参数
const searchProps = {
user_id: user_id || undefined,
page_size,
withdraw_apply_status,
};
console.log(this.searchProps);
try {
const res = await getApplyList(this.searchProps);
const res = await getApplyList(searchProps);
if (res.code !== 0) return this.$message.error(res.reason);
console.log("提现列表", res);
this.goodsList = res.result.list;
......@@ -419,9 +449,23 @@ export default {
this.loading = false;
} catch (error) {
this.loading = false;
console.error(error);
ElMessage.error("请求查询列表失败");
}
},
// 查询
findProducts() {
this.getApplyList();
},
// 解冻
async handleFinzingFind(id) {
try {
await getFreezingFund({id})
ElMessage.success('解冻成功')
} catch (error) {
ElMessage.error('请求解冻失败')
}
}
},
};
</script>
......
......@@ -6,18 +6,34 @@ const getParams = (p = {}) => {
}
// 获取提现审核列表
export async function getApplyList () {
const res = await axios.get("/api/v1/get_withdrawal_apply_list", {params: getParams()});
export async function getApplyList (params) {
const res = await axios.get("/api/v1/get_withdrawal_apply_list", {params: getParams(params)});
return res;
}
// 黑名单,冻结用户
export async function getBlackList ({user_id,wallet_id,is_freezing}) {
const res = await axios.post("/api/v1/get_withdrawal_black_list" ,{params: getParams({user_id,wallet_id,is_freezing})});
export async function getBlackList (params) {
const res = await axios.post("/api/v1/get_withdrawal_black_list" ,{params: getParams(params)});
return res;
}
// 获取订单审核--通过,拒绝
export async function getWithdrawAudit ({id,withdraw_apply_status}) {
const res = await axios.post("/api/v1/get_withdraw_audit",{params: getParams({id,withdraw_apply_status})});
export async function getWithdrawAudit (params) {
const res = await axios.post("/api/v1/get_withdraw_audit",{params: getParams(params)});
return res;
}
// 获取提现失败冻结
export async function getFreezingFund (params) {
const res = await axios.post("/api/v1/get_freezing_fund",{params: getParams(params)});
return res;
}
// 获取提现审核详情
export async function getApplyDetail (params) {
const res = await axios.get("/api/v1/get_apply_detail", {params: getParams(params)});
return res;
}
//权限列表
export async function getAll_role_list (user_email) {
const res = await axios.post("/api/v1/merchant/authority/get_role_list", {
user_email
})
return res.permissions;
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment