Browse Source

[feat]仓库管理

修改暂收-采购采购入库和其详情页面加上物料型号字段
修改暂收仓库入库前端和其详情页面,按照新版prd调整:供应商不在分组,放在from表单上,暂收合格数和实际到货数加上4个校验条件,修改提交方法;
修改 暂收-采购单(仓库入库) 供应商物料详情列表后端接口,不在进行分组和就加工方式的筛选:采用分页查询接口
修改暂收-采购入库保存方法,品质状态为全部品质
修改暂收-仓库入库保存方法:去掉主表的暂收数和实际到货数的检验,改为子表校验
修改采购入库仓库入库后生成品质单后端接口:按照新版逻辑,一个物料对应一个品质单,品质单主表和详情根据入库单详情进行遍历,去掉多余的生成品质报告和品质不合格分类表的数据,品质详情的供应商相关数据来自仓库入库单主表的数据
dev
liuxiaoxu 5 hours ago
parent
commit
044e1de5c8
  1. 44
      ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityOrderServiceImpl.java
  2. 9
      ruoyi-admin/src/main/java/com/ruoyi/warehouse/controller/WarehouseStorageOrderController.java
  3. 14
      ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseStorageOrderServiceImpl.java
  4. 5
      ruoyi-admin/src/main/resources/templates/warehouse/storageOrder/temporaryPurchase.html
  5. 7
      ruoyi-admin/src/main/resources/templates/warehouse/storageOrder/temporaryPurchaseDetail.html
  6. 202
      ruoyi-admin/src/main/resources/templates/warehouse/storageOrder/temporaryPurchaseWarehouse.html
  7. 130
      ruoyi-admin/src/main/resources/templates/warehouse/storageOrder/temporaryPurchaseWarehouseDetail.html

44
ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityOrderServiceImpl.java

@ -489,34 +489,38 @@ public class QualityOrderServiceImpl implements IQualityOrderService
@Override
public void insertQualityOrderByWarehouseStorageOrder(WarehouseStorageOrder warehouseStorageOrder, List<WarehouseStorageOrderDetail> storageOrderDetailList) {
//新增三个子表的数据
for (WarehouseStorageOrderDetail detail : storageOrderDetailList) {
QualityOrder qualityOrder = new QualityOrder();
qualityOrder.setCreateTime(new Date());
qualityOrder.setCreateBy(warehouseStorageOrder.getCreateBy());
//使用redis自动生成品质单号
String qualityOrderCode = redisCache.generateBillNo("PZ");
qualityOrder.setQualityOrderCode(qualityOrderCode);
qualityOrder.setInStorageCode(warehouseStorageOrder.getWarehouseStorageCode());
qualityOrder.setRelatedOrderCode(warehouseStorageOrder.getRelatedOrderCode());
qualityOrder.setQualityStatus("0");
qualityOrder.setQualityOrderType("0");
qualityOrder.setQualityStorageStatus("0");
//qualityOrder.setThisArrivedNum(warehouseStorageOrder.getActualArrivedNum());
qualityOrder.setMaterialNo(detail.getMaterialNo());
qualityOrder.setMaterialName(detail.getMaterialName());
qualityOrder.setQualityQualifiedNum(0);
qualityOrder.setQualityUnqualifiedNum(0);
qualityOrder.setPendingReviewNum(0);
qualityOrder.setThisArrivedNum(detail.getTemporaryQualifiedNum());
qualityOrder.setWarehouseCode(warehouseStorageOrder.getWarehouseCode());
qualityOrder.setWarehouseName(warehouseStorageOrder.getWarehouseName());
qualityOrder.setDeliveryInspectionTime(warehouseStorageOrder.getDeliveryInspectionTime());
qualityOrder.setCreateBy(ShiroUtils.getLoginName());
qualityOrder.setCreateTime(new Date());
qualityOrderMapper.insertQualityOrder(qualityOrder);
int insertQualityOrderResult = qualityOrderMapper.insertQualityOrder(qualityOrder);
if(insertQualityOrderResult<=0){
throw new BusinessException("新增品质单失败");
}
//新增三个子表的数据
for (WarehouseStorageOrderDetail detail : storageOrderDetailList) {
// 构建QualityOrderDetail,假设其他属性与QualityOrder相同,故不重复设置
insertQualityOrderDetailByWarehouseStorageOrder(warehouseStorageOrder, detail, qualityOrderCode);
insertQualityOrderReportByWarehouseStorageOrder(detail,qualityOrderCode);
insertQualityOrderUnqualifiedByWarehouseStorageOrder(detail);
// ...
}
}
@ -980,19 +984,19 @@ public class QualityOrderServiceImpl implements IQualityOrderService
qualityOrderDetail.setMaterialPhotourl(warehouseStorageOrderDetail.getMaterialPhotourl());
qualityOrderDetail.setMaterialUnit(warehouseStorageOrderDetail.getMaterialUnit());
qualityOrderDetail.setMaterialType(warehouseStorageOrderDetail.getMaterialType());
//暂时生成品质单本来应该是实际到货数 prd有误暂时这样处理
qualityOrderDetail.setCheckNum(warehouseStorageOrderDetail.getActualArriveNum());
qualityOrderDetail.setSupplierCode(warehouseStorageOrderDetail.getSupplierCode());
qualityOrderDetail.setSupplierName(warehouseStorageOrderDetail.getSupplierName());
qualityOrderDetail.setSupplierAddress(warehouseStorageOrderDetail.getSupplierAddress());
qualityOrderDetail.setCustomerContact(warehouseStorageOrderDetail.getCustomerContact());
qualityOrderDetail.setContactNumber(warehouseStorageOrderDetail.getContactNumber());
qualityOrderDetail.setQualityHasqualifiedNum(warehouseStorageOrderDetail.getQualityHasQualifiedNum());
qualityOrderDetail.setMaterialModel(warehouseStorageOrderDetail.getMaterialModel());
qualityOrderDetail.setCheckNum(warehouseStorageOrderDetail.getTemporaryQualifiedNum());
qualityOrderDetail.setSupplierCode(warehouseStorageOrder.getSupplierCode());
qualityOrderDetail.setSupplierName(warehouseStorageOrder.getSupplierName());
qualityOrderDetail.setSupplierAddress(warehouseStorageOrder.getSupplierAddress());
qualityOrderDetail.setCustomerContact(warehouseStorageOrder.getCustomerContact());
qualityOrderDetail.setContactNumber(warehouseStorageOrder.getContactNumber());
qualityOrderDetail.setDeliveryInspectionTime(warehouseStorageOrder.getDeliveryInspectionTime());
qualityOrderDetail.setCreateTime(new Date());
qualityOrderDetail.setCreateBy(warehouseStorageOrderDetail.getCreateBy());
int insertResult= orderDetailMapper.insertQualityOrderDetail(qualityOrderDetail);
if (insertResult <= 0){
throw new BusinessException("插入品质单详情失败");
throw new BusinessException("新增品质单详情失败");
}
}
}

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

@ -173,11 +173,10 @@ public class WarehouseStorageOrderController extends BaseController
*/
@ResponseBody
@RequestMapping("/temporaryPurchaseWarehouseDetailList")
public Map<String,List<WarehouseStorageOrderDetail>> temporaryPurchaseWarehouseDetail(String warehouseStorageCode){
List<WarehouseStorageOrderDetail> allDetails = storageOrderDetailService.selectStorageOrderDetailListByCode(warehouseStorageCode);
List<WarehouseStorageOrderDetail> filterAllDetails = allDetails.stream().filter(wso -> "0".equals(wso.getMaterialDeptType())).collect(Collectors.toList());
Map<String, List<WarehouseStorageOrderDetail>> groupedDetails = filterAllDetails.stream().collect(Collectors.groupingBy(WarehouseStorageOrderDetail::getSupplierCode));
return groupedDetails;
public TableDataInfo temporaryPurchaseWarehouseDetail(String warehouseStorageCode){
startPage();
List<WarehouseStorageOrderDetail> list = storageOrderDetailService.selectStorageOrderDetailListByCode(warehouseStorageCode);
return getDataTable(list);
}

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

@ -368,8 +368,8 @@ public class WarehouseStorageOrderServiceImpl implements IWarehouseStorageOrderS
warehouseStorageOrder.setUpdateTime(DateUtils.getNowDate());
//改变状态为已暂收
warehouseStorageOrder.setWarehouseStorageStatus("2");
//设置品质状态,为品质
//warehouseStorageOrder.setWarehouseQualityStatus("0");
//设置品质状态,为全部品质
warehouseStorageOrder.setWarehouseQualityStatus("2");
warehouseStorageOrder.setWarehouseEmployee(loginName);
List<WarehouseStorageOrderDetail> warehouseStorageOrderDetailList = warehouseStorageOrder.getWarehouseStorageOrderDetailList();
@ -1022,7 +1022,6 @@ public class WarehouseStorageOrderServiceImpl implements IWarehouseStorageOrderS
List<WarehouseStorageOrderDetail> warehouseStorageOrderDetailList = warehouseStorageOrder.getWarehouseStorageOrderDetailList();
int actualArriveNum = 0;
//检查填写的实际到货数是否有空值
boolean hasActualArriveNumNull = warehouseStorageOrderDetailList.stream()
@ -1035,21 +1034,16 @@ public class WarehouseStorageOrderServiceImpl implements IWarehouseStorageOrderS
actualArriveNum = warehouseStorageOrderDetailList.stream().mapToInt(WarehouseStorageOrderDetail::getActualArriveNum).sum();
int temporaryQualifiedNum = 0;
//检查填写的品质合格数是否有空值
//检查填写的暂收合格数是否有空值
boolean hasTemporaryQualifiedNumNull = warehouseStorageOrderDetailList.stream()
.anyMatch(item -> item.getTemporaryQualifiedNum() == null);
if (hasTemporaryQualifiedNumNull) {
throw new BusinessException("存在品质合格数为空,请检查!");
throw new BusinessException("存在暂收合格数为空,请检查!");
}
//入库单主表的暂收合格数为子表的合计
temporaryQualifiedNum = warehouseStorageOrderDetailList.stream().mapToInt(WarehouseStorageOrderDetail::getTemporaryQualifiedNum).sum();
if (actualArriveNum < temporaryQualifiedNum) {
throw new BusinessException("暂收合格数不能大于实际到货数");
}
//插入实际到货数
warehouseStorageOrder.setActualArrivedNum(actualArriveNum);
//插入暂收合格数

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

@ -173,6 +173,7 @@
"materialType": item.materialType,
"materialPhotourl": item.materialPhotourl,
"materialDescribe": item.materialDescribe,
"materialModel": item.materialModel,
"materialBrand": item.materialBrand,
"materialUnit": item.materialUnit,
"materialProcessMethod": item.materialProcessMethod,
@ -240,6 +241,10 @@
title: '物料描述',
field: 'materialDescribe',
},
{
title: '物料型号',
field: 'materialModel',
},
{
title: '物料品牌',
field: 'materialBrand',

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

@ -160,6 +160,7 @@
"materialType": item.materialType,
"materialPhotourl": item.materialPhotourl,
"materialDescribe": item.materialDescribe,
"materialModel": item.materialModel,
"materialBrand": item.materialBrand,
"materialUnit": item.materialUnit,
"materialProcessMethod": item.materialProcessMethod,
@ -184,7 +185,7 @@
// 使用 JSON.stringify() 序列化数据
const jsonData = JSON.stringify(combinedData);
// 发送 AJAX 请求到后端接口
$.operate.saveJson(prefix + "/temporaryPurchase", jsonData);
$.operate.saveJson(prefix + "/temporaryPurchaseDetail", jsonData);
}
}
@ -239,6 +240,10 @@
title: '物料描述',
field: 'materialDescribe',
},
{
title: '物料型号',
field: 'materialModel',
},
{
title: '物料品牌',
field: 'materialBrand',

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

@ -35,6 +35,37 @@
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">供应商ID:</label>
<div class="col-sm-8">
<input name="supplierCode" th:field="*{supplierCode}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">供应商名称:</label>
<div class="col-sm-8">
<input name="supplierName" th:field="*{supplierName}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">联系人:</label>
<div class="col-sm-8">
<input name="customerContact" th:field="*{customerContact}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">联系人电话:</label>
<div class="col-sm-8">
<input name="contactNumber" th:field="*{contactNumber}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">联系人地址:</label>
<div class="col-sm-8">
<input name="supplierAddress" th:field="*{supplierAddress}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">到货时间:</label>
<div class="col-sm-8">
@ -74,11 +105,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>
@ -108,29 +139,30 @@
obj[item.name] = item.value;
return obj;
}, {});
var table = $('#bootstrap-table').bootstrapTable("getData");
// 初始化一个数组用于存放所有表格的数据
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) {
var materialDataList = table.map(function(item) {
// 根据实际字段名调整
return {
"supplierCode": item.supplierCode,
"supplierName":item.supplierName,
"customerContact":item.customerContact,
"contactNumber":item.contactNumber,
"supplierAddress":item.supplierAddress,
"materialNo": item.materialNo,
"materialName": item.materialName,
"materialType": item.materialType,
"materialPhotourl": item.materialPhotourl,
"materialDescribe": item.materialDescribe,
"materialModel": item.materialModel,
"materialBrand": item.materialBrand,
"materialUnit": item.materialUnit,
"materialProcessMethod": item.materialProcessMethod,
"notifyHasArrivedNum": item.notifyHasArrivedNum,
"actualHasArrivedNum": item.actualHasArrivedNum,
"temporaryHasQualifiedNum": item.temporaryHasQualifiedNum,
"qualityHasQualifiedNum": item.qualityHasQualifiedNum,
"hasStorageNum": item.hasStorageNum,
"notifyArriveNum": item.notifyArriveNum,
"actualArriveNum": item.actualArriveNum,
@ -140,12 +172,9 @@
// ...其他字段
};
});
allMaterialDataList = allMaterialDataList.concat(materialDataList);
});
}
const combinedData = Object.assign({}, storageOrderData, {
warehouseStorageOrderDetailList: allMaterialDataList
warehouseStorageOrderDetailList: materialDataList,
});
// 合并表单数据和表格数据
// const combinedData = Object.assign({}, ...complaintNoticeData.array(item => ({ [item.name]: item.value })), ...materialData);
@ -168,38 +197,17 @@
autoclose: true
});
//物料信息展示列表
$(function() {
// 假设qualityOrderCode已经定义或者可以通过某种方式获取到
var warehouseStorageCode = [[${warehouseStorageOrder.warehouseStorageCode}]]; // 这里需要实际赋值,比如从前端某个地方读取
$.getJSON(prefix + "/temporaryPurchaseWarehouseDetailList?warehouseStorageCode=" + warehouseStorageCode, function(data) {
for (var supplierCode in data) {
if (data.hasOwnProperty(supplierCode)) {
var supplierData = data[supplierCode];
createTableForSupplier(supplierCode, supplierData);
}
}
});
});
function createTableForSupplier(supplierCode, supplierData) {
var tableId = 'bootstrap-table-' + supplierCode.replace(/[^a-z0-9]/gi, '_').toLowerCase();
tableDatas.push(tableId);
var $tableWrapper = $('<div class="table-responsive mt-3"></div>');
// 确保supplierData至少有一条记录,并从中提取供应商详细信息
var supplierInfo = supplierData.length > 0 ? supplierData[0] : {}; // 默认为空对象,以防数据不存在
// 构建含有额外供应商信息的标题字符串
var headerTitle ='供应商'+'</br>'+supplierCode + ' - ' + (supplierInfo.supplierName || 'N/A') +
' </br> ' + (supplierInfo.customerContact || 'N/A') +
' - ' + (supplierInfo.contactNumber || 'N/A') +
' - ' + (supplierInfo.supplierAddress || 'N/A');
var $header = $('<h4>' + headerTitle + '</h4>');
var $table = $('<table id="' + tableId + '" class="table table-striped table-bordered"></table>');
$table.bootstrapTable({
data: supplierData,
var options = {
modalName: "选择物料",
url: prefix + "/temporaryPurchaseWarehouseDetailList",
queryParams: queryParams,
showSearch: false,
showRefresh: false,
showToggle: false,
showColumns: false,
pagination: false, // 设置不分页
columns: [{
checkbox: true
},
@ -227,6 +235,10 @@
title: '物料描述',
field: 'materialDescribe',
},
{
title: '物料型号',
field: 'materialModel',
},
{
title: '物料品牌',
field: 'materialBrand',
@ -242,6 +254,7 @@
return $.table.selectDictLabel(processMethodDatas, value);
}
},
{
title: '入库部门',
field: 'materialDeptType',
@ -260,11 +273,6 @@
{
title: '暂收已合格数',
field: 'temporaryHasQualifiedNum',
visible: false,
},
{
title: '品质已合格数',
field: 'qualityHasQualifiedNum',
},
{
title: '已入库数',
@ -279,28 +287,78 @@
title: '实际到货数',
field: 'actualArriveNum',
editable: {
type: 'text',
mode:'inline',
validate: function (v) {
if (!v) return '数量不能为空';
if (isNaN(v)) return '数量必须是数字';
var processBadNum = parseInt(v);
if (processBadNum < 0) return '数量必须是整数';
validate: function(value) {
if ($.trim(value) === '') {
return '实际到货数不能为空';
}
if (isNaN(value)) {
return '请输入有效的数字';
}
if (value < 0) {
return '实际到货数不能小于0';
}
//不能为小数
if (value % 1 !== 0) {
return '实际到货数不能为小数';
}
},
},
formatter: function (value, row) {
// 检查 row 是否存在
if (!row) {
return "";
}
// 检查 actualArriveNum 是否存在
if (row.actualArriveNum === undefined || row.actualArriveNum === null) {
return "";
}
// 根据 actualArriveNum 的值决定返回值
if (row.actualArriveNum) {
return row.actualArriveNum;
} else {
return value;
}
}
},
{
title: '暂收数量',
title: '暂收合格数量',
field: 'temporaryQualifiedNum',
editable: {
type: 'text',
mode:'inline',
validate: function (v) {
if (!v) return '数量不能为空';
if (isNaN(v)) return '数量必须是数字';
var processBadNum = parseInt(v);
if (processBadNum < 0) return '数量必须是整数';
validate: function(value) {
if ($.trim(value) === '') {
return '暂收数不能为空';
}
if (isNaN(value)) {
return '请输入有效的数字';
}
if (value < 0) {
return '暂收数不能小于0';
}
//不能为小数
if (value % 1 !== 0) {
return '暂收数不能为小数';
}
},
},
formatter: function (value, row) {
// 检查 row 是否存在
if (!row) {
return "";
}
// 检查 temporaryQualifiedNum 是否存在
if (row.temporaryQualifiedNum === undefined || row.temporaryQualifiedNum === null) {
return "";
}
// 根据 temporaryQualifiedNum 的值决定返回值
if (row.temporaryQualifiedNum) {
return row.temporaryQualifiedNum;
} else {
return value;
}
}
},
@ -315,10 +373,16 @@
field: 'temporaryReportUrl',
visible: false,
}]
});
};
$.table.init(options);
})
$tableWrapper.append($header).append($table);
$('#tablesContainer').append($tableWrapper);
function queryParams(params) {
var curParams = {
// 传递参数查询参数
warehouseStorageCode: warehouseStorageCode
};
return curParams;
}

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

@ -35,6 +35,38 @@
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">供应商ID:</label>
<div class="col-sm-8">
<input name="supplierCode" th:field="*{supplierCode}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">供应商名称:</label>
<div class="col-sm-8">
<input name="supplierName" th:field="*{supplierName}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">联系人:</label>
<div class="col-sm-8">
<input name="customerContact" th:field="*{customerContact}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">联系人电话:</label>
<div class="col-sm-8">
<input name="contactNumber" th:field="*{contactNumber}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">联系人地址:</label>
<div class="col-sm-8">
<input name="supplierAddress" th:field="*{supplierAddress}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">到货时间:</label>
<div class="col-sm-8">
@ -74,11 +106,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>
@ -108,29 +140,30 @@
obj[item.name] = item.value;
return obj;
}, {});
var table = $('#bootstrap-table').bootstrapTable("getData");
// 初始化一个数组用于存放所有表格的数据
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) {
var materialDataList = table.map(function(item) {
// 根据实际字段名调整
return {
"supplierCode": item.supplierCode,
"supplierName":item.supplierName,
"customerContact":item.customerContact,
"contactNumber":item.contactNumber,
"supplierAddress":item.supplierAddress,
"materialNo": item.materialNo,
"materialName": item.materialName,
"materialType": item.materialType,
"materialPhotourl": item.materialPhotourl,
"materialDescribe": item.materialDescribe,
"materialModel": item.materialModel,
"materialBrand": item.materialBrand,
"materialUnit": item.materialUnit,
"materialProcessMethod": item.materialProcessMethod,
"notifyHasArrivedNum": item.notifyHasArrivedNum,
"actualHasArrivedNum": item.actualHasArrivedNum,
"temporaryHasQualifiedNum": item.temporaryHasQualifiedNum,
"qualityHasQualifiedNum": item.qualityHasQualifiedNum,
"hasStorageNum": item.hasStorageNum,
"notifyArriveNum": item.notifyArriveNum,
"actualArriveNum": item.actualArriveNum,
@ -140,12 +173,9 @@
// ...其他字段
};
});
allMaterialDataList = allMaterialDataList.concat(materialDataList);
});
}
const combinedData = Object.assign({}, storageOrderData, {
warehouseStorageOrderDetailList: allMaterialDataList
warehouseStorageOrderDetailList: materialDataList,
});
// 合并表单数据和表格数据
// const combinedData = Object.assign({}, ...complaintNoticeData.array(item => ({ [item.name]: item.value })), ...materialData);
@ -153,7 +183,7 @@
// 使用 JSON.stringify() 序列化数据
const jsonData = JSON.stringify(combinedData);
// 发送 AJAX 请求到后端接口
$.operate.saveJson(prefix + "/temporaryPurchaseWarehouse", jsonData);
$.operate.saveJson(prefix + "/temporaryPurchaseWarehouseDetail", jsonData);
}
$("input[name='arrivedTime']").datetimepicker({
@ -168,38 +198,18 @@
autoclose: true
});
$(function() {
// 假设qualityOrderCode已经定义或者可以通过某种方式获取到
var warehouseStorageCode = [[${warehouseStorageOrder.warehouseStorageCode}]]; // 这里需要实际赋值,比如从前端某个地方读取
$.getJSON(prefix + "/temporaryPurchaseWarehouseDetailList?warehouseStorageCode=" + warehouseStorageCode, function(data) {
for (var supplierCode in data) {
if (data.hasOwnProperty(supplierCode)) {
var supplierData = data[supplierCode];
createTableForSupplier(supplierCode, supplierData);
}
}
});
});
function createTableForSupplier(supplierCode, supplierData) {
var tableId = 'bootstrap-table-' + supplierCode.replace(/[^a-z0-9]/gi, '_').toLowerCase();
tableDatas.push(tableId);
var $tableWrapper = $('<div class="table-responsive mt-3"></div>');
// 确保supplierData至少有一条记录,并从中提取供应商详细信息
var supplierInfo = supplierData.length > 0 ? supplierData[0] : {}; // 默认为空对象,以防数据不存在
// 构建含有额外供应商信息的标题字符串
var headerTitle ='供应商'+'</br>'+supplierCode + ' - ' + (supplierInfo.supplierName || 'N/A') +
' </br> ' + (supplierInfo.customerContact || 'N/A') +
' - ' + (supplierInfo.contactNumber || 'N/A') +
' - ' + (supplierInfo.supplierAddress || 'N/A');
var $header = $('<h4>' + headerTitle + '</h4>');
var $table = $('<table id="' + tableId + '" class="table table-striped table-bordered"></table>');
$table.bootstrapTable({
data: supplierData,
//物料信息展示列表
$(function() {
var options = {
modalName: "选择物料",
url: prefix + "/temporaryPurchaseWarehouseDetailList",
queryParams: queryParams,
showSearch: false,
showRefresh: false,
showToggle: false,
showColumns: false,
pagination: false, // 设置不分页
columns: [{
checkbox: true
},
@ -227,6 +237,10 @@
title: '物料描述',
field: 'materialDescribe',
},
{
title: '物料型号',
field: 'materialModel',
},
{
title: '物料品牌',
field: 'materialBrand',
@ -242,6 +256,7 @@
return $.table.selectDictLabel(processMethodDatas, value);
}
},
{
title: '入库部门',
field: 'materialDeptType',
@ -260,11 +275,6 @@
{
title: '暂收已合格数',
field: 'temporaryHasQualifiedNum',
visible: false,
},
{
title: '品质已合格数',
field: 'qualityHasQualifiedNum',
},
{
title: '已入库数',
@ -281,12 +291,13 @@
},
{
title: '暂收数量',
title: '暂收合格数量',
field: 'temporaryQualifiedNum',
},
{
title: '暂收备注',
field: 'temporaryRemark',
editable: true,
visible: false,
},
{
@ -294,14 +305,19 @@
field: 'temporaryReportUrl',
visible: false,
}]
});
};
$.table.init(options);
})
$tableWrapper.append($header).append($table);
$('#tablesContainer').append($tableWrapper);
function queryParams(params) {
var curParams = {
// 传递参数查询参数
warehouseStorageCode: warehouseStorageCode
};
return curParams;
}
//根据仓库ID查询仓库名称
$(document).ready(function() {
// 初始化时默认加载仓库ID列表

Loading…
Cancel
Save