Compare commits
2 Commits
86dc894f2f
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 2a457fc076 | |||
| 7943cf2cb5 |
@@ -212,25 +212,36 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
getAmount(d, index, month) {
|
||||
if (!month || !month.total || !Array.isArray(month.total)) {
|
||||
return "0";
|
||||
}
|
||||
|
||||
if (d.val === "other") {
|
||||
const list = month.total.filter(item => {
|
||||
return (
|
||||
item.type === d.realTitle &&
|
||||
(item.payMethod === "" || item.payMethod === "其他")
|
||||
);
|
||||
});
|
||||
|
||||
if (!list.length) {
|
||||
return "0";
|
||||
}
|
||||
|
||||
return list.reduce((sum, item) => {
|
||||
const val = Number(item.amount || 0);
|
||||
return sum + (isNaN(val) ? 0 : val);
|
||||
}, 0);
|
||||
}
|
||||
|
||||
// 定义所有可能的匹配规则
|
||||
const matchRules = [
|
||||
item => {
|
||||
// 例如:当类型是特定值时,启用特殊匹配
|
||||
if (d.val == "other" && item.payMethod == "") {
|
||||
return `${item.type}` === d.realTitle;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
item => item.type === d.title,
|
||||
item => item.type === d.realTitle,
|
||||
item => `${item.payMethod}${item.type}` === d.realTitle,
|
||||
item => `${item.type}${item.payMethod}` === d.realTitle,
|
||||
item => `${item.type}${item.goodsType}` === d.realTitle
|
||||
// 更复杂的条件组合
|
||||
];
|
||||
|
||||
// 依次检查每个规则,返回第一个匹配项
|
||||
for (const rule of matchRules) {
|
||||
const matchedItem = month.total.find(rule);
|
||||
if (matchedItem) {
|
||||
@@ -238,7 +249,6 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
// 没有匹配项时返回空字符串
|
||||
return "0";
|
||||
},
|
||||
async handleExportAll() {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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, // 库存
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
// api接口请求地址
|
||||
// window.SITE_CONFIG['baseUrl'] = 'https://api.nuttyreading.com'; // 线上正式环境
|
||||
window.SITE_CONFIG['baseUrl'] = 'http://192.168.110.100:9200/pb'; //川
|
||||
window.SITE_CONFIG['baseUrl'] = 'http://192.168.110.100:9200/pb'; // 川
|
||||
|
||||
// cdn地址 = 域名 + 版本号
|
||||
window.SITE_CONFIG['domain'] = './'; // 域名
|
||||
|
||||
Reference in New Issue
Block a user