纽威
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.

454 lines
20 KiB

  1. @{
  2. ViewBag.Title = "Index";
  3. Layout = "~/Views/Shared/_Index.cshtml";
  4. }
  5. <script>
  6. debugger;
  7. var _Clos = new Array();
  8. var Type = $.request("Type");
  9. var ColModelMain = [];
  10. var ColModelSub = [];
  11. var ChosenList = "";
  12. var BatchStockInArea = "";
  13. $(function () {
  14. SetCols();
  15. if (Type == '1' || Type == '2' || Type == '3' || Type == '4' || Type == '5' || Type == '6' || Type == '9') {
  16. $(".HideItems").css('display', 'none');
  17. }
  18. if (Type != '9') {
  19. $(".Workorder").css('display', 'none');
  20. }
  21. if (Type != '7') {
  22. $(".txt_DNID1").css('display', 'none');
  23. }
  24. gridList7();
  25. })
  26. //显示的列内容
  27. function SetCols() {
  28. $.ajax({
  29. url: "/Print/SelectColumnName?" + Math.random(),
  30. dataType: "json",
  31. async: false,
  32. success: function (data) {
  33. var cols = new Array();
  34. if (Type == '7') {
  35. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  36. cols.push(collast);
  37. var collast = { label: '单据号', name: 'DNCode', width: 120, align: 'left' };
  38. cols.push(collast);
  39. var collast = { label: '行号', name: 'Sequence', width: 50, align: 'left' };
  40. cols.push(collast);
  41. var collast = { label: '采购订单号', name: 'DNID', width: 120, align: 'left' };
  42. cols.push(collast);
  43. var collast = { label: '采购订单行号', name: 'DNDetailID', width: 120, align: 'left' };
  44. cols.push(collast);
  45. var collast = { label: '料品编码', name: 'InvCode', width: 120, align: 'left' };
  46. cols.push(collast);
  47. var collast = { label: '物料描述', name: 'InvoDescribe', width: 120, align: 'left' };
  48. cols.push(collast);
  49. var collast = { label: '区域', name: 'Area', width: 120, align: 'left' };
  50. cols.push(collast);
  51. var collast = { label: '仓库', name: 'WHCode', width: 50, align: 'left' };
  52. cols.push(collast);
  53. var collast = { label: '检验修改日期', name: 'ModificationDate', width: 100, align: 'left' };
  54. cols.push(collast);
  55. var collast = { label: '供应商代码', name: 'VenCode', width: 120, align: 'left' };
  56. cols.push(collast);
  57. var collast = { label: '供应商名称', name: 'VenName', width: 120, align: 'left' };
  58. cols.push(collast);
  59. var collast = { label: '站点', name: 'WorkPoint', width: 50, align: 'left' };
  60. cols.push(collast);
  61. var collast = { label: '检验类型', name: 'InspectionType', width: 50, align: 'left' };
  62. cols.push(collast);
  63. var collast = { label: '不合格单号', name: 'NonconformingForm', width: 120, align: 'left' };
  64. cols.push(collast);
  65. var collast = { label: '图号', name: 'DrawingNo', width: 120, align: 'left' };
  66. cols.push(collast);
  67. var collast = { label: '图标', name: 'Version1', width: 50, align: 'left' };
  68. cols.push(collast);
  69. var collast = { label: '修改时间', name: 'ModificationDate', width: 50, align: 'left' };
  70. cols.push(collast);
  71. var collast = { label: '特殊库存标识', name: 'StockIndicator', width: 50, align: 'left', hidden: true };
  72. cols.push(collast);
  73. var collast = { label: '辅助描述', name: 'InvDesc', width: 50, align: 'left' };
  74. cols.push(collast);
  75. var collast = { label: '料品型号', name: 'InvStd', width: 150, align: 'left', hidden: true };
  76. cols.push(collast);
  77. var collast = { label: '料品单位', name: 'InvUnit', width: 50, align: 'left' };
  78. cols.push(collast);
  79. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  80. cols.push(collast);
  81. var collast = { label: '是否过账', name: 'SAPMark', width: 60, align: 'left', };
  82. cols.push(collast);
  83. var collast = { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', };
  84. cols.push(collast);
  85. var collast = { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' };
  86. cols.push(collast);
  87. var collast = { label: '区域类型', name: 'AreaType', width: 10, align: 'left', hidden: true };
  88. cols.push(collast);
  89. }
  90. if (data != null && data.length > 0) {
  91. DateList = data;
  92. for (var i = 0; i < data.length; i++) {
  93. var ColName = data[i].ColName;
  94. var ColCode = data[i].ColCode;
  95. var obj = new Array();
  96. obj = {
  97. label: ColName,
  98. name: ColCode,
  99. width: 80,
  100. align: "left"
  101. }
  102. cols.push(obj);
  103. cols1.push(obj);
  104. }
  105. }
  106. _Clos = cols;
  107. _Clos1 = cols1;
  108. }
  109. });
  110. }
  111. //*审核到货单生成条码
  112. function gridList() {
  113. debugger;
  114. var $gridList = $("#gridList");
  115. var queryJson = {
  116. POCode: $("#txt_POCode").val(),
  117. VenCode: $("#txt_VenCode").val(),
  118. VenName: $("#txt_VenName").val(),
  119. Area: $("#txt_Area").val(),
  120. Location: $("#txt_Location").val(),
  121. InvCode: $("#txt_InvCode").val(),
  122. InvName: $("#txt_InvName").val(),
  123. BatchCode: $("#txt_BatchCode").val(),
  124. Container: $("#txt_Container :checked").val(),
  125. DNID: $("#txt_DNID").val()
  126. }
  127. $gridList.dataGrid({
  128. url: "/WMS/WMSCreateItemLot/GetGridJsonSHDH" + "?" + Math.random(),
  129. postData: { queryJson: JSON.stringify(queryJson) },
  130. height: $(window).height() - 200,
  131. width: $(window).width() - 300,
  132. colModel: _Clos,
  133. width: "100%",
  134. autowidth: true,
  135. //shrinkToFit: true,
  136. gridComplete: function () {
  137. var strIds = $("#gridList").jqGrid("getDataIDs");
  138. for (var i = 0; i < strIds.length; i++) {
  139. var strValue = $("#gridList").jqGrid("getCell", strIds[i], "LOTQTY");//得到单元格数据
  140. var strValue1 = $("#gridList").jqGrid("getCell", strIds[i], "Quantity");//得到单元格数据
  141. if (strValue == strValue1) {
  142. $("#" + strIds[i]).find("td").css("background-color", "yellow");
  143. }
  144. }
  145. if (ChosenList != "") {
  146. var Chosen = ChosenList.split(',');
  147. for (var i = 0; i < Chosen.length; i++) {
  148. $("#gridList").jqGrid('setSelection', Chosen[i]);
  149. }
  150. }
  151. },
  152. pager: "#gridPager",
  153. sortname: 'ModificationDate,DNCode',
  154. sortorder: "asc",
  155. viewrecords: true,
  156. multiselect: true,
  157. beforeSelectRow: function (rowid, e) {
  158. },
  159. subGrid: false
  160. });
  161. $("#warehouse a.btn-default").click(function () {
  162. $("#warehouse a.btn-default").removeClass("active");
  163. $(this).addClass("active");
  164. $('#btn_search').trigger("click");
  165. });
  166. $("#btn_search").click(function () {
  167. var warehouse = $("#warehouse a.active").attr('data-value');
  168. var queryJson = {
  169. POCode: $("#txt_POCode").val(),
  170. VenCode: $("#txt_VenCode").val(),
  171. VenName: $("#txt_VenName").val(),
  172. Area: $("#txt_Area").val(),
  173. Location: $("#txt_Location").val(),
  174. InvCode: $("#txt_InvCode").val(),
  175. InvName: $("#txt_InvName").val(),
  176. BatchCode: $("#txt_BatchCode").val(),
  177. Container: $("#txt_Container :checked").val(),
  178. DNID: $("#txt_DNID").val()
  179. }
  180. $gridList.jqGrid('setGridParam', {
  181. postData: { queryJson: JSON.stringify(queryJson) },
  182. page: 1,
  183. }).trigger('reloadGrid');
  184. });
  185. }
  186. function fullscreen() {
  187. var docElm = document.documentElement;
  188. if (docElm.requestFullscreen) {
  189. docElm.requestFullscreen();
  190. } else if (docElm.mozRequestFullScreen) {
  191. docElm.mozRequestFullScreen();
  192. } else if (docElm.webkitRequestFullScreen) {
  193. docElm.webkitRequestFullScreen();
  194. } else if (docElm.msRequestFullscreen) {
  195. docElm.msRequestFullscreen();
  196. }
  197. $(window).bind('resize', function () {
  198. $("#gridList").setGridWidth($(window).width());
  199. }).trigger('resize');
  200. $(window).bind('resize', function () {
  201. $("#gridList").setGridHeight($(window).height());
  202. }).trigger('resize');
  203. }
  204. function btnPrint() {
  205. debugger;
  206. var mold = '';
  207. if (Type == '1') { mold = '00001'; }//生产退料生成条码
  208. if (Type == '2') { mold = '00002'; }//委外退料生成条码
  209. if (Type == '3') { mold = '00003'; }//工单成品生成条码
  210. if (Type == '4') { mold = '00004'; }//销售退货生成条码
  211. if (Type == '5') { mold = '00005'; }//其他入库生成条码
  212. if (Type == '6') { mold = '00006'; }//归还单生成条码
  213. if (Type == '7') { mold = '00007'; }//普通到货单生成条码
  214. if (Type == '8') { mold = '00008'; }//委外到货单生成条码
  215. if (Type == '9') { mold = '00009'; }//成品入库单生成条码
  216. if (Type == '10') { mold = '00010'; }//拒收单生成条码
  217. if (Type == '11') { mold = '00011'; }//委外拒收单生成条码
  218. if (Type == '12') { mold = '00012'; }//领料申请退料
  219. if (Type == '13') { mold = '00013'; }//材料出库退料
  220. if (Type == '14') { mold = '00014'; }//委外领料申请退料
  221. if (Type == '15') { mold = '00015'; }//委外材料出库退料
  222. if (Type == '16') { mold = '00016'; }//返工工单
  223. var objArr = '';
  224. var arr = [];
  225. var obj = $("#gridList").jqGrid("getRowData");
  226. for (var i = 0; i < obj.length; i++) {
  227. var $SubGird = $("#gridList_" + obj[i].ID + "_t");
  228. var rowData = $SubGird.jqGrid('getGridParam', 'selarrrow');
  229. if (rowData != "undefined" && rowData != null) {
  230. for (var j = 0; j < rowData.length; j++) {
  231. objArr += "'" + rowData[j] + "',";
  232. }
  233. objArr = objArr.slice(0, objArr.length - 1);
  234. objArr = "" + objArr + "|";
  235. arr.push(objArr);
  236. }
  237. }
  238. if (objArr == "") {
  239. $.modalAlertNew("WMS00101");
  240. return;
  241. }
  242. $.modalOpen({
  243. id: "PrintLot",
  244. title: "打印",
  245. url: "/WMS/Print/PrintView?Arguments=" + encodeURI(encodeURI(arr)) + "&mold=" + mold + "&" + Math.random(),
  246. width: "550px",
  247. height: "1000px",
  248. callBack: function (iframeId) {
  249. top.frames[iframeId].submitForm();
  250. }
  251. });
  252. }
  253. function btnBatchPrint() {
  254. debugger;
  255. var mold = '';
  256. var objArr = '';
  257. var arr = [];
  258. var obj = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  259. mold = '00007';
  260. for (var i = 0; i < obj.length; i++) {
  261. var rowId = obj[i];
  262. var rowData = $("#gridList").jqGrid('getRowData', rowId);
  263. if (rowData != "undefined" && rowData != null) {
  264. objArr += "'" + rowId + "',";
  265. objArr = objArr.slice(0, objArr.length - 1);
  266. objArr = "" + objArr + "|";
  267. arr.push(objArr);
  268. }
  269. }
  270. if (objArr == "") {
  271. $.modalAlertNew("WMS00101");
  272. return;
  273. }
  274. $.modalOpen({
  275. id: "PrintLot",
  276. title: "打印",
  277. url: "/WMS/Print/PrintView?Arguments=" + encodeURI(encodeURI(arr)) + "&mold=" + mold + "&" + Math.random(),
  278. width: "550px",
  279. height: "1000px",
  280. callBack: function (iframeId) {
  281. top.frames[iframeId].submitForm();
  282. }
  283. });
  284. }
  285. function btnGXWXCallSAP() {
  286. var DocNOList = "";
  287. var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
  288. if (ids.length == 0) {
  289. $.modalAlertNew("WMS00110");
  290. return;
  291. }
  292. for (var i in ids) {
  293. DocNOList += $("#gridList").jqGrid('getRowData', ids[i]).DNCode + ',';
  294. var SAPMark = $("#gridList").jqGrid('getRowData', ids[i]).SAPMark;
  295. if (SAPMark == "是") {
  296. $.modalAlert("单据:" + $("#gridList").jqGrid('getRowData', ids[i]).DNCode+"已经过账,请勿重复操作!", "warning");
  297. return;
  298. }
  299. }
  300. if (DocNOList != "") {
  301. $.modalConfirm("确定过账工序外协检验合格单吗?", function (r) {
  302. if (r) {
  303. $.submitForm({
  304. url: "/WMS/WMSCreateItemLot/GXWXCallSAP?DocNoList=" + DocNOList,
  305. async: false,
  306. success: function () {
  307. }
  308. })
  309. }
  310. });
  311. }
  312. }
  313. </script>
  314. <iframe id="ifrm" src="" width="0" height="0"></iframe>
  315. <script>
  316. </script>
  317. <div class="topPanel" style="height:150px;">
  318. <div class="toolbar">
  319. <div class="btn-group">
  320. <a id="NF-BatchStockIN" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btnGXWXCallSAP()"><i class="fa fa-pencil-square-o"></i>工序外协过账</a>
  321. <a id="NF-Print" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btnPrint()"><i class="fa fa-pencil-square-o"></i>打印</a>
  322. <a id="NF-BatchPrint" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btnBatchPrint()"><i class="fa fa-pencil-square-o"></i>批量打印</a>
  323. <a class="btn btn-primary" onclick="$.reload()"><span class="glyphicon glyphicon-refresh"></span></a>
  324. </div>
  325. <div class="btn-group" style="display:block;padding-left:2px;">
  326. <a class="btn btn-primary" id="downPrintControl" href="~/PrintActivex.exe" style="display:none">点击下载打印组件</a>
  327. </div>
  328. <script>$('.toolbar').authorizeButton()</script>
  329. </div>
  330. <div class="search">
  331. <table>
  332. <tr>
  333. <td style="text-align:right;"><label class="lglabel" for="txt_POCode">&nbsp;&nbsp;&nbsp;&nbsp;单据号</label>:</td>
  334. <td>
  335. <div class="input-group">
  336. <input id="txt_POCode" type="text" class="form-control" style="width: 100px;">
  337. </div>
  338. </td>
  339. <td style="text-align:right;" class=" txt_DNID1"><label class="lglabel" for="txt_DNID">&nbsp;&nbsp;&nbsp;&nbsp;采购订单号</label>:</td>
  340. <td class=" txt_DNID1">
  341. <div class="input-group">
  342. <input id="txt_DNID" type="text" class="form-control" style="width: 100px;">
  343. </div>
  344. </td>
  345. <td class="HideItems" style="text-align:right;"><label class="lglabel HideItems" for="txt_VenCode">&nbsp;&nbsp;&nbsp;&nbsp;供应商代码</label>:</td>
  346. <td class="HideItems">
  347. <div class="input-group HideItems">
  348. <input id="txt_VenCode" type="text" class="form-control HideItems" style="width: 100px;">
  349. </div>
  350. </td>
  351. <td class="HideItems" style="text-align:right;"><label class="lglabel HideItems" for="txt_VenName">&nbsp;&nbsp;&nbsp;&nbsp;供应商名称</label>:</td>
  352. <td class="HideItems">
  353. <div class="input-group HideItems">
  354. <input id="txt_VenName" type="text" class="form-control HideItems" style="width: 100px;">
  355. </div>
  356. </td>
  357. <td style="text-align:right;"><label class="lglabel " for="txt_Area">&nbsp;&nbsp;&nbsp;&nbsp;区域</label>:</td>
  358. <td>
  359. <div class="input-group ">
  360. <input id="txt_Area" type="text" class="form-control " style="width: 100px;">
  361. </div>
  362. </td>
  363. <td class="Workorder" style="text-align:right;"><label class="lglabel " for="txt_OrderNumber">&nbsp;&nbsp;&nbsp;&nbsp;生产订单</label>:</td>
  364. <td class="Workorder">
  365. <div class="input-group ">
  366. <input id="txt_OrderNumber" type="text" class="form-control " style="width: 100px;">
  367. </div>
  368. </td>
  369. @*<td class="Workorder" style="text-align:right;"><label class="lglabel " for="txt_Area9">&nbsp;&nbsp;&nbsp;&nbsp;存储区域</label>:</td>
  370. <td class="Workorder" >
  371. <div class="input-group ">
  372. <input id="txt_Area9" type="text" class="form-control " style="width: 100px;">
  373. </div>
  374. </td>*@
  375. </tr>
  376. <tr>
  377. <td style="text-align:right;"><label class="lglabel " for="txt_Location">&nbsp;&nbsp;&nbsp;&nbsp;仓库</label>:</td>
  378. <td>
  379. <div class="input-group ">
  380. <input id="txt_Location" type="text" class="form-control " style="width: 100px;">
  381. </div>
  382. </td>
  383. @*<td style="text-align:right;"><label class="lglabel" for="txt_Location">&nbsp;&nbsp;&nbsp;&nbsp;库存地点</label>:</td>
  384. <td>
  385. <div class="input-group">
  386. <input id="txt_Location" type="text" class="form-control" style="width: 100px;">
  387. </div>
  388. </td>*@
  389. <td style="text-align:right;"><label class="lglabel" for="txt_InvCode">&nbsp;&nbsp;&nbsp;&nbsp;料品编码</label>:</td>
  390. <td>
  391. <div class="input-group">
  392. <input id="txt_InvCode" type="text" class="form-control" style="width: 100px;">
  393. </div>
  394. </td>
  395. <td style="text-align:right;"><label class="lglabel" for="txt_InvName">&nbsp;&nbsp;&nbsp;&nbsp;物料描述</label>:</td>
  396. <td>
  397. <div class="input-group">
  398. <input id="txt_InvName" type="text" class="form-control" style="width: 100px;">
  399. </div>
  400. </td>
  401. <td style="text-align:right;"><label class="lglabel" for="txt_BatchCode">&nbsp;&nbsp;&nbsp;&nbsp;批次号</label>:</td>
  402. <td>
  403. <div class="input-group">
  404. <input id="txt_BatchCode" type="text" class="form-control" style="width: 100px;">
  405. </div>
  406. </td>
  407. <td>
  408. <span class="input-group-btn">
  409. <button id="btn_search" type="button" class="btn btn-primary"><i class="fa fa-search"></i></button>
  410. </span>
  411. </td>
  412. </tr>
  413. </table>
  414. </div>
  415. </div>
  416. <div class="gridPanel">
  417. <table id="gridList"></table>
  418. <div id="gridPager"></div>
  419. </div>