From 13db4aad7910c34610313d4b6168b69b85d4ce46 Mon Sep 17 00:00:00 2001 From: "DESKTOP-5DIJMF9\\admin" <2388969634@qq.com> Date: Thu, 20 Feb 2025 15:01:30 +0800 Subject: [PATCH] =?UTF-8?q?opt:=E4=BC=98=E5=8C=96=E6=88=90=E5=93=81?= =?UTF-8?q?=E5=BA=93=E5=AD=98=E6=9F=A5=E8=AF=A2=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/SubpackagerelationServiceImpl.java | 21 ++++- .../nl/wms/pdm/wql/PDM_BI_SUBPACKAGER01.wql | 24 +++--- lms/nladmin-ui/src/views/wms/pdm/bi/index.vue | 77 +++++++++++-------- 3 files changed, 81 insertions(+), 41 deletions(-) diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pdm/bi/service/impl/SubpackagerelationServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/pdm/bi/service/impl/SubpackagerelationServiceImpl.java index 24a8d081e..401ec7ed3 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/pdm/bi/service/impl/SubpackagerelationServiceImpl.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/pdm/bi/service/impl/SubpackagerelationServiceImpl.java @@ -5,6 +5,7 @@ import cn.hutool.core.date.DateUtil; import cn.hutool.core.map.MapUtil; import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; @@ -94,9 +95,17 @@ public class SubpackagerelationServiceImpl implements SubpackagerelationService if (ObjectUtil.isNotEmpty(sap_pcsn)) { map.put("sap_pcsn", "%" + sap_pcsn + "%"); } + String begin_time = (String) whereJson.get("begin_time"); + + if (!StrUtil.isEmpty(begin_time)) { + map.put("begin_time", begin_time); + } + String end_time = (String) whereJson.get("end_time"); + if (!StrUtil.isEmpty(end_time)) { + map.put("end_time", end_time); + } map.put("is_un_plan_production", is_un_plan_production); map.put("date_of_production", date_of_production); - map.put("date_of_FG_inbound", date_of_FG_inbound); map.put("status", status); JSONObject json = WQL.getWO("PDM_BI_SUBPACKAGER01").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page),"workorder_id desc"); JSONArray content = json.getJSONArray("content"); @@ -228,7 +237,15 @@ public class SubpackagerelationServiceImpl implements SubpackagerelationService } map.put("is_un_plan_production", is_un_plan_production); map.put("date_of_production", date_of_production); - map.put("date_of_FG_inbound", date_of_FG_inbound); + String begin_time = (String) whereJson.get("begin_time"); + + if (!StrUtil.isEmpty(begin_time)) { + map.put("begin_time", begin_time); + } + String end_time = (String) whereJson.get("end_time"); + if (!StrUtil.isEmpty(end_time)) { + map.put("end_time", end_time); + } map.put("status", status); map.put("limits", "10000"); JSONArray resultJSONArray = WQL.getWO("PDM_BI_SUBPACKAGER01").addParamMap(map).process().getResultJSONArray(0); diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pdm/wql/PDM_BI_SUBPACKAGER01.wql b/lms/nladmin-system/src/main/java/org/nl/wms/pdm/wql/PDM_BI_SUBPACKAGER01.wql index e86eb52d9..3426fceab 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/pdm/wql/PDM_BI_SUBPACKAGER01.wql +++ b/lms/nladmin-system/src/main/java/org/nl/wms/pdm/wql/PDM_BI_SUBPACKAGER01.wql @@ -26,6 +26,8 @@ 输入.sap_pcsn TYPEAS s_string 输入.date_of_production TYPEAS s_string 输入.date_of_FG_inbound TYPEAS s_string + 输入.begin_time TYPEAS s_string + 输入.end_time TYPEAS s_string 输入.status TYPEAS s_string @@ -99,14 +101,16 @@ date_of_production = 输入.date_of_production ENDOPTION - OPTION 输入.date_of_FG_inbound <> "" - date_of_FG_inbound = 输入.date_of_FG_inbound + OPTION 输入.begin_time <> "" + date_of_FG_inbound>= 输入.begin_time ENDOPTION + OPTION 输入.end_time <> "" + date_of_FG_inbound <= 输入.end_time + ENDOPTION OPTION 输入.status <> "" status = 输入.status ENDOPTION - ENDSELECT ENDPAGEQUERY ENDIF @@ -167,7 +171,6 @@ OPTION 输入.status <> "" sub.status = 输入.status ENDOPTION - ENDSELECT ENDPAGEQUERY ENDIF @@ -228,7 +231,6 @@ OPTION 输入.status <> "" sub.status = 输入.status ENDOPTION - ENDSELECT ENDPAGEQUERY ENDIF @@ -280,15 +282,19 @@ date_of_production = 输入.date_of_production ENDOPTION - OPTION 输入.date_of_FG_inbound <> "" - date_of_FG_inbound = 输入.date_of_FG_inbound - ENDOPTION + OPTION 输入.begin_time <> "" + date_of_FG_inbound>= 输入.begin_time + ENDOPTION + + OPTION 输入.end_time <> "" + date_of_FG_inbound <= 输入.end_time + ENDOPTION OPTION 输入.status <> "" status = 输入.status ENDOPTION OPTION 输入.limits <> "" - 1=1 order by workorder_id desc limit 0,10000 + 1=1 order by date_of_FG_inbound desc limit 0,10000 ENDOPTION ENDSELECT ENDQUERY diff --git a/lms/nladmin-ui/src/views/wms/pdm/bi/index.vue b/lms/nladmin-ui/src/views/wms/pdm/bi/index.vue index 86ff3a303..1062ac2fa 100644 --- a/lms/nladmin-ui/src/views/wms/pdm/bi/index.vue +++ b/lms/nladmin-ui/src/views/wms/pdm/bi/index.vue @@ -87,16 +87,6 @@ @change="hand" /> - - - - + + + @@ -187,6 +171,7 @@ type="success" icon="el-icon-check" size="mini" + :loading="showDtlLoading" @click="downdtl" > 导出Excel @@ -610,6 +595,7 @@ import udOperation from '@crud/UD.operation' import pagination from '@crud/Pagination' import { download } from '@/api/data' import { downloadFile } from '@/utils' +import crudUserStor from "@/views/wms/basedata/st/userStor/userStor"; const defaultForm = { workorder_id: null, @@ -669,6 +655,7 @@ export default { edit: ['admin', 'sub:edit'], del: ['admin', 'sub:del'] }, + showDtlLoading: false, isPlanProducList: [ { 'label': '是', 'value': '1' }, { 'label': '否', 'value': '0' } @@ -744,23 +731,53 @@ export default { } } }, + created() { + this.initQuery() + }, methods: { // 钩子:在获取表格数据之前执行,false 则代表不获取数据 [CRUD.HOOK.beforeRefresh]() { return true }, + initQuery() { + const end = new Date() + const start = new Date() + const endYear = end.getFullYear() + var endMonth = end.getMonth() + 1 + if (end.getMonth() + 1 < 10) { + endMonth = '0' + endMonth.toString() + } + var endDay = end.getDate() + if (end.getDate() < 10) { + endDay = '0' + endDay.toString() + } + const endDate = endYear + '-' + endMonth + '-' + endDay + ' 23:59:59' + start.setTime(start.getTime() - 3600 * 1000 * 24 * 7) + const startYear = start.getFullYear() + var startMonth = start.getMonth() + 1 + if (start.getMonth() + 1 < 10) { + startMonth = '0' + startMonth.toString() + } + var startDay = start.getDate() + if (start.getDate() < 10) { + startDay = '0' + startDay.toString() + } + const startDate = startYear + '-' + startMonth + '-' + startDay + ' 00:00:00' + this.$set(this.query, 'createTime', [startDate, endDate]) + this.crud.toQuery() + }, hand(value) { this.crud.toQuery() }, downdtl() { if (this.currentRow !== null) { - crud.downloadLoading = true + this.showDtlLoading = true download('/api/subpackagerelation/download', this.crud.query).then(result => { debugger downloadFile(result, '子卷包装', 'xlsx') - crud.downloadLoading = false + this.showDtlLoading = false }).catch(() => { - crud.downloadLoading = false + this.showDtlLoading = false }) } }