|
|
@ -46,7 +46,7 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="col-sm-6"> |
|
|
|
<label for="nowStorageTotalAmount" class="col-sm-4 col-form-label">领料数量合计:</label> |
|
|
|
<label for="nowStorageTotalAmount" class="col-sm-4 col-form-label">入库数量合计:</label> |
|
|
|
<div class="col-sm-6"> |
|
|
|
<input type="text" class="form-control" value="0" id="nowStorageTotalAmount" disabled> |
|
|
|
</div> |
|
|
@ -123,7 +123,8 @@ |
|
|
|
correlationCodes: material.correlationCodes, |
|
|
|
plannedOutsourceAmount: material.plannedOutsourceAmount, |
|
|
|
actualOutsourceAmount: material.orderDetails[0].actualOutsourceAmount, |
|
|
|
alreadyStorageAmount: 0, |
|
|
|
hasStorageNum: material.orderDetails[0].hasStorageNum, |
|
|
|
notifyHasArrivedNum: material.orderDetails[0].notifyHasArrivedNum, |
|
|
|
nowStorageAmount: 0, |
|
|
|
}; |
|
|
|
var materialData = [materialObj]; // Bootstrap Table需要一个数组作为数据源 |
|
|
@ -131,7 +132,7 @@ |
|
|
|
tables(materialTable, materialData); |
|
|
|
|
|
|
|
var $MaterialNumDiv = |
|
|
|
$('<div class="row" style="margin-top: 20px;margin-left: 10px;">' + |
|
|
|
$('<div class="row" style="margin-top: 40px;margin-left: 10px;">' + |
|
|
|
'<div class="form-group">' + |
|
|
|
'<div class="col-xs-12">' + |
|
|
|
'<h3>' + |
|
|
@ -169,7 +170,7 @@ |
|
|
|
} |
|
|
|
$processContent = |
|
|
|
$('<div class="card-header process_card" id="process-' + tableId + '_' + (detailsIndex+1) + '" >' + |
|
|
|
'<div class="row" style="margin-left: 25px;height: 20px">' + |
|
|
|
'<div class="row" style="margin-left: 25px;height: 20px;">' + |
|
|
|
'<div class="card-text">' + |
|
|
|
'<h5>委外工序 ' + (detailsIndex+1) + ':' + |
|
|
|
'<span style="color: blue" class="processNo">' + detail.outsourceProcessNo + '</span>' + '-' + |
|
|
@ -236,27 +237,29 @@ |
|
|
|
showToggle: false, |
|
|
|
data: data, |
|
|
|
columns: [ |
|
|
|
{title: '料号', field: 'materialNo'}, |
|
|
|
{title: '图片', field: 'materialPhotourl', formatter: function (value, row, index) { |
|
|
|
{title: '料号', field: 'materialNo',align: 'center',}, |
|
|
|
{title: '图片', field: 'materialPhotourl',align: 'center', |
|
|
|
formatter: function (value, row, index) { |
|
|
|
return $.table.imageView(value); |
|
|
|
} |
|
|
|
}, |
|
|
|
{title: '物料类型',field: 'materialType', |
|
|
|
{title: '物料类型',field: 'materialType',align: 'center', |
|
|
|
formatter: function(value, row, index) {return $.table.selectCategoryLabel(materialTypeDatas, value);} |
|
|
|
}, |
|
|
|
{title: '物料名称', field: 'materialName'}, |
|
|
|
{title: '物料描述', field: 'description'}, |
|
|
|
{title: '品牌', field: 'brand'}, |
|
|
|
{title: '物料名称', field: 'materialName',align: 'center',}, |
|
|
|
{title: '物料描述', field: 'description',align: 'center',}, |
|
|
|
{title: '品牌', field: 'brand',align: 'center',}, |
|
|
|
{title: '单位', field: 'unit', align: 'center', }, |
|
|
|
{title: '加工方式', field: 'processMethod', align: 'center', |
|
|
|
formatter: function (value, row, index) { |
|
|
|
return $.table.selectDictLabel(processMethodDatas, value); |
|
|
|
} |
|
|
|
}, |
|
|
|
{title: '计划委外数', field: 'plannedOutsourceAmount'}, |
|
|
|
{title: '实际委外数', field: 'actualOutsourceAmount'}, |
|
|
|
{title: '已入库数', field: 'alreadyStorageAmount'}, |
|
|
|
{title: '本次入库数', field: 'nowStorageAmount', |
|
|
|
{title: '计划委外数', field: 'plannedOutsourceAmount',align: 'center',}, |
|
|
|
{title: '实际委外数', field: 'actualOutsourceAmount',align: 'center',}, |
|
|
|
{title: '已入库数', field: 'hasStorageNum',align: 'center',}, |
|
|
|
{title: '通知已到货数', field: 'notifyHasArrivedNum',align: 'center',}, |
|
|
|
{title: '通知到货数', field: 'nowStorageAmount',align: 'center', |
|
|
|
formatter: function(value, row, index) { |
|
|
|
var html = $.common.sprintf("<input class='form-control' type='text' name='nowStorageAmount' value='' id='nowStorageAmount_"+tableId+"'>", index, value); |
|
|
|
return html; |
|
|
@ -303,6 +306,8 @@ |
|
|
|
processMethod: current.processMethod, |
|
|
|
correlationCodes: current.correlationCodes, |
|
|
|
plannedOutsourceAmount: current.plannedOutsourceAmount, |
|
|
|
hasStorageNum: current.hasStorageNum, |
|
|
|
notifyHasArrivedNum: current.notifyHasArrivedNum, |
|
|
|
orderDetails: [ |
|
|
|
current.orderDetails[0], |
|
|
|
] |
|
|
@ -320,7 +325,6 @@ |
|
|
|
storageDetailList:[] |
|
|
|
}; |
|
|
|
let storageSum = 0; |
|
|
|
var hasError = false; |
|
|
|
var hasValue = false; |
|
|
|
$('.table-materialNo').each(function(index, tableElement) { |
|
|
|
var tableId = tableIdList[index]; |
|
|
@ -330,17 +334,14 @@ |
|
|
|
var rows = $("#" + "bootstrap-table_" + tableId).bootstrapTable('getData').length; |
|
|
|
if(rows != 0) { |
|
|
|
var data = $("#" + "bootstrap-table_" + tableId).bootstrapTable('getData')[0]; |
|
|
|
if ($('[id^="nowStorageAmount_bootstrap-table_' + tableId + '"]').val() === "") { |
|
|
|
var notifyValue = $('[id^="nowStorageAmount_bootstrap-table_' + tableId + '"]').val(); |
|
|
|
if (notifyValue === "" || Number(notifyValue) <= 0) { |
|
|
|
return; |
|
|
|
} else { |
|
|
|
hasValue = true; |
|
|
|
// materialAmount++; |
|
|
|
let value = Number($('[id^="nowStorageAmount_bootstrap-table_' + tableId + '"]').val()); |
|
|
|
if (!isNaN(value)) { |
|
|
|
var hasReValue = Number(data.alreadyStorageAmount); |
|
|
|
if (hasReValue + value > data.actualOutsourceAmount) { |
|
|
|
hasError = true; |
|
|
|
} |
|
|
|
storageSum += value; |
|
|
|
} |
|
|
|
var correlationCodes = $("#correlationCodes-" + tableId).text().trim(); |
|
|
@ -366,8 +367,9 @@ |
|
|
|
plannedOutsourceAmount: data.plannedOutsourceAmount, |
|
|
|
actualOutsourceAmount: data.actualOutsourceAmount, |
|
|
|
outsourceOrderNo: outsourceStorage.relatedOrderCode, |
|
|
|
takenMaterial: data.alreadyStorageAmount, |
|
|
|
takingMaterial: value, |
|
|
|
hasStorageNum: data.hasStorageNum, |
|
|
|
notifyHasArrivedNum: data.notifyHasArrivedNum, |
|
|
|
notifyArrivedNum: value, |
|
|
|
outsourceProcessInfo: processInfo, |
|
|
|
chargeUnitInfo: chargeUnitInfo, |
|
|
|
singleMaterialInfo: singleMaterialInfo, |
|
|
@ -386,13 +388,7 @@ |
|
|
|
$.modal.msgError("入库数不能全为空!"); |
|
|
|
return; |
|
|
|
} |
|
|
|
if(!hasError){ |
|
|
|
console.log(outsourceStorage); |
|
|
|
$.operate.saveJson(prefix + "/addStorage",JSON.stringify(outsourceStorage)); |
|
|
|
}else{ |
|
|
|
$.modal.msgError("累计入库数不能大于实际委外数!"); |
|
|
|
return; |
|
|
|
} |
|
|
|
$.operate.saveJson(prefix + "/addStorage",JSON.stringify(outsourceStorage)); |
|
|
|
} |
|
|
|
|
|
|
|
</script> |
|
|
|