<script> AttachXFormValueChangeEventById("3b520239d9ffe2",sap); Com_AddEventListener(window, "load", sap); function sap(){ var fields = GetXFormFieldById("3b520239d9ffe2")[0].value; if(fields == "1"){// 授信新增客户 $('input[name="extendDataFormInfo.value(fd_3b52039084bb0c)"]').show();//填写显示 $('input[name="extendDataFormInfo.value(fd_3b520391b85874)"]').hide();//选择隐藏 $(GetXFormFieldById("fd_3b520391b85874")[0]).attr("validate","required=false");//选择非必填 $(GetXFormFieldById("fd_3b52039084bb0c")[0]).attr("validate","required");//选择必填 }else{ $('input[name="extendDataFormInfo.value(fd_3b52039084bb0c)"]').hide(); $('input[name="extendDataFormInfo.value(fd_3b520391b85874)"]').show(); $(GetXFormFieldById("fd_3b52039084bb0c")[0]).attr("validate","required=false"); $(GetXFormFieldById("fd_3b520391b85874")[0]).attr("validate","required"); } } </script> <script type="text/javascript"> function queryCustomer(){ Dialog_List(false, null, null, ";", 'kmReviewDialogService&flag='+encodeURI(encodeURI("queryCustomer")),function(data){ if(data!=null){ var rtnVal = data.GetHashMapArray(); if(null != rtnVal && rtnVal.length > 0){// 设置值 var obj = rtnVal[0]; SetXFormFieldValueById('fd_customer_code', obj["id"]); SetXFormFieldValueById('fd_customer_name', obj["name"]); } } },'kmReviewDialogService&keyword=!{keyword}&flag='+encodeURI(encodeURI("queryCustomer")), null, false, "选择客户"); } </script> <xform:editShow> <a onclick="queryCustomer()" style="cursor:pointer" id='addCustomer'> 选择 </a> </xform:editShow> <xform:viewShow> <a onclick="queryCustomer()" style="cursor:pointer" id='updateCustomer'> 选择 </a> </xform:viewShow>
标签:授信,false,name,value,js,fd,null,GetXFormFieldById From: https://www.cnblogs.com/dzx-fiona/p/17137036.html