InvManualOut.js 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426
  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["TorsChkQty"] = $("#TorsChkQty").lrselectGet();
  62. queryJson["Wind"] = $("#Wind").val();
  63. page.search({ queryJson: JSON.stringify(queryJson) });
  64. }, 250);
  65. // 查询
  66. $('#btn_Search').on('click', function () {
  67. var keyword = $('#txt_Keyword').val();
  68. page.search({ queryJson: JSON.stringify({ keyword: $('#txt_Keyword').val(), InvStateCode: 3 }) });
  69. });
  70. // 刷新
  71. $('#lr_refresh').on('click', function () {
  72. location.reload();
  73. });
  74. // 手动出库
  75. $('#lr_edit').on('click', function ()
  76. {
  77. selectRowsData = $('#gridtable').jfGridGet("rowdata");
  78. if (selectRowsData.length == 0) {
  79. learun.alert.error('未选择行!');
  80. return false;
  81. }
  82. learun.layerForm({
  83. id: 'form',
  84. title: '选择出库地址',
  85. url: top.$.rootUrl + '/SXManager/Inventorys/Form',
  86. width: 700,
  87. height: 300,
  88. callBack: function (id) {
  89. return top[id].acceptClick(refreshGirdData);
  90. }
  91. });
  92. });
  93. $('#lr_OvertimePalletizing').on('click', function () {
  94. var url = weburl + "api/Sx/SpecialStockOut";
  95. learun.layerConfirm('是否确认超时码垛!', function (res, index) {
  96. if (res) {
  97. $.ajax({
  98. type: 'post',
  99. //data: { location: postData.map((item) => item.Id) },
  100. data: JSON.stringify({
  101. "equip": 'L'
  102. }),
  103. dataType: 'json',
  104. contentType: "application/json;charset=utf-8",
  105. url: url,
  106. success: function (response) {
  107. //resCode 200 resMsg "成功"
  108. refreshGirdData();
  109. top.layer.close( index);
  110. learun.alert.info(response.resMsg);
  111. }
  112. });
  113. }
  114. });
  115. });
  116. $('#lr_OvertimePalletizingCHA').on('click', function () {
  117. var url = weburl + "api/Sx/ChongraoPackStockOut";
  118. learun.layerConfirm('是否确认重绕盘超时码垛!', function (res, index) {
  119. if (res) {
  120. $.ajax({
  121. type: 'post',
  122. //data: { location: postData.map((item) => item.Id) },
  123. data: JSON.stringify({
  124. "equip": 'L'
  125. }),
  126. dataType: 'json',
  127. contentType: "application/json;charset=utf-8",
  128. url: url,
  129. success: function (response) {
  130. //resCode 200 resMsg "成功"
  131. refreshGirdData();
  132. top.layer.close(index);
  133. learun.alert.info(response.resMsg);
  134. }
  135. });
  136. }
  137. });
  138. });
  139. $('#lr_pass').on('click', function () {
  140. var postData = $('#gridtable').jfGridGet("rowdata");
  141. if (postData.length == 0) {
  142. learun.alert.error('未选择行!');
  143. return false;
  144. }
  145. learun.layerConfirm('是否确认放行该箱号!', function (res) {
  146. if (res) {
  147. learun.postForm(top.$.rootUrl + '/SXManager/Inventorys/UpdatePassStates', { ids: JSON.stringify(postData.map((item) => item.Id)) }, function () {
  148. refreshGirdData();
  149. });
  150. }
  151. });
  152. });
  153. $('#OneInTime').lrdatetime({
  154. dfdata: [
  155. { name: '今天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00') }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
  156. { 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') } },
  157. { 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') } },
  158. { 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') } },
  159. ],
  160. // 月
  161. mShow: false,
  162. premShow: false,
  163. // 季度
  164. jShow: false,
  165. prejShow: false,
  166. // 年
  167. ysShow: false,
  168. yxShow: false,
  169. preyShow: false,
  170. yShow: false,
  171. // 默认
  172. dfvalue: 'all',
  173. selectfn: function (begin, end) {
  174. OneInTimebegin = begin;
  175. OneInTimeend = end;
  176. }
  177. });
  178. $('#ProductTime').lrdatetime({
  179. dfdata: [
  180. { name: '今天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00') }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
  181. { 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') } },
  182. { 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') } },
  183. { 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') } },
  184. ],
  185. // 月
  186. mShow: false,
  187. premShow: false,
  188. // 季度
  189. jShow: false,
  190. prejShow: false,
  191. // 年
  192. ysShow: false,
  193. yxShow: false,
  194. preyShow: false,
  195. yShow: false,
  196. // 默认
  197. dfvalue: 'all',
  198. selectfn: function (begin, end) {
  199. ProductTimebegin = begin;
  200. ProductTimeend = end;
  201. }
  202. });
  203. $('#ContGrpType').lrselect({
  204. url: top.$.rootUrl + '/SXManager/Enums/GetContGrpTypeList',
  205. maxHeight: 180,
  206. allowSearch: false
  207. });
  208. $('#InvStateCode').lrselect({
  209. url: top.$.rootUrl + '/SXManager/Enums/GetInvStateList',
  210. maxHeight: 180,
  211. allowSearch: false
  212. });
  213. $('#ExecStateCode').lrselect({
  214. url: top.$.rootUrl + '/SXManager/Enums/InvLockStateList',
  215. maxHeight: 60,
  216. allowSearch: false
  217. });
  218. $('#IsSurplus').lrselect({
  219. url: top.$.rootUrl + '/SXManager/Enums/YesNoList',
  220. maxHeight: 60,
  221. allowSearch: false
  222. });
  223. $('#IsRework').lrselect({
  224. url: top.$.rootUrl + '/SXManager/Enums/YesNoList',
  225. maxHeight: 60,
  226. allowSearch: false
  227. });
  228. $('#IsFast').lrselect({
  229. url: top.$.rootUrl + '/SXManager/Enums/YesNoList',
  230. maxHeight: 60,
  231. allowSearch: false
  232. });
  233. $('#IsFail').lrselect({
  234. url: top.$.rootUrl + '/SXManager/Enums/YesNoList',
  235. maxHeight: 60,
  236. allowSearch: false
  237. });
  238. $('#IsBlack').lrselect({
  239. url: top.$.rootUrl + '/SXManager/Enums/YesNoList',
  240. maxHeight: 60,
  241. allowSearch: false
  242. });
  243. $('#IsControlpanel').lrselect({
  244. url: top.$.rootUrl + '/SXManager/Enums/YesNoList',
  245. maxHeight: 60,
  246. allowSearch: false
  247. });
  248. $('#IsTorsChk').lrselect({
  249. url: top.$.rootUrl + '/SXManager/Enums/YesNoList',
  250. maxHeight: 60,
  251. allowSearch: false
  252. });
  253. $('#IsCore').lrselect({
  254. url: top.$.rootUrl + '/SXManager/Enums/YesNoList',
  255. maxHeight: 60,
  256. allowSearch: false
  257. });
  258. $('#IsTimeOut').lrselect({
  259. url: top.$.rootUrl + '/SXManager/Enums/YesNoList',
  260. maxHeight: 60,
  261. allowSearch: false
  262. });
  263. $('#TorsChkQty').lrselect({
  264. url: top.$.rootUrl + '/SXManager/Enums/YesNoList',
  265. maxHeight: 60,
  266. allowSearch: false
  267. });
  268. },
  269. // 初始化列表
  270. initGird: function () {
  271. $('#gridtable').jfGrid({
  272. url: top.$.rootUrl + '/SXManager/Inventorys/GetPageList',
  273. headData: [
  274. { label: "容器条码", name: "ContGrpBarCode", width: 130, align: "left" },
  275. {
  276. label: "库存类型", name: "ContGrpTypeName", width: 60, align: "left", sortname: "ContGrpType"
  277. },
  278. //{ label: "材料号", name: "InvBarCode", width: 110, align: "left" },
  279. { label: "库存状态", name: "InvStateName", width: 80, align: "left", sortname: "InvStateCode" },
  280. { label: "巷道", name: "Tunnel", width: 50, align: "left" },
  281. { label: "货位号", name: "Code", width: 100, align: "left" },
  282. {
  283. label: "货位状态", name: "CellState", width: 80, align: "left"
  284. , formatter: function (cellvalue) {
  285. if (cellvalue == 0) {
  286. return '<span class=\"label label-success\" >启用</span>';
  287. } else {
  288. return '<span class=\"label label-default\" >禁用</span>';
  289. }
  290. }
  291. },
  292. { label: "箱号", name: "BoxBarCode", width: 120, align: "left" },
  293. { label: "SKU", name: "HWBarCode", width: 80, align: "left" },
  294. { label: "行", name: "PutRow", width:40, align: "left" },
  295. { label: "列", name: "PutCol", width: 40, align: "left" },
  296. { label: "层", name: "PutLayer", width:40, align: "left" },
  297. { label: "首次入库时间", name: "OneInTime", width: 130, align: "left" },
  298. { label: "生产时间", name: "ProductTime", width: 130, align: "left" },
  299. { label: "物料编码", name: "MatCode", width: 80, align: "left" },
  300. { label: "物料名称", name: "MatName", width: 80, align: "left" },
  301. { label: "预锁单号", name: "SalesDoc", width: 120, align: "left" },
  302. { label: "总重量", name: "TolWQty", width: 80, align: "left" },
  303. { label: "净重", name: "NetWQty", width: 80, align: "left" },
  304. { label: "皮重", name: "TareWQty", width: 80, align: "left" },
  305. { label: "长度", name: "LengthQty", width: 80, align: "left" },
  306. {
  307. label: "是否余料", name: "IsSurplus", width: 80, align: "left"
  308. , formatter: function (cellvalue) {
  309. if (cellvalue == true) {
  310. return '<span class=\"label label-success\" >是</span>';
  311. } else {
  312. return '<span class=\"label label-default\" >否</span>';
  313. }
  314. }
  315. },
  316. {
  317. label: "是否黑盘", name: "IsBlack", width: 80, align: "left"
  318. , formatter: function (cellvalue) {
  319. if (cellvalue == true) {
  320. return '<span class=\"label label-success\" >是</span>';
  321. } else {
  322. return '<span class=\"label label-default\" >否</span>';
  323. }
  324. }
  325. },
  326. {
  327. label: "返工标记", name: "IsRework", width: 80, align: "left", formatter: function (cellvalue) {
  328. if (cellvalue == true) {
  329. return '<span class=\"label label-success\" >是</span>';
  330. } else {
  331. return '<span class=\"label label-default\" >否</span>';
  332. }
  333. }
  334. },
  335. {
  336. label: "快投标记", name: "IsFast", width: 80, align: "left", formatter: function (cellvalue) {
  337. if (cellvalue == true) {
  338. return '<span class=\"label label-success\" >是</span>';
  339. } else {
  340. return '<span class=\"label label-default\" >否</span>';
  341. }
  342. }
  343. },
  344. {
  345. label: "是否异常", name: "IsFail", width: 80, align: "left", formatter: function (cellvalue) {
  346. if (cellvalue == true) {
  347. return '<span class=\"label label-success\" >是</span>';
  348. } else {
  349. return '<span class=\"label label-default\" >否</span>';
  350. }
  351. }
  352. },
  353. {
  354. label: "是否锁定", name: "ExecStateCode", width: 80, align: "left"
  355. , formatter: function (cellvalue) {
  356. if (cellvalue == "InvState_Normal") {
  357. return '<span class=\"label label-default\" >否</span>';
  358. } else {
  359. return '<span class=\"label label-success\" >是</span>';
  360. }
  361. }
  362. },
  363. {
  364. label: "是否已扭转", name: "TorsChkQty", width: 80, align: "left"
  365. , formatter: function (cellvalue) {
  366. if (cellvalue == true) {
  367. return '<span class=\"label label-success\" >是</span>';
  368. } else {
  369. return '<span class=\"label label-default\" >否</span>';
  370. }
  371. }
  372. },
  373. { label: "预锁库存", name: "PreStock", width: 120, align: "left" },
  374. { label: "绕向", name: "Wind", width: 120, align: "left" },
  375. { label: "异常原因", name: "FailReason", width: 80, align: "left" },
  376. { label: "等级", name: "Grade", width: 80, align: "left" },
  377. { label: "退料原因", name: "BackReason", width: 80, align: "left" },
  378. { label: "工序订单号", name: "ProcessDocsCode", width: 120, align: "left" },
  379. { label: "生产机台号", name: "ProductMachCode", width: 80, align: "left" },
  380. { label: "产线编号", name: "ProductLineNo", width: 80, align: "left" },
  381. { label: "入库单号", name: "InDocsNo", width: 120, align: "left" },
  382. { label: "入库单行号", name: "InDocsRowNo", width: 120, align: "left" },
  383. { label: "扭转检测弓高", name: "TorsChkChord", width: 80, align: "left" },
  384. { label: "弓高是否合格", name: "TorsChkChordIsGood", width: 80, align: "left" },
  385. { label: "扭转检测平直度", name: "TorsChkFlatness", width: 80, align: "left" },
  386. { label: "平直度是否合格", name: "TorsChkFlatnessIsGood", width: 80, align: "left" },
  387. { label: "扭转机台工位", name: "TorsChkStation", width: 80, align: "left" },
  388. { label: "扭转值是否合格", name: "TorsChkValueIsGood", width: 80, align: "left" },
  389. { label: "创建时间", name: "AddTime", width: 150, align: "left" },
  390. { label: "更新时间", name: "EditTime", width: 150, align: "left" },
  391. ],
  392. mainId: 'Id',
  393. isPage: true,
  394. reloadSelected: true,
  395. autowWidth: true,
  396. sidx: 'AddTime',
  397. sord: 'DESC',
  398. isMultiselect: true,
  399. });
  400. page.search({ queryJson: JSON.stringify({ keyword: $('#txt_Keyword').val(), InvStateCode: 3 }) });
  401. },
  402. search: function (param) {
  403. param = param || { queryJson: JSON.stringify({InvStateCode: 3 }) };
  404. $('#gridtable').jfGridSet('reload', param);
  405. }
  406. };
  407. refreshGirdData = function () {
  408. page.search();
  409. };
  410. page.init();
  411. }