|
|
@@ -1,11 +1,15 @@
|
|
|
<!--
|
|
|
PC 供货业绩:与小程序 cgStat 同源 /stat-cg-ghs/profile;
|
|
|
- 跨天采购售后按通过日扣实际金额(可为负,订单数不减)。
|
|
|
+ timeType 切换记账时间(bill) / 发货时间(send);跨天采购售后按通过日扣实际金额。
|
|
|
-->
|
|
|
<template>
|
|
|
<div class="shop-list">
|
|
|
<x-crud @load="onLoad">
|
|
|
<template #slot-date-select>
|
|
|
+ <el-button-group style="margin-right:12px;">
|
|
|
+ <el-button size="mini" :type="timeType === 'bill' ? 'primary' : 'default'" @click="changeTimeType('bill')">记账时间</el-button>
|
|
|
+ <el-button size="mini" :type="timeType === 'send' ? 'primary' : 'default'" @click="changeTimeType('send')">发货时间</el-button>
|
|
|
+ </el-button-group>
|
|
|
<el-date-picker v-model="currentDateList" type="daterange" align="right" unlink-panels range-separator="至" start-placeholder="开始日期" @change="getSearchDate" value-format="yyyy-MM-dd"
|
|
|
end-placeholder="结束日期" :picker-options="pickerOptions" size="mini"> </el-date-picker>
|
|
|
</template>
|
|
|
@@ -39,7 +43,7 @@
|
|
|
</template>
|
|
|
|
|
|
<template #slot-export-data>
|
|
|
- <el-button type="primary" size="mini" style="margin-left:60px;" @click="exportDue()">导出数据</el-button>
|
|
|
+ <el-button type="primary" size="mini" style="margin-left:60px;" @click="exportDue()">导出{{ timeTypeName }}</el-button>
|
|
|
</template>
|
|
|
|
|
|
<template #slot-column-option="{scope}">
|
|
|
@@ -94,6 +98,8 @@ export default {
|
|
|
startTime:'',
|
|
|
endTime:'',
|
|
|
searchTime:'',
|
|
|
+ // bill=记账 entryTime(默认) / send=发货 sendTime
|
|
|
+ timeType: 'bill',
|
|
|
totalActPrice:0,
|
|
|
totalOrderPrice:0,
|
|
|
totalCarton:0,
|
|
|
@@ -108,6 +114,10 @@ export default {
|
|
|
},
|
|
|
computed: {
|
|
|
...mapGetters(['shopInfo']),
|
|
|
+ /** 当前筛选口径文案,导出按钮与提示共用 */
|
|
|
+ timeTypeName() {
|
|
|
+ return this.timeType === 'send' ? '发货时间' : '记账时间'
|
|
|
+ },
|
|
|
},
|
|
|
methods: {
|
|
|
/** 数字展示:不用 truthy,避免 0/负数被当成空 */
|
|
|
@@ -124,6 +134,27 @@ export default {
|
|
|
}
|
|
|
return neg ? 'color:#e74c3c;font-weight:bold;' : '';
|
|
|
},
|
|
|
+ /** 与小程序 cgStat 对齐的查询参数 */
|
|
|
+ queryParams(extra) {
|
|
|
+ return {
|
|
|
+ searchTime: this.searchTime,
|
|
|
+ startTime: this.startTime,
|
|
|
+ endTime: this.endTime,
|
|
|
+ debt: this.debt,
|
|
|
+ timeType: this.timeType,
|
|
|
+ ...(extra || {})
|
|
|
+ };
|
|
|
+ },
|
|
|
+ /** 切换记账时间 / 发货时间并刷新 */
|
|
|
+ changeTimeType(type) {
|
|
|
+ if (this.timeType === type) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.timeType = type
|
|
|
+ if (this.app) {
|
|
|
+ this.app.refresh(this.queryParams())
|
|
|
+ }
|
|
|
+ },
|
|
|
getTkDetail(info){
|
|
|
let query = {ghsId:info.id,ghsName:info.name,searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,status:1};
|
|
|
this.$router.push({ path: '/in/refund-list', query })
|
|
|
@@ -138,7 +169,7 @@ export default {
|
|
|
this.$router.push({ path: '/in/list', query });
|
|
|
},
|
|
|
exportDue(){
|
|
|
- this.$service.statCgGhs.getProfile({searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,debt:this.debt,export:1}).then(res => {
|
|
|
+ this.$service.statCgGhs.getProfile(this.queryParams({export:1})).then(res => {
|
|
|
if(res.file){
|
|
|
window.location.href = res.file
|
|
|
}
|
|
|
@@ -148,7 +179,7 @@ export default {
|
|
|
this.app = app;
|
|
|
ctx.service({
|
|
|
page: () => {
|
|
|
- return this.$service.statCgGhs.getProfile({searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,debt:this.debt}).then((res) => {
|
|
|
+ return this.$service.statCgGhs.getProfile(this.queryParams()).then((res) => {
|
|
|
this.totalActPrice = this.formatNum(res.totalActPrice)
|
|
|
this.totalOrderPrice = this.formatNum(res.totalOrderPrice)
|
|
|
this.totalCarton = this.formatNum(res.totalCarton)
|
|
|
@@ -239,11 +270,11 @@ export default {
|
|
|
this.searchTime = 'custom'
|
|
|
this.startTime = this.currentDateList[0]
|
|
|
this.endTime = this.currentDateList[1]
|
|
|
- this.app.refresh({searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,debt:this.debt});
|
|
|
+ this.app.refresh(this.queryParams());
|
|
|
},
|
|
|
changeDebt(e){
|
|
|
this.debt = e
|
|
|
- this.app.refresh({searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,debt:this.debt})
|
|
|
+ this.app.refresh(this.queryParams())
|
|
|
},
|
|
|
},
|
|
|
};
|