InvManualOut.js 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  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["RFIDBarCode"] = $("#RFIDBarCode").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["OneInTimeBegin"] = OneInTimebegin;
  45. //queryJson["OneInTimeEnd"] = OneInTimeend;
  46. //queryJson["ProductTimeBegin"] = ProductTimebegin;
  47. //queryJson["ProductTimeEnd"] = ProductTimeend;
  48. queryJson["Grade"] = $("#Grade").val();
  49. queryJson["ExecStateCode"] = $("#ExecStateCode").lrselectGet();
  50. queryJson["InvStateCode"] = 3;
  51. queryJson["IsSurplus"] = $("#IsSurplus").lrselectGet();
  52. queryJson["IsRework"] = $("#IsRework").lrselectGet();
  53. queryJson["IsFast"] = $("#IsFast").lrselectGet();
  54. queryJson["IsFail"] = $("#IsFail").lrselectGet();
  55. queryJson["IsBack"] = $("#IsBack").lrselectGet();
  56. queryJson["ExecStateCode"] = $("#ExecStateCode").lrselectGet();
  57. page.search({ queryJson: JSON.stringify(queryJson) });
  58. }, 250);
  59. // 查询
  60. $('#btn_Search').on('click', function () {
  61. var keyword = $('#txt_Keyword').val();
  62. page.search({ queryJson: JSON.stringify({ keyword: $('#txt_Keyword').val(), InvStateCode: 3 }) });
  63. });
  64. // 刷新
  65. $('#lr_refresh').on('click', function () {
  66. location.reload();
  67. });
  68. // 手动出库
  69. $('#lr_edit').on('click', function ()
  70. {
  71. selectRowsData = $('#gridtable').jfGridGet("rowdata");
  72. if (selectRowsData.length == 0) {
  73. learun.alert.error('未选择行!');
  74. return false;
  75. }
  76. learun.layerForm({
  77. id: 'form',
  78. title: '选择出库地址',
  79. url: top.$.rootUrl + '/PTManager/Inventorys/Form',
  80. width: 700,
  81. height: 300,
  82. callBack: function (id) {
  83. return top[id].acceptClick(refreshGirdData);
  84. }
  85. });
  86. });
  87. $('#OneInTime').lrdatetime({
  88. dfdata: [
  89. { name: '今天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00') }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
  90. { 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') } },
  91. { 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') } },
  92. { 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') } },
  93. ],
  94. // 月
  95. mShow: false,
  96. premShow: false,
  97. // 季度
  98. jShow: false,
  99. prejShow: false,
  100. // 年
  101. ysShow: false,
  102. yxShow: false,
  103. preyShow: false,
  104. yShow: false,
  105. // 默认
  106. dfvalue: 'all',
  107. selectfn: function (begin, end) {
  108. OneInTimebegin = begin;
  109. OneInTimeend = end;
  110. }
  111. });
  112. $('#ProductTime').lrdatetime({
  113. dfdata: [
  114. { name: '今天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00') }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
  115. { 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') } },
  116. { 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') } },
  117. { 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') } },
  118. ],
  119. // 月
  120. mShow: false,
  121. premShow: false,
  122. // 季度
  123. jShow: false,
  124. prejShow: false,
  125. // 年
  126. ysShow: false,
  127. yxShow: false,
  128. preyShow: false,
  129. yShow: false,
  130. // 默认
  131. dfvalue: 'all',
  132. selectfn: function (begin, end) {
  133. ProductTimebegin = begin;
  134. ProductTimeend = end;
  135. }
  136. });
  137. $('#ExecStateCode').lrselect({
  138. url: top.$.rootUrl + '/PTManager/Enums/GetExecStateList',
  139. maxHeight: 180,
  140. allowSearch: false
  141. });
  142. $('#InvStateCode').lrselect({
  143. url: top.$.rootUrl + '/PTManager/Enums/GetInvStateList',
  144. maxHeight: 180,
  145. allowSearch: false
  146. });
  147. $('#IsSurplus').lrselect({
  148. url: top.$.rootUrl + '/PTManager/Enums/YesNoList',
  149. maxHeight: 60,
  150. allowSearch: false
  151. });
  152. $('#IsRework').lrselect({
  153. url: top.$.rootUrl + '/PTManager/Enums/YesNoList',
  154. maxHeight: 60,
  155. allowSearch: false
  156. });
  157. $('#IsFast').lrselect({
  158. url: top.$.rootUrl + '/PTManager/Enums/YesNoList',
  159. maxHeight: 60,
  160. allowSearch: false
  161. });
  162. $('#IsFail').lrselect({
  163. url: top.$.rootUrl + '/PTManager/Enums/YesNoList',
  164. maxHeight: 60,
  165. allowSearch: false
  166. });
  167. $('#IsBack').lrselect({
  168. url: top.$.rootUrl + '/PTManager/Enums/YesNoList',
  169. maxHeight: 60,
  170. allowSearch: false
  171. });
  172. },
  173. // 初始化列表
  174. initGird: function () {
  175. $('#gridtable').jfGrid({
  176. url: top.$.rootUrl + '/PTManager/Inventorys/GetPageList',
  177. headData: [
  178. { label: "容器条码", name: "ContGrpBarCode", width: 120, align: "left" },
  179. { label: "材料号", name: "InvBarCode", width: 110, align: "left" },
  180. { label: "库存状态", name: "InvStateName", width: 80, align: "left", sortname: "InvStateCode" },
  181. { label: "冻结/放行状态", name: "ExecStateName", width: 80, align: "left", sortname: "ExecStateCode" },
  182. { label: "巷道", name: "Tunnel", width: 50, align: "left" },
  183. { label: "货位号", name: "Code", width: 100, align: "left" },
  184. {
  185. label: "货位状态", name: "CellState", width: 80, align: "left"
  186. , formatter: function (cellvalue) {
  187. if (cellvalue == 0) {
  188. return '<span class=\"label label-success\" >启用</span>';
  189. } else {
  190. return '<span class=\"label label-default\" >禁用</span>';
  191. }
  192. }
  193. },
  194. { label: "行", name: "PutRow", width:40, align: "left" },
  195. { label: "列", name: "PutCol", width: 40, align: "left" },
  196. { label: "层", name: "PutLayer", width:40, align: "left" },
  197. { label: "首次入库时间", name: "OneInTime", width: 130, align: "left" },
  198. { label: "生产时间", name: "ProductTime", width: 130, align: "left" },
  199. { label: "物料编码", name: "MatCode", width: 80, align: "left" },
  200. { label: "物料名称", name: "MatName", width: 80, align: "left" },
  201. { label: "牌号", name: "BrandNo", width: 80, align: "left" },
  202. { label: "炉号", name: "BoilerNo", width: 80, align: "left" },
  203. { label: "包号", name: "PackNo", width: 80, align: "left" },
  204. { label: "碳当量", name: "CaQty", width: 80, align: "left" },
  205. { label: "总重量", name: "TolWQty", width: 80, align: "left" },
  206. { label: "净重", name: "NetWQty", width: 80, align: "left" },
  207. { label: "皮重", name: "TareWQty", width: 80, align: "left" },
  208. { label: "长度", name: "LengthQty", width: 80, align: "left" },
  209. { label: "RFID编号", name: "RFIDBarCode", width: 80, align: "left" },
  210. {
  211. label: "是否余料", name: "IsSurplus", width:70, align: "left"
  212. , formatter: function (cellvalue) {
  213. if (cellvalue == true) {
  214. return '<span class=\"label label-success\" >是</span>';
  215. } else {
  216. return '<span class=\"label label-default\" >否</span>';
  217. }
  218. }
  219. },
  220. {
  221. label: "是否退料", name: "IsBack", width: 70, align: "left"
  222. , formatter: function (cellvalue) {
  223. if (cellvalue == true) {
  224. return '<span class=\"label label-success\" >是</span>';
  225. } else {
  226. return '<span class=\"label label-default\" >否</span>';
  227. }
  228. }
  229. },
  230. {
  231. label: "是否锁定", name: "ExecStateCode", width: 80, align: "left"
  232. , formatter: function (cellvalue) {
  233. if (cellvalue == "InvState_Normal") {
  234. return '<span class=\"label label-default\" >否</span>';
  235. } else {
  236. return '<span class=\"label label-success\" >是</span>';
  237. }
  238. }
  239. },
  240. {
  241. label: "返工标记", name: "IsRework", width: 60, align: "left", formatter: function (cellvalue) {
  242. if (cellvalue == true) {
  243. return '<span class=\"label label-success\" >是</span>';
  244. } else {
  245. return '<span class=\"label label-default\" >否</span>';
  246. }
  247. }
  248. },
  249. {
  250. label: "快投标记", name: "IsFast", width: 60, align: "left", formatter: function (cellvalue) {
  251. if (cellvalue == true) {
  252. return '<span class=\"label label-success\" >是</span>';
  253. } else {
  254. return '<span class=\"label label-default\" >否</span>';
  255. }
  256. }
  257. },
  258. {
  259. label: "是否异常", name: "IsFail", width: 60, align: "left", formatter: function (cellvalue) {
  260. if (cellvalue == true) {
  261. return '<span class=\"label label-success\" >是</span>';
  262. } else {
  263. return '<span class=\"label label-default\" >否</span>';
  264. }
  265. }
  266. },
  267. { label: "异常原因", name: "FailReason", width: 80, align: "left" },
  268. { label: "等级", name: "Grade", width: 80, align: "left" },
  269. { label: "退料原因", name: "BackReason", width: 80, align: "left" },
  270. { label: "工序订单号", name: "ProcessDocsCode", width: 120, align: "left" },
  271. { label: "生产机台号", name: "ProductMachCode", width: 80, align: "left" },
  272. { label: "产线编号", name: "ProductLineNo", width: 80, align: "left" },
  273. { label: "入库单号", name: "InDocsNo", width: 120, align: "left" },
  274. { label: "入库单行号", name: "InDocsRowNo", width: 120, align: "left" },
  275. { label: "创建时间", name: "AddTime", width: 150, align: "left" },
  276. { label: "更新时间", name: "EditTime", width: 150, align: "left" },
  277. ],
  278. mainId: 'Id',
  279. isPage: true,
  280. reloadSelected: true,
  281. autowWidth: true,
  282. sidx: 'AddTime',
  283. sord: 'DESC',
  284. isMultiselect: true,
  285. });
  286. page.search({ queryJson: JSON.stringify({ keyword: $('#txt_Keyword').val(), InvStateCode: 3 }) });
  287. },
  288. search: function (param) {
  289. param = param || { queryJson: JSON.stringify({InvStateCode: 3 }) };
  290. $('#gridtable').jfGridSet('reload', param);
  291. }
  292. };
  293. refreshGirdData = function () {
  294. page.search();
  295. };
  296. page.init();
  297. }