Browse Source

这是11.2号的修改

Hongxilin
donghaolin 6 months ago
parent
commit
17f0c65d87
  1. 6
      vue/gold-system/src/views/consume/addConsume.vue
  2. 244
      vue/gold-system/src/views/consume/allConsume.vue
  3. 92
      vue/gold-system/src/views/managerecharge/rate.vue
  4. 7
      vue/gold-system/src/views/recharge/addRecharge.vue
  5. 76
      vue/gold-system/src/views/refund/addRefund.vue
  6. 88
      vue/gold-system/src/views/refund/allRefund.vue

6
vue/gold-system/src/views/consume/addConsume.vue

@ -82,8 +82,14 @@ const getUser = async function (jwcode) {
//
user.value = result.data.data[0];
console.log("用户信息", user.value);
if (result.data.code === 0) {
ElMessage.error(result.data.msg);
} else {
ElMessage.success(result.data.msg);
}
} catch (error) {
console.log("请求失败", error);
ElMessage.error("查询失败,请检查精网号是否正确");
//
}
};

244
vue/gold-system/src/views/consume/allConsume.vue

@ -12,7 +12,7 @@ const detailVo = ref({});
//
const getObj = ref({
pageNum: 1,
pageSize: 5,
pageSize: 10,
});
//
const total = ref(100);
@ -28,35 +28,36 @@ const area = ref([]);
//
const activeName = ref("all");
//
const payWay = [
//
const consumePlatform = [
{
value: "微信",
label: "微信",
value: "HomilyLink",
label: "HomilyLink",
},
{
value: "支付宝",
label: "支付宝",
value: "金币系统",
label: "金币系统",
},
{
value: "银联",
label: "银联",
value: "ERP系统",
label: "ERP系统",
},
{
value: "信用卡",
label: "信用卡",
value: "金币系统",
label: "金币系统",
},
];
const consumeType = [
{
value: "借记卡",
label: "借记卡",
value: "购买商品",
label: "购买商品",
},
];
//
const tableHeight = computed(function () {
return (getObj.value.pageSize + 2) * 60 + "px";
return (getObj.value.pageSize + 1) * 41 + "px";
});
//
// ==============================================================
//
@ -98,12 +99,11 @@ const get = async function (val) {
};
//
const reset = function () {
detailVo.value.activityId = "";
detailVo.value.payWay = "";
detailVo.value.area = "";
detailVo.value.goods = "";
detailVo.value.consumePlatform = "";
detailVo.value.consumeType = "";
detailVo.value.startDate = "";
detailVo.value.endDate = "";
get();
};
//
const getToday = function () {
@ -157,30 +157,6 @@ const get7Days = function () {
console.log("getTime", getTime.value);
get();
};
//
const adminAll = function () {
console.log("adminAll");
detailVo.value.status = "";
get();
};
//
const adminWait = function () {
detailVo.value.status = 0;
get();
console.log("adminWait");
};
//
const adminPass = function () {
detailVo.value.status = 1;
get();
console.log("adminPass");
};
//
const adminReject = function () {
detailVo.value.status = 2;
get();
console.log("adminReject");
};
//
const handleClick = function (tab, event) {
if (tab.props.name === "all") {
@ -193,52 +169,41 @@ const handleClick = function (tab, event) {
adminReject();
}
};
//
const getActivity = async function () {
try {
// POST
const result = await axios.post(
"http://192.168.8.93:10010/recharge/activity/select",
{}
);
//
console.log("请求成功", result);
//
activity.value = result.data.data;
console.log("activity", activity.value);
} catch (error) {
console.log("请求失败", error);
//
}
};
//
const getArea = async function () {
try {
// POST
const result = await axios.post(
"http://192.168.8.93:10010/recharge/recharge",
{}
);
//
console.log("请求成功", result);
//
allData.value = result.data.data;
console.log("allData", allData.value);
//
area.value = [...new Set(allData.value.map((item) => item.area))];
console.log("地区", area.value);
} catch (error) {
console.log("请求失败", error);
//
}
};
//
onMounted(async function () {
await get();
getActivity();
await getArea();
});
//
const checkNumber = function () {
if (typeof parseInt(getObj.value.pageNum) === "number") {
console.log(
"总共有多少页" + Math.ceil(total.value / getObj.value.pageSize)
);
if (
getObj.value.pageNum > 0 &&
getObj.value.pageNum <= Math.ceil(total.value / getObj.value.pageSize)
) {
console.log("输入的数字合法");
get();
} else {
//
ElMessage({
type: "error",
message: "请检查输入内容",
});
}
} else {
//
ElMessage({
type: "error",
message: "请检查输入内容",
});
}
};
</script>
<template>
@ -250,7 +215,7 @@ onMounted(async function () {
<div class="head-card-element">
<el-text class="mx-1" size="large">商品名称</el-text>
<el-select
v-model="detailVo.activityId"
v-model="detailVo.goods"
placeholder="请选择活动名称"
size="large"
style="width: 240px"
@ -268,13 +233,13 @@ onMounted(async function () {
<div class="head-card-element">
<el-text class="mx-1" size="large">消费平台</el-text>
<el-select
v-model="detailVo.payWay"
v-model="detailVo.consumePlatform"
placeholder="请选择支付方式"
size="large"
style="width: 240px"
>
<el-option
v-for="item in payWay"
v-for="item in consumePlatform"
:key="item.value"
:label="item.label"
:value="item.value"
@ -286,16 +251,16 @@ onMounted(async function () {
<div class="head-card-element">
<el-text class="mx-1" size="large">消费类型</el-text>
<el-select
v-model="detailVo.area"
placeholder="请选择所属地区"
v-model="detailVo.consumeType"
placeholder="请选择消费类型"
size="large"
style="width: 240px"
>
<el-option
v-for="item in area"
v-for="item in consumeType"
:key="item"
:label="item"
:value="item"
:label="item.label"
:value="item.value"
/>
</el-select>
</div>
@ -304,7 +269,7 @@ onMounted(async function () {
<el-row>
<el-col :span="21">
<div class="head-card-element">
<el-text class="mx-1" size="large">充值时间</el-text>
<el-text class="mx-1" size="large">消费时间</el-text>
<el-date-picker
v-model="getTime"
type="datetimerange"
@ -334,12 +299,16 @@ onMounted(async function () {
<el-card>
<div>
<el-table :data="tableData" :height="tableHeight" style="width: 100%">
<el-table-column prop="username" label="姓名" width="80px" />
<el-table-column prop="homilyId" label="精网号" width="180px" />
<el-table-column prop="userName" label="姓名" width="80px" />
<el-table-column prop="jwcode" label="精网号" width="180px" />
<el-table-column prop="area" label="所属地区" width="120px" />
<el-table-column prop="goods" label="商品名称" width="200px" />
<el-table-column
prop="consumPlatform"
prop="productName"
label="商品名称"
width="200px"
/>
<el-table-column
prop="consumePlatform"
label="消费平台"
width="120px"
/>
@ -352,7 +321,15 @@ onMounted(async function () {
prop="rechargeTotal"
label="消费金币总数"
width="180px"
/>
>
<template #default="scope">
{{
scope.row.taskCoin +
scope.row.freeCoin +
scope.row.rechargeCoin
}}
</template>
</el-table-column>
<el-table-column prop="taskCoin" label="任务金币" width="120px" />
<el-table-column prop="freeCoin" label="免费金币" width="120px" />
<el-table-column
@ -366,40 +343,52 @@ onMounted(async function () {
width="200px"
show-overflow-tooltip
/>
<el-table-column prop="conmmitName" label="提交人" width="120px" />
<el-table-column prop="adminName" label="提交人" width="120px" />
<el-table-column prop="createTime" label="消费时间" width="180px" />
<el-table-column prop="operation" label="操作">
<template #default="scope">
<el-popconfirm
title="确定将此条活动删除吗?"
@confirm="delConfirm"
>
<template #reference>
<el-button type="primary" text @click="del(scope.row)">
删除
</el-button>
</template>
<template #actions="{ confirm, cancel }">
<el-button size="small" @click="cancel">取消</el-button>
<el-button type="primary" size="small" @click="confirm">
确定
</el-button>
</template>
</el-popconfirm>
</template>
</el-table-column>
</el-table>
</div>
<!-- 分页 -->
<el-pagination
background
layout="prev, pager, next"
:total="total"
:page-size="getObj.pageSize"
:current-page="getObj.pageNum"
@current-change="get"
/>
<div class="pagination">
<el-pagination
background
:page-size="getObj.pageSize"
layout="slot"
:total="total"
>
<div>{{ total }},每页</div>
<el-select
v-model="getObj.pageSize"
class="page-size"
@change="get()"
style="width: 80px"
>
<el-option
v-for="item in [5, 6, 7, 8, 9, 10]"
:key="item"
:label="item"
:value="item"
></el-option>
</el-select>
<div></div>
</el-pagination>
<el-pagination
background
layout="prev, pager, next, slot"
:page-size="getObj.pageSize"
:total="total"
:current-page="getObj.pageNum"
@current-change="get"
>
<div>跳至</div>
<el-input
v-model="getObj.pageNum"
style="width: 40px"
@change="checkNumber"
/>
<div></div>
</el-pagination>
</div>
</el-card>
</el-col>
</el-row>
@ -421,4 +410,9 @@ onMounted(async function () {
.head-card-btn {
margin-left: auto;
}
.pagination {
display: flex;
margin-top: 20px;
margin-left: 33%;
}
</style>

92
vue/gold-system/src/views/managerecharge/rate.vue

@ -3,6 +3,7 @@ import { ref, onMounted, computed, reactive } from "vue";
import { ElMessageBox } from "element-plus";
import axios from "axios";
import { createApp } from "vue";
import moment from "moment";
const regeAdd = ref(false);
const regeEdit = ref(false);
@ -14,9 +15,15 @@ const getObj = ref({
pageNum: 1,
pageSize: 5,
});
const total = ref(0);
//
const get = async function () {
const get = async function (val) {
try {
//
if (typeof val === "number") {
getObj.value.pageNum = val;
}
console.log("搜索参数", getObj.value);
// POST
const result = await axios.post("http://192.168.8.174:10010/rates/search", {
@ -30,9 +37,9 @@ const get = async function () {
tableData.value = result.data.data.list;
console.log("tableData", tableData.value);
// UI
getObj.value.pageNum = result.data.data.pageNum;
getObj.value.pageSize = result.data.data.pageSize;
getObj.value.total = result.data.data.total;
//
total.value = result.data.data.total;
console.log("total", total.value);
} catch (error) {
console.log("请求失败", error);
//
@ -40,7 +47,9 @@ const get = async function () {
};
//
const rateAdd = ref({});
const rateAdd = ref({
adminId: "1",
});
const addRate = async function () {
try {
console.log("搜索参数", getObj.value);
@ -245,6 +254,34 @@ const rules = reactive({
{ validator: checkEndTime, trigger: "blur" },
],
});
//
const checkNumber = function () {
if (typeof parseInt(getObj.value.pageNum) === "number") {
console.log(
"总共有多少页" + Math.ceil(total.value / getObj.value.pageSize)
);
if (
getObj.value.pageNum > 0 &&
getObj.value.pageNum <= Math.ceil(total.value / getObj.value.pageSize)
) {
console.log("输入的数字合法");
get();
} else {
//
ElMessage({
type: "error",
message: "请检查输入内容",
});
}
} else {
//
ElMessage({
type: "error",
message: "请检查输入内容",
});
}
};
</script>
<template>
@ -342,12 +379,42 @@ const rules = reactive({
<div class="pagination">
<el-pagination
background
layout="prev, pager, next"
v-model:current-page="getObj.pageNum"
v-model:page-size="getObj.pageSize"
:total="getObj.total"
@change="handlePageChange"
/>
:page-size="getObj.pageSize"
layout="slot"
:total="total"
>
<div>{{ total }},每页</div>
<el-select
v-model="getObj.pageSize"
class="page-size"
@change="get()"
style="width: 80px"
>
<el-option
v-for="item in [5, 6, 7, 8, 9, 10]"
:key="item"
:label="item"
:value="item"
></el-option>
</el-select>
<div></div>
</el-pagination>
<el-pagination
background
layout="prev, pager, next, slot"
:page-size="getObj.pageSize"
:total="total"
:current-page="getObj.pageNum"
@current-change="get"
>
<div>跳至</div>
<el-input
v-model="getObj.pageNum"
style="width: 40px"
@change="checkNumber"
/>
<div></div>
</el-pagination>
</div>
</el-card>
</el-col>
@ -553,4 +620,7 @@ p {
.el-card {
padding: 0px;
}
.pagination {
display: flex;
}
</style>

7
vue/gold-system/src/views/recharge/addRecharge.vue

@ -10,6 +10,7 @@ import { ElMessageBox } from "element-plus";
const addRecharge = ref({
rechargeVoucher: "",
rechargeWay: "客服充值",
adminId: "1",
});
//
const add = async function () {
@ -88,8 +89,14 @@ const getUser = async function (jwcode) {
//
user.value = result.data.data[0];
console.log("用户信息", user.value);
if (result.data.code === 0) {
ElMessage.error(result.data.msg);
} else {
ElMessage.success(result.data.msg);
}
} catch (error) {
console.log("请求失败", error);
ElMessage.error("查询失败,请检查精网号是否正确");
//
}
};

76
vue/gold-system/src/views/refund/addRefund.vue

@ -7,13 +7,15 @@ import axios from "axios";
import { ElMessageBox } from "element-plus";
//
const addRefund = ref({});
const addRefund = ref({
adminId: "1",
});
//
const add = async function () {
try {
// POST
const result = await axios.post(
"http://192.168.8.93:10010/recharge/recharge/add",
"http://192.168.8.174:10040/refund/add",
addRefund.value
);
@ -33,7 +35,6 @@ const addBefore = () => {
.then(() => {
add();
console.log("添加成功");
imageUrl.value = "";
addRefund.value = {};
})
.catch(() => {
@ -83,42 +84,46 @@ const getUser = async function (jwcode) {
//
user.value = result.data.data[0];
console.log("用户信息", user.value);
if (result.data.code === 0) {
ElMessage.error(result.data.msg);
} else {
ElMessage.success(result.data.msg);
}
} catch (error) {
console.log("请求失败", error);
ElMessage.error("查询失败,请检查精网号是否正确");
//
}
};
const calculatedAllGold = computed(() => {
return (
addRefund.value.freeCoin +
addRefund.value.rechargeCoin +
addRefund.value.taskCoin
);
});
//
const currency = ref([]);
const getCurrency = async function () {
try {
// POST
const result = await axios.post(
"http://192.168.8.174:10010/rates/search",
{}
);
//
console.log("货币请求成功", result);
//
currency.value = result.data.data;
console.log("tableData", currency.value);
// UI
} catch (error) {
console.log("请求失败", error);
//
}
};
getCurrency();
const calculatedFreeGold = computed(() => {
return addRefund.value.paidGold * addRefund.value.activityId;
watch(calculatedAllGold, (newVal) => {
addRefund.value.allCoin = newVal;
});
watch(calculatedFreeGold, (newVal) => {
addRefund.value.freeGold = newVal;
const AAA = computed(() => {
return addRefund.value.jwcode;
});
watch(AAA, (newVal) => {});
// 退
const refundType = [
{
value: "退款商品",
label: "退款商品",
},
{
value: "退款金币",
label: "退款金币",
},
];
</script>
<template>
@ -147,10 +152,10 @@ watch(calculatedFreeGold, (newVal) => {
style="width: 300px"
>
<el-option
v-for="item in activity"
v-for="item in refundType"
:key="item.value"
:label="item.activityName"
:value="item.rechargeRatio"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
@ -198,7 +203,10 @@ watch(calculatedFreeGold, (newVal) => {
<p style="margin-right: 20px"></p>
</el-form-item>
<el-form-item prop="allCoin" label="退款金币总数">
<el-input disabled v-model="addRefund.allCoin" style="width: 100px" />
<el-input disabled v-model="addRefund.allCoin" style="width: 100px">
<template #default="scope">
<template #s> {{ taskCoin + freeCoin + rechargeCoin }} </template>
</el-input>
</el-form-item>
<el-form-item prop="remark" label="备注">
<el-input

88
vue/gold-system/src/views/refund/allRefund.vue

@ -3,6 +3,7 @@ import { ref, onMounted, reactive, computed } from "vue";
import ElementPlus from "element-plus";
import { AiFillRead } from "vue-icons-plus/ai";
import axios from "axios";
import moment from "moment";
//
//
const tableData = ref([]);
@ -28,27 +29,15 @@ const area = ref([]);
//
const activeName = ref("all");
//
const payWay = [
// 退
const consumeType = [
{
value: "微信",
label: "微信",
value: "退商品",
label: "退商品",
},
{
value: "支付宝",
label: "支付宝",
},
{
value: "银联",
label: "银联",
},
{
value: "信用卡",
label: "信用卡",
},
{
value: "借记卡",
label: "借记卡",
value: "退金币",
label: "退金币",
},
];
@ -98,8 +87,8 @@ const get = async function (val) {
};
//
const reset = function () {
rechargeVo.value.activityId = "";
rechargeVo.value.payWay = "";
rechargeVo.value.goods = "";
rechargeVo.value.consumeType = "";
rechargeVo.value.area = "";
rechargeVo.value.startDate = "";
rechargeVo.value.endDate = "";
@ -239,6 +228,30 @@ onMounted(async function () {
getActivity();
await getArea();
});
//
const delObj = ref({});
const del = function (row) {
delObj.value.detailId = row.detailId;
console.log("delObj", delObj.value);
};
//
const delConfirm = async function () {
try {
console.log("delObj", delObj.value);
// POST
const result = await axios.post(
"http://192.168.8.174:10040/refund/softDelete",
delObj.value
);
//
console.log("请求成功", result);
//
get();
} catch (error) {
console.log("请求失败", error);
//
}
};
</script>
<template>
@ -248,25 +261,25 @@ onMounted(async function () {
<el-row style="margin-bottom: 10px">
<el-col :span="8">
<div class="head-card-element">
<el-text class="mx-1" size="large">活动名称</el-text>
<el-text class="mx-1" size="large">退款类型</el-text>
<el-select
v-model="rechargeVo.activityId"
placeholder="请选择活动名称"
v-model="rechargeVo.consumeType"
placeholder="请选择退款类型"
size="large"
style="width: 240px"
>
<el-option
v-for="item in activity"
v-for="item in consumeType"
:key="item.activityId"
:label="item.activityName"
:value="item.activityId"
:label="item.label"
:value="item.value"
/>
</el-select>
</div>
</el-col>
<el-col :span="8">
<div class="head-card-element">
<el-text class="mx-1" size="large">支付方式</el-text>
<el-text class="mx-1" size="large">退款商品</el-text>
<el-select
v-model="rechargeVo.payWay"
placeholder="请选择支付方式"
@ -344,9 +357,14 @@ onMounted(async function () {
<el-tab-pane label="已驳回" name="reject"></el-tab-pane>
</el-tabs>
<div>
<el-table :data="tableData" :height="tableHeight" style="width: 100%">
<el-table-column prop="name" label="姓名" width="80px" />
<el-table-column prop="homilyId" label="精网号" width="180px" />
<el-table
:data="tableData"
v-if="(tableData.detailFlag = 1)"
:height="tableHeight"
style="width: 100%"
>
<el-table-column prop="user" label="姓名" width="80px" />
<el-table-column prop="jwcode" label="精网号" width="180px" />
<el-table-column prop="area" label="所属地区" width="120px" />
<el-table-column prop="refundType" label="退款类型" width="180px" />
<el-table-column
@ -377,7 +395,7 @@ onMounted(async function () {
width="200px"
show-overflow-tooltip
/>
<el-table-column prop="adminName" label="提交人" width="100px" />
<el-table-column prop="name" label="提交人" width="100px" />
<el-table-column prop="status" label="审核状态" width="120px">
<!-- 模板内容 -->
<template #default="scope">
@ -407,7 +425,11 @@ onMounted(async function () {
width="200px"
show-overflow-tooltip
/>
<el-table-column prop="createTime" label="提交时间" width="180px" />
<el-table-column prop="createTime" label="提交时间" width="180px">
<template #default="scope">
{{ moment(scope.row.createTime).format("YYYY-MM-DD HH:mm:ss") }}
</template>
</el-table-column>
<el-table-column
prop="operation"
label="操作"
@ -426,7 +448,7 @@ onMounted(async function () {
</template>
<template #actions="{ confirm, cancel }">
<el-button size="small" @click="cancel">取消</el-button>
<el-button type="primary" size="small" @click="confirm">
<el-button type="primary" size="small" @click="delConfirm">
确定
</el-button>
</template>

Loading…
Cancel
Save