@ -148,17 +148,17 @@
var materialData = [materialObj]; // Bootstrap Table需要一个数组作为数据源
materialList.push(material);
tables(materialTable, materialData);
var $supplierInfo = $('< div class = "supplier-card" style = "height: 20px;" id = "supplierInfo-' + tableId + '" > < / div > ');
// 创建表格的容器
//如果物料下的供应商为空,则不需要添加供应商信息,并在容器中添加一个提示信息:暂无供应商信息,请先添加供应商信息。
const uniqueSuppliers = [];
if (material.purchaseSupplierList.size = = 0) {
if (material.purchaseSupplierList.length < = 0) {
var $noSupplierDiv = $('< div class = "no-supplier" > 暂无供应商信息,请先添加供应商信息。< / div > ');
$tableWrapper.append($noSupplierDiv);
}
else{
material.purchaseSupplierList.forEach(supplier => {
const key = `${supplier.supplierCode}_${supplier.materialCode}`;
$supplierInfo = $('< div class = "supplier-card" id = "supplierInfo-' + tableId + '" > < / div > ');
if (!uniqueSuppliers.map(s => `${s.supplierCode}_${s.materialCode}`).includes(key)) {
uniqueSuppliers.push(supplier);
}else{
@ -264,15 +264,6 @@
var purchaseNum = parseFloat($(supplierCard).find('.supplierMaterialNum').val()) || 0;
var noRmbPrice = parseFloat($(supplierCard).find('.supplierMaterialNoRmb').text().trim());
var rmbPrice = parseFloat($(supplierCard).find('.supplierMaterialRmb').text().trim());
if (purchaseNum > 0) {
// 如果采购数量大于0,则显示供应商采购总价
$(supplierCard).find('.supplierPurchaseTotal').removeClass('hidden');
$(supplierCard).find('.supplierPurchaseTotalRmb').removeClass('hidden');
} else {
// 否则隐藏供应商采购总价
$(supplierCard).find('.supplierPurchaseTotal').addClass('hidden');
$(supplierCard).find('.supplierPurchaseTotalRmb').addClass('hidden');
}
//物料的供应商合计
totalMaterialSum += purchaseNum;
if (rmbPrice) {
@ -331,7 +322,7 @@
showColumns: false,
showToggle: false,
data: data,
height: 25 ,
height: 10 ,
columns: [
{checkbox: false},
{title: '料号', field: 'materialCode'},
@ -350,10 +341,7 @@
return $.table.selectDictLabel(processMethodDatas, value);
}
},
{title: '单位', field: 'unit', align: 'center', formatter: function (value, row, index) {
return $.table.selectDictLabel(sysUnitClassDatas, value);
}
},
{title: '单位', field: 'unit', align: 'center', },
{title: '入库部门', field: 'warehouseDept', align: 'center', formatter: function (value, row, index) {
return $.table.selectDictLabel(warehouseDeptDatas, value);
}},