Commit 2bd2e81c authored by mengwenhao's avatar mengwenhao

Merge branch 'test' of https://git.yidian-inc.com:8021/bp/op-web-service into dev

parents 8c30900d 958c8ec4
This diff is collapsed.
......@@ -450,7 +450,7 @@
">购买后不允许退款</span>
<span v-else-if="
$route.params.operation !== 'EDIT' && goodsObj.rule_refund === 3
">到期后不退款</span>
">到期后不允许退款</span>
</el-form-item>
<el-form-item label="使用日期:">
<el-radio-group
......@@ -737,9 +737,9 @@ export default {
rulesForm: {
// 退款选项
rulesOptions: [
{ value: 1, label: "到期自动退款" },
{ value: 1, label: "到期自动退款" },
{ value: 2, label: "购买后不允许退款" },
{ value: 3, label: "到期后不退款" }
{ value: 3, label: "到期后不允许退款" }
],
useStartTime: "", // 使用开始时间
useEndTime: "", // 使用结束时间
......
......@@ -49,7 +49,7 @@
<!-- 页码区 -->
<Pagination
@current-change="handleCurrentChange"
v-model.current-page="page"
v-model:current-page="page"
:page-size="pageSize"
:total="total"
></Pagination>
......@@ -111,8 +111,8 @@
clearable
placeholder="请选择配送工具"
>
<el-option label="电动车" value="0"></el-option>
<el-option label="摩托车" value="1"></el-option>
<el-option label="电动车" value="1"></el-option>
<el-option label="摩托车" value="2"></el-option>
</el-select>
</el-form-item>
</el-form>
......@@ -297,6 +297,8 @@ export default {
const { name, max_capacity, min_capacity, tool_type } = this.addDeliverer;
if (!name) return ElMessage("请填写配送员姓名");
if (!max_capacity) return ElMessage("请填写配送上限");
if (min_capacity !== '' && min_capacity <= 0) return ElMessage("最小配送量不能为0或小于0");
if (!min_capacity) return ElMessage("请填写最小配送量");
if (!tool_type) return ElMessage("请选择配送工具");
const params = {
name,
......@@ -305,7 +307,8 @@ export default {
tool_type: +tool_type,
};
try {
await getAddDeliverer(params);
const {code, reason} = await getAddDeliverer(params);
if(code !== 0) return this.$message.error(reason || "添加配送员失败")
ElMessage("添加配送员成功");
this.getDelivererList();
this.dialogFormAdd = false;
......@@ -339,7 +342,7 @@ export default {
this.selectActivity = code;
console.log(code);
try {
const res = await getDelivererList({ code });
const res = await getDelivererList({ code});
this.deliverer = res.response;
this.isEdit = true;
this.getList();
......@@ -365,9 +368,11 @@ export default {
const { selectActivity, multipleSelection } = this;
const uids = multipleSelection.map((item) => item.deliverer_id);
if (!selectActivity) return ElMessage("请选择活动姓名");
// if (!uids.length) return this.$message.info("请至少选择一名骑手");
try {
await getSaveDeliverer({ code: selectActivity, uids: uids.join(",") });
ElMessage("分配配送员成功");
const {code, reason} = await getSaveDeliverer({ code: selectActivity, uids: uids.join(",") });
if(code !== 0) return this.$message.error(reason || (this.isEdit ? "修改配送员失败":"分配配送员失败"))
ElMessage(this.isEdit ? "修改配送员成功":"分配配送员成功");
this.dialogFormAssign = false;
this.isEdit = false;
this.getList();
......
......@@ -158,13 +158,11 @@
v-show="
scope.row.order_status == '2' ||
scope.row.order_status == '6' ||
scope.row.order_status == '8'
scope.row.order_status == '8'
"
>退款</el-button
>
<el-button-group
v-show="scope.row.order_status == '3'"
>
<el-button-group v-show="scope.row.order_status == '3'">
<el-button type="text" size="small" @click="agree(scope.row)"
>同意</el-button
>
......@@ -177,7 +175,7 @@
</el-table>
<page
@current-change="handleCurrentChange"
v-model.current-page="orderQueryObj.page"
:current-page="orderQueryObj.page"
:page-size="orderQueryObj.page_size"
:total="totalNum"
/>
......@@ -246,14 +244,13 @@
size="small"
@click="refund(scope.row)"
v-show="
scope.row.order_status_text == '已支付' ||
scope.row.order_status_text == '已拒绝'
scope.row.order_status == '2' ||
scope.row.order_status == '6' ||
scope.row.order_status == '8'
"
>退款</el-button
>
<el-button-group
v-show="scope.row.order_status_text == '待退款'"
>
<el-button-group v-show="scope.row.order_status == '3'">
<el-button type="text" size="small" @click="agree(scope.row)"
>同意</el-button
>
......@@ -266,7 +263,7 @@
</el-table>
<page
@current-change="handleCurrentChange"
v-model.current-page="orderQueryObj.page"
:current-page="orderQueryObj.page"
:page-size="orderQueryObj.page_size"
:total="totalNum"
/>
......@@ -325,6 +322,7 @@
>
<el-row>
<el-checkbox
class="check-wrap"
v-model="item.refundedGoodsSel"
:label="item.goods_name"
name="type"
......@@ -341,12 +339,11 @@
v-model="item.refundableQuantity"
@change="handleChange"
:min="0"
:max="item.goods_num"
label="描述文字"
:max="item.goods_num - item.refund_count"
></el-input-number>
</el-row>
<el-row>
退款金额(可退金额{{ item.payment }}元):
退款金额(可退金额{{ item.amountToRefund }}元):
<el-input
v-model="item.amountToRefund"
style="width: 150px"
......@@ -495,7 +492,7 @@ export default {
methods: {
activityNameFocus() {
this.getOrderListMet();
this.getMarketingListMet();
},
// 获取活动名称
......@@ -509,20 +506,27 @@ export default {
}
},
// 获取商品名称
// 活动名称的change事件 获取商品名称+获取自提点
async activityNameSel(val) {
this.orderQueryObj.goods_id = "";
const params = {
marketing_id: val,
};
const res = await getGoodsList(params);
const res = await getGoodsList(params); // 商品名称
this.getSubShopListMet(val) //自提点
// const res = await getSubShopList(params);
this.tradeNameArr = res.result;
// this.selLiftPoinArr = res.result;
},
// 获取自提点
async getSubShopListMet() {
async getSubShopListMet(params) {
try {
const res = await getSubShopList();
let marketing_id = ''
if(params){
marketing_id = params
}
const res = await getSubShopList({'marketing_id':marketing_id});
this.selLiftPoinArr = res.result;
} catch (error) {
this.$message.error("发生未知错误,请稍后再试一下吧~~~");
......@@ -698,8 +702,10 @@ export default {
res.result[i].goods_num - res.result[i].refund_count
);
this.refundGoods[i].payment = Number(
res.result[i].payment - res.result[i].refund_amount
res.result[i].payment
//res.result[i].payment - res.result[i].refund_amount
);
// console.log( res.result[i]);
this.refundGoods[i].amountToRefund = Number(
res.result[i].payment - res.result[i].refund_amount
);
......@@ -751,11 +757,20 @@ export default {
},
},
created() {
this.getMarketingListMet();
this.getSubShopListMet();
this.getOrderListMet();
this.getMarketingListMet(); // 活动名称
this.getSubShopListMet(); // 自提点
this.getOrderListMet(); // table列表
},
};
</script>
<style lang="less" src="./index.less" scope></style>
<style lang="less" scoped>
.check-wrap{
/deep/ .el-checkbox__label {
white-space: normal;
word-break: break-all;
}
}
</style>
<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 @@
.commodity_list {
margin-top: 30px;
}
.pagination {
margin-top: 30px;
}
}
.pagination {
margin-top: 30px;
}
.listShow {
// padding-left: 60px;
......@@ -83,4 +82,29 @@
}
.el-card__body{
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="200"
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">
<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
>
<!-- <el-button
size="small"
@click="handleBlackList('白名单')"
>白名单</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,
};
},
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 () => {
try {
const res = await urlObj[action](params);
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);
},
},
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 = [
import(
/* 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"
)
}
];
......
......@@ -50,8 +50,10 @@ export async function getGoodsList(params) {
}
// 获取自提点
export async function getSubShopList() {
const res = await axios.get("/api/v1/order/background/sub_shop_list");
export async function getSubShopList(params) {
const res = await axios.get("/api/v1/order/background/sub_shop_list",{
params
});
return res;
}
......
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