|
|
@ -3,6 +3,7 @@ |
|
|
|
<head> |
|
|
|
<th:block th:include="include :: header('入库-委外单')" /> |
|
|
|
<th:block th:include="include :: datetimepicker-css" /> |
|
|
|
<th:block th:include="include :: bootstrap-editable-css" /> |
|
|
|
</head> |
|
|
|
<body class="white-bg"> |
|
|
|
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
|
|
@ -101,6 +102,10 @@ |
|
|
|
obj[item.name] = item.value; |
|
|
|
return obj; |
|
|
|
}, {}); |
|
|
|
if(storageOrderData.warehouseCode == ''||storageOrderData.warehouseCode == null){ |
|
|
|
$.modal.msgError("仓库信息为空,请检查"); |
|
|
|
return; |
|
|
|
} |
|
|
|
const tableData = $("#bootstrap-storageDetail-table").bootstrapTable('getData'); |
|
|
|
var materialDataList = tableData.map(function (item) { |
|
|
|
// 根据实际字段名调整 |
|
|
@ -122,13 +127,24 @@ |
|
|
|
"notifyArriveNum": item.notifyArriveNum, |
|
|
|
"actualArriveNum": item.actualArriveNum, |
|
|
|
"temporaryQualifiedNum": item.temporaryQualifiedNum, |
|
|
|
"temporaryRemark": item.temporaryRemark, |
|
|
|
"temporaryReportUrl": item.temporaryReportUrl, |
|
|
|
"storageNum": item.storageNum, |
|
|
|
"storageLocation": item.storageLocation, |
|
|
|
// ...其他字段 |
|
|
|
}; |
|
|
|
}); |
|
|
|
var overStorage = false; |
|
|
|
materialDataList.forEach(function (material){ |
|
|
|
var qualifiedNum = Number(material.qualityHasQualifiedNum); |
|
|
|
var hasStorageSum = Number(material.hasStorageNum) + Number(material.storageNum); |
|
|
|
if(hasStorageSum > qualifiedNum){ |
|
|
|
overStorage = true; |
|
|
|
} |
|
|
|
}); |
|
|
|
if(overStorage){ |
|
|
|
$.modal.msgError("总入库数超出品质合格数,请检查"); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
const combinedData = Object.assign({}, storageOrderData, { |
|
|
|
warehouseStorageOrderDetailList: materialDataList |
|
|
|
}); |
|
|
@ -174,13 +190,17 @@ |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '料号', |
|
|
|
field: 'materialNo' |
|
|
|
}, { |
|
|
|
field: 'materialNo', |
|
|
|
align: 'center', |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '物料名称', |
|
|
|
align: 'center', |
|
|
|
field: 'materialName' |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '物料类型', |
|
|
|
align: 'center', |
|
|
|
field: 'materialType', |
|
|
|
formatter: function(value, row, index) { |
|
|
|
return $.table.selectCategoryLabel(materialTypeDatas, value); |
|
|
@ -188,22 +208,27 @@ |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '图片', |
|
|
|
align: 'center', |
|
|
|
field: 'materialPhotourl', |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '物料描述', |
|
|
|
title: '描述', |
|
|
|
align: 'center', |
|
|
|
field: 'materialDescribe', |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '物料品牌', |
|
|
|
title: '品牌', |
|
|
|
align: 'center', |
|
|
|
field: 'materialBrand', |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '物料单位', |
|
|
|
title: '单位', |
|
|
|
align: 'center', |
|
|
|
field: 'materialUnit', |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '物料加工方式', |
|
|
|
title: '加工方式', |
|
|
|
align: 'center', |
|
|
|
field: 'materialProcessMethod', |
|
|
|
formatter: function(value, row, index) { |
|
|
|
return $.table.selectDictLabel(processMethodDatas, value); |
|
|
@ -212,51 +237,42 @@ |
|
|
|
|
|
|
|
{ |
|
|
|
title: '通知已到货数', |
|
|
|
align: 'center', |
|
|
|
field: 'notifyHasArrivedNum', |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '实际已到货数', |
|
|
|
align: 'center', |
|
|
|
field: 'actualHasArrivedNum', |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '暂收已合格数', |
|
|
|
field: 'temporaryHasQualifiedNum', |
|
|
|
visible: false, |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '品质已合格数', |
|
|
|
align: 'center', |
|
|
|
field: 'qualityHasQualifiedNum', |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '已入库数', |
|
|
|
align: 'center', |
|
|
|
field: 'hasStorageNum', |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '通知到货数', |
|
|
|
align: 'center', |
|
|
|
field: 'notifyArriveNum', |
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
title: '实际到货数', |
|
|
|
align: 'center', |
|
|
|
field: 'actualArriveNum', |
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
title: '暂收数量', |
|
|
|
title: '暂收合格数量', |
|
|
|
align: 'center', |
|
|
|
field: 'temporaryQualifiedNum', |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '暂收备注', |
|
|
|
field: 'temporaryRemark', |
|
|
|
visible: false, |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '暂收报告', |
|
|
|
field: 'temporaryReportUrl', |
|
|
|
visible: false, |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '入库数', |
|
|
|
align: 'center', |
|
|
|
field: 'storageNum', |
|
|
|
editable:{ |
|
|
|
type: 'text', |
|
|
@ -267,12 +283,49 @@ |
|
|
|
var processBadNum = parseInt(v); |
|
|
|
if (processBadNum <= 0) return '数量必须是正整数'; |
|
|
|
} |
|
|
|
}, |
|
|
|
formatter: function (value, row) { |
|
|
|
// 检查 row 是否存在 |
|
|
|
if (!row) { |
|
|
|
return ""; |
|
|
|
} |
|
|
|
|
|
|
|
// 检查 storageNum 是否存在 |
|
|
|
if (row.storageNum === undefined || row.storageNum === null) { |
|
|
|
return ""; |
|
|
|
} |
|
|
|
|
|
|
|
// 根据 storageNum 的值决定返回值 |
|
|
|
if (row.storageNum) { |
|
|
|
return row.storageNum; |
|
|
|
} else { |
|
|
|
return value; |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '存放位置', |
|
|
|
align: 'center', |
|
|
|
field: 'storageLocation', |
|
|
|
editable: true, |
|
|
|
formatter: function (value, row) { |
|
|
|
// 检查 row 是否存在 |
|
|
|
if (!row) { |
|
|
|
return ""; |
|
|
|
} |
|
|
|
|
|
|
|
// 检查 storageLocation 是否存在 |
|
|
|
if (row.storageLocation === undefined || row.storageLocation === null) { |
|
|
|
return ""; |
|
|
|
} |
|
|
|
|
|
|
|
// 根据 storageLocation 的值决定返回值 |
|
|
|
if (row.storageLocation) { |
|
|
|
return row.storageLocation; |
|
|
|
} else { |
|
|
|
return value; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
] |
|
|
|
}; |
|
|
|