InvManualPalletizingOut.js 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324
  1. var refreshGirdData;
  2. var OneInTimebegin = '';
  3. var OneInTimeend = '';
  4. var ProductTimebegin = '';
  5. var ProductTimeend = '';
  6. var logbegin = '';
  7. var logend = '';
  8. var selectRowsData;
  9. var bootstrap = function ($, learun) {
  10. "use strict";
  11. var page = {
  12. init: function () {
  13. page.initGird();
  14. page.bind();
  15. },
  16. bind: function () {
  17. $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
  18. // 调用后台查询
  19. // queryJson 查询条件
  20. var oneintime = $('#lr_search_date_OneInTime').html();
  21. if (oneintime == '') {
  22. OneInTimebegin = '';
  23. OneInTimeend = '';
  24. }
  25. var producttime = $('#lr_search_date_ProductTime').html();
  26. if (producttime == '') {
  27. ProductTimebegin = '';
  28. ProductTimeend = '';
  29. }
  30. console.log(queryJson);
  31. //queryJson["MatCode"] = $("#MatCode").val();
  32. //queryJson["MatName"] = $("#MatName").val();
  33. //queryJson["BoxBarCode"] = $("#BoxBarCode").val();
  34. //queryJson["InvBarCode"] = $("#InvBarCode").val();
  35. //queryJson["Tunnel"] = $("#Tunnel").val();
  36. //queryJson["Code"] = $("#Code").val();
  37. //queryJson["PutRow"] = $("#PutRow").val();
  38. //queryJson["PutCol"] = $("#PutCol").val();
  39. //queryJson["PutLayer"] = $("#PutLayer").val();
  40. //queryJson["OneInTimeBegin"] = $("#OneInTimebegin").val();
  41. //queryJson["OneInTimeEnd"] = $("#OneInTimeend").val();
  42. //queryJson["ProductTimeBegin"] = $("#ProductTimebegin").val();
  43. //queryJson["ProductTimeEnd"] = $("#ProductTimeend").val();
  44. //queryJson["Grade"] = $("#Grade").val();
  45. //queryJson["DoseNo"] = $("#DoseNo").val();
  46. //queryJson["ContGrpType"] = $("#ContGrpType").lrselectGet();
  47. //queryJson["InvStateCode"] = 3;
  48. //queryJson["IsSurplus"] = $("#IsSurplus").lrselectGet();
  49. //queryJson["IsRework"] = $("#IsRework").lrselectGet();
  50. //queryJson["IsFast"] = $("#IsFast").lrselectGet();
  51. //queryJson["IsFail"] = $("#IsFail").lrselectGet();
  52. //queryJson["IsBlack"] = $("#IsBlack").lrselectGet();
  53. //queryJson["ExecStateCode"] = $("#ExecStateCode").lrselectGet();
  54. queryJson["WbGroupCode"] = $("#WbGroupCode").val();
  55. //queryJson["SolderCount"] = $("#SolderCount").val();
  56. //queryJson["HoldTime"] = $("#HoldTime").val();
  57. //queryJson["IsControlpanel"] = $("#IsControlpanel").lrselectGet();
  58. //queryJson["IsTorsChk"] = $("#IsTorsChk").lrselectGet();
  59. //queryJson["IsCore"] = $("#IsCore").lrselectGet();
  60. queryJson["IsTimeOut"] = $("#IsTimeOut").lrselectGet();
  61. queryJson["HwTypeCode"] = $("#HwType").lrselectGet();
  62. //queryJson["TorsChkQty"] = $("#TorsChkQty").lrselectGet();
  63. queryJson["Wind"] = $("#Wind").val();
  64. queryJson["SkuCode"] = $("#SkuCode").val();
  65. page.search({ queryJson: JSON.stringify(queryJson) });
  66. }, 250);
  67. // 查询
  68. $('#btn_Search').on('click', function () {
  69. var keyword = $('#txt_Keyword').val();
  70. page.search({ queryJson: JSON.stringify({ keyword: $('#txt_Keyword').val(), InvStateCode: 3 }) });
  71. });
  72. // 刷新
  73. $('#lr_refresh').on('click', function () {
  74. location.reload();
  75. });
  76. $('#lr_ManualPalletizing').on('click', function () {
  77. var url = weburl + "api/Sx/ManualPalletizingStockOut";
  78. learun.layerConfirm('是否确认手动码垛!', function (res, index) {
  79. if (res) {
  80. $.ajax({
  81. type: 'post',
  82. //data: { location: postData.map((item) => item.Id) },
  83. data: JSON.stringify({
  84. "equip": 'L',
  85. "sku": $("#SkuCode").val(),
  86. "wbGroupCode": $("#WbGroupCode").val(),
  87. "wind": $("#Wind").val(),
  88. "hwType": $("#HwType").lrselectGet(),
  89. "isTimeOut": String($("#IsTimeOut").lrselectGet()),
  90. }),
  91. dataType: 'json',
  92. contentType: "application/json;charset=utf-8",
  93. url: url,
  94. success: function (response) {
  95. //resCode 200 resMsg "成功"
  96. refreshGirdData();
  97. top.layer.close( index);
  98. learun.alert.info(response.resMsg);
  99. }
  100. });
  101. }
  102. });
  103. });
  104. $('#OneInTime').lrdatetime({
  105. dfdata: [
  106. { name: '今天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00') }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
  107. { name: '近7天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'd', -6) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
  108. { name: '近1个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -1) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
  109. { name: '近3个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -3) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
  110. ],
  111. // 月
  112. mShow: false,
  113. premShow: false,
  114. // 季度
  115. jShow: false,
  116. prejShow: false,
  117. // 年
  118. ysShow: false,
  119. yxShow: false,
  120. preyShow: false,
  121. yShow: false,
  122. // 默认
  123. dfvalue: 'all',
  124. selectfn: function (begin, end) {
  125. OneInTimebegin = begin;
  126. OneInTimeend = end;
  127. }
  128. });
  129. $('#ProductTime').lrdatetime({
  130. dfdata: [
  131. { name: '今天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00') }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
  132. { name: '近7天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'd', -6) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
  133. { name: '近1个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -1) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
  134. { name: '近3个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -3) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
  135. ],
  136. // 月
  137. mShow: false,
  138. premShow: false,
  139. // 季度
  140. jShow: false,
  141. prejShow: false,
  142. // 年
  143. ysShow: false,
  144. yxShow: false,
  145. preyShow: false,
  146. yShow: false,
  147. // 默认
  148. dfvalue: 'all',
  149. selectfn: function (begin, end) {
  150. ProductTimebegin = begin;
  151. ProductTimeend = end;
  152. }
  153. });
  154. $('#IsTimeOut').lrselect({
  155. url: top.$.rootUrl + '/SXManager/Enums/YesNoList',
  156. maxHeight: 60,
  157. allowSearch: false
  158. });
  159. $('#HwType').lrselect({
  160. url: top.$.rootUrl + '/SXManager/Enums/HwTypeList',
  161. maxHeight: 60,
  162. allowSearch: false
  163. });
  164. },
  165. // 初始化列表
  166. initGird: function () {
  167. $('#gridtable').jfGrid({
  168. url: top.$.rootUrl + '/SXManager/Inventorys/GetPageList2',
  169. headData: [
  170. { label: "容器条码", name: "ContGrpBarCode", width: 130, align: "left" },
  171. {
  172. label: "库存类型", name: "ContGrpTypeName", width: 60, align: "left", sortname: "ContGrpType"
  173. },
  174. //{ label: "材料号", name: "InvBarCode", width: 110, align: "left" },
  175. { label: "库存状态", name: "InvStateName", width: 80, align: "left", sortname: "InvStateCode" },
  176. //{ label: "巷道", name: "Tunnel", width: 50, align: "left" },
  177. //{ label: "货位号", name: "Code", width: 100, align: "left" },
  178. {
  179. label: "货位状态", name: "CellState", width: 80, align: "left"
  180. , formatter: function (cellvalue) {
  181. if (cellvalue == 0) {
  182. return '<span class=\"label label-success\" >启用</span>';
  183. } else {
  184. return '<span class=\"label label-default\" >禁用</span>';
  185. }
  186. }
  187. },
  188. //{ label: "箱号", name: "BoxBarCode", width: 120, align: "left" },
  189. { label: "SKU", name: "SkuCode", width: 80, align: "left" },
  190. { label: "机器组", name: "WbGroupCode", width: 80, align: "left" },
  191. { label: "行", name: "PutRow", width:40, align: "left" },
  192. { label: "列", name: "PutCol", width: 40, align: "left" },
  193. { label: "层", name: "PutLayer", width:40, align: "left" },
  194. { label: "首次入库时间", name: "OneInTime", width: 130, align: "left" },
  195. { label: "生产时间", name: "ProductTime", width: 130, align: "left" },
  196. { label: "物料编码", name: "MatCode", width: 80, align: "left" },
  197. { label: "物料名称", name: "MatName", width: 80, align: "left" },
  198. { label: "预锁单号", name: "SalesDoc", width: 120, align: "left" },
  199. { label: "总重量", name: "TolWQty", width: 80, align: "left" },
  200. { label: "净重", name: "NetWQty", width: 80, align: "left" },
  201. { label: "皮重", name: "TareWQty", width: 80, align: "left" },
  202. { label: "长度", name: "LengthQty", width: 80, align: "left" },
  203. {
  204. label: "是否余料", name: "IsSurplus", width: 80, align: "left"
  205. , formatter: function (cellvalue) {
  206. if (cellvalue == true) {
  207. return '<span class=\"label label-success\" >是</span>';
  208. } else {
  209. return '<span class=\"label label-default\" >否</span>';
  210. }
  211. }
  212. },
  213. {
  214. label: "是否黑盘", name: "IsBlack", width: 80, align: "left"
  215. , formatter: function (cellvalue) {
  216. if (cellvalue == true) {
  217. return '<span class=\"label label-success\" >是</span>';
  218. } else {
  219. return '<span class=\"label label-default\" >否</span>';
  220. }
  221. }
  222. },
  223. {
  224. label: "返工标记", name: "IsRework", width: 80, align: "left", formatter: function (cellvalue) {
  225. if (cellvalue == true) {
  226. return '<span class=\"label label-success\" >是</span>';
  227. } else {
  228. return '<span class=\"label label-default\" >否</span>';
  229. }
  230. }
  231. },
  232. {
  233. label: "快投标记", name: "IsFast", width: 80, align: "left", formatter: function (cellvalue) {
  234. if (cellvalue == true) {
  235. return '<span class=\"label label-success\" >是</span>';
  236. } else {
  237. return '<span class=\"label label-default\" >否</span>';
  238. }
  239. }
  240. },
  241. {
  242. label: "是否异常", name: "IsFail", width: 80, align: "left", formatter: function (cellvalue) {
  243. if (cellvalue == true) {
  244. return '<span class=\"label label-success\" >是</span>';
  245. } else {
  246. return '<span class=\"label label-default\" >否</span>';
  247. }
  248. }
  249. },
  250. {
  251. label: "是否锁定", name: "ExecStateCode", width: 80, align: "left"
  252. , formatter: function (cellvalue) {
  253. if (cellvalue == "InvState_Normal") {
  254. return '<span class=\"label label-default\" >否</span>';
  255. } else {
  256. return '<span class=\"label label-success\" >是</span>';
  257. }
  258. }
  259. },
  260. {
  261. label: "是否已扭转", name: "TorsChkQty", width: 80, align: "left"
  262. , formatter: function (cellvalue) {
  263. if (cellvalue == true) {
  264. return '<span class=\"label label-success\" >是</span>';
  265. } else {
  266. return '<span class=\"label label-default\" >否</span>';
  267. }
  268. }
  269. },
  270. { label: "预锁库存", name: "PreStock", width: 120, align: "left" },
  271. { label: "绕向", name: "Wind", width: 120, align: "left" },
  272. { label: "异常原因", name: "FailReason", width: 80, align: "left" },
  273. { label: "等级", name: "Grade", width: 80, align: "left" },
  274. { label: "退料原因", name: "BackReason", width: 80, align: "left" },
  275. { label: "工序订单号", name: "ProcessDocsCode", width: 120, align: "left" },
  276. { label: "生产机台号", name: "ProductMachCode", width: 80, align: "left" },
  277. { label: "产线编号", name: "ProductLineNo", width: 80, align: "left" },
  278. { label: "入库单号", name: "InDocsNo", width: 120, align: "left" },
  279. { label: "入库单行号", name: "InDocsRowNo", width: 120, align: "left" },
  280. { label: "扭转检测弓高", name: "TorsChkChord", width: 80, align: "left" },
  281. { label: "弓高是否合格", name: "TorsChkChordIsGood", width: 80, align: "left" },
  282. { label: "扭转检测平直度", name: "TorsChkFlatness", width: 80, align: "left" },
  283. { label: "平直度是否合格", name: "TorsChkFlatnessIsGood", width: 80, align: "left" },
  284. { label: "扭转机台工位", name: "TorsChkStation", width: 80, align: "left" },
  285. { label: "扭转值是否合格", name: "TorsChkValueIsGood", width: 80, align: "left" },
  286. { label: "创建时间", name: "AddTime", width: 150, align: "left" },
  287. { label: "更新时间", name: "EditTime", width: 150, align: "left" },
  288. ],
  289. mainId: 'Id',
  290. isPage: true,
  291. reloadSelected: true,
  292. autowWidth: true,
  293. sidx: 'AddTime',
  294. sord: 'DESC',
  295. isMultiselect: true,
  296. });
  297. page.search({ queryJson: JSON.stringify({ keyword: $('#txt_Keyword').val(), InvStateCode: 3 }) });
  298. },
  299. search: function (param) {
  300. param = param || { queryJson: JSON.stringify({InvStateCode: 3 }) };
  301. $('#gridtable').jfGridSet('reload', param);
  302. }
  303. };
  304. refreshGirdData = function () {
  305. page.search();
  306. };
  307. page.init();
  308. }