单据模块代码优化

This commit is contained in:
季圣华
2020-08-29 02:05:14 +08:00
parent 79ecd87f20
commit d8b105943c
2 changed files with 15 additions and 11 deletions

View File

@@ -2377,12 +2377,16 @@
if ($('#materialData').datagrid('validateRow', editIndex)) { if ($('#materialData').datagrid('validateRow', editIndex)) {
//仓库信息 //仓库信息
var edDepot = $('#materialData').datagrid('getEditor', {index:editIndex,field:'DepotId'}); var edDepot = $('#materialData').datagrid('getEditor', {index:editIndex,field:'DepotId'});
var DepotName = $(edDepot.target).combobox('getText'); if(edDepot) {
$('#materialData').datagrid('getRows')[editIndex]['DepotName'] = DepotName; var DepotName = $(edDepot.target).combobox('getText');
$('#materialData').datagrid('getRows')[editIndex]['DepotName'] = DepotName;
}
//商品信息 //商品信息
var edMaterial = $('#materialData').datagrid('getEditor', {index:editIndex,field:'MaterialExtendId'}); var edMaterial = $('#materialData').datagrid('getEditor', {index:editIndex,field:'MaterialExtendId'});
var MaterialName = $(edMaterial.target).next().find('input.textbox-text').val(); if(edMaterial) {
$('#materialData').datagrid('getRows')[editIndex]['MaterialName'] = MaterialName; var MaterialName = $(edMaterial.target).next().find('input.textbox-text').val();
$('#materialData').datagrid('getRows')[editIndex]['MaterialName'] = MaterialName;
}
//其它信息 //其它信息
$('#materialData').datagrid('endEdit', editIndex); $('#materialData').datagrid('endEdit', editIndex);
editIndex = undefined; editIndex = undefined;

View File

@@ -367,7 +367,7 @@ public class DepotItemService {
depotItem.setMaterialId(materialId); depotItem.setMaterialId(materialId);
depotItem.setMaterialExtendId(tempInsertedJson.getLong("MaterialExtendId")); depotItem.setMaterialExtendId(tempInsertedJson.getLong("MaterialExtendId"));
depotItem.setMaterialUnit(tempInsertedJson.getString("Unit")); depotItem.setMaterialUnit(tempInsertedJson.getString("Unit"));
if (!StringUtil.isEmpty(tempInsertedJson.get("OperNumber").toString())) { if (StringUtil.isExist(tempInsertedJson.get("OperNumber"))) {
depotItem.setOperNumber(tempInsertedJson.getBigDecimal("OperNumber")); depotItem.setOperNumber(tempInsertedJson.getBigDecimal("OperNumber"));
try { try {
String Unit = tempInsertedJson.get("Unit").toString(); String Unit = tempInsertedJson.get("Unit").toString();
@@ -392,13 +392,13 @@ public class DepotItemService {
logger.error(">>>>>>>>>>>>>>>>>>>设置基础数量异常", e); logger.error(">>>>>>>>>>>>>>>>>>>设置基础数量异常", e);
} }
} }
if (!StringUtil.isEmpty(tempInsertedJson.get("UnitPrice").toString())) { if (StringUtil.isExist(tempInsertedJson.get("UnitPrice"))) {
depotItem.setUnitPrice(tempInsertedJson.getBigDecimal("UnitPrice")); depotItem.setUnitPrice(tempInsertedJson.getBigDecimal("UnitPrice"));
} }
if (!StringUtil.isEmpty(tempInsertedJson.get("TaxUnitPrice").toString())) { if (StringUtil.isExist(tempInsertedJson.get("TaxUnitPrice"))) {
depotItem.setTaxUnitPrice(tempInsertedJson.getBigDecimal("TaxUnitPrice")); depotItem.setTaxUnitPrice(tempInsertedJson.getBigDecimal("TaxUnitPrice"));
} }
if (!StringUtil.isEmpty(tempInsertedJson.get("AllPrice").toString())) { if (StringUtil.isExist(tempInsertedJson.get("AllPrice"))) {
depotItem.setAllPrice(tempInsertedJson.getBigDecimal("AllPrice")); depotItem.setAllPrice(tempInsertedJson.getBigDecimal("AllPrice"));
} }
depotItem.setRemark(tempInsertedJson.getString("Remark")); depotItem.setRemark(tempInsertedJson.getString("Remark"));
@@ -408,13 +408,13 @@ public class DepotItemService {
if (tempInsertedJson.get("AnotherDepotId") != null && !StringUtil.isEmpty(tempInsertedJson.get("AnotherDepotId").toString())) { if (tempInsertedJson.get("AnotherDepotId") != null && !StringUtil.isEmpty(tempInsertedJson.get("AnotherDepotId").toString())) {
depotItem.setAnotherDepotId(tempInsertedJson.getLong("AnotherDepotId")); depotItem.setAnotherDepotId(tempInsertedJson.getLong("AnotherDepotId"));
} }
if (!StringUtil.isEmpty(tempInsertedJson.get("TaxRate").toString())) { if (StringUtil.isExist(tempInsertedJson.get("TaxRate"))) {
depotItem.setTaxRate(tempInsertedJson.getBigDecimal("TaxRate")); depotItem.setTaxRate(tempInsertedJson.getBigDecimal("TaxRate"));
} }
if (!StringUtil.isEmpty(tempInsertedJson.get("TaxMoney").toString())) { if (StringUtil.isExist(tempInsertedJson.get("TaxMoney"))) {
depotItem.setTaxMoney(tempInsertedJson.getBigDecimal("TaxMoney")); depotItem.setTaxMoney(tempInsertedJson.getBigDecimal("TaxMoney"));
} }
if (!StringUtil.isEmpty(tempInsertedJson.get("TaxLastMoney").toString())) { if (StringUtil.isExist(tempInsertedJson.get("TaxLastMoney"))) {
depotItem.setTaxLastMoney(tempInsertedJson.getBigDecimal("TaxLastMoney")); depotItem.setTaxLastMoney(tempInsertedJson.getBigDecimal("TaxLastMoney"));
} }
if (tempInsertedJson.get("OtherField1") != null) { if (tempInsertedJson.get("OtherField1") != null) {