From 66ec2c69057787e24cfacca304dae750a8e6cb7d Mon Sep 17 00:00:00 2001 From: liuxy Date: Wed, 14 Sep 2022 10:53:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/InstrumentaccountServiceImpl.java | 15 +++++++++ .../service/impl/SafeaccountServiceImpl.java | 15 +++++++++ .../impl/SpecialaccountServiceImpl.java | 16 +++++++++- .../sb/repair/wql/EM_BI_DEVICEREPAIR001.wql | 6 +++- .../wms/sb/re/instrumentaccount/index.vue | 31 +----------------- .../src/views/wms/sb/re/safeaccount/index.vue | 31 +----------------- .../views/wms/sb/re/specialaccount/index.vue | 32 +------------------ .../wms/sb/repair/devicerepair/index.vue | 8 +++-- .../wms/sb/repair/devicerepairpa/index.vue | 18 +++++++---- .../wms/sb/upkeep/devicemaintenance/index.vue | 8 +++-- 10 files changed, 75 insertions(+), 105 deletions(-) diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/sb/re/service/impl/InstrumentaccountServiceImpl.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/sb/re/service/impl/InstrumentaccountServiceImpl.java index 5b60d050..c8c10661 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/sb/re/service/impl/InstrumentaccountServiceImpl.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/sb/re/service/impl/InstrumentaccountServiceImpl.java @@ -2,6 +2,7 @@ package org.nl.wms.sb.re.service.impl; +import cn.hutool.core.date.DateUnit; import cn.hutool.core.date.DateUtil; import cn.hutool.core.map.MapUtil; import cn.hutool.core.util.IdUtil; @@ -48,6 +49,20 @@ public class InstrumentaccountServiceImpl implements InstrumentaccountService { map.put("beginuse_date", MapUtil.getStr(whereJson, "beginuse_date")); map.put("docimasy_result", MapUtil.getStr(whereJson, "docimasy_result")); JSONObject json = WQL.getWO("QEM_BI_INSTRUMENTACCOUNT001").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), ""); + + JSONArray content = json.getJSONArray("content"); + for (int i = 0; i < content.size(); i++) { + JSONObject jsonObject = content.getJSONObject(i); + + Date date1 = DateUtil.parse(DateUtil.today()); // 当前日期 + Date date2 = DateUtil.parse(jsonObject.getString("beginuse_date")); // 下次检验日期 + + long betweenDay = DateUtil.between(date1, date2, DateUnit.DAY, false); + + if (betweenDay < 15) { + jsonObject.put("is_red", "1"); + } + } return json; } diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/sb/re/service/impl/SafeaccountServiceImpl.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/sb/re/service/impl/SafeaccountServiceImpl.java index 63f83ce2..a1c3fecb 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/sb/re/service/impl/SafeaccountServiceImpl.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/sb/re/service/impl/SafeaccountServiceImpl.java @@ -2,6 +2,7 @@ package org.nl.wms.sb.re.service.impl; +import cn.hutool.core.date.DateUnit; import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.ObjectUtil; @@ -45,6 +46,20 @@ public class SafeaccountServiceImpl implements SafeaccountService { if (!ObjectUtil.isEmpty(device_code)) map.put("device_code", "%" + device_code + "%"); map.put("docimasy_date", docimasy_date); JSONObject json = WQL.getWO("QEM_BI_SAFEACCOUNT001").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), ""); + + JSONArray content = json.getJSONArray("content"); + for (int i = 0; i < content.size(); i++) { + JSONObject jsonObject = content.getJSONObject(i); + + Date date1 = DateUtil.parse(DateUtil.today()); // 当前日期 + Date date2 = DateUtil.parse(jsonObject.getString("next_docimasy_date")); // 下次检验日期 + + long betweenDay = DateUtil.between(date1, date2, DateUnit.DAY, false); + + if (betweenDay < 15) { + jsonObject.put("is_red", "1"); + } + } return json; } diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/sb/re/service/impl/SpecialaccountServiceImpl.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/sb/re/service/impl/SpecialaccountServiceImpl.java index c5ad01c5..c7cea716 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/sb/re/service/impl/SpecialaccountServiceImpl.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/sb/re/service/impl/SpecialaccountServiceImpl.java @@ -2,6 +2,7 @@ package org.nl.wms.sb.re.service.impl; +import cn.hutool.core.date.DateUnit; import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.ObjectUtil; @@ -35,7 +36,6 @@ import java.util.*; @RequiredArgsConstructor @Slf4j public class SpecialaccountServiceImpl implements SpecialaccountService { - @Override public Map queryAll(Map whereJson, Pageable page) { String device_code = (String) whereJson.get("device_code"); @@ -45,6 +45,20 @@ public class SpecialaccountServiceImpl implements SpecialaccountService { if (!ObjectUtil.isEmpty(device_code)) map.put("device_code", "%" + device_code + "%"); map.put("valid_term", valid_term); JSONObject json = WQL.getWO("QEM_BI_SPECIALACCOUNT001").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), ""); + + JSONArray content = json.getJSONArray("content"); + for (int i = 0; i < content.size(); i++) { + JSONObject jsonObject = content.getJSONObject(i); + + Date date1 = DateUtil.parse(DateUtil.today()); // 当前日期 + Date date2 = DateUtil.parse(jsonObject.getString("valid_term")); // 检验日期 + + long betweenDay = DateUtil.between(date1, date2, DateUnit.DAY, false); + + if (betweenDay < 30) { + jsonObject.put("is_red", "1"); + } + } return json; } diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/sb/repair/wql/EM_BI_DEVICEREPAIR001.wql b/mes/hd/nladmin-system/src/main/java/org/nl/wms/sb/repair/wql/EM_BI_DEVICEREPAIR001.wql index b53de128..c5433b46 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/sb/repair/wql/EM_BI_DEVICEREPAIR001.wql +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/sb/repair/wql/EM_BI_DEVICEREPAIR001.wql @@ -58,11 +58,15 @@ class.class_name, file.device_code, file.device_name, - file.extend_code + file.extend_code, + d1.name AS dept_name, + d2.name AS use_name FROM EM_BI_DeviceRepairMst mst LEFT JOIN EM_BI_EquipmentFile file ON file.devicerecord_id = mst.devicerecord_id LEFT JOIN md_pb_classstandard class ON file.material_type_id = class.class_id + LEFT JOIN sys_dept d1 ON file.belong_deptid = d1.dept_id + LEFT JOIN sys_dept d2 ON file.use_groupid = d2.dept_id WHERE mst.is_delete = '0' AND file.is_delete = '0' diff --git a/mes/qd/src/views/wms/sb/re/instrumentaccount/index.vue b/mes/qd/src/views/wms/sb/re/instrumentaccount/index.vue index 8fe259a2..66704691 100644 --- a/mes/qd/src/views/wms/sb/re/instrumentaccount/index.vue +++ b/mes/qd/src/views/wms/sb/re/instrumentaccount/index.vue @@ -248,37 +248,8 @@ export default { } }, tableRowClassName({ row, rowIndex }) { - // 将每行的检验有效期时间格式化 - const vDate = row.beginuse_date - const vDateStr = vDate.replace(/-/g, '') - // 获取当前时间并格式化 - var myDate = new Date() - // 以下操作是为了补时间缺的0 - const month = myDate.getMonth() + 1 - const date = myDate.getDate() - const stryear = myDate.getFullYear().toString() - const strmonth = (myDate.getMonth() + 1).toString() - const strdate = myDate.getDate().toString() - var c - var x - var b - b = stryear - if (month < 10) { - c = ('0' + strmonth) - } else { - c = strmonth - } - if (date < 10) { - x = ('0' + strdate) - } else { - x = strdate - } - const vnowDate = b + c + x - // 将字符串转换成int类型进行相减 - const a = parseInt(vDateStr) - parseInt(vnowDate) - // 进行比较符合条件表格就变化颜色 const stylejson = {} - if (a < 15) { + if (row.is_red !== undefined) { stylejson.background = '#e0838f' stylejson.color = 'green' return stylejson diff --git a/mes/qd/src/views/wms/sb/re/safeaccount/index.vue b/mes/qd/src/views/wms/sb/re/safeaccount/index.vue index 3d804980..bef65db9 100644 --- a/mes/qd/src/views/wms/sb/re/safeaccount/index.vue +++ b/mes/qd/src/views/wms/sb/re/safeaccount/index.vue @@ -217,37 +217,8 @@ export default { return true }, tableRowClassName({ row, rowIndex }) { - // 将每行的检验有效期时间格式化 - const vDate = row.next_docimasy_date - const vDateStr = vDate.replace(/-/g, '') - // 获取当前时间并格式化 - var myDate = new Date() - // 以下操作是为了补时间缺的0 - const month = myDate.getMonth() + 1 - const date = myDate.getDate() - const stryear = myDate.getFullYear().toString() - const strmonth = (myDate.getMonth() + 1).toString() - const strdate = myDate.getDate().toString() - var c - var x - var b - b = stryear - if (month < 10) { - c = ('0' + strmonth) - } else { - c = strmonth - } - if (date < 10) { - x = ('0' + strdate) - } else { - x = strdate - } - const vnowDate = b + c + x - // 将字符串转换成int类型进行相减 - const a = parseInt(vDateStr) - parseInt(vnowDate) - // 进行比较符合条件表格就变化颜色 const stylejson = {} - if (a < 15) { + if (row.is_red !== undefined) { stylejson.background = '#e0838f' stylejson.color = 'green' return stylejson diff --git a/mes/qd/src/views/wms/sb/re/specialaccount/index.vue b/mes/qd/src/views/wms/sb/re/specialaccount/index.vue index d8e6139c..1e9185de 100644 --- a/mes/qd/src/views/wms/sb/re/specialaccount/index.vue +++ b/mes/qd/src/views/wms/sb/re/specialaccount/index.vue @@ -216,38 +216,8 @@ export default { return true }, tableRowClassName({ row, rowIndex }) { - // 将每行的检验有效期时间格式化 - const vDate = row.valid_term - const vDateStr = vDate.replace(/-/g, '') - // 获取当前时间并格式化 - var myDate = new Date() - // 以下操作是为了补时间缺的0 - const month = myDate.getMonth() + 1 - const date = myDate.getDate() - const stryear = myDate.getFullYear().toString() - const strmonth = (myDate.getMonth() + 1).toString() - const strdate = myDate.getDate().toString() - var c - var x - var b - b = stryear - if (month < 10) { - c = ('0' + strmonth) - } else { - c = strmonth - } - if (date < 10) { - x = ('0' + strdate) - } else { - x = strdate - } - const vnowDate = b + c + x - // 将字符串转换成int类型进行相减 - const a = parseInt(vDateStr) - parseInt(vnowDate) - debugger - // 进行比较符合条件表格就变化颜色 const stylejson = {} - if (a < 30) { + if (row.is_red !== undefined) { stylejson.background = '#e0838f' stylejson.color = 'green' return stylejson diff --git a/mes/qd/src/views/wms/sb/repair/devicerepair/index.vue b/mes/qd/src/views/wms/sb/repair/devicerepair/index.vue index b73377b3..aac16c3c 100644 --- a/mes/qd/src/views/wms/sb/repair/devicerepair/index.vue +++ b/mes/qd/src/views/wms/sb/repair/devicerepair/index.vue @@ -94,14 +94,16 @@ - - + + + + diff --git a/mes/qd/src/views/wms/sb/repair/devicerepairpa/index.vue b/mes/qd/src/views/wms/sb/repair/devicerepairpa/index.vue index 72e63590..a9bec490 100644 --- a/mes/qd/src/views/wms/sb/repair/devicerepairpa/index.vue +++ b/mes/qd/src/views/wms/sb/repair/devicerepairpa/index.vue @@ -84,7 +84,7 @@ type="success" icon="el-icon-position" size="mini" - :disabled="crud.selections.length !== 1" + :disabled="start_flag" @click="startRepair" > 开始维修 @@ -95,7 +95,7 @@ type="success" icon="el-icon-position" size="mini" - :disabled="crud.selections.length !== 1" + :disabled="execu_flag" @click="executeRepair" > 维修执行 @@ -106,7 +106,7 @@ type="success" icon="el-icon-position" size="mini" - :disabled="crud.selections.length !== 1" + :disabled="end_flag" @click="endRepair" > 结束维修 @@ -117,7 +117,7 @@ type="success" icon="el-icon-position" size="mini" - :disabled="crud.selections.length !== 1" + :disabled="open_flag" @click="openReceive" > 维修领用 @@ -128,7 +128,7 @@ type="success" icon="el-icon-position" size="mini" - :disabled="crud.selections.length !== 1" + :disabled="confirm_flag" @click="confirmRepair" > 维修确认 @@ -139,7 +139,7 @@ type="success" icon="el-icon-position" size="mini" - :disabled="crud.selections.length !== 1" + :disabled="result_flag" @click="resuftRepair" > 结果录入 @@ -221,6 +221,12 @@ export default { }, data() { return { + start_flag: true, + execu_flag: true, + end_flag: true, + open_flag: true, + confirm_flag: true, + result_flag: true, classes: [], class_idStr: null, materOpt_code: '23', diff --git a/mes/qd/src/views/wms/sb/upkeep/devicemaintenance/index.vue b/mes/qd/src/views/wms/sb/upkeep/devicemaintenance/index.vue index 054134c5..c129d874 100644 --- a/mes/qd/src/views/wms/sb/upkeep/devicemaintenance/index.vue +++ b/mes/qd/src/views/wms/sb/upkeep/devicemaintenance/index.vue @@ -105,14 +105,16 @@ - - + + + +