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
6c9c0bc4
Commit
6c9c0bc4
authored
Jun 21, 2017
by
季圣华
Browse files
优化零售界面和报表界面
parent
09544415
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/main/java/com/jsh/action/materials/DepotItemAction.java
View file @
6c9c0bc4
...
@@ -211,6 +211,7 @@ public class DepotItemAction extends BaseAction<DepotItemModel>
...
@@ -211,6 +211,7 @@ public class DepotItemAction extends BaseAction<DepotItemModel>
item
.
put
(
"MaterialName"
,
depotItem
.
getMaterialId
().
getName
());
item
.
put
(
"MaterialName"
,
depotItem
.
getMaterialId
().
getName
());
item
.
put
(
"MaterialModel"
,
depotItem
.
getMaterialId
().
getModel
());
item
.
put
(
"MaterialModel"
,
depotItem
.
getMaterialId
().
getModel
());
item
.
put
(
"MaterialColor"
,
depotItem
.
getMaterialId
().
getColor
());
item
.
put
(
"MaterialColor"
,
depotItem
.
getMaterialId
().
getColor
());
item
.
put
(
"MaterialUnit"
,
depotItem
.
getMaterialId
().
getUnit
());
item
.
put
(
"prevSum"
,
prevSum
);
item
.
put
(
"prevSum"
,
prevSum
);
item
.
put
(
"InSum"
,
InSum
);
item
.
put
(
"InSum"
,
InSum
);
item
.
put
(
"OutSum"
,
OutSum
);
item
.
put
(
"OutSum"
,
OutSum
);
...
@@ -266,6 +267,7 @@ public class DepotItemAction extends BaseAction<DepotItemModel>
...
@@ -266,6 +267,7 @@ public class DepotItemAction extends BaseAction<DepotItemModel>
item
.
put
(
"MaterialName"
,
depotItem
.
getMaterialId
().
getName
());
item
.
put
(
"MaterialName"
,
depotItem
.
getMaterialId
().
getName
());
item
.
put
(
"MaterialModel"
,
depotItem
.
getMaterialId
().
getModel
());
item
.
put
(
"MaterialModel"
,
depotItem
.
getMaterialId
().
getModel
());
item
.
put
(
"MaterialColor"
,
depotItem
.
getMaterialId
().
getColor
());
item
.
put
(
"MaterialColor"
,
depotItem
.
getMaterialId
().
getColor
());
item
.
put
(
"MaterialUnit"
,
depotItem
.
getMaterialId
().
getUnit
());
item
.
put
(
"InSum"
,
InSum
);
item
.
put
(
"InSum"
,
InSum
);
item
.
put
(
"OutSum"
,
OutSum
);
item
.
put
(
"OutSum"
,
OutSum
);
item
.
put
(
"InSumPrice"
,
InSumPrice
);
item
.
put
(
"InSumPrice"
,
InSumPrice
);
...
@@ -323,6 +325,7 @@ public class DepotItemAction extends BaseAction<DepotItemModel>
...
@@ -323,6 +325,7 @@ public class DepotItemAction extends BaseAction<DepotItemModel>
item
.
put
(
"MaterialName"
,
depotItem
.
getMaterialId
().
getName
());
item
.
put
(
"MaterialName"
,
depotItem
.
getMaterialId
().
getName
());
item
.
put
(
"MaterialModel"
,
depotItem
.
getMaterialId
().
getModel
());
item
.
put
(
"MaterialModel"
,
depotItem
.
getMaterialId
().
getModel
());
item
.
put
(
"MaterialColor"
,
depotItem
.
getMaterialId
().
getColor
());
item
.
put
(
"MaterialColor"
,
depotItem
.
getMaterialId
().
getColor
());
item
.
put
(
"MaterialUnit"
,
depotItem
.
getMaterialId
().
getUnit
());
item
.
put
(
"OutSum"
,
OutSumRetail
+
OutSum
);
item
.
put
(
"OutSum"
,
OutSumRetail
+
OutSum
);
item
.
put
(
"InSum"
,
InSumRetail
+
InSum
);
item
.
put
(
"InSum"
,
InSumRetail
+
InSum
);
item
.
put
(
"OutSumPrice"
,
OutSumRetailPrice
+
OutSumPrice
);
item
.
put
(
"OutSumPrice"
,
OutSumRetailPrice
+
OutSumPrice
);
...
@@ -416,6 +419,7 @@ public class DepotItemAction extends BaseAction<DepotItemModel>
...
@@ -416,6 +419,7 @@ public class DepotItemAction extends BaseAction<DepotItemModel>
item
.
put
(
"MaterialName"
,
depotItem
.
getMaterialId
().
getName
());
item
.
put
(
"MaterialName"
,
depotItem
.
getMaterialId
().
getName
());
item
.
put
(
"MaterialModel"
,
depotItem
.
getMaterialId
().
getModel
());
item
.
put
(
"MaterialModel"
,
depotItem
.
getMaterialId
().
getModel
());
item
.
put
(
"MaterialColor"
,
depotItem
.
getMaterialId
().
getColor
());
item
.
put
(
"MaterialColor"
,
depotItem
.
getMaterialId
().
getColor
());
item
.
put
(
"MaterialUnit"
,
depotItem
.
getMaterialId
().
getUnit
());
item
.
put
(
"prevSum"
,
prevSum
);
item
.
put
(
"prevSum"
,
prevSum
);
item
.
put
(
"InSum"
,
InSum
);
item
.
put
(
"InSum"
,
InSum
);
item
.
put
(
"OutSum"
,
OutSum
);
item
.
put
(
"OutSum"
,
OutSum
);
...
...
src/main/java/com/jsh/service/materials/DepotItemService.java
View file @
6c9c0bc4
...
@@ -89,8 +89,8 @@ public class DepotItemService extends BaseService<DepotItem> implements DepotIte
...
@@ -89,8 +89,8 @@ public class DepotItemService extends BaseService<DepotItem> implements DepotIte
workbook
=
Workbook
.
createWorkbook
(
os
);
workbook
=
Workbook
.
createWorkbook
(
os
);
WritableSheet
sheet
=
workbook
.
createSheet
(
"进销存报表"
,
0
);
WritableSheet
sheet
=
workbook
.
createSheet
(
"进销存报表"
,
0
);
//增加列头
//增加列头
int
[]
colunmWidth
=
{
10
,
10
,
10
,
10
,
15
,
15
,
15
,
15
,
15
};
int
[]
colunmWidth
=
{
10
,
10
,
10
,
10
,
10
,
15
,
15
,
15
,
15
,
15
};
String
[]
colunmName
=
{
"名称"
,
"款号"
,
"颜色"
,
"单价"
,
"上月结存数量"
,
"入库数量"
,
"出库数量"
,
"本月结存数量"
,
"结存金额"
};
String
[]
colunmName
=
{
"名称"
,
"款号"
,
"颜色"
,
"单
位"
,
"单
价"
,
"上月结存数量"
,
"入库数量"
,
"出库数量"
,
"本月结存数量"
,
"结存金额"
};
for
(
int
i
=
0
;
i
<
colunmWidth
.
length
;
i
++)
for
(
int
i
=
0
;
i
<
colunmWidth
.
length
;
i
++)
{
{
sheet
.
setColumnView
(
i
,
colunmWidth
[
i
]);
sheet
.
setColumnView
(
i
,
colunmWidth
[
i
]);
...
@@ -103,14 +103,15 @@ public class DepotItemService extends BaseService<DepotItem> implements DepotIte
...
@@ -103,14 +103,15 @@ public class DepotItemService extends BaseService<DepotItem> implements DepotIte
sheet
.
addCell
(
new
Label
(
0
,
j
+
1
,
jo
.
getString
(
"MaterialName"
)));
sheet
.
addCell
(
new
Label
(
0
,
j
+
1
,
jo
.
getString
(
"MaterialName"
)));
sheet
.
addCell
(
new
Label
(
1
,
j
+
1
,
jo
.
getString
(
"MaterialModel"
)));
sheet
.
addCell
(
new
Label
(
1
,
j
+
1
,
jo
.
getString
(
"MaterialModel"
)));
sheet
.
addCell
(
new
Label
(
2
,
j
+
1
,
jo
.
getString
(
"MaterialColor"
)));
sheet
.
addCell
(
new
Label
(
2
,
j
+
1
,
jo
.
getString
(
"MaterialColor"
)));
sheet
.
addCell
(
new
Label
(
3
,
j
+
1
,
jo
.
getString
(
"UnitPrice"
)));
sheet
.
addCell
(
new
Label
(
3
,
j
+
1
,
jo
.
getString
(
"MaterialUnit"
)));
sheet
.
addCell
(
new
Label
(
4
,
j
+
1
,
jo
.
getString
(
"prevSum"
)));
sheet
.
addCell
(
new
Label
(
4
,
j
+
1
,
jo
.
getString
(
"UnitPrice"
)));
sheet
.
addCell
(
new
Label
(
5
,
j
+
1
,
jo
.
getString
(
"InSum"
)));
sheet
.
addCell
(
new
Label
(
5
,
j
+
1
,
jo
.
getString
(
"prevSum"
)));
sheet
.
addCell
(
new
Label
(
6
,
j
+
1
,
jo
.
getString
(
"OutSum"
)));
sheet
.
addCell
(
new
Label
(
6
,
j
+
1
,
jo
.
getString
(
"InSum"
)));
sheet
.
addCell
(
new
Label
(
7
,
j
+
1
,
jo
.
getString
(
"thisSum"
)));
sheet
.
addCell
(
new
Label
(
7
,
j
+
1
,
jo
.
getString
(
"OutSum"
)));
sheet
.
addCell
(
new
Label
(
8
,
j
+
1
,
jo
.
getString
(
"thisSum"
)));
double
d
=
Double
.
parseDouble
(
jo
.
getString
(
"thisAllPrice"
).
toString
());
double
d
=
Double
.
parseDouble
(
jo
.
getString
(
"thisAllPrice"
).
toString
());
String
s1
=
String
.
format
(
"%.2f"
,
d
);
String
s1
=
String
.
format
(
"%.2f"
,
d
);
sheet
.
addCell
(
new
Label
(
8
,
j
+
1
,
s1
));
sheet
.
addCell
(
new
Label
(
9
,
j
+
1
,
s1
));
}
}
}
}
workbook
.
write
();
workbook
.
write
();
...
...
src/main/webapp/js/pages/materials/in_out.js
View file @
6c9c0bc4
...
@@ -408,7 +408,56 @@
...
@@ -408,7 +408,56 @@
valueField
:
'
Id
'
,
valueField
:
'
Id
'
,
textField
:
'
MaterialName
'
,
textField
:
'
MaterialName
'
,
method
:
'
get
'
,
method
:
'
get
'
,
url
:
path
+
"
/material/findBySelect.action
"
url
:
path
+
"
/material/findBySelect.action
"
,
onSelect
:
function
(
rec
){
if
(
rec
)
{
$
.
ajax
({
url
:
path
+
"
/material/findById.action
"
,
type
:
"
get
"
,
dataType
:
"
json
"
,
data
:
{
"
MaterialID
"
:
rec
.
Id
},
success
:
function
(
res
)
{
if
(
res
&&
res
.
rows
&&
res
.
rows
[
0
])
{
var
retailPrice
=
res
.
rows
[
0
].
RetailPrice
;
//零售价格
var
presetPriceOne
=
res
.
rows
[
0
].
PresetPriceOne
;
//价格1
var
presetPriceTwo
=
res
.
rows
[
0
].
PresetPriceTwo
;
//价格2
var
TotalPrice
=
0
;
var
allPrice
=
0
;
var
body
=
$
(
"
#depotHeadFM .datagrid-body
"
);
var
footer
=
$
(
"
#depotHeadFM .datagrid-footer
"
);
var
input
=
"
.datagrid-editable-input
"
;
body
.
find
(
"
[field='OperNumber']
"
).
find
(
input
).
val
(
1
);
if
(
listSubType
==
"
零售
"
)
{
body
.
find
(
"
[field='UnitPrice']
"
).
find
(
input
).
val
(
retailPrice
);
body
.
find
(
"
[field='AllPrice']
"
).
find
(
input
).
val
(
retailPrice
);
allPrice
=
retailPrice
;
}
else
if
(
listTitle
==
"
销售出库列表
"
||
listTitle
==
"
采购退货列表
"
||
listTitle
==
"
其它出库列表
"
||
listTitle
==
"
调拨出库列表
"
)
{
body
.
find
(
"
[field='UnitPrice']
"
).
find
(
input
).
val
(
presetPriceOne
);
body
.
find
(
"
[field='AllPrice']
"
).
find
(
input
).
val
(
presetPriceOne
);
allPrice
=
presetPriceOne
;
}
body
.
find
(
"
[field='AllPrice']
"
).
each
(
function
(){
if
(
$
(
this
).
find
(
"
div
"
).
text
()
!==
""
){
TotalPrice
=
TotalPrice
+
parseFloat
(
$
(
this
).
find
(
"
div
"
).
text
().
toString
());
}
});
TotalPrice
=
TotalPrice
+
allPrice
;
footer
.
find
(
"
[field='AllPrice']
"
).
find
(
"
div
"
).
text
((
TotalPrice
).
toFixed
(
2
));
if
(
listSubType
==
"
零售
"
){
$
(
"
#ChangeAmount, #getAmount
"
).
val
((
TotalPrice
).
toFixed
(
2
));
$
(
"
#backAmount
"
).
val
(
0
);
}
}
},
error
:
function
()
{
$
.
messager
.
alert
(
'
页面加载提示
'
,
'
页面加载异常,请稍后再试!
'
,
'
error
'
);
}
});
}
}
}
}
}
}
},
},
...
@@ -915,7 +964,8 @@
...
@@ -915,7 +964,8 @@
var
body
=
$
(
"
#depotHeadFM .datagrid-body
"
);
var
body
=
$
(
"
#depotHeadFM .datagrid-body
"
);
var
footer
=
$
(
"
#depotHeadFM .datagrid-footer
"
);
var
footer
=
$
(
"
#depotHeadFM .datagrid-footer
"
);
var
input
=
"
.datagrid-editable-input
"
;
var
input
=
"
.datagrid-editable-input
"
;
//点击商品下拉框,自动加载数量、单价、金额
//修改单价,自动计算金额和合计
//修改单价,自动计算金额和合计
body
.
find
(
"
[field='UnitPrice']
"
).
find
(
input
).
off
(
"
keyup
"
).
on
(
"
keyup
"
,
function
(){
body
.
find
(
"
[field='UnitPrice']
"
).
find
(
input
).
off
(
"
keyup
"
).
on
(
"
keyup
"
,
function
(){
var
UnitPrice
=
$
(
this
).
val
()
-
0
;
//单价
var
UnitPrice
=
$
(
this
).
val
()
-
0
;
//单价
...
...
src/main/webapp/pages/reports/buy_in_report.jsp
View file @
6c9c0bc4
...
@@ -77,6 +77,7 @@
...
@@ -77,6 +77,7 @@
{ title:
'
名称
'
,field:
'
MaterialName
'
,width:60},
{ title:
'
名称
'
,field:
'
MaterialName
'
,width:60},
{ title:
'
款号
'
,field:
'
MaterialModel
'
,width:80},
{ title:
'
款号
'
,field:
'
MaterialModel
'
,width:80},
{ title:
'
颜色
'
,field:
'
MaterialColor
'
,width:80},
{ title:
'
颜色
'
,field:
'
MaterialColor
'
,width:80},
{ title:
'
单位
'
,field:
'
MaterialUnit
'
,width:80},
{ title:
'
进货数量
'
,field:
'
InSum
'
,width:60},
{ title:
'
进货数量
'
,field:
'
InSum
'
,width:60},
{ title:
'
进货金额
'
,field:
'
InSumPrice
'
,width:60},
{ title:
'
进货金额
'
,field:
'
InSumPrice
'
,width:60},
{ title:
'
退货数量
'
,field:
'
OutSum
'
,width:60},
{ title:
'
退货数量
'
,field:
'
OutSum
'
,width:60},
...
...
src/main/webapp/pages/reports/in_out_stock_report.jsp
View file @
6c9c0bc4
...
@@ -97,6 +97,7 @@
...
@@ -97,6 +97,7 @@
{ title: '名称',field: 'MaterialName',width:60},
{ title: '名称',field: 'MaterialName',width:60},
{ title: '款号',field: 'MaterialModel',width:80},
{ title: '款号',field: 'MaterialModel',width:80},
{ title: '颜色',field: 'MaterialColor',width:80},
{ title: '颜色',field: 'MaterialColor',width:80},
{ title: '单位',field: 'MaterialUnit',width:80},
{ title: '单价',field: 'UnitPrice',width:60,formatter: function(value,row,index){
{ title: '单价',field: 'UnitPrice',width:60,formatter: function(value,row,index){
return value.toFixed(2);
return value.toFixed(2);
}
}
...
...
src/main/webapp/pages/reports/sale_out_report.jsp
View file @
6c9c0bc4
...
@@ -79,6 +79,7 @@
...
@@ -79,6 +79,7 @@
{ title:
'
名称
'
,field:
'
MaterialName
'
,width:60},
{ title:
'
名称
'
,field:
'
MaterialName
'
,width:60},
{ title:
'
款号
'
,field:
'
MaterialModel
'
,width:80},
{ title:
'
款号
'
,field:
'
MaterialModel
'
,width:80},
{ title:
'
颜色
'
,field:
'
MaterialColor
'
,width:80},
{ title:
'
颜色
'
,field:
'
MaterialColor
'
,width:80},
{ title:
'
单位
'
,field:
'
MaterialUnit
'
,width:80},
{ title:
'
销售数量
'
,field:
'
OutSum
'
,width:60},
{ title:
'
销售数量
'
,field:
'
OutSum
'
,width:60},
{ title:
'
销售金额
'
,field:
'
OutSumPrice
'
,width:60},
{ title:
'
销售金额
'
,field:
'
OutSumPrice
'
,width:60},
{ title:
'
退货数量
'
,field:
'
InSum
'
,width:60},
{ title:
'
退货数量
'
,field:
'
InSum
'
,width:60},
...
...
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