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
ced1b082
Commit
ced1b082
authored
Dec 03, 2017
by
季圣华
Browse files
单据提交的bug修复
parent
884be9bf
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/webapp/js/pages/materials/in_out.js
View file @
ced1b082
...
@@ -1999,6 +1999,19 @@
...
@@ -1999,6 +1999,19 @@
}
}
else
if
(
listTitle
===
"
调拨出库列表
"
){
else
if
(
listTitle
===
"
调拨出库列表
"
){
}
//进行明细的校验
if
(
depotHeadID
==
0
)
{
//新增模式下
if
(
!
CheckData
(
"
add
"
))
{
return
;
}
}
else
{
//编辑模式下
if
(
!
CheckData
(
"
edit
"
))
{
return
;
}
}
}
var
OrganId
=
null
,
ProjectId
=
null
,
AllocationProjectId
=
null
;
var
OrganId
=
null
,
ProjectId
=
null
,
AllocationProjectId
=
null
;
var
ChangeAmount
=
$
.
trim
(
$
(
"
#ChangeAmount
"
).
val
())
-
0
;
var
ChangeAmount
=
$
.
trim
(
$
(
"
#ChangeAmount
"
).
val
())
-
0
;
...
@@ -2121,11 +2134,11 @@
...
@@ -2121,11 +2134,11 @@
if
(
depotHeadID
==
0
)
if
(
depotHeadID
==
0
)
{
{
getMaxId
();
//查找最大的Id
getMaxId
();
//查找最大的Id
accept
(
depotHeadMaxId
,
closeDialog
,
"
add
"
);
//新增
accept
(
depotHeadMaxId
,
closeDialog
);
//新增
}
}
else
else
{
{
accept
(
depotHeadID
,
closeDialog
,
"
edit
"
);
//修改
accept
(
depotHeadID
,
closeDialog
);
//修改
}
}
}
}
else
else
...
@@ -2871,7 +2884,14 @@
...
@@ -2871,7 +2884,14 @@
editIndex
=
undefined
;
editIndex
=
undefined
;
}
}
//判断
//判断
function
CheckData
()
{
function
CheckData
(
type
)
{
append
();
removeit
();
var
change
=
$
(
'
#materialData
'
).
datagrid
(
'
getChanges
'
).
length
;
if
(
type
==
"
add
"
&&
!
change
)
{
$
.
messager
.
alert
(
'
提示
'
,
'
请输入明细信息!
'
,
'
warning
'
);
return
false
;
}
var
row
=
$
(
'
#materialData
'
).
datagrid
(
'
getRows
'
);
var
row
=
$
(
'
#materialData
'
).
datagrid
(
'
getRows
'
);
if
(
!
row
.
length
){
if
(
!
row
.
length
){
$
.
messager
.
alert
(
'
提示
'
,
"
请输入明细信息!
"
,
'
info
'
);
$
.
messager
.
alert
(
'
提示
'
,
"
请输入明细信息!
"
,
'
info
'
);
...
@@ -2891,51 +2911,36 @@
...
@@ -2891,51 +2911,36 @@
return
true
;
return
true
;
}
}
//保存
//保存
function
accept
(
accepId
,
fun
,
type
)
{
function
accept
(
accepId
,
fun
)
{
append
();
var
inserted
=
$
(
"
#materialData
"
).
datagrid
(
'
getChanges
'
,
"
inserted
"
);
removeit
();
var
deleted
=
$
(
"
#materialData
"
).
datagrid
(
'
getChanges
'
,
"
deleted
"
);
var
change
=
$
(
'
#materialData
'
).
datagrid
(
'
getChanges
'
).
length
;
var
updated
=
$
(
"
#materialData
"
).
datagrid
(
'
getChanges
'
,
"
updated
"
);
if
(
type
==
"
add
"
&&
!
change
)
{
$
.
ajax
({
$
.
messager
.
alert
(
'
提示
'
,
'
请输入明细信息!
'
,
'
warning
'
);
type
:
"
post
"
,
return
;
url
:
path
+
"
/depotItem/saveDetials.action
"
,
}
data
:
{
if
(
change
)
{
Inserted
:
JSON
.
stringify
(
inserted
),
if
(
!
CheckData
())
{
Deleted
:
JSON
.
stringify
(
deleted
),
return
;
Updated
:
JSON
.
stringify
(
updated
),
HeaderId
:
accepId
,
clientIp
:
clientIp
},
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
();
}
}
var
inserted
=
$
(
"
#materialData
"
).
datagrid
(
'
getChanges
'
,
"
inserted
"
);
});
var
deleted
=
$
(
"
#materialData
"
).
datagrid
(
'
getChanges
'
,
"
deleted
"
);
var
updated
=
$
(
"
#materialData
"
).
datagrid
(
'
getChanges
'
,
"
updated
"
);
$
.
ajax
({
type
:
"
post
"
,
url
:
path
+
"
/depotItem/saveDetials.action
"
,
data
:
{
Inserted
:
JSON
.
stringify
(
inserted
),
Deleted
:
JSON
.
stringify
(
deleted
),
Updated
:
JSON
.
stringify
(
updated
),
HeaderId
:
accepId
,
clientIp
:
clientIp
},
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
();
}
});
}
else
{
fun
&&
fun
();
}
if
(
endEditing
())
{
if
(
endEditing
())
{
$
(
'
#materialData
'
).
datagrid
(
'
acceptChanges
'
);
$
(
'
#materialData
'
).
datagrid
(
'
acceptChanges
'
);
}
}
...
...
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