|
@@ -16,7 +16,7 @@
|
|
|
<a-row :gutter="15">
|
|
|
<a-col :md="6" :sm="24">
|
|
|
<a-form-model-item label="日期" prop="time">
|
|
|
- <rangeDate ref="rangeDate" :showShortcut="false" @change="dateChange" />
|
|
|
+ <rangeDate ref="rangeDate" :showShortcut="false" :value="queryParam.time" @change="dateChange" />
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
@@ -92,6 +92,7 @@
|
|
|
<script>
|
|
|
import { commonMixin } from '@/utils/mixin'
|
|
|
import { STable, VSelect } from '@/components'
|
|
|
+import getDate from '@/libs/getDate.js'
|
|
|
import rangeDate from '@/views/common/rangeDate.vue'
|
|
|
import { downloadExcel } from '@/libs/JGPrint.js'
|
|
|
import ProductType from '../../common/productType.js'
|
|
@@ -108,9 +109,14 @@ export default {
|
|
|
spinning: false,
|
|
|
tableHeight: 0,
|
|
|
queryParam: { // 查询条件
|
|
|
- time: [],
|
|
|
- beginDate: '',
|
|
|
- endDate: '',
|
|
|
+ time: [
|
|
|
+ // getDate.getMonthDays(3).starttime,
|
|
|
+ // getDate.getMonthDays(3).endtime
|
|
|
+ ],
|
|
|
+ // beginDate: getDate.getMonthDays(3).starttime,
|
|
|
+ // endDate: getDate.getMonthDays(3).endtime,
|
|
|
+ beginDate:'',
|
|
|
+ endDate:'',
|
|
|
productEntity: {
|
|
|
code: '', // 产品编码
|
|
|
name: '', // 产品名称
|
|
@@ -201,7 +207,7 @@ export default {
|
|
|
this.$refs.ruleForm.validate(valid => {
|
|
|
if (valid) {
|
|
|
const a = moment(this.queryParam.beginDate)
|
|
|
- const b = moment(this.queryParam.endDate)
|
|
|
+ const b = moment(this.queryParam.endDate).subtract(1, 'days')
|
|
|
if (b.diff(a, 'month') > 2) {
|
|
|
this.$message.info('最多只能查询3个月')
|
|
|
return false
|
|
@@ -225,8 +231,10 @@ export default {
|
|
|
},
|
|
|
// 重置
|
|
|
resetSearchForm () {
|
|
|
+ // this.$refs.rangeDate.resetDate(this.queryParam.time)
|
|
|
+ // this.queryParam.beginDate = getDate.getMonthDays(3).starttime
|
|
|
+ // this.queryParam.endDate = getDate.getMonthDays(3).endtime
|
|
|
this.$refs.rangeDate.resetDate()
|
|
|
- this.queryParam.time = []
|
|
|
this.queryParam.beginDate = ''
|
|
|
this.queryParam.endDate = ''
|
|
|
this.queryParam.productEntity.code = ''
|
|
@@ -236,9 +244,9 @@ export default {
|
|
|
this.queryParam.productEntity.productTypeSn2 = ''
|
|
|
this.queryParam.productEntity.productTypeSn3 = ''
|
|
|
this.productType = []
|
|
|
- this.$refs.ruleForm.resetFields()
|
|
|
this.totalData = null
|
|
|
this.$refs.table.clearTable()
|
|
|
+ this.$refs.ruleForm.resetFields()
|
|
|
},
|
|
|
// 导出
|
|
|
handleExport () {
|
|
@@ -269,14 +277,12 @@ export default {
|
|
|
},
|
|
|
mounted () {
|
|
|
if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
|
|
|
- this.pageInit()
|
|
|
this.resetSearchForm()
|
|
|
}
|
|
|
},
|
|
|
activated () {
|
|
|
// 如果是新页签打开,则重置当前页面
|
|
|
if (this.$store.state.app.isNewTab) {
|
|
|
- this.pageInit()
|
|
|
this.resetSearchForm()
|
|
|
}
|
|
|
},
|