|
@@ -113,7 +113,6 @@
|
|
import { commonMixin } from '@/utils/mixin'
|
|
import { commonMixin } from '@/utils/mixin'
|
|
import { hdExportExcel } from '@/libs/exportExcel'
|
|
import { hdExportExcel } from '@/libs/exportExcel'
|
|
import moment from 'moment'
|
|
import moment from 'moment'
|
|
-import getDate from '@/libs/getDate.js'
|
|
|
|
// 组件
|
|
// 组件
|
|
import { STable, VSelect } from '@/components'
|
|
import { STable, VSelect } from '@/components'
|
|
import quarterDate from '@/views/common/quarterDate.vue'
|
|
import quarterDate from '@/views/common/quarterDate.vue'
|
|
@@ -139,8 +138,7 @@ export default {
|
|
queryParam: {
|
|
queryParam: {
|
|
time: [], // 日期
|
|
time: [], // 日期
|
|
queryType: 'quarter', // 轮胎季度费用报表
|
|
queryType: 'quarter', // 轮胎季度费用报表
|
|
- beginDate: undefined, // 开始时间
|
|
|
|
- endDate: undefined, // 结束时间
|
|
|
|
|
|
+ queryDate: undefined, // 选择年份+季度
|
|
dealerLevel: undefined, // 客户级别
|
|
dealerLevel: undefined, // 客户级别
|
|
subareaArea: {
|
|
subareaArea: {
|
|
subareaSn: '', // 区域
|
|
subareaSn: '', // 区域
|
|
@@ -217,20 +215,20 @@ export default {
|
|
methods: {
|
|
methods: {
|
|
// 获取季度默认值
|
|
// 获取季度默认值
|
|
getQuarterVal () {
|
|
getQuarterVal () {
|
|
- // 获取今年的季度
|
|
|
|
- const thisQuarter = moment().quarter()
|
|
|
|
- // 获取去年年份
|
|
|
|
- const lastYear = moment().subtract(1, 'years').format('YYYY')
|
|
|
|
- this.queryParam.time = [lastYear, thisQuarter]
|
|
|
|
- const valStr = getDate.getQuarterByYear(lastYear, thisQuarter)
|
|
|
|
- if (valStr && Object.keys(valStr).length > 0) {
|
|
|
|
- this.queryParam.beginDate = valStr.start
|
|
|
|
- this.queryParam.endDate = valStr.end
|
|
|
|
|
|
+ // 获取上个月是今年的第几季度
|
|
|
|
+ const lastQuarter = moment().subtract(1, 'month').quarter()
|
|
|
|
+ // 获取今年年份
|
|
|
|
+ const thisYear = moment().year()
|
|
|
|
+ this.queryParam.time = [thisYear, lastQuarter]
|
|
|
|
+ if (this.queryParam.time.length > 0) {
|
|
|
|
+ this.queryParam.queryDate = thisYear + '0' + lastQuarter
|
|
}
|
|
}
|
|
},
|
|
},
|
|
// 查询
|
|
// 查询
|
|
handleSearch () {
|
|
handleSearch () {
|
|
const _this = this
|
|
const _this = this
|
|
|
|
+ console.log('1111111111111111:', _this.queryParam)
|
|
|
|
+ console.log('2222222222222222:', _this.queryParam.queryDate)
|
|
this.$refs.ruleForm.validate(valid => {
|
|
this.$refs.ruleForm.validate(valid => {
|
|
if (valid) {
|
|
if (valid) {
|
|
_this.$refs.table.refresh(true)
|
|
_this.$refs.table.refresh(true)
|
|
@@ -264,12 +262,10 @@ export default {
|
|
// 日期选择 change
|
|
// 日期选择 change
|
|
dateChange (date, valStr) {
|
|
dateChange (date, valStr) {
|
|
this.queryParam.time = date[0] && date[1] ? date : []
|
|
this.queryParam.time = date[0] && date[1] ? date : []
|
|
- if (valStr && Object.keys(valStr).length > 0) {
|
|
|
|
- this.queryParam.beginDate = valStr.start
|
|
|
|
- this.queryParam.endDate = valStr.end
|
|
|
|
|
|
+ if (date && date.length > 0) {
|
|
|
|
+ this.queryParam.queryDate = date[0] + '0' + date[1]
|
|
} else {
|
|
} else {
|
|
- this.queryParam.beginDate = ''
|
|
|
|
- this.queryParam.endDate = ''
|
|
|
|
|
|
+ this.queryParam.queryDate = ''
|
|
}
|
|
}
|
|
},
|
|
},
|
|
// 区域分区 change
|
|
// 区域分区 change
|
|
@@ -279,10 +275,8 @@ export default {
|
|
},
|
|
},
|
|
// 重置
|
|
// 重置
|
|
resetSearchForm () {
|
|
resetSearchForm () {
|
|
|
|
+ // this.$refs.quarterDate.resetDate()
|
|
this.queryParam.queryType = 'quarter'
|
|
this.queryParam.queryType = 'quarter'
|
|
- this.queryParam.time = []
|
|
|
|
- this.queryParam.beginDate = ''
|
|
|
|
- this.queryParam.endDate = ''
|
|
|
|
this.queryParam.dealerEntity.provinceSn = undefined
|
|
this.queryParam.dealerEntity.provinceSn = undefined
|
|
this.queryParam.dealerEntity.citySn = undefined
|
|
this.queryParam.dealerEntity.citySn = undefined
|
|
this.queryParam.dealerEntity.districtSn = undefined
|
|
this.queryParam.dealerEntity.districtSn = undefined
|
|
@@ -296,6 +290,9 @@ export default {
|
|
if (this.advanced) {
|
|
if (this.advanced) {
|
|
this.$refs.dealerSubareaScopeList.resetForm()
|
|
this.$refs.dealerSubareaScopeList.resetForm()
|
|
}
|
|
}
|
|
|
|
+ this.getQuarterVal()
|
|
|
|
+ console.log('1111111111111111:', this.queryParam.time)
|
|
|
|
+ console.log('2222222222222222:', this.queryParam.queryDate)
|
|
this.totalData = null
|
|
this.totalData = null
|
|
this.$refs.areaList.clearData()
|
|
this.$refs.areaList.clearData()
|
|
this.$refs.table.clearTable()
|
|
this.$refs.table.clearTable()
|