单据列表增加商品信息展开功能

This commit is contained in:
季圣华
2017-09-11 00:25:57 +08:00
parent 7ec6035d1c
commit 3bbcef496f
7 changed files with 48 additions and 8 deletions

View File

@@ -427,6 +427,7 @@ public class DepotHeadAction extends BaseAction<DepotHeadModel>
item.put("payType", depotHead.getPayType()==null?"":depotHead.getPayType());
item.put("Status", depotHead.getStatus());
item.put("Remark", depotHead.getRemark());
item.put("MaterialsList", findMaterialsListByHeaderId(depotHead.getId()));
item.put("op", 1);
dataArray.add(item);
}
@@ -685,6 +686,25 @@ public class DepotHeadAction extends BaseAction<DepotHeadModel>
}
}
public String findMaterialsListByHeaderId(Long headerId){
String allReturn = "";
PageUtil pageUtil = new PageUtil();
pageUtil.setPageSize(0);
pageUtil.setCurPage(0);
try {
depotHeadService.findMaterialsListByHeaderId(pageUtil, headerId);
allReturn = pageUtil.getPageList().toString();
allReturn = allReturn.substring(1,allReturn.length()-1);
if(allReturn.equals("null")){
allReturn = "";
}
}
catch (JshException e) {
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找信息异常", e);
}
return allReturn;
}
/**
* 拼接搜索条件
* @return

View File

@@ -115,4 +115,13 @@ public class DepotHeadDAO extends BaseDAO<DepotHead> implements DepotHeadIDAO {
}
pageUtil.setPageList(query.list());
}
@SuppressWarnings("unchecked")
public void findMaterialsListByHeaderId(PageUtil pageUtil,Long headerId) throws JshException {
StringBuffer queryString = new StringBuffer();
queryString.append("select group_concat(concat(jsh_material.`Name`,' ',jsh_material.Model,' ',jsh_material.Mfrs)) as mName from jsh_depotitem inner join jsh_material " +
" on jsh_depotitem.MaterialId = jsh_material.Id where jsh_depotitem.HeaderId ="+ headerId);
Query query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createSQLQuery(queryString + SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
pageUtil.setPageList(query.list());
}
}

View File

@@ -21,4 +21,6 @@ public interface DepotHeadIDAO extends BaseIDAO<DepotHead>
public void findInOutMaterialCount(PageUtil pageUtil,String beginTime,String endTime,String type,Long pid,String dids) throws JshException;
public void findMaterialsListByHeaderId(PageUtil pageUtil,Long headerId) throws JshException;
}

View File

@@ -20,4 +20,6 @@ public interface DepotHeadIService extends BaseIService<DepotHead>
public void findInDetail(PageUtil pageUtil,String beginTime,String endTime, String type, Long pid,String dids)throws JshException;
public void findInOutMaterialCount(PageUtil pageUtil,String beginTime,String endTime, String type, Long pid,String dids)throws JshException;
public void findMaterialsListByHeaderId(PageUtil pageUtil,Long headerId)throws JshException;
}

View File

@@ -45,4 +45,8 @@ public class DepotHeadService extends BaseService<DepotHead> implements DepotHea
public void findInOutMaterialCount(PageUtil pageUtil,String beginTime,String endTime,String type,Long pid,String dids) throws JshException {
depotHeadDao.findInOutMaterialCount(pageUtil,beginTime,endTime,type,pid,dids);
}
public void findMaterialsListByHeaderId(PageUtil pageUtil,Long headerId) throws JshException {
depotHeadDao.findMaterialsListByHeaderId(pageUtil, headerId);
}
}

View File

@@ -486,15 +486,10 @@
singleSelect : true,
collapsible:false,
selectOnCheck:false,
//fitColumns:true,
//单击行是否选中
//checkOnSelect : false,
//url: path + '/depotHead/findBy.action?pageSize=' + initPageSize,
pagination: true,
//交替出现背景
striped : true,
//loadFilter: pagerFilter,
pageSize: 5,
pageSize: 10,
pageList: initPageNum,
columns:[[
{ field: 'Id',width:35,align:"center",checkbox:true},
@@ -537,9 +532,16 @@
{ title: '单据备注',field: 'Remark',width:100},
{ title: '创建时间',field: 'CreateTime',width:130}
]],
view: detailview,
detailFormatter: function(rowIndex, rowData){
return '<table><tr>' +
'<td style="border:0">' +
'<p>商品信息: ' + rowData.MaterialsList + '</p>' +
'</td>' +
'</tr></table>';
},
toolbar:tableToolBar,
onLoadError:function()
{
onLoadError:function() {
$.messager.alert('页面加载提示','页面加载异常,请稍后再试!','error');
return;
}

View File

@@ -19,6 +19,7 @@
<script src="<%=path %>/js/jquery-1.8.0.min.js"></script>
<script src="<%=path %>/js/easyui-1.3.5/jquery.easyui.min.js"></script>
<script src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
<script src="<%=path %>/js/datagrid-detailview.js"></script>
<script src="<%=path %>/js/My97DatePicker/WdatePicker.js"></script>
<script src="<%=path %>/js/common/common.js"></script>
<script src="<%=path %>/js/pages/materials/in_out.js"></script>