From 8663c0f1a31eabe2820c98dc6524d8142afd936d Mon Sep 17 00:00:00 2001 From: zenglf <18502938215@163.com> Date: 星期三, 19 六月 2024 11:54:34 +0800 Subject: [PATCH] 1、 下次技术状态鉴定时间调整 ,下次技术状态鉴定时间=验收日期+技术状态检定周期-1天 2、字段展示调整 --- src/views/dashboard/WorkshopSectionSignage.vue | 238 ++++++++++++++++++++++++++++++++++++++++------------------ 1 files changed, 163 insertions(+), 75 deletions(-) diff --git a/src/views/dashboard/WorkshopSectionSignage.vue b/src/views/dashboard/WorkshopSectionSignage.vue index 2931790..09783e4 100644 --- a/src/views/dashboard/WorkshopSectionSignage.vue +++ b/src/views/dashboard/WorkshopSectionSignage.vue @@ -14,45 +14,11 @@ <dv-decoration-11 style="width:45%;height:60px;color: #fff;font-size: 20px;align-self: flex-start">涓変繚璁″垝 </dv-decoration-11> <div class="support-plan-container"> - <div class="support-plan-item" style="background:#5FE0AF"> - <div>涓変繚鏈湀璁″垝</div> + <div v-for="(item,index) in supportPlanList" :key="index" class="support-plan-item" + :style="{background:item.backgroundColor}" @click="openMaintenanceModal(item)"> + <div>{{item.planTime}}</div> <div class="plan-value-container"> - <div class="plan-value">{{thisMonthMaintenancePlanNum}}</div> - <div>鍙�</div> - </div> - </div> - <div class="support-plan-item" style="background:#409EFF"> - <div>鏈湀瀹屾垚閲�</div> - <div class="plan-value-container"> - <div class="plan-value">{{thisMonthMaintenanceRealNum}}</div> - <div>鍙�</div> - </div> - </div> - <div class="support-plan-item" style="background:#FCAA29"> - <div>寤舵湡</div> - <div class="plan-value-container"> - <div class="plan-value">{{maintenanceExtensionNum}}</div> - <div>鍙�</div> - </div> - </div> - <div class="support-plan-item" style="background:#F56C6C"> - <div>瓒呮湡</div> - <div class="plan-value-container"> - <div class="plan-value">{{maintenanceOverdueNum}}</div> - <div>鍙�</div> - </div> - </div> - <div class="support-plan-item" style="background:#D6BC52"> - <div>涓嬫湀璁″垝</div> - <div class="plan-value-container"> - <div class="plan-value">{{nextMonthMaintenancePlanNum}}</div> - <div>鍙�</div> - </div> - </div> - <div class="support-plan-item" style="background:#58D9F9"> - <div>涓嬩笅鏈堣鍒�</div> - <div class="plan-value-container"> - <div class="plan-value">{{nextNextMonthMaintenancePlanNum}}</div> + <div class="plan-value">{{$data[item.planValueLabel]}}</div> <div>鍙�</div> </div> </div> @@ -102,15 +68,21 @@ </dv-border-box-9> </div> </div> + + <SignageModal :modalVisible="modalVisible" :modalTitle=modalTitle :modalDataApiUrl="modalDataApiUrl" + :modalDataApiParams="modalDataApiParams" + @closeModal="modalVisible=false"/> </div> </template> <script> import signageApi from '@/api/signage' import moment from 'moment' + import SignageModal from './modules/SignageModal' export default { name: 'WorkshopSectionSignage', + components: { SignageModal }, props: { productionCode: { type: String, @@ -141,6 +113,46 @@ { value: '0', name: '鍋滄満' }, { value: '0', name: '杩愯' } ], + supportPlanList: [ + { + planTime: '鏈湀涓変繚璁″垝', + planValueLabel: 'thisMonthMaintenancePlanNum', + backgroundColor: '#5FE0AF', + apiUrl: '/eam/calibrationOrder/showThisMonthMaintenanceList' + }, + + { + planTime: '鏈湀瀹屾垚閲�', + planValueLabel: 'thisMonthMaintenanceRealNum', + backgroundColor: '#409EFF', + apiUrl: '/eam/calibrationOrder/showThisMonthMaintenanceFinishList' + }, + { + planTime: '寤舵湡', + planValueLabel: 'maintenanceExtensionNum', + backgroundColor: '#FCAA29', + apiUrl: '/eam/calibrationOrder/show3MaintenancePostponeList' + }, + + { + planTime: '瓒呮湡', + planValueLabel: 'maintenanceOverdueNum', + backgroundColor: '#F56C6C', + apiUrl: '/eam/calibrationOrder/show3MaintenanceOverdueList' + }, + { + planTime: '涓嬫湀璁″垝', + planValueLabel: 'nextMonthMaintenancePlanNum', + backgroundColor: '#D6BC52', + apiUrl: '/eam/calibrationOrder/showNextMonthMaintenanceList' + }, + { + planTime: '涓嬩笅鏈堣鍒�', + planValueLabel: 'nextNextMonthMaintenancePlanNum', + backgroundColor: '#58D9F9', + apiUrl: '/eam/calibrationOrder/showNextNextMonthMaintenanceList' + } + ], thisMonthMaintenancePlanNum: 0, thisMonthMaintenanceRealNum: 0, maintenanceExtensionNum: 0, @@ -164,7 +176,12 @@ }, barChart: '', barChartData: [], - equipmentId: '' + equipmentId: '', + modalVisible: false, + modalTitle: '', + modalDataApiUrl: '', + modalTableColumns: [], + modalDataApiParams: {} } }, mounted() { @@ -201,9 +218,9 @@ .then(res => { if (res.success && res.result) { this.techConditionData = [ - { value: res.result[0].qualifiedCount, name: '鍚堟牸' }, - { value: res.result[0].disabledCount, name: '绂佺敤' }, - { value: res.result[0].limitedUseCount, name: '闄愮敤' } + { value: res.result[0].qualifiedCount, name: '鍚堟牸', technologyStatus: 'qualified' }, + { value: res.result[0].disabledCount, name: '绂佺敤', technologyStatus: 'disabled' }, + { value: res.result[0].limitedUseCount, name: '闄愮敤', technologyStatus: 'limitedUse' } ] } this.drawTechConditionChart() @@ -223,9 +240,9 @@ .then(res => { if (res.success && res.result) { this.warrantyMalfunctionData = [ - { value: res.result[0].failurTotalCount, name: '鎶ヤ慨' }, - { value: res.result[0].stopCount, name: '鍋滄満' }, - { value: res.result[0].noStopCount, name: '杩愯' } + { value: res.result[0].failurTotalCount, name: '鎶ヤ慨', isStop: '' }, + { value: res.result[0].stopCount, name: '鍋滄満', isStop: '2' }, + { value: res.result[0].noStopCount, name: '杩愯', isStop: '1' } ] } this.drawWarrantyMalfunctionChart() @@ -393,7 +410,7 @@ center: ['50%', '50%'], color: [ '#0FC61A', - '#0DAF15', + '#F56436', '#8B8B8B' ], label: { @@ -420,6 +437,16 @@ } this.techConditionChart.setOption(option, true) this.techConditionChart.hideLoading() + + this.techConditionChart.on('click', params => { + this.modalTitle = `鎶�鏈姸鎬侊紙${params.name}锛塦 + this.modalDataApiParams = { + technologyStatus: this.techConditionData.find(item => item.name === params.name).technologyStatus, + productionCode: this.productionCode + } + this.modalDataApiUrl = '/eam/calibrationOrder/showEquipmentByTechnologyStatus' + this.modalVisible = true + }) }, /* 缁樺埗璁惧鎶ヤ慨鏁呴殰楗煎浘 */ @@ -498,6 +525,16 @@ } this.warrantyMalfunctionChart.setOption(option, true) this.warrantyMalfunctionChart.hideLoading() + + this.warrantyMalfunctionChart.on('click', params => { + this.modalTitle = `鎶ヤ慨鏁呴殰锛�${params.name}锛塦 + this.modalDataApiParams = { + isStop: this.warrantyMalfunctionData.find(item => item.name === params.name).isStop, + productionCode: this.productionCode + } + this.modalDataApiUrl = '/eam/calibrationOrder/showEquipmentByReportRepair' + this.modalVisible = true + }) }, /* 缁樺埗璁惧杩愯鐘舵�佺帿鐟伴ゼ鍥� */ @@ -805,8 +842,7 @@ // 涓绘爣棰樻枃鏈牱寮� fontSize: 18, fontWeight: 'normal', - color: '#1AD8DE', - fontWeight: 'bold' + color: '#1AD8DE' } }, tooltip: { @@ -860,8 +896,8 @@ lineStyle: { // 灞炴�ineStyle鎺у埗绾挎潯鏍峰紡 color: [ //琛ㄧ洏棰滆壊 [0.3, '#F56436'],//0-30%澶勭殑棰滆壊 - [0.7, '#FFFF40'],//30%-60%澶勭殑棰滆壊 - [1, '#0FC61A']//90%-100%澶勭殑棰滆壊 + [0.6, '#FFFF40'],//30%-60%澶勭殑棰滆壊 + [1, '#0FC61A']//60%-100%澶勭殑棰滆壊 ], width: 15//琛ㄧ洏瀹藉害 } @@ -889,11 +925,22 @@ /* 缁樺埗鍒╃敤鐜囦华琛ㄧ洏鍥捐〃 */ drawGaugeChart1(opt) { const option = Object.assign({}, opt) - option.title.text = moment().subtract(1, 'days').format('M鏈圖鏃�') + `鍒╃敤鐜嘸 - option.series[0].name = '鍒╃敤鐜�' - option.series[0].data = [this.gaugeChartData.utilizationRate] - this.gaugeChart1.setOption(option, true) - this.gaugeChart1.hideLoading() + + signageApi.getGaugeColorByTypeApi('lyl') + .then(res => { + if (res.success) { + const colorRange = res.result.map(item => item = [+item.maximumRange / 100, item.rateParameterColor]) + option.series[0].axisLine.lineStyle.color = colorRange + } + }) + .finally(() => { + option.title.text = moment().subtract(1, 'days').format('M鏈圖鏃�') + `鍒╃敤鐜嘸 + option.series[0].name = '鍒╃敤鐜�' + option.series[0].data = [this.gaugeChartData.utilizationRate] + this.gaugeChart1.setOption(option, true) + this.gaugeChart1.hideLoading() + }) + this.gaugeChart1.getZr().on('click', params => { // 浠呮湁鐐瑰嚮琛ㄧ洏鍖哄煙鎵嶄細鏈変互涓嬪睘鎬э紝topTarget琛ㄧず瑙﹀彂浜嬩欢瀵硅薄锛宻hape琛ㄧず瑙﹀彂浜嬩欢瀵硅薄鐨勫浘鍍忓睘鎬э紝clockwise琛ㄧず琛ㄧ洏鏄惁浠ラ『鏃堕拡鎺掑垪锛岄粯璁や负true @@ -912,13 +959,22 @@ /* 缁樺埗寮�鍔ㄧ巼浠〃鐩樺浘琛� */ drawGaugeChart2(opt) { - this.gaugeChart2 = this.$echarts.init(document.getElementById('gauge_chart2')) const option = Object.assign({}, opt) - option.title.text = moment().subtract(1, 'days').format('M鏈圖鏃�') + '寮�鍔ㄧ巼' - option.series[0].name = '寮�鍔ㄧ巼' - option.series[0].data = [this.gaugeChartData.startRate] - this.gaugeChart2.setOption(option, true) - this.gaugeChart2.hideLoading() + + signageApi.getGaugeColorByTypeApi('kdl') + .then(res => { + if (res.success) { + const colorRange = res.result.map(item => item = [+item.maximumRange / 100, item.rateParameterColor]) + option.series[0].axisLine.lineStyle.color = colorRange + } + }) + .finally(() => { + option.title.text = moment().subtract(1, 'days').format('M鏈圖鏃�') + '寮�鍔ㄧ巼' + option.series[0].name = '寮�鍔ㄧ巼' + option.series[0].data = [this.gaugeChartData.startRate] + this.gaugeChart2.setOption(option, true) + this.gaugeChart2.hideLoading() + }) this.gaugeChart2.getZr().on('click', params => { // 浠呮湁鐐瑰嚮琛ㄧ洏鍖哄煙鎵嶄細鏈変互涓嬪睘鎬э紝topTarget琛ㄧず瑙﹀彂浜嬩欢瀵硅薄锛宻hape琛ㄧず瑙﹀彂浜嬩欢瀵硅薄鐨勫浘鍍忓睘鎬э紝clockwise琛ㄧず琛ㄧ洏鏄惁浠ラ『鏃堕拡鎺掑垪锛岄粯璁や负true @@ -937,13 +993,22 @@ /* 缁樺埗寮�鏈虹巼浠〃鐩樺浘琛� */ drawGaugeChart3(opt) { - this.gaugeChart3 = this.$echarts.init(document.getElementById('gauge_chart3')) const option = Object.assign({}, opt) - option.title.text = moment().subtract(1, 'days').format('M鏈圖鏃�') + '寮�鏈虹巼' - option.series[0].name = '寮�鏈虹巼' - option.series[0].data = [this.gaugeChartData.openRate] - this.gaugeChart3.setOption(option, true) - this.gaugeChart3.hideLoading() + + signageApi.getGaugeColorByTypeApi('kdl') + .then(res => { + if (res.success) { + const colorRange = res.result.map(item => item = [+item.maximumRange / 100, item.rateParameterColor]) + option.series[0].axisLine.lineStyle.color = colorRange + } + }) + .finally(() => { + option.title.text = moment().subtract(1, 'days').format('M鏈圖鏃�') + '寮�鏈虹巼' + option.series[0].name = '寮�鏈虹巼' + option.series[0].data = [this.gaugeChartData.openRate] + this.gaugeChart3.setOption(option, true) + this.gaugeChart3.hideLoading() + }) this.gaugeChart3.getZr().on('click', params => { // 浠呮湁鐐瑰嚮琛ㄧ洏鍖哄煙鎵嶄細鏈変互涓嬪睘鎬э紝topTarget琛ㄧず瑙﹀彂浜嬩欢瀵硅薄锛宻hape琛ㄧず瑙﹀彂浜嬩欢瀵硅薄鐨勫浘鍍忓睘鎬э紝clockwise琛ㄧず琛ㄧ洏鏄惁浠ラ『鏃堕拡鎺掑垪锛岄粯璁や负true @@ -962,13 +1027,22 @@ /* 缁樺埗OEE浠〃鐩樺浘琛� */ drawGaugeChart4(opt) { - this.gaugeChart4 = this.$echarts.init(document.getElementById('gauge_chart4')) const option = Object.assign({}, opt) - option.title.text = moment().subtract(1, 'months').format('M鏈�') + `OEE` - option.series[0].name = 'OEE' - option.series[0].data = [this.gaugeChartData.overallEquipmentEfficiency] - this.gaugeChart4.setOption(option, true) - this.gaugeChart4.hideLoading() + + signageApi.getGaugeColorByTypeApi('lyl') + .then(res => { + if (res.success) { + const colorRange = res.result.map(item => item = [+item.maximumRange / 100, item.rateParameterColor]) + option.series[0].axisLine.lineStyle.color = colorRange + } + }) + .finally(() => { + option.title.text = moment().subtract(1, 'months').format('M鏈�') + `OEE` + option.series[0].name = 'OEE' + option.series[0].data = [this.gaugeChartData.overallEquipmentEfficiency] + this.gaugeChart4.setOption(option, true) + this.gaugeChart4.hideLoading() + }) this.gaugeChart4.getZr().on('click', params => { // 浠呮湁鐐瑰嚮琛ㄧ洏鍖哄煙鎵嶄細鏈変互涓嬪睘鎬э紝topTarget琛ㄧず瑙﹀彂浜嬩欢瀵硅薄锛宻hape琛ㄧず瑙﹀彂浜嬩欢瀵硅薄鐨勫浘鍍忓睘鎬э紝clockwise琛ㄧず琛ㄧ洏鏄惁浠ラ『鏃堕拡鎺掑垪锛岄粯璁や负true @@ -995,8 +1069,7 @@ // 涓绘爣棰樻枃鏈牱寮� fontSize: 18, fontWeight: 'normal', - color: '#1AD8DE', - fontWeight: 'bold' + color: '#1AD8DE' } }, tooltip: { @@ -1147,6 +1220,20 @@ }, /** + * 鐐瑰嚮涓変繚灞曠ず鏍忓悗鎵撳紑寮圭獥 + * @param record 鐐瑰嚮褰撳墠涓変繚淇℃伅 + */ + openMaintenanceModal(record) { + this.modalTitle = record.planTime + this.modalDataApiParams = { + productionCode: this.productionCode + } + this.modalDataApiUrl = record.apiUrl + this.modalVisible = true + }, + + + /** * 绐楀彛灏哄鍙樺寲鏃惰Е鍙� * 璋冩暣鍥捐〃灏哄浠ラ�傚簲鍒嗚鲸鐜� */ @@ -1192,6 +1279,7 @@ width: 30%; padding: 5px 10px; margin-bottom: 10px; + cursor: pointer; .plan-value-container { display: flex; -- Gitblit v1.9.3