From 67d427bd384f9e91d9eedb3deff1452a0cd7c94a Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Tue, 25 Jun 2024 10:42:27 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=E5=93=81=E8=B4=A8=E7=AE=A1=E7=90=86=20?= =?UTF-8?q?=E5=85=A5=E5=BA=93=E7=AE=A1=E7=90=86=20=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E4=BB=93=E5=BA=93=E5=85=A5=E5=BA=93=E5=8D=95=E6=9A=82=E5=AD=98?= =?UTF-8?q?=E6=97=B6=E9=97=B4=20=E8=AE=BE=E7=BD=AE=E5=93=81=E8=B4=A8?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=93=81=E8=B4=A8=E5=8D=95=E6=9A=82=E5=AD=98?= =?UTF-8?q?=E6=97=B6=E9=97=B4=20=E4=BF=AE=E6=94=B9=E5=93=81=E8=B4=A8?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=93=81=E8=B4=A8=E5=8D=95=E6=8A=A5=E5=91=8A?= =?UTF-8?q?=E7=9A=84=E5=89=8D=E7=AB=AF=E6=8F=90=E4=BA=A4=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/QualityOrderServiceImpl.java | 2 +- .../WarehouseStorageOrderServiceImpl.java | 6 +- .../qualityOrder/qualityOrderReport.html | 66 ++++++++++--------- 3 files changed, 40 insertions(+), 34 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityOrderServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityOrderServiceImpl.java index f1172c93..346ccf47 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityOrderServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityOrderServiceImpl.java @@ -105,7 +105,7 @@ public class QualityOrderServiceImpl implements IQualityOrderService { String loginName = ShiroUtils.getLoginName(); qualityOrder.setUpdateBy(loginName); - qualityOrder.setUpdateTime(DateUtils.getNowDate()); + qualityOrder.setUpdateTime(new Date()); List qualityOrderDetailList = qualityOrder.getQualityOrderDetailList(); //根据品质单号从数据库查询 diff --git a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseStorageOrderServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseStorageOrderServiceImpl.java index 17becfef..712a9675 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseStorageOrderServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseStorageOrderServiceImpl.java @@ -104,7 +104,7 @@ public class WarehouseStorageOrderServiceImpl implements IWarehouseStorageOrderS { String loginName = ShiroUtils.getLoginName(); warehouseStorageOrder.setUpdateBy(loginName); - warehouseStorageOrder.setUpdateTime(DateUtils.getNowDate()); + warehouseStorageOrder.setUpdateTime(new Date()); List storageOrderDetailList = warehouseStorageOrder.getWarehouseStorageOrderDetailList(); @@ -145,6 +145,8 @@ public class WarehouseStorageOrderServiceImpl implements IWarehouseStorageOrderS warehouseStorageOrder.setUpdateBy(loginName); warehouseStorageOrder.setUpdateTime(DateUtils.getNowDate()); warehouseStorageOrder.setWarehouseStorageStatus("1"); + //设置暂存时间 + warehouseStorageOrder.setTemporaryTime(new Date()); updateWarehouseStorageOrderDetails(warehouseStorageOrder); int updateResult = warehouseStorageOrderMapper.updateWarehouseStorageOrder(warehouseStorageOrder); @@ -178,6 +180,8 @@ public class WarehouseStorageOrderServiceImpl implements IWarehouseStorageOrderS warehouseStorageOrder.setWarehouseStorageStatus("2"); //目前假设全部品质 warehouseStorageOrder.setWarehouseQualityStatus("2"); + //设置品质时间 + warehouseStorageOrder.setQualityTime(new Date()); for (QualityOrderDetail qualityOrderDetail : qualityOrderDetailList) { WarehouseStorageOrderDetail storageOrderDetail = new WarehouseStorageOrderDetail(); storageOrderDetail.setWarehouseStorageCode(qualityOrder.getInStorageCode()); diff --git a/ruoyi-admin/src/main/resources/templates/quality/qualityOrder/qualityOrderReport.html b/ruoyi-admin/src/main/resources/templates/quality/qualityOrder/qualityOrderReport.html index f7f70646..364f6a5a 100644 --- a/ruoyi-admin/src/main/resources/templates/quality/qualityOrder/qualityOrderReport.html +++ b/ruoyi-admin/src/main/resources/templates/quality/qualityOrder/qualityOrderReport.html @@ -109,39 +109,41 @@ }); function submitHandler() { - // 获取表单数据 - const qualityReportData = $("#form-qualityOrderReport-edit").serializeArray().reduce((obj, item) => { - obj[item.name] = item.value; - return obj; - }, {}); - // 获取bootstrap-table的数据,这里假设你使用bootstrap-table的API获取所有数据 - var table = $('#bootstrap-unqualified-table').bootstrapTable('getData'); - // 检查表格数据是否为空 - if (table.length===0){ - $.modal.alertWarning("请至少添加一条不合格数再保存!"); - return; - } - console.log(JSON.stringify(table)); - // 将表数据转换成与qualityReportData格式一致的数组 - var unqualifiedDataList = table.map(function(item) { - // 根据实际字段名调整 - return { - "processBadClassification": item.processBadClassification, - "processBadGrade": item.processBadGrade, - "processBadNum": item.processBadNum, - "unqualifiedReportUrl": item.unqualifiedReportUrl - // ...其他字段 - }; - }); + if ($.validate.form()) { + // 获取表单数据 + const qualityReportData = $("#form-qualityOrderReport-edit").serializeArray().reduce((obj, item) => { + obj[item.name] = item.value; + return obj; + }, {}); + // 获取bootstrap-table的数据,这里假设你使用bootstrap-table的API获取所有数据 + var table = $('#bootstrap-unqualified-table').bootstrapTable('getData'); + // 检查表格数据是否为空 + if (table.length === 0) { + $.modal.alertWarning("请至少添加一条不合格数再保存!"); + return; + } + console.log(JSON.stringify(table)); + // 将表数据转换成与qualityReportData格式一致的数组 + var unqualifiedDataList = table.map(function (item) { + // 根据实际字段名调整 + return { + "processBadClassification": item.processBadClassification, + "processBadGrade": item.processBadGrade, + "processBadNum": item.processBadNum, + "unqualifiedReportUrl": item.unqualifiedReportUrl + // ...其他字段 + }; + }); - const combinedData = Object.assign({}, qualityReportData, { unqualifiedDataList: unqualifiedDataList }); - // 合并表单数据和表格数据 - // const combinedData = Object.assign({}, ...complaintNoticeData.array(item => ({ [item.name]: item.value })), ...materialData); - console.log(combinedData) - // 使用 JSON.stringify() 序列化数据 - const jsonData = JSON.stringify(combinedData); - // 发送 AJAX 请求到后端接口 - $.operate.saveJson(prefix + "/qualityReport", jsonData); + const combinedData = Object.assign({}, qualityReportData, {unqualifiedDataList: unqualifiedDataList}); + // 合并表单数据和表格数据 + // const combinedData = Object.assign({}, ...complaintNoticeData.array(item => ({ [item.name]: item.value })), ...materialData); + console.log(combinedData) + // 使用 JSON.stringify() 序列化数据 + const jsonData = JSON.stringify(combinedData); + // 发送 AJAX 请求到后端接口 + $.operate.saveJson(prefix + "/qualityReport", jsonData); + } } $("input[name='checkoutCompletionTime']").datetimepicker({