This commit is contained in:
duan 2025-03-12 17:22:02 +08:00
commit aeb4268a56
15 changed files with 178 additions and 120 deletions

View File

@ -6,19 +6,17 @@ const API = {
return request({ return request({
url: `${baseURL}`, url: `${baseURL}`,
method: "get", method: "get",
headers: { params: {
shopId: shopId shopId: shopId
} }
}); });
}, },
edit(shopId: string | number, data: shopMerchantType) { edit(shopId: string | number, data: shopMerchantType) {
delete data.id
return request({ return request({
url: `${baseURL}`, url: `${baseURL}`,
method: "put", method: "put",
data: data, data: { ...data, shopId },
headers: {
shopId: shopId
}
}); });
} }
} }

View File

@ -24,7 +24,9 @@ const Api = {
return request<any>({ return request<any>({
url: `${baseURL}/export`, url: `${baseURL}/export`,
method: "get", method: "get",
params params,
responseType: 'blob'
}); });
}, },
}; };

View File

@ -16,7 +16,8 @@ const Api = {
return request<any>({ return request<any>({
url: `${baseURL}/export`, url: `${baseURL}/export`,
method: "get", method: "get",
params params,
responseType: 'blob'
}); });
}, },
}; };

Binary file not shown.

After

Width:  |  Height:  |  Size: 521 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 389 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 495 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 548 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 502 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 490 B

View File

@ -32,7 +32,7 @@ const router = useRouter();
* 打开个人中心页面 * 打开个人中心页面
*/ */
function handleOpenUserProfile() { function handleOpenUserProfile() {
router.push({ name: "Profile" }); router.push({ name: "shopConfig" });
} }
/** /**

View File

@ -67,8 +67,7 @@
range-separator="至" range-separator="至"
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期" end-placeholder="结束日期"
:default-time="['00:00:00', '23:59:59']" value-format="YYYY-MM-DD "
value-format="yyyy-MM-dd HH:mm:ss"
v-if="timeValue == 'custom'" v-if="timeValue == 'custom'"
@change="summarytrade" @change="summarytrade"
></el-date-picker> ></el-date-picker>
@ -84,12 +83,40 @@
<el-tooltip popper-class="popper" effect="light" placement="bottom"> <el-tooltip popper-class="popper" effect="light" placement="bottom">
<template #content> <template #content>
<div class="tips_row"> <div class="tips_row">
<div class="item" v-for="(item, index) in payCount" :key="index"> <div class="item">
<div class="left"> <div class="left">
<img class="icon" :src="item.icon" /> <img class="icon" src="@/assets/images/data/wx.png" />
<span>{{ item.payType }}</span> <span>微信小程序</span>
</div> </div>
<span class="num">{{ item.payAmount }}</span> <span class="num">{{ trade.wechatPayCount }}</span>
</div>
<div class="item">
<div class="left">
<img class="icon" src="@/assets/images/data/ali.png" />
<span>支付宝小程序</span>
</div>
<span class="num">{{ trade.aliPayCount }}</span>
</div>
<div class="item">
<div class="left">
<img class="icon" src="@/assets/images/data/scan.png" />
<span>主扫收款</span>
</div>
<span class="num">{{ trade.scanPayCount }}</span>
</div>
<div class="item">
<div class="left">
<img class="icon" src="@/assets/images/data/cash.png" />
<span>现金</span>
</div>
<span class="num">{{ trade.cashPayCount }}</span>
</div>
<div class="item">
<div class="left">
<img class="icon" src="@/assets/images/data/cash.png" />
<span>挂账</span>
</div>
<span class="num">{{ trade.creditPayCount }}</span>
</div> </div>
</div> </div>
</template> </template>
@ -298,8 +325,8 @@
<el-table :data="saleTable" v-loading="saleTableLoading" style="width: 100%"> <el-table :data="saleTable" v-loading="saleTableLoading" style="width: 100%">
<!-- <el-table-column label="排名" prop="productId"></el-table-column> --> <!-- <el-table-column label="排名" prop="productId"></el-table-column> -->
<el-table-column label="商品名称" prop="productName"></el-table-column> <el-table-column label="商品名称" prop="productName"></el-table-column>
<el-table-column label="数量" prop="salesNum"></el-table-column> <el-table-column label="数量" prop="number"></el-table-column>
<el-table-column label="金额" prop="salesAmount"></el-table-column> <el-table-column label="金额" prop="amount"></el-table-column>
</el-table> </el-table>
<div <div
class="head-container" class="head-container"
@ -308,7 +335,7 @@
<el-pagination <el-pagination
:total="saleTableTotal" :total="saleTableTotal"
:page-size="saleTableSize" :page-size="saleTableSize"
:current-page="saleTablePage + 1" :current-page="saleTablePage"
@current-change="paginationChange" @current-change="paginationChange"
layout="total, prev, pager, next, jumper" layout="total, prev, pager, next, jumper"
></el-pagination> ></el-pagination>
@ -405,7 +432,7 @@ export default {
saleTableActive: "7", saleTableActive: "7",
saleTable: [], saleTable: [],
saleTableLoading: false, saleTableLoading: false,
saleTablePage: 0, saleTablePage: 1,
saleTableTotal: 0, saleTableTotal: 0,
saleTableSize: 5, saleTableSize: 5,
__resizeHandler: null, __resizeHandler: null,
@ -526,8 +553,8 @@ export default {
try { try {
this.tradeLoading = true; this.tradeLoading = true;
const res = await dataSummaryApi.trade({ const res = await dataSummaryApi.trade({
beginTime: this.query.createdAt[0], beginDate: this.query.createdAt[0],
endTime: this.query.createdAt[1], endDate: this.query.createdAt[1],
}); });
this.trade = res; this.trade = res;
this.tradeLoading = false; this.tradeLoading = false;
@ -868,23 +895,20 @@ export default {
} }
}, },
paginationChange(e) { paginationChange(e) {
this.saleTablePage = e - 1; this.saleTablePage = e;
this.dateProduct(); this.dateProduct();
}, },
// //
async dateProduct() { async dateProduct() {
try { try {
this.saleTableLoading = true; this.saleTableLoading = true;
const res = await dataSummaryApi.productSaleDate( const res = await dataSummaryApi.productSaleDate({
this.saleTableActive, day: this.saleTableActive,
this.saleTablePage, page: this.saleTablePage,
this.saleTableSize size: this.saleTableSize,
); });
this.saleTable = res.productList.content; this.saleTable = res.records;
this.saleTableTotal = res.productList.totalElements; this.saleTableTotal = res.totalRow * 1;
this.productCount = res.productCount.payAmount;
this.productSum = res.productSum.payAmount;
this.summaryDateGet(res.countList); this.summaryDateGet(res.countList);
setTimeout(() => { setTimeout(() => {
this.saleTableLoading = false; this.saleTableLoading = false;

View File

@ -8,10 +8,10 @@
<el-form :model="query" inline label-position="left"> <el-form :model="query" inline label-position="left">
<template v-if="orderType == 2"> <template v-if="orderType == 2">
<el-form-item> <el-form-item>
<el-input placeholder="商品名称" v-model="query.proName" /> <el-input placeholder="商品名称" v-model="query.productName" />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-select v-model="query.cateId" placeholder="商品分类" style="width: 140px"> <el-select v-model="query.prodCategoryId" placeholder="商品分类" style="width: 140px">
<el-option <el-option
:label="item.name" :label="item.name"
:value="item.id" :value="item.id"
@ -23,14 +23,14 @@
</template> </template>
<el-form-item> <el-form-item>
<el-radio-group v-model="timeValue" @change="timeChange"> <el-radio-group v-model="timeValue" @change="timeChange">
<el-radio-button label="">全部</el-radio-button> <el-radio-button value="">全部</el-radio-button>
<el-radio-button label="0">今天</el-radio-button> <el-radio-button value="0">今天</el-radio-button>
<el-radio-button label="-1">昨天</el-radio-button> <el-radio-button value="-1">昨天</el-radio-button>
<el-radio-button label="-7">最近7天</el-radio-button> <el-radio-button value="-7">最近7天</el-radio-button>
<el-radio-button label="-30">最近30天</el-radio-button> <el-radio-button value="-30">最近30天</el-radio-button>
<el-radio-button label="week">本周</el-radio-button> <el-radio-button value="week">本周</el-radio-button>
<el-radio-button label="month">本月</el-radio-button> <el-radio-button value="month">本月</el-radio-button>
<el-radio-button label="custom">自定义</el-radio-button> <el-radio-button value="custom">自定义</el-radio-button>
</el-radio-group> </el-radio-group>
<el-date-picker <el-date-picker
v-model="query.createdAt" v-model="query.createdAt"
@ -46,7 +46,7 @@
<el-form-item> <el-form-item>
<el-button type="primary" @click="getTableData">查询</el-button> <el-button type="primary" @click="getTableData">查询</el-button>
<el-button @click="resetHandle">重置</el-button> <el-button @click="resetHandle">重置</el-button>
<el-button icon="el-icon-download" v-loading="downloadLoading" @click="downloadHandle"> <el-button icon="download" v-loading="downloadLoading" @click="downloadHandle">
<span v-if="!downloadLoading">导出Excel</span> <span v-if="!downloadLoading">导出Excel</span>
<span v-else>下载中...</span> <span v-else>下载中...</span>
</el-button> </el-button>
@ -55,16 +55,40 @@
</div> </div>
<div class="head-container"> <div class="head-container">
<div class="collect_wrap"> <div class="collect_wrap">
<div class="item" v-for="item in payCountList" :key="item.id"> <div class="item">
<div class="icon_wrap" style="--bg-color: #c978ee"> <div class="icon_wrap" style="--bg-color: #c978ee">
<i class="icon" :class="item.icon"></i> <el-icon color="#fff"><Coin /></el-icon>
</div> </div>
<div class="info"> <div class="info">
<div class="m"> <div class="m">{{ payCount.totalAmount || 0 }}</div>
<template v-if="item.isAmount == 1"></template> <div class="t">总金额</div>
{{ item.payAmount }} </div>
</div> </div>
<div class="t">{{ item.payType }}</div> <div class="item">
<div class="icon_wrap" style="--bg-color: #c978ee">
<el-icon color="#fff"><Coin /></el-icon>
</div>
<div class="info">
<div class="m">{{ payCount.refundAmount || 0 }}</div>
<div class="t">退款金额</div>
</div>
</div>
<div class="item">
<div class="icon_wrap" style="--bg-color: #c978ee">
<el-icon color="#fff"><ShoppingCartFull /></el-icon>
</div>
<div class="info">
<div class="m">{{ payCount.saleCount || 0 }}</div>
<div class="t">总数量</div>
</div>
</div>
<div class="item">
<div class="icon_wrap" style="--bg-color: #c978ee">
<el-icon color="#fff"><ShoppingCart /></el-icon>
</div>
<div class="info">
<div class="m">{{ payCount.refundCount || 0 }}</div>
<div class="t">退单量</div>
</div> </div>
</div> </div>
</div> </div>
@ -109,13 +133,13 @@
<!-- <el-table-column label="商品分类" prop="cateName"></el-table-column> <!-- <el-table-column label="商品分类" prop="cateName"></el-table-column>
<el-table-column label="商品描述" prop="productSkuName"></el-table-column> <el-table-column label="商品描述" prop="productSkuName"></el-table-column>
<el-table-column label="单价" prop="price"></el-table-column> --> <el-table-column label="单价" prop="price"></el-table-column> -->
<el-table-column label="商品名称" prop="name"></el-table-column> <el-table-column label="商品名称" prop="productName"></el-table-column>
<el-table-column label="销量" prop="salesNum"></el-table-column> <el-table-column label="销量" prop="saleCount"></el-table-column>
<el-table-column label="销售金额" prop="salesAmount"> <el-table-column label="销售金额" prop="saleAmount">
<template v-slot="scope">{{ scope.row.salesAmount }}</template> <template v-slot="scope">{{ scope.row.salesAmount }}</template>
</el-table-column> </el-table-column>
<el-table-column label="退单量" prop="refNum"></el-table-column> <el-table-column label="退单量" prop="refundCount"></el-table-column>
<el-table-column label="退款金额" prop="refAmount"> <el-table-column label="退款金额" prop="refundAmount">
<template v-slot="scope">{{ scope.row.refAmount }}</template> <template v-slot="scope">{{ scope.row.refAmount }}</template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -148,18 +172,18 @@ export default {
categorys: [], categorys: [],
query: { query: {
createdAt: [], createdAt: [],
proName: "", productName: "",
cateId: "", prodCategoryId: "",
}, },
tableData: { tableData: {
data: [], data: [],
page: 0, page: 1,
size: 10, size: 10,
loading: false, loading: false,
total: 0, total: 0,
}, },
downloadLoading: false, downloadLoading: false,
payCountList: "", payCount: "",
payCountTotal: 0, payCountTotal: 0,
}; };
}, },
@ -195,14 +219,14 @@ export default {
async daycount() { async daycount() {
try { try {
const res = await saleSummaryApi.count({ const res = await saleSummaryApi.count({
startTime: this.query.createdAt[0], beginDate: this.query.createdAt[0],
endTime: this.query.createdAt[1], endDate: this.query.createdAt[1],
cateId: this.query.cateId, prodCategoryId: this.query.prodCategoryId,
proName: this.query.proName, productName: this.query.productName,
type: this.orderType, type: this.orderType,
}); });
this.payCountList = res; this.payCount = res;
} catch (error) { } catch (error) {
console.log(error); console.log(error);
} }
@ -211,12 +235,11 @@ export default {
async downloadHandle() { async downloadHandle() {
try { try {
this.downloadLoading = true; this.downloadLoading = true;
const file = await daydownload({ const file = await saleSummaryApi.export({
type: this.orderType, beginDate: this.query.createdAt[0],
startTime: this.query.createdAt[0], endDate: this.query.createdAt[1],
endTime: this.query.createdAt[1], prodCategoryId: this.query.prodCategoryId,
cateId: this.query.cateId, productName: this.query.productName,
proName: this.query.proName,
}); });
downloadFile(file, "数据", "xlsx"); downloadFile(file, "数据", "xlsx");
this.downloadLoading = false; this.downloadLoading = false;
@ -250,10 +273,10 @@ export default {
page: this.tableData.page, page: this.tableData.page,
size: this.tableData.size, size: this.tableData.size,
type: this.orderType, type: this.orderType,
startTime: this.query.createdAt[0], beginDate: this.query.createdAt[0],
endTime: this.query.createdAt[1], endDate: this.query.createdAt[1],
proName: this.query.proName, productName: this.query.productName,
cateId: this.query.cateId, prodCategoryId: this.query.prodCategoryId,
}); });
this.tableData.loading = false; this.tableData.loading = false;
this.tableData.data = res.records; this.tableData.data = res.records;

View File

@ -6,32 +6,36 @@
</el-tabs> --> </el-tabs> -->
<div class="head-container"> <div class="head-container">
<el-form :model="query" inline label-position="left"> <el-form :model="query" inline label-position="left">
<el-radio-group v-model="timeValue" @change="timeChange"> <div class="u-flex gap-10">
<el-radio-button label="">全部</el-radio-button> <el-radio-group v-model="timeValue" @change="timeChange">
<el-radio-button label="0">今天</el-radio-button> <el-radio-button value="">全部</el-radio-button>
<el-radio-button label="-1">昨天</el-radio-button> <el-radio-button value="0">今天</el-radio-button>
<el-radio-button label="-7">最近7天</el-radio-button> <el-radio-button value="-1">昨天</el-radio-button>
<el-radio-button label="-30">最近30天</el-radio-button> <el-radio-button value="-7">最近7天</el-radio-button>
<el-radio-button label="week">本周</el-radio-button> <el-radio-button value="-30">最近30天</el-radio-button>
<el-radio-button label="month">本月</el-radio-button> <el-radio-button value="week">本周</el-radio-button>
<el-radio-button label="custom">自定义</el-radio-button> <el-radio-button value="month">本月</el-radio-button>
</el-radio-group> <el-radio-button value="custom">自定义</el-radio-button>
<el-date-picker </el-radio-group>
v-model="query.createdAt" <div>
type="daterange" <el-date-picker
range-separator="至" v-model="query.createdAt"
start-placeholder="开始日期" type="daterange"
end-placeholder="结束日期" range-separator="至"
value-format="YYYY-MM-DD" start-placeholder="开始日期"
></el-date-picker> end-placeholder="结束日期"
<el-form-item> value-format="YYYY-MM-DD"
<el-button type="primary" @click="getTableData">查询</el-button> ></el-date-picker>
<el-button @click="resetHandle">重置</el-button> </div>
<el-button icon="el-icon-download" v-loading="downloadLoading" @click="downloadHandle"> <div>
<span v-if="!downloadLoading">导出Excel</span> <el-button type="primary" @click="getTableData">查询</el-button>
<span v-else>下载中...</span> <el-button @click="resetHandle">重置</el-button>
</el-button> <el-button icon="download" v-loading="downloadLoading" @click="downloadHandle">
</el-form-item> <span v-if="!downloadLoading">导出Excel</span>
<span v-else>下载中...</span>
</el-button>
</div>
</div>
</el-form> </el-form>
</div> </div>
<!-- <div class="head-container"> <!-- <div class="head-container">
@ -113,7 +117,7 @@ export default {
}, },
tableData: { tableData: {
data: [], data: [],
page: 0, page: 1,
size: 10, size: 10,
loading: false, loading: false,
total: 0, total: 0,
@ -149,8 +153,8 @@ export default {
try { try {
this.downloadLoading = true; this.downloadLoading = true;
const file = await tableSummaryApi.export({ const file = await tableSummaryApi.export({
startTime: this.query.createdAt[0], beginDate: this.query.createdAt[0],
endTime: this.query.createdAt[1], endDate: this.query.createdAt[1],
}); });
downloadFile(file, "数据", "xlsx"); downloadFile(file, "数据", "xlsx");
this.downloadLoading = false; this.downloadLoading = false;
@ -163,7 +167,7 @@ export default {
resetHandle() { resetHandle() {
this.timeValue = ""; this.timeValue = "";
this.query = { ...this.resetQuery }; this.query = { ...this.resetQuery };
this.page = 0; this.page = 1;
this.getTableData(); this.getTableData();
}, },
// //
@ -173,17 +177,17 @@ export default {
}, },
// //
paginationChange(e) { paginationChange(e) {
this.tableData.page = e - 1; this.tableData.page = e;
this.getTableData(); this.getTableData();
}, },
async getTableData() { async getTableData() {
this.tableData.loading = true; this.tableData.loading = true;
try { try {
const res = await tableSummaryApi.list({ const res = await tableSummaryApi.list({
page: this.tableData.page + 1, page: this.tableData.page,
size: this.tableData.size, size: this.tableData.size,
startTime: this.query.createdAt[0], beginDate: this.query.createdAt[0],
endTime: this.query.createdAt[1], endDate: this.query.createdAt[1],
}); });
this.tableData.loading = false; this.tableData.loading = false;
this.tableData.data = res; this.tableData.data = res;

View File

@ -7,11 +7,11 @@
<div class="bullshit__oops">OOPS</div> <div class="bullshit__oops">OOPS</div>
<div class="bullshit__info"> <div class="bullshit__info">
该页面无法访问 该页面无法访问
<a style="color: #20a0ff" href="/" target="_blank">返回首页</a> <a style="color: #20a0ff" href="/">返回首页</a>
</div> </div>
<div class="bullshit__headline">抱歉您访问的页面不存在</div> <div class="bullshit__headline">抱歉您访问的页面不存在</div>
<div class="bullshit__info">请确认您输入的网址是否正确或者点击下方按钮返回首页</div> <div class="bullshit__info">请确认您输入的网址是否正确或者点击下方按钮返回首页</div>
<a href="#" class="bullshit__return-home" @click.prevent="back">返回首页</a> <a href="/" class="bullshit__return-home">返回首页</a>
</div> </div>
</div> </div>
</template> </template>

View File

@ -6,8 +6,11 @@
<el-form-item label="店铺id"> <el-form-item label="店铺id">
<el-input v-model="form.storeId" placeholder="请输入店铺id"></el-input> <el-input v-model="form.storeId" placeholder="请输入店铺id"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="商户号"> <el-form-item label="商户名称">
<el-input v-model="form.appId" placeholder="请输入商户号"></el-input> <el-input v-model="form.merchantName" placeholder="请输入支付系统商户名称"></el-input>
</el-form-item>
<el-form-item label="商户应用id">
<el-input v-model="form.appId" placeholder="请输入商户应用id"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="商户密钥"> <el-form-item label="商户密钥">
<el-input <el-input
@ -82,6 +85,7 @@ export default {
alipayAppToken: "", alipayAppToken: "",
alipayAppId: "", alipayAppId: "",
}, },
shopId: "",
}; };
}, },
methods: { methods: {
@ -89,7 +93,7 @@ export default {
async submitHandle() { async submitHandle() {
this.formLoading = true; this.formLoading = true;
try { try {
await shopMerchantApi.edit(this.form.id, this.form); await shopMerchantApi.edit(this.shopId, this.form);
this.$emit("success"); this.$emit("success");
this.formLoading = false; this.formLoading = false;
ElNotification({ ElNotification({
@ -112,22 +116,24 @@ export default {
this.form.payPassword = ""; this.form.payPassword = "";
this.form.status = 1; this.form.status = 1;
this.form.appId = ""; this.form.appId = "";
this.shopId = "";
}, },
// //
async getDetail(id) { async getDetail(id) {
console.log(id); console.log(id);
this.shopId = id;
try { try {
const res = await shopMerchantApi.get(id); const res = await shopMerchantApi.get(id);
this.form.appSecret = res.appSecret; this.form.appSecret = res.appSecret || "";
this.form.payPassword = res.payPassword; this.form.payPassword = res.payPassword || "";
this.form.status = res.status; this.form.status = res.status || "";
this.form.appId = res.appId; this.form.appId = res.appId || "";
this.form.wechatSmallAppid = res.wechatSmallAppid; this.form.wechatSmallAppid = res.wechatSmallAppid || "";
this.form.alipaySmallAppid = res.alipaySmallAppid; this.form.alipaySmallAppid = res.alipaySmallAppid || "";
this.form.merchantName = res.merchantName; this.form.merchantName = res.merchantName || "";
//this.form.alipayAppToken = res.alipayAppToken //this.form.alipayAppToken = res.alipayAppToken
//this.form.alipayAppId = res.alipayAppId //this.form.alipayAppId = res.alipayAppId
this.form.storeId = res.storeId; this.form.storeId = res.storeId || "";
this.dialogVisible = true; this.dialogVisible = true;
} catch (error) { } catch (error) {
console.log(error); console.log(error);