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