优化库存报表

This commit is contained in:
季圣华
2019-08-14 00:05:57 +08:00
parent f8781f36ed
commit e85fedde4d
4 changed files with 84 additions and 17 deletions

View File

@@ -149,7 +149,7 @@
<td width="18%">零售价</td>
<td width="18%">最低售价</td>
<td width="18%">预计采购价</td>
<td width="18%">批发</td>
<td width="18%">销售</td>
</tr>
<tr>
<td>基本单位</td>
@@ -187,7 +187,7 @@
class="easyui-validatebox"
data-options="validType:'length[1,30]'"
style="width: 180px;height: 20px"/></td>
<td>批发</td>
<td>销售</td>
<td style="padding:5px"><input name="PresetPriceTwo" id="PresetPriceTwo"
class="easyui-validatebox"
data-options="validType:'length[1,30]'"
@@ -467,6 +467,29 @@
});
}
//价格转换
function parsePrice(value, rec, type) {
var res = "";
if(rec.unit) {
res = value;
} else {
var ps = rec.pricestrategy;
var arr = JSON.parse(ps);
var basic = "";
if(type == "lowprice") {
basic = arr[0].basic.LowPrice;
} else if(type == "presetpriceone") {
basic = arr[0].basic.PresetPriceOne;
} else if(type == "presetpricetwo") {
basic = arr[0].basic.PresetPriceTwo;
} else if(type == "retailprice") {
basic = arr[0].basic.RetailPrice;
}
res = basic;
}
return res;
}
//初始化表格数据
function initTableData() {
//改变宽度和高度
@@ -513,7 +536,15 @@
{title: '型号', field: 'model', width: 80},
{title: '类别', field: 'categoryName', width: 80},
{title: '扩展信息', field: 'materialOther', width: 150},
{title: '单位', field: 'unit', width: 60},
{title: '单位', field: 'unit', width: 100,
formatter: function (value, rec) {
if(value) {
return value;
} else {
return rec.unitName;
}
}
},
{title: '安全存量', field: 'safetystock', width: 70},
{
title: '库存', field: 'stock', width: 70, formatter: function (value, rec) {
@@ -522,10 +553,26 @@
return str;
}
},
{title: '零售价', field: 'retailprice', width: 60},
{title: '最低售价', field: 'lowprice', width: 70},
{title: '预计采购价', field: 'presetpriceone', width: 70},
{title: '批发价', field: 'presetpricetwo', width: 70},
{title: '零售价', field: 'retailprice', width: 60,
formatter: function (value, rec) {
return parsePrice(value, rec, "retailprice");
}
},
{title: '最低售价', field: 'lowprice', width: 70,
formatter: function (value, rec) {
return parsePrice(value, rec, "lowprice");
}
},
{title: '预计采购价', field: 'presetpriceone', width: 70,
formatter: function (value, rec) {
return parsePrice(value, rec, "presetpriceone");
}
},
{title: '销售价', field: 'presetpricetwo', width: 70,
formatter: function (value, rec) {
return parsePrice(value, rec, "presetpricetwo");
}
},
{
title: '状态', field: 'enabled', width: 50, align: "center", formatter: function (value) {
return value ? "启用" : "禁用";

View File

@@ -111,7 +111,16 @@
{title: '名称', field: 'MaterialName', width: 60},
{title: '型号', field: 'MaterialModel', width: 80},
{title: '扩展信息', field: 'MaterialOther', width: 150},
{title: '单位', field: 'MaterialUnit', width: 80},
{title: '单位', field: 'MaterialUnit', width: 80,
formatter: function (value, row) {
if(value) {
return value;
} else if(row.UName) {
var uName = row.UName;
return uName.substring(0,uName.indexOf(","));
}
}
},
{title: '进货数量', field: 'InSum', width: 60},
{title: '进货金额', field: 'InSumPrice', width: 60},
{title: '退货数量', field: 'OutSum', width: 60},

View File

@@ -110,15 +110,24 @@
pageSize: 10,
pageList: [10, 50, 100],
columns: [[
{title: '名称', field: 'MaterialName', width: 60, align: "center"},
{title: '型号', field: 'MaterialModel', width: 80, align: "center"},
{title: '扩展信息', field: 'MaterialOther', width: 150, align: "center"},
{title: '单位', field: 'MaterialUnit', width: 80, align: "center"},
{title: '销售数量', field: 'OutSum', width: 60, align: "center"},
{title: '销售金额', field: 'OutSumPrice', width: 60, align: "center"},
{title: '退货数量', field: 'InSum', width: 60, align: "center"},
{title: '退货金额', field: 'InSumPrice', width: 60, align: "center"},
{title: '实际销售金额', field: 'OutInSumPrice', width: 80, align: "center"}
{title: '名称', field: 'MaterialName', width: 60},
{title: '型号', field: 'MaterialModel', width: 80},
{title: '扩展信息', field: 'MaterialOther', width: 150},
{title: '单位', field: 'MaterialUnit', width: 80,
formatter: function (value, row) {
if(value) {
return value;
} else if(row.UName) {
var uName = row.UName;
return uName.substring(0,uName.indexOf(","));
}
}
},
{title: '销售数量', field: 'OutSum', width: 60},
{title: '销售金额', field: 'OutSumPrice', width: 60},
{title: '退货数量', field: 'InSum', width: 60},
{title: '退货金额', field: 'InSumPrice', width: 60},
{title: '实际销售金额', field: 'OutInSumPrice', width: 80}
]],
onLoadError: function () {

View File

@@ -445,6 +445,7 @@ public class DepotItemController {
item.put("MaterialOther", materialOther);
item.put("MaterialColor", diEx.getMColor());
item.put("MaterialUnit", diEx.getMaterialUnit());
item.put("UName", diEx.getUName());
item.put("InSum", InSum);
item.put("OutSum", OutSum);
item.put("InSumPrice", InSumPrice);
@@ -510,6 +511,7 @@ public class DepotItemController {
item.put("MaterialOther", materialOther);
item.put("MaterialColor", diEx.getMColor());
item.put("MaterialUnit", diEx.getMaterialUnit());
item.put("UName", diEx.getUName());
item.put("OutSum", OutSumRetail.add(OutSum));
item.put("InSum", InSumRetail.add(InSum));
item.put("OutSumPrice", OutSumRetailPrice.add(OutSumPrice));