You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

175 lines
5.5 KiB

1 week ago
  1. <#import "../master.ftl" as master>
  2. <@master.layout>
  3. <style>
  4. #fm label {
  5. width: 150px;
  6. }
  7. </style>
  8. <div class="page-header">
  9. <h2>Stock Query</h2>
  10. </div>
  11. <table id="dg" class="easyui-datagrid" style="width:100%;height:460px;display: none;"
  12. data-options="pagination: true, pageSize:20, showFooter: true, singleSelect:true, fitColumns:true ,
  13. queryParams:{status: $('#status').val()},
  14. url:'/so/fqc/getStockBoxList', method:'POST', toolbar:'#tb'">
  15. <thead>
  16. <tr>
  17. <th data-options="field:'orderNo',width:100">SO No</th>
  18. <th data-options="field:'boxNo',width:100">Box No</th>
  19. <th data-options="field:'partNo',width:100">Part No</th>
  20. <th data-options="field:'rollNums',width:100,align:'right'">Count of Rolls</th>
  21. <th data-options="field:'boxQty',width:100,align:'right'">Box Qty</th>
  22. <th data-options="field:'status',width:100" >Status</th>
  23. <th data-options="field:'createdBy',width:100">Created By</th>
  24. <th data-options="field:'createdDate',width:100,formatter:formatStringTime">Created Time</th>
  25. <th data-options="field:'updatedBy',width:100">Updated By</th>
  26. <th data-options="field:'updatedDate',width:100,formatter:formatStringTime">Updated Time</th>
  27. <th data-options="field:'labelDate',width:100,formatter:formatStringDate">Label Tracking Date</th>
  28. </tr>
  29. </thead>
  30. </table>
  31. <div id="tb" style="padding:10px 5px;display: none;">
  32. <div>
  33. SO No: <input class="easyui-textbox" id="orderNo" style="width:110px">
  34. Part No: <input class="easyui-textbox" id="partNo" style="width:110px">
  35. Box No: <input class="easyui-textbox" id="boxNo" style="width:110px">
  36. Box Status: <select class="easyui-combobox" name="status" id="status" style="width:90px;">
  37. <option value="ALL">ALL</option>
  38. <option value="1">Created</option>
  39. <option value="2">Packing</option>
  40. <option value="3">Packed</option>
  41. <option value="4">Received</option>
  42. </select>
  43. <a href="#nowhere" id="queryLink" class="easyui-linkbutton" iconCls="icon-search">Search</a>
  44. <a class="easyui-linkbutton" iconCls="icon-add" onclick="downInventoryExcel()">Export to Excel</a>
  45. </div>
  46. </div>
  47. <script>
  48. $(window).resize(function () {
  49. $("#dg").datagrid({"height": $(window).height() - $(".datagrid").offset().top - 20});
  50. });
  51. $(function () {
  52. $(window).resize();
  53. });
  54. //格式化字符串时间
  55. function formatStringDate(value, row){
  56. if(null == value || '' == value){
  57. return '';
  58. }
  59. value = value.substring(0, 10);
  60. return value;
  61. }
  62. $("#queryLink").click(function(){
  63. var dg = $('#dg').datagrid({
  64. queryParams: {
  65. orderNo: $("#orderNo").val(),
  66. partNo: $("#partNo").val(),
  67. boxNo: $("#boxNo").val(),
  68. status: $("#status").val()
  69. }
  70. });
  71. });
  72. //主表功能
  73. function formatDeliveryAction(value, row){
  74. //根据状态区分不同的按钮
  75. let status = row.status;
  76. let tags = '';
  77. if('Freeze' == status){
  78. tags += '<a onclick="performingTask(\''+row.boxNo+'\')" class="disabled-underscore">unFrozen</a>';
  79. }
  80. return tags;
  81. }
  82. //解冻
  83. function performingTask(boxNo){
  84. $.messager.confirm('Confirm','Are you sure to unFrozen the box: <b>'+boxNo+'</b> ?', function(r){
  85. if (r){
  86. //取到当前的行
  87. delay(function(){
  88. //调用方法
  89. updateFreezeTask(boxNo);
  90. }, 500);
  91. }
  92. });
  93. }
  94. //解冻功能
  95. function updateFreezeTask(boxNo){
  96. let username = $('#current_username').val();
  97. let postData = {'boxNo': boxNo, 'updatedBy': username};
  98. //保存或修改数据
  99. /*//序列化
  100. postData = JSON.stringify(postData);*/
  101. //post请求类型修改
  102. $('#saveButton').addClass("button-disabled");
  103. $.ajaxSetup({
  104. contentType: "application/x-www-form-urlencoded"});
  105. $.post('/inventory/updateFreezeTask', postData, function(result){
  106. $('#saveButton').removeClass("button-disabled");
  107. if (result.success){
  108. //刷新主表数据
  109. $('#dg').datagrid('reload');
  110. } else {
  111. $.messager.alert('error',result.msg, 'error');
  112. }
  113. },'json');
  114. $.ajaxSetup({
  115. contentType: " application/x-www-form-urlencoded"});
  116. }
  117. //延时操作
  118. var delay = (function(){
  119. var timer = 0;
  120. return function(callback, ms){
  121. clearTimeout (timer);
  122. timer = setTimeout(callback, ms);
  123. };
  124. })();
  125. //获取状态
  126. function getStatement(value, row){
  127. if(value=="Delivered"){
  128. return "Shipped";
  129. }else if(value=="Stocked"){
  130. return "In-Stock";
  131. }else if(value=="Freeze"){
  132. return "Frozen";
  133. }
  134. }
  135. /* //TT扫描入库和IFS入库数量如果不相等,异常提醒
  136. $('#dg').datagrid({
  137. rowStyler:function(index,row){
  138. if(row.confirmBy !=null&&row.confirmBy !=''){
  139. return ''
  140. }
  141. if (Math.abs(Number(row.qtyComplete)-Number(row.qtyCompleteIfs))>=row.packageQty){
  142. return 'background-color:#ff534d;font-weight:bold;';
  143. }
  144. }
  145. }); */
  146. </script>
  147. </@master.layout>