From 8a4d90d80c6ae8472bf11a1c1f148ca49c90f0a7 Mon Sep 17 00:00:00 2001 From: zhaowei <zhaowei> Date: 星期四, 29 五月 2025 15:42:59 +0800 Subject: [PATCH] 1、设备TEEP、设备开动率以及班次利用率页面时间选择器新增用户选择时对时间范围的限制功能并测试大数据导出功能 2、生产设备自主维护点检表设备编号的输入方式由手动输入调整为弹窗选择输入 3、生产设备自主维护点检表页面调整周保执行记录渲染逻辑(日期对应到周) --- src/views/eam/SelfMaintenanceAndInspectionList.vue | 51 ++-- src/views/mdc/base/modules/efficiencyPOReport/EfficiencyPOList.vue | 77 ++++--- src/views/mdc/base/modules/efficiencyReport/EfficiencyList.vue | 66 +++++- src/views/mdc/base/modules/efficiencyShiftReport/EfficiencyShiftList.vue | 63 +++-- src/views/eam/modules/SelfMaintenanceAndInspectionList/EamEquipmentListModal.vue | 189 ++++++++++++++++++ src/views/mdc/base/modules/EquipmentList/DeviceListModal.vue | 100 +++++---- 6 files changed, 403 insertions(+), 143 deletions(-) diff --git a/src/views/eam/SelfMaintenanceAndInspectionList.vue b/src/views/eam/SelfMaintenanceAndInspectionList.vue index dfc9a75..a47ab74 100644 --- a/src/views/eam/SelfMaintenanceAndInspectionList.vue +++ b/src/views/eam/SelfMaintenanceAndInspectionList.vue @@ -7,7 +7,8 @@ <a-col :md="4" :sm="4"> <a-form-item label="璁惧缂栧彿"> - <a-input placeholder="璇疯緭鍏ヨ澶囩紪鍙�" v-model="queryParam.num" :allow-clear="false"/> + <a-input-search :readOnly="true" v-model="queryParam.num" @search="handleOpenEamEquipmentListModal" + enter-button placeholder='璇烽�夋嫨璁惧缂栧彿'/> </a-form-item> </a-col> @@ -43,7 +44,9 @@ <th colspan="3"></th> <th colspan="6">缁熶竴缂栧彿锛歿{dataSource.equipentNum}}</th> <th colspan="3"></th> - <th colspan="6">{{queryParam.dataTime.split('-')[0]}} 骞� {{queryParam.dataTime.split('-')[1]}} 鏈�</th> + <th colspan="6"> + {{queryParam.dataTime.split('-')[0]}} 骞� {{queryParam.dataTime.split('-')[1]}} 鏈� + </th> <th colspan="6">鍗曚綅锛歿{dataSource.workCenterName}}</th> <th colspan="3"></th> </tr> @@ -88,7 +91,7 @@ <td>搴忓彿</td> <td colspan="5">鍛ㄤ繚鍏婚」鐩�</td> <td colspan="5">妫�鏌ユ爣鍑�</td> - <td colspan="31">鍛ㄦ姤鎵ц璁板綍</td> + <td colspan="31">鍛ㄤ繚鎵ц璁板綍</td> </tr> <tr v-for="(item,index) in dataSource.list4"> @@ -96,36 +99,37 @@ <td colspan="5">{{item.name}}</td> <td colspan="5">{{item.detectionStandard}}</td> <td v-for="childItem in 4" colspan="6"> - {{item.dataList&&item.dataList[childItem-1]?item.dataList[childItem-1].insResult:''}} + {{item.dataList&&item.dataList.find(item=>item.weekOfMonth===childItem)?item.dataList.find(item=>item.weekOfMonth===childItem).insResult:''}} </td> <td colspan="7"> - {{item.dataList&&item.dataList[4]?item.dataList[4].insResult:''}} + {{item.dataList&&item.dataList.find(item=>item.weekOfMonth===5)?item.dataList.find(item=>item.weekOfMonth===5).insResult:''}} </td> </tr> <tr> <td colspan="11">鍛ㄤ繚鍏绘搷浣滆�呮墽琛岋紙鎿嶄綔鑰呯瀛楋級</td> <td v-for="childItem in 4" colspan="6"> - {{dataSource.list5&&dataSource.list5[0]&&dataSource.list5[0].dataList&&dataSource.list5[0].dataList[childItem-1]?dataSource.list5[0].dataList[childItem-1].inspectionUserName:''}} + {{dataSource.list5&&dataSource.list5[0]&&dataSource.list5[0].dataList&&dataSource.list5[0].dataList.find(item=>item.weekOfMonth===childItem)?dataSource.list5[0].dataList.find(item=>item.weekOfMonth===childItem).inspectionUserName:''}} </td> <td colspan="7"> - {{dataSource.list5&&dataSource.list5[0]&&dataSource.list5[0].dataList&&dataSource.list5[0].dataList[4]?dataSource.list5[0].dataList[4].inspectionUserName:''}} + {{dataSource.list5&&dataSource.list5[0]&&dataSource.list5[0].dataList&&dataSource.list5[0].dataList.find(item=>item.weekOfMonth===5)?dataSource.list5[0].dataList.find(item=>item.weekOfMonth===5).inspectionUserName:''}} </td> </tr> <tr> - <td colspan="11">闂翠繚鍏绘鏌ヤ汉纭锛堢淮淇汉鍛樼瀛楋級</td> + <td colspan="11">鍛ㄤ繚鍏绘鏌ヤ汉纭锛堢淮淇汉鍛樼瀛楋級</td> <td v-for="childItem in 4" colspan="6"> - {{dataSource.list6&&dataSource.list6[0]&&dataSource.list6[0].dataList&&dataSource.list6[0].dataList[childItem-1]?dataSource.list6[0].dataList[childItem-1].repairConfirmPerson:''}} + {{dataSource.list5&&dataSource.list6[0]&&dataSource.list6[0].dataList&&dataSource.list6[0].dataList.find(item=>item.weekOfMonth===childItem)?dataSource.list6[0].dataList.find(item=>item.weekOfMonth===childItem).repairConfirmPerson:''}} + </td> <td colspan="7"> - {{dataSource.list6&&dataSource.list6[0]&&dataSource.list6[0].dataList&&dataSource.list6[0].dataList[4]?dataSource.list6[0].dataList[4].repairConfirmPerson:''}} + {{dataSource.list5&&dataSource.list6[0]&&dataSource.list6[0].dataList&&dataSource.list6[0].dataList.find(item=>item.weekOfMonth===5)?dataSource.list6[0].dataList.find(item=>item.weekOfMonth===5).repairConfirmPerson:''}} </td> </tr> <tr> <td colspan="42" style="text-align: left"> - 濉啓瑕佹眰锛氭甯革紳/锛屽紓甯革紳x锛屾晠闅滃仠鏈猴紳鈻筹紝娌″紑鏈猴紳T锛氳澶囨棩甯哥偣妫�璁板綍鐢辨搷浣滀汉鍛樻墽琛屽苟璁板綍銆傛墽琛屾儏鍐垫鏌ョ敱缁翠慨浜哄憳璐熻矗鎵ц骞惰褰曪紝瀵瑰彂鐜伴棶棰樿褰曡嚦鐐规琛ㄨ儗闈㈠悇娉ㄦ爮锛屽鍙戠幇闂杩涜鍏ㄧ▼闂幆璁板綍銆� + 濉啓瑕佹眰锛氭甯革紳鈭氾紝寮傚父锛澝楋紝鏁呴殰鍋滄満锛濃柍锛屾病寮�鏈猴紳T锛氳澶囨棩甯哥偣妫�璁板綍鐢辨搷浣滀汉鍛樻墽琛屽苟璁板綍銆傛墽琛屾儏鍐垫鏌ョ敱缁翠慨浜哄憳璐熻矗鎵ц骞惰褰曪紝瀵瑰彂鐜伴棶棰樿褰曡嚦鐐规琛ㄨ儗闈㈠娉ㄦ爮锛屽鍙戠幇闂杩涜鍏ㄧ▼闂幆璁板綍銆� </td> </tr> @@ -144,6 +148,8 @@ </tbody> </table> </a-spin> + + <eam-equipment-list-modal ref="eamEquipmentListModal" @sendSelectionRows="setSelectedEquipmentId"/> </a-card> </template> @@ -152,9 +158,11 @@ import { getAction } from '@/api/manage' import $ from 'jquery' import '@/components/table2excel/table2excel' + import EamEquipmentListModal from './modules/SelfMaintenanceAndInspectionList/EamEquipmentListModal' export default { name: 'SelfMaintenanceAndInspectionList', + components: { EamEquipmentListModal }, mixins: [JeecgListMixin], data() { return { @@ -189,18 +197,7 @@ that.$message.warning(`${dataTime.split('-')[0]}骞�${dataTime.split('-')[1]}鏈� 璁惧缂栧彿涓�${num}璁惧 鏃犵偣妫�璁板綍`) return } - that.dataSource = res.result - - for (let index = 4; index <= 6; index++) { - that.dataSource[`list${index}`] = that.dataSource[`list${index}`].map(item => { - return { - ...item, - dataList: item.dataList.sort((x, y) => x.dayTime - y.dayTime) - } - }) - } - this.$nextTick(() => this.tableElement = document.getElementById('dataTable')) } else that.$message.warning(res.message) @@ -210,6 +207,16 @@ }) }, + // 鎺у埗閫夋嫨璁惧寮圭獥寮瑰嚭 + handleOpenEamEquipmentListModal() { + this.$refs.eamEquipmentListModal.visible = true + this.$refs.eamEquipmentListModal.openPage() + }, + + setSelectedEquipmentId(record) { + this.$set(this.queryParam, 'num', record.num) + }, + exportExcel() { if (!this.tableElement) this.$message.warning('璇锋煡璇㈠悗鍐嶈繘琛屽鍑�') diff --git a/src/views/eam/modules/SelfMaintenanceAndInspectionList/EamEquipmentListModal.vue b/src/views/eam/modules/SelfMaintenanceAndInspectionList/EamEquipmentListModal.vue new file mode 100644 index 0000000..1447b98 --- /dev/null +++ b/src/views/eam/modules/SelfMaintenanceAndInspectionList/EamEquipmentListModal.vue @@ -0,0 +1,189 @@ +<template> + <a-modal :title="title" :width="1000" :visible="visible" :maskClosable="false" @ok="handleOk" @cancel="handleCancel" + cancelText="鍏抽棴"> + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <a-form layout="inline" @keyup.enter.native="searchQuery"> + <a-row :gutter="24"> + <a-col :md="7" :sm="7"> + <a-form-item label="缁熶竴缂栫爜"> + <a-input placeholder="璇疯緭鍏ョ粺涓�缂栫爜" v-model="queryParam.num"/> + </a-form-item> + </a-col> + + <a-col :md="7" :sm="7"> + <a-form-item label="璁惧鍚嶇О"> + <a-input placeholder="璇疯緭鍏ヨ澶囧悕绉�" v-model="queryParam.name"/> + </a-form-item> + </a-col> + + <a-col :md="3" :sm="3"> + <a-space> + <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button> + <a-button @click="searchReset" icon="reload">閲嶇疆</a-button> + </a-space> + </a-col> + </a-row> + </a-form> + </div> + + <!-- table鍖哄煙-begin --> + <div> + <a-table bordered rowKey="id" :scroll="{聽 y: 300聽}" :columns="columns" :customRow="customRow" + :dataSource="dataSource" :pagination="ipagination" :loading="loading" + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type:'radio'}" + @change="handleTableChange"> + </a-table> + </div> + <!-- table鍖哄煙-end --> + </a-modal> +</template> + +<script> + import { getAction } from '@/api/manage' + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + import { filterObj } from '@/utils/util' + + export default { + name: 'EamEquipmentListModal', + mixins: [JeecgListMixin], + data() { + return { + title: '閫夋嫨璁惧', + visible: false, + disableMixinCreated: true, + columns: [ + { + title: '缁熶竴缂栫爜', + align: 'center', + dataIndex: 'num' + }, + { + title: '璁惧鍚嶇О', + align: 'center', + dataIndex: 'name' + }, + { + title: '浣跨敤閮ㄩ棬', + align: 'center', + dataIndex: 'useId_dictText' + }, + { + title: '涓績', + align: 'center', + dataIndex: 'workCenterId_dictText' + }, + { + title: '宸ュ尯', + align: 'center', + dataIndex: 'factoryModelId_dictText' + }, + { + title: '宸ユ', + align: 'center', + dataIndex: 'areaId_dictText' + }, + ], + url: { + list: '/eam/equipment/getEquipmentTZList' + } + } + }, + methods: { + openPage() { + this.visible = true + this.onClearSelected() + this.dataSource = [] + this.loadData(1) + }, + + getQueryParams() { + //鑾峰彇鏌ヨ鏉′欢 + let sqp = {} + if (this.superQueryParams) { + sqp['superQueryParams'] = encodeURI(this.superQueryParams) + sqp['superQueryMatchType'] = this.superQueryMatchType + } + const param = Object.assign(sqp, this.queryParam) + param.pageNo = this.ipagination.current + param.pageSize = this.ipagination.pageSize + + return filterObj(param) + }, + + loadData(arg) { + if (!this.url.list) { + this.$message.error('璇疯缃畊rl.list灞炴��!') + return + } + //鍔犺浇鏁版嵁 鑻ヤ紶鍏ュ弬鏁�1鍒欏姞杞界涓�椤电殑鍐呭 + if (arg === 1) { + this.ipagination.current = 1 + } + const params = this.getQueryParams()//鏌ヨ鏉′欢 + + if (!params) { + return false + } + + this.loading = true + getAction(this.url.list, params).then((res) => { + if (res.success) { + this.dataSource = res.result.records || res.result + if (res.result.total) { + this.ipagination.total = res.result.total + } else { + this.ipagination.total = 0 + } + } else { + this.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }).finally(() => { + this.loading = false + }) + }, + + customRow(record) { + return { + style: { + cursor: 'pointer' + }, + on: { + click: () => { + this.onSelectChange([record.id], [record]) + } + } + } + }, + + modalFormOk(val) { + // 鏂板/淇敼 鎴愬姛鏃讹紝閲嶈浇鍒楄〃 + this.loadData() + this.selectedRowKeys = [val.id] + }, + searchQuery() { + this.loadData() + this.onClearSelected() + }, + searchReset() { + this.queryParam = {} + this.loadData() + this.onClearSelected() + }, + close() { + this.$emit('close') + this.visible = false + }, + handleCancel() { + this.close() + }, + handleOk() { + this.$emit('sendSelectionRows', this.selectionRows[0]) + this.close() + } + } + } +</script> diff --git a/src/views/mdc/base/modules/EquipmentList/DeviceListModal.vue b/src/views/mdc/base/modules/EquipmentList/DeviceListModal.vue index f799bac..f42b4d6 100644 --- a/src/views/mdc/base/modules/EquipmentList/DeviceListModal.vue +++ b/src/views/mdc/base/modules/EquipmentList/DeviceListModal.vue @@ -30,10 +30,10 @@ <!-- table鍖哄煙-begin --> <div> - <a-table ref="table" size="middle" bordered rowKey="id" :scroll="{聽 y: 300聽}" :columns="columns" + <a-table ref="table" size="middle" bordered rowKey="equipmentid" :scroll="{聽 y: 300聽}" :columns="columns" :dataSource="dataSource" :pagination="ipagination" :loading="loading" :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type:'radio'}" - @change="handleTableChange"> + @change="handleTableChange" :customRow="customRow"> </a-table> </div> <!-- table鍖哄煙-end --> @@ -59,7 +59,7 @@ import Tooltip from 'ant-design-vue/es/tooltip' import JDate from '@/components/jeecg/JDate' import moment from 'moment' - import { filterObj } from '@/utils/util'; + import { filterObj } from '@/utils/util' export default { name: 'DeviceListModel', @@ -79,24 +79,24 @@ }, data() { return { - title:'', + title: '', visible: false, disableMixinCreated: true, queryParam: {}, columns: [{ title: '缁熶竴缂栫爜', align: 'center', - dataIndex: 'equipmentid', + dataIndex: 'equipmentid' }, { title: '璁惧鍚嶇О', align: 'center', - dataIndex: 'equipmentname', + dataIndex: 'equipmentname' }, { title: '璁惧鍨嬪彿', align: 'center', - dataIndex: 'equipmentmodel', + dataIndex: 'equipmentmodel' }, // { // title: '璁惧绫诲瀷', @@ -106,27 +106,27 @@ { title: '鏈哄簥IP', align: 'center', - dataIndex: 'equipmentip', + dataIndex: 'equipmentip' }, { title: '椹卞姩绫诲瀷', align: 'center', - dataIndex: 'drivetype', + dataIndex: 'drivetype' }, { title: '绔彛', align: 'center', - dataIndex: 'dataport', + dataIndex: 'dataport' }, { title: '鏁版帶绯荤粺', align: 'center', - dataIndex: 'controlsystem', + dataIndex: 'controlsystem' } ], url: { - list: '/mdc/equipment/list', - }, + list: '/mdc/equipment/list' + } } }, @@ -137,23 +137,23 @@ openPage() { this.visible = true this.onClearSelected() - this.dataSource = []; + this.dataSource = [] // this.queryParam = { // status: this.status // }; - this.loadData(); + this.loadData() }, getQueryParams() { //鑾峰彇鏌ヨ鏉′欢 let sqp = {} - if(this.superQueryParams){ - sqp['superQueryParams']=encodeURI(this.superQueryParams) + if (this.superQueryParams) { + sqp['superQueryParams'] = encodeURI(this.superQueryParams) sqp['superQueryMatchType'] = this.superQueryMatchType } - var param = Object.assign(sqp, this.queryParam); + var param = Object.assign(sqp, this.queryParam) // param.field = this.getQueryField(); - param.pageNo = this.ipagination.current; - param.pageSize = this.ipagination.pageSize; + param.pageNo = this.ipagination.current + param.pageSize = this.ipagination.pageSize //鑾峰彇鐢ㄦ埛瀹氬埗鐨勫弬鏁板睘鎬� // if (this.getCustomQueryParams) { // param = this.getCustomQueryParams(param); @@ -162,42 +162,41 @@ // } // } - return filterObj(param); + return filterObj(param) }, loadData(arg) { - if(!this.url.list){ - this.$message.error("璇疯缃畊rl.list灞炴��!") + if (!this.url.list) { + this.$message.error('璇疯缃畊rl.list灞炴��!') return } //鍔犺浇鏁版嵁 鑻ヤ紶鍏ュ弬鏁�1鍒欏姞杞界涓�椤电殑鍐呭 if (arg === 1) { - this.ipagination.current = 1; + this.ipagination.current = 1 } - var params = this.getQueryParams();//鏌ヨ鏉′欢 + var params = this.getQueryParams()//鏌ヨ鏉′欢 - if(!params){ - return false; + if (!params) { + return false } - this.loading = true; + this.loading = true getAction(this.url.list, params).then((res) => { if (res.success) { // console.log(res) //update-begin---author:zhangyafei Date:20201118 for锛氶�傞厤涓嶅垎椤电殑鏁版嵁鍒楄〃------------ - this.dataSource = res.result.records||res.result; - if(res.result.total) - { - this.ipagination.total = res.result.total; - }else{ - this.ipagination.total = 0; + this.dataSource = res.result.records || res.result + if (res.result.total) { + this.ipagination.total = res.result.total + } else { + this.ipagination.total = 0 } //update-end---author:zhangyafei Date:20201118 for锛氶�傞厤涓嶅垎椤电殑鏁版嵁鍒楄〃------------ - }else{ + } else { // this.$message.warning(res.message) this.$notification.warning({ - message:'娑堟伅', - description:res.message - }); + message: '娑堟伅', + description: res.message + }) } }).finally(() => { this.loading = false @@ -211,18 +210,31 @@ // }); // return str; }, + customRow(record) { + return { + style: { + cursor: 'pointer' + }, + on: { + click: () => { + console.log('瑙﹀彂鐐瑰嚮') + this.onSelectChange([record.equipmentid], [record]) + } + } + } + }, modalFormOk(val) { // 鏂板/淇敼 鎴愬姛鏃讹紝閲嶈浇鍒楄〃 - this.loadData(); - this.selectedRowKeys = [val.id]; + this.loadData() + this.selectedRowKeys = [val.id] }, searchQuery() { - this.loadData(); + this.loadData() this.onClearSelected() }, searchReset() { this.queryParam = {} - this.loadData(); + this.loadData() this.onClearSelected() }, close() { @@ -235,8 +247,8 @@ handleOk() { this.$emit('sendSelectionRows', this.selectionRows[0]) this.close() - }, - }, + } + } } </script> <style> diff --git a/src/views/mdc/base/modules/efficiencyPOReport/EfficiencyPOList.vue b/src/views/mdc/base/modules/efficiencyPOReport/EfficiencyPOList.vue index a0e5f85..585b0f6 100644 --- a/src/views/mdc/base/modules/efficiencyPOReport/EfficiencyPOList.vue +++ b/src/views/mdc/base/modules/efficiencyPOReport/EfficiencyPOList.vue @@ -39,26 +39,12 @@ </a-col> <a-col :md="6" :sm="6"> <a-form-item label="鏃堕棿"> - <a-range-picker @change="dateParamChange" :disabledDate="disabledDate" format="YYYYMMDD" v-model="dates" + <a-range-picker @change="dateParamChange" :disabledDate="disabledDate" + @calendarChange="handleCalendarChange" @openChange="handleCalendarOpenChange" + format="YYYYMMDD" v-model="dates" :allowClear="false"/> </a-form-item> </a-col> -<!-- <a-col :md="5" :sm="5" :xs="5">--> -<!-- <a-form-item label="璁惧绉嶇被">--> -<!-- <a-select--> -<!-- :value="queryParams.deviceCategory"--> -<!-- mode="multiple"--> -<!-- placeholder="璇烽�夋嫨璁惧绉嶇被"--> -<!-- allow-clear--> -<!-- :maxTagCount="1"--> -<!-- @change="selectChange($event,'deviceCategory')"--> -<!-- >--> -<!-- <a-select-option v-for="(item,index) in device_category_list" :value="item.value" :key="index">--> -<!-- {{item.label}}--> -<!-- </a-select-option>--> -<!-- </a-select>--> -<!-- </a-form-item>--> -<!-- </a-col>--> <a-col :md="5" :sm="5" :xs="5"> <a-form-item label="璁惧绾у埆"> <a-select @@ -113,7 +99,9 @@ <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="handleShowFeedbackModal" icon="plus" v-has="'EfficiencyPO:feedback'">寮傚父鍙嶉</a-button> + <a-button type="primary" @click="handleShowFeedbackModal" icon="plus" v-has="'EfficiencyPO:feedback'"> + 寮傚父鍙嶉 + </a-button> <a-button type="primary" icon="printer" v-print="'#EfficiencyPO'" v-has="'EfficiencyPO:print'">鎵撳嵃 </a-button> @@ -268,7 +256,7 @@ queryParams: { equipmentType: [], driveType: [], - deviceLevel: [], + deviceLevel: [] }, queryParamEquip: {}, queryParamPeople: {}, @@ -291,7 +279,8 @@ tableHeads: [], spinning: false, toggleSearchStatus: false, - modalVisible: false// 寮傚父鍙嶉寮圭獥鏄惁寮瑰嚭 + modalVisible: false,// 寮傚父鍙嶉寮圭獥鏄惁寮瑰嚭 + preSelectFirstDate: null } }, props: { nodeTree: '', Type: '', nodePeople: '' }, @@ -447,7 +436,6 @@ }, // 鍚堝苟 combineCell() { - console.log(this.dataList) let list = this.dataList for (let field in list[0]) { var k = 0 @@ -469,10 +457,37 @@ } return list }, - disabledDate(current) { - //Can not slect days before today and today - return current && current > moment().subtract('days', 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') + } + }, + initDeviceType(deviceList) { let dictCode = 'mdc_equipmentType' let items = [] @@ -521,19 +536,8 @@ dateParamChange(v1, v2) { this.queryParam.startTime = v2[0] this.queryParam.endTime = v2[1] - // 鐐瑰嚮鏃堕棿閫夋嫨鍣ㄧ殑娓呯┖鎸夐挳鏃朵細瑙﹀彂姝ゅ垽鏂�(鐐瑰嚮閲嶇疆鎸夐挳涓嶄細瑙﹀彂)锛屽疄鐜伴噸缃垪琛ㄥ姛鑳斤紝鍒囧疄鏀瑰彉鍒楄〃鏄剧ず鏁堟灉 - if (!this.queryParam.startTime && !this.queryParam.endTime) this.searchReset() }, efficiencyOptionsOnChange(checkedList) { - // let index = checkedList.indexOf('lyl') - // if (index < 0) { - // // this.$message.warn('涓嶈兘鍙栨秷鏌ヨ鍒╃敤鐜�') - // this.$notification.warning({ - // message:'娑堟伅', - // description:"涓嶈兘鍙栨秷鏌ヨ鍒╃敤鐜�" - // }) - // return false - // } this.checkedList = checkedList }, searchQuery() { @@ -568,7 +572,7 @@ this.queryParams = { equipmentType: [], driveType: [], - deviceLevel: [], + deviceLevel: [] } this.loadData() }, @@ -578,7 +582,6 @@ this.dataList = [] getAction(this.url.list, this.queryParam).then(res => { if (res.success) { - // console.log(res.result) this.tableHeads = res.result.dates this.dataList = res.result.mdcEfficiencyList if (res.result.mdcEfficiencyList && !res.result.mdcEfficiencyList.length) { diff --git a/src/views/mdc/base/modules/efficiencyReport/EfficiencyList.vue b/src/views/mdc/base/modules/efficiencyReport/EfficiencyList.vue index 8acbf86..55d1dd3 100644 --- a/src/views/mdc/base/modules/efficiencyReport/EfficiencyList.vue +++ b/src/views/mdc/base/modules/efficiencyReport/EfficiencyList.vue @@ -38,7 +38,9 @@ </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> @@ -95,8 +97,10 @@ <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> @@ -275,7 +279,7 @@ list: '/mdc/efficiencyReport/efficiencyList', listByType: '/mdc/MdcUtilizationRate/getByType', queryEquipmentType: '/mdc/mdcEquipmentType/queryEquipmentType', - exportOneYearXlsUrl: '' + exportLongTimeXlsUrl: '/mdc/efficiencyReport/exportEfficiencyXls' }, tableHeads: [], utilizationRateRowAverage: '', @@ -289,7 +293,8 @@ requestAllDataSize: 8,// 鎬诲叡璇锋眰鐨勫垪琛ㄩ」鏁扮洰(榛樿鍊间负榛樿鏃ユ湡鐨勫樊鍊�+1) everyRequestDataSize: 15,// 姣忔璇锋眰鐨勫垪琛ㄩ」鏁扮洰 toggleSearchStatus: false, - modalVisible: false// 寮傚父鍙嶉寮圭獥鏄惁寮瑰嚭 + modalVisible: false,// 寮傚父鍙嶉寮圭獥鏄惁寮瑰嚭 + preSelectFirstDate: null } }, props: { nodeTree: '', Type: '', nodePeople: '' }, @@ -469,10 +474,42 @@ } 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', @@ -484,10 +521,14 @@ 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({ @@ -517,11 +558,6 @@ 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 diff --git a/src/views/mdc/base/modules/efficiencyShiftReport/EfficiencyShiftList.vue b/src/views/mdc/base/modules/efficiencyShiftReport/EfficiencyShiftList.vue index a112342..d4449e2 100644 --- a/src/views/mdc/base/modules/efficiencyShiftReport/EfficiencyShiftList.vue +++ b/src/views/mdc/base/modules/efficiencyShiftReport/EfficiencyShiftList.vue @@ -40,7 +40,9 @@ </a-col> <a-col :md="4" :sm="4" :xs="4"> <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> @@ -77,22 +79,6 @@ </a-row> <a-row :gutter="24" v-if="toggleSearchStatus"> - <!-- <a-col :md="5" :sm="5" :xs="5">--> - <!-- <a-form-item label="璁惧绉嶇被">--> - <!-- <a-select--> - <!-- :value="queryParams.deviceCategory"--> - <!-- mode="multiple"--> - <!-- placeholder="璇烽�夋嫨璁惧绉嶇被"--> - <!-- allow-clear--> - <!-- :maxTagCount="1"--> - <!-- @change="selectChange($event,'deviceCategory')"--> - <!-- >--> - <!-- <a-select-option v-for="(item,index) in device_category_list" :value="item.value" :key="index">--> - <!-- {{item.label}}--> - <!-- </a-select-option>--> - <!-- </a-select>--> - <!-- </a-form-item>--> - <!-- </a-col>--> <a-col :md="5" :sm="5" :xs="5"> <a-form-item label="璁惧绾у埆"> <a-select @@ -133,7 +119,9 @@ <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="handleShowFeedbackModal" icon="plus" v-has="'efficiencyShiftReport:feedback'">寮傚父鍙嶉</a-button> + <a-button type="primary" @click="handleShowFeedbackModal" icon="plus" + v-has="'efficiencyShiftReport:feedback'">寮傚父鍙嶉 + </a-button> <a-button type="primary" icon="printer" v-print="'#EfficiencyShift'" v-has="'efficiencyShiftReport:print'">鎵撳嵃 </a-button> @@ -320,7 +308,8 @@ shiftSubList: [], spinning: false, toggleSearchStatus: false, - modalVisible: false// 寮傚父鍙嶉寮圭獥鏄惁寮瑰嚭 + modalVisible: false,// 寮傚父鍙嶉寮圭獥鏄惁寮瑰嚭 + preSelectFirstDate: null } }, props: { nodeTree: '', Type: '', nodePeople: '' }, @@ -500,10 +489,37 @@ } return list }, - disabledDate(current) { - //Can not slect days before today and today - return current && current > moment().subtract('days', 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') + } + }, + initDeviceType(deviceList) { let dictCode = 'mdc_equipmentType' let items = [] @@ -575,8 +591,6 @@ dateParamChange(v1, v2) { this.queryParam.startTime = v2[0] this.queryParam.endTime = v2[1] - // 鐐瑰嚮鏃堕棿閫夋嫨鍣ㄧ殑娓呯┖鎸夐挳鏃朵細瑙﹀彂姝ゅ垽鏂�(鐐瑰嚮閲嶇疆鎸夐挳涓嶄細瑙﹀彂)锛屽疄鐜伴噸缃垪琛ㄥ姛鑳斤紝鍒囧疄鏀瑰彉鍒楄〃鏄剧ず鏁堟灉 - // if(!this.queryParam.startTime&&!this.queryParam.endTime)this.searchReset() }, efficiencyOptionsOnChange(checkedList) { this.checkedList = checkedList @@ -595,7 +609,6 @@ if (this.queryParams[item].length === 0) delete this.queryParam[item] }) this.loadData() - // this.onClearSelected() }, searchReset() { this.typeTree = this.queryParam.typeTree -- Gitblit v1.9.3