IT启程之路1



<?xml version="1.0" encoding="gbk"?>

<page template="0301" version="1.0" formaction="">
  <info>
    <description title="托管账户转入 "/>
    <editlogs>
      <log editor="Y00423(离线)" edittime="2014-03-15 21:10:06"/>
    </editlogs>
  </info>
  <scripts>
    <script><![CDATA[//页面加载后执行
   var arrAccnum = [];
function pageOnload() {
 $('#datalist1').on('change','input[name=regnumcheck]',function(){

  /**
  *功能 批量数据前添加复选框,提交选中的复选框中的个人账号以逗号分隔
  *使用的主要函数  $.inArray(元素名,数组名) 返回值当前元素在数组中的位置,不存在则返回-1
  *arrAccnum[arrAccnum.length] = "'"+accnum1+"'";  选中若不存在 在数组末尾添加改元素
  *先选中,在取消,则在数组中清除去   var index = *$.inArray("'"+accnum1+"'",arrAccnum);arrAccnum.splice(index,1);
  *先找到改元素在数组的索引值,如果不是-1,怎调用splice方法,从index位置开始,删除1个元素
  *splice()参数可以有多个
  *
  */
  var accnum1 = $(this).closest('tr').getCell('accnum1').text();
  
  if ( this.checked )
  {
   if(!ydl.validator($(this).closest('tr').getCell('reason','select'),{required:true})){
     alert('请先选择停缴原因');
     $("input[class='"+$(this).attr('class')+"']").attr("checked",false);
     return false;
   }
   $("input[class='"+$(this).attr('class')+"']").attr("checked",true);

   //如果个人账号不在数组里
   if ($.inArray(accnum1,arrAccnum) == -1) arrAccnum[arrAccnum.length] = "'"+accnum1+"'"; 
  } 
  else{
   
   $("input[class='"+$(this).attr('class')+"']").attr("checked", false);
   //
   var index = $.inArray("'"+accnum1+"'",arrAccnum);
   //未选中,清空原因
   $(this).closest('tr').getCell('reason','select').val('');
   if (index != -1) arrAccnum.splice(index,1);
  }
 });

}

//表单提交时执行
function form_validate() {
 datalist_buttonclick_datalist1("save");
 //arrAccnum
 $$('AccNum1Str').value = arrAccnum.join(',');
 if(!$$('AccNum1Str').value){
  alert('请选择托管账户');
  return false;
 }
 return true;
}

function datalist_buttonclick_datalist1(save){
 $$('AccNum1Str').value = arrAccnum.join(',');
  ydl.workflow.sendCommand({});
  ydl.init.dataList({
   id: 'datalist1'
   }, 'refresh');
}

//查询结果反显前调用
function datalist_callback_datalist1(rows) {
 $(rows).filter(':gt(0)').each(function (index) {
 
  $(this).getCell(1).addClass('code');
  $(this).getCell(2).addClass('code');
  $(this).getCell(3).addClass('code');
  $(this).getCell(4).addClass('code');
  $(this).getCell(5).addClass('code');
  $(this).getCell(6).addClass('code');
  $(this).getCell(7).addClass('code');
  $(this).getCell(8).addClass('code');
  $(this).getCell(9).addClass('code');
 
 //金额千分符
  var money = $(this).getCell('basenumber').text();
  $(this).getCell('basenumber').text(ydl.addComma(money));
  
  //var accnum1 = $(this).getCell('accnum1','input').val();
  var accnum1 = $(this).getCell('accnum1').text();
  $(this).prepend('<td><input type="checkbox" name="regnumcheck" class="c'+$(this).closest('tr').getCell('_rownumber').text()+'"/></td>');
  //复选框
  var $checkbox = $(this).find('input[name=regnumcheck]');
  //如果已选择此记录,进行勾选
  if ($.inArray("'"+accnum1+"'",arrAccnum) != -1) $checkbox.prop('checked',true);
  else $checkbox.prop('checked',false);
 
 
 
 
 
 });
 $(rows).eq(0).prepend('<th></th>');
 
 
 
}
]]></script>
  </scripts>
  <dataset/>
  <ajax/>
  <containers>
    <container type="table" id="ct_form" cols="4" layout="fit" uid="ct_form">
      <component type="label" for="unitaccnum">单位账号:</component>
      <component id="unitaccnum" type="input" subtype="text" maxlength="12" width="250px" fromdic="true" readonly="rw=='r'" colspan="3">=unitaccnum</component>
      <component type="label" for="unitaccname">单位名称:</component>
      <component id="unitaccname" type="input" subtype="text" maxlength="80" width="250px" fromdic="true" colspan="3" readonly="rw=='r'">=unitaccname</component>
    </container>
    <container uid="container-cf35eb37cea24d00a3c2fa58331c0ac8" type="box" layout="fit buttons" id="container-cf35eb37cea24d00a3c2fa58331c0ac8">
      <component id="datalist1" type="datalist" paging="true" layout="fit buttons" caption="个人托管" allowinsert="false" allowupdate="true" allowdelete="false" allowprint="false" pagesize="10" version="1" searchbox="false" compatible="0" showrowid="true" dialogedit="0" allowexport="true" allowimport="false" saveimportfile="false">
        <columns>
          <col id="instancenum" desc="实例号" coltype="3" hidden="true" required="false" ischar="false" datatype="int" dict="none" keycol="false"/>
          <col id="accnum1" desc="个人帐号" coltype="3" hidden="false" required="true" ischar="true" datatype="validchar" dict="none" keycol="false"/>
          <col id="accname1" desc="个人姓名" coltype="1" hidden="false" required="true" ischar="true" datatype="validchar" dict="none" keycol="false"/>
          <col id="certinum" desc="身份证号码" coltype="1" hidden="false" required="true" ischar="true" datatype="idcard" dict="none" keycol="false"/>
          <col id="reason" desc="停缴原因" coltype="2" hidden="false" required="false" ischar="true" datatype="validchar" dict="dynamic" datasource="workflow.cfg.xml" keycol="false">="select itemid,itemval from pf45 where typeid ='FCYY' and p_level='2' and status='1'"</col>
          <col id="basenumber" desc="账户余额" coltype="1" hidden="false" required="false" ischar="false" datatype="float" dict="none" keycol="false"/>
          <col id="enddate" desc="缴至年月" coltype="1" hidden="false" required="false" ischar="true" datatype="validchar" dict="none" keycol="false"/>
          <col id="accnum2" desc="手机号码" coltype="1" hidden="false" required="false" ischar="true" datatype="validchar" dict="none" keycol="false"/>
        </columns>
        <sqls datasource="workflow.cfg.xml">
          <sql type="insert">=""</sql>
          <sql type="select">="select instancenum, accnum1, accname1, certinum, reason,unitaccname, enddate, basenumber ,accnum2 from dp077 where instancenum="+_IS+" order by accnum1 "</sql>
          <sql type="update">="update dp077 set reason='"+reason[#]+"' where instancenum="+instancenum[#]+" and accnum1='"+accnum1[#]+"'"</sql>
          <sql type="delete">=""</sql>
        </sqls>
      </component>
    </container>
    <container uid="container-e5dd18c7cb9d4901ab6f055c41111230" type="hidden" id="container-e5dd18c7cb9d4901ab6f055c41111230">
      <component id="AccNum1Str" type="hidden">=AccNum1Str</component>
    </container>
  </containers>
</page>

猜你喜欢

转载自blog.csdn.net/wudongfang666/article/details/25866215