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
837b7843
Commit
837b7843
authored
May 21, 2019
by
qiankunpingtai
Browse files
去掉其它出库列表从后台获取最大id的逻辑
parent
7a100114
Changes
2
Hide whitespace changes
Inline
Side-by-side
erp_web/js/pages/materials/other_out_list.js
View file @
837b7843
...
...
@@ -11,8 +11,6 @@ var personID = null;
var
ProjectSearch
=
null
;
var
userBusinessList
=
null
;
var
userdepot
=
null
;
var
depotHeadMaxId
=
null
;
//获取最大的Id
var
accepId
=
null
;
//保存的主表id
var
url
;
var
depotHeadID
=
0
;
var
preTotalPrice
=
0
;
//前一次加载的金额
...
...
@@ -1600,50 +1598,6 @@ function bindEvent(){
updateDepotHeadAndDetail
(
url
,
infoStr
,
preTotalPrice
);
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
;
}
});
}
});
...
...
@@ -2325,62 +2279,7 @@ function CheckData(type) {
}
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
;
}
}
/**
* 新增单据主表及单据子表
...
...
src/main/java/com/jsh/erp/controller/DepotItemController.java
View file @
837b7843
...
...
@@ -261,31 +261,6 @@ public class DepotItemController {
return
allNumber
;
}
/**
* 保存明细
* @param inserted
* @param deleted
* @param updated
* @param headerId
* @param request
* @return
*/
@PostMapping
(
value
=
"/saveDetials"
)
public
String
saveDetials
(
@RequestParam
(
"inserted"
)
String
inserted
,
@RequestParam
(
"deleted"
)
String
deleted
,
@RequestParam
(
"updated"
)
String
updated
,
@RequestParam
(
"headerId"
)
Long
headerId
,
HttpServletRequest
request
)
throws
Exception
{
Map
<
String
,
Object
>
objectMap
=
new
HashMap
<
String
,
Object
>();
try
{
depotItemService
.
saveDetials
(
inserted
,
deleted
,
updated
,
headerId
);
return
returnJson
(
objectMap
,
ErpInfo
.
OK
.
name
,
ErpInfo
.
OK
.
code
);
}
catch
(
DataAccessException
e
)
{
e
.
printStackTrace
();
logger
.
error
(
">>>>>>>>>>>>>>>>>>>保存明细信息异常"
,
e
);
return
returnJson
(
objectMap
,
ErpInfo
.
ERROR
.
name
,
ErpInfo
.
ERROR
.
code
);
}
}
/**
* 查询计量单位信息
...
...
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