Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
JSH ERP
Commits
0c4b9916
Commit
0c4b9916
authored
May 21, 2019
by
qiankunpingtai
Browse files
去掉零售退货列表从后台获取最大id的逻辑
parent
2eac9ae9
Changes
1
Hide whitespace changes
Inline
Side-by-side
erp_web/js/pages/materials/retail_back_list.js
View file @
0c4b9916
...
@@ -11,8 +11,6 @@ var personID = null;
...
@@ -11,8 +11,6 @@ var personID = null;
var
ProjectSearch
=
null
;
var
ProjectSearch
=
null
;
var
userBusinessList
=
null
;
var
userBusinessList
=
null
;
var
userdepot
=
null
;
var
userdepot
=
null
;
var depotHeadMaxId=null; //获取最大的Id
var accepId=null; //保存的主表id
var
url
;
var
url
;
var
depotHeadID
=
0
;
var
depotHeadID
=
0
;
var
preTotalPrice
=
0
;
//前一次加载的金额
var
preTotalPrice
=
0
;
//前一次加载的金额
...
@@ -1721,51 +1719,6 @@ function bindEvent(){
...
@@ -1721,51 +1719,6 @@ function bindEvent(){
updateDepotHeadAndDetail
(
url
,
infoStr
,
preTotalPrice
);
updateDepotHeadAndDetail
(
url
,
infoStr
,
preTotalPrice
);
return
;
return
;
}
}
$.ajax({
type:"post",
url: url,
dataType: "json",
async : false,
data: ({
info:infoStr
}),
success: function (tipInfo)
{
if(tipInfo)
{
function closeDialog(){
$('#depotHeadDlg').dialog('close');
var opts = $("#tableData").datagrid('options');
showDepotHeadDetails(opts.pageNumber,opts.pageSize);
}
//保存明细记录
if(depotHeadID ==0)
{
getMaxId(); //查找最大的Id
accept(depotHeadMaxId,closeDialog); //新增
}
else
{
accept(depotHeadID,closeDialog); //修改
}
}
else
{
$.messager.show({
title: '错误提示',
msg: '保存信息失败,请稍后重试!'
});
}
},
//此处添加错误处理
error:function()
{
$.messager.alert('提示','保存信息异常,请稍后再试!','error');
return;
}
});
}
}
});
});
...
@@ -2450,62 +2403,6 @@ function CheckData(type) {
...
@@ -2450,62 +2403,6 @@ function CheckData(type) {
}
}
return
true
;
return
true
;
}
}
//保存
function accept(accepId,fun) {
var inserted = $("#materialData").datagrid('getChanges', "inserted");
var deleted = $("#materialData").datagrid('getChanges', "deleted");
var updated = $("#materialData").datagrid('getChanges', "updated");
$.ajax({
type: "post",
url: "/depotItem/saveDetials",
data: {
inserted: JSON.stringify(inserted),
deleted: JSON.stringify(deleted),
updated: JSON.stringify(updated),
headerId:accepId
},
success: function (tipInfo)
{
if (tipInfo) {
$.messager.alert('提示','保存成功!','info');
}
else {
$.messager.alert('提示', '保存失败!', 'error');
}
fun && fun();
},
error: function (XmlHttpRequest, textStatus, errorThrown)
{
$.messager.alert('提示',XmlHttpRequest.responseText,'error');
fun && fun();
}
});
if (endEditing()) {
$('#materialData').datagrid('acceptChanges');
}
}
//获取MaxId
function getMaxId(){
var depotHeadMax=null;
$.ajax({
type:"get",
url: "/depotHead/getMaxId",
//设置为同步
async:false,
dataType: "json",
success: function (res) {
if(res && res.code === 200) {
if(res.data) {
depotHeadMax = res.data.maxId;
}
}
}
});
if(depotHeadMax !=null) {
depotHeadMaxId=depotHeadMax;
}
}
/**
/**
* 新增单据主表及单据子表
* 新增单据主表及单据子表
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment