|
@@ -29,7 +29,7 @@
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
|
<a-form-model-item label="地区">
|
|
|
- <Area id="regionTypeBusinessReportList-areaList" v-model="queryParam.dealerEntity.provinceSn" placeholder="请选择省份"></Area>
|
|
|
+ <Area id="regionTypeBusinessReportList-areaList" v-model="queryParam.provinceSn" @change="areaChange" placeholder="请选择省份"></Area>
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
@@ -90,8 +90,9 @@ import { STable, VSelect } from '@/components'
|
|
|
import Area from '@/views/common/area.js'
|
|
|
import reportModal from '@/views/common/reportModal.vue'
|
|
|
import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
|
|
|
+import getDate from '@/libs/getDate'
|
|
|
// 接口
|
|
|
-import { tireFeeReportList, tireFeeListExport } from '@/api/reportData'
|
|
|
+import { manageAnalysisReportQuery, manageAnalysisReportExport } from '@/api/reportData'
|
|
|
export default {
|
|
|
name: 'RegionTypeBusinessReportList',
|
|
|
mixins: [commonMixin],
|
|
@@ -107,13 +108,12 @@ export default {
|
|
|
monthVal: moment().format('YYYY-MM'), // 初始化月份值
|
|
|
// 查询条件
|
|
|
queryParam: {
|
|
|
- queryType: 'month', // 月度
|
|
|
queryDate: moment().format('YYYYMM'), // 选择月份
|
|
|
- customSn: undefined, // 客户sn
|
|
|
- dealerEntity: {
|
|
|
- dealerName: undefined, // 客户名称
|
|
|
- provinceSn: undefined // 省
|
|
|
- }
|
|
|
+ beginDate: getDate.getCurrLastMonthDays().starttime, // 开始日期
|
|
|
+ endDate: getDate.getCurrLastMonthDays().endtime, // 结束日期
|
|
|
+ dealerName: undefined, // 客户名称
|
|
|
+ provinceName: undefined, // 省
|
|
|
+ provinceSn: undefined
|
|
|
},
|
|
|
rules: {
|
|
|
'queryDate': [{ required: true, message: '请选择查询月份', trigger: 'change' }]
|
|
@@ -122,17 +122,13 @@ export default {
|
|
|
loadData: parameter => {
|
|
|
this.disabled = true
|
|
|
this.spinning = true
|
|
|
- const params = Object.assign(parameter, this.queryParam)
|
|
|
+ const { beginDate, endDate, dealerName, provinceName } = this.queryParam
|
|
|
+ const params = Object.assign(parameter, { beginDate, endDate, dealerName, provinceName })
|
|
|
// 获取列表数据 有分页
|
|
|
- return tireFeeReportList(params).then(res => {
|
|
|
+ return manageAnalysisReportQuery(params).then(res => {
|
|
|
let data
|
|
|
if (res.status == 200) {
|
|
|
data = res.data
|
|
|
- // 计算表格序号
|
|
|
- const no = (data.pageNo - 1) * data.pageSize
|
|
|
- for (var i = 0; i < data.list.length; i++) {
|
|
|
- data.list[i].no = no + i + 1
|
|
|
- }
|
|
|
this.disabled = false
|
|
|
}
|
|
|
this.spinning = false
|
|
@@ -155,14 +151,14 @@ export default {
|
|
|
computed: {
|
|
|
columns () {
|
|
|
const arr = [
|
|
|
- { title: '类别', dataIndex: 'subareaArea.subareaName', width: '20%', align: 'center', customRender: function (text) { return (text || text == 0) || '--' } },
|
|
|
- { title: '成本', dataIndex: 'dealerEntity.dealerName', width: '10%', align: 'center', customRender: function (text) { return (text || text == 0) || '--' } },
|
|
|
- { title: '销售额', dataIndex: 'dealerEntity.dealerLevelDictValue', width: '10%', align: 'center', customRender: function (text) { return (text || text == 0) || '--' } },
|
|
|
- { title: '毛利', dataIndex: 'parentDealerEntity.dealerName', width: '10%', align: 'center', customRender: function (text) { return (text || text == 0) || '--' } },
|
|
|
- { title: '毛利率', dataIndex: 'increaseRewardAmount', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '促销费用', dataIndex: 'increaseRewardShareFactory', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '减促销费用的毛利', dataIndex: 'serviceAmountSys', width: '15%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '促销费用占比', dataIndex: 'serviceAmountProvince', width: '15%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
|
|
|
+ { title: '类别', dataIndex: 'category', width: '20%', align: 'center', customRender: function (text) { return (text || text == 0) || '--' } },
|
|
|
+ { title: '成本', dataIndex: 'cost', width: '10%', align: 'center', customRender: function (text) { return (text || text == 0) || '--' } },
|
|
|
+ { title: '销售额', dataIndex: 'amount', width: '10%', align: 'center', customRender: function (text) { return (text || text == 0) || '--' } },
|
|
|
+ { title: '毛利', dataIndex: 'gross', width: '10%', align: 'center', customRender: function (text) { return (text || text == 0) || '--' } },
|
|
|
+ { title: '毛利率', dataIndex: 'grossMargin', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '促销费用', dataIndex: 'promo', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '减促销费用的毛利', dataIndex: 'removePromoGross', width: '15%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '促销费用占比', dataIndex: 'promoRatio', width: '15%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
|
|
|
]
|
|
|
return arr
|
|
|
}
|
|
@@ -177,8 +173,13 @@ export default {
|
|
|
this.monthVal = dateString
|
|
|
if (date && dateString != '') {
|
|
|
this.queryParam.queryDate = dateString.replace('-', '')
|
|
|
+ const { beginDate, endDate } = getDate.getBeDateByMonth(dateString)
|
|
|
+ this.queryParam.beginDate = beginDate
|
|
|
+ this.queryParam.endDate = endDate
|
|
|
} else {
|
|
|
this.queryParam.queryDate = void 0
|
|
|
+ this.queryParam.beginDate = undefined
|
|
|
+ this.queryParam.endDate = undefined
|
|
|
}
|
|
|
},
|
|
|
// 查询
|
|
@@ -195,17 +196,21 @@ export default {
|
|
|
},
|
|
|
// 客户名称 change
|
|
|
custChange (val) {
|
|
|
- this.queryParam.dealerEntity.dealerName = val.name
|
|
|
- this.queryParam.customSn = val.key
|
|
|
+ this.queryParam.dealerName = val.name
|
|
|
+ },
|
|
|
+ // 地区
|
|
|
+ areaChange (val, item) {
|
|
|
+ this.queryParam.provinceName = item.name
|
|
|
},
|
|
|
// 重置
|
|
|
resetSearchForm () {
|
|
|
- this.queryParam.queryType = 'month'
|
|
|
this.monthVal = moment().format('YYYY-MM')
|
|
|
this.queryParam.queryDate = moment().format('YYYYMM')
|
|
|
- this.queryParam.dealerEntity.provinceSn = undefined
|
|
|
- this.queryParam.dealerEntity.dealerName = undefined
|
|
|
- this.queryParam.customSn = undefined
|
|
|
+ this.queryParam.provinceName = undefined
|
|
|
+ this.queryParam.provinceSn = undefined
|
|
|
+ this.queryParam.dealerName = undefined
|
|
|
+ this.queryParam.beginDate = getDate.getCurrLastMonthDays().starttime
|
|
|
+ this.queryParam.endDate = getDate.getCurrLastMonthDays().endtime
|
|
|
if (this.$refs.dealerSubareaScopeList) {
|
|
|
this.$refs.dealerSubareaScopeList.resetForm()
|
|
|
}
|
|
@@ -219,7 +224,7 @@ export default {
|
|
|
if (valid) {
|
|
|
_this.exportList()
|
|
|
} else {
|
|
|
- _this.$message.error('请选择查询月份')
|
|
|
+ _this.$message.error('请选择月份')
|
|
|
return false
|
|
|
}
|
|
|
})
|
|
@@ -231,7 +236,7 @@ export default {
|
|
|
_this.exportLoading = true
|
|
|
_this.spinning = true
|
|
|
_this.showExport = true
|
|
|
- hdExportExcel(tireFeeListExport, params, '各品类经营分析表-' + this.monthVal, function () {
|
|
|
+ hdExportExcel(manageAnalysisReportExport, params, '各品类经营分析表-' + this.monthVal, function () {
|
|
|
_this.exportLoading = false
|
|
|
_this.spinning = false
|
|
|
})
|