|
@@ -8,11 +8,12 @@
|
|
|
ref="ruleForm"
|
|
|
class="form-model-con"
|
|
|
layout="inline"
|
|
|
+ :rules="rules"
|
|
|
:model="queryParam">
|
|
|
<a-row :gutter="15">
|
|
|
<a-col :md="6" :sm="24">
|
|
|
- <a-form-model-item label="日期">
|
|
|
- <rangeDate ref="rangeDate" :showTime="false" :value="time" @change="dateChange" />
|
|
|
+ <a-form-model-item label="日期" prop="time">
|
|
|
+ <rangeDate ref="rangeDate" :showTime="false" :value="queryParam.time" @change="dateChange" />
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
@@ -129,7 +130,6 @@
|
|
|
|
|
|
<script>
|
|
|
import { commonMixin } from '@/utils/mixin'
|
|
|
-import getDate from '@/libs/getDate.js'
|
|
|
import { STable, VSelect } from '@/components'
|
|
|
import rangeDate from '@/views/common/rangeDate.vue'
|
|
|
import subarea from '@/views/common/subarea.js'
|
|
@@ -137,7 +137,7 @@ import AreaList from '@/views/common/areaList.js'
|
|
|
import BizUser from '@/views/common/bizUser.js'
|
|
|
import reportModal from '@/views/common/reportModal.vue'
|
|
|
import { hdExportExcel } from '@/libs/exportExcel'
|
|
|
-import { tireReportList, queryTireCount, excelTireOnlineExport } from '@/api/reportData'
|
|
|
+import { tireReportList, queryTireCount, tireListExport } from '@/api/reportData'
|
|
|
import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
|
|
|
export default {
|
|
|
name: 'TireSalesDealerList',
|
|
@@ -148,13 +148,10 @@ export default {
|
|
|
spinning: false,
|
|
|
advanced: true, // 高级搜索 展开/关闭
|
|
|
tableHeight: 0,
|
|
|
- time: [
|
|
|
- getDate.getThreeMonthDaysInfo().starttime,
|
|
|
- getDate.getCurrMonthDaysInfo().endtime
|
|
|
- ],
|
|
|
queryParam: { // 查询条件
|
|
|
- bizBeginDate: getDate.getThreeMonthDaysInfo().starttime.replace(/-/g, ''),
|
|
|
- bizEndDate: getDate.getCurrMonthDaysInfo().endtime.replace(/-/g, ''),
|
|
|
+ time: [],
|
|
|
+ bizBeginDate: '',
|
|
|
+ bizEndDate: '',
|
|
|
provinceSn: undefined,
|
|
|
citySn: undefined,
|
|
|
districtSn: undefined,
|
|
@@ -170,11 +167,16 @@ export default {
|
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
|
exportLoading: false,
|
|
|
showExport: false,
|
|
|
+ rules: {
|
|
|
+ 'time': [{ required: true, message: '请选择日期', trigger: 'change' }]
|
|
|
+ },
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
|
loadData: parameter => {
|
|
|
this.disabled = true
|
|
|
this.spinning = true
|
|
|
- const params = Object.assign(parameter, this.queryParam)
|
|
|
+ const oldParams = Object.assign(parameter, this.queryParam)
|
|
|
+ const params = JSON.parse(JSON.stringify(oldParams))
|
|
|
+ delete params.time
|
|
|
return tireReportList(params).then(res => {
|
|
|
let data
|
|
|
if (res.status == 200 && res.data) {
|
|
@@ -270,15 +272,15 @@ export default {
|
|
|
this.queryParam.citySn = val[1] ? val[1] : undefined
|
|
|
this.queryParam.districtSn = val[2] ? val[2] : undefined
|
|
|
},
|
|
|
- // 下推时间 change
|
|
|
+ // 日期选择 change
|
|
|
dateChange (date) {
|
|
|
if (date[0] && date[1]) {
|
|
|
- this.time = date
|
|
|
+ this.queryParam.time = date
|
|
|
} else {
|
|
|
- this.time = []
|
|
|
+ this.queryParam.time = []
|
|
|
}
|
|
|
- this.queryParam.bizBeginDate = date[0].replace(/-/g, '') || ''
|
|
|
- this.queryParam.bizEndDate = date[1].replace(/-/g, '') || ''
|
|
|
+ this.queryParam.bizBeginDate = date[0] ? date[0].replace(/-/g, '') : ''
|
|
|
+ this.queryParam.bizEndDate = date[1] ? date[1].replace(/-/g, '') : ''
|
|
|
},
|
|
|
subareaChange (val) {
|
|
|
this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
|
|
@@ -286,13 +288,10 @@ export default {
|
|
|
},
|
|
|
// 重置
|
|
|
resetSearchForm () {
|
|
|
- this.time = [
|
|
|
- getDate.getThreeMonthDaysInfo().starttime,
|
|
|
- getDate.getCurrMonthDaysInfo().endtime
|
|
|
- ]
|
|
|
- this.$refs.rangeDate.resetDate(this.time)
|
|
|
- this.queryParam.bizBeginDate = getDate.getThreeMonthDaysInfo().starttime.replace(/-/g, '')
|
|
|
- this.queryParam.bizEndDate = getDate.getCurrMonthDaysInfo().endtime.replace(/-/g, '')
|
|
|
+ this.queryParam.time = []
|
|
|
+ this.$refs.rangeDate.resetDate()
|
|
|
+ this.queryParam.bizBeginDate = ''
|
|
|
+ this.queryParam.bizEndDate = ''
|
|
|
this.queryParam.provinceSn = undefined
|
|
|
this.queryParam.citySn = undefined
|
|
|
this.queryParam.districtSn = undefined
|
|
@@ -306,19 +305,33 @@ export default {
|
|
|
this.$refs.areaList.clearData()
|
|
|
if (this.advanced) {
|
|
|
this.$refs.dealerSubareaScopeList.resetForm()
|
|
|
- this.$refs.subarea.clearData()
|
|
|
}
|
|
|
+
|
|
|
+ this.$refs.subarea.clearData()
|
|
|
this.$refs.table.clearTable()
|
|
|
},
|
|
|
// 导出
|
|
|
handleExport () {
|
|
|
+ const _this = this
|
|
|
+ this.$refs.ruleForm.validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ _this.exportList()
|
|
|
+ } else {
|
|
|
+ _this.$message.error('请选择日期')
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 导出
|
|
|
+ exportList () {
|
|
|
const _this = this
|
|
|
const params = _this.queryParam
|
|
|
_this.exportLoading = true
|
|
|
_this.spinning = true
|
|
|
_this.showExport = true
|
|
|
_this.$store.state.app.curActionPermission = 'B_tireSalesReportExport'
|
|
|
- hdExportExcel(excelTireOnlineExport, params, '轮胎统计报表', function () {
|
|
|
+ params.exportFlag = 0
|
|
|
+ hdExportExcel(tireListExport, params, '轮胎统计报表', function () {
|
|
|
_this.exportLoading = false
|
|
|
_this.spinning = false
|
|
|
_this.$store.state.app.curActionPermission = ''
|
|
@@ -329,7 +342,6 @@ export default {
|
|
|
this.$nextTick(() => { // 页面渲染完成后的回调
|
|
|
_this.setTableH()
|
|
|
})
|
|
|
- this.resetSearchForm()
|
|
|
},
|
|
|
setTableH () {
|
|
|
const tableSearchH = this.$refs.tableSearch.offsetHeight
|