|
@@ -6,13 +6,7 @@
|
|
|
<a-row :gutter="15">
|
|
|
<a-col :md="6" :sm="24">
|
|
|
<a-form-item label="变更时间">
|
|
|
- <a-range-picker
|
|
|
- style="width:100%"
|
|
|
- id="productChangeRecordList-time"
|
|
|
- :disabledDate="disabledDate"
|
|
|
- v-model="time"
|
|
|
- :format="dateFormat"
|
|
|
- :placeholder="['开始时间', '结束时间']" />
|
|
|
+ <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
@@ -58,7 +52,13 @@
|
|
|
<a-col :md="6" :sm="24">
|
|
|
<a-button style="margin-bottom: 18px;" type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="productChangeRecordList-refresh">查询</a-button>
|
|
|
<a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="productChangeRecordList-reset">重置</a-button>
|
|
|
- <a-button style="margin: 0 0 18px 8px" type="danger" @click="handleExport" :loading="exportLoading" id="productChangeRecordList-export">导出</a-button>
|
|
|
+ <a-button
|
|
|
+ style="margin: 0 0 18px 8px"
|
|
|
+ type="primary"
|
|
|
+ class="button-warning"
|
|
|
+ @click="handleExport"
|
|
|
+ :loading="exportLoading"
|
|
|
+ id="productChangeRecordList-export">导出</a-button>
|
|
|
<a @click="advanced=!advanced" style="margin-left: 8px">
|
|
|
{{ advanced ? '收起' : '展开' }}
|
|
|
<a-icon :type="advanced ? 'up' : 'down'"/>
|
|
@@ -117,18 +117,21 @@
|
|
|
|
|
|
<script>
|
|
|
import moment from 'moment'
|
|
|
-import { STable, VSelect } from '@/components'
|
|
|
import getDate from '@/libs/getDate.js'
|
|
|
+import { STable, VSelect } from '@/components'
|
|
|
+import rangeDate from '@/views/common/rangeDate.vue'
|
|
|
import { productBrandQuery } from '@/api/productBrand'
|
|
|
import { productTypeQuery } from '@/api/productType'
|
|
|
import { productPriceChangeList, getCurrentDealer } from '@/api/product'
|
|
|
export default {
|
|
|
- components: { STable, VSelect },
|
|
|
+ components: { STable, VSelect, rangeDate },
|
|
|
data () {
|
|
|
return {
|
|
|
advanced: false, // 高级搜索 展开/关闭
|
|
|
tableHeight: 0,
|
|
|
queryParam: { // 查询条件
|
|
|
+ beginDate: getDate.getThreeMonthDays().starttime,
|
|
|
+ endDate: getDate.getCurrMonthDays().endtime,
|
|
|
productName: '', // 产品名称
|
|
|
productCode: '', // 产品编码
|
|
|
brandSn: undefined, // 品牌
|
|
@@ -138,7 +141,6 @@ export default {
|
|
|
},
|
|
|
productType: [],
|
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
|
- dateFormat: 'YYYY-MM-DD',
|
|
|
time: [
|
|
|
moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'),
|
|
|
moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
|
|
@@ -150,14 +152,6 @@ export default {
|
|
|
if (this.tableHeight == 0) {
|
|
|
this.tableHeight = window.innerHeight - 430
|
|
|
}
|
|
|
- // 变更时间
|
|
|
- if (this.time && this.time.length > 0) {
|
|
|
- this.queryParam.beginDate = moment(this.time[0]).format(this.dateFormat)
|
|
|
- this.queryParam.endDate = moment(this.time[1]).format(this.dateFormat)
|
|
|
- } else {
|
|
|
- this.queryParam.beginDate = undefined
|
|
|
- this.queryParam.endDate = undefined
|
|
|
- }
|
|
|
return productPriceChangeList(Object.assign(parameter, this.queryParam)).then(res => {
|
|
|
const data = res.data
|
|
|
const no = (data.pageNo - 1) * data.pageSize
|
|
@@ -176,9 +170,10 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- // 不可选日期
|
|
|
- disabledDate (date, dateStrings) {
|
|
|
- return date && date.valueOf() > Date.now()
|
|
|
+ // 时间 change
|
|
|
+ dateChange (date) {
|
|
|
+ this.queryParam.beginDate = date[0]
|
|
|
+ this.queryParam.endDate = date[1]
|
|
|
},
|
|
|
// 设置表头
|
|
|
getColumns () {
|
|
@@ -267,16 +262,15 @@ export default {
|
|
|
},
|
|
|
// 重置
|
|
|
resetSearchForm () {
|
|
|
+ this.$refs.rangeDate.resetDate(this.time)
|
|
|
+ this.queryParam.beginDate = getDate.getThreeMonthDays().starttime
|
|
|
+ this.queryParam.endDate = getDate.getCurrMonthDays().endtime
|
|
|
this.queryParam.productCode = ''
|
|
|
this.queryParam.productName = ''
|
|
|
this.queryParam.brandSn = undefined
|
|
|
this.queryParam.productTypeSn1 = ''
|
|
|
this.queryParam.productTypeSn2 = ''
|
|
|
this.queryParam.productTypeSn3 = ''
|
|
|
- this.time = [
|
|
|
- moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'),
|
|
|
- moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
|
|
|
- ]
|
|
|
this.$refs.table.refresh(true)
|
|
|
},
|
|
|
// 审核
|
|
@@ -313,22 +307,6 @@ export default {
|
|
|
// 导出
|
|
|
handleExport () {
|
|
|
const params = this.queryParam
|
|
|
- if (this.time && this.time.length) {
|
|
|
- params.beginDate = moment(this.time[0]).format('YYYY-MM-DD')
|
|
|
- params.endDate = moment(this.time[1]).format('YYYY-MM-DD')
|
|
|
- } else {
|
|
|
- params.beginDate = ''
|
|
|
- params.endDate = ''
|
|
|
- }
|
|
|
- if (!params.beginDate && !params.endDate) {
|
|
|
- this.$message.error('请先选择变更时间后查询并导出!')
|
|
|
- return
|
|
|
- }
|
|
|
- // 判断两个时间段是否相差m个月 第二个参数指相差单位,第三个参数指是否返回浮点形式(小数)
|
|
|
- if (moment(params.endDate).diff(moment(params.beginDate), 'months', true) > 12) {
|
|
|
- this.$message.error('仅支持导出最多12个月的数据,请先修改变更时间再进行导出!')
|
|
|
- return
|
|
|
- }
|
|
|
this.exportLoading = true
|
|
|
// customerBundleExportDelay(params).then(res => {
|
|
|
// this.exportLoading = false
|