Commit 962e0c3a by 江和松

js减法保留3位处理

parent 8e54e4e8
...@@ -45,15 +45,15 @@ $(function() { ...@@ -45,15 +45,15 @@ $(function() {
if (e.field == "entityAmount") { if (e.field == "entityAmount") {
if(item.bookAmount && item.entityAmount){ if(item.bookAmount && item.entityAmount){
let diffAmount = item.entityAmount - item.bookAmount; let diffAmount = item.entityAmount - item.bookAmount;
resultGrid.setCellValue(item, 'diffAmount', diffAmount) resultGrid.setCellValue(item, 'diffAmount', diffAmount.toFixed(3))
} }
if(item.bookUnitWeight && item.entityAmount && item.bookWeight){ if(item.bookUnitWeight && item.entityAmount && item.bookWeight){
//实物重量=单重*数量 //实物重量=单重*数量
let entityWeight = item.bookUnitWeight * item.entityAmount; let entityWeight = item.bookUnitWeight * item.entityAmount;
resultGrid.setCellValue(item, 'entityWeight', entityWeight) resultGrid.setCellValue(item, 'entityWeight', entityWeight.toFixed(3))
//差异重量=实物重量-账面重量 //差异重量=实物重量-账面重量
let diffWeight = entityWeight - item.bookWeight; let diffWeight = entityWeight - item.bookWeight;
resultGrid.setCellValue(item, 'diffWeight', diffWeight) resultGrid.setCellValue(item, 'diffWeight', diffWeight.toFixed(3))
} }
} }
}); });
......
...@@ -46,13 +46,13 @@ $(function () { ...@@ -46,13 +46,13 @@ $(function () {
if (e.field == "qualifyQty") { if (e.field == "qualifyQty") {
if(item.qualifyQty && item.receiveQty){ if(item.qualifyQty && item.receiveQty){
let unqualifyQty = item.receiveQty - item.qualifyQty; let unqualifyQty = item.receiveQty - item.qualifyQty;
resultGrid.setCellValue(item, 'unqualifyQty', unqualifyQty) resultGrid.setCellValue(item, 'unqualifyQty', unqualifyQty.toFixed(3))
} }
} }
if (e.field == "unqualifyQty") { if (e.field == "unqualifyQty") {
if(item.unqualifyQty && item.receiveQty){ if(item.unqualifyQty && item.receiveQty){
let qualifyQty = item.receiveQty - item.unqualifyQty; let qualifyQty = item.receiveQty - item.unqualifyQty;
resultGrid.setCellValue(item, 'qualifyQty', qualifyQty) resultGrid.setCellValue(item, 'qualifyQty', qualifyQty.toFixed(3))
} }
} }
}); });
......
...@@ -40,7 +40,7 @@ $(function () { ...@@ -40,7 +40,7 @@ $(function () {
if (e.field == "unpassQuantity") { if (e.field == "unpassQuantity") {
// loadChange(grid,e,"passQuantity"); // loadChange(grid,e,"passQuantity");
var passQuantity = e.items[0]['quantity'] - e.items[0]['unpassQuantity']; var passQuantity = e.items[0]['quantity'] - e.items[0]['unpassQuantity'];
resultGrid.setCellValue(e.items[0],"passQuantity",passQuantity); resultGrid.setCellValue(e.items[0],"passQuantity",passQuantity.toFixed(3));
} }
// 判断父级节点是否发生变化 // 判断父级节点是否发生变化
......
...@@ -90,7 +90,7 @@ $(function () { ...@@ -90,7 +90,7 @@ $(function () {
if (e.field == "unpassQuantity") { if (e.field == "unpassQuantity") {
// loadChange(grid,e,"passQuantity"); // loadChange(grid,e,"passQuantity");
var passQuantity = e.items[0]['quantity'] - e.items[0]['unpassQuantity']; var passQuantity = e.items[0]['quantity'] - e.items[0]['unpassQuantity'];
resultGrid.setCellValue(e.items[0],"passQuantity",passQuantity); resultGrid.setCellValue(e.items[0],"passQuantity",passQuantity.toFixed(3));
} }
if (e.field == "workBy") { if (e.field == "workBy") {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment