Browse Source

[feat] 品质管理 仓库管理 生产管理 销售管理

修改品质管理 计算不良数量的合计值。去掉不合格分类列表为空的抛出异常校验
修改仓库 生产入库前端页面
修改仓库 生产入库详情前端页面
修改仓库 委内入库前端页面
修改仓库入库单 生产入库 入库的按钮显示条件
新增 入库-生产订单(生产入库) 客户物料详情列表
销售订单后端新增 根据销售单号更新销售订单数据
新增入库生产订单的入库修改保存方法,新增加同时修改生产订单和销售订单
dev
liuxiaoxu 4 months ago
parent
commit
10108d9b41
  1. 12
      ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityOrderReportServiceImpl.java
  2. 5
      ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSalesOrderService.java
  3. 12
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesOrderServiceImpl.java
  4. 9
      ruoyi-admin/src/main/java/com/ruoyi/warehouse/controller/WarehouseStorageOrderController.java
  5. 119
      ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseStorageOrderServiceImpl.java
  6. 142
      ruoyi-admin/src/main/resources/templates/warehouse/storageOrder/storageMake.html
  7. 140
      ruoyi-admin/src/main/resources/templates/warehouse/storageOrder/storageMakeDetail.html
  8. 11
      ruoyi-admin/src/main/resources/templates/warehouse/storageOrder/storageMakeInDetail.html
  9. 4
      ruoyi-admin/src/main/resources/templates/warehouse/storageOrder/storageOrder.html

12
ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityOrderReportServiceImpl.java

@ -328,12 +328,16 @@ public class QualityOrderReportServiceImpl implements IQualityOrderReportService
qualityOrderDetail.setQualityHasqualifiedNum(qualityQualifiedNum);
//获得品质报告中的不合格数模块数据
List<QualityOrderReportUnqualified> unqualifiedDataList = qualityOrderReport.getUnqualifiedDataList();
if (CollectionUtils.isEmpty(unqualifiedDataList)){
throw new BusinessException("品质单不合格数数据为空");
// if (CollectionUtils.isEmpty(unqualifiedDataList)){
// throw new BusinessException("品质单不合格数数据为空");
// }
int processBadNumTotal = 0;
if (!CollectionUtils.isEmpty(unqualifiedDataList)){
//计算不良数量的合计值
processBadNumTotal = unqualifiedDataList.stream().mapToInt(QualityOrderReportUnqualified::getProcessBadNum).sum();
}
//计算不良数量的合计值
int processBadNumTotal = unqualifiedDataList.stream().mapToInt(QualityOrderReportUnqualified::getProcessBadNum).sum();
//更新品质报告详情品质不合格数
qualityOrderDetail.setQualityUnqualifiedNum(processBadNumTotal);

5
ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSalesOrderService.java

@ -82,4 +82,9 @@ public interface ISysSalesOrderService
* 提交申请*/
public ProcessInstance submitApply(SysSalesOrder sysSalesOrder);
/*
* 根据销售单号更新销售订单
* */
int updateSysSalesOrderBySalesOrderCode(SysSalesOrder sysSalesOrder);
}

12
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesOrderServiceImpl.java

@ -340,6 +340,18 @@ public class SysSalesOrderServiceImpl implements ISysSalesOrderService
return processInstance;
}
/*
* 根据销售单号更新销售订单
* */
@Override
public int updateSysSalesOrderBySalesOrderCode(SysSalesOrder sysSalesOrder) {
sysSalesOrder.setUpdateTime(new Date());
sysSalesOrder.setUpdateBy(ShiroUtils.getLoginName());
return sysSalesOrderMapper.updateSysSalesOrderBySalesOrderCode(sysSalesOrder);
}
private ProcessInstance startProcessInstance(String applyTitle,String instanceType,SysSalesOrder sysSalesOrder, SysUser user) {
Long nessKey = sysSalesOrder.getSalesOrderId();

9
ruoyi-admin/src/main/java/com/ruoyi/warehouse/controller/WarehouseStorageOrderController.java

@ -538,10 +538,11 @@ public class WarehouseStorageOrderController extends BaseController
*/
@ResponseBody
@RequestMapping("/storageMakeDetailList")
public Map<String,List<WarehouseStorageOrderDetail>> storageMakeDetail(String warehouseStorageCode){
List<WarehouseStorageOrderDetail> allDetails = storageOrderDetailService.selectStorageOrderDetailListByCode(warehouseStorageCode);
Map<String, List<WarehouseStorageOrderDetail>> groupedDetails = allDetails.stream().collect(Collectors.groupingBy(WarehouseStorageOrderDetail::getCustomerId));
return groupedDetails;
public TableDataInfo storageMakeDetailList(WarehouseStorageOrder warehouseStorageOrder){
startPage();
String warehouseStorageCode = warehouseStorageOrder.getWarehouseStorageCode();
List<WarehouseStorageOrderDetail> list = storageOrderDetailService.selectStorageOrderDetailListByCode(warehouseStorageCode);
return getDataTable(list) ;
}

119
ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseStorageOrderServiceImpl.java

@ -18,7 +18,12 @@ import com.ruoyi.quality.mapper.QualityOrderMapper;
import com.ruoyi.quality.mapper.QualityOrderReportMapper;
import com.ruoyi.quality.mapper.QualityOrderReportUnqualifiedMapper;
import com.ruoyi.quality.service.IQualityOrderService;
import com.ruoyi.system.domain.SysMakeOrder;
import com.ruoyi.system.domain.SysSalesOrder;
import com.ruoyi.system.mapper.SysMakeOrderMapper;
import com.ruoyi.system.mapper.SysSalesOrderMapper;
import com.ruoyi.system.service.ISysMakeOrderService;
import com.ruoyi.system.service.ISysSalesOrderService;
import com.ruoyi.warehouse.domain.WarehouseStorageOrderDetail;
import com.ruoyi.warehouse.mapper.WarehouseStorageOrderDetailMapper;
import lombok.extern.slf4j.Slf4j;
@ -55,6 +60,16 @@ public class WarehouseStorageOrderServiceImpl implements IWarehouseStorageOrderS
@Autowired
private ISysMakeOrderService sysMakeOrderService;
@Autowired
private SysSalesOrderMapper salesOrderMapper;
@Autowired
private ISysSalesOrderService salesOrderService;
@Autowired
private SysMakeOrderMapper sysMakeOrderMapper;
@Autowired
private RedisCache redisCache;
@ -434,7 +449,7 @@ public class WarehouseStorageOrderServiceImpl implements IWarehouseStorageOrderS
//设置委内加工费单价
warehouseStorageOrderDetail.setMakeInUnitPrice(qualityOrderDetail.getMakeInUnitPrice());
//设置品质已合格数
warehouseStorageOrderDetail.setQualityHasQualifiedNum(qualityOrderDetail.getQualityHasqualifiedNum());
warehouseStorageOrderDetail.setQualityHasQualifiedNum(qualityOrderDetail.getQualityQualifiedNum());
warehouseStorageOrderDetail.setMaterialNo(qualityOrderDetail.getMaterialNo());
warehouseStorageOrderDetail.setMaterialName(qualityOrderDetail.getMaterialName());
warehouseStorageOrderDetail.setMaterialBrand(qualityOrderDetail.getMaterialBrand());
@ -615,7 +630,7 @@ public class WarehouseStorageOrderServiceImpl implements IWarehouseStorageOrderS
//生产入库数
warehouseStorageOrderDetail.setMakeStorageNum(qualityOrderDetail.getMakeCompletionNum());
//设置品质已合格数
warehouseStorageOrderDetail.setQualityHasQualifiedNum(qualityOrderDetail.getQualityHasqualifiedNum());
warehouseStorageOrderDetail.setQualityHasQualifiedNum(qualityOrderDetail.getQualityQualifiedNum());
warehouseStorageOrderDetail.setMaterialNo(qualityOrderDetail.getMaterialNo());
warehouseStorageOrderDetail.setMaterialName(qualityOrderDetail.getMaterialName());
warehouseStorageOrderDetail.setMaterialBrand(qualityOrderDetail.getMaterialBrand());
@ -720,33 +735,97 @@ public class WarehouseStorageOrderServiceImpl implements IWarehouseStorageOrderS
/*
* 入库-生产订单
* */
@Transactional(rollbackFor = Exception.class)
@Override
public int updateStorageMake(WarehouseStorageOrder warehouseStorageOrder) {
String loginName = ShiroUtils.getLoginName();
//假设全部入库
warehouseStorageOrder.setWarehouseStorageStatus("4");
warehouseStorageOrder.setUpdateBy(loginName);
warehouseStorageOrder.setUpdateTime(DateUtils.getNowDate());
warehouseStorageOrder.setUpdateTime(new Date());
//记录一下入库时间
warehouseStorageOrder.setStorageTime(new Date());
String warehouseCode = warehouseStorageOrder.getWarehouseCode();
String warehouseName = warehouseStorageOrder.getWarehouseName();
if (StringUtils.isNotEmpty(warehouseCode)){
warehouseStorageOrder.setWarehouseCode(warehouseCode);
}
if (StringUtils.isNotEmpty(warehouseName)){
warehouseStorageOrder.setWarehouseName(warehouseName);
}
List<WarehouseStorageOrderDetail> storageOrderDetailList = warehouseStorageOrder.getWarehouseStorageOrderDetailList();
List<WarehouseStorageOrderDetail> warehouseStorageOrderDetailList = warehouseStorageOrder.getWarehouseStorageOrderDetailList();
if (StringUtils.isEmpty(warehouseStorageOrderDetailList)){
log.warn("入库单详情数据为空:{}",warehouseStorageOrderDetailList);
throw new BusinessException("入库单详情数据为空");
}
if (StringUtils.isEmpty(storageOrderDetailList)){
log.warn("入库单详情为空:{}",storageOrderDetailList);
}else {
for (WarehouseStorageOrderDetail warehouseStorageOrderDetail : storageOrderDetailList) {
warehouseStorageOrderDetail.setWarehouseStorageCode(warehouseStorageOrder.getWarehouseStorageCode());
WarehouseStorageOrderDetail tempStorageOrderDetail = new WarehouseStorageOrderDetail();
tempStorageOrderDetail.setMaterialNo(warehouseStorageOrderDetail.getMaterialNo());
tempStorageOrderDetail.setCustomerId(warehouseStorageOrderDetail.getCustomerId());
tempStorageOrderDetail.setWarehouseStorageCode(warehouseStorageOrder.getWarehouseStorageCode());
WarehouseStorageOrderDetail storageOrderDetailFromData = storageOrderDetailMapper.selectWarehouseStorageMakeOrderByObject(tempStorageOrderDetail);
if (storageOrderDetailFromData == null){
log.warn("数据库中入库单详情为空:{}",tempStorageOrderDetail);
}else {
storageOrderDetailMapper.updateWarehouseStorageMakeOrderDetailByObject(warehouseStorageOrderDetail);
}
//入库数
Integer storageNum = 0;
// 检查storageNum是否含有null值
boolean hasThisStorageNumNull = warehouseStorageOrderDetailList.stream()
.anyMatch(item -> item.getStorageNum() == null);
if (hasThisStorageNumNull) {
throw new BusinessException("存在入库数为空,请检查!");
}
// 计算各个字段的总和
storageNum = warehouseStorageOrderDetailList.stream()
.mapToInt(WarehouseStorageOrderDetail::getStorageNum)
.sum();
//插入主表入库数量
warehouseStorageOrder.setStorageNum(storageNum);
//更新生产订单的数据
SysMakeOrder tempSysMakeOrder = sysMakeOrderMapper.selectMakeOrderByMakeNo(warehouseStorageOrder.getRelatedOrderCode());
tempSysMakeOrder.setEceiptNum(Long.valueOf(storageNum));
//设置生产状态为全部完成
tempSysMakeOrder.setMakeStatus("6");
int updateMakeOrderResult = sysMakeOrderService.updateByMakeNo(tempSysMakeOrder);
if (updateMakeOrderResult <= 0){
throw new BusinessException("更新生产订单数据失败");
}
//更新销售订单数据
SysSalesOrder sysSalesOrder = salesOrderMapper.selectSysSalesOrderBySalesOrderCode(tempSysMakeOrder.getSaleNo());
//设置为全部完成
sysSalesOrder.setMakeStatus("6");
//设置为待出货
sysSalesOrder.setDeliveryStatus("2");
int updateSalesOrderResult = salesOrderService.updateSysSalesOrderBySalesOrderCode(sysSalesOrder);
if (updateSalesOrderResult <= 0){
throw new BusinessException("更新销售订单数据失败");
}
// //更新生产单数据
// int updateMakeOrderResult = sysMakeOrderService.updateSysMakeOrderByWarehouseStorageOrder(warehouseStorageOrder, warehouseStorageOrderDetailList);
// if (updateMakeOrderResult <= 0){
// throw new BusinessException("更新生产订单失败,未影响任何行");
// }
for (WarehouseStorageOrderDetail warehouseStorageOrderDetail : warehouseStorageOrderDetailList) {
//更新入库单详情的数据
warehouseStorageOrderDetail.setUpdateBy(loginName);
warehouseStorageOrderDetail.setUpdateTime(new Date());
//更新已入库数
warehouseStorageOrderDetail.setHasStorageNum(warehouseStorageOrderDetail.getStorageNum());
int updateWarehouseStorageOrderDetailResult = storageOrderDetailMapper.updateWarehouseStorageOrderDetail(warehouseStorageOrderDetail);
if (updateWarehouseStorageOrderDetailResult <= 0){
throw new BusinessException("更新仓库入库单详情失败,未影响任何行");
}
}
//更新入库单的数据
int updateResult = warehouseStorageOrderMapper.updateWarehouseStorageOrder(warehouseStorageOrder);
return warehouseStorageOrderMapper.updateWarehouseStorageOrder(warehouseStorageOrder);
if (updateResult <= 0){
log.warn("更新入库单失败,未影响任何行");
}
return updateResult;
}

142
ruoyi-admin/src/main/resources/templates/warehouse/storageOrder/storageMake.html

@ -13,7 +13,7 @@
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-temporaryPurchaseWarehouse-edit" th:object="${warehouseStorageOrder}">
<form class="form-horizontal m" id="form-storageMakeIn-edit" th:object="${warehouseStorageOrder}">
<input name="warehouseStorageId" th:field="*{warehouseStorageId}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">入库单号:</label>
@ -74,11 +74,11 @@
</div>
</div>
<!--物料信息-->
<div class="container">
<!--客户物料相关-->
<div class="row">
<div class="col-sm-12" id="tablesContainer">
<!-- 表格将在这里动态生成 -->
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
@ -92,54 +92,48 @@
var warehouseStorageCode = [[${warehouseStorageOrder.warehouseStorageCode}]]
var warehouseCode = [[${warehouseStorageOrder.warehouseCode}]]
var prefix = ctx + "warehouse/storageOrder";
$("#form-temporaryPurchaseWarehouse-edit").validate({
$("#form-storageMakeIn-edit").validate({
focusCleanup: true
});
//生成的不同table的id集合
var tableDatas = [];
// 新增提交
function submitHandler() {
const storageOrderData = $("#form-temporaryPurchaseWarehouse-edit").serializeArray().reduce((obj, item) => {
// 获取表单数据
const storageMakeInData = $("#form-storageMakeIn-edit").serializeArray().reduce((obj, item) => {
obj[item.name] = item.value;
return obj;
}, {});
// 初始化一个数组用于存放所有表格的数据
let allMaterialDataList = [];
for(let i in tableDatas){
$('#' + tableDatas[i]).each(function() {
const tableData = $(this).bootstrapTable('getData');
console.log(JSON.stringify(tableData));
// 将表数据转换成与qualityReportData格式一致的数组
var materialDataList = tableData.map(function (item) {
// 根据实际字段名调整
return {
"customerId": item.customerId,
"materialNo": item.materialNo,
"materialName": item.materialName,
"materialType": item.materialType,
"materialPhotourl": item.materialPhotourl,
"materialDescribe": item.materialDescribe,
"materialBrand": item.materialBrand,
"materialUnit": item.materialUnit,
"materialProcessMethod": item.materialProcessMethod,
"qualityHasQualifiedNum": item.qualityHasQualifiedNum,
"hasStorageNum": item.hasStorageNum,
"makeStorageNum": item.makeStorageNum,
"storageNum": item.storageNum,
"storageLocation": item.storageLocation,
// ...其他字段
};
});
allMaterialDataList = allMaterialDataList.concat(materialDataList);
});
}
// 获取bootstrap-table的数据,这里假设你使用bootstrap-table的API获取所有数据
var table = $('#bootstrap-table').bootstrapTable('getData');
const combinedData = Object.assign({}, storageOrderData, {
warehouseStorageOrderDetailList: allMaterialDataList
// 将表数据转换成与complaintNoticeData格式一致的数组
var materialDataList = table.map(function(item) {
// 根据实际字段名调整
return {
"warehouseStorageDetailId":item.warehouseStorageDetailId,
"materialNo": item.materialNo,
"materialName": item.materialName,
"materialType": item.materialType,
"materialPhotourl": item.materialPhotourl,
"materialDescribe": item.materialDescribe,
"materialBrand": item.materialBrand,
"materialUnit": item.materialUnit,
"materialProcessMethod": item.materialProcessMethod,
"makeTotal": item.makeTotal,
"qualityHasQualifiedNum": item.qualityHasQualifiedNum,
"hasStorageNum": item.hasStorageNum,
"makeStorageNum": item.makeStorageNum,
"storageNum": item.storageNum,
"storageLocation": item.storageLocation,
// ...其他字段
};
});
const combinedData = Object.assign({}, storageMakeInData, {
warehouseStorageOrderDetailList: materialDataList,
});
// 合并表单数据和表格数据
// const combinedData = Object.assign({}, ...complaintNoticeData.array(item => ({ [item.name]: item.value })), ...materialData);
console.log(combinedData)
// 使用 JSON.stringify() 序列化数据
const jsonData = JSON.stringify(combinedData);
@ -147,6 +141,9 @@
$.operate.saveJson(prefix + "/storageMake", jsonData);
}
$("input[name='arrivedTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
@ -159,44 +156,24 @@
autoclose: true
});
$(function() {
// 假设qualityOrderCode已经定义或者可以通过某种方式获取到
var warehouseStorageCode = [[${warehouseStorageOrder.warehouseStorageCode}]]; // 这里需要实际赋值,比如从前端某个地方读取
$.getJSON(prefix + "/storageMakeDetailList?warehouseStorageCode=" + warehouseStorageCode, function(data) {
for (var customerId in data) {
if (data.hasOwnProperty(customerId)) {
var customerData = data[customerId];
createTableForCustomer(customerId, customerData);
}
}
});
});
function createTableForCustomer(customerId, customerData) {
var tableId = 'bootstrap-table-' + customerId.replace(/[^a-z0-9]/gi, '_').toLowerCase();
tableDatas.push(tableId);
var $tableWrapper = $('<div class="table-responsive mt-3"></div>');
// 确保customerData至少有一条记录,并从中提取客户详细信息
var customerInfo = customerData.length > 0 ? customerData[0] : {}; // 默认为空对象,以防数据不存在
// 构建含有额外客户信息的标题字符串
var headerTitle ='客户'+'</br>'+customerId + ' - ' + (customerInfo.customerName || 'N/A') +
' </br> ' + (customerInfo.customerContactPeople || 'N/A') +
' - ' + (customerInfo.customerContactNumber || 'N/A') +
' - ' + (customerInfo.customerCompanyAddress || 'N/A');
var $header = $('<h4>' + headerTitle + '</h4>');
var $table = $('<table id="' + tableId + '" class="table table-striped table-bordered"></table>');
$table.bootstrapTable({
data: customerData,
//物料信息展示列表
$(function() {
var options = {
modalName: "选择物料",
url: prefix + "/storageMakeDetailList",
queryParams: queryParams,
showSearch: false,
showRefresh: false,
showToggle: false,
showColumns: false,
pagination: false, // 设置不分页
columns: [{
checkbox: true
},
{
title: '客户ID',
field: 'customerId',
title: '入库单详情Id',
field: 'warehouseStorageDetailId',
visible: false
},
{
@ -231,7 +208,7 @@
field: 'materialProcessMethod',
},
{
title: '订单数',
title: '生产订单数',
field: 'makeTotal',
},
{
@ -245,6 +222,7 @@
{
title: '生产入库数',
field: 'makeStorageNum',
},
{
title: '入库数',
@ -265,14 +243,20 @@
field: 'storageLocation',
editable: true
}]
});
};
$.table.init(options);
})
$tableWrapper.append($header).append($table);
$('#tablesContainer').append($tableWrapper);
function queryParams(params) {
var curParams = {
// 传递参数查询参数
warehouseStorageCode: warehouseStorageCode
};
console.log(curParams);
return curParams;
}
//根据仓库ID查询仓库名称
$(document).ready(function() {
// 初始化时默认加载仓库ID列表

140
ruoyi-admin/src/main/resources/templates/warehouse/storageOrder/storageMakeDetail.html

@ -13,7 +13,7 @@
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-temporaryPurchaseWarehouse-edit" th:object="${warehouseStorageOrder}">
<form class="form-horizontal m" id="form-storageMakeInDetail-edit" th:object="${warehouseStorageOrder}">
<input name="warehouseStorageId" th:field="*{warehouseStorageId}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">入库单号:</label>
@ -74,11 +74,11 @@
</div>
</div>
<!--物料信息-->
<div class="container">
<!--客户物料相关-->
<div class="row">
<div class="col-sm-12" id="tablesContainer">
<!-- 表格将在这里动态生成 -->
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
@ -92,61 +92,53 @@
var warehouseStorageCode = [[${warehouseStorageOrder.warehouseStorageCode}]]
var warehouseCode = [[${warehouseStorageOrder.warehouseCode}]]
var prefix = ctx + "warehouse/storageOrder";
$("#form-temporaryPurchaseWarehouse-edit").validate({
$("#form-storageMakeInDetail-edit").validate({
focusCleanup: true
});
//生成的不同table的id集合
var tableDatas = [];
// 新增提交
function submitHandler() {
const storageOrderData = $("#form-temporaryPurchaseWarehouse-edit").serializeArray().reduce((obj, item) => {
// 获取表单数据
const storageMakeInData = $("#form-storageMakeInDetail-edit").serializeArray().reduce((obj, item) => {
obj[item.name] = item.value;
return obj;
}, {});
// 初始化一个数组用于存放所有表格的数据
let allMaterialDataList = [];
for(let i in tableDatas){
$('#' + tableDatas[i]).each(function() {
const tableData = $(this).bootstrapTable('getData');
console.log(JSON.stringify(tableData));
// 将表数据转换成与qualityReportData格式一致的数组
var materialDataList = tableData.map(function (item) {
// 根据实际字段名调整
return {
"customerId": item.customerId,
"materialNo": item.materialNo,
"materialName": item.materialName,
"materialType": item.materialType,
"materialPhotourl": item.materialPhotourl,
"materialDescribe": item.materialDescribe,
"materialBrand": item.materialBrand,
"materialUnit": item.materialUnit,
"materialProcessMethod": item.materialProcessMethod,
"qualityHasQualifiedNum": item.qualityHasQualifiedNum,
"hasStorageNum": item.hasStorageNum,
"makeStorageNum": item.makeStorageNum,
"storageNum": item.storageNum,
"storageLocation": item.storageLocation,
// ...其他字段
};
});
allMaterialDataList = allMaterialDataList.concat(materialDataList);
});
}
// 获取bootstrap-table的数据,这里假设你使用bootstrap-table的API获取所有数据
var table = $('#bootstrap-table').bootstrapTable('getData');
// 将表数据转换成与complaintNoticeData格式一致的数组
var materialDataList = table.map(function(item) {
// 根据实际字段名调整
return {
"materialNo": item.materialNo,
"materialName": item.materialName,
"materialType": item.materialType,
"materialPhotourl": item.materialPhotourl,
"materialDescribe": item.materialDescribe,
"materialBrand": item.materialBrand,
"materialUnit": item.materialUnit,
"materialProcessMethod": item.materialProcessMethod,
"qualityHasQualifiedNum": item.qualityHasQualifiedNum,
"hasStorageNum": item.hasStorageNum,
"makeStorageNum": item.makeStorageNum,
"storageNum": item.storageNum,
"storageLocation": item.storageLocation,
// ...其他字段
};
});
const combinedData = Object.assign({}, storageOrderData, {
warehouseStorageOrderDetailList: allMaterialDataList
const combinedData = Object.assign({}, storageMakeInData, {
warehouseStorageOrderDetailList: materialDataList,
});
// 合并表单数据和表格数据
// 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 + "/storageMake", jsonData);
$.operate.saveJson(prefix + "/storageMakeDetail", jsonData);
}
$("input[name='arrivedTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
@ -159,46 +151,20 @@
autoclose: true
});
//物料信息展示列表
$(function() {
// 假设qualityOrderCode已经定义或者可以通过某种方式获取到
var warehouseStorageCode = [[${warehouseStorageOrder.warehouseStorageCode}]]; // 这里需要实际赋值,比如从前端某个地方读取
$.getJSON(prefix + "/storageMakeDetailList?warehouseStorageCode=" + warehouseStorageCode, function(data) {
for (var customerId in data) {
if (data.hasOwnProperty(customerId)) {
var customerData = data[customerId];
createTableForCustomer(customerId, customerData);
}
}
});
});
function createTableForCustomer(customerId, customerData) {
var tableId = 'bootstrap-table-' + customerId.replace(/[^a-z0-9]/gi, '_').toLowerCase();
tableDatas.push(tableId);
var $tableWrapper = $('<div class="table-responsive mt-3"></div>');
// 确保customerData至少有一条记录,并从中提取客户详细信息
var customerInfo = customerData.length > 0 ? customerData[0] : {}; // 默认为空对象,以防数据不存在
// 构建含有额外客户信息的标题字符串
var headerTitle ='客户'+'</br>'+customerId + ' - ' + (customerInfo.customerName || 'N/A') +
' </br> ' + (customerInfo.customerContactPeople || 'N/A') +
' - ' + (customerInfo.customerContactNumber || 'N/A') +
' - ' + (customerInfo.customerCompanyAddress || 'N/A');
var $header = $('<h4>' + headerTitle + '</h4>');
var $table = $('<table id="' + tableId + '" class="table table-striped table-bordered"></table>');
$table.bootstrapTable({
data: customerData,
var options = {
modalName: "选择物料",
url: prefix + "/storageMakeDetailList",
queryParams: queryParams,
showSearch: false,
showRefresh: false,
showToggle: false,
showColumns: false,
pagination: false, // 设置不分页
columns: [{
checkbox: true
},
{
title: '客户ID',
field: 'customerId',
visible: false
},
{
title: '料号',
field: 'materialNo'
@ -231,7 +197,7 @@
field: 'materialProcessMethod',
},
{
title: '订单数',
title: '生产订单数',
field: 'makeTotal',
},
{
@ -254,14 +220,20 @@
title: '存放位置',
field: 'storageLocation',
}]
});
};
$.table.init(options);
})
$tableWrapper.append($header).append($table);
$('#tablesContainer').append($tableWrapper);
function queryParams(params) {
var curParams = {
// 传递参数查询参数
warehouseStorageCode: warehouseStorageCode
};
console.log(curParams);
return curParams;
}
//根据仓库ID查询仓库名称
$(document).ready(function() {
// 初始化时默认加载仓库ID列表

11
ruoyi-admin/src/main/resources/templates/warehouse/storageOrder/storageMakeInDetail.html

@ -211,21 +211,10 @@
{
title: '入库数',
field: 'storageNum',
editable:{
type: 'text',
mode:'inline',
validate: function (v) {
if (!v) return '数量不能为空';
if (isNaN(v)) return '数量必须是数字';
var processBadNum = parseInt(v);
if (processBadNum <= 0) return '数量必须是正整数';
}
}
},
{
title: '存放位置',
field: 'storageLocation',
editable: true
}]
};
$.table.init(options);

4
ruoyi-admin/src/main/resources/templates/warehouse/storageOrder/storageOrder.html

@ -301,13 +301,13 @@
}
/*入库-生产订单(生产入库)*/
if ( row.warehouseStorageType == 5 && row.warehouseDeptType == 1 && row.warehouseOrderType == 1 && (row.warehouseStorageStatus == 2 || row.warehouseStorageStatus == 3) ){
if ( row.warehouseStorageType == 5 && row.warehouseOrderType == 1 && (row.warehouseStorageStatus == 2 || row.warehouseStorageStatus == 3) ){
actions.push('<a class="btn btn-success btn-xs ' + storageMakeFlag + '" href="javascript:void(0)" onclick="storageMake(\'' + row.warehouseStorageId + '\')"><i class="fa fa-edit"></i>入库</a> ');
}
/*入库-生产订单(生产入库) 详情*/
if ( row.warehouseStorageType == 5 && row.warehouseDeptType == 1 && row.warehouseOrderType == 1 && (row.warehouseStorageStatus == 2 || row.warehouseStorageStatus == 3 || row.warehouseStorageStatus == 4) ){
if ( row.warehouseStorageType == 5 && row.warehouseOrderType == 1 && (row.warehouseStorageStatus == 2 || row.warehouseStorageStatus == 3 || row.warehouseStorageStatus == 4) ){
actions.push('<a class="btn btn-success btn-xs ' + storageMakeDetailFlag + '" href="javascript:void(0)" onclick="storageMakeDetail(\'' + row.warehouseStorageId + '\')"><i class="fa fa-edit"></i>详情</a> ');
}

Loading…
Cancel
Save