- 注册时间
- 2015-3-24
- 最后登录
- 1970-1-1
- 阅读权限
- 10
- 积分
- 14
- 精华
- 0
- 帖子
- 3
|
felt 发表于 2015-3-24 15:32
提供代码,我本地看一下
add.js- /**
- *
- */
- mini.parse();
- var zqyldg=mini.get("fzcyGridList");
- var depID;
- var depName;
- var ztID;
- var ztName;
- //设置新增窗口部门名称的选中值来自页面传递的depID
- var addDeptName = mini.get("ALERS0303");
- // 获取表单数据
- var cxxzForm = new mini.Form("#search4AddForm");
- var ZFZTCODE =mini.get("ZFZTCODE");
- var ZFZTNAME =mini.get("ZFZTNAME");
- ////////////////////////////////////////////////////
- setData();
- function setData(){
- var Selected=window.Owner.getGridSelected();
- depID=Selected.BASE0521;
- ztID=Selected.BASE0520;
- depName=Selected.BASE0522;
- ztName=Selected.BASE0501;
- /////////////////////////////
- addDeptName.setValue(depID);
- //职权主体是大的部门还是小的主体,--小的主体
- ZFZTNAME.setValue(ztName);
- ZFZTCODE.setValue(ztID);
-
- // 提交数据
- var cxzqData = cxxzForm.getData();
- var cxzqJson = mini.encode([ cxzqData ]);
- var loadFlag = "1";//点击新增时加载标识
- zqyldg.load({
- cxzqJson : cxzqJson,
- loadFlag :"1",
- depID : depID,
- ztID : ztID
- });
- }
- function searchZfzq4Add(){
- // 获取表单数据
- var cxxzForm = new mini.Form("#search4AddForm");
- // 表单验证
- cxxzForm.validate();
- if (cxxzForm.isValid() == false) {
- return;
- }
- // 提交数据
- var cxzqData = cxxzForm.getData();
- var cxzqJson = mini.encode([ cxzqData ]);
- // 向后台提交数据
- zqyldg.load({
- cxzqJson : cxzqJson,
- loadFlag : "2"
- });
- }
- function add(){
- depID = addDeptName.getValue();
- depName = addDeptName.getText();
- ztID = ZFZTCODE.getValue();
- ztName =ZFZTNAME.getValue();
- ///////////////////////////////
- var rows=GetAllSelecteds();
- if (rows.length > 0) {
- var gridData=mini.encode(rows);
- zqyldg.loading("操作中,请稍候......");
- // 处理数据
- $.ajax({
- url : "/zfzrz/zfzq/zfzqservice/addztzq?theme=none",
- type : "post",
- data : {
- selData : gridData,
- depID : depID,
- depName : depName,
- ztID : ztID,
- ztName : ztName
- },
- success : function(detext) {
- var data = mini.decode(detext);
- mini.alert(data.info);
- // 重新载入数据列表
- zqyldg.reload();
- window.Owner.zqyldg.reload();
- },
- error : function() {
- }
- });
- } else {
- mini.alert(MessageUtil("MSGG005"));
- }
- }
- /**
- * 关闭基本信息窗口
- *
- * @param action
- * @returns
- */
- function CloseWindow() {
- window.CloseOwnerWindow();
- }
- /////////////////////////////////////
- //重写(参考,几乎没变)
- function GetSelecteds() {
- var rows = zqyldg.getSelecteds();
- return rows;
- }
- var selectMaps = {};
- function GetAllSelecteds() {
- var data = [];
- for(var pageIndex in selectMaps){
- var rows = selectMaps[pageIndex];
- data.addRange(rows);
- }
- return data;
- }
- function GetData() {
- var rows = GetAllSelecteds();
- var ids = [],lers0301s = [];
- for (var i = 0, l = rows.length; i < l; i++) {
- var row = rows[i];
- ids.push(row.RECORDID);//获取翻页选中的RECORDID列表
- lers0301s.push(row.LERS0301);//获取翻页选中的编号列表
- }
- var data = {};
- data.RECORDID = ids.join(",");
- data.LERS0301 = lers0301s.join(",");
- return data;
- }
- ////////////////////////////////////////////
- function onGridLoad(e) {
- var rows = selectMaps[zqyldg.getPageIndex()];
- if(rows) zqyldg.selects(rows);
- }
- function onSelectoinChanged(e) {
- var rows =zqyldg.getSelecteds();
- selectMaps[zqyldg.getPageIndex()] = rows;
- }
复制代码 add.jsp
<body>
<div style="margin: 5px">
<fieldset >
<legend>
<span class="mini-button-span">查询条件</span>
</legend>
<div id="search4AddForm" class="fieldset-body">
<table class="form-table" border="0" cellpadding="2" cellspacing="5">
<tr>
<td class="form-label" style="text-align: right;width: 80px;"
nowrap="nowrap">部门:
<!-- 主体编号 -->
<input id="ZFZTCODE" name="ZFZTCODE" class="mini-hidden" />
<!-- 主体名称 -->
<input id="ZFZTNAME" name="ZFZTNAME" class="mini-hidden" />
</td>
<td><input id="ALERS0303" name="ALERS0303"
class="mini-combobox" allowInput="true" valueFromSelect="true" style="width: 200px;"
textField="name" valueField="id"
url="/zfzrz/zfzq/zfzqservice/getbranchlist4combobox?theme=none"
showNullItem="false" nullItemText="" allowInput="true"/></td>
<td nowrap="nowrap">行为:</td><td><input id="ALERS0302" name="ALERS0302"
class="mini-textbox" style="width: 150px;" vtype="sign" /></td>
<td style="width:100%;text-align: right;" ><a class="mini-button"
iconCls="icon-find" onclick="searchZfzq4Add" ><span class="mini-button-span">查询</span></a>
</td>
</tr>
</table>
</div>
</fieldset>
</div>
<div class="mini-fit">
<div class="mini-toolbar" style="height: 20px;" borderStyle="border:0px;">
<span class="mini-button-span">职权列表(亲,您方便加好友吗,我qq:1071745437.)</span>
</div><!-- allowCellEdit="true" allowCellSelect="true" allowCellValid="true" allowResizeColumn="true" allowAlternating="true" -->
<div class="mini-fit" style="margin: 0px 0px 0px 0px">
<div id="fzcyGridList" class="mini-datagrid" style="width: 100%; height: 100%;"
url="/zfzrz/zfzq/zfzqservice/getztzqbyaddgridlist/add?theme=none" idField="id"
allowResize="true"
multiSelect="true" totalField="Total" onselectionchanged="onSelectoinChanged" onload="onGridLoad">
<div property="columns">
<%-- 复选框 --%>
<div type="checkcolumn" width="6%"></div>
<%-- 序号 --%>
<div type="indexcolumn" headerAlign="center" width="10%">序号</div>
<div field="RECORDID" visible="false"></div>
<%-- 成员姓名 --%>
<div field="LERS0301" name="LERS0301" headerAlign="center" width="45px"
align="left" allowSort="true">编号</div>
<%-- 部门 --%>
<div field="LERS0303" name="LERS0303" headerAlign="center"
width="100px" align="left" allowSort="true">部门</div>
<%--名称 --%>
<div field="LERS0302" name="LERS0302" headerAlign="center" align="left"
allowSort="true">名称</div>
</div>
</div>
</div>
<div style="text-align:center;">
<a class="mini-button" plain="false" iconCls="icon-ok" onclick="add">
<span class="mini-button-span">确定</span>
</a>
<span> </span>
<a class="mini-button" plain="false" iconCls="icon-cancel" onclick="CloseWindow">
<span class="mini-button-span">关闭</span>
</a>
</div>
<div > </div>
</div>
<%=PathUtil.jsLink("com.bop.web.zfzrz", "/zfzq/js/addztzq.js")%>
</body>
|
|