|
|
|
|
@ -13,6 +13,7 @@
|
|
|
|
|
end-placeholder="结束日期"
|
|
|
|
|
>
|
|
|
|
|
</el-date-picker>
|
|
|
|
|
<el-button type="primary" size="mini" @click="handleExport">导出<i class="el-icon-download"></i></el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<el-table
|
|
|
|
|
@ -29,15 +30,17 @@
|
|
|
|
|
>
|
|
|
|
|
<el-table-column
|
|
|
|
|
align="center"
|
|
|
|
|
min-width="50"
|
|
|
|
|
min-width="80"
|
|
|
|
|
prop="storeNum"
|
|
|
|
|
label="门店编码"
|
|
|
|
|
fixed='left'
|
|
|
|
|
></el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
align="center"
|
|
|
|
|
min-width="50"
|
|
|
|
|
min-width="80"
|
|
|
|
|
prop="storeName"
|
|
|
|
|
label="门店名称"
|
|
|
|
|
fixed='left'
|
|
|
|
|
></el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
align="center"
|
|
|
|
|
@ -45,13 +48,13 @@
|
|
|
|
|
:key="index"
|
|
|
|
|
:label="item.label"
|
|
|
|
|
:prop="item.prop"
|
|
|
|
|
width="60"
|
|
|
|
|
width="80"
|
|
|
|
|
></el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import { exportStoreDailys,exportStore } from "@/api/statistics.js";
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
@ -96,105 +99,47 @@ export default {
|
|
|
|
|
this.init()
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
handleExport(){
|
|
|
|
|
let params = {
|
|
|
|
|
startDate:this.days[0],
|
|
|
|
|
endDate:this.days[1]
|
|
|
|
|
}
|
|
|
|
|
exportStore(params).then(res=>{
|
|
|
|
|
console.log(res)
|
|
|
|
|
let blob = new Blob([res]);
|
|
|
|
|
var a = document.createElement("a");
|
|
|
|
|
var url = window.URL.createObjectURL(blob);
|
|
|
|
|
a.href = url;
|
|
|
|
|
a.download = "收款总汇表.xlsx";
|
|
|
|
|
a.click();
|
|
|
|
|
window.URL.revokeObjectURL(url);
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
init() {
|
|
|
|
|
this.loading = true
|
|
|
|
|
let res = {
|
|
|
|
|
list: [
|
|
|
|
|
{
|
|
|
|
|
cashPeopleNum: 0,
|
|
|
|
|
cashMoney: 0,
|
|
|
|
|
courseMoney: 0,
|
|
|
|
|
courseOrderNum: 0,
|
|
|
|
|
rechargeMoney: 2000.0,
|
|
|
|
|
rechargeOrderNum: 2,
|
|
|
|
|
repayMoney: 0,
|
|
|
|
|
refundMoney: 0,
|
|
|
|
|
cashRefundMoney: 0,
|
|
|
|
|
newMemberNum: 0,
|
|
|
|
|
memberNum: 6,
|
|
|
|
|
recNegativeMoney: 2000.0,
|
|
|
|
|
startMemberNum: 6,
|
|
|
|
|
woman: 0,
|
|
|
|
|
man: 0,
|
|
|
|
|
date: "2023-01-12",
|
|
|
|
|
cashierCashMoney: 0,
|
|
|
|
|
cashierCardMoney: 0,
|
|
|
|
|
cashlMoney: 0,
|
|
|
|
|
coursexMoney: 0,
|
|
|
|
|
coursekMoney: 0,
|
|
|
|
|
recRepay: null,
|
|
|
|
|
recRepayMoney: 0,
|
|
|
|
|
courseRepay: null,
|
|
|
|
|
courseRepayMoney: 0,
|
|
|
|
|
promotionCourseRepay: null,
|
|
|
|
|
promotionCourseRepayMoney: 0,
|
|
|
|
|
changeInPayMoney: 0,
|
|
|
|
|
rechargeMoneys: 2000.0,
|
|
|
|
|
coursexMoneys: 0,
|
|
|
|
|
cashierCashMoneys: 0,
|
|
|
|
|
grouponCounts: 0.0,
|
|
|
|
|
grouponMoney: 0.0,
|
|
|
|
|
sumList:[10,100,0]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
cashPeopleNum: 0,
|
|
|
|
|
cashMoney: 0,
|
|
|
|
|
courseMoney: 0,
|
|
|
|
|
courseOrderNum: 0,
|
|
|
|
|
rechargeMoney: 2000.0,
|
|
|
|
|
rechargeOrderNum: 2,
|
|
|
|
|
repayMoney: 0,
|
|
|
|
|
refundMoney: 0,
|
|
|
|
|
cashRefundMoney: 0,
|
|
|
|
|
newMemberNum: 0,
|
|
|
|
|
memberNum: 6,
|
|
|
|
|
recNegativeMoney: 2000.0,
|
|
|
|
|
startMemberNum: 6,
|
|
|
|
|
woman: 0,
|
|
|
|
|
man: 0,
|
|
|
|
|
date: "2023-01-12",
|
|
|
|
|
cashierCashMoney: 0,
|
|
|
|
|
cashierCardMoney: 0,
|
|
|
|
|
cashlMoney: 0,
|
|
|
|
|
coursexMoney: 0,
|
|
|
|
|
coursekMoney: 0,
|
|
|
|
|
recRepay: null,
|
|
|
|
|
recRepayMoney: 0,
|
|
|
|
|
courseRepay: null,
|
|
|
|
|
courseRepayMoney: 0,
|
|
|
|
|
promotionCourseRepay: null,
|
|
|
|
|
promotionCourseRepayMoney: 0,
|
|
|
|
|
changeInPayMoney: 0,
|
|
|
|
|
rechargeMoneys: 2000.0,
|
|
|
|
|
coursexMoneys: 0,
|
|
|
|
|
cashierCashMoneys: 0,
|
|
|
|
|
grouponCounts: 0.0,
|
|
|
|
|
grouponMoney: 0.0,
|
|
|
|
|
sumList:[100,10000]
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
exportList: [
|
|
|
|
|
{
|
|
|
|
|
label: "1-1",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "1-2",
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
};
|
|
|
|
|
this.list = res.exportList
|
|
|
|
|
this.tableDate = res.list
|
|
|
|
|
this.$nextTick(()=>{
|
|
|
|
|
res.list.forEach((item,index)=>{
|
|
|
|
|
res.list.forEach((item,index)=>{
|
|
|
|
|
this.list[index].prop = 'sum'+index
|
|
|
|
|
let params = {
|
|
|
|
|
startDate:this.days[0],
|
|
|
|
|
endDate:this.days[1]
|
|
|
|
|
}
|
|
|
|
|
exportStoreDailys(params).then(res=>{
|
|
|
|
|
this.loading = false
|
|
|
|
|
if(res.code == '000000'){
|
|
|
|
|
this.$nextTick(()=>{
|
|
|
|
|
this.list = res.data.exportList.map((item,index)=>{
|
|
|
|
|
return{
|
|
|
|
|
label:item,
|
|
|
|
|
prop:`sum${index}`
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
item.sumList.forEach((item2,index2)=>{
|
|
|
|
|
this.$set(this.tableDate[index],`sum${index2}`,item2)
|
|
|
|
|
this.tableDate = res.data.list
|
|
|
|
|
res.data.list.forEach((item,index)=>{
|
|
|
|
|
item.sumList.forEach((item2,index2)=>{
|
|
|
|
|
this.$set(this.tableDate[index],`sum${index2}`,item2.sum)
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
this.loading = false
|
|
|
|
|
},
|
|
|
|
|
// 获取当月第一天至今的时间
|
|
|
|
|
defaultDate(){
|
|
|
|
|
@ -214,64 +159,9 @@ export default {
|
|
|
|
|
changeMonth(date) {
|
|
|
|
|
if (!date) {
|
|
|
|
|
} else {
|
|
|
|
|
this.init()
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
currentMonthDays() {
|
|
|
|
|
// 获取标准时间
|
|
|
|
|
const date = new Date();
|
|
|
|
|
// 获取当天日期
|
|
|
|
|
const currentDay = date.getDate();
|
|
|
|
|
// 获取当前月份(实际月份需要加1)
|
|
|
|
|
const currentMonth =
|
|
|
|
|
date.getMonth() + 1 < 10 ? date.getMonth() + 1 : date.getMonth() + 1;
|
|
|
|
|
// 获取当前年份
|
|
|
|
|
const currentYear = date.getFullYear();
|
|
|
|
|
// 获取当前月有多少天
|
|
|
|
|
const currentMonthDays = new Date(currentYear, currentMonth, 0).getDate();
|
|
|
|
|
// 当前月份所有日期集合
|
|
|
|
|
const currentMonthArr = [];
|
|
|
|
|
for (let day = 1; day <= currentMonthDays; day++) {
|
|
|
|
|
// 截至当前日期为止
|
|
|
|
|
if (day <= currentDay) {
|
|
|
|
|
// 年月日(yyyy-MM-dd)
|
|
|
|
|
// let dateItem = currentYear + "-" + currentMonth + "-" + (day < 10 ? '0' + day : day)
|
|
|
|
|
let dateItem = currentMonth + "-" + (day < 10 ? "0" + day : day);
|
|
|
|
|
currentMonthArr.push(dateItem);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return currentMonthArr;
|
|
|
|
|
},
|
|
|
|
|
// 获取所有日期
|
|
|
|
|
getDayAll(starDay, endDay) {
|
|
|
|
|
let arr = [];
|
|
|
|
|
let dates = [];
|
|
|
|
|
// 设置两个日期UTC时间
|
|
|
|
|
let db = new Date(starDay);
|
|
|
|
|
let de = new Date(endDay);
|
|
|
|
|
// 获取两个日期GTM时间
|
|
|
|
|
let s = db.getTime() - 24 * 60 * 60 * 1000;
|
|
|
|
|
let d = de.getTime() - 24 * 60 * 60 * 1000;
|
|
|
|
|
|
|
|
|
|
// 获取到两个日期之间的每一天的毫秒数
|
|
|
|
|
for (let i = s; i <= d; ) {
|
|
|
|
|
i = i + 24 * 60 * 60 * 1000;
|
|
|
|
|
arr.push(parseInt(i));
|
|
|
|
|
}
|
|
|
|
|
// 获取每一天的时间 YY-MM-DD
|
|
|
|
|
for (let j in arr) {
|
|
|
|
|
let time = new Date(arr[j]);
|
|
|
|
|
let year = time.getFullYear(time);
|
|
|
|
|
let mouth =
|
|
|
|
|
time.getMonth() + 1 >= 10
|
|
|
|
|
? time.getMonth() + 1
|
|
|
|
|
: "0" + (time.getMonth() + 1);
|
|
|
|
|
let day = time.getDate() >= 10 ? time.getDate() : "0" + time.getDate();
|
|
|
|
|
let YYMMDD = mouth + "-" + day;
|
|
|
|
|
// let YYMMDD = year + '-' + mouth + '-' + day;
|
|
|
|
|
dates.push(YYMMDD);
|
|
|
|
|
}
|
|
|
|
|
return dates;
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|