feat(商品管理/报表): 新增微信支付商户选择功能并优化实物报表

- 在商品添加/编辑页面增加微信支付商户选择(众妙之门/灵枢教育科技)
- 优化实物报表组件,支持按支付商户类型筛选和导出数据
- 修复报表组件中数据可能为空的显示问题
- 调整商品重量输入框的样式布局
This commit is contained in:
2026-02-03 09:22:39 +08:00
parent 86dc894f2f
commit 7943cf2cb5
4 changed files with 77 additions and 50 deletions

View File

@@ -5,7 +5,7 @@
>
<div v-if="allMonthData.length>0"
@click="handleExportAll()"
style="position: absolute;left: 360px;top:30px;cursor: pointer;color: #006699;font-size: 14px;"
style="position: absolute;left: 360px;top:85px;cursor: pointer;color: #006699;font-size: 14px;"
>
<i class="el-icon-download"></i>下载 {{ selectYear }} 年全部实物报表
</div>
@@ -67,7 +67,9 @@
>共计{{
allMonthData[mIndex].total.filter(
item => item.payType == d.title
)[0].count
)[0] ? allMonthData[mIndex].total.filter(
item => item.payType == d.title
)[0].count : 0
}}</span
>
@@ -75,7 +77,9 @@
>{{
allMonthData[mIndex].total.filter(
item => item.payType == d.title
)[0].totalPrice
)[0] ? allMonthData[mIndex].total.filter(
item => item.payType == d.title
)[0].totalPrice : 0
}}
</span>
</div>
@@ -119,7 +123,11 @@ export default {
urlList: {
type: Object,
default: () => ({})
}
},
merchantType: {
type: String,
default: '0'
},
},
data() {
return {
@@ -156,8 +164,8 @@ export default {
},
async created() {
await this.getMonthsByYear(this.selectYear);
await this.fetchAllMonthData();
// await this.getMonthsByYear(this.selectYear);
// await this.fetchAllMonthData();
},
methods: {
async handleExportAll() {
@@ -175,7 +183,7 @@ export default {
return this.$http({
url: this.$http.adornUrl(this.urlList.export),
method: "post",
data: this.$http.adornData({ date:this.$commonJS.getDate(this.selectYear,m) }),
data: this.$http.adornData({ date:this.$commonJS.getDate(this.selectYear,m), orderType: this.merchantType }),
responseType: "blob"
})
.then(res => {
@@ -235,7 +243,8 @@ export default {
url: this.$http.adornUrl(this.urlList.export),
method: "post",
data: this.$http.adornData({
date:this.$commonJS.getDate(this.selectYear,this.pad(mIndex))
date:this.$commonJS.getDate(this.selectYear,this.pad(mIndex)),
orderType: this.merchantType
}),
responseType: "blob" // ⚡⚡⚡一定要加上
}).then(res => {
@@ -292,7 +301,7 @@ export default {
return this.$http({
url: this.$http.adornUrl(this.urlList.list),
method: "post",
data: this.$http.adornData({ date: this.$commonJS.getDate(year,m) })
data: this.$http.adornData({ date: this.$commonJS.getDate(year,m), orderType: this.merchantType })
})
.then(res => {
if (res.data && res.data.code === 0) {

View File

@@ -1,41 +1,35 @@
<template>
<div class="mod-config">
<el-tabs v-model="merchantType" type="card" @tab-click="changeTab">
<el-tab-pane label="众妙之门" name="order" />
<el-tab-pane label="灵枢教育科技" name="lsorder" />
</el-tabs>
<el-form
:inline="true"
:model="dataForm"
@keyup.enter.native="getDataList()"
>
<el-form-item>
<div class="block">
<el-date-picker
v-model="currentYear"
type="year"
format="yyyy"
value-format="yyyy" :picker-options="pickerOptions"
placeholder="选择年份"
@change="handleYearChange"
/>
</div>
<div class="block">
<el-date-picker
v-model="currentYear"
type="year"
format="yyyy"
value-format="yyyy" :picker-options="pickerOptions"
placeholder="选择年份"
@change="handleYearChange"
/>
</div>
</el-form-item>
<el-button
type="primary"
size="small"
@click="
handleYearChange();
"
>刷新</el-button
>
type="primary"
size="small"
@click=" handleYearChange()"
>刷新</el-button>
</el-form>
<FullYearCalendar :urlList="urlList" ref="refCalendar" :selectYear="Number(currentYear)" :marks="markedDates" v-if="currentYear" />
<FullYearCalendar :urlList="urlList" ref="refCalendar" :selectYear="Number(currentYear)" :marks="markedDates" :merchantType="orderType" v-if="currentYear" />
</div>
</template>
@@ -45,29 +39,31 @@
data() {
return {
urlList:{
list:'/master/statistics/getPhysicalBuyOrderInfoTotal',
export:'/master/statistics/exportPhysicalBuyOrderInfo',
list:'/master/statistics/getPhysicalBuyOrderInfoTotal',
export:'/master/statistics/exportPhysicalBuyOrderInfo',
},
currentYear: '',
merchantType:'order',
orderType:'order',
dataForm:{},
pickerOptions: {
disabledDate(time) {
// 禁用今年以后的年份
return time.getFullYear() > new Date().getFullYear()
}
},
disabledDate(time) {
// 禁用今年以后的年份
return time.getFullYear() > new Date().getFullYear()
}
},
markedDates: {
"2019-01-01": "red",
"2019-02-14": "blue",
"2019-03-12": "yellow",
"2019-05-20": "blue",
"2019-06-10": "yellow"
}
"2019-01-01": "red",
"2019-02-14": "blue",
"2019-03-12": "yellow",
"2019-05-20": "blue",
"2019-06-10": "yellow"
}
};
},
components: { FullYearCalendar },
activated() {
this.currentYear = new Date().getFullYear().toString();
this.currentYear = new Date().getFullYear().toString();
this.handleYearChange();
},
@@ -77,7 +73,13 @@ export:'/master/statistics/exportPhysicalBuyOrderInfo',
this.$refs.refCalendar.init();
})
},
changeTab(tab) {
if (tab.name === this.orderType) {
return;
}
this.orderType = tab.name;
this.handleYearChange();
}
}

View File

@@ -174,6 +174,12 @@
<el-radio :label="0"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="微信支付商户" prop="payMerchant">
<el-radio-group v-model="dataForm.payMerchant">
<el-radio :label="0">众妙之门</el-radio>
<el-radio :label="1">灵枢教育科技</el-radio>
</el-radio-group>
</el-form-item>
</div>
<el-form-item label="商品详情" prop="productDetails">
<el-upload
@@ -282,6 +288,7 @@ export default {
// format: '', // 开本
isFreeMail: 1, // 是否包邮
isVipPrice: 1, //是否vip
payMerchant: 0, // 微信支付商户
// pageNum: '',
// quality: '', // 内文用纸
isNew: 0,

View File

@@ -160,7 +160,7 @@
v-model="dataForm.weight"
placeholder="商品重量"
></el-input
><span style="display: inline-block; float: right; width: 10%;"
><span style="float: right; width: 10%;"
></span
>
</el-form-item>
@@ -224,6 +224,12 @@
<el-radio :label="0"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="微信支付商户" prop="payMerchant">
<el-radio-group v-model="dataForm.payMerchant">
<el-radio :label="0">众妙之门</el-radio>
<el-radio :label="1">灵枢教育科技</el-radio>
</el-radio-group>
</el-form-item>
</div>
<el-form-item label="商品详情" prop="productDetails">
<el-upload
@@ -326,6 +332,7 @@ export default {
// format: '', // 开本
isFreeMail: 1, // 是否包邮
isVipPrice: 0, //是否vip
payMerchant: 0, // 微信支付商户
// pageNum: '',
// quality: '', // 内文用纸
isNew: 0,
@@ -517,6 +524,7 @@ export default {
// this.dataForm.format = data.shopProduct.format
this.dataForm.isFreeMail = data.shopProduct.isFreeMail;
this.dataForm.isNew = data.shopProduct.isNew;
this.dataForm.payMerchant = data.shopProduct.payMerchant;
this.dataForm.productDetails = data.shopProduct.productDetails;
this.dataForm.poids = data.shopProduct.poids;
this.dataForm.productStock = data.shopProduct.productStock;
@@ -633,6 +641,7 @@ export default {
isFreeMail: this.dataForm.isFreeMail,
isVipPrice: this.dataForm.isVipPrice,
isNew: this.dataForm.isNew,
payMerchant: this.dataForm.payMerchant, // 微信支付商户
// 'pageNum': this.dataForm.pageNum,
// 'quality': this.dataForm.quality, // 内文用纸
productStock: this.dataForm.productStock, // 库存