selectContractList.jsp 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  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,DatePicker"></t:base>
  8. </head>
  9. <body style="overflow-y: hidden" scroll="no">
  10. <t:datagrid pagination="false" name="contractSaleList" pageSize="20" sortName="createDate" sortOrder="desc" title="选择销售合同" actionUrl="contractSaleController.do?selRefDatagridByUser" idField="id" checkbox="false" showRefresh="false" fit="true" queryMode="group" onLoadSuccess="initCheck">
  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="customername" query="false" queryMode="single" width="120" ></t:dgCol>
  15. <t:dgCol title="项目" field="projectname" query="false" queryMode="single" width="120" ></t:dgCol>
  16. <t:dgCol title="签订日期" field="signdate" hidden="true" formatter="yyyy-MM-dd" queryMode="single" width="120"></t:dgCol>
  17. <t:dgCol title="合同描述" field="description" hidden="false" queryMode="single" width="240"></t:dgCol>
  18. <t:dgCol title="合同金额(元)" field="totalamount" formatterjs="formatterNum" hidden="false" queryMode="single" width="80"></t:dgCol>
  19. <t:dgCol title="累计开票金额(元)" field="totalinvoice" formatterjs="formatterNum" hidden="false" queryMode="single" width="80"></t:dgCol>
  20. <t:dgCol title="累计收款金额(元)" field="totalincome" formatterjs="formatterNum" hidden="true" queryMode="single" width="80"></t:dgCol>
  21. <t:dgCol title="开始日期" field="startdate" formatter="yyyy-MM-dd" queryMode="single" width="80"></t:dgCol>
  22. <t:dgCol title="截止日期" field="enddate" formatter="yyyy-MM-dd" queryMode="single" width="80"></t:dgCol>
  23. <t:dgToolBar title="查看" icon="icon-search" url="contractSaleController.do?goUpdate" funname="detail" width="100%" height="100%"></t:dgToolBar>
  24. </t:datagrid>
  25. </body>
  26. </html>
  27. <script type="text/javascript" src="plug-in/tools/money.js"></script>
  28. <script src = "webpage/cn/com/lzt/contractsale/contractSaleList.js"></script>
  29. <script>
  30. $(function() {
  31. var datagrid = $("#contractSaleListtb");
  32. datagrid.prepend($("#pinjie1 div[name='pinjie2']").html());
  33. $("#pinjie1").html('');
  34. datagrid.children(".datagrid-toolbar").children("span:first").after($("#pinjiechaxun1 div[name='pinjiechaxun2']").html());
  35. $("#pinjiechaxun1").html('');
  36. });
  37. </script>
  38. <div id="pinjie1">
  39. <div name="pinjie2" style="padding:3px; height: auto" class="datagrid-toolbar">
  40. <div name="searchColums" style="margin:23px 0 18px 0;margin-top: 15px;margin-bottom: 8px;">
  41. <%-- <input type="hidden" id="orgCode" name="orgCode" value="${orgCode}"> --%>
  42. <table style="padding:0px" cellpadding="0" cellspacing="1" >
  43. <tbody>
  44. <tr>
  45. <td align="right" style="width: 74px;">
  46. <label class="Validform_label">
  47. 项目:
  48. </label>
  49. </td>
  50. <td class="value" >
  51. <input type="text" id="projectname" name="projectname" style="width: 157px" placeholder="请填写项目名称" >
  52. <!-- <input id="projectid" name="projectid" type="hidden" value="">
  53. <a href="#" class="easyui-linkbutton" plain="true" icon="icon-select" id="departSearch" onclick="openProjectSelect()">选择</a>
  54. <a href="#" class="easyui-linkbutton" plain="true" icon="icon-clean" id="departRedo" onclick="callbackCleanProject()">清空</a> -->
  55. </td>
  56. <td align="right" style="width: 74px;">
  57. <label class="Validform_label">
  58. 客户:
  59. </label>
  60. </td>
  61. <td class="value" >
  62. <input type="text" id="customername" name="customername" style="width: 157px" placeholder="请填写客户名称" >
  63. <!-- <input id="customerid" name="customerid" type="hidden" value="">
  64. <a href="#" class="easyui-linkbutton" plain="true" icon="icon-select" id="customerSearch" onclick="openCustomerSelect()">选择</a>
  65. <a href="#" class="easyui-linkbutton" plain="true" icon="icon-clean" id="customerRedo" onclick="callbackCleanCustomer()">清空</a> -->
  66. </td>
  67. </tr>
  68. <tr height="50px">
  69. <td align="right" style="width: 74px;">
  70. <label class="Validform_label">
  71. 合同号:
  72. </label>
  73. </td>
  74. <td class="value">
  75. <input id="code" name="code" type="text" style="width: 157px; " class="inputxt" placeholder="合同编码">
  76. </td>
  77. <td align="right" style="width: 74px;">
  78. <label class="Validform_label">
  79. 合同名称:
  80. </label>
  81. </td>
  82. <td class="value">
  83. <input id="name" name="name" type="text" style="width: 157px; " class="inputxt" placeholder="合同名称">
  84. </td>
  85. <td align="right" style="width: 74px;">
  86. <label class="Validform_label">
  87. 合同描述:
  88. </label>
  89. </td>
  90. <td class="value">
  91. <input id="description" name="description" type="text" style="width: 157px; " class="inputxt" placeholder="合同描述">
  92. </td>
  93. <!-- <td>
  94. <span style="display:-moz-inline-box;display:inline-block;">
  95. <span style="vertical-align:middle;display:-moz-inline-box;display:inline-block;width: 90px;text-align:right;text-overflow:ellipsis;-o-text-overflow:ellipsis; overflow: hidden;white-space:nowrap; "
  96. title="起始日期">合同生效日期:</span><input type="text" name="startdate_begin" style="width: 94px" class="Wdate" onclick="WdatePicker()">
  97. <span style="display:-moz-inline-box;display:inline-block;width: 8px !important;text-align:right;">~
  98. </span><input type="text" name="startdate_end" style="width: 94px" class="Wdate" onclick="WdatePicker()"></span>
  99. </td> -->
  100. </tr>
  101. </tbody>
  102. </table>
  103. </div>
  104. </div>
  105. </div>
  106. <div id="pinjiechaxun1">
  107. <div name="pinjiechaxun2" style="padding:3px; height: auto" class="datagrid-toolbar">
  108. <span style="float:right;margin-bottom:4px;">
  109. <span>
  110. <a href="#" class="easyui-linkbutton" plain="true" icon="icon-search" id="contractSaleListSearch" onclick="contractSaleListsearch()">查询</a>
  111. </span>
  112. <span>
  113. <a href="#" class="easyui-linkbutton" plain="true" icon="icon-reload " id="contractSaleListRedo" onclick="searchReset('contractSaleList')">重置</a>
  114. </span>
  115. </div>
  116. </div>
  117. </div>
  118. </div>
  119. <script type="text/javascript">
  120. $(function() {
  121. $('#projectname').bind('keyup', function(event) {
  122. if (event.keyCode == "13") {
  123.     //回车执行查询
  124. contractSaleListsearch();
  125. }
  126. });
  127. $('#customername').bind('keyup', function(event) {
  128. if (event.keyCode == "13") {
  129.     //回车执行查询
  130. contractSaleListsearch();
  131. }
  132. });
  133. });
  134. function initCheck(data){
  135. var ids = "${ids}";
  136. var idArr = ids.split(",");
  137. for(var i=0;i<idArr.length;i++){
  138. if(idArr[i]!=""){
  139. $("#contractSaleList").datagrid("selectRecord",idArr[i]);
  140. }
  141. }
  142. }
  143. //编写自定义JS代码获得输入框中的值等父级页面调用取值
  144. function getReason(){
  145. var strShiftid="";
  146. var strShiftCode="";
  147. var selectRows = $("#contractSaleList").datagrid('getSelections');
  148. //console.log(selectRows.length);
  149. //console.log(selectRows);
  150. for(var i=0;i<selectRows.length;i++){
  151. for(var key in selectRows[i]){
  152. //console.log(key+"======="+selectRows[i][key]);
  153. if(key=="id"){
  154. if(strShiftid.length>0){
  155. strShiftid+=","+selectRows[i][key];
  156. }else{
  157. strShiftid=selectRows[i][key];
  158. }
  159. }
  160. if(key=="name"){
  161. if(strShiftCode.length>0){
  162. strShiftCode+=","+selectRows[i][key];
  163. }else{
  164. strShiftCode=selectRows[i][key];
  165. }
  166. }
  167. }
  168. }
  169. var strData='[{"id":"'+strShiftid+'","code":"'+strShiftCode+'"}]';
  170. return strData;
  171. }
  172. //选择项目名称,列表================
  173. function openProjectSelect() {
  174. //$.dialog.setting.zIndex = getzIndex();
  175. var orgIds = $("#projectid").val();
  176. /* var orgCode = $("#orgCode").val();*/
  177. $.dialog({
  178. content: 'url:publicpageController.do?projectSelect&ids='+orgIds, zIndex: getzIndex(), title: '项目名称列表', lock: true, width: '600px', height: '350px', opacity: 0.4, button: [
  179. {name: '<t:mutiLang langKey="common.confirm"/>', callback: function (){
  180. var iframe = this.iframe.contentWindow;
  181. if(iframe.getReason().length>0){
  182. var strData=eval(iframe.getReason());
  183. for(var key in strData[0]){
  184. if(key=="strId"){
  185. $("#projectid").val(strData[0][key]);
  186. }else if(key=="strName"){
  187. $("#projectname").val(strData[0][key]);
  188. }
  189. }
  190. }
  191. }, focus: true},
  192. {name: '<t:mutiLang langKey="common.cancel"/>', callback: function (){}}
  193. ]}).zindex();
  194. }
  195. function callbackCleanProject(){
  196. $('#projectname').val('');
  197. $('#projectid').val('');
  198. }
  199. //选择供应商
  200. function openCustomerSelect() {
  201. //$.dialog.setting.zIndex = getzIndex();
  202. var partnerIds = $("#customerid").val();
  203. /* var orgCode = $("#orgCode").val();*/
  204. $.dialog({
  205. content: 'url:publicpageController.do?customerSelect&ids='+partnerIds, zIndex: getzIndex(), title: '客户列表', lock: true, width: '600px', height: '350px', opacity: 0.4, button: [
  206. {name: '<t:mutiLang langKey="common.confirm"/>', callback: function (){
  207. var iframe = this.iframe.contentWindow;
  208. if(iframe.getReason().length>0){
  209. var strData=eval(iframe.getReason());
  210. for(var key in strData[0]){
  211. if(key=="strId"){
  212. $("#customerid").val(strData[0][key]);
  213. }else if(key=="strPartnerName"){
  214. $("#customername").val(strData[0][key]);
  215. }
  216. }
  217. }
  218. }, focus: true},
  219. {name: '<t:mutiLang langKey="common.cancel"/>', callback: function (){}}
  220. ]}).zindex();
  221. }
  222. function callbackCleanCustomer(){
  223. $('#customername').val('');
  224. $('#customerid').val('');
  225. }
  226. </script>