receiptList.jsp 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333
  1. <%@ page contentType="text/html;charset=UTF-8"%>
  2. <%@ include file="/WEB-INF/include/taglibs.jsp"%>
  3. <!DOCTYPE html>
  4. <html>
  5. <head>
  6. <title>用户管理</title>
  7. <%@ include file="/WEB-INF/include/common.jsp"%>
  8. <script type="text/javascript" src="<%=path %>/script/common/jquery-easyui-1.3.2/plugins/jquery.datagrid_detailview.js"></script>
  9. <script type="text/javascript">
  10. var storageTypeList = ${requestScope.storageTypeList};
  11. var functionId = '${functionId}';
  12. function storageTypeFormat(value){
  13. for ( var i = 0; i < storageTypeList.length; i++)
  14. {
  15. var statusValues = storageTypeList[i];
  16. if (value == statusValues.id)
  17. {
  18. return statusValues.dictionaryName;
  19. }
  20. }
  21. }
  22. function statusFormat(value)
  23. {
  24. if(value == 1){
  25. return "是";
  26. }else {
  27. return "否";
  28. }
  29. }
  30. $(function(){
  31. var buttonData = '${requestScope.buttons}';
  32. //实例化查询表单,当前页面只能实例化一次
  33. var searchForm = $("#searchForm").searchForm();
  34. //实例化实体List
  35. $.ReceiptList = new $.AbstractList( {
  36. entity:"Receipt",
  37. searchForm:searchForm,
  38. id:"receiptId",
  39. functionId : functionId,
  40. showExportButton : true,
  41. showTopic:true,
  42. autoLoad:false,
  43. myGridConfig:{
  44. view: detailview,
  45. detailFormatter:function(index,row){
  46. return '<div class="ddv" style="padding:5px 0"></div>';
  47. },
  48. onExpandRow: function(index,row){
  49. var readDetailForm = $("#readDetailForm");
  50. var hiddenReceiptId = readDetailForm.find("input[name='receiptId']");
  51. hiddenReceiptId.val(row.receiptId);
  52. var ddv = $(this).datagrid('getRowDetail',index).find('div.ddv');
  53. var readUrl = WEBROOT + '/ReceiptDetail/readDetails.action';
  54. ddv.panel({
  55. border:false,
  56. cache:false,
  57. href:readUrl+'?searchConditions='+JSON.stringify(readDetailForm.searchForm().getQo()),
  58. onLoad:function(){
  59. $.ReceiptList.datagrid.datagrid('fixDetailRowHeight',index);
  60. }
  61. });
  62. $.ReceiptList.datagrid.datagrid('fixDetailRowHeight',index);
  63. }
  64. }
  65. }) ;
  66. $.btnSearch = $('#btnSearch').advSearch({
  67. functionId:functionId,
  68. baseList:$.ReceiptList
  69. });
  70. if( !$.isEmpty(buttonData )){
  71. //构建权限按钮
  72. var jsonButtons = JSON.parse(buttonData);
  73. $.buildToolbar( $("#toolbar"),jsonButtons );
  74. };
  75. $.fn.extend($.ReceiptList, {
  76. printReceipt : function(){
  77. var url = WEBROOT + "/Receipt/printReceiptCheck.action";
  78. var rows = this.getSelections();
  79. if (rows.length == 0) {
  80. if(this.advSearchForm) {
  81. this.searchForm.setBaseConditions(this.advSearchForm.getConditions());
  82. }
  83. var conditionForSign = this.searchForm.getQo();
  84. if (conditionForSign['conditionRules'] != "") {
  85. var postData = {
  86. conditions : JSON.stringify(conditionForSign)
  87. };
  88. ajaxRequest(url, postData, successPrintCheck, null, this);
  89. } else {
  90. alertMsg("提示", "请选择要打印的行", "error");
  91. }
  92. } else {
  93. var ids = [];
  94. for (var i = 0; i < rows.length; i++) {
  95. ids.push(rows[i][this.id]);
  96. }
  97. var postData = {
  98. ids : $.encodeJSON(ids)
  99. };
  100. ajaxRequest(url, postData, successPrintCheck, null, this);
  101. }
  102. },
  103. close : function(){
  104. var url = WEBROOT + "/Receipt/closeCheck.action";
  105. var rows = this.getSelections();
  106. if (rows.length == 0) {
  107. if(this.advSearchForm) {
  108. this.searchForm.setBaseConditions(this.advSearchForm.getConditions());
  109. }
  110. var conditionForSign = this.searchForm.getQo();
  111. if (conditionForSign['conditionRules'] != "") {
  112. var postData = {
  113. conditions : JSON.stringify(conditionForSign)
  114. };
  115. ajaxRequest(url, postData, successCloseCheck, null, this);
  116. } else {
  117. alertMsg("提示", "请选择要关闭的行", "error");
  118. }
  119. } else {
  120. var ids = [];
  121. for (var i = 0; i < rows.length; i++) {
  122. ids.push(rows[i][this.id]);
  123. }
  124. var postData = {
  125. ids : $.encodeJSON(ids)
  126. };
  127. ajaxRequest(url, postData, successCloseCheck, null, this);
  128. }
  129. }
  130. });
  131. $("#btnSearch").bind("click",$.proxy( $.ReceiptList.quickSearch, $.ReceiptList ) );
  132. $("#btnReset").bind("click",
  133. $.proxy($.ReceiptList.reset, $.ReceiptList));
  134. $('#customerId').combogrid({ // 货主
  135. url : WEBROOT + "/loadData.action?entity=customer",
  136. idField : 'customerId',
  137. textField : 'customerName',
  138. delay : 500,
  139. mode : 'remote',
  140. showHeader : false,
  141. striped : true,
  142. columns : [ [ {
  143. field : 'customerName',
  144. width : '150'
  145. } ] ],
  146. onBeforeLoad : function(param) { // 此设置使控件不会自动加载数据 这里不能使用this
  147. if (!$("#customerId").combogrid('getText')) {
  148. return false;
  149. } else {
  150. return true;
  151. }
  152. },
  153. onShowPanel : function() { // 在第一次触发下拉框事件是加载数据
  154. if (!$(this).combogrid('getText')) {
  155. $(this).combogrid({
  156. onBeforeLoad : function(param) {
  157. return true;
  158. }
  159. });
  160. }
  161. }
  162. });
  163. });
  164. function successPrintCheck(data){
  165. $.messager.confirm('提示', '共【' + data[0].length + '】个订单可以打印,确定要打印吗?',
  166. function(result) {
  167. if (result) {
  168. if(data[0].length>0){
  169. var url = WEBROOT + "/Receipt/doPrintReceipt.action";
  170. var postData={
  171. ids:$.encodeJSON(data[0])
  172. };
  173. ajaxRequest(url, postData, successQueryPrint, null, this);
  174. }
  175. }
  176. });
  177. };
  178. function successQueryPrint(ajaxResponse){
  179. if( ajaxResponse.code=='fail'){
  180. alertMsg("打印查询","查询要打印的订单出现异常:"+ajaxResponse.errorDesc,"error");
  181. }else{
  182. var data = ajaxResponse.data;
  183. var config = {
  184. showPrinterSelect:"1",
  185. showPreview:1,
  186. autoMatch:1,
  187. templeteType:'收货单'
  188. };
  189. var printPlugIn = new top.PrintPlugIn(config);
  190. printPlugIn.print(data);
  191. }
  192. };
  193. function successCloseCheck(data){
  194. $.messager.confirm('提示', '共【' + data[0].length + '】个订单可以关闭,确定要关闭吗?',
  195. function(result) {
  196. if (result) {
  197. if(data[0].length>0){
  198. var url = WEBROOT + "/Receipt/doClose.action";
  199. var postData={
  200. ids:$.encodeJSON(data[0])
  201. };
  202. ajaxRequest(url, postData, successClose, null, this);
  203. }
  204. }
  205. });
  206. };
  207. function successClose(ajaxResponse){
  208. if( ajaxResponse.code=='fail'){
  209. alertMsg("提示",ajaxResponse.errorDesc,"error");
  210. }else{
  211. alertMsg("提示","关闭成功");
  212. $.ReceiptList.datagrid.datagrid('clearSelections');
  213. $.ReceiptList.datagrid.datagrid('reload');
  214. }
  215. };
  216. </script>
  217. </head>
  218. <body style="overflow-y:hidden" fit="true" scroll="no">
  219. <div id="tabs" class="easyui-tabs" fit="true">
  220. <div title="查询">
  221. <form id="searchForm" action="#" method="post">
  222. <table width="100%">
  223. <tr>
  224. <td class="title">收货单号:
  225. </td>
  226. <td>
  227. <textarea class="easyui-validatebox" style="vertical-align:middle" name="receiptId" condition ='"operator":"in"' ></textarea>
  228. </td>
  229. <td class="title">客户查询号:
  230. </td>
  231. <td>
  232. <textarea class="easyui-validatebox" style="vertical-align:middle" name="customerRefferenceId" condition ='"operator":"in"' ></textarea>
  233. </td>
  234. <td class="title">订单状态:
  235. </td>
  236. <td>
  237. <select name="receiptStatus" style="width: 155px"
  238. class="easyui-combobox"
  239. data-options="multiple:true,editable:false,panelHeight:'auto'"
  240. condition='"operator":"in"'>${receiptStatus}
  241. </select>
  242. </td>
  243. </tr>
  244. <tr>
  245. <td class="title">供应商代码:
  246. </td>
  247. <td>
  248. <input class="easyui-validatebox" type="text" style="vertical-align:middle" name="senderCode" condition ='"operator":"like"' />
  249. </td>
  250. <td class="title">订单类型:
  251. </td>
  252. <td>
  253. <s:select list="#request.inboundKinds" listKey="id" listValue="dictionaryName" cssClass="easyui-combobox" cssStyle="width: 155px" name="inboundKind" theme="simple" condition ='"operator":"="'></s:select>
  254. </td>
  255. <td class="title">货主:</td>
  256. <td>
  257. <input id="customerId" name="customerId" myType="easyui-combogrid" condition ='"operator":"in"'/>
  258. </td>
  259. </tr>
  260. <tr>
  261. <td class="title">预计到货时间:
  262. </td>
  263. <td colspan="3">
  264. <input class="easyui-datetimebox" type="text" style="vertical-align:middle" name="expectedReceiveTime" condition ='"operator":">"' >
  265. ~
  266. <input class="easyui-datetimebox" type="text" style="vertical-align:middle" name="expectedReceiveTime" condition ='"operator":"<"' >
  267. </td>
  268. </tr>
  269. <tr>
  270. <td colspan="6" align="right">
  271. <a id="btnSearch" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search'">查询</a>
  272. <a id="btnAdvSearch" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search'">高级查询<span class="totals"></span> </a>
  273. <a id="btnReset" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-reset'">重置</a>
  274. </td>
  275. </tr>
  276. </table>
  277. </form>
  278. <div id="toolbar" class="toolbar"></div>
  279. <table id="maingrid" data-options="">
  280. <thead>
  281. <tr>
  282. <th data-options="field:'ck',width:20,checkbox:true">编码</th>
  283. <th data-options="field:'receiptId',align:'center',width:140">收货单号</th>
  284. <th data-options="field:'customerRefferenceId',align:'center',width:100">客户订单号</th>
  285. <th data-options="field:'storageType',align:'center',width:100,formatter:storageTypeFormat">入库类型</th>
  286. <th data-options="field:'customerName',align:'center',width:100">货主</th>
  287. <th data-options="field:'warehouseName',align:'center',width:100">仓库名称</th>
  288. <th data-options="field:'receiptStatus',align:'center',width:100">收货单状态</th>
  289. <th data-options="field:'senderCode',align:'center',width:100">发货人代码</th>
  290. <th data-options="field:'senderName',align:'center',width:100">发货人名称</th>
  291. <th data-options="field:'carrierTrackingNumber',align:'center',width:100">承运单号</th>
  292. <th data-options="field:'carrierName',align:'center',width:100">承运商名称</th>
  293. <th data-options="field:'creationTime',align:'center',width:100">创建时间</th>
  294. <th data-options="field:'createdBy',align:'center',width:100">创建人</th>
  295. <th data-options="field:'updatedBy',align:'center',width:100">更新人</th>
  296. <th data-options="field:'updateTime',align:'center',width:100">更新时间</th>
  297. </tr>
  298. </thead>
  299. </table>
  300. </div>
  301. <div title="内容">
  302. <iframe id="innerFrame" name="innerTab" scrolling="auto" frameborder="0" style="width:100%;height:99.4%;border:none;"></iframe>
  303. </div>
  304. </div>
  305. <form id="readDetailForm">
  306. <input class="easyui-validatebox" type="hidden" style="vertical-align:middle" name="receiptId" value="" condition ='"operator":"="' />
  307. </form>
  308. </body>
  309. </html>