Commit 77a2c2a7 authored by 季圣华's avatar 季圣华
Browse files

单据数据不全的时候增加提示

parent e6a74500
...@@ -2121,11 +2121,11 @@ ...@@ -2121,11 +2121,11 @@
if(depotHeadID ==0) if(depotHeadID ==0)
{ {
getMaxId(); //查找最大的Id getMaxId(); //查找最大的Id
accept(depotHeadMaxId,closeDialog); //新增 accept(depotHeadMaxId,closeDialog,"add"); //新增
} }
else else
{ {
accept(depotHeadID,closeDialog); //修改 accept(depotHeadID,closeDialog,"edit"); //修改
} }
} }
else else
...@@ -2873,9 +2873,13 @@ ...@@ -2873,9 +2873,13 @@
//判断 //判断
function CheckData() { function CheckData() {
var row = $('#materialData').datagrid('getRows'); var row = $('#materialData').datagrid('getRows');
if(!row.length){
$.messager.alert('提示',"请输入明细信息!",'info');
return false;
}
var totalRowNum = ""; var totalRowNum = "";
for (var i = 0; i < row.length; i++) { for (var i = 0; i < row.length; i++) {
if (row[i].MaterialId == "" || row[i].OperNumber == "" || row[i].UnitPrice === "" || row[i].AllPrice === "") { if (row[i].DepotId == "" || row[i].MaterialId == "" || row[i].OperNumber == "" || row[i].UnitPrice === "" || row[i].AllPrice === "") {
totalRowNum += (i + 1) + "、"; totalRowNum += (i + 1) + "、";
} }
} }
...@@ -2887,10 +2891,15 @@ ...@@ -2887,10 +2891,15 @@
return true; return true;
} }
//保存 //保存
function accept(accepId,fun) { function accept(accepId,fun,type) {
append(); append();
removeit(); removeit();
if ($("#materialData").datagrid('getChanges').length) { var change = $('#materialData').datagrid('getChanges').length;
if(type =="add" && !change) {
$.messager.alert('提示','请输入明细信息!','warning');
return;
}
if (change) {
if (!CheckData()) { if (!CheckData()) {
return; return;
} }
......
Supports Markdown
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