@@ -283,27 +283,8 @@ public class DepotItemAction extends BaseAction<DepotItemModel>
|
||||
}
|
||||
//品名/型号/扩展信息/包装
|
||||
String MaterialName = depotItem.getMaterialId().getName() + ((depotItem.getMaterialId().getModel() == null || depotItem.getMaterialId().getModel().equals(""))?"":"("+depotItem.getMaterialId().getModel() + ")");
|
||||
for(int i=0; i< mpArr.length; i++) {
|
||||
if(mpArr[i].equals("颜色")) {
|
||||
MaterialName = MaterialName + ((depotItem.getMaterialId().getColor() == null || depotItem.getMaterialId().getColor().equals(""))?"":"("+depotItem.getMaterialId().getColor() + ")");
|
||||
}
|
||||
if(mpArr[i].equals("规格")) {
|
||||
MaterialName = MaterialName + ((depotItem.getMaterialId().getStandard() == null || depotItem.getMaterialId().getStandard().equals(""))?"":"("+depotItem.getMaterialId().getStandard() + ")");
|
||||
}
|
||||
if(mpArr[i].equals("制造商")) {
|
||||
MaterialName = MaterialName + ((depotItem.getMaterialId().getMfrs() == null || depotItem.getMaterialId().getMfrs().equals(""))?"":"("+depotItem.getMaterialId().getMfrs() + ")");
|
||||
}
|
||||
if(mpArr[i].equals("自定义1")) {
|
||||
MaterialName = MaterialName + ((depotItem.getMaterialId().getOtherField1() == null || depotItem.getMaterialId().getOtherField1().equals(""))?"":"("+depotItem.getMaterialId().getOtherField1() + ")");
|
||||
}
|
||||
if(mpArr[i].equals("自定义2")) {
|
||||
MaterialName = MaterialName + ((depotItem.getMaterialId().getOtherField2() == null || depotItem.getMaterialId().getOtherField2().equals(""))?"":"("+depotItem.getMaterialId().getOtherField2() + ")");
|
||||
}
|
||||
if(mpArr[i].equals("自定义3")) {
|
||||
MaterialName = MaterialName + ((depotItem.getMaterialId().getOtherField3() == null || depotItem.getMaterialId().getOtherField3().equals(""))?"":"("+depotItem.getMaterialId().getOtherField3() + ")");
|
||||
}
|
||||
}
|
||||
MaterialName = MaterialName + ratio;
|
||||
String materialOther = getOtherInfo(mpArr, depotItem);
|
||||
MaterialName = MaterialName + materialOther + ratio;
|
||||
item.put("MaterialName", MaterialName);
|
||||
item.put("Unit", depotItem.getMUnit());
|
||||
item.put("OperNumber", depotItem.getOperNumber());
|
||||
@@ -354,7 +335,8 @@ public class DepotItemAction extends BaseAction<DepotItemModel>
|
||||
pageUtil.setAdvSearch(getConditionALL());
|
||||
depotItemService.find(pageUtil);
|
||||
List<DepotItem> dataList = pageUtil.getPageList();
|
||||
|
||||
String mpList = model.getMpList(); //商品属性
|
||||
String[] mpArr = mpList.split(",");
|
||||
JSONObject outer = new JSONObject();
|
||||
outer.put("total", pageUtil.getTotalCount());
|
||||
//存放数据json数组
|
||||
@@ -373,7 +355,9 @@ public class DepotItemAction extends BaseAction<DepotItemModel>
|
||||
item.put("MaterialId", depotItem.getMaterialId()==null?"":depotItem.getMaterialId().getId());
|
||||
item.put("MaterialName", depotItem.getMaterialId().getName());
|
||||
item.put("MaterialModel", depotItem.getMaterialId().getModel());
|
||||
item.put("MaterialStandard", depotItem.getMaterialId().getStandard());
|
||||
//扩展信息
|
||||
String materialOther = getOtherInfo(mpArr, depotItem);
|
||||
item.put("MaterialOther", materialOther);
|
||||
item.put("MaterialColor", depotItem.getMaterialId().getColor());
|
||||
item.put("MaterialUnit", depotItem.getMaterialId().getUnit());
|
||||
Double unitPrice = 0.0;
|
||||
@@ -459,7 +443,8 @@ public class DepotItemAction extends BaseAction<DepotItemModel>
|
||||
pageUtil.setAdvSearch(getConditionALL());
|
||||
depotItemService.find(pageUtil);
|
||||
List<DepotItem> dataList = pageUtil.getPageList();
|
||||
|
||||
String mpList = model.getMpList(); //商品属性
|
||||
String[] mpArr = mpList.split(",");
|
||||
JSONObject outer = new JSONObject();
|
||||
outer.put("total", pageUtil.getTotalCount());
|
||||
//存放数据json数组
|
||||
@@ -474,7 +459,9 @@ public class DepotItemAction extends BaseAction<DepotItemModel>
|
||||
item.put("MaterialId", depotItem.getMaterialId()==null?"":depotItem.getMaterialId().getId());
|
||||
item.put("MaterialName", depotItem.getMaterialId().getName());
|
||||
item.put("MaterialModel", depotItem.getMaterialId().getModel());
|
||||
item.put("MaterialStandard", depotItem.getMaterialId().getStandard());
|
||||
//扩展信息
|
||||
String materialOther = getOtherInfo(mpArr, depotItem);
|
||||
item.put("MaterialOther", materialOther);
|
||||
item.put("MaterialColor", depotItem.getMaterialId().getColor());
|
||||
item.put("MaterialUnit", depotItem.getMaterialId().getUnit());
|
||||
item.put("thisSum", InSum - OutSum);
|
||||
@@ -507,7 +494,8 @@ public class DepotItemAction extends BaseAction<DepotItemModel>
|
||||
pageUtil.setAdvSearch(getConditionALL());
|
||||
depotItemService.find(pageUtil);
|
||||
List<DepotItem> dataList = pageUtil.getPageList();
|
||||
|
||||
String mpList = model.getMpList(); //商品属性
|
||||
String[] mpArr = mpList.split(",");
|
||||
JSONObject outer = new JSONObject();
|
||||
outer.put("total", pageUtil.getTotalCount());
|
||||
//存放数据json数组
|
||||
@@ -525,7 +513,9 @@ public class DepotItemAction extends BaseAction<DepotItemModel>
|
||||
item.put("MaterialId", depotItem.getMaterialId()==null?"":depotItem.getMaterialId().getId());
|
||||
item.put("MaterialName", depotItem.getMaterialId().getName());
|
||||
item.put("MaterialModel", depotItem.getMaterialId().getModel());
|
||||
item.put("MaterialStandard", depotItem.getMaterialId().getStandard());
|
||||
//扩展信息
|
||||
String materialOther = getOtherInfo(mpArr, depotItem);
|
||||
item.put("MaterialOther", materialOther);
|
||||
item.put("MaterialColor", depotItem.getMaterialId().getColor());
|
||||
item.put("MaterialUnit", depotItem.getMaterialId().getUnit());
|
||||
item.put("InSum", InSum);
|
||||
@@ -562,7 +552,8 @@ public class DepotItemAction extends BaseAction<DepotItemModel>
|
||||
pageUtil.setAdvSearch(getConditionALL());
|
||||
depotItemService.find(pageUtil);
|
||||
List<DepotItem> dataList = pageUtil.getPageList();
|
||||
|
||||
String mpList = model.getMpList(); //商品属性
|
||||
String[] mpArr = mpList.split(",");
|
||||
JSONObject outer = new JSONObject();
|
||||
outer.put("total", pageUtil.getTotalCount());
|
||||
//存放数据json数组
|
||||
@@ -584,7 +575,9 @@ public class DepotItemAction extends BaseAction<DepotItemModel>
|
||||
item.put("MaterialId", depotItem.getMaterialId()==null?"":depotItem.getMaterialId().getId());
|
||||
item.put("MaterialName", depotItem.getMaterialId().getName());
|
||||
item.put("MaterialModel", depotItem.getMaterialId().getModel());
|
||||
item.put("MaterialStandard", depotItem.getMaterialId().getStandard());
|
||||
//扩展信息
|
||||
String materialOther = getOtherInfo(mpArr, depotItem);
|
||||
item.put("MaterialOther", materialOther);
|
||||
item.put("MaterialColor", depotItem.getMaterialId().getColor());
|
||||
item.put("MaterialUnit", depotItem.getMaterialId().getUnit());
|
||||
item.put("OutSum", OutSumRetail + OutSum);
|
||||
@@ -843,6 +836,35 @@ public class DepotItemAction extends BaseAction<DepotItemModel>
|
||||
sumPrice = Double.parseDouble(allPrice);
|
||||
return sumPrice;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取扩展信息
|
||||
* @return
|
||||
*/
|
||||
public String getOtherInfo(String[] mpArr, DepotItem depotItem){
|
||||
String materialOther = "";
|
||||
for(int i=0; i< mpArr.length; i++) {
|
||||
if(mpArr[i].equals("颜色")) {
|
||||
materialOther = materialOther + ((depotItem.getMaterialId().getColor() == null || depotItem.getMaterialId().getColor().equals(""))?"":"("+depotItem.getMaterialId().getColor() + ")");
|
||||
}
|
||||
if(mpArr[i].equals("规格")) {
|
||||
materialOther = materialOther + ((depotItem.getMaterialId().getStandard() == null || depotItem.getMaterialId().getStandard().equals(""))?"":"("+depotItem.getMaterialId().getStandard() + ")");
|
||||
}
|
||||
if(mpArr[i].equals("制造商")) {
|
||||
materialOther = materialOther + ((depotItem.getMaterialId().getMfrs() == null || depotItem.getMaterialId().getMfrs().equals(""))?"":"("+depotItem.getMaterialId().getMfrs() + ")");
|
||||
}
|
||||
if(mpArr[i].equals("自定义1")) {
|
||||
materialOther = materialOther + ((depotItem.getMaterialId().getOtherField1() == null || depotItem.getMaterialId().getOtherField1().equals(""))?"":"("+depotItem.getMaterialId().getOtherField1() + ")");
|
||||
}
|
||||
if(mpArr[i].equals("自定义2")) {
|
||||
materialOther = materialOther + ((depotItem.getMaterialId().getOtherField2() == null || depotItem.getMaterialId().getOtherField2().equals(""))?"":"("+depotItem.getMaterialId().getOtherField2() + ")");
|
||||
}
|
||||
if(mpArr[i].equals("自定义3")) {
|
||||
materialOther = materialOther + ((depotItem.getMaterialId().getOtherField3() == null || depotItem.getMaterialId().getOtherField3().equals(""))?"":"("+depotItem.getMaterialId().getOtherField3() + ")");
|
||||
}
|
||||
}
|
||||
return materialOther;
|
||||
}
|
||||
/**
|
||||
* 拼接搜索条件
|
||||
* @return
|
||||
|
||||
@@ -303,7 +303,8 @@ public class MaterialAction extends BaseAction<MaterialModel>
|
||||
materialService.find(pageUtil);
|
||||
getSession().put("pageUtilMaterial", pageUtil);
|
||||
List<Material> dataList = pageUtil.getPageList();
|
||||
|
||||
String mpList = model.getMpList(); //商品属性
|
||||
String[] mpArr = mpList.split(",");
|
||||
JSONObject outer = new JSONObject();
|
||||
outer.put("total", pageUtil.getTotalCount());
|
||||
//存放数据json数组
|
||||
@@ -317,12 +318,32 @@ public class MaterialAction extends BaseAction<MaterialModel>
|
||||
item.put("Name", material.getName());
|
||||
item.put("CategoryId", material.getMaterialCategory().getId()); //类型Id
|
||||
item.put("CategoryName", material.getMaterialCategory().getName()); //类型名称
|
||||
item.put("Mfrs", material.getMfrs()==null?"" : material.getMfrs());
|
||||
item.put("Packing", material.getPacking()==null?"" : material.getPacking());
|
||||
item.put("SafetyStock", material.getSafetyStock()==null?"" : material.getSafetyStock());
|
||||
item.put("Model", material.getModel()==null?"" : material.getModel());
|
||||
item.put("Standard", material.getStandard()==null?"": material.getStandard());
|
||||
item.put("Color", material.getColor()==null?"": material.getColor());
|
||||
//扩展信息
|
||||
String materialOther = "";
|
||||
for(int i=0; i< mpArr.length; i++) {
|
||||
if(mpArr[i].equals("颜色")) {
|
||||
materialOther = materialOther + ((material.getColor() == null || material.getColor().equals(""))?"":"("+material.getColor() + ")");
|
||||
}
|
||||
if(mpArr[i].equals("规格")) {
|
||||
materialOther = materialOther + ((material.getStandard() == null || material.getStandard().equals(""))?"":"("+material.getStandard() + ")");
|
||||
}
|
||||
if(mpArr[i].equals("制造商")) {
|
||||
materialOther = materialOther + ((material.getMfrs() == null || material.getMfrs().equals(""))?"":"("+material.getMfrs() + ")");
|
||||
}
|
||||
if(mpArr[i].equals("自定义1")) {
|
||||
materialOther = materialOther + ((material.getOtherField1() == null || material.getOtherField1().equals(""))?"":"("+material.getOtherField1() + ")");
|
||||
}
|
||||
if(mpArr[i].equals("自定义2")) {
|
||||
materialOther = materialOther + ((material.getOtherField2() == null || material.getOtherField2().equals(""))?"":"("+material.getOtherField2() + ")");
|
||||
}
|
||||
if(mpArr[i].equals("自定义3")) {
|
||||
materialOther = materialOther + ((material.getOtherField3() == null || material.getOtherField3().equals(""))?"":"("+material.getOtherField3() + ")");
|
||||
}
|
||||
}
|
||||
item.put("MaterialOther", materialOther);
|
||||
item.put("Unit", material.getUnit()==null?"": material.getUnit());
|
||||
item.put("RetailPrice", material.getRetailPrice());
|
||||
item.put("LowPrice", material.getLowPrice());
|
||||
@@ -335,9 +356,12 @@ public class MaterialAction extends BaseAction<MaterialModel>
|
||||
item.put("PriceStrategy", material.getPriceStrategy());
|
||||
item.put("Enabled", material.getEnabled());
|
||||
item.put("Remark", material.getRemark());
|
||||
item.put("OtherField1", material.getOtherField1());
|
||||
item.put("OtherField2", material.getOtherField2());
|
||||
item.put("OtherField3", material.getOtherField3());
|
||||
item.put("Color", material.getColor()==null?"" : material.getColor());
|
||||
item.put("Standard", material.getStandard()==null?"" : material.getStandard());
|
||||
item.put("Mfrs", material.getMfrs()==null?"" : material.getMfrs());
|
||||
item.put("OtherField1", material.getOtherField1()==null?"" : material.getOtherField1());
|
||||
item.put("OtherField2", material.getOtherField2()==null?"" : material.getOtherField2());
|
||||
item.put("OtherField3", material.getOtherField3()==null?"" : material.getOtherField3());
|
||||
item.put("op", 1);
|
||||
dataArray.add(item);
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ public class MaterialService extends BaseService<Material> implements MaterialIS
|
||||
workbook = Workbook.createWorkbook(os);
|
||||
WritableSheet sheet = workbook.createSheet("信息报表", 0);
|
||||
//增加列头
|
||||
String[] colunmName = {"品名","类型","型号","颜色","规格","安全存量","单位","零售价","最低售价","预计采购价","批发价","备注","状态"};
|
||||
String[] colunmName = {"品名","类型","型号","安全存量","单位","零售价","最低售价","预计采购价","批发价","备注","状态"};
|
||||
for(int i = 0 ;i < colunmName.length;i ++) {
|
||||
sheet.setColumnView(i, 10);
|
||||
sheet.addCell(new Label(i, 0, colunmName[i]));
|
||||
@@ -102,8 +102,6 @@ public class MaterialService extends BaseService<Material> implements MaterialIS
|
||||
sheet.addCell(new Label(j++,i, material.getName()));
|
||||
sheet.addCell(new Label(j++,i, material.getMaterialCategory().getName()));
|
||||
sheet.addCell(new Label(j++,i, material.getModel() == null ?"": material.getModel()));
|
||||
sheet.addCell(new Label(j++,i, material.getColor() == null ?"": material.getColor()));
|
||||
sheet.addCell(new Label(j++,i, material.getStandard() == null ?"": material.getStandard()));
|
||||
sheet.addCell(getLabelInfo(cellInfo,j++,i, material.getSafetyStock() == null ?"": material.getSafetyStock().toString(),material));
|
||||
sheet.addCell(new Label(j++,i, material.getUnit() == null ?"": material.getUnit()));
|
||||
sheet.addCell(new Label(j++,i, material.getRetailPrice() == null ?"": material.getRetailPrice().toString()));
|
||||
@@ -206,8 +204,6 @@ public class MaterialService extends BaseService<Material> implements MaterialIS
|
||||
while(itsheet.hasNext()) {
|
||||
//获取当前行数据
|
||||
Row row = itsheet.next();
|
||||
//获取一行有多少单元格
|
||||
// System.out.println(row.getLastCellNum());
|
||||
|
||||
//excel表格第几行数据 从1开始 0 是表头
|
||||
int rowNum = row.getRowNum();
|
||||
@@ -242,7 +238,7 @@ public class MaterialService extends BaseService<Material> implements MaterialIS
|
||||
|
||||
Log.infoFileSync("==================excel表格中第" + totalRow + "行的第 " + cellIndex + "列的值为" + cell.getStringCellValue());
|
||||
|
||||
//每行中数据顺序 "品名","类型","型号","颜色","规格","安全存量","单位","零售价","最低售价","预计采购价","批发价","备注","状态"
|
||||
//每行中数据顺序 "品名","类型","型号","安全存量","单位","零售价","最低售价","预计采购价","批发价","备注","状态"
|
||||
switch(cellIndex) {
|
||||
case MaterialConstants.BusinessForExcel.EXCEL_NAME :
|
||||
String materialName = cell.getStringCellValue();
|
||||
@@ -268,22 +264,6 @@ public class MaterialService extends BaseService<Material> implements MaterialIS
|
||||
}
|
||||
material.setModel(model);
|
||||
break;
|
||||
case MaterialConstants.BusinessForExcel.EXCEL_COLOR :
|
||||
String color = cell.getStringCellValue();
|
||||
if(null == color || "".equals(color)) {
|
||||
Log.errorFileSync(">>>>>>>>>>>>>>>>列表没有填写(颜色)信息");
|
||||
break;
|
||||
}
|
||||
material.setColor(color);
|
||||
break;
|
||||
case MaterialConstants.BusinessForExcel.EXCEL_STANDARD :
|
||||
String standard = cell.getStringCellValue();
|
||||
if(null == standard || "".equals(standard)) {
|
||||
Log.errorFileSync(">>>>>>>>>>>>>>>>列表没有填写(规格)信息");
|
||||
break;
|
||||
}
|
||||
material.setStandard(standard);
|
||||
break;
|
||||
case MaterialConstants.BusinessForExcel.EXCEL_SAFETY_STOCK :
|
||||
String safetyStock = cell.getStringCellValue();
|
||||
if(null == safetyStock || "".equals(safetyStock)) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
jdbcUrl= jdbc\:mysql\://localhost\:3306/jsh_erp?useUnicode\=true&characterEncoding\=UTF-8
|
||||
jdbcUrl= jdbc\:mysql\://localhost\:3306/jsh_erp_guoku1009?useUnicode\=true&characterEncoding\=UTF-8
|
||||
driverClass= com.mysql.jdbc.Driver
|
||||
user= root
|
||||
password=1234
|
||||
@@ -35,10 +35,7 @@
|
||||
<td>
|
||||
<input name="searchModel" id="searchModel" style="width:80px;"/>
|
||||
</td>
|
||||
<td>颜色:</td>
|
||||
<td>
|
||||
<input name="searchColor" id="searchColor" style="width:80px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>类别:</td>
|
||||
<td>
|
||||
<select name="searchCategoryId_f" id="searchCategoryId_f" style="width:100px;"></select>
|
||||
@@ -253,6 +250,7 @@
|
||||
var cid=1;
|
||||
var multiple = 0; //倍数
|
||||
var mPropertyList = null; //商品属性列表
|
||||
var mPropertyListShort = ""; //商品属性列表-传值
|
||||
//初始化界面
|
||||
$(function()
|
||||
{
|
||||
@@ -263,6 +261,7 @@
|
||||
initSelectInfo("edit_first");
|
||||
manyUnitFun();
|
||||
priceKeyUp();//价格触发事件
|
||||
initMPropertyShort(); //初始化商品属性
|
||||
initTableData();
|
||||
ininPager();
|
||||
initForm();
|
||||
@@ -529,6 +528,34 @@
|
||||
});
|
||||
}
|
||||
|
||||
//初始化商品属性
|
||||
function initMPropertyShort(){
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "<%=path %>/materialProperty/findBy.action",
|
||||
dataType: "json",
|
||||
async: false,
|
||||
success: function (res) {
|
||||
if (res && res.rows) {
|
||||
var thisRows = res.rows;
|
||||
for(var i=0; i < thisRows.length; i++) {
|
||||
if(thisRows[i].enabled){
|
||||
mPropertyListShort += thisRows[i].nativeName +",";
|
||||
}
|
||||
}
|
||||
if(mPropertyListShort){
|
||||
mPropertyListShort = mPropertyListShort.substring(0,mPropertyListShort.length-1);
|
||||
}
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function() {
|
||||
$.messager.alert('查询提示','查询信息异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化表格数据
|
||||
function initTableData() {
|
||||
//改变宽度和高度
|
||||
@@ -550,7 +577,6 @@
|
||||
//fitColumns:true,
|
||||
//单击行是否选中
|
||||
//checkOnSelect : false,
|
||||
url:'<%=path %>/material/findBy.action?pageSize=' + initPageSize+'&CategoryIds='+setCategoryId+'&CategoryId='+cid,
|
||||
pagination: true,
|
||||
//交替出现背景
|
||||
striped : true,
|
||||
@@ -576,8 +602,7 @@
|
||||
},
|
||||
{ title: '品名',field: 'Name',width:80},
|
||||
{ title: '型号',field: 'Model',width:80},
|
||||
{ title: '颜色',field: 'Color',width:80},
|
||||
{ title: '规格',field: 'Standard',width:80},
|
||||
{ title: '扩展信息',field: 'MaterialOther',width:150},
|
||||
{ title: '单位',field: 'Unit',width:60},
|
||||
{ title: '安全存量',field: 'SafetyStock',width:90},
|
||||
{ title: '零售价',field: 'RetailPrice',width:60},
|
||||
@@ -651,6 +676,7 @@
|
||||
return;
|
||||
}
|
||||
});
|
||||
showMaterialDetails(1,initPageSize);
|
||||
}
|
||||
|
||||
//初始化键盘enter事件
|
||||
@@ -1384,8 +1410,7 @@
|
||||
});
|
||||
|
||||
|
||||
function showMaterialDetails(pageNo,pageSize)
|
||||
{
|
||||
function showMaterialDetails(pageNo,pageSize) {
|
||||
if(setCategoryId!="1") {
|
||||
cid = 2;
|
||||
}
|
||||
@@ -1402,6 +1427,7 @@
|
||||
Color: $.trim($("#searchColor").val()),
|
||||
CategoryId:cid,
|
||||
CategoryIds:setCategoryId,
|
||||
mpList: mPropertyListShort,
|
||||
pageNo:pageNo,
|
||||
pageSize:pageSize
|
||||
}),
|
||||
|
||||
@@ -48,24 +48,50 @@
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var mPropertyList = ""; //商品属性列表
|
||||
//初始化界面
|
||||
$(function()
|
||||
{
|
||||
var thisDate = getNowFormatMonth(); //当前月份
|
||||
$("#searchMonth").val(thisDate);
|
||||
initMProperty(); //初始化商品属性
|
||||
initTableData();
|
||||
ininPager();
|
||||
search();
|
||||
print();
|
||||
});
|
||||
});
|
||||
|
||||
//初始化商品属性
|
||||
function initMProperty(){
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "<%=path %>/materialProperty/findBy.action",
|
||||
dataType: "json",
|
||||
success: function (res) {
|
||||
if (res && res.rows) {
|
||||
var thisRows = res.rows;
|
||||
for(var i=0; i < thisRows.length; i++) {
|
||||
if(thisRows[i].enabled){
|
||||
mPropertyList += thisRows[i].nativeName +",";
|
||||
}
|
||||
}
|
||||
if(mPropertyList){
|
||||
mPropertyList = mPropertyList.substring(0,mPropertyList.length-1);
|
||||
}
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function() {
|
||||
$.messager.alert('查询提示','查询信息异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化表格数据
|
||||
function initTableData()
|
||||
{
|
||||
$('#tableData').datagrid({
|
||||
//title:'列表',
|
||||
//iconCls:'icon-save',
|
||||
//width:700,
|
||||
height:heightInfo,
|
||||
nowrap: false,
|
||||
rownumbers: true,
|
||||
@@ -82,8 +108,7 @@
|
||||
columns:[[
|
||||
{ title: '名称',field: 'MaterialName',width:60},
|
||||
{ title: '型号',field: 'MaterialModel',width:80},
|
||||
{ title: '规格',field: 'MaterialStandard',width:80},
|
||||
{ title: '颜色',field: 'MaterialColor',width:80,hidden:true},
|
||||
{ title: '扩展信息',field: 'MaterialOther',width:150},
|
||||
{ title: '单位',field: 'MaterialUnit',width:80},
|
||||
{ title: '进货数量',field: 'InSum',width:60},
|
||||
{ title: '进货金额',field: 'InSumPrice',width:60},
|
||||
@@ -146,11 +171,10 @@
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
opts.pageNumber = 1;
|
||||
opts.pageSize = initPageSize;
|
||||
pager.pagination('refresh',
|
||||
{
|
||||
pageNumber:1,
|
||||
pageSize:initPageSize
|
||||
});
|
||||
pager.pagination('refresh', {
|
||||
pageNumber:1,
|
||||
pageSize:initPageSize
|
||||
});
|
||||
}
|
||||
//搜索处理
|
||||
$("#searchBtn").unbind().bind({
|
||||
@@ -182,7 +206,7 @@
|
||||
var MIds = resNew.mIds;
|
||||
if(MIds) {
|
||||
$.ajax({
|
||||
type:"get",
|
||||
type:"post",
|
||||
url: "<%=path %>/depotItem/buyIn.action",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
@@ -190,7 +214,8 @@
|
||||
pageSize:pageSize,
|
||||
MonthTime:$("#searchMonth").val(),
|
||||
HeadIds:HeadIds,
|
||||
MaterialIds:MIds
|
||||
MaterialIds:MIds,
|
||||
mpList: mPropertyList
|
||||
}),
|
||||
success: function (data)
|
||||
{
|
||||
|
||||
@@ -44,11 +44,13 @@
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var mPropertyList = ""; //商品属性列表
|
||||
//初始化界面
|
||||
$(function(){
|
||||
var userBusinessList=null;
|
||||
var userdepot=null;
|
||||
initGift();
|
||||
initMProperty(); //初始化商品属性
|
||||
initTableData();
|
||||
ininPager();
|
||||
});
|
||||
@@ -73,6 +75,33 @@
|
||||
});
|
||||
}
|
||||
|
||||
//初始化商品属性
|
||||
function initMProperty(){
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "<%=path %>/materialProperty/findBy.action",
|
||||
dataType: "json",
|
||||
success: function (res) {
|
||||
if (res && res.rows) {
|
||||
var thisRows = res.rows;
|
||||
for(var i=0; i < thisRows.length; i++) {
|
||||
if(thisRows[i].enabled){
|
||||
mPropertyList += thisRows[i].nativeName +",";
|
||||
}
|
||||
}
|
||||
if(mPropertyList){
|
||||
mPropertyList = mPropertyList.substring(0,mPropertyList.length-1);
|
||||
}
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function() {
|
||||
$.messager.alert('查询提示','查询信息异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化表格数据
|
||||
function initTableData(){
|
||||
$('#tableData').datagrid({
|
||||
@@ -91,8 +120,7 @@
|
||||
columns:[[
|
||||
{ title: '名称',field: 'MaterialName',width:60},
|
||||
{ title: '型号',field: 'MaterialModel',width:80},
|
||||
{ title: '规格',field: 'MaterialStandard',width:80},
|
||||
{ title: '颜色',field: 'MaterialColor',width:80,hidden:true},
|
||||
{ title: '扩展信息',field: 'MaterialOther',width:150},
|
||||
{ title: '单位',field: 'MaterialUnit',width:80},
|
||||
{ title: '结存数量',field: 'thisSum',width:80}
|
||||
]],
|
||||
@@ -186,7 +214,7 @@
|
||||
var MIds = resNew.mIds;
|
||||
if(MIds) {
|
||||
$.ajax({
|
||||
type:"get",
|
||||
type:"post",
|
||||
url: "<%=path %>/depotItem/findGiftByAll.action",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
@@ -194,7 +222,8 @@
|
||||
pageSize:pageSize,
|
||||
ProjectId: searchGiftId,
|
||||
HeadIds: HeadIds,
|
||||
MaterialIds: MIds
|
||||
MaterialIds: MIds,
|
||||
mpList: mPropertyList
|
||||
}),
|
||||
success: function (data) {
|
||||
$("#tableData").datagrid('loadData',data);
|
||||
|
||||
@@ -60,6 +60,7 @@
|
||||
<script type="text/javascript">
|
||||
var depotList = null;
|
||||
var depotID = null;
|
||||
var mPropertyList = ""; //商品属性列表
|
||||
//初始化界面
|
||||
$(function()
|
||||
{
|
||||
@@ -71,6 +72,7 @@
|
||||
initSelectInfo_UB();
|
||||
initSystemData_depot();
|
||||
initSelectInfo_depot();
|
||||
initMProperty(); //初始化商品属性
|
||||
initTableData();
|
||||
ininPager();
|
||||
search();
|
||||
@@ -180,14 +182,38 @@
|
||||
$("#searchProjectId").empty().append('<option value="">全部</option>').append(options);
|
||||
}
|
||||
}
|
||||
|
||||
//初始化商品属性
|
||||
function initMProperty(){
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "<%=path %>/materialProperty/findBy.action",
|
||||
dataType: "json",
|
||||
success: function (res) {
|
||||
if (res && res.rows) {
|
||||
var thisRows = res.rows;
|
||||
for(var i=0; i < thisRows.length; i++) {
|
||||
if(thisRows[i].enabled){
|
||||
mPropertyList += thisRows[i].nativeName +",";
|
||||
}
|
||||
}
|
||||
if(mPropertyList){
|
||||
mPropertyList = mPropertyList.substring(0,mPropertyList.length-1);
|
||||
}
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function() {
|
||||
$.messager.alert('查询提示','查询信息异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化表格数据
|
||||
function initTableData()
|
||||
{
|
||||
$('#tableData').datagrid({
|
||||
//title:'列表',
|
||||
//iconCls:'icon-save',
|
||||
//width:700,
|
||||
height:heightInfo,
|
||||
nowrap: false,
|
||||
rownumbers: true,
|
||||
@@ -204,8 +230,7 @@
|
||||
columns:[[
|
||||
{ title: '名称',field: 'MaterialName',width:60},
|
||||
{ title: '型号',field: 'MaterialModel',width:80},
|
||||
{ title: '规格',field: 'MaterialStandard',width:80},
|
||||
{ title: '颜色',field: 'MaterialColor',width:80,hidden:true},
|
||||
{ title: '扩展信息',field: 'MaterialOther',width:150},
|
||||
{ title: '单位',field: 'MaterialUnit',width:80},
|
||||
{ title: '单价',field: 'UnitPrice',width:60,formatter: function(value,row,index){
|
||||
return value.toFixed(2);
|
||||
@@ -328,7 +353,7 @@
|
||||
}
|
||||
else {
|
||||
$.ajax({
|
||||
type:"get",
|
||||
type:"post",
|
||||
url: "<%=path %>/depotItem/findByAll.action",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
@@ -337,7 +362,8 @@
|
||||
ProjectId: $.trim($("#searchProjectId").val()),
|
||||
MonthTime:$("#searchMonth").val(),
|
||||
HeadIds:HeadIds,
|
||||
MaterialIds:MIds
|
||||
MaterialIds:MIds,
|
||||
mpList: mPropertyList
|
||||
}),
|
||||
success: function (data)
|
||||
{
|
||||
|
||||
@@ -49,25 +49,51 @@
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var mPropertyList = ""; //商品属性列表
|
||||
//初始化界面
|
||||
$(function()
|
||||
{
|
||||
$("#searchTable .tip").css("padding-left","15px").css("color","red");
|
||||
var thisDate = getNowFormatMonth(); //当前月份
|
||||
$("#searchMonth").val(thisDate);
|
||||
initMProperty(); //初始化商品属性
|
||||
initTableData();
|
||||
ininPager();
|
||||
search();
|
||||
print();
|
||||
});
|
||||
});
|
||||
|
||||
//初始化商品属性
|
||||
function initMProperty(){
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "<%=path %>/materialProperty/findBy.action",
|
||||
dataType: "json",
|
||||
success: function (res) {
|
||||
if (res && res.rows) {
|
||||
var thisRows = res.rows;
|
||||
for(var i=0; i < thisRows.length; i++) {
|
||||
if(thisRows[i].enabled){
|
||||
mPropertyList += thisRows[i].nativeName +",";
|
||||
}
|
||||
}
|
||||
if(mPropertyList){
|
||||
mPropertyList = mPropertyList.substring(0,mPropertyList.length-1);
|
||||
}
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function() {
|
||||
$.messager.alert('查询提示','查询信息异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化表格数据
|
||||
function initTableData()
|
||||
{
|
||||
$('#tableData').datagrid({
|
||||
//title:'列表',
|
||||
//iconCls:'icon-save',
|
||||
//width:700,
|
||||
height:heightInfo,
|
||||
nowrap: false,
|
||||
rownumbers: true,
|
||||
@@ -84,8 +110,7 @@
|
||||
columns:[[
|
||||
{ title: '名称',field: 'MaterialName',width:60},
|
||||
{ title: '型号',field: 'MaterialModel',width:80},
|
||||
{ title: '规格',field: 'MaterialStandard',width:80},
|
||||
{ title: '颜色',field: 'MaterialColor',width:80,hidden:true},
|
||||
{ title: '扩展信息',field: 'MaterialOther',width:150},
|
||||
{ title: '单位',field: 'MaterialUnit',width:80},
|
||||
{ title: '销售数量',field: 'OutSum',width:60},
|
||||
{ title: '销售金额',field: 'OutSumPrice',width:60},
|
||||
@@ -184,7 +209,7 @@
|
||||
var MIds = resNew.mIds;
|
||||
if(MIds) {
|
||||
$.ajax({
|
||||
type:"get",
|
||||
type:"post",
|
||||
url: "<%=path %>/depotItem/saleOut.action",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
@@ -192,7 +217,8 @@
|
||||
pageSize:pageSize,
|
||||
MonthTime:$("#searchMonth").val(),
|
||||
HeadIds:HeadIds,
|
||||
MaterialIds:MIds
|
||||
MaterialIds:MIds,
|
||||
mpList: mPropertyList
|
||||
}),
|
||||
success: function (data)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user