优化零售界面和报表界面

This commit is contained in:
季圣华 2017-06-21 23:34:48 +08:00
parent 09544415a9
commit 6c9c0bc4a6
6 changed files with 68 additions and 10 deletions

View File

@ -211,6 +211,7 @@ public class DepotItemAction extends BaseAction<DepotItemModel>
item.put("MaterialName", depotItem.getMaterialId().getName());
item.put("MaterialModel", depotItem.getMaterialId().getModel());
item.put("MaterialColor", depotItem.getMaterialId().getColor());
item.put("MaterialUnit", depotItem.getMaterialId().getUnit());
item.put("prevSum", prevSum);
item.put("InSum", InSum);
item.put("OutSum", OutSum);
@ -266,6 +267,7 @@ public class DepotItemAction extends BaseAction<DepotItemModel>
item.put("MaterialName", depotItem.getMaterialId().getName());
item.put("MaterialModel", depotItem.getMaterialId().getModel());
item.put("MaterialColor", depotItem.getMaterialId().getColor());
item.put("MaterialUnit", depotItem.getMaterialId().getUnit());
item.put("InSum", InSum);
item.put("OutSum", OutSum);
item.put("InSumPrice", InSumPrice);
@ -323,6 +325,7 @@ public class DepotItemAction extends BaseAction<DepotItemModel>
item.put("MaterialName", depotItem.getMaterialId().getName());
item.put("MaterialModel", depotItem.getMaterialId().getModel());
item.put("MaterialColor", depotItem.getMaterialId().getColor());
item.put("MaterialUnit", depotItem.getMaterialId().getUnit());
item.put("OutSum", OutSumRetail + OutSum);
item.put("InSum", InSumRetail + InSum);
item.put("OutSumPrice", OutSumRetailPrice + OutSumPrice);
@ -416,6 +419,7 @@ public class DepotItemAction extends BaseAction<DepotItemModel>
item.put("MaterialName", depotItem.getMaterialId().getName());
item.put("MaterialModel", depotItem.getMaterialId().getModel());
item.put("MaterialColor", depotItem.getMaterialId().getColor());
item.put("MaterialUnit", depotItem.getMaterialId().getUnit());
item.put("prevSum", prevSum);
item.put("InSum", InSum);
item.put("OutSum", OutSum);

View File

@ -89,8 +89,8 @@ public class DepotItemService extends BaseService<DepotItem> implements DepotIte
workbook = Workbook.createWorkbook(os);
WritableSheet sheet = workbook.createSheet("进销存报表", 0);
//增加列头
int[] colunmWidth = {10,10,10,10,15,15,15,15,15};
String[] colunmName = {"名称","款号","颜色","","上月结存数量","入库数量","出库数量","本月结存数量","结存金额"};
int[] colunmWidth = {10,10,10,10,10,15,15,15,15,15};
String[] colunmName = {"名称","款号","颜色","","","上月结存数量","入库数量","出库数量","本月结存数量","结存金额"};
for(int i = 0 ;i < colunmWidth.length;i ++)
{
sheet.setColumnView(i,colunmWidth[i]);
@ -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(1, j+1, jo.getString("MaterialModel")));
sheet.addCell(new Label(2, j+1, jo.getString("MaterialColor")));
sheet.addCell(new Label(3, j+1, jo.getString("UnitPrice")));
sheet.addCell(new Label(4, j+1, jo.getString("prevSum")));
sheet.addCell(new Label(5, j+1, jo.getString("InSum")));
sheet.addCell(new Label(6, j+1, jo.getString("OutSum")));
sheet.addCell(new Label(7, j+1, jo.getString("thisSum")));
sheet.addCell(new Label(3, j+1, jo.getString("MaterialUnit")));
sheet.addCell(new Label(4, j+1, jo.getString("UnitPrice")));
sheet.addCell(new Label(5, j+1, jo.getString("prevSum")));
sheet.addCell(new Label(6, j+1, jo.getString("InSum")));
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());
String s1 = String.format("%.2f", d);
sheet.addCell(new Label(8, j+1, s1));
sheet.addCell(new Label(9, j+1, s1));
}
}
workbook.write();

View File

@ -408,7 +408,56 @@
valueField:'Id',
textField:'MaterialName',
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 @@
var body =$("#depotHeadFM .datagrid-body");
var footer =$("#depotHeadFM .datagrid-footer");
var input = ".datagrid-editable-input";
//点击商品下拉框,自动加载数量、单价、金额
//修改单价,自动计算金额和合计
body.find("[field='UnitPrice']").find(input).off("keyup").on("keyup",function(){
var UnitPrice =$(this).val()-0; //单价

View File

@ -77,6 +77,7 @@
{ title: '名称',field: 'MaterialName',width:60},
{ title: '款号',field: 'MaterialModel',width:80},
{ title: '颜色',field: 'MaterialColor',width:80},
{ title: '单位',field: 'MaterialUnit',width:80},
{ title: '进货数量',field: 'InSum',width:60},
{ title: '进货金额',field: 'InSumPrice',width:60},
{ title: '退货数量',field: 'OutSum',width:60},

View File

@ -97,6 +97,7 @@
{ title: '名称',field: 'MaterialName',width:60},
{ title: '款号',field: 'MaterialModel',width:80},
{ title: '颜色',field: 'MaterialColor',width:80},
{ title: '单位',field: 'MaterialUnit',width:80},
{ title: '单价',field: 'UnitPrice',width:60,formatter: function(value,row,index){
return value.toFixed(2);
}

View File

@ -79,6 +79,7 @@
{ title: '名称',field: 'MaterialName',width:60},
{ title: '款号',field: 'MaterialModel',width:80},
{ title: '颜色',field: 'MaterialColor',width:80},
{ title: '单位',field: 'MaterialUnit',width:80},
{ title: '销售数量',field: 'OutSum',width:60},
{ title: '销售金额',field: 'OutSumPrice',width:60},
{ title: '退货数量',field: 'InSum',width:60},