Commit 63a68ac0 by 江和松

单重为总重除以数量,保存时有提示有数量或重量未填写

parent 3c9a496a
......@@ -126,7 +126,8 @@ public class ServiceHGSC009A extends ServiceBase {
for (int i = 0; i < resultRows.size(); i++) {
HGSC009A hgsc009A = new HGSC009A();
hgsc009A.fromMap(resultRows.get(i));
//AssertUtils.isNull(hgsc009A.s(), "是否启用不能为空");
AssertUtils.isTrue(hgsc009A.getGrossAmount().compareTo(BigDecimal.ZERO) <= 0, "重量不能小于等于0");
AssertUtils.isTrue(hgsc009A.getQuantity().compareTo(BigDecimal.ZERO) <= 0, "数量不能小于等于0");
}
}
......
......@@ -63,17 +63,24 @@ $(function () {
grid.dataSource.bind("change", function (e) {
//数量发生变化进行计算
if(e.field === "quantity"){
if(e.items[0].singleWeight != null){
let grossAmount = e.items[0].quantity * e.items[0].singleWeight;
resultGrid.setCellValue(e.items[0], 'grossAmount', grossAmount);
if(e.items[0].grossAmount != null){
let singleWeight = e.items[0].grossAmount/e.items[0].quantity;
resultGrid.setCellValue(e.items[0], 'singleWeight', singleWeight);
}
}
if(e.field === "singleWeight"){
//数量总重发生变化
if(e.field === "grossAmount"){
if(e.items[0].quantity != null){
let grossAmount = e.items[0].quantity * e.items[0].singleWeight;
resultGrid.setCellValue(e.items[0], 'grossAmount', grossAmount);
let singleWeight = e.items[0].grossAmount/e.items[0].quantity;
resultGrid.setCellValue(e.items[0], 'singleWeight', singleWeight);
}
}
// if(e.field === "singleWeight"){
// if(e.items[0].quantity != null){
// let grossAmount = e.items[0].quantity * e.items[0].singleWeight;
// resultGrid.setCellValue(e.items[0], 'grossAmount', grossAmount);
// }
// }
if (e.field === "inventCode") {
for (let i = 0; i < inventRecordBoxBlockId.length; i++) {
if (inventRecordBoxBlockId[i]['valueField'] === e.items[0].inventCode) {
......
......@@ -60,7 +60,7 @@
defaultValue="0"
data-regex="/^-?[0-9]{1,17}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!" enable="false"/>
<EF:EFColumn ename="grossAmount" cname="总重(KG)" width="120" align="right" enable="false" format="{0:N3}"/>
<EF:EFColumn ename="grossAmount" cname="总重(KG)" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="prdtCode" cname="部件编码" enable="false" width="120" align="center" hidden="true"/>
<EF:EFColumn ename="partCode" cname="零件编码" enable="false" width="120" align="center" hidden="true"/>
......
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