Commit d7793a6f authored by liwenhong's avatar liwenhong

Merge branch 'withdrawList-h5'

parents 021a2365 300afe92
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -683,6 +683,7 @@ export default { ...@@ -683,6 +683,7 @@ export default {
this.rulesForm.useStartTime = this.formatDate(val.rule_start_time); this.rulesForm.useStartTime = this.formatDate(val.rule_start_time);
this.rulesForm.useEndTime = this.formatDate(val.rule_end_time); this.rulesForm.useEndTime = this.formatDate(val.rule_end_time);
console.log(val.original_price); console.log(val.original_price);
this.goodsObj.original_price = Number(val.original_price)
if (!val.original_price) { if (!val.original_price) {
this.$nextTick(() => { this.$nextTick(() => {
this.goodsObj.original_price = ""; this.goodsObj.original_price = "";
...@@ -1244,6 +1245,8 @@ export default { ...@@ -1244,6 +1245,8 @@ export default {
rule_date_type: this.goodsObj.rule_date_type // 使用日期类型(周末/工作日) rule_date_type: this.goodsObj.rule_date_type // 使用日期类型(周末/工作日)
}; };
console.log(111222333, query.original_price);
// 必填校验 // 必填校验
if (!this.goodsObj.goods_spu_id) { if (!this.goodsObj.goods_spu_id) {
return this.$message.error("未传入商品id"); return this.$message.error("未传入商品id");
......
<template>
<!-- 提现失败页 -->
<!-- <auditTab v-if="status_text == 'fourth'"></auditTab> -->
<!-- <el-card class="goods-h5"> -->
<div class="goods-h5">
<el-table :data="goodsList" border>
<el-table-column
label="申请用户"
prop="user_id"
align="center"
></el-table-column>
<el-table-column
label="提现金额"
prop="amount"
align="center"
></el-table-column>
<el-table-column
label="申请时间"
prop="create_time"
align="center"
></el-table-column>
<!-- 操作快捷键 -->
<el-table-column label="操作" align="center">
<template v-slot:default="scope">
<el-button
type="text"
v-show="searchProps.status == '0' && isAllowedToAudit"
@click="handleDetail(scope.row.id)"
>审核</el-button
>
</template>
</el-table-column>
</el-table>
<!-- 页码区 -->
<!-- <el-pagination
class="pagination"
@current-change="handleCurrentChange"
v-model:currentPage="searchProps.page"
:page-size="searchProps.page_size"
layout="total,prev, pager, next, jumper"
:total="searchProps.count"
>
</el-pagination> -->
</div>
<!-- </el-card> -->
</template>
<script>
import {
getApplyList,
getBlackList,
getWithdrawAudit,
getFreezingFund,
getRolesForUser,
} from "@/service/Withdrawal/withdrawal";
import { ElMessage } from "element-plus";
import { fetchCurrentUser } from "../../../service/user";
const TABS = {
pending: "0",
passed: "1",
rejected: "2",
failed: "3",
};
export default {
name: "Examine",
data() {
return {
goodsList: [
// {
// user_id: "对的", //提现用户
// city_name: "北京", //所在圈
// amount: "45", ///提现金额
// lately_amount: "11", //最近24小时收入
// lately_share: "23", //近两天分享增长
// lately_download: "4", //近两天分享下载量
// history_share: "8", //历史分享增长
// history_download: "7", //历史分享下载量
// history_download_keep: "4", //历史分享留存
// create_time: "2021-5-4", //申请时间
// status_text: "待审核", //状态
// withdraw_audit_time: "", //审核时间
// audit_user_name: "我", //审核人
// },
],
// 查询参数
searchProps: {
user_id: "", //用户id
page: 1,
count: 0,
page_size: 20, //每页条数
status: TABS.pending, //状态
},
// 弹框
dialogData: {
showData: {}, //弹框展示
},
// 黑名单
// blackList: {
// user_id: "",
// wallet_id: "",
// is_freezing: 0,
// opt_desc: "",
// },
award: "", //奖励明细
outerVisible: false, //外层弹框
permissions: [],
// constants
TABS,
};
},
created() {
this.getApplyList();
},
async mounted() {
const res = await this.getPermissionsAll();
// if (!res) {
// this.$router.push({ name: "Forbidden" });
// return;
// }
let withdrawlPermission = res.filter(
({ name }) => name === "withdrawal_audit"
);
if (withdrawlPermission.length === 0) {
// push to forbidden
this.$router.push({ name: "Forbidden" });
return;
}
console.log("withdrawlPermission", withdrawlPermission);
withdrawlPermission = withdrawlPermission[0];
// judge subpermission
let subpermissions = withdrawlPermission.sub_permissions.filter(
({ name }) => name === "show"
);
if (subpermissions.length === 0) {
this.$router.push({ name: "Forbidden" });
}
},
methods: {
async getPermissionsAll() {
// 不能够信赖 store 中的 email,无法知道全局中的 fetchCurrentUser 处理完毕
// 是一个重构的点
const { user } = await fetchCurrentUser();
const res = await getRolesForUser(user.email);
this.permissions = res;
return res;
},
// tab切换
handleTabChange() {
this.searchProps.page = 0;
this.getApplyList();
},
// 分页
handleCurrentChange(e) {
this.searchProps.page = e;
this.getApplyList();
},
// 提现申请审核详情
async handleDetail(id) {
this.$router.push({ name: 'withdrawDetail', query: {id: 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, params) {
const urlObj = {
黑名单: getBlackList,
通过: getWithdrawAudit,
拒绝: getWithdrawAudit,
};
this.$confirm(`<p>你确定此操作吗</p><p>${action}</p>`, "再次确认", {
confirmButtonText: "取消",
cancelButtonText: "确定",
cancelButtonClass: "cancel",
confirmButtonClass: "confirm",
closeOnClickModal: false,
dangerouslyUseHTMLString: true,
center: true,
showClose: false,
type: "warning",
})
.then(() => {
this.$message({
type: "info",
message: "已取消操作",
});
})
.catch(async () => {
try {
const res = await urlObj[action](params);
this.getApplyList();
this.outerVisible = false;
this.$message({
type: "success",
message: "操作成功",
});
console.log(res);
} catch (error) {
this.$message({
type: "error",
message: "请求操作失败",
});
}
});
},
//获取黑名单
handleBlackList(action) {
const { id, user_id, wallet_id } = this.dialogData.showData;
const params = {
id,
user_id,
wallet_id,
is_freezing: action === "黑名单" ? 1 : 0,
opt_desc: "",
};
this.handleConfirm(action, params);
},
// 通过 & 拒绝
handleAdoptRefuse(action) {
const { withdraw_apply_id: id } = this.dialogData.showData;
const params = {
id,
withdraw_apply_status: action === "通过" ? 1 : 2,
};
this.handleConfirm(action, params);
},
// 获取提现审核列表
async getApplyList() {
const { user_id, page, page_size, status } = this.searchProps;
// 整理参数
const searchProps = {
user_id: user_id || undefined,
page,
page_size,
status,
};
console.log(this.searchProps);
try {
const res = await getApplyList(searchProps);
if (res.code !== 0) return this.$message.error(res.reason);
this.goodsList = res.result.list;
this.searchProps.count = res.result.count;
} catch (error) {
ElMessage.error("请求查询列表失败");
}
},
// 查询
findProducts() {
this.getApplyList();
},
// 解冻
async handleFinzingFind(id) {
try {
await getFreezingFund({ id });
this.getApplyList();
ElMessage.success("解冻成功");
} catch (error) {
ElMessage.error("请求解冻失败");
}
},
// 清空
resetDate() {
(this.goodsList = []),
// 查询参数
(this.searchProps = {
user_id: "", //用户id
page_size: 2, //页码
status: "0", //状态
page: 1,
count: 0, //总条数
}),
// 弹框
(this.dialogData = {
showData: {}, //弹框展示
showMode: "audit", //判断是审核还是查看
}),
(this.award = ""), //奖励明细
(this.outerVisible = false); //外层弹框
},
},
computed: {
isAllowedToAudit() {
// 用户不存在
if (!this.permissions) {
return false;
}
const WITHDRAWAL_PERMISSION_ID = 10;
const WITHDRAWAL_PERMISSION_ID1 = 10000005;
let withdrawlPermission = this.permissions.filter(
(item) => (item.id === WITHDRAWAL_PERMISSION_ID || item.id === WITHDRAWAL_PERMISSION_ID1)
);
// 无此模块权限
if (withdrawlPermission.length === 0) {
return false;
}
const AUDIT_PERMSSION_ID = 14;
const AUDIT_PERMSSION_ID1 = 10000014;
const auditPermission = withdrawlPermission[0].sub_permissions.filter(
(item) => (item.id === AUDIT_PERMSSION_ID || item.id === AUDIT_PERMSSION_ID1)
);
return auditPermission.length !== 0;
},
},
};
</script>
<style lang="less" src="./index.less" scope></style>
...@@ -35,10 +35,9 @@ ...@@ -35,10 +35,9 @@
.commodity_list { .commodity_list {
margin-top: 30px; margin-top: 30px;
} }
.pagination { }
margin-top: 30px; .pagination {
} margin-top: 30px;
} }
.listShow { .listShow {
// padding-left: 60px; // padding-left: 60px;
...@@ -83,4 +82,29 @@ ...@@ -83,4 +82,29 @@
} }
.el-card__body{ .el-card__body{
padding: 10px; padding: 10px;
}
.goods-h5 {
width: 90%;
margin: 20px auto;
.dialog-footer {
display: flex;
justify-content: center;
align-items: center;
}
.apply-list {
li {
width: 70%;
display: flex;
justify-content: space-between;
span {
width: 70px;
text-align: left;
}
}
}
}
.el-message-box {
width: 80vw;
margin: 0 auto;
} }
\ No newline at end of file
<template>
<div class="goods-h5">
<el-form>
<ul class="apply-list">
<li> 提现用户:<span>{{ dialogData.showData.user_id }}</span></li>
<li> 提现金额:<span>{{ dialogData.showData.amount }}</span></li>
<li> 最近24小时收入:<span>{{ dialogData.showData.lately_amount }}</span></li>
<li> 近两天分享增长:<span>{{ dialogData.showData.lately_share }}</span></li>
<li> 近两天分享下载量:<span>{{ dialogData.showData.lately_download }}</span></li>
<li> 历史分享增长: <span>{{ dialogData.showData.history_share }}</span></li>
</ul>
<el-form-item label="奖励明细:">
<el-table
:data="dialogData.showData.record_list || []"
border
align="center"
max-height="300"
size="small"
>
<el-table-column
align="center"
prop="create_time"
label="流水时间"
>
</el-table-column>
<el-table-column
align="center"
prop="amount"
label="分享用户量"
>
<template v-slot:default="scope">
<span>{{ scope ? "+" + scope.row.amount : null }}</span>
</template>
</el-table-column>
<el-table-column
align="center"
prop="third_order_desc"
label="说明"
>
</el-table-column>
</el-table>
</el-form-item>
</el-form>
<div class="dialog-footer">
<div v-if="!showBackBtn">
<el-button
type="primary"
size="small"
@click="handleAdoptRefuse('通过')"
>通过</el-button
>
<el-button
type="danger"
size="small"
@click="handleAdoptRefuse('拒绝')"
>拒绝</el-button
>
<el-button
type="primary"
size="small"
@click="handleBlackList('黑名单')"
>黑名单</el-button
>
</div>
<el-button
size="small"
type="primary"
v-else
@click="$router.go(-1)"
>返回</el-button
>
</div>
</div>
</template>
<script>
import {
getBlackList,
getWithdrawAudit,
getApplyDetail,
getRolesForUser,
} from "@/service/Withdrawal/withdrawal";
import { fetchCurrentUser } from "../../../service/user";
const TABS = {
pending: "0",
passed: "1",
rejected: "2",
failed: "3",
};
export default {
name: "Examine",
data() {
return {
// 弹框
dialogData: {
showData: {}, //弹框展示
showMode: "audit", //判断是审核还是查看
},
// 黑名单
// blackList: {
// user_id: "",
// wallet_id: "",
// is_freezing: 0,
// opt_desc: "",
// },
permissions: [],
// constants
TABS,
showBackBtn: false, //操作成功后展示返回按钮
};
},
async created() {
const res = await getApplyDetail({ id: this.$route.query.id });
const showData = res.info || {};
this.dialogData = { ...this.dialogData, showData };
},
async mounted() {
},
methods: {
async getPermissionsAll() {
// 不能够信赖 store 中的 email,无法知道全局中的 fetchCurrentUser 处理完毕
// 是一个重构的点
const { user } = await fetchCurrentUser();
const res = await getRolesForUser(user.email);
this.permissions = res;
return res;
},
// 二次确认弹框
handleConfirm(action, params) {
const urlObj = {
黑名单: getBlackList,
通过: getWithdrawAudit,
拒绝: getWithdrawAudit,
};
this.$confirm(`<p>你确定此操作吗</p><p>${action}</p>`, "再次确认", {
confirmButtonText: "取消",
cancelButtonText: "确定",
cancelButtonClass: "cancel",
confirmButtonClass: "confirm",
closeOnClickModal: false,
dangerouslyUseHTMLString: true,
center: true,
showClose: false,
type: "warning",
})
.then(() => {
this.$message({
type: "info",
message: "已取消操作",
});
})
.catch(async () => {
const res = await urlObj[action](params);
if(+res.code === 0) {
this.$message({
type: "success",
message: "操作成功",
});
this.showBackBtn = true;
} else {
this.$message({
type: "error",
message: res.reason,
});
}
});
},
//获取黑名单
handleBlackList(action) {
const { id, user_id, wallet_id } = this.dialogData.showData;
const params = {
id,
user_id,
wallet_id,
is_freezing: action === "黑名单" ? 1 : 0,
opt_desc: "",
};
this.handleConfirm(action, params);
},
// 通过 & 拒绝
handleAdoptRefuse(action) {
const { withdraw_apply_id: id } = this.dialogData.showData;
const params = {
id,
withdraw_apply_status: action === "通过" ? 1 : 2,
};
this.handleConfirm(action, params);
},
},
computed: {
isAllowedToAudit() {
// 用户不存在
if (!this.permissions) {
return false;
}
const WITHDRAWAL_PERMISSION_ID = 10;
const WITHDRAWAL_PERMISSION_ID1 = 10000005;
let withdrawlPermission = this.permissions.filter(
(item) => (item.id === WITHDRAWAL_PERMISSION_ID || item.id === WITHDRAWAL_PERMISSION_ID1)
);
// 无此模块权限
if (withdrawlPermission.length === 0) {
return false;
}
const AUDIT_PERMSSION_ID = 14;
const AUDIT_PERMSSION_ID1 = 10000014;
const auditPermission = withdrawlPermission[0].sub_permissions.filter(
(item) => (item.id === AUDIT_PERMSSION_ID || item.id === AUDIT_PERMSSION_ID1)
);
return auditPermission.length !== 0;
},
},
};
</script>
<style lang="less" src="./index.less" scope></style>
\ No newline at end of file
...@@ -51,6 +51,22 @@ const withdrawalRoutes = [ ...@@ -51,6 +51,22 @@ const withdrawalRoutes = [
import( import(
/* webpackChunkName: "Withdrawal" */ "@/pages/Withdrawal/Role/role-detail" /* webpackChunkName: "Withdrawal" */ "@/pages/Withdrawal/Role/role-detail"
) )
},
{
path: "/op/withdrawal/h5",
name: "withdrawalh5",
component: () =>
import(
/* webpackChunkName: "Withdrawal" */ "@/pages/Withdrawal/Examine/h5"
)
},
{
path: "/op/withdrawal/withdrawDetail",
name: "withdrawDetail",
component: () =>
import(
/* webpackChunkName: "Withdrawal" */ "@/pages/Withdrawal/Examine/withdrawDetail"
)
} }
]; ];
......
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