Commit 7f1c3d80 by lichengming

修改了统计分析日期搜索

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