From c5116e93fc42e6f4d732a7ea990068ad9d0e0736 Mon Sep 17 00:00:00 2001 From: baoshiwei <baoshiwei@shlanbao.cn> Date: 星期四, 24 七月 2025 14:52:56 +0800 Subject: [PATCH] feat(dry): 新增设备维护记录功能、新增维修记录功能、设备主数据增加履历相关字段 --- src/views/dry/bigScreen/BigWorkShop.vue | 45 +++++++++++++++++++++++++++------------------ 1 files changed, 27 insertions(+), 18 deletions(-) diff --git a/src/views/dry/bigScreen/BigWorkShop.vue b/src/views/dry/bigScreen/BigWorkShop.vue index 1d764c7..aa59bc9 100644 --- a/src/views/dry/bigScreen/BigWorkShop.vue +++ b/src/views/dry/bigScreen/BigWorkShop.vue @@ -34,12 +34,12 @@ <div class="statistics putincolor"> <div class="stat_label font16"> 鎬绘姇鏂欓噺 </div> <div class="stat_value"> - {{ originWeight.toFixed(2) }} + {{ originWeight?.toFixed(2) || 0 }} <span class="font16"> Kg </span> </div> <div class="stat_avg"> <div> 棰勮浜ч噺 </div> - <div> {{ totalYield.toFixed(2) }} kg </div> + <div> {{ totalYield?.toFixed(2) || 0 }} kg </div> </div> </div> </dv-border-box7> @@ -47,12 +47,12 @@ <div class="statistics putincolor"> <div class="stat_label font16"> 鐢甸噺娑堣�� </div> <div class="stat_value"> - {{ watt.toFixed(2) }} + {{ watt?.toFixed(2) || 0 }} <span class="font16"> Kwh </span> </div> <div class="stat_avg"> <div> 骞冲潎鐢佃�� </div> - <div> {{wattAvg.toFixed(2)}} Kwh/kg </div> + <div> {{wattAvg?.toFixed(2) || 0}} Kwh/kg </div> </div> </div> </dv-border-box7> @@ -60,12 +60,12 @@ <div class="statistics putincolor"> <div class="stat_label font16"> 钂告苯娑堣�� </div> <div class="stat_value"> - {{ steam.toFixed(2) }} + {{ steam?.toFixed(2) || 0 }} <span class="font16"> m鲁 </span> </div> <div class="stat_avg"> <div> 骞冲潎姹借�� </div> - <div> {{steamAvg.toFixed(2)}} m鲁 </div> + <div> {{steamAvg?.toFixed(2) || 0}} m鲁/kg </div> </div> </div> </dv-border-box7> @@ -155,11 +155,11 @@ <div class="eqp-timer"> <div ><Icon style="color: #1850b7" icon="ic:twotone-water-drop" :size="20" /> - {{ realTime.get(eqpCodes[num - 1])?.trendVo?.moisture.toFixed(1) || '0' }} % + {{ realTime.get(eqpCodes[num - 1])?.trendVo?.moisture?.toFixed(1) || '0' }} % </div> <div ><Icon style="color: #873853" icon="fluent:temperature-20-regular" :size="20" /> - {{ realTime.get(eqpCodes[num - 1])?.trendVo?.bellowsTemp.toFixed(0) || '0' }} 鈩� + {{ realTime.get(eqpCodes[num - 1])?.trendVo?.bellowsTemp?.toFixed(0) || '0' }} 鈩� </div> <div ><Icon style="color: rgb(134 207 106)" icon="gg:sand-clock" :size="20" /> @@ -247,11 +247,11 @@ <div class="eqp-timer"> <div ><Icon style="color: #1850b7" icon="ic:twotone-water-drop" :size="20" /> - {{ realTime.get(eqpCodes[num + 3])?.trendVo?.moisture.toFixed(1) || '0' }} % + {{ realTime.get(eqpCodes[num + 3])?.trendVo?.moisture?.toFixed(1) || '0' }} % </div> <div ><Icon style="color: #873853" icon="fluent:temperature-20-regular" :size="20" /> - {{ realTime.get(eqpCodes[num + 3])?.trendVo?.bellowsTemp.toFixed(0) || '0' }} 鈩� + {{ realTime.get(eqpCodes[num + 3])?.trendVo?.bellowsTemp?.toFixed(0) || '0' }} 鈩� </div> <!-- <div><Icon style="color: rgb(42 154 234)" icon="mdi:clock-outline" :size="20" /> {{realTime.get(eqpCodes[num + 3])?.dryTime || 0}} min @@ -285,12 +285,19 @@ import { router } from '/@/router' import { defHttp } from '/@/utils/http/axios' import { useUserStore } from '/@/store/modules/user' + import {setAuthCache} from "/@/utils/auth"; + import {TENANT_ID} from "/@/enums/cacheEnum"; const eqpNum = ref(4) const eqpMap = ref(new Map()) const eqpCodes = ref(['GM001', 'GM002', 'GM003', 'GM004', 'GM005', 'GM006', 'GM007', 'GM008']) const eqps = ref([] as dryEquipment[]) - const title = ref('鍏版郸鏅鸿兘骞茬嚗杞﹂棿') + const title = ref('鏅鸿兘骞茬嚗杞﹂棿') + const userStore = useUserStore() + const tenantId = ref(router.currentRoute.value.query.tenantId | userStore.getTenant) + setAuthCache(TENANT_ID, tenantId.value) + console.log('tenantId1', router.currentRoute.value.query.tenantId) + console.log('tenantId2', userStore.getTenant) const envHum = ref(0) const envTemp = ref(0) const originWeight = ref(0) @@ -314,7 +321,7 @@ const nowDate = ref() function listAllEqp() { - listAll({ enable: 'Y' }) + defHttp.get({ url: '/dry/real/queryAllEqps', params: { tenantId: tenantId.value,enable: 'Y' } }) .then((result) => { console.log(`output->result`, result) eqps.value = result @@ -340,8 +347,8 @@ } function queryWorkShopStatistics() { - let tenantId = userStore.getTenant - defHttp.get({ url: '/dry/real/workshopStatistics', params: { tenantid: tenantId } }).then((res) => { + + defHttp.get({ url: '/dry/real/workshopStatistics', params: { tenantid: tenantId.value } }).then((res) => { console.log(`output->res`, res) steam.value = res.steam watt.value = res.watt @@ -358,17 +365,19 @@ } function queryRealTime(eqp: dryEquipment) { - let tenantId = userStore.getTenant + let eqpCode = eqp.code let queryRealTimeUrl = '/dry/real/getRealTimeData' - defHttp.get({ url: queryRealTimeUrl, params: { tenantid: tenantId, machineid: eqpCode } }).then((res) => { + defHttp.get({ url: queryRealTimeUrl, params: { tenantid: tenantId.value, machineid: eqpCode } }).then((res) => { if (res && res.trendVo) { res.tempValue = [res.windTemp, 100] res.totalRemain = res.remain - if (res.detailList) { + if (res.detailList && res.detailList.length > 0) { // 骞茬嚗鍓╀綑鏃堕棿=宸ュ崟棰勮鍓╀綑-锛堝綋鍓嶅共鐕ユ椂闂�-鏈�鍚庝竴娆¤褰曞共鐕ユ椂闂达級 res.totalRemain = res.remain - (res.dryTime - res.detailList[res.detailList.length - 1].totalTime) - } + } else { + res.totalRemain = res.remain - res.dryTime + } if (res.totalRemain < 0) { res.totalRemain = 0 } -- Gitblit v1.9.3