Commit f462e1d2 by lichengming

修改了统计查询模块日期查询格式

parent 19ee7076
...@@ -12,12 +12,12 @@ ...@@ -12,12 +12,12 @@
<el-date-picker <el-date-picker
v-model="queryDate" v-model="queryDate"
@change="_dateChange" @change="_dateChange"
type="monthrange" type="daterange"
range-separator="-" range-separator="-"
start-placeholder="开始月份" start-placeholder="开始月份"
end-placeholder="结束月份" end-placeholder="结束月份"
size="small" size="small"
value-format="yyyy-MM" value-format="yyyy-MM-dd"
> >
</el-date-picker> </el-date-picker>
</Form-item> </Form-item>
...@@ -69,10 +69,10 @@ import { soilStatistics } from '../../../api' ...@@ -69,10 +69,10 @@ import { soilStatistics } from '../../../api'
export default { export default {
components: {}, components: {},
data() { data() {
const date = this.$dateformat(new Date(), 'yyyy-mm') const date = this.$dateformat(new Date(), 'yyyy-mm-dd')
const nextMonth = this.$dateformat( const nextMonth = this.$dateformat(
new Date().setMonth(new Date().getMonth() + 1), new Date().setMonth(new Date().getMonth() + 1),
'yyyy-mm' 'yyyy-mm-dd'
) )
return { return {
formId: 'AreaSample', formId: 'AreaSample',
...@@ -113,7 +113,7 @@ export default { ...@@ -113,7 +113,7 @@ export default {
this.$refs.pageTable._hideLoading() this.$refs.pageTable._hideLoading()
const str = this.tempData.endDate const str = this.tempData.endDate
const arr = str.split('-') const arr = str.split('-')
const lastday = this.mGetDate(arr[0], arr[1]).getTime() - 1 const lastday = this.mGetDate(arr[0], arr[1], arr[2]).getTime() - 1
this.formObj.entrustDateBeg = this.tempData.beginDate this.formObj.entrustDateBeg = this.tempData.beginDate
this.formObj.entrustDateEnd = this.$dateformat( this.formObj.entrustDateEnd = this.$dateformat(
lastday, lastday,
...@@ -129,7 +129,7 @@ export default { ...@@ -129,7 +129,7 @@ export default {
this.formObj.entrustDateBeg = data[0] this.formObj.entrustDateBeg = data[0]
const str = data[1] const str = data[1]
const arr = str.split('-') const arr = str.split('-')
const lastday = this.mGetDate(arr[0], arr[1]).getTime() - 1 const lastday = this.mGetDate(arr[0], arr[1], arr[2]).getTime() - 1
this.formObj.entrustDateEnd = this.$dateformat( this.formObj.entrustDateEnd = this.$dateformat(
lastday, lastday,
'yyyy-mm-dd HH:MM:ss' 'yyyy-mm-dd HH:MM:ss'
...@@ -141,8 +141,8 @@ export default { ...@@ -141,8 +141,8 @@ export default {
this.formObj.entrustDateEnd = undefined this.formObj.entrustDateEnd = undefined
} }
}, },
mGetDate(year, month) { mGetDate(year, month, day) {
const d = new Date(year, month, 1) const d = new Date(year, month - 1, day, 24)
return d return d
}, },
// 服务类型 // 服务类型
......
...@@ -12,12 +12,12 @@ ...@@ -12,12 +12,12 @@
<el-date-picker <el-date-picker
v-model="queryDate" v-model="queryDate"
@change="_dateChange" @change="_dateChange"
type="monthrange" type="daterange"
range-separator="-" range-separator="-"
start-placeholder="开始月份" start-placeholder="开始月份"
end-placeholder="结束月份" end-placeholder="结束月份"
size="small" size="small"
value-format="yyyy-MM" value-format="yyyy-MM-dd"
> >
</el-date-picker> </el-date-picker>
</Form-item> </Form-item>
...@@ -74,10 +74,10 @@ import { soilAptitude, soilStatistics } from '../../../api' ...@@ -74,10 +74,10 @@ import { soilAptitude, soilStatistics } from '../../../api'
export default { export default {
components: {}, components: {},
data() { data() {
const date = this.$dateformat(new Date(), 'yyyy-mm') const date = this.$dateformat(new Date(), 'yyyy-mm-dd')
const nextMonth = this.$dateformat( const nextMonth = this.$dateformat(
new Date().setMonth(new Date().getMonth() + 1), new Date().setMonth(new Date().getMonth() + 1),
'yyyy-mm' 'yyyy-mm-dd'
) )
return { return {
formId: 'ProjectItem', formId: 'ProjectItem',
...@@ -122,7 +122,7 @@ export default { ...@@ -122,7 +122,7 @@ export default {
this.$refs.pageTable._hideLoading() this.$refs.pageTable._hideLoading()
const str = this.tempData.endDate const str = this.tempData.endDate
const arr = str.split('-') const arr = str.split('-')
const lastday = this.mGetDate(arr[0], arr[1]).getTime() - 1 const lastday = this.mGetDate(arr[0], arr[1], arr[2]).getTime() - 1
this.formObj.entrustDateBeg = this.tempData.beginDate this.formObj.entrustDateBeg = this.tempData.beginDate
this.formObj.entrustDateEnd = this.$dateformat( this.formObj.entrustDateEnd = this.$dateformat(
lastday, lastday,
...@@ -149,7 +149,7 @@ export default { ...@@ -149,7 +149,7 @@ export default {
this.formObj.entrustDateBeg = data[0] this.formObj.entrustDateBeg = data[0]
const str = data[1] const str = data[1]
const arr = str.split('-') const arr = str.split('-')
const lastday = this.mGetDate(arr[0], arr[1]).getTime() - 1 const lastday = this.mGetDate(arr[0], arr[1], arr[2]).getTime() - 1
this.formObj.entrustDateEnd = this.$dateformat( this.formObj.entrustDateEnd = this.$dateformat(
lastday, lastday,
'yyyy-mm-dd HH:MM:ss' 'yyyy-mm-dd HH:MM:ss'
...@@ -161,8 +161,8 @@ export default { ...@@ -161,8 +161,8 @@ export default {
this.formObj.entrustDateEnd = undefined this.formObj.entrustDateEnd = undefined
} }
}, },
mGetDate(year, month) { mGetDate(year, month, day) {
const d = new Date(year, month, 1) const d = new Date(year, month - 1, day, 24)
return d return d
}, },
// 服务类型 // 服务类型
......
...@@ -12,12 +12,12 @@ ...@@ -12,12 +12,12 @@
<el-date-picker <el-date-picker
v-model="queryDate" v-model="queryDate"
@change="_dateChange" @change="_dateChange"
type="monthrange" type="daterange"
range-separator="-" range-separator="-"
start-placeholder="开始月份" start-placeholder="开始月份"
end-placeholder="结束月份" end-placeholder="结束月份"
size="small" size="small"
value-format="yyyy-MM" value-format="yyyy-MM-dd"
> >
</el-date-picker> </el-date-picker>
</Form-item> </Form-item>
...@@ -69,10 +69,10 @@ import { soilStatistics } from '../../../api' ...@@ -69,10 +69,10 @@ import { soilStatistics } from '../../../api'
export default { export default {
components: {}, components: {},
data() { data() {
const date = this.$dateformat(new Date(), 'yyyy-mm') const date = this.$dateformat(new Date(), 'yyyy-mm-dd')
const nextMonth = this.$dateformat( const nextMonth = this.$dateformat(
new Date().setMonth(new Date().getMonth() + 1), new Date().setMonth(new Date().getMonth() + 1),
'yyyy-mm' 'yyyy-mm-dd'
) )
return { return {
formId: 'TestItem', formId: 'TestItem',
...@@ -113,7 +113,7 @@ export default { ...@@ -113,7 +113,7 @@ export default {
this.$refs.pageTable._hideLoading() this.$refs.pageTable._hideLoading()
const str = this.tempData.endDate const str = this.tempData.endDate
const arr = str.split('-') const arr = str.split('-')
const lastday = this.mGetDate(arr[0], arr[1]).getTime() - 1 const lastday = this.mGetDate(arr[0], arr[1], arr[2]).getTime() - 1
this.formObj.checkTimeBeg = this.tempData.beginDate this.formObj.checkTimeBeg = this.tempData.beginDate
this.formObj.checkTimeEnd = this.$dateformat(lastday, 'yyyy-mm-dd HH:MM:ss') this.formObj.checkTimeEnd = this.$dateformat(lastday, 'yyyy-mm-dd HH:MM:ss')
this._getData() this._getData()
...@@ -124,9 +124,10 @@ export default { ...@@ -124,9 +124,10 @@ export default {
this.tempData.beginDate = data[0] this.tempData.beginDate = data[0]
this.tempData.endDate = data[1] this.tempData.endDate = data[1]
this.formObj.checkTimeBeg = data[0] this.formObj.checkTimeBeg = data[0]
// this.formObj.checkTimeEnd = data[1]
const str = data[1] const str = data[1]
const arr = str.split('-') const arr = str.split('-')
const lastday = this.mGetDate(arr[0], arr[1]).getTime() - 1 const lastday = this.mGetDate(arr[0], arr[1], arr[2]).getTime() - 1
this.formObj.checkTimeEnd = this.$dateformat( this.formObj.checkTimeEnd = this.$dateformat(
lastday, lastday,
'yyyy-mm-dd HH:MM:ss' 'yyyy-mm-dd HH:MM:ss'
...@@ -138,8 +139,8 @@ export default { ...@@ -138,8 +139,8 @@ export default {
this.formObj.checkTimeEnd = undefined this.formObj.checkTimeEnd = undefined
} }
}, },
mGetDate(year, month) { mGetDate(year, month, day) {
const d = new Date(year, month, 1) const d = new Date(year, month - 1, day, 24)
return d return d
}, },
// 服务类型 // 服务类型
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment