sortingScan.jsp 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382
  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">
  9. var receiptEntity = ${requestScope.receipt};
  10. var skuNumber = ${requestScope.skuNumber};
  11. var voice = null;
  12. try
  13. {
  14. voice = new ActiveXObject('Sapi.SpVoice');
  15. }
  16. catch(e)
  17. {
  18. }
  19. var sortingCount = 1;
  20. var lastIndex = -1;
  21. var editIndex;
  22. function formatStatus(value)
  23. {
  24. if (0 == value)
  25. {
  26. return "正常";
  27. }
  28. else if (1 == value)
  29. {
  30. return "关闭";
  31. }
  32. }
  33. function closeBox(row)
  34. {
  35. var url = WEBROOT + "/Receipt/closeBox.action";
  36. var postData = {
  37. id:row.id
  38. };
  39. ajaxRequest(url, postData, function(response){
  40. // succeed
  41. if (response.code == "success") {
  42. showMsg("提示", "箱子关闭成功");
  43. } else {
  44. var errorDesc = response.errorDesc;
  45. showMsg("失败", errorDesc);
  46. }
  47. }, null, this);
  48. }
  49. $(function(){
  50. $("#closeBtn").click(function(){
  51. //parent.$.scanDialog.dialog('close');
  52. });
  53. $("#preBoxListTable").datagrid({
  54. width : '100%',
  55. checkOnSelect:true,
  56. nowrap : false,
  57. striped : true,
  58. collapsible : false,
  59. fitColumns : true,
  60. pagination : true,
  61. singleSelect : true,
  62. pageSize : 50,
  63. idField : 'id',
  64. url : WEBROOT + '/Receipt/showPreBoxList.action',
  65. queryParams:{receiptId:receiptEntity.receiptId,sortingCount:sortingCount},
  66. remoteSort : true,
  67. pageList : [50, 100],
  68. columns:[[
  69. {field:'boxNo',title:'中转箱号',width:100},
  70. {field:'skuCount',title:'SKU数',width:100},
  71. {field:'qty',title:'总件数',width:100}
  72. ]]
  73. });
  74. $("#realyBoxNo").combobox({
  75. data:${requestScope.boxList},
  76. valueField:'boxId',
  77. textField:'boxNo'
  78. });
  79. $("#useBox").click(function(){
  80. if (this.checked)
  81. {
  82. $("#realyBoxNo").combobox('enable');
  83. }
  84. else
  85. {
  86. $("#realyBoxNo").combobox('clear');
  87. $("#realyBoxNo").combobox('disable');
  88. }
  89. });
  90. $('#barCode').keydown(function(e)
  91. {
  92. if (e.keyCode == 13)
  93. {
  94. //校验产品是否在箱明细中 如果不在说明多发货
  95. if ($("#useBox").attr("checked") && !$("#realyBoxNo").combobox('getValue'))
  96. {
  97. setTimeout(function()
  98. {
  99. alertMsg("提示", "请选择箱号", "error");
  100. }, 100);
  101. return;
  102. }
  103. //更新系统箱信息
  104. var postData = {
  105. "realyBoxId" : $("#realyBoxNo").combobox('getValue'),
  106. "realyBoxNo" : $("#realyBoxNo").combobox('getText'),
  107. "barCode" : $('#barCode').val(),
  108. "receiptId" : receiptEntity.receiptId,
  109. "sortingCount":sortingCount
  110. };
  111. var url = WEBROOT + '/Receipt/itemScan.action';
  112. ajaxRequest(url, postData, function(response)
  113. {
  114. if (response.code == "success")
  115. {
  116. $("#sortingBoxNo").val(response.data.preBoxNo);
  117. setTimeout(function()
  118. {
  119. $("#sortingBox").datagrid('reload');
  120. $("#sortingDetail").datagrid('reload',{
  121. receiptId:receiptEntity.receiptId,
  122. preBoxId:response.data.boxId,
  123. sortingCount:sortingCount
  124. });
  125. $("#sortingScanDetail").datagrid('reload');
  126. try
  127. {
  128. voice.Speak(response.data.preBoxNo,1);
  129. }
  130. catch(e)
  131. {
  132. alert('请参见语音播报配置手册进行配置');
  133. }
  134. }, 100);
  135. }
  136. else if (response.code == "fail")
  137. {
  138. showMsg("错误", response.errorDesc);
  139. }
  140. });
  141. //刷新页面箱信息
  142. }
  143. });
  144. $("#preBoxDetailTable").datagrid({
  145. width : '100%',
  146. checkOnSelect:true,
  147. nowrap : false,
  148. striped : true,
  149. collapsible : false,
  150. fitColumns : true,
  151. pagination : true,
  152. singleSelect : true,
  153. pageSize : 50,
  154. idField : 'id',
  155. url : WEBROOT + '/Receipt/showPreBoxDetail.action',
  156. queryParams:{receiptId:receiptEntity.receiptId,sortingCount:sortingCount},
  157. remoteSort : true,
  158. pageList : [50, 100],
  159. columns:[[
  160. {field:'boxNo',title:'中转箱号',width:100},
  161. {field:'itemCode',title:'SKU',width:100},
  162. {field:'zoneName',title:'库区',width:100},
  163. {field:'locationName',title:'储位',width:100},
  164. ]]
  165. });
  166. $("#sortingBox").datagrid({
  167. width : '100%',
  168. checkOnSelect:true,
  169. nowrap : false,
  170. striped : true,
  171. collapsible : false,
  172. fitColumns : true,
  173. pagination : true,
  174. singleSelect : true,
  175. pageSize : 50,
  176. idField : 'id',
  177. url : WEBROOT + '/Receipt/showSortingBox.action',
  178. queryParams:{receiptId:receiptEntity.receiptId,sortingCount:sortingCount},
  179. remoteSort : true,
  180. pageList : [50, 100],
  181. columns:[[
  182. {field:'preBoxNo',title:'预分拣箱号',width:100},
  183. {field:'cartonBoxNo',title:'实际箱号',width:100},
  184. {field:'qty',title:'数量',width:100},
  185. {field:'status',title:'状态',width:100,formatter:formatStatus,editor:{
  186. type : 'combobox',
  187. options:{
  188. valueField: 'id',
  189. textField: 'text',
  190. data:[{id:0,text:'正常'},{id:1,text:'关闭'}],
  191. onSelect:function(record){
  192. setTimeout(function(){
  193. $('#sortingBox').datagrid('endEdit', editIndex);
  194. var rows = $('#sortingBox').datagrid('getRows');
  195. var row = rows[editIndex];
  196. row.status = record.id;
  197. $('#sortingBox').datagrid('updateRow',{index:editIndex,row:row});
  198. closeBox(row);
  199. lastIndex = -1;
  200. }, 100);
  201. }
  202. }
  203. }}
  204. ]],
  205. onClickCell : function (rowIndex, field, value) {
  206. if(field == "status" && 0 == value){
  207. if (lastIndex != rowIndex) {
  208. $('#sortingBox').datagrid('cancelEdit', lastIndex);
  209. editIndex = rowIndex;
  210. lastIndex = rowIndex;
  211. $('#sortingBox').datagrid('beginEdit', rowIndex);
  212. }
  213. }
  214. }
  215. });
  216. $("#sortingDetail").datagrid({
  217. width : '100%',
  218. checkOnSelect:true,
  219. nowrap : false,
  220. striped : true,
  221. collapsible : false,
  222. fitColumns : true,
  223. pagination : true,
  224. singleSelect : true,
  225. pageSize : 50,
  226. idField : 'id',
  227. url : WEBROOT + '/Receipt/showSortingDetail.action',
  228. queryParams:{receiptId:receiptEntity.receiptId,sortingCount:sortingCount},
  229. remoteSort : true,
  230. pageList : [50, 100],
  231. columns:[[
  232. {field:'cartonBoxNo',title:'实际箱号',width:100},
  233. {field:'itemCode',title:'SKU',width:100},
  234. {field:'qty',title:'数量',width:100}
  235. ]]
  236. });
  237. $("#sortingScanDetail").datagrid({
  238. width : '100%',
  239. checkOnSelect:true,
  240. nowrap : false,
  241. striped : true,
  242. collapsible : false,
  243. fitColumns : true,
  244. pagination : true,
  245. singleSelect : true,
  246. pageSize : 50,
  247. idField : 'id',
  248. url : WEBROOT + '/Receipt/showScanDetail.action',
  249. queryParams:{receiptId:receiptEntity.receiptId,sortingCount:sortingCount},
  250. remoteSort : true,
  251. pageList : [50, 100],
  252. columns:[[
  253. {field:'itemCode',title:'SKU',width:100},
  254. {field:'itemBarCode',title:'条码',width:150},
  255. {field:'qty',title:'数量',width:50},
  256. {field:'orgCartonBoxNo',title:'原始箱号',width:50}
  257. ]]
  258. });
  259. });
  260. </script>
  261. </head>
  262. <body id="body" style="background:#fafafa;">
  263. <div class="easyui-panel" style="width:1070px;height:45px;padding:10px;background:#fafafa;"
  264. data-options="iconCls:'icon-base',closable:false,collapsible:false,minimizable:false,maximizable:false">
  265. <table style="width: 100%">
  266. <tr>
  267. <td colspan="2"><a href="#" icon="icon-close" id="closeBtn" class="easyui-linkbutton">关闭</a>
  268. </td>
  269. <td>收货单号:</td>
  270. <td><input class="easyui-validatebox" value="${requestScope.receipt.receiptId}" disabled="disabled" id="receiptId" name="receiptId"></input>
  271. </td>
  272. <td>总SKU数:</td>
  273. <td><input class="easyui-validatebox" value="${requestScope.skuNumber}" disabled="disabled" id="skuNumber" name="skuNumber"></input>
  274. </td>
  275. <td>总件数:</td>
  276. <td><input class="easyui-validatebox" value="${requestScope.receipt.expectedReceiveQuantity}" disabled="disabled"
  277. id="expectedQuantity" name="expectedQuantity"></input></td>
  278. </tr>
  279. </table>
  280. </div>
  281. <div style="float:left;margin-left:10px;">
  282. <div class="easyui-panel" title="预分拣箱清单" style="width:330px;height:200px;"
  283. data-options="iconCls:'icon-base',closable:false,collapsible:false,minimizable:false,maximizable:false">
  284. <table id="preBoxListTable">
  285. </table>
  286. </div>
  287. </div>
  288. <div style="float:left; width:80px; height:200px">
  289. <br> <br> <br> <br> <br> <br>
  290. </div>
  291. <div>
  292. <div class="easyui-panel" title="实际分拣箱清单" style="float:left;width:330px;height:200px;background:#fafafa;"
  293. data-options="iconCls:'icon-base',closable:false,collapsible:false,minimizable:false,maximizable:false">
  294. <table id="sortingBox">
  295. </table>
  296. </div>
  297. </div>
  298. <div class="easyui-panel" style="width:800px;height:80px;background:#fafafa;margin-left:10px;"
  299. data-options="iconCls:'icon-base',closable:false,collapsible:false,minimizable:false,maximizable:false">
  300. <table style="width: 50%">
  301. <tr>
  302. <td><input type="checkbox" value="1" name="useBox" id="useBox"/>按箱扫描</td>
  303. </tr>
  304. </table>
  305. <table style="width: 100%">
  306. <tr>
  307. <td>箱号:</td>
  308. <td><input class="easyui-combobox" disabled="disabled" id="realyBoxNo" name="boxNo"></input></td>
  309. <td>条码:</td>
  310. <td><input class="easyui-validatebox" id="barCode" name="barCode"></input></td>
  311. <td>中转箱号:</td>
  312. <td><input class="easyui-validatebox" disabled="disabled" id="sortingBoxNo" name="sortingBoxNo"></input></td>
  313. <td colspan="2"><input type="checkbox" value="1" name="printEle" id="printEle"/>打印分拣标签</td>
  314. </tr>
  315. </table>
  316. </div>
  317. <div style="float:left;margin-left:10px;">
  318. <div class="easyui-panel" title="预分拣箱汇总明细" style="width:330px;height:200px;"
  319. data-options="iconCls:'icon-base',closable:false,collapsible:false,minimizable:false,maximizable:false">
  320. <table id="preBoxDetailTable">
  321. </table>
  322. </div>
  323. </div>
  324. <div style="float:left; width:80px; height:200px">
  325. <br> <br> <br> <br> <br> <br>
  326. </div>
  327. <div style="float:left;">
  328. <div class="easyui-panel" title="实际分拣明细" style="width:330px;height:200px;background:#fafafa;"
  329. data-options="iconCls:'icon-base',closable:false,collapsible:false,minimizable:false,maximizable:false">
  330. <table id="sortingDetail">
  331. </table>
  332. </div>
  333. </div>
  334. <div style="float:left; width:80px; height:130px">
  335. <br> <br> <br> <br> <br> <br>
  336. </div>
  337. <div>
  338. <div class="easyui-panel" title="实际分拣扫描明细" style="float:left;width:300px;height:200px;background:#fafafa;"
  339. data-options="iconCls:'icon-base',closable:false,collapsible:false,minimizable:false,maximizable:false">
  340. <table id="sortingScanDetail">
  341. </table>
  342. </div>
  343. </div>
  344. </body>
  345. </html>