"...src/main/java/me/git@ustchcs.com:gujinli1118/eladmin.git" did not exist on "f26342ee0e798bd14748369ba8823b65879623e4"
Commit 66dcd16e authored by 季圣华's avatar 季圣华
Browse files

优化单据页面新增账户和仓库的功能

parent 84943631
...@@ -50,7 +50,7 @@ $.get("../../pages/template/base.html?7891", function(tem) { ...@@ -50,7 +50,7 @@ $.get("../../pages/template/base.html?7891", function(tem) {
collapsible: false, collapsible: false,
closable: true closable: true
}); });
$("#depotDlg #name,#depotDlg #address").textbox({ $("#depotDlg #name").textbox({
required: true, required: true,
validType: 'length[2,30]' validType: 'length[2,30]'
}); });
...@@ -232,6 +232,9 @@ function bindDepotEvent() { ...@@ -232,6 +232,9 @@ function bindDepotEvent() {
return flag; return flag;
} }
$("#saveDepot").off("click").on("click", function () { $("#saveDepot").off("click").on("click", function () {
if(!$('#depotFM').form('validate')){
return;
}
var infoObj = $("#depotFM").serializeObject(); var infoObj = $("#depotFM").serializeObject();
infoObj.type = 0; infoObj.type = 0;
if (checkDepotName()) { if (checkDepotName()) {
...@@ -300,24 +303,28 @@ function bindAccountEvent() { ...@@ -300,24 +303,28 @@ function bindAccountEvent() {
if (checkAccountName()) { if (checkAccountName()) {
return; return;
} }
$.ajax({ if(!$('#accountFM').form('validate')){
url: '/account/add', return;
type: "post", } else {
dataType: "json", $.ajax({
data: ({ url: '/account/add',
info: JSON.stringify($("#accountFM").serializeObject()) type: "post",
}), dataType: "json",
success: function(res) { data: ({
if(res && res.code === 200) { info: JSON.stringify($("#accountFM").serializeObject())
$('#accountDlg').dialog('close'); }),
initSystemData_account(); //刷新账户 success: function(res) {
if(res && res.code === 200) {
$('#accountDlg').dialog('close');
initSystemData_account(); //刷新账户
}
},
//此处添加错误处理
error: function () {
$.messager.alert('提示', '保存结算账户异常,请稍后再试!', 'error');
return;
} }
}, });
//此处添加错误处理 }
error: function () {
$.messager.alert('提示', '保存结算账户异常,请稍后再试!', 'error');
return;
}
});
}); });
} }
\ No newline at end of file
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