表单:
<div id="complex" class="mini-complex" style="background: rgb(255, 255, 255); padding: 2px 20px 10px; box-shadow: rgb(144, 144, 144) 0px 0px 5px; margin: 10px auto 12px; font-size: 14px; position: relative; height: 1000px; width: 660px;"> <p style="text-align: center;"> <strong><span style="font-size: 24px;"><br/></span></strong> </p> <p style="text-align: center;"> <strong><span style="font-size: 24px;">学生集体外出实习备案</span></strong><br/> </p> <p style="margin-bottom: 25px;"> <strong><span style="font-size: 24px;"></span></strong> </p> <table style="table-layout: fixed;border-collapse:collapse;border:2px solid black;" data-sort="sortDisabled" align="center"> <tbody> <tr class="firstRow"> <td valign="middle" align="center" colspan="1" rowspan="1" height="27" style="border-color: rgb(38, 38, 38); word-break: break-all;" width="93.33333333333333"> 申请人姓名 </td> <td valign="middle" align="center" colspan="1" rowspan="1" height="27" style="border-color: rgb(38, 38, 38); word-break: break-all;" width="140.33333333333334"> <input class="mini-textbox" choosevalue="CURRENTUSER" required="true" fieldtype="ordinary" allowinput="true" isshowonlist="1" datasourcetype="url" fldorder="0" enfield="SQRXM" cnfield="申请人姓名" adaptive="true" multiselect="false" showclearbutton="false" allowlimitvalue="false" maxlength="200" style="width: 100%;" type="mini-textbox" ziti="MicrosoftYaHei" zihao="fourteen" emptytext="" data-options="{"emptytext":""}"/><br/> </td> <td valign="middle" align="center" colspan="1" rowspan="1" height="27" style="border-color: rgb(38, 38, 38); word-break: break-all;" width="102.33333333333333"> 申请人工号 </td> <td valign="middle" align="center" colspan="1" rowspan="1" height="27" style="border-color: rgb(38, 38, 38);" width="135.33333333333334"> <input class="mini-textbox" choosevalue="CURRENTUSERID" required="true" fieldtype="ordinary" allowinput="true" isshowonlist="1" datasourcetype="url" fldorder="1" enfield="SQRGH" cnfield="申请人工号" adaptive="true" multiselect="false" showclearbutton="false" allowlimitvalue="false" maxlength="200" style="width: 100%;" type="mini-textbox" ziti="MicrosoftYaHei" zihao="fourteen" emptytext="" data-options="{"emptytext":""}"/><br/> </td> </tr> <tr> <td style="border-color: rgb(38, 38, 38); word-break: break-all;" width="125.33333333333333" valign="middle" align="center"> 带队教师姓名 </td> <td style="border-color: rgb(38, 38, 38); word-break: break-all;" width="140.33333333333334" valign="middle" align="center"> <input class="mini-textbox" choosevalue="CURRENTUSER" required="true" fieldtype="ordinary" allowinput="true" isshowonlist="1" datasourcetype="url" fldorder="1" enfield="DDJSXM" cnfield="带队教师姓名" adaptive="true" multiselect="false" showclearbutton="false" allowlimitvalue="false" maxlength="200" style="width: 100%;" emptytext="" data-options="{"emptytext":"","id":"DDJSXM"}"/><br/> </td> <td style="border-color: rgb(38, 38, 38); word-break: break-all;" width="95.33333333333333" valign="middle" align="center"> 带队教师工号 </td> <td style="border-color: rgb(38, 38, 38); word-break: break-all;" width="137.33333333333334" valign="middle" align="center"> <input class="mini-textbox" choosevalue="CURRENTUSERID" required="true" fieldtype="ordinary" allowinput="true" isshowonlist="1" datasourcetype="url" fldorder="2" enfield="DDJSGH" cnfield="带队教师工号" adaptive="true" multiselect="false" style="width: 100%;" showclearbutton="false" allowlimitvalue="false" maxlength="200" data-options="{"emptytext":""}" type="mini-textbox" ziti="MicrosoftYaHei" zihao="fourteen" emptytext="" linkageurl="/queryservice/query.htm?snumber=CXZDJSXX&ZDJSGH=INPUTVALUE" datasourceurl="" relatefield_1="cnfield=指导教师姓名;enfield=JSXM;datatype=value;icon=;key=ZDJSXM;" relatefield_2="cnfield=联系电话;enfield=LXDH;datatype=value;icon=;key=LXDH;" relatefield_3="cnfield=专业负责人;enfield=ZYFZR;datatype=data;icon=;key=;"/><br/> </td> </tr> <tr> <td style="border-color: rgb(38, 38, 38); word-break: break-all;" width="125.33333333333333" valign="middle" align="center"> 所在单位 </td> <td style="border-color: rgb(38, 38, 38);" width="140.33333333333334" valign="middle" align="center"> <input class="mini-textbox" choosevalue="other" required="true" fieldtype="ordinary" allowinput="true" isshowonlist="1" datasourcetype="url" fldorder="4" enfield="SZDW" cnfield="所在单位" adaptive="true" multiselect="false" style="width: 100%;" showclearbutton="false" allowlimitvalue="false" maxlength="200" data-options="{"emptytext":""}" type="mini-textbox" ziti="MicrosoftYaHei" zihao="fourteen" emptytext="" datasourceurl="/queryservice/query.htm?snumber=CXBMMC&HUMANCODE=STARTID" urlkey="DWMC"/><br/> </td> <td style="border-color: rgb(38, 38, 38); word-break: break-all;" width="102.33333333333333" valign="middle" align="center"> 联系电话 </td> <td style="border-color: rgb(38, 38, 38);" width="137.33333333333334" valign="middle" align="center"> <input class="mini-textbox" choosevalue="CURRENTUSERMOBILETEL" required="true" fieldtype="ordinary" allowinput="true" isshowonlist="1" datasourcetype="url" fldorder="5" enfield="LXDH" cnfield="联系电话" adaptive="true" multiselect="false" style="width: 100%;" showclearbutton="false" allowlimitvalue="false" maxlength="200" data-options="{"emptytext":""}" type="mini-textbox" ziti="MicrosoftYaHei" zihao="fourteen" emptytext=""/><br/> </td> </tr> <tr> <td style="border-color: rgb(38, 38, 38); word-break: break-all;" width="125.33333333333333" valign="middle" align="center"> 参加人数 </td> <td style="border-color: rgb(38, 38, 38); word-break: break-all;" valign="middle" align="center" rowspan="1" colspan="3"> <input class="mini-textbox" choosevalue="other" required="true" fieldtype="ordinary" allowinput="true" isshowonlist="1" datasourcetype="url" fldorder="6" enfield="RS" cnfield="参加人数" adaptive="false" multiselect="false" showclearbutton="false" allowlimitvalue="false" maxlength="200" style="width:60%;" type="mini-textbox" ziti="MicrosoftYaHei" zihao="fourteen" data-options="{"vtype":"int","textAlign":"center"}" vtype="int" inputstyle="text-align:center;"/>人<br/> </td> </tr> <tr> <td style="border-color: rgb(38, 38, 38); word-break: break-all;" rowspan="1" colspan="4" valign="middle" height="27" align="center" width="98.00000000000004"> <strong>实习学生信息</strong><br/> </td> </tr> <tr> <td style="border-color: rgb(38, 38, 38); word-break: break-all;" rowspan="1" colspan="4" valign="middle" height="27" align="center" width="98.00000000000004"> <img src="../../resources/images/flow/datagrid.png" datagrid_style="width: 100%; height: 200px;" datagrid_class="mini-datagrid" datagrid_idfield="id" datagrid_showpager="false" datagrid_fldorder="7" datagrid_cnfield="实习学生名单" datagrid_enfield="SXXSMD" showaddbtn="true" showdelbtn="true" showinbtn="true" showupbtn="true" showdownbtn="true" maxgridrows="500" loadcontext="true" shownumber="false" adaptive="true" datagridfield_1="class=mini-textbox;field=XH;name=负责人学号;required=true;align=left;allowinput=true;allowsort=true;maxLength=200;emptytext=;stylewidth=80;stylewidthtype=%;linkageurl=%2Fqueryservice%2Fquery.htm%3Fsnumber%3DCXXMZYBJ%26user_id%3DINPUTVALUE;reactionData=%5B%7B%22datatype%22%3A%22value%22%2C%22_id%22%3A1%2C%22_uid%22%3A1%2C%22_state%22%3A%22added%22%2C%22enfield%22%3A%22XM%22%2C%22cnfield%22%3A%22%E8%B4%9F%E8%B4%A3%E4%BA%BA%E5%A7%93%E5%90%8D%22%2C%22key%22%3A%22XM%22%7D%2C%7B%22datatype%22%3A%22value%22%2C%22_id%22%3A2%2C%22_uid%22%3A2%2C%22_state%22%3A%22added%22%2C%22enfield%22%3A%22BJ%22%2C%22cnfield%22%3A%22%E5%AE%9E%E4%B9%A0%E7%8F%AD%E7%BA%A7%22%2C%22key%22%3A%22BJMC%22%7D%2C%7B%22datatype%22%3A%22value%22%2C%22_id%22%3A3%2C%22_uid%22%3A3%2C%22_state%22%3A%22added%22%2C%22enfield%22%3A%22HTDE4690%22%2C%22cnfield%22%3A%22%E8%B4%9F%E8%B4%A3%E4%BA%BA%E7%94%B5%E8%AF%9D%22%2C%22key%22%3A%22SJH%22%7D%5D;vtype=undefined;choosevalue=other;" stylewidth="80" stylewidthtype="%" fieldname_1="负责人学号" datagridfield_2="class=mini-textbox;field=XM;name=负责人姓名;required=false;align=left;allowinput=true;allowsort=true;maxLength=200;emptytext=;stylewidth=80;stylewidthtype=%;linkageurl=;reactionData=%5B%5D;vtype=undefined;choosevalue=other;" fieldname_2="负责人姓名" required="true" fieldname_3="专业" datagridfield_4="class=mini-textbox;field=BJ;name=实习班级;required=false;align=left;allowinput=true;allowsort=true;maxLength=200;emptytext=;stylewidth=80;stylewidthtype=%;linkageurl=;reactionData=%5B%5D;vtype=undefined;choosevalue=other;" fieldname_4="实习班级" name="未定义列" field="HT44EB6B" data="[{"id":"是","text":"是","_id":1,"_uid":1,"_state":"modified"},{"id":"否","text":"否","_id":2,"_uid":2,"_state":"modified"}]" fieldname_5="负责人电话" fieldname_6="是否离校" fieldname_7="实习单位名称" fieldname_8="实习单位地址(省市县区)" fieldname_9="实习开始时间" fieldname_10="实习结束时间" fieldname_11="备注" data-options="{"shownumber":"false","mingridrows":1,"showinbtn":"true","showupbtn":"true","showdownbtn":"true"}" mingridrows="1" type="mini-datagrid" datagridfield_5="class=mini-textbox;field=HTDE4690;name=负责人电话;required=true;align=left;allowinput=true;allowsort=true;maxLength=200;emptytext=;stylewidth=80;stylewidthtype=%;linkageurl=;reactionData=%5B%5D;vtype=undefined;choosevalue=other;" relatefield_1="cnfield=负责人姓名;enfield=XM;datatype=value;icon=;key=XM;" relatefield_2="cnfield=实习班级;enfield=BJ;datatype=value;icon=;key=BJMC;" relatefield_3="cnfield=负责人电话;enfield=HTDE4690;datatype=value;icon=;key=SJH;"/><br/> </td> </tr> <tr> <td valign="middle" align="center" colspan="1" rowspan="1" height="27" style="border-color: rgb(38, 38, 38); word-break: break-all;"> 实习课程号 </td> <td valign="middle" align="center" colspan="1" rowspan="1" height="27" style="border-color: rgb(38, 38, 38);"></td> <td valign="middle" align="center" colspan="1" rowspan="1" height="27" style="border-color: rgb(38, 38, 38); word-break: break-all;"> 实习课程名 </td> <td valign="middle" align="center" colspan="1" rowspan="1" height="27" style="border-color: rgb(38, 38, 38);"></td> </tr> <tr> <td valign="middle" align="center" colspan="1" rowspan="1" height="27" style="border-color: rgb(38, 38, 38); word-break: break-all;"> 离校时间 </td> <td valign="middle" align="center" colspan="1" rowspan="1" height="27" style="border-color: rgb(38, 38, 38);"> <input class="mini-datepicker" choosevalue="other" required="true" fieldtype="ordinary" allowinput="true" isshowonlist="1" datasourcetype="url" fldorder="8" enfield="LXSJ" cnfield="离校时间" adaptive="true" multiselect="false" showclearbutton="false" allowlimitvalue="false" style="width: 100%;" showtime="false" tagtype="mini-datepicker" datetimetype="mini-datepicker" mindate="" maxdate="" data-options="{"minDate":"","maxDate":"","showStyle":"rung","dateScope":"false","manyDateScope":"false","nowDateAfter":"false","dateFixedScope":"false","workDate":"false"}" showsignaturedateformat="rung" type="mini-datepicker" ziti="MicrosoftYaHei" zihao="fourteen"/><br/> </td> <td valign="middle" align="center" colspan="1" rowspan="1" height="27" style="border-color: rgb(38, 38, 38); word-break: break-all;"> 返校时间 </td> <td valign="middle" align="center" colspan="1" rowspan="1" height="27" style="border-color: rgb(38, 38, 38);"> <input class="mini-datepicker" choosevalue="other" required="true" fieldtype="ordinary" allowinput="true" isshowonlist="1" datasourcetype="url" fldorder="9" enfield="FXSJ" cnfield="返校时间" adaptive="true" multiselect="false" showclearbutton="false" allowlimitvalue="false" style="width: 100%;" showtime="false" tagtype="mini-datepicker" datetimetype="mini-datepicker" mindate="" maxdate="" data-options="{"minDate":"","maxDate":"","showStyle":"rung","dateScope":"false","manyDateScope":"false","nowDateAfter":"false","dateFixedScope":"false","workDate":"false"}" showsignaturedateformat="rung" datescope="false" type="mini-datepicker" ziti="MicrosoftYaHei" zihao="fourteen"/><br/> </td> </tr> <tr> <td valign="middle" align="center" colspan="1" rowspan="1" height="27" style="border-color: rgb(38, 38, 38); word-break: break-all;"> 实习地点 </td> <td valign="middle" align="center" colspan="3" rowspan="1" height="27" style="border-color: rgb(38, 38, 38);"> <input class="mini-textarea" choosevalue="other" required="true" fieldtype="ordinary" allowinput="true" isshowonlist="1" datasourcetype="url" fldorder="10" enfield="DD" cnfield="实习地点" adaptive="true" multiselect="false" showclearbutton="false" allowlimitvalue="false" style="width: 100%; height: 100%;" maxlength="200" type="mini-textarea" ziti="MicrosoftYaHei" zihao="fourteen"/><br/> </td> </tr> <tr> <td valign="middle" align="center" colspan="1" rowspan="1" height="27" style="border-color: rgb(38, 38, 38); word-break: break-all;"> 外出管理措施 </td> <td valign="middle" align="center" colspan="3" rowspan="1" height="27" style="border-color: rgb(38, 38, 38); word-break: break-all;"> <input class="mini-textarea" choosevalue="other" required="true" fieldtype="ordinary" allowinput="true" isshowonlist="1" datasourcetype="url" fldorder="11" enfield="WCGLCS" cnfield="外出管理措施" adaptive="true" multiselect="false" showclearbutton="false" allowlimitvalue="false" style="width: 100%; height: 100%;" maxlength="200" type="mini-textarea" ziti="MicrosoftYaHei" zihao="fourteen"/><br/> </td> </tr> <tr> <td style="border-color: rgb(38, 38, 38); word-break: break-all;" width="125.33333333333333" valign="middle" height="27" align="center"> 辅导员 </td> <td style="border-color: rgb(38, 38, 38); word-break: break-all;" valign="middle" height="27" align="center" rowspan="1" colspan="3" width="445.3333333333333"> <input class="mini-textbox" choosevalue="other" required="true" fieldtype="ordinary" allowinput="true" isshowonlist="1" datasourcetype="url" fldorder="12" enfield="FDYXM" cnfield="辅导员" adaptive="true" multiselect="false" style="width: 100%;" showclearbutton="false" allowlimitvalue="false" maxlength="200" data-options="{"id":"FDYXM","type":"COUNTDAY"}" type="mini-textbox" ziti="MicrosoftYaHei" zihao="fourteen"/><br/> </td> </tr> </tbody> </table> <input class="mini-textbox" choosevalue="other" required="true" fieldtype="ordinary" allowinput="true" isshowonlist="0" datasourcetype="url" fldorder="13" enfield="FDYGH" cnfield="辅导员审批" adaptive="false" multiselect="false" showclearbutton="false" allowlimitvalue="false" maxlength="200" data-options="{"id":"FDYGH","type":"COUNTDAY"}" style="width:40%;" type="mini-textbox" ziti="MicrosoftYaHei" zihao="fourteen"/> <p style="margin-bottom: 25px; text-align: left;"> <img class="flow-javascript" src="../../style/flow/img/javascript.png" choosevalue="other" enfield="HTA261E6" cnfield="脚本控件" style="width: 18px; height: 18px; display: block;" method="var datagrid = mini.get('SXXSMD'); //多行表单英文名称 SXXSMD datagrid.on('cellendedit',function(e){ if(e.field == 'XH'){ //多行表单学号 if(e.row.XH){ var row = e.row; $.ajax({ //通用查询地址+根据哪个控件值 url:'${basePath}queryservice/query.htm?snumber=CXXMZYBJ&user_id='+row.XH, dataType:'json', async:false, success:function(text){ if (Array.isArray(text)) { row.XM = text[0].XM; //row.ZY = text[0].XYMC; row.BJ = text[0].BJMC; datagrid.commitEditRow ( row ); var bj = row.BJ; setFdy(bj) } }, }); } } }); datagrid.on('preload',function(e){ debugger; console.log(e.sender.data); var data = e.sender.data; for(var i=0;i<data.length;i++){ var row = data[i]; var row = e.row; $.ajax({ //通用查询地址+根据哪个控件值 url:'${basePath}queryservice/query.htm?snumber=CXXMZYBJ&user_id='+row.XH, dataType:'json', async:false, success:function(text){ if (Array.isArray(text)) { row.XM = text[0].XM; //row.ZY = text[0].XYMC; row.BJ = text[0].BJMC; datagrid.commitEditRow(row); var bj = row.BJ; setFdy(bj); } }, }); } }); function setFdy(bj){ var fdy_ids = mini.get("FDYGH").getValue(); var fdy_names = mini.get("FDYXM").getValue(); var fdy_id_arr = fdy_ids.split(","); var fdy_name_arr = fdy_names.split(","); if(bj){ $.ajax({ methods: 'GET', dataType:'json', async:false, url: "${basePath}queryservice/query.htm?snumber=CXFDY&orgname=" + bj, success: function (res) { if(res){ for(var i=0;i<res.length;i++){ var fdy_obj = res[i]; var fdy_id = fdy_obj.HUMANCODE; var fdy_name = fdy_obj.HUMANNAME; fdy_id_arr.push(fdy_id); fdy_name_arr.push(fdy_name); } let fyd_id_set = [...new Set(fdy_id_arr)]; fdy_ids = [...fyd_id_set].join(','); let fyd_name_set = [...new Set(fdy_name_arr)]; fdy_names = [...fyd_name_set].join(','); } if(fdy_names.indexOf(",")==0 ){ fdy_names = fdy_names.substring(1, fdy_names.length); } if(fdy_ids.indexOf(",")==0 ){ fdy_ids = fdy_ids.substring(1, fdy_ids.length); } mini.get("FDYGH").setValue(fdy_ids); mini.get("FDYXM").setValue(fdy_names); }, error: function (err) { reject(err) } }) } } $('#delbar_SXXSMD').click(function () { debugger; var data = datagrid.getData(); if(data.length >0){ mini.get("FDYGH").setValue(""); mini.get("FDYXM").setValue(""); for(var i=0;i<data.length;i++){ var row = data[i]; var bj = row.BJ; setFdy(bj); } }else{ mini.get("FDYGH").setValue(""); mini.get("FDYXM").setValue(""); } });"/> </p> </div>
JS:
var datagrid = mini.get('SXXSMD'); //多行表单英文名称 SXXSMD datagrid.on('cellendedit',function(e){ if(e.field == 'XH'){ //多行表单学号 if(e.row.XH){ var row = e.row; $.ajax({ //通用查询地址+根据哪个控件值 url:'${basePath}queryservice/query.htm?snumber=CXXMZYBJ&user_id='+row.XH, dataType:'json', async:false, success:function(text){ if (Array.isArray(text)) { row.XM = text[0].XM; //row.ZY = text[0].XYMC; row.BJ = text[0].BJMC; datagrid.commitEditRow ( row ); var bj = row.BJ; setFdy(bj) } }, }); } } }); datagrid.on('preload',function(e){ debugger; console.log(e.sender.data); var data = e.sender.data; for(var i=0;i<data.length;i++){ var row = data[i]; var row = e.row; $.ajax({ //通用查询地址+根据哪个控件值 url:'${basePath}queryservice/query.htm?snumber=CXXMZYBJ&user_id='+row.XH, dataType:'json', async:false, success:function(text){ if (Array.isArray(text)) { row.XM = text[0].XM; //row.ZY = text[0].XYMC; row.BJ = text[0].BJMC; datagrid.commitEditRow(row); var bj = row.BJ; setFdy(bj); } }, }); } }); function setFdy(bj){ var fdy_ids = mini.get("FDYGH").getValue(); var fdy_names = mini.get("FDYXM").getValue(); var fdy_id_arr = fdy_ids.split(","); var fdy_name_arr = fdy_names.split(","); if(bj){ $.ajax({ methods: 'GET', dataType:'json', async:false, url: "${basePath}queryservice/query.htm?snumber=CXFDY&orgname=" + bj, success: function (res) { if(res){ for(var i=0;i<res.length;i++){ var fdy_obj = res[i]; var fdy_id = fdy_obj.HUMANCODE; var fdy_name = fdy_obj.HUMANNAME; fdy_id_arr.push(fdy_id); fdy_name_arr.push(fdy_name); } let fyd_id_set = [...new Set(fdy_id_arr)]; fdy_ids = [...fyd_id_set].join(','); let fyd_name_set = [...new Set(fdy_name_arr)]; fdy_names = [...fyd_name_set].join(','); } if(fdy_names.indexOf(",")==0 ){ fdy_names = fdy_names.substring(1, fdy_names.length); } if(fdy_ids.indexOf(",")==0 ){ fdy_ids = fdy_ids.substring(1, fdy_ids.length); } mini.get("FDYGH").setValue(fdy_ids); mini.get("FDYXM").setValue(fdy_names); }, error: function (err) { reject(err) } }) } } $('#delbar_SXXSMD').click(function () { debugger; var data = datagrid.getData(); if(data.length >0){ mini.get("FDYGH").setValue(""); mini.get("FDYXM").setValue(""); for(var i=0;i<data.length;i++){ var row = data[i]; var bj = row.BJ; setFdy(bj); } }else{ mini.get("FDYGH").setValue(""); mini.get("FDYXM").setValue(""); } });
通用查询:
CXXMZYBJ:
select a.humanname as XM,e.xh, e.xymc,e.zymc,e.bjmc,a.telmobile1 as SJH from ht_sys_user a,( select a.orgname as XYMC ,c.ZYMC AS ZYMC,c.BJMC AS BJMC ,c.user_id as XH from HT_SYS_ORGANIZATION a,( select a.orgname as ZYMC,b.orgname as BJMC ,a.parent ,b.user_id from HT_SYS_ORGANIZATION a , (select a.orgname,a.parent,b.user_id from HT_SYS_ORGANIZATION a,HT_SYS_ORGANIZATION_USER b where a.id =b.organization_id and b.user_id='${user_id}') b where a.id = b.parent) c where a.id =c.parent) e where a.id =e.xh
截图:
标签:MINIUI,滨州,user,JS,实习,nbsp,var,id,row From: https://www.cnblogs.com/xiaoweihongyan/p/17532625.html