Commit 7f1c3d80 by lichengming

修改了统计分析日期搜索

parent 657d5af1
......@@ -14,9 +14,6 @@
</Form-item>
</Form>
</div>
<div class="fr">
<Button class="width-80" @click="_export">导出</Button>
</div>
<div class="clear"></div>
</Col>
<!--内容-->
......
......@@ -16,23 +16,20 @@
<!--@on-change="_endDateChange"></DatePicker>-->
<el-date-picker
v-model="queryDate"
@change="_dateChange"
type="monthrange"
range-separator="-"
start-placeholder="开始月份"
end-placeholder="结束月份"
size="small"
value-format="yyyy-MM"
@change="_dateChange">
value-format="yyyy-MM">
</el-date-picker>
</Form-item>
<Form-item class="marginLeft-70" style="margin-left: -60px;">
<Button type="primary" class="width-80" @click="_getData">搜索</Button>
<Button @click="_getData" type="primary" class="width-80">搜索</Button>
</Form-item>
</Form>
</div>
<div class="fr">
<Button class="width-80" @click="_export">导出</Button>
</div>
<div class="clear"></div>
</Col>
<!--内容-->
......@@ -87,12 +84,20 @@ export default {
}
},
mounted() {
const str = this.tempData.endDate
const arr = str.split('-')
const lastday = this.mGetDate(arr[0], arr[1]).getTime() - 1
this.forObject.edateBegin = this.tempData.beginDate
this.forObject.edateEnd = this.tempData.endDate
// this.forObject.edateEnd = this.tempData.endDate
this.forObject.edateEnd = this.$dateformat(lastday, 'yyyy-mm-dd HH:MM:ss')
this._getData()
// this._search();
},
methods: {
mGetDate(year, month) {
const d = new Date(year, month, 1)
return d
},
_dateChange(data) {
if (data) {
this.tempData.beginDate = data[0]
......@@ -101,13 +106,20 @@ export default {
this.pieData.endDate = data[1]
this.forObject.edateBegin = data[0]
this.forObject.edateEnd = data[1]
const str = data[1]
const arr = str.split('-')
const lastday = this.mGetDate(arr[0], arr[1]).getTime() - 1
this.forObject.edateEnd = this.$dateformat(
lastday,
'yyyy-mm-dd HH:MM:ss'
)
} else {
this.tempData.beginDate = ''
this.tempData.endDate = ''
this.pieData.beginDate = ''
this.pieData.endDate = ''
this.forObject.edateBegin = ''
this.forObject.edateEnd = ''
this.forObject.edateBegin = undefined
this.forObject.edateEnd = undefined
}
this.$refs.contractTableModal._changeDate(this.tempData)
},
......@@ -131,8 +143,8 @@ export default {
},
_search() {
this.$refs.contractTableModal._searchTable({
beginDate: this.tempData.beginDate,
endDate: this.tempData.endDate
beginDate: this.forObject.edateBegin,
endDate: this.forObject.edateEnd
})
// this.$refs.contractPieModal._searchPie({
// beginDate: this.pieData.beginDate,
......
......@@ -52,7 +52,7 @@ export default {
}
},
mounted() {
this._page()
// this._page()
},
methods: {
// 日期变化时,将时间赋值,导出根据查询条件
......@@ -67,7 +67,7 @@ export default {
$('input[name=endDate]').val(data.endDate)
$('input[name=warningDate]').val(data.warningDate)
$('input[name=type]').val('')
this._page()
// this._page()
},
_searchTable(data) {
$('input[name=beginDate]').val(data.beginDate)
......
......@@ -25,9 +25,6 @@
</Form-item>
</Form>
</div>
<div class="fr">
<Button @click="_exportSampleForm" class="width-80">导出</Button>
</div>
<div class="clear"></div>
</Col>
<!--内容-->
......@@ -122,18 +119,23 @@ export default {
},
mounted() {
this.$refs.pageTable._hideLoading()
const str = this.tempData.endDate
const arr = str.split('-')
const lastday = this.mGetDate(arr[0], arr[1]).getTime() - 1
// this._contHide()
// this._getUserGroup()
this.formObj.edateBegin = this.tempData.beginDate
this.formObj.edateEnd = this.tempData.endDate
this.formObj.edateEnd = this.$dateformat(lastday, 'yyyy-mm-dd HH:MM:ss')
this._getData()
// this._getServiceTypeList()
},
methods: {
mGetDate(year, month) {
const d = new Date(year, month, 1)
return d
},
// 服务类型
_getData: async function() {
this.formObj.edateBegin = this.queryDate[0]
this.formObj.edateEnd = this.queryDate[1]
console.log('753951')
console.log('选择时间后的请求', this.formObj)
const result = await meterSample.pageCustomerEntrustStatistics(
......@@ -159,9 +161,15 @@ export default {
if (data) {
this.formObj.edateBegin = data[0]
this.formObj.edateEnd = data[1]
const str = data[1]
const arr = str.split('-')
const lastday = this.mGetDate(arr[0], arr[1]).getTime() - 1
this.formObj.edateEnd = this.$dateformat(lastday, 'yyyy-mm-dd HH:MM:ss')
} else {
this.tempData.edateBegin = ''
this.tempData.edateEnd = ''
this.formObj.edateBegin = undefined
this.formObj.edateEnd = undefined
}
},
_contHide() {
......
......@@ -35,9 +35,6 @@
</Form-item>
</Form>
</div>
<div class="fr">
<Button class="width-80" @click="_exportSampleForm">导出</Button>
</div>
<div class="clear"></div>
</Col>
<!--内容-->
......@@ -154,12 +151,19 @@ export default {
this.$refs.pageTable._hideLoading()
// this._contHide()
// this._getUserGroup()
const str = this.tempData.endDate
const arr = str.split('-')
const lastday = this.mGetDate(arr[0], arr[1]).getTime() - 1
this.formObj.edateBegin = this.tempData.beginDate
this.formObj.edateEnd = this.tempData.endDate
this.formObj.edateEnd = this.$dateformat(lastday, 'yyyy-mm-dd HH:MM:ss')
this._getData()
// this._getServiceTypeList()
},
methods: {
mGetDate(year, month) {
const d = new Date(year, month, 1)
return d
},
// 服务类型
_getData: async function() {
const result = await meterSample.pagePersonalTaskStatistics(this.formObj)
......@@ -184,7 +188,10 @@ export default {
this.tempData.beginDate = data[0]
this.tempData.endDate = data[1]
this.formObj.edateBegin = data[0]
this.formObj.edateEnd = data[1]
const str = data[1]
const arr = str.split('-')
const lastday = this.mGetDate(arr[0], arr[1]).getTime() - 1
this.formObj.edateEnd = this.$dateformat(lastday, 'yyyy-mm-dd HH:MM:ss')
} else {
this.tempData.beginDate = ''
this.tempData.endDate = ''
......
......@@ -25,9 +25,6 @@
</Form-item>
</Form>
</div>
<div class="fr">
<Button @click="_exportSampleForm" class="width-80">导出</Button>
</div>
<div class="clear"></div>
</Col>
<!--内容-->
......@@ -142,14 +139,21 @@ export default {
},
mounted() {
this.$refs.pageTable._hideLoading()
const str = this.tempData.endDate
const arr = str.split('-')
const lastday = this.mGetDate(arr[0], arr[1]).getTime() - 1
this.formObj.edateBegin = this.tempData.beginDate
this.formObj.edateEnd = this.tempData.endDate
this.formObj.edateEnd = this.$dateformat(lastday, 'yyyy-mm-dd HH:MM:ss')
// this._contHide()
// this._getUserGroup()
this._getData()
// this._getServiceTypeList()
},
methods: {
mGetDate(year, month) {
const d = new Date(year, month, 1)
return d
},
// 服务类型
_getData: async function() {
const result = await meterSample.pageSampleQuantityStatistics(
......@@ -176,7 +180,10 @@ export default {
this.tempData.beginDate = data[0]
this.tempData.endDate = data[1]
this.formObj.edateBegin = data[0]
this.formObj.edateEnd = data[1]
const str = data[1]
const arr = str.split('-')
const lastday = this.mGetDate(arr[0], arr[1]).getTime() - 1
this.formObj.edateEnd = this.$dateformat(lastday, 'yyyy-mm-dd HH:MM:ss')
} else {
this.tempData.beginDate = ''
this.tempData.endDate = ''
......
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