projectServiceSelectedList.jsp 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2. <%@include file="/context/mytags.jsp"%>
  3. <t:base type="jquery,easyui,tools,DatePicker"></t:base>
  4. <div id="main_service_list" class="easyui-layout" fit="true">
  5. <div region="center" style="padding:0px;border:0px">
  6. <t:datagrid name="projectServiceList" checkbox="${param.checkbox?param.checkbox:false}" pageSize="20" pagination="true" fitColumns="true" title="项目外包服务"
  7. actionUrl="projectServiceController.do?datagrid&projectid=${projectid }&servicetypedetail=${param.servicetypedetail}&id=${param.projectServiceId}"
  8. idField="id" fit="true" queryMode="group">
  9. <t:dgCol title="主键" field="id" hidden="true" queryMode="single" width="120"></t:dgCol>
  10. <t:dgCol title="项目" field="projectid" hidden="true" queryMode="single" width="120"></t:dgCol>
  11. <t:dgCol title="项目" field="projectName" queryMode="single" width="120"></t:dgCol>
  12. <t:dgCol title="服务类型" field="servicetypedetail" hidden="true" queryMode="single" width="120"></t:dgCol>
  13. <t:dgCol title="服务编码" field="code" queryMode="single" width="120"></t:dgCol>
  14. <t:dgCol title="服务名称" field="name" queryMode="single" width="120"></t:dgCol>
  15. <%-- <t:dgCol title="操作" field="opt"></t:dgCol>
  16. <t:dgFunOpt funname="showDeviceList(id,projectid)" title="查看设备" urlclass="ace_button" urlfont="fa-user"></t:dgFunOpt> --%>
  17. <t:dgToolBar title="服务列表&nbsp&nbsp&nbsp&nbsp" funname="none" width="100%" height="100%"></t:dgToolBar>
  18. </t:datagrid>
  19. </div>
  20. </div>
  21. <script src = "webpage/cn/com/lzt/projectservice/projectServiceList.js"></script>
  22. <script type="text/javascript">
  23. $(function() {
  24. var datagrid = $("#projectServiceListtb");
  25. datagrid.prepend($("#pinjie1 div[name='pinjie2']").html());
  26. $("#pinjie1").html('');
  27. datagrid.children(".datagrid-toolbar").children("span:first").after($("#pinjiechaxun1 div[name='pinjiechaxun2']").html());
  28. $("#pinjiechaxun1").html('');
  29. });
  30. </script>
  31. <c:set var="hiddenProjectSearch">${empty param.hiddenProjectSearch?false:true}</c:set>
  32. <div id="pinjie1">
  33. <div name="pinjie2" style="padding:3px; height: auto" class="datagrid-toolbar">
  34. <div name="searchColums" style="margin:23px 0 18px 0;margin-top: 15px;margin-bottom: 8px;">
  35. <%-- <input type="hidden" id="orgCode" name="orgCode" value="${orgCode}"> --%>
  36. <table style="padding:0px" cellpadding="0" cellspacing="1" >
  37. <tbody>
  38. <tr>
  39. <c:if test="${!hiddenProjectSearch}">
  40. <td align="right" style="width: 74px;">
  41. <label class="Validform_label">
  42. 项目名称:
  43. </label>
  44. </td>
  45. <td class="value" colspan="3">
  46. <input readonly="true" type="text" id="projectName" name="projectName" style="width: 157px" placeholder="请选择项目名称" onclick="openDepartmentSelect()">
  47. <input id="projectid" name="projectid" type="hidden" value="">
  48. <a href="#" class="easyui-linkbutton" plain="true" icon="icon-select" id="departSearch" onclick="openDepartmentSelect()">选择</a>
  49. <a href="#" class="easyui-linkbutton" plain="true" icon="icon-clean" id="departRedo" onclick="callbackClean()">清空</a>
  50. </td>
  51. </c:if>
  52. <td align="right" style="width: 74px;">
  53. <label class="Validform_label">
  54. 服务编码:
  55. </label>
  56. </td>
  57. <td class="value">
  58. <input id="code" name="code" type="text" style="width: 157px; " class="inputxt" placeholder="服务编码">
  59. </td>
  60. <td align="right" style="width: 74px;">
  61. <label class="Validform_label">
  62. 服务名称:
  63. </label>
  64. </td>
  65. <td class="value">
  66. <input id="name" name="name" type="text" style="width: 157px; " class="inputxt" placeholder="服务名称">
  67. </td>
  68. </tr>
  69. </tbody>
  70. </table>
  71. </div>
  72. </div>
  73. </div>
  74. <div id="pinjiechaxun1">
  75. <div name="pinjiechaxun2" style="padding:3px; height: auto" class="datagrid-toolbar">
  76. <span style="float:right;margin-bottom:4px;">
  77. <span>
  78. <a href="#" class="easyui-linkbutton" plain="true" icon="icon-search" id="projectServiceListSearch" onclick="projectServiceListsearch()">查询</a>
  79. </span>
  80. <span>
  81. <a href="#" class="easyui-linkbutton" plain="true" icon="icon-reload " id="projectServiceListRedo" onclick="searchReset('projectServiceList')">重置</a>
  82. </span>
  83. </div>
  84. </div>
  85. <%-- function showDeviceList(id,pid){
  86. var title = '设备明细';
  87. if(li_east == 0 || $('#main_service_list').layout('panel','east').panel('options').title != title){
  88. $('#main_service_list').layout('expand','east');
  89. }
  90. $('#eastPanel').panel('setTitle','<t:mutiLang langKey="member.list"/>');
  91. $('#main_service_list').layout('panel','east').panel('setTitle', title);
  92. $('#main_service_list').layout('panel','east').panel('resize', {width: 300});
  93. $('#deviceListpanel').panel("refresh", "projectServiceDeviceController.do?list&serviceid=" + id+"&projectid="+pid);
  94. } --%>
  95. <script type="text/javascript">
  96. function initCheck(data){
  97. var ids = "${ids}";
  98. var idArr = ids.split(",");
  99. for(var i=0;i<idArr.length;i++){
  100. if(idArr[i]!=""){
  101. $("#projectServiceList").datagrid("selectRecord",idArr[i]);
  102. }
  103. }
  104. }
  105. //编写自定义JS代码获得输入框中的值等父级页面调用取值
  106. function getReason(){
  107. var strId="";
  108. var strName="";
  109. var servicetypedetail = "";
  110. var selectRows = $("#projectServiceList").datagrid('getSelections');
  111. for(var i=0;i<selectRows.length;i++){
  112. for(var key in selectRows[i]){
  113. //console.log(key+"======="+selectRows[i][key]);
  114. if(key=="id"){
  115. if(strId.length>0){
  116. strId+=","+selectRows[i][key];
  117. }else{
  118. strId=selectRows[i][key];
  119. }
  120. }
  121. if(key=="name"){
  122. if(strName.length>0){
  123. strName+=","+selectRows[i][key];
  124. }else{
  125. strName=selectRows[i][key];
  126. }
  127. }
  128. if(key=="servicetypedetail"){
  129. if(servicetypedetail.length>0){
  130. servicetypedetail+=","+selectRows[i][key];
  131. }else{
  132. servicetypedetail=selectRows[i][key];
  133. }
  134. }
  135. }
  136. }
  137. //var strData='[{"strShiftid":"'+strShiftid+'","strShiftName":"'+strShiftName+'","strShiftType":"'+strShiftType+'"}]';
  138. var strData='[{"strId":"'+strId+'","strName":"'+strName+'","servicetypedetail":"'+servicetypedetail+'"}]';
  139. return strData;
  140. }
  141. //选择项目名称,列表================
  142. function openDepartmentSelect() {
  143. //$.dialog.setting.zIndex = getzIndex();
  144. var orgIds = $("#projectid").val();
  145. /* var orgCode = $("#orgCode").val();*/
  146. $.dialog({
  147. content: 'url:userWageController.do?projectDepartTableAll&ids='+orgIds, zIndex: getzIndex(), title: '项目名称列表', lock: true, width: '600px', height: '350px', opacity: 0.4, button: [
  148. {name: '<t:mutiLang langKey="common.confirm"/>', callback: function (){
  149. var iframe = this.iframe.contentWindow;
  150. if(iframe.getReason().length>0){
  151. var strData=eval(iframe.getReason());
  152. for(var key in strData[0]){
  153. if(key=="strPId"){
  154. $("#projectid").val(strData[0][key]);
  155. }else if(key=="strDepartName"){
  156. $("#projectName").val(strData[0][key]);
  157. }
  158. }
  159. }
  160. }, focus: true},
  161. {name: '<t:mutiLang langKey="common.cancel"/>', callback: function (){}}
  162. ]}).zindex();
  163. }
  164. function callbackClean(){
  165. $('#projectName').val('');
  166. $('#projectid').val('');
  167. }
  168. function none(){}
  169. function getSelectedRow(){
  170. var selectRows = $("#projectServiceList").datagrid('getSelections');
  171. return selectRows;
  172. }
  173. </script>