inventoryLocationMoveEdit.jsp 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442
  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="${ctx}/script/common/jquery.comboboxRef.js"></script>
  9. <script type="text/javascript" src="${ctx}/script/common/jquery.combogridRef.js"></script>
  10. <script type="text/javascript">
  11. var functionId = '${functionId}';
  12. var operate = '${requestScope.operate}';
  13. var inventoryLocationMoveId = '${requestScope.inventoryLocationMove.inventoryLocationMoveId}';
  14. var ilmi = "";
  15. var transferKindListJson = JSON.parse('${requestScope.transferKindListJson}');
  16. function transferKindFormat(value, row, index)
  17. {
  18. for ( var i = 0; i < transferKindListJson.length; i++)
  19. {
  20. var transferKindItem = transferKindListJson[i];
  21. if (transferKindItem != null)
  22. {
  23. if (value == transferKindItem.id)
  24. {
  25. return transferKindItem.dictionaryName;
  26. }
  27. }
  28. }
  29. if (value == "0") {
  30. return "否";
  31. } else if(value == "1"){
  32. return "是";
  33. }else{
  34. return value;
  35. }
  36. };
  37. function formatAction(value,row) {
  38. //如果产品不需要扫描 则不展示SN扫描按钮
  39. var moveType = row.moveType;
  40. var a = '<a href="#" onclick="imeiScan(this)">IMEI列表</a> ';
  41. //不用扫描
  42. if (moveType == 1201 || moveType == 1203)
  43. {
  44. return null;
  45. }
  46. else
  47. {
  48. return a;
  49. }
  50. }
  51. function getRowIndex(target){
  52. var tr = $(target).closest('tr.datagrid-row');
  53. return parseInt(tr.attr('datagrid-row-index'));
  54. }
  55. function imeiScan(target)
  56. {
  57. var index = getRowIndex(target);
  58. var rows = $("#detailList").datagrid('getRows');
  59. var snList = rows[index].snList;
  60. $('#showImei').window({
  61. title : 'IEMI列表',
  62. width : 450,
  63. height : 350,
  64. closed : false,
  65. cache : false,
  66. modal : true,
  67. onOpen:function() {
  68. document.getElementById('snListNew').value = snList;
  69. }
  70. });
  71. }
  72. $(function() {
  73. //定义页面元素
  74. var $tabs = $("#tabs");
  75. $tabs.tabs('select', "基本信息");
  76. var unEditableAttributes = ${requestScope.unEditableAttributes};
  77. var inventoryLocationMoveData = '${ requestScope.inventoryLocationMoveData }';
  78. $.InventoryLocationMoveEdit = new $.AbstractEdit({
  79. entity : "InventoryLocationMove",
  80. formId : "inventoryLocationMoveForm",
  81. operate : operate,
  82. functionId : functionId,
  83. id : "inventoryLocationMoveId"
  84. });
  85. $.fn.extend($.InventoryLocationMoveEdit, {
  86. save : function() {
  87. if (this.form.form('validate') && this.validForm() )
  88. {
  89. if (4902 == status){
  90. showMsg("提示", "状态为完成,不允许修改订单");
  91. }
  92. else{
  93. if ("add" == this.operate){
  94. this.doBeforeSave();
  95. var postData = {
  96. "formData" : JSON.stringify(this.getData()),
  97. "updateFields" : JSON.stringify(this.changeList),
  98. "operate":this.operate
  99. };
  100. ajaxRequest(this.saveUrl, postData, this.afterSave, null, this);
  101. }
  102. else{
  103. if (this.changeList.length > 0)
  104. {
  105. this.doBeforeSave();
  106. var postData = {
  107. "formData" : JSON.stringify(this.getData()),
  108. "updateFields" : JSON.stringify(this.changeList),
  109. "operate":this.operate
  110. };
  111. ajaxRequest(this.saveUrl, postData, this.afterSave, null, this);
  112. }
  113. else
  114. {
  115. showMsg("提示", "数据未更新");
  116. }
  117. }
  118. }
  119. }
  120. },
  121. doAfterSuccessSave : function(response) {
  122. var temp = {'unEditableFields':['customerId','warehouseId','locationMoveStatus','locationMoveBy','locationMoveTime'],'unEditableButtons':[]};
  123. disabledAttributes($("#body"),temp);
  124. ilmi = response.data.inventoryLocationMoveId;
  125. }
  126. });
  127. $('#locationId').combogrid({// 仓库
  128. url : WEBROOT + "/loadData.action?entity=location",
  129. idField : 'locationId',
  130. textField : 'locationName',
  131. delay : 500,
  132. showHeader : false,
  133. mode : 'remote',
  134. columns : [ [ {
  135. field : 'locationName',
  136. title : '储位名称',
  137. width : 155
  138. } ] ],
  139. onBeforeLoad : function(param) { // 此设置使控件不会自动加载数据 这里不能使用this
  140. param.warehouseId = $("#warehouseId").combogrid('getValue');
  141. if (!$('#locationId').combogrid('getText')) {
  142. return false;
  143. } else {
  144. return true;
  145. }
  146. },
  147. onShowPanel : function() { // 在第一次触发下拉框事件是加载数据
  148. if (!$(this).combogrid('getText')) {
  149. $(this).combogrid({
  150. onBeforeLoad : function(param) {
  151. param.warehouseId = $("#warehouseId").combogrid('getValue');
  152. return true;
  153. }
  154. });
  155. }
  156. },
  157. onSelectAfter : function(){
  158. $('#itemLocation').combobox({// 储位上产品
  159. url : WEBROOT + "/loadData.action?entity=itemLocation",
  160. valueField : 'itemId',
  161. textField : 'itemName',
  162. delay : 500,
  163. showHeader : false,
  164. mode : 'remote',
  165. columns : [ [ {
  166. field : 'itemName',
  167. title : '商品名称',
  168. width : 155
  169. } ] ],
  170. onBeforeLoad : function(param) { // 此设置使控件不会自动加载数据 这里不能使用this
  171. param.locationId = $("#locationId").combogrid('getValue');
  172. param.customerId = $("#customerId").combogrid('getValue');
  173. if (!$('#itemLocation').combobox('getText')) {
  174. return false;
  175. } else {
  176. return true;
  177. }
  178. },
  179. onShowPanel : function() { // 在第一次触发下拉框事件是加载数据
  180. if (!$(this).combobox('getText')) {
  181. $(this).combobox({
  182. onBeforeLoad : function(param) {
  183. param.locationId = $("#locationId").combogrid('getValue');
  184. param.customerId = $("#customerId").combogrid('getValue');
  185. return true;
  186. }
  187. });
  188. }
  189. }
  190. });
  191. }
  192. });
  193. $('#toLocationId').combogrid({// 仓库
  194. url : WEBROOT + "/loadData.action?entity=location",
  195. idField : 'locationId',
  196. textField : 'locationName',
  197. delay : 500,
  198. showHeader : false,
  199. mode : 'remote',
  200. columns : [ [ {
  201. field : 'locationName',
  202. title : '储位名称',
  203. width : 155
  204. } ] ],
  205. onBeforeLoad : function(param) { // 此设置使控件不会自动加载数据 这里不能使用this
  206. param.warehouseId = $("#warehouseId").combogrid('getValue');
  207. if (!$('#toLocationId').combogrid('getText')) {
  208. return false;
  209. } else {
  210. return true;
  211. }
  212. },
  213. onShowPanel : function() { // 在第一次触发下拉框事件是加载数据
  214. if (!$(this).combogrid('getText')) {
  215. $(this).combogrid({
  216. onBeforeLoad : function(param) {
  217. param.warehouseId = $("#warehouseId").combogrid('getValue');
  218. return true;
  219. }
  220. });
  221. }
  222. }
  223. });
  224. $('#queryLocationName').combogrid({// 仓库
  225. url : WEBROOT + "/loadData.action?entity=location",
  226. idField : 'locationName',
  227. textField : 'locationName',
  228. delay : 500,
  229. showHeader : false,
  230. mode : 'remote',
  231. columns : [ [ {
  232. field : 'locationName',
  233. title : '储位名称',
  234. width : 155
  235. } ] ],
  236. onBeforeLoad : function(param) { // 此设置使控件不会自动加载数据 这里不能使用this
  237. param.warehouseId = $("#warehouseId").combogrid('getValue');
  238. //param.locationCategory = 702;
  239. if (!$('#queryLocationName').combogrid('getText')) {
  240. return false;
  241. } else {
  242. return true;
  243. }
  244. },
  245. onShowPanel : function() { // 在第一次触发下拉框事件是加载数据
  246. if (!$(this).combogrid('getText')) {
  247. $(this).combogrid({
  248. onBeforeLoad : function(param) {
  249. param.warehouseId = $("#warehouseId").combogrid('getValue');
  250. param.locationCategory = 702;
  251. return true;
  252. }
  253. });
  254. }
  255. }
  256. });
  257. $.InventoryLocationMoveEdit.init();
  258. if (!$.isEmpty(${requestScope.inventoryLocationMoveData})) {
  259. $.InventoryLocationMoveEdit.fillData(${requestScope.inventoryLocationMoveData});
  260. disabledAttributes($("#body"),unEditableAttributes);
  261. }
  262. $("#saveInventoryLocationMoveBtn").click(
  263. $.proxy($.InventoryLocationMoveEdit.save,
  264. $.InventoryLocationMoveEdit));
  265. //实例化实体List
  266. $.InventoryLocationMoveDetailEdit = new $.AbstractEdit({
  267. entity : "InventoryLocationMoveDetail",
  268. formId : "inventoryLocationMoveDetailForm",
  269. id : "id"
  270. });
  271. disabledAttributes($("#body1"),unEditableAttributes);
  272. $.InventoryLocationMoveDetailEdit.init();
  273. disabledAttributes($("#body1"),unEditableAttributes);
  274. var status = 4901;
  275. /**
  276. * 完成转移
  277. */
  278. $("#finishInventoryLocationMoveBtn").bind("click",function() {
  279. var statusFromDB = '${requestScope.inventoryLocationMove.locationMoveStatus}';
  280. if(4902 == status){
  281. showMsg('提示', '状态为完成,不能完成移动');
  282. }
  283. else if(4902 == statusFromDB){
  284. showMsg('提示', '状态为完成,不能完成移动');
  285. }
  286. else{
  287. ajaxRequest(WEBROOT + '/InventoryLocationMove/completeMove.action', {id : $("#inventoryLocationMoveForm").find("input[name='inventoryLocationMoveId']").val()}, function(response) {
  288. if (response.code == "success") {
  289. showMsg('提示', '移库成功');
  290. status = 4902;
  291. $("#inventoryLocationMoveForm").find("input[name='locationMoveStatus']").val(4902);
  292. $("#detailList").datagrid('reload');
  293. var data = response.data;
  294. $('#inventoryLocationMoveForm').form('load',{
  295. locationMoveStatus : data.locationMoveStatus,
  296. locationMoveBy : data.locationMoveBy,
  297. locationMoveTime : data.locationMoveTime
  298. });
  299. } else {
  300. var errorDesc = response.errorDesc;
  301. showMsg('移库失败', errorDesc);
  302. };
  303. });
  304. }
  305. });
  306. });
  307. </script>
  308. <script type="text/javascript"
  309. src="${ctx}/script/wms/inventory/inventoryLocationMove.js"></script>
  310. </head>
  311. <body style="overflow-y: hidden" fit="true" scroll="no" >
  312. <div id="tabs" class="easyui-tabs" fit="true" >
  313. <div title="基本信息" id="body">
  314. <form id="inventoryLocationMoveForm" method="post">
  315. <input type="hidden" name="inventoryLocationMoveId" value="${inventoryLocationMove.inventoryLocationMoveId}"></input>
  316. <input type="hidden" name="deleteFlag" id="deleteFlag"></input>
  317. <table style="width: 100%">
  318. <tr>
  319. <a href="#" icon="icon-save" id="saveInventoryLocationMoveBtn"
  320. class="easyui-linkbutton">保存</a>
  321. <a href="#" icon="" id="finishInventoryLocationMoveBtn"
  322. class="easyui-linkbutton">完成移动</a>
  323. </tr>
  324. <tr>
  325. <td><div class="star">*</div>仓库:</td>
  326. <td>
  327. <s:select list="#request.warehouseList" listKey="warehouseId" listValue="warehouseName" cssClass="easyui-combobox" cssStyle="width: 155px" name="warehouseId" id="warehouseId" theme="simple" data-options="required: true"></s:select>
  328. </td>
  329. <td><div class="star">*</div>货主:</td>
  330. <td>
  331. <s:select list="#request.customerList" listKey="customerId" listValue="customerName" cssClass="easyui-combobox" cssStyle="width: 155px" name="customerId" id="customerId" theme="simple" data-options="required: true"></s:select>
  332. </td>
  333. <td>状态:</td>
  334. <td>
  335. <select id="locationMoveStatus" class="easyui-combobox" size="8" name="locationMoveStatus" style="width:160px" data-options="required:true" disabled="disabled">
  336. <option value="4901" selected="selected">待处理</option>
  337. <c:forEach var="item" items="${locationMoveStatusList}">
  338. <option value="${item.id}">${item.dictionaryName}</option>
  339. </c:forEach>
  340. </select>
  341. </td>
  342. </tr>
  343. <tr>
  344. <td>处理人:</td>
  345. <td><input class="easyui-validatebox" name="locationMoveBy" disabled="disabled"></input>
  346. </td>
  347. <td>转移时间:</td>
  348. <td><input class="easyui-datebox" name="locationMoveTime" disabled="disabled"></input>
  349. </td>
  350. <td>备注:</td>
  351. <td><textarea class="easyui-validatebox" name="description"
  352. style="width: 155px"></textarea>
  353. </td>
  354. </tr>
  355. </table>
  356. </form>
  357. <div id="detailTabs" class="easyui-tabs" fit="false">
  358. <div title="详情明细">
  359. <div id="toolbar" class="toolbar">
  360. <table>
  361. <tr>
  362. <td><a id="addDetailBtn" href="#" class="easyui-linkbutton"
  363. data-options="iconCls:'icon-add'">新增</a></td>
  364. <td><a id="removeDetailBtn" href="#" class="easyui-linkbutton"
  365. data-options="iconCls:'icon-remove'">删除</a></td>
  366. </tr>
  367. </table>
  368. </div>
  369. <form id="searchForm" action="#" method="post">
  370. <table id="detailList" data-options="fitColumns:true">
  371. <thead>
  372. <tr>
  373. <th data-options="field:'id',hidden:true">主键</th>
  374. <th data-options="field:'ck',checkbox:true">编码</th>
  375. <th data-options="field:'relationedCustomerName',align:'center',width:100">货主关系人</th>
  376. <th data-options="field:'locationName',align:'center',width:100">原储位</th>
  377. <th data-options="field:'itemCode',align:'center',width:100">产品代码</th>
  378. <th data-options="field:'itemName',align:'center',width:100">产品名称</th>
  379. <th data-options="field:'normalFlag',align:'center',width:100">产品形态</th>
  380. <th data-options="field:'locationMoveQuantity',align:'center',width:100">移动数量</th>
  381. <th data-options="field:'toLocationName',align:'center',width:100">至储位</th>
  382. <th data-options="field:'transferKind',align:'center',width:100,formatter:transferKindFormat">全部转移</th>
  383. <th data-options="field:'moveReason',align:'center',width:100">移库原因</th>
  384. <th data-options="field:'snList',align:'center',width:100,formatter:formatAction">IMEI列表</th>
  385. </tr>
  386. </thead>
  387. </table>
  388. </form>
  389. </div>
  390. </div>
  391. </div>
  392. </div>
  393. <div id="popWindow" data-options="" style="margin: 0px; padding: 0px; overflow: auto" >
  394. <%@ include file="/WEB-INF/pages/wms/inventoryLocationMove/inventoryLocationMoveDetailEdit.jsp"%>
  395. </div>
  396. </body>
  397. </html>
  398. </html>