|
@@ -5,6 +5,7 @@
|
|
|
<a-tab-pane key="1" tab="促销销售单报表">
|
|
|
<a-card size="small" :bordered="false" class="promotionSalesRealTimeReport-wrap searchBoxNormal">
|
|
|
<div ref="tableSearch" class="table-page-search-wrapper newTableSearchName">
|
|
|
+ <!-- 查询条件 -->
|
|
|
<a-form-model
|
|
|
layout="inline"
|
|
|
ref="ruleForm"
|
|
@@ -17,7 +18,6 @@
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
|
- <!-- :disabledDate="disabledDate" -->
|
|
|
<a-form-model-item label="促销开始时间">
|
|
|
<a-range-picker
|
|
|
style="width:100%"
|
|
@@ -103,9 +103,9 @@
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24" v-show="isShowCustomerSearch">
|
|
|
- <a-form-item label="客服">
|
|
|
+ <a-form-model-item label="客服">
|
|
|
<customerService ref="customerName" v-model="queryParam.bizUserSn"></customerService>
|
|
|
- </a-form-item>
|
|
|
+ </a-form-model-item>
|
|
|
</a-col>
|
|
|
</template>
|
|
|
<a-col :md="isShowCustomerSearch?24:6" :sm="24" :style="{textAlign: isShowCustomerSearch?'center':''}">
|
|
@@ -195,17 +195,18 @@
|
|
|
|
|
|
<script>
|
|
|
import { commonMixin } from '@/utils/mixin'
|
|
|
+import getDate from '@/libs/getDate.js'
|
|
|
+import { hdExportExcel } from '@/libs/exportExcel'
|
|
|
+// 组件
|
|
|
import { STable, VSelect } from '@/components'
|
|
|
import reportModal from '@/views/common/reportModal.vue'
|
|
|
-import { salesPromoReportList, salesPromoReportQueryCount, exportSalesPromoReport } from '@/api/reportData'
|
|
|
-import { hdExportExcel } from '@/libs/exportExcel'
|
|
|
import gatherList from './list'
|
|
|
import rangeDate from '@/views/common/rangeDate.vue'
|
|
|
-import getDate from '@/libs/getDate.js'
|
|
|
import subarea from '@/views/common/subarea.js'
|
|
|
import AreaList from '@/views/common/areaList.js'
|
|
|
import customerService from '@/views/common/customerService'
|
|
|
-// import moment from 'moment'
|
|
|
+// 接口
|
|
|
+import { salesPromoReportList, salesPromoReportQueryCount, exportSalesPromoReport } from '@/api/reportData'
|
|
|
export default {
|
|
|
name: 'PriceDifferenceDetailReportList',
|
|
|
mixins: [commonMixin],
|
|
@@ -213,10 +214,11 @@ export default {
|
|
|
data () {
|
|
|
const _this = this
|
|
|
return {
|
|
|
- advanced: true, // 高级搜索 展开/关闭
|
|
|
- time: undefined,
|
|
|
spinning: false,
|
|
|
+ advanced: true, // 高级搜索 展开/关闭
|
|
|
+ time: undefined, // 促销开始时间
|
|
|
queryParam: {
|
|
|
+ // 促销审核时间默认值
|
|
|
salesDate: [
|
|
|
getDate.getCurrMonthDays().starttime,
|
|
|
getDate.getCurrMonthDays().endtime
|
|
@@ -234,25 +236,25 @@ export default {
|
|
|
buyerLevel: undefined, // 客户级别
|
|
|
buyerName: '', // 客户名称
|
|
|
subareaArea: {
|
|
|
- subareaSn: '',
|
|
|
- subareaAreaSn: ''
|
|
|
+ subareaSn: '', // 区域
|
|
|
+ subareaAreaSn: ''// 分区
|
|
|
},
|
|
|
dealerProvinceSn: undefined, // 省份编码
|
|
|
dealerCitySn: undefined, // 城市编码
|
|
|
dealerDistrictSn: undefined, // 区域编码
|
|
|
- giveMoney: undefined,
|
|
|
+ giveMoney: undefined, // 采购额
|
|
|
bizUserSn: undefined// 客服
|
|
|
},
|
|
|
rules: {
|
|
|
salesDate: [{ required: true, message: '请选择销售审核时间', trigger: 'change' }]
|
|
|
},
|
|
|
- dateFormat: 'YYYY-MM-DD',
|
|
|
- tabVal: 1,
|
|
|
- disabled: false,
|
|
|
- tableHeight: 0,
|
|
|
+ dateFormat: 'YYYY-MM-DD', // 时间格式
|
|
|
+ tabVal: 1, // tab值 1促销销售单报表 2促销销售单实时报表
|
|
|
+ disabled: false, // 查询、重置按钮是否可操作
|
|
|
+ tableHeight: 0, // 表格高度
|
|
|
totalData: null, // 合计
|
|
|
- exportLoading: false,
|
|
|
- showExport: false,
|
|
|
+ exportLoading: false, // 导出按钮加载状态
|
|
|
+ showExport: false, // 导出弹窗
|
|
|
columns: [
|
|
|
{ title: '促销名称', dataIndex: 'promotion.title', width: '160px', align: 'left', customRender: function (text) { return text || '--' }, fixed: 'left', ellipsis: true },
|
|
|
{ title: '促销时间', scopedSlots: { customRender: 'promotionTime' }, width: '130px', align: 'center', fixed: 'left' },
|
|
@@ -287,10 +289,12 @@ export default {
|
|
|
const newParams = JSON.parse(JSON.stringify(params))
|
|
|
delete newParams.salesDate
|
|
|
this.spinning = true
|
|
|
+ // 促销销售单报表 列表 有分页
|
|
|
return salesPromoReportList(newParams).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
|
|
@@ -304,6 +308,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 销售审核时间 change
|
|
|
salesDateChange (date) {
|
|
|
if (date[0] && date[1]) {
|
|
|
this.queryParam.salesDate = date
|
|
@@ -313,6 +318,7 @@ export default {
|
|
|
this.queryParam.beginAuditDate = date[0] || ''
|
|
|
this.queryParam.endAuditDate = date[1] || ''
|
|
|
},
|
|
|
+ // 促销开始时间 change
|
|
|
dateChange (date, dateString) {
|
|
|
this.time = date
|
|
|
if (dateString[0] != '' && dateString[1] != '') {
|
|
@@ -323,10 +329,6 @@ export default {
|
|
|
this.$set(this.queryParam.promoRuleReport, 'promotionDateEnd', undefined)
|
|
|
}
|
|
|
},
|
|
|
- // // 不可选日期
|
|
|
- // disabledDate (date, dateStrings) {
|
|
|
- // return date && date.valueOf('day') < moment().subtract(1, 'day') // 今天以后,包含今天
|
|
|
- // },
|
|
|
// 统计
|
|
|
getCount (params) {
|
|
|
salesPromoReportQueryCount(params).then(res => {
|
|
@@ -337,11 +339,12 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ // 区域分区
|
|
|
subareaChange (val) {
|
|
|
this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
|
|
|
this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
|
|
|
},
|
|
|
- // tab
|
|
|
+ // tab 切换 change
|
|
|
handleChange (val) {
|
|
|
this.tabVal = val
|
|
|
},
|
|
@@ -379,6 +382,7 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ // 地区
|
|
|
areaChange (val) {
|
|
|
this.queryParam.dealerProvinceSn = val[0] ? val[0] : ''
|
|
|
this.queryParam.dealerCitySn = val[1] ? val[1] : ''
|
|
@@ -387,9 +391,9 @@ export default {
|
|
|
// 查询
|
|
|
handleSearch () {
|
|
|
const _this = this
|
|
|
- // 总计
|
|
|
const paramData = JSON.parse(JSON.stringify(this.queryParam))
|
|
|
delete paramData.salesDate
|
|
|
+ // 获取统计数据
|
|
|
_this.getCount(paramData)
|
|
|
_this.$refs.table.refresh(true)
|
|
|
},
|
|
@@ -430,18 +434,21 @@ export default {
|
|
|
this.$refs.table.clearTable()
|
|
|
this.totalData = null
|
|
|
},
|
|
|
+ // 初始化
|
|
|
pageInit () {
|
|
|
const _this = this
|
|
|
this.$nextTick(() => { // 页面渲染完成后的回调
|
|
|
_this.setTableH()
|
|
|
})
|
|
|
},
|
|
|
+ // 计算表格高度
|
|
|
setTableH () {
|
|
|
const tableSearchH = this.$refs.tableSearch.offsetHeight
|
|
|
this.tableHeight = window.innerHeight - tableSearchH - 260
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
+ // 展开关闭
|
|
|
advanced (newValue, oldValue) {
|
|
|
const _this = this
|
|
|
this.$nextTick(() => { // 页面渲染完成后的回调
|