|
@@ -13,6 +13,7 @@
|
|
|
<a-month-picker
|
|
|
:disabled-date="disabledStartDate"
|
|
|
format="YYYY-MM"
|
|
|
+ v-model="startValue"
|
|
|
placeholder="开始月份"
|
|
|
@openChange="handleStartOpenChange"
|
|
|
@change="getStartDate"
|
|
@@ -21,6 +22,7 @@
|
|
|
<a-month-picker
|
|
|
:disabled-date="disabledEndDate"
|
|
|
format="YYYY-MM"
|
|
|
+ v-model="endValue"
|
|
|
placeholder="结束月份"
|
|
|
:open="endOpen"
|
|
|
@openChange="handleEndOpenChange"
|
|
@@ -149,6 +151,8 @@ export default {
|
|
|
tableHeight: 0,
|
|
|
endOpen: false,
|
|
|
showExport: false,
|
|
|
+ startValue: null,
|
|
|
+ endValue: null,
|
|
|
columns: [
|
|
|
{ title: '产品编码', dataIndex: 'productCode', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
{ title: '产品名称', dataIndex: 'productName', width: '30%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
@@ -205,14 +209,14 @@ export default {
|
|
|
},
|
|
|
// 选择月份限制
|
|
|
disabledStartDate (startValue) {
|
|
|
- const endValue = this.endMonthVal
|
|
|
+ const endValue = this.endValue
|
|
|
if (!startValue || !endValue) {
|
|
|
return startValue.valueOf() > this.moment().valueOf()
|
|
|
}
|
|
|
return startValue.valueOf() >= endValue.valueOf()
|
|
|
},
|
|
|
disabledEndDate (endValue) {
|
|
|
- const startValue = this.startMonthVal
|
|
|
+ const startValue = this.startValue
|
|
|
if (!startValue) {
|
|
|
return endValue.valueOf() > this.moment().valueOf()
|
|
|
}
|
|
@@ -226,7 +230,7 @@ export default {
|
|
|
},
|
|
|
getStartDate (date, dateString) {
|
|
|
this.form.time[0] = dateString
|
|
|
- this.queryParam.beginDate = this.moment(dateString).startOf('month').format('YYYY-MM-DD') + ' 00:00:00'
|
|
|
+ this.queryParam.beginDate = date ? this.moment(dateString).startOf('month').format('YYYY-MM-DD') + ' 00:00:00' : ''
|
|
|
},
|
|
|
// 结束时间
|
|
|
handleEndOpenChange (open) {
|
|
@@ -234,7 +238,7 @@ export default {
|
|
|
},
|
|
|
getEndDate (date, dateString) {
|
|
|
this.form.time[1] = dateString
|
|
|
- this.queryParam.endDate = this.moment(dateString).endOf('month').format('YYYY-MM-DD') + ' 59:59:59'
|
|
|
+ this.queryParam.endDate = date ? this.moment(dateString).endOf('month').format('YYYY-MM-DD') + ' 59:59:59' : ''
|
|
|
},
|
|
|
|
|
|
// 产品分类 change
|
|
@@ -297,6 +301,11 @@ export default {
|
|
|
// 重置
|
|
|
resetSearchForm () {
|
|
|
this.$refs.ruleForm.resetFields()
|
|
|
+ this.startValue = null
|
|
|
+ this.endValue = null
|
|
|
+ this.time = []
|
|
|
+ this.queryParam.beginDate = undefined
|
|
|
+ this.queryParam.endDate = undefined
|
|
|
this.queryParam.productCode = undefined
|
|
|
this.queryParam.productName = undefined
|
|
|
this.queryParam.productBrandSn = undefined
|