Commit 0e7b7c31 authored by pengyunqian's avatar pengyunqian

feature:黑名单

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