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
4d05d5ee
Commit
4d05d5ee
authored
Apr 22, 2020
by
季圣华
Browse files
解决单位被删后导致商品选择的bug
parent
19a90d57
Changes
2
Hide whitespace changes
Inline
Side-by-side
erp_web/pages/manage/unit.html
View file @
4d05d5ee
...
...
@@ -330,44 +330,53 @@
oldUnit
=
""
;
unitID
=
0
;
url
=
'
/unit/add
'
;
//单位名称事件
$
(
"
#basicName
"
).
textbox
(
'
textbox
'
).
bind
(
"
keyup
"
,
function
()
{
$
(
"
#unitName
"
).
text
(
$
(
this
).
val
());
});
}
//保存信息
$
(
"
#saveUnit
"
).
off
(
"
click
"
).
on
(
"
click
"
,
function
()
{
if
(
checkUnitName
(
))
{
if
(
!
$
(
'
#unitFM
'
).
form
(
'
validate
'
)){
return
;
}
var
basicName
=
$
.
trim
(
$
(
"
#basicName
"
).
val
());
var
otherName
=
$
.
trim
(
$
(
"
#otherName
"
).
val
());
var
otherNum
=
$
.
trim
(
$
(
"
#otherNum
"
).
val
());
var
name
=
basicName
+
"
,
"
+
otherName
+
"
(1:
"
+
otherNum
+
"
)
"
;
$
.
ajax
({
url
:
url
,
type
:
"
post
"
,
dataType
:
"
json
"
,
data
:
({
info
:
JSON
.
stringify
({
uname
:
name
,
basicUnit
:
basicName
,
otherUnit
:
otherName
,
ratio
:
otherNum
})
}),
success
:
function
(
res
)
{
if
(
res
&&
res
.
code
===
200
)
{
$
(
'
#unitDlg
'
).
dialog
(
'
close
'
);
//加载完以后重新初始化
var
opts
=
$
(
"
#tableData
"
).
datagrid
(
'
options
'
);
showUnitDetails
(
opts
.
pageNumber
,
opts
.
pageSize
);
}
},
//此处添加错误处理
error
:
function
()
{
$
.
messager
.
alert
(
'
提示
'
,
'
保存计量单位异常,请稍后再试!
'
,
'
error
'
);
else
{
if
(
checkUnitName
())
{
return
;
}
});
var
basicName
=
$
.
trim
(
$
(
"
#basicName
"
).
val
());
var
otherName
=
$
.
trim
(
$
(
"
#otherName
"
).
val
());
var
otherNum
=
$
.
trim
(
$
(
"
#otherNum
"
).
val
());
var
name
=
basicName
+
"
,
"
+
otherName
+
"
(1:
"
+
otherNum
+
"
)
"
;
$
.
ajax
({
url
:
url
,
type
:
"
post
"
,
dataType
:
"
json
"
,
data
:
({
info
:
JSON
.
stringify
({
uname
:
name
,
basicUnit
:
basicName
,
otherUnit
:
otherName
,
ratio
:
otherNum
})
}),
success
:
function
(
res
)
{
if
(
res
&&
res
.
code
===
200
)
{
$
(
'
#unitDlg
'
).
dialog
(
'
close
'
);
//加载完以后重新初始化
var
opts
=
$
(
"
#tableData
"
).
datagrid
(
'
options
'
);
showUnitDetails
(
opts
.
pageNumber
,
opts
.
pageSize
);
}
},
//此处添加错误处理
error
:
function
()
{
$
.
messager
.
alert
(
'
提示
'
,
'
保存计量单位异常,请稍后再试!
'
,
'
error
'
);
return
;
}
});
}
});
//编辑信息
...
...
@@ -382,6 +391,10 @@
$
(
"
#otherNum
"
).
textbox
(
"
setValue
"
,
rowsdata
.
ratio
);
$
(
"
#unitName
"
).
text
(
rowsdata
.
basicUnit
);
url
=
'
/unit/update?id=
'
+
rowsdata
.
id
;
//单位名称事件
$
(
"
#basicName
"
).
textbox
(
'
textbox
'
).
bind
(
"
keyup
"
,
function
()
{
$
(
"
#unitName
"
).
text
(
$
(
this
).
val
());
});
}
//检查名称是否存在 ++ 重名无法提示问题需要跟进
...
...
@@ -472,11 +485,6 @@
$
(
"
#searchBtn
"
).
click
();
}
});
//单位名称事件
$
(
"
#basicName
"
).
off
(
"
keyup
"
).
on
(
"
keyup
"
,
function
()
{
$
(
"
#unitName
"
).
text
(
$
(
this
).
val
());
});
</script>
</body>
</html>
\ No newline at end of file
src/main/java/com/jsh/erp/controller/MaterialController.java
View file @
4d05d5ee
...
...
@@ -157,7 +157,9 @@ public class MaterialController {
ratio
=
""
;
}
else
{
ratio
=
material
.
getUnitName
();
ratio
=
ratio
.
substring
(
ratio
.
indexOf
(
"("
));
if
(
ratio
!=
null
)
{
ratio
=
ratio
.
substring
(
ratio
.
indexOf
(
"("
));
}
}
//品名/型号/扩展信息/包装
String
MaterialName
=
""
;
...
...
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