selectContractList.jsp 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2. <%@include file="/context/mytags.jsp"%>
  3. <!DOCTYPE html >
  4. <html>
  5. <head>
  6. <title>请选择合同</title>
  7. <t:base type="jquery,easyui,tools"></t:base>
  8. </head>
  9. <body style="overflow-y: hidden" scroll="no">
  10. <t:datagrid pagination="false" name="list" title="选择" actionUrl="contractController.do?selRefDatagridByUser&projectid=${param.projectid}" idField="id" checkbox="false" showRefresh="false" fit="true" queryMode="group" onLoadSuccess="initCheck();initSearch();">
  11. <t:dgCol title="主键" field="id" hidden="true" queryMode="single" width="120"></t:dgCol>
  12. <t:dgCol title="合同编码" field="code" queryMode="single" width="120"></t:dgCol>
  13. <t:dgCol title="合同名称" field="name" queryMode="single" width="200"></t:dgCol>
  14. <t:dgCol title="供应商" field="partnerid" query="false" queryMode="single" width="120" dictionary="t_b_related_units,id,unit_name"></t:dgCol>
  15. <c:if test="${not empty pid }">
  16. <t:dgCol title="项目" field="projectid" query="false" queryMode="single" width="120" dictionary="t_b_project,id,abbreviation ,order by CONVERT(abbreviation USING gbk) asc" defaultVal="${pid }"></t:dgCol>
  17. </c:if>
  18. <c:if test="${empty pid }">
  19. <t:dgCol title="项目" field="projectid" query="false" queryMode="single" width="120" dictionary="t_b_project,id,abbreviation ,order by CONVERT(abbreviation USING gbk) asc"></t:dgCol>
  20. </c:if>
  21. <t:dgCol title="签订日期" field="signdate" hidden="true" formatter="yyyy-MM-dd" queryMode="single" width="120"></t:dgCol>
  22. <t:dgCol title="合同描述" field="description" hidden="false" queryMode="single" width="240"></t:dgCol>
  23. <t:dgCol title="合同金额(元)" field="totalamount" formatterjs="formatterNum" hidden="false" queryMode="single" width="80"></t:dgCol>
  24. <t:dgCol title="累计开票金额(元)" field="totalinvoice" formatterjs="formatterNum" hidden="false" queryMode="single" width="80"></t:dgCol>
  25. <t:dgCol title="累计付款金额(元)" field="totalpayment" formatterjs="formatterNum" hidden="false" queryMode="single" width="80"></t:dgCol>
  26. <t:dgCol title="累计收款金额(元)" field="totalincome" formatterjs="formatterNum" hidden="true" queryMode="single" width="80"></t:dgCol>
  27. <t:dgCol title="服务开始日期" field="startdate" formatter="yyyy-MM-dd" queryMode="single" width="80"></t:dgCol>
  28. <t:dgCol title="服务截止日期" field="enddate" formatter="yyyy-MM-dd" queryMode="single" width="80"></t:dgCol>
  29. <t:dgCol title="审批日期" field="auditdate" hidden="true" formatter="yyyy-MM-dd hh:mm:ss" queryMode="single" width="80"></t:dgCol>
  30. <t:dgCol title="第三方单位" field="thirdpartner" query="false" hidden="true" queryMode="single" width="80"></t:dgCol>
  31. <t:dgToolBar title="合同清单:" icon="icon-detail" funname="temp" width="100%" height="100%"></t:dgToolBar>
  32. </t:datagrid>
  33. </body>
  34. </html>
  35. <div id="pinjie1">
  36. <div name="pinjie2" style="padding:3px; height: auto" class="datagrid-toolbar">
  37. <div name="searchColums" style="margin:23px 0 18px 0;margin-top: 15px;margin-bottom: 8px;">
  38. <%-- <input type="hidden" id="orgCode" name="orgCode" value="${orgCode}"> --%>
  39. <table style="padding:0px" cellpadding="0" cellspacing="1" >
  40. <tbody>
  41. <tr>
  42. <td align="right" style="width: 74px;">
  43. <label class="Validform_label">
  44. 项目名称:
  45. </label>
  46. </td>
  47. <td class="value" colspan="3">
  48. <input readonly="true" type="text" id="projectName" name="projectName" value="${pname}" style="width: 157px" placeholder="请选择项目名称" onclick="openDepartmentSelect()">
  49. <input id="projectid" name="projectid" type="hidden" value="${pid}">
  50. <a href="#" class="easyui-linkbutton" plain="true" icon="icon-select" id="departSearch" onclick="openDepartmentSelect()">选择</a>
  51. <a href="#" class="easyui-linkbutton" plain="true" icon="icon-clean" id="departRedo" onclick="callbackClean()">清空</a>
  52. </td>
  53. <td align="right" style="width: 74px;">
  54. <label class="Validform_label">
  55. 供应商:
  56. </label>
  57. </td>
  58. <td class="value" colspan="3">
  59. <input readonly="true" type="text" id="partnerName" name="partnerName" style="width: 157px" placeholder="请选择供应商" onclick="openPartnerSelect()">
  60. <input id="partnerid" name="partnerid" type="hidden" value="">
  61. <a href="#" class="easyui-linkbutton" plain="true" icon="icon-select" id="partnerSearch" onclick="openPartnerSelect()">选择</a>
  62. <a href="#" class="easyui-linkbutton" plain="true" icon="icon-clean" id="partnerRedo" onclick="callbackCleanPartner()">清空</a>
  63. </td>
  64. </tr>
  65. <tr height="50px">
  66. <td align="right" style="width: 74px;">
  67. <label class="Validform_label">
  68. 合同编码:
  69. </label>
  70. </td>
  71. <td class="value">
  72. <input id="code" name="code" type="text" style="width: 157px; " class="inputxt" placeholder="合同编码">
  73. </td>
  74. <td align="right" style="width: 74px;">
  75. <label class="Validform_label">
  76. 合同名称:
  77. </label>
  78. </td>
  79. <td class="value">
  80. <input id="name" name="name" type="text" style="width: 157px; " class="inputxt" placeholder="合同名称">
  81. </td>
  82. <td align="right" style="width: 74px;">
  83. <label class="Validform_label">
  84. 合同描述:
  85. </label>
  86. </td>
  87. <td class="value">
  88. <input id="description" name="description" type="text" style="width: 157px; " class="inputxt" placeholder="合同描述">
  89. </td>
  90. </tr>
  91. </tbody>
  92. </table>
  93. </div>
  94. </div>
  95. </div>
  96. <div id="pinjiechaxun1">
  97. <div name="pinjiechaxun2" style="padding:3px; height: auto" class="datagrid-toolbar">
  98. <span style="float:right;margin-bottom:4px;">
  99. <span>
  100. <a href="#" class="easyui-linkbutton" plain="true" icon="icon-search" id="listSearch" onclick="listsearch()">查询</a>
  101. </span>
  102. <span>
  103. <a href="#" class="easyui-linkbutton" plain="true" icon="icon-reload " id="listRedo" onclick="searchReset('list')">重置</a>
  104. </span>
  105. </div>
  106. </div>
  107. <script type="text/javascript" src="plug-in/tools/money.js"></script>
  108. <script type="text/javascript">
  109. $(function() {
  110. var datagrid = $("#listtb");
  111. datagrid.prepend($("#pinjie1 div[name='pinjie2']").html());
  112. $("#pinjie1").html('');
  113. datagrid.children(".datagrid-toolbar").children("span:first").after($("#pinjiechaxun1 div[name='pinjiechaxun2']").html());
  114. $("#pinjiechaxun1").html('');
  115. });
  116. var hasInit = false;
  117. function initSearch(){
  118. if($('#projectid').val() && !hasInit){
  119. listsearch();
  120. }
  121. hasInit = true;
  122. }
  123. function initCheck(data){
  124. var ids = "${ids}";
  125. var idArr = ids.split(",");
  126. for(var i=0;i<idArr.length;i++){
  127. if(idArr[i]!=""){
  128. $("#list").datagrid("selectRecord",idArr[i]);
  129. }
  130. }
  131. }
  132. //编写自定义JS代码获得输入框中的值等父级页面调用取值
  133. function getReason(){
  134. var strShiftid="";
  135. var strShiftCode="";
  136. var selectRows = $("#list").datagrid('getSelections');
  137. //console.log(selectRows.length);
  138. //console.log(selectRows);
  139. for(var i=0;i<selectRows.length;i++){
  140. for(var key in selectRows[i]){
  141. //console.log(key+"======="+selectRows[i][key]);
  142. if(key=="id"){
  143. if(strShiftid.length>0){
  144. strShiftid+=","+selectRows[i][key];
  145. }else{
  146. strShiftid=selectRows[i][key];
  147. }
  148. }
  149. if(key=="name"){
  150. if(strShiftCode.length>0){
  151. strShiftCode+=","+selectRows[i][key];
  152. }else{
  153. strShiftCode=selectRows[i][key];
  154. }
  155. }
  156. }
  157. }
  158. var strData='[{"id":"'+strShiftid+'","code":"'+strShiftCode+'"}]';
  159. return strData;
  160. }
  161. //选择项目名称,列表================
  162. function openDepartmentSelect() {
  163. //$.dialog.setting.zIndex = getzIndex();
  164. var orgIds = $("#projectid").val();
  165. /* var orgCode = $("#orgCode").val();*/
  166. $.dialog({
  167. content: 'url:publicpageController.do?projectSelect&ids='+orgIds, zIndex: getzIndex(), title: '项目名称列表', lock: true, width: '600px', height: '350px', opacity: 0.4, button: [
  168. {name: '<t:mutiLang langKey="common.confirm"/>', callback: function (){
  169. var iframe = this.iframe.contentWindow;
  170. if(iframe.getReason().length>0){
  171. var strData=eval(iframe.getReason());
  172. for(var key in strData[0]){
  173. if(key=="strId"){
  174. $("#projectid").val(strData[0][key]);
  175. }else if(key=="strName"){
  176. $("#projectName").val(strData[0][key]);
  177. }
  178. }
  179. }
  180. }, focus: true},
  181. {name: '<t:mutiLang langKey="common.cancel"/>', callback: function (){}}
  182. ]}).zindex();
  183. }
  184. function callbackClean(){
  185. $('#projectName').val('');
  186. $('#projectid').val('');
  187. }
  188. //选择供应商
  189. function openPartnerSelect() {
  190. //$.dialog.setting.zIndex = getzIndex();
  191. var partnerIds = $("#partnerid").val();
  192. /* var orgCode = $("#orgCode").val();*/
  193. $.dialog({
  194. content: 'url:partnerController.do?supplierAll&ids='+partnerIds, zIndex: getzIndex(), title: '供应商列表', lock: true, width: '600px', height: '350px', opacity: 0.4, button: [
  195. {name: '<t:mutiLang langKey="common.confirm"/>', callback: function (){
  196. var iframe = this.iframe.contentWindow;
  197. if(iframe.getReason().length>0){
  198. var strData=eval(iframe.getReason());
  199. for(var key in strData[0]){
  200. if(key=="strId"){
  201. $("#partnerid").val(strData[0][key]);
  202. }else if(key=="strPartnerName"){
  203. $("#partnerName").val(strData[0][key]);
  204. }
  205. }
  206. }
  207. }, focus: true},
  208. {name: '<t:mutiLang langKey="common.cancel"/>', callback: function (){}}
  209. ]}).zindex();
  210. }
  211. function callbackCleanPartner(){
  212. $('#partnerName').val('');
  213. $('#partnerid').val('');
  214. }
  215. function temp(){
  216. }
  217. function getSelectedRow(){
  218. var selectRows = $("#list").datagrid('getSelections');
  219. return selectRows;
  220. }
  221. </script>