添加自定义列,配置控制自定义F7
自定义F7的地址为连接界面的url
/dynamicPage.do?event=initialize&method=doEvent&uipk=com.kingdee.eas.re.sales.settlementTypeF7&waf2skin=easbase&inwafpage=false&debug=true
自定义F7添加一个释放按键事件(模糊搜索)
接收输入的文本模糊搜索并打开F7界面
settlementTypeKeyup:function(event){
var iframeOptions = waf(event.target).wafPromptIframe("option");
var boxOptions = waf(event.target).wafPromptBox("option");
var f7Url = "/easweb/dynamicPage.do?event=initialize&method=doEvent&uipk=com.kingdee.eas.re.sales.settlementTypeF7&waf2skin=easbase&inwafpage=false&debug=true";
var settlement = $(event.target).val();
if(settlement!=null&&settlement.trim()!=""){
var url = f7Url + "&settlement=" +encodeURIComponent(settlement);
waf(event.target).wafPromptIframe("option",'url',url);
if(waf(event.target).wafPromptIframe("hasOpen")){
waf(event.target).wafPromptIframe("close");
}
waf(event.target).wafPromptIframe("open");
waf(event.target).wafPromptIframe("option",'url',f7Url);
}
}
添加一个模型加载功能,接收输入的文本返回前台过滤
package com.kingdee.eas.re.sales.receiveGather.handler; import java.util.HashMap;
import java.util.Map; import javax.servlet.http.HttpServletRequest; import org.springframework.ui.ModelMap; import com.kingdee.bos.eventbus.event.view.AbstractOnRequestEvent;
import com.kingdee.bos.webframework.dynamic.application.WebSymbolConstant;
import com.kingdee.bos.webframework.dynamic.handler.view.WebPageOnLoadEventHandler;
import com.kingdee.bos.webframework.exception.WafException;
import com.kingdee.bos.webframework.json.JSONUtils;
import com.kingdee.eas.re.sales.web.utils.SalesContext; public class SettlementTypeF7PageOnLoadEventHandler extends
WebPageOnLoadEventHandler {
@Override
public void onLoad(AbstractOnRequestEvent event) throws WafException {
// TODO Auto-generated method stub
HttpServletRequest request = event.getReqeustContext().getHttpServletRequest();
Map initData = new HashMap();
ModelMap modelMap = event.getReqeustContext().get(ModelMap.class);
String uipk = event.getReqeustContext().getHttpServletRequest().getParameter(WebSymbolConstant.UIPK);
if(modelMap.get(WebSymbolConstant.PAGE_INITDATA_VAR)!=null){
String modelJSONDesc = modelMap.get(WebSymbolConstant.PAGE_INITDATA_VAR).toString();
initData = JSONUtils.convertJsonToObject(modelJSONDesc, HashMap.class);
}
if(SalesContext.getSellProject()!=null){
initData.put("sellproject",SalesContext.getSellProject());
}
String accountParam = request.getParameter("settlement");
if(accountParam!=null){
initData.put("settlementParam", accountParam);
}
modelMap.put(WebSymbolConstant.PAGE_INITDATA_VAR, JSONUtils
.convertObjectToJson(initData));
}
}
F7界面加一个页面加载事件(接收输入的文本并搜索)
1 pageOnLoadEvent_after:function(e){
2 var sellProjectid = "";
3 if(_self._pageInitData.sellproject!=null){
4 sellProjectid = _self._pageInitData.sellproject.id;
5 }else{
6 _self.showInfo("请先选择项目");
7 return;
8 }
9 var settlementParam = _self._pageInitData.settlementParam;
10 // _self.getUrlParam('build');
11 var filteritems = "";
12 if(settlementParam&&settlementParam.trim().length>0){
13 filteritems = filteritems + "name like '%"+settlementParam+"%'";
14 }
15 waf("#queryGrid").dataGrid("option","filterItems",filteritems);
16 waf("#queryGrid").dataGrid("reloadGrid");
17 }
F7界面加一个行点击后事件(选中行之后返回选中的数据,并关闭F7界面)
rowClick_after:function(rowid,status){
var settlementInfo = waf("#queryGrid").wafGrid('getRowRealData', rowid);
var returnVal = new Array();
// buildInfo.building =buildInfo.name;
returnVal.push(settlementInfo);
PromptIframeMgr.setReturnValue(returnVal);
PromptIframeMgr.close();
}