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
07d4055b
Commit
07d4055b
authored
Jul 29, 2019
by
qiankunpingtai
Browse files
修改库存显示
parent
44f3ccbd
Changes
4
Hide whitespace changes
Inline
Side-by-side
erp_web/pages/materials/material_forselect.html
View file @
07d4055b
...
...
@@ -89,37 +89,7 @@
{
title
:
'
品名
'
,
field
:
'
name
'
,
width
:
150
},
{
title
:
'
型号
'
,
field
:
'
model
'
,
width
:
100
},
{
title
:
'
类别
'
,
field
:
'
categoryName
'
,
width
:
130
},
{
title
:
'
单位
'
,
field
:
'
unit
'
,
width
:
60
},
{
title
:
'
库存
'
,
field
:
'
abc
'
,
width
:
70
,
formatter
:
function
(
value
,
rec
)
{
var
monthTime
=
getNowFormatMonth
();
var
mId
=
rec
.
id
;
//商品id
var
thisStock
=
0
;
//查询库存
$
.
ajax
({
type
:
"
get
"
,
url
:
'
/depotItem/findStockNumByMaterialId
'
,
data
:
{
materialId
:
mId
},
dataType
:
"
json
"
,
success
:
function
(
res
)
{
if
(
res
&&
res
.
code
===
200
)
{
if
(
res
.
data
&&
res
.
data
.
page
&&
res
.
data
.
page
[
0
])
{
thisStock
=
res
.
data
.
page
[
0
].
thisSum
-
0
;
if
(
thisStock
>
0
)
{
$
(
"
#tableForSelectPanel .class-
"
+
rec
.
id
).
text
(
thisStock
);
//延迟加载库存数据
}
}
}
},
error
:
function
()
{
$
.
messager
.
alert
(
'
查询提示
'
,
'
查询数据后台异常,请稍后再试!
'
,
'
error
'
);
}
});
return
"
<span class='class-
"
+
rec
.
id
+
"
'>
"
+
thisStock
+
"
</span>
"
;
}
},
{
title
:
'
单位
'
,
field
:
'
unit
'
,
width
:
60
}
]],
toolbar
:
[
],
...
...
erp_web/pages/materials/materialcategory_forselect.html
View file @
07d4055b
...
...
@@ -46,21 +46,8 @@
function
forSelectMaterialCategory
(
node
)
{
console
.
log
(
node
);
if
(
clickType
)
{
if
(
clickType
==
"
selectBtn
"
)
{
$
(
"
#searchParentName
"
).
val
(
node
.
text
);
$
(
"
#searchParentId
"
).
val
(
node
.
id
);
types
=
""
;
initMCData
(
node
.
id
);
}
else
if
(
clickType
==
"
editBtn
"
)
{
$
(
"
#parentName
"
).
val
(
node
.
text
);
$
(
"
#parentid
"
).
val
(
node
.
id
);
}
}
else
{
$
(
"
#parentName
"
).
val
(
node
.
text
);
$
(
"
#parentid
"
).
val
(
node
.
id
);
}
$
(
"
#parentName
"
).
val
(
node
.
text
);
$
(
"
#parentid
"
).
val
(
node
.
id
);
$
(
'
#forSelectMaterialCategoryDlg
'
).
dialog
(
'
close
'
);
}
});
...
...
src/main/resources/mapper_xml/DepotItemMapperEx.xml
View file @
07d4055b
...
...
@@ -149,7 +149,7 @@
and ifnull(delete_Flag,'0') !='1'
</select>
<select
id=
"findByTypeAndMaterialIdIn"
resultType=
"java.lang.
Integer
"
>
<select
id=
"findByTypeAndMaterialIdIn"
resultType=
"java.lang.
Long
"
>
select ifnull(sum(BasicNumber),0) as BasicNumber from jsh_depothead dh
INNER JOIN jsh_depotitem di on dh.id=di.HeaderId and ifnull(di.delete_Flag,'0') !='1'
where dh.type='入库'
...
...
@@ -157,7 +157,7 @@
and ifnull(dh.delete_Flag,'0') !='1'
</select>
<select
id=
"findByTypeAndMaterialIdOut"
resultType=
"java.lang.
Integer
"
>
<select
id=
"findByTypeAndMaterialIdOut"
resultType=
"java.lang.
Long
"
>
select ifnull(sum(BasicNumber),0) as BasicNumber from jsh_depothead dh
INNER JOIN jsh_depotitem di on dh.id=di.HeaderId and ifnull(di.delete_Flag,'0') !='1'
where dh.type='出库'
...
...
src/main/resources/mapper_xml/MaterialMapperEx.xml
View file @
07d4055b
...
...
@@ -24,8 +24,11 @@
<bind
name=
"model"
value=
"'%' + _parameter.model + '%'"
/>
and m.model like #{model}
</if>
<if
test=
"categoryId != 1"
>
and m.CategoryId in (#{categoryIds})
<if
test=
"categoryIds != null and categoryIds != ''"
>
and m.CategoryId in
<foreach
item=
"did"
index=
"index"
collection=
"categoryIds.split(',')"
open=
"("
separator=
","
close=
")"
>
#{did}
</foreach>
</if>
and ifnull(m.delete_Flag,'0') !='1'
order by m.id asc
...
...
@@ -49,8 +52,11 @@
<bind
name=
"model"
value=
"'%' + _parameter.model + '%'"
/>
and m.model like #{model}
</if>
<if
test=
"categoryId != 1"
>
and m.CategoryId in (#{categoryIds})
<if
test=
"categoryIds != null and categoryIds != ''"
>
and m.CategoryId in
<foreach
item=
"did"
index=
"index"
collection=
"categoryIds.split(',')"
open=
"("
separator=
","
close=
")"
>
#{did}
</foreach>
</if>
and ifnull(m.delete_Flag,'0') !='1'
</select>
...
...
@@ -108,8 +114,11 @@
<bind
name=
"model"
value=
"'%' + _parameter.model + '%'"
/>
and m.model like #{model}
</if>
<if
test=
"categoryId != 1"
>
and m.CategoryId in (#{categoryIds})
<if
test=
"categoryIds != null and categoryIds != ''"
>
and m.CategoryId in
<foreach
item=
"did"
index=
"index"
collection=
"categoryIds.split(',')"
open=
"("
separator=
","
close=
")"
>
#{did}
</foreach>
</if>
and ifnull(m.delete_Flag,'0') !='1'
order by m.id asc
...
...
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