Browse Source

[fix]品质管理 入库管理

设置仓库入库单暂存时间
设置品质管理品质单暂存时间
修改品质管理品质单报告的前端提交方法
dev
liuxiaoxu 5 months ago
parent
commit
67d427bd38
  1. 2
      ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityOrderServiceImpl.java
  2. 6
      ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseStorageOrderServiceImpl.java
  3. 66
      ruoyi-admin/src/main/resources/templates/quality/qualityOrder/qualityOrderReport.html

2
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(); String loginName = ShiroUtils.getLoginName();
qualityOrder.setUpdateBy(loginName); qualityOrder.setUpdateBy(loginName);
qualityOrder.setUpdateTime(DateUtils.getNowDate()); qualityOrder.setUpdateTime(new Date());
List<QualityOrderDetail> qualityOrderDetailList = qualityOrder.getQualityOrderDetailList(); List<QualityOrderDetail> qualityOrderDetailList = qualityOrder.getQualityOrderDetailList();
//根据品质单号从数据库查询 //根据品质单号从数据库查询

6
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(); String loginName = ShiroUtils.getLoginName();
warehouseStorageOrder.setUpdateBy(loginName); warehouseStorageOrder.setUpdateBy(loginName);
warehouseStorageOrder.setUpdateTime(DateUtils.getNowDate()); warehouseStorageOrder.setUpdateTime(new Date());
List<WarehouseStorageOrderDetail> storageOrderDetailList = warehouseStorageOrder.getWarehouseStorageOrderDetailList(); List<WarehouseStorageOrderDetail> storageOrderDetailList = warehouseStorageOrder.getWarehouseStorageOrderDetailList();
@ -145,6 +145,8 @@ public class WarehouseStorageOrderServiceImpl implements IWarehouseStorageOrderS
warehouseStorageOrder.setUpdateBy(loginName); warehouseStorageOrder.setUpdateBy(loginName);
warehouseStorageOrder.setUpdateTime(DateUtils.getNowDate()); warehouseStorageOrder.setUpdateTime(DateUtils.getNowDate());
warehouseStorageOrder.setWarehouseStorageStatus("1"); warehouseStorageOrder.setWarehouseStorageStatus("1");
//设置暂存时间
warehouseStorageOrder.setTemporaryTime(new Date());
updateWarehouseStorageOrderDetails(warehouseStorageOrder); updateWarehouseStorageOrderDetails(warehouseStorageOrder);
int updateResult = warehouseStorageOrderMapper.updateWarehouseStorageOrder(warehouseStorageOrder); int updateResult = warehouseStorageOrderMapper.updateWarehouseStorageOrder(warehouseStorageOrder);
@ -178,6 +180,8 @@ public class WarehouseStorageOrderServiceImpl implements IWarehouseStorageOrderS
warehouseStorageOrder.setWarehouseStorageStatus("2"); warehouseStorageOrder.setWarehouseStorageStatus("2");
//目前假设全部品质 //目前假设全部品质
warehouseStorageOrder.setWarehouseQualityStatus("2"); warehouseStorageOrder.setWarehouseQualityStatus("2");
//设置品质时间
warehouseStorageOrder.setQualityTime(new Date());
for (QualityOrderDetail qualityOrderDetail : qualityOrderDetailList) { for (QualityOrderDetail qualityOrderDetail : qualityOrderDetailList) {
WarehouseStorageOrderDetail storageOrderDetail = new WarehouseStorageOrderDetail(); WarehouseStorageOrderDetail storageOrderDetail = new WarehouseStorageOrderDetail();
storageOrderDetail.setWarehouseStorageCode(qualityOrder.getInStorageCode()); storageOrderDetail.setWarehouseStorageCode(qualityOrder.getInStorageCode());

66
ruoyi-admin/src/main/resources/templates/quality/qualityOrder/qualityOrderReport.html

@ -109,39 +109,41 @@
}); });
function submitHandler() { function submitHandler() {
// 获取表单数据 if ($.validate.form()) {
const qualityReportData = $("#form-qualityOrderReport-edit").serializeArray().reduce((obj, item) => { // 获取表单数据
obj[item.name] = item.value; const qualityReportData = $("#form-qualityOrderReport-edit").serializeArray().reduce((obj, item) => {
return obj; obj[item.name] = item.value;
}, {}); return obj;
// 获取bootstrap-table的数据,这里假设你使用bootstrap-table的API获取所有数据 }, {});
var table = $('#bootstrap-unqualified-table').bootstrapTable('getData'); // 获取bootstrap-table的数据,这里假设你使用bootstrap-table的API获取所有数据
// 检查表格数据是否为空 var table = $('#bootstrap-unqualified-table').bootstrapTable('getData');
if (table.length===0){ // 检查表格数据是否为空
$.modal.alertWarning("请至少添加一条不合格数再保存!"); if (table.length === 0) {
return; $.modal.alertWarning("请至少添加一条不合格数再保存!");
} return;
console.log(JSON.stringify(table)); }
// 将表数据转换成与qualityReportData格式一致的数组 console.log(JSON.stringify(table));
var unqualifiedDataList = table.map(function(item) { // 将表数据转换成与qualityReportData格式一致的数组
// 根据实际字段名调整 var unqualifiedDataList = table.map(function (item) {
return { // 根据实际字段名调整
"processBadClassification": item.processBadClassification, return {
"processBadGrade": item.processBadGrade, "processBadClassification": item.processBadClassification,
"processBadNum": item.processBadNum, "processBadGrade": item.processBadGrade,
"unqualifiedReportUrl": item.unqualifiedReportUrl "processBadNum": item.processBadNum,
// ...其他字段 "unqualifiedReportUrl": item.unqualifiedReportUrl
}; // ...其他字段
}); };
});
const combinedData = Object.assign({}, qualityReportData, { unqualifiedDataList: unqualifiedDataList }); const combinedData = Object.assign({}, qualityReportData, {unqualifiedDataList: unqualifiedDataList});
// 合并表单数据和表格数据 // 合并表单数据和表格数据
// const combinedData = Object.assign({}, ...complaintNoticeData.array(item => ({ [item.name]: item.value })), ...materialData); // const combinedData = Object.assign({}, ...complaintNoticeData.array(item => ({ [item.name]: item.value })), ...materialData);
console.log(combinedData) console.log(combinedData)
// 使用 JSON.stringify() 序列化数据 // 使用 JSON.stringify() 序列化数据
const jsonData = JSON.stringify(combinedData); const jsonData = JSON.stringify(combinedData);
// 发送 AJAX 请求到后端接口 // 发送 AJAX 请求到后端接口
$.operate.saveJson(prefix + "/qualityReport", jsonData); $.operate.saveJson(prefix + "/qualityReport", jsonData);
}
} }
$("input[name='checkoutCompletionTime']").datetimepicker({ $("input[name='checkoutCompletionTime']").datetimepicker({

Loading…
Cancel
Save