| | |
| | | </a-col> |
| | | <a-col :md="6" :sm="6"> |
| | | <a-form-item label="时间"> |
| | | <a-range-picker @change="dateParamChange" :disabledDate="disabledDate" format="YYYYMMDD" |
| | | <a-range-picker @change="dateParamChange" :disabledDate="disabledDate" |
| | | @calendarChange="handleCalendarChange" @openChange="handleCalendarOpenChange" |
| | | format="YYYYMMDD" |
| | | v-model="dates" :allowClear="false"/> |
| | | </a-form-item> |
| | | </a-col> |
| | |
| | | <a-button type="primary" @click="searchQuery" icon="search">查询</a-button> |
| | | <a-button type="primary" @click="searchReset" icon="reload">重置</a-button> |
| | | <a-button type="primary" @click="exportExcel" icon="download">导出</a-button> |
| | | <!--<a-button type="primary" @click="exportOneYearExcel('设备TEEP')" icon="download">大数据导出</a-button>--> |
| | | <a-button type="primary" @click="handleShowFeedbackModal" icon="plus" v-has="'efficiency:feedback'">异常反馈</a-button> |
| | | <a-button type="primary" @click="exportLongTimeExcel('设备TEEP')" icon="download">大数据导出</a-button> |
| | | <a-button type="primary" @click="handleShowFeedbackModal" icon="plus" v-has="'efficiency:feedback'"> |
| | | 异常反馈 |
| | | </a-button> |
| | | <a-button type="primary" icon="printer" v-print="'#Efficiency'" |
| | | v-has="'efficiency:print'">打印 |
| | | </a-button> |
| | |
| | | list: '/mdc/efficiencyReport/efficiencyList', |
| | | listByType: '/mdc/MdcUtilizationRate/getByType', |
| | | queryEquipmentType: '/mdc/mdcEquipmentType/queryEquipmentType', |
| | | exportOneYearXlsUrl: '' |
| | | exportLongTimeXlsUrl: '/mdc/efficiencyReport/exportEfficiencyXls' |
| | | }, |
| | | tableHeads: [], |
| | | utilizationRateRowAverage: '', |
| | |
| | | requestAllDataSize: 8,// 总共请求的列表项数目(默认值为默认日期的差值+1) |
| | | everyRequestDataSize: 15,// 每次请求的列表项数目 |
| | | toggleSearchStatus: false, |
| | | modalVisible: false// 异常反馈弹窗是否弹出 |
| | | modalVisible: false,// 异常反馈弹窗是否弹出 |
| | | preSelectFirstDate: null |
| | | } |
| | | }, |
| | | props: { nodeTree: '', Type: '', nodePeople: '' }, |
| | |
| | | } |
| | | return list |
| | | }, |
| | | disabledDate(current) { |
| | | //Can not slect days before today and today |
| | | return current && current > moment().subtract('days', 1) |
| | | |
| | | dateParamChange(v1, v2) { |
| | | this.queryParam.startTime = v2[0] |
| | | this.queryParam.endTime = v2[1] |
| | | }, |
| | | |
| | | /** |
| | | * 时间选择器面板上的值发生改变时触发 |
| | | * @param dates 面板上的两个值组成的数组 |
| | | */ |
| | | handleCalendarChange(dates) { |
| | | if (dates.length === 1) this.preSelectFirstDate = dates[0] |
| | | }, |
| | | |
| | | /** |
| | | * 控制时间选择器面板开启与关闭 |
| | | * @param status 开启状态 |
| | | */ |
| | | handleCalendarOpenChange(status) { |
| | | if (status) this.preSelectFirstDate = null |
| | | }, |
| | | |
| | | /** |
| | | * 面板上禁止选择的日期 |
| | | * @param current 禁止的时间范围 |
| | | */ |
| | | disabledDate(current) { |
| | | if (!this.preSelectFirstDate) { |
| | | return current > moment().startOf('days') |
| | | } else { |
| | | return current < moment(this.preSelectFirstDate).subtract(365, 'days').startOf('days') |
| | | || current > moment().startOf('days') |
| | | || current > moment(this.preSelectFirstDate).add(365, 'days').endOf('days') |
| | | } |
| | | }, |
| | | |
| | | exportExcel() { |
| | | $('#Efficiency').table2excel({ |
| | | exclude: '.noExl', |
| | |
| | | exclude_inputs: false |
| | | }) |
| | | }, |
| | | exportOneYearExcel(fileName) { |
| | | exportLongTimeExcel(fileName) { |
| | | // let param = this.getQueryParams() |
| | | // console.log('导出参数', param) |
| | | downFile(this.url.exportOneYearXlsUrl) |
| | | const param = { |
| | | startTime: moment(this.dates[0]).format('YYYYMMDD'), |
| | | endTime: moment(this.dates[1]).format('YYYYMMDD') |
| | | } |
| | | downFile(this.url.exportLongTimeXlsUrl, param) |
| | | .then((data) => { |
| | | if (!data) { |
| | | this.$notification.warning({ |
| | |
| | | this.identifying = res.result |
| | | } |
| | | }) |
| | | }, |
| | | dateParamChange(v1, v2) { |
| | | this.queryParam.startTime = v2[0] |
| | | this.queryParam.endTime = v2[1] |
| | | this.dates = [v1[0], v1[1]] |
| | | }, |
| | | efficiencyOptionsOnChange(checkedList) { |
| | | this.checkedList = checkedList |