rock_flow_whereedit.php 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. <?php if(!defined('HOST'))die('not access');?>
  2. <script >
  3. $(document).ready(function(){
  4. {params};
  5. var id = params.id;
  6. if(!id)id = 0;
  7. var h = $.bootsform({
  8. window:false,rand:'{rand}',tablename:'flow_where',url:publicsave('{mode}','{dir}'),
  9. submitfields:'setid,name,wheresstr,whereustr,wheredstr,pnum,explain,recename,status,islb,receid,nrecename,nreceid,num,sort',requiredfields:'name',beforesaveaction:'flowwheresave_before',
  10. success:function(){
  11. if(id>0){
  12. closenowtabs();
  13. }else{
  14. js.msg('success','新增成功,继续保存可持续新增');
  15. }
  16. try{guanflowwherelist.reload();}catch(e){}
  17. },
  18. loadafter:function(a){
  19. if(a.data){
  20. h.form.wheresstr.value=jm.base64decode(a.data.wheresstr);
  21. h.form.whereustr.value=jm.base64decode(a.data.whereustr);
  22. h.form.wheredstr.value=jm.base64decode(a.data.wheredstr);
  23. }
  24. },
  25. submitcheck:function(d){
  26. if(d.islb==1&&d.num=='')return '请设置一个编号';
  27. return {
  28. wheresstr:jm.base64encode(d.wheresstr),
  29. whereustr:jm.base64encode(d.whereustr),
  30. wheredstr:jm.base64encode(d.wheredstr)
  31. };
  32. }
  33. });
  34. h.forminit();
  35. h.load(js.getajaxurl('loaddatawhere','{mode}','{dir}',{id:id,setid:params.setid}));
  36. var c = {
  37. setwhere:function(){
  38. js.setwhere(params.setid,'backsheowe{rand}');
  39. },
  40. clears:function(o1,lx){
  41. if(lx==1){
  42. h.setValue('recename','');
  43. h.setValue('receid','');
  44. }
  45. if(lx==2){
  46. h.setValue('nrecename','');
  47. h.setValue('nreceid','');
  48. }
  49. },
  50. getdist:function(o1, lx){
  51. var cans = {
  52. nameobj:h.form.recename,
  53. idobj:h.form.receid,
  54. type:'deptusercheck',
  55. title:'选择包含人员'
  56. };
  57. if(lx==2){
  58. var cans = {
  59. nameobj:h.form.nrecename,
  60. idobj:h.form.nreceid,
  61. type:'deptusercheck',
  62. title:'选择除外人员'
  63. };
  64. }
  65. cans.value=cans.idobj.value,
  66. js.getuser(cans);
  67. },
  68. setdab:function(ov,lx){
  69. var a = ['{read}','{unread}','{weekfirst}'];
  70. this.addwhewe(a[lx]);
  71. },
  72. addwhewe:function(ss){
  73. if(!ss)return;
  74. var o1 = h.form.wheresstr;
  75. if(ss=='uid'){o1.value='`uid`={uid}';return;}
  76. if(ss=='optid'){o1.value='`optid`={uid}';return;}
  77. if(o1.value!='')ss='and '+ss+'';
  78. o1.value+=' '+ss;
  79. },
  80. changessvs:function(ss){
  81. if(!ss)return;
  82. var fid = get('weherecss{rand}').value;
  83. if(fid==''){js.msg('msg','没有输入字段');return;}
  84. ss = ss.replace('uid', fid);
  85. c.addwhewe(ss);
  86. }
  87. };
  88. js.initbtn(c);
  89. if(id==0)h.form.setid.value=params.setid;
  90. backsheowe{rand}=function(s1,s2){
  91. h.setValue('wheresstr',s1);
  92. h.setValue('explain',s2);
  93. }
  94. $('#weherecs{rand}').change(function(){
  95. c.changessvs(this.value);
  96. });
  97. });
  98. </script>
  99. <div align="center">
  100. <div style="padding:10px;width:700px">
  101. <form name="form_{rand}">
  102. <input name="id" value="0" type="hidden" />
  103. <input name="setid" value="0" type="hidden" />
  104. <table cellspacing="0" border="0" width="100%" align="center" cellpadding="0">
  105. <tr>
  106. <td align="right" width="25%"><font color=red>*</font> 名称:</td>
  107. <td class="tdinput" width="25%"><input name="name" class="form-control"></td>
  108. <td align="right" width="15%">编号:</td>
  109. <td class="tdinput" width="30%"><input name="num" maxlength="30" class="form-control"></td>
  110. </tr>
  111. <tr>
  112. <td align="right" ></td>
  113. <td class="tdinput" ></td>
  114. <td align="right" >分组编号:</td>
  115. <td class="tdinput"><input name="pnum" maxlength="30" class="form-control"></td>
  116. </tr>
  117. <tr>
  118. <td align="right" >主表字段条件:</td>
  119. <td class="tdinput" colspan="3"><textarea name="wheresstr" style="height:60px" class="form-control"></textarea><div class="tishi" style="padding-top:0px">对应主表上字段条件,字段必须用``包含,如:`uid`={uid},<a click="setwhere" href="javascript:;">[设置条件]</a><br>字段:<input style="width:60px" id="weherecss{rand}" class="input" value="uid">中<select class="input" id="weherecs{rand}"><option value="">-选择条件-</option><option value="uid">我申请的uid</option><option value="optid">我操作的optid</option><option value="{uid,uidin}">包含当前用户</option><option value="{uid,down}">直属下级</option><option value="{uid,downall}">全部直属下级</option><option value="{uid,dept}">同级部门人员</option><option value="{uid,deptall}">同级部门人员(含子部门)</option><option value="{receid}">receid字段包含当前用户</option><option value="{read}">已读记录</option><option value="{unread}">未读记录</option><option value="{uid,receall}">字段中用户部门包含当前用户(含为空时)</option><option value="{uid,recenot}">字段中用户部门包含当前用户</option><option value="{uid,company}">所属单位</option></select><br>用{}的变量会在文件webmain/model/whereModel.php中的getstrwhere方法替换可自己查看。<a href="<?=URLY?>view_flowwhere.html" target="_blank">[看帮助介绍]</a></div></td>
  120. </tr>
  121. <tr>
  122. <td align="right" >数据上人员包含条件:</td>
  123. <td class="tdinput" colspan="3">
  124. <div style="width:100%" class="input-group">
  125. <input readonly class="form-control" name="recename" >
  126. <input type="hidden" name="receid" >
  127. <span class="input-group-btn">
  128. <button class="btn btn-default" click="clears,1" type="button"><i class="icon-remove"></i></button>
  129. <button class="btn btn-default" click="getdist,1" type="button"><i class="icon-search"></i></button>
  130. </span>
  131. </div>
  132. <textarea name="whereustr" style="height:40px" class="form-control"></textarea><div class="tishi" style="padding-top:0px">不选默认全部人员</div>
  133. </td>
  134. </tr>
  135. <tr>
  136. <td align="right" >除了这些人员外:</td>
  137. <td class="tdinput" colspan="3">
  138. <div style="width:100%" class="input-group">
  139. <input readonly class="form-control" name="nrecename" >
  140. <input type="hidden" name="nreceid" >
  141. <span class="input-group-btn">
  142. <button class="btn btn-default" click="clears,2" type="button"><i class="icon-remove"></i></button>
  143. <button class="btn btn-default" click="getdist,2" type="button"><i class="icon-search"></i></button>
  144. </span>
  145. </div>
  146. <textarea name="wheredstr" style="height:40px" class="form-control"></textarea></div>
  147. </td>
  148. </tr>
  149. <tr>
  150. <td align="right" >说明:</td>
  151. <td class="tdinput" colspan="3"><textarea name="explain" style="height:60px" class="form-control"></textarea></td>
  152. </tr>
  153. <tr>
  154. <td align="right">排序号:</td>
  155. <td class="tdinput"><input name="sort" value="0" maxlength="3" type="number" onfocus="js.focusval=this.value" onblur="js.number(this)" class="form-control"></td>
  156. </tr>
  157. <tr>
  158. <td align="right" ></td>
  159. <td class="tdinput" colspan="3">
  160. <label><input name="status" value="1" checked type="checkbox"> 启用?</label>&nbsp; &nbsp;
  161. <label><input name="islb" value="0" type="checkbox"> 列表页显示</label>&nbsp; &nbsp;
  162. <label><input name="yuanwhere" value="1" checked type="checkbox"> 验证条件</label>
  163. </td>
  164. </tr>
  165. <tr>
  166. <td align="right"></td>
  167. <td style="padding:15px 0px" colspan="3" align="left"><button disabled class="btn btn-success" id="save_{rand}" type="button"><i class="icon-save"></i>&nbsp;保存</button>&nbsp; <span id="msgview_{rand}"></span>
  168. </td>
  169. </tr>
  170. </table>
  171. </form>
  172. <div align="left" class="tishi">也可根据编号从程序代码上自定义返回条件,文件:webmain\model\flow下对应模块编号文件</div>
  173. </div>
  174. </div>
粤ICP备19079148号