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.

522 lines
24 KiB

3 weeks ago
  1. @{
  2. ViewBag.Title = "Index";
  3. Layout = "~/Views/Shared/_Index.cshtml";
  4. }
  5. <script src="~/Content/js/datepicker/WdatePicker.js"></script>
  6. <script>
  7. $(document).ready(function () {
  8. $("input.cell").keyup(function (e) {
  9. switch (e.keyCode) {
  10. // up arrow
  11. case 40:
  12. $(this).parent()
  13. .parent()
  14. .next()
  15. .children("td")
  16. .children("input.cell[name="
  17. + $(this).attr("name") + "]")
  18. .focus();
  19. break;
  20. // down arrow
  21. case 38:
  22. $(this).parent()
  23. .parent()
  24. .prev()
  25. .children("td")
  26. .children("input.cell[name="
  27. + $(this).attr("name") + "]")
  28. .focus();
  29. break;
  30. }
  31. });
  32. });</script>
  33. <script>
  34. var _Clos = new Array();
  35. $("#F_Type").val("2");
  36. $(function () {
  37. SetCols();
  38. gridList();
  39. })
  40. function SetCols() {
  41. $.ajax({
  42. url: "/Print/SelectColumnName?" + Math.random(),
  43. dataType: "json",
  44. async: false,
  45. success: function (data) {
  46. var cols = new Array();
  47. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  48. cols.push(collast);
  49. var collast = { label: '工单ID', name: 'RCVCode', width: 120, align: 'left' };
  50. cols.push(collast);
  51. if (data != null && data.length > 0) {
  52. DateList = data;
  53. for (var i = 0; i < data.length; i++) {
  54. var ColName = data[i].ColName;
  55. var ColCode = data[i].ColCode;
  56. var obj = new Array();
  57. obj = {
  58. label: ColName,
  59. name: ColCode,
  60. width: 80,
  61. align: "left"
  62. }
  63. cols.push(obj);
  64. }
  65. }
  66. $.ajax({
  67. url: "/Print/SelectTableColumnName?" + Math.random(),
  68. dataType: "json",
  69. async: false,
  70. success: function (data) {
  71. if (data != null && data.length > 0) {
  72. DateList = data;
  73. for (var i = 0; i < data.length; i++) {
  74. var TableCode = data[i].TableCode;
  75. if (TableCode == "ICSMOIssue") {
  76. var Code = data[i].Code;
  77. var Name = data[i].Name;
  78. var obj = new Array();
  79. obj = {
  80. label: Name,
  81. name: Code,
  82. width: 80,
  83. align: "left"
  84. }
  85. cols.push(obj);
  86. }
  87. if (TableCode == "ICSInventory") {
  88. var Code = data[i].Code;
  89. var Name = data[i].Name;
  90. var obj = new Array();
  91. obj = {
  92. label: Name,
  93. name: Code,
  94. width: 80,
  95. align: "left"
  96. }
  97. cols.push(obj);
  98. //cols1.push(obj);
  99. }
  100. }
  101. }
  102. _Clos = cols;
  103. //_Clos1 = cols1;
  104. }
  105. });
  106. _Clos = cols;
  107. }
  108. });
  109. }
  110. function gridList() {
  111. var $gridList = $("#gridList");
  112. var queryJson = {
  113. POCode: $("#txt_POCode").val(),
  114. InvCode: $("#txt_InvCode").val(),
  115. InvName: $("#txt_InvName").val(),
  116. WHCode: $("#txt_WHCode").val(),
  117. WHName: $("#txt_WHName").val(),
  118. //BatchCode: $("#txt_BatchCode").val(),
  119. FromTime: $("#FromTime").val(),
  120. ToTime: $("#ToTime").val(),
  121. F_Type: $("#F_Type").val(),
  122. //POStatus: $("#selShow").val()
  123. }
  124. $gridList.dataGrid({
  125. url: "/MFWMS/ICSMOIssueSendBack/GetMOIssueSendBackApplyNeg" + "?" + Math.random(),
  126. postData: { queryJson: JSON.stringify(queryJson) },
  127. height: $(window).height() - 200,
  128. width: $(window).width() - 300,
  129. colModel: [
  130. { label: '出库单号', name: 'RCVCode', width: 120, align: 'left' },
  131. //{ label: '仓库代码', name: 'WHCode', width: 150, align: 'left' },
  132. //{ label: '仓库名称', name: 'WarehouseName', width: 150, align: 'left' },
  133. {
  134. label: "状态", name: "Status", width: 80, align: "left",
  135. formatter: function (cellvalue) {
  136. if (cellvalue == "1") {
  137. return "开立";
  138. } else if (cellvalue == "2") {
  139. return "审核";
  140. } else if (cellvalue == "3") {
  141. return "关闭";
  142. }
  143. else { return ""; }
  144. }
  145. },
  146. {
  147. label: "类型", name: "Type", width: 80, align: "left",
  148. formatter: function (cellvalue) {
  149. if (cellvalue == "1") {
  150. return "蓝字出库单";
  151. }
  152. else { return "红字出库单"; }
  153. }
  154. },
  155. { label: '操作人', name: 'MUSERName', width: 150, align: 'left' },
  156. { label: '操作时间', name: 'MTIME', width: 150, align: 'left' },
  157. ],
  158. shrinkToFit: true,//宽度自适应
  159. autoWidth: true,
  160. gridComplete: function () {
  161. },
  162. pager: "#gridPager",
  163. sortorder: "desc",
  164. sortname: 'MTIME',
  165. viewrecords: true,
  166. multiselect: true,
  167. //beforeSelectRow: function (rowid, e) {
  168. // $("#gridList").jqGrid('resetSelection');
  169. // return (true);
  170. //},
  171. subGrid: true, // (1)开启子表格支持
  172. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  173. $("#gridList").jqGrid("setSelection", rowid, false);
  174. bindSubGrid(subgrid_id, rowid)
  175. }
  176. });
  177. $("#warehouse a.btn-default").click(function () {
  178. $("#warehouse a.btn-default").removeClass("active");
  179. $(this).addClass("active");
  180. $('#btn_search').trigger("click");
  181. });
  182. $("#btn_search").click(function () {
  183. var warehouse = $("#warehouse a.active").attr('data-value');
  184. var queryJson = {
  185. POCode: $("#txt_POCode").val(),
  186. InvCode: $("#txt_InvCode").val(),
  187. InvName: $("#txt_InvName").val(),
  188. WHCode: $("#txt_WHCode").val(),
  189. WHName: $("#txt_WHName").val(),
  190. //BatchCode: $("#txt_BatchCode").val(),
  191. FromTime: $("#FromTime").val(),
  192. ToTime: $("#ToTime").val(),
  193. F_Type: $("#F_Type").val(),
  194. //POStatus: $("#selShow").val()
  195. }
  196. $gridList.jqGrid('setGridParam', {
  197. postData: { queryJson: JSON.stringify(queryJson) },
  198. }).trigger('reloadGrid');
  199. });
  200. }
  201. function bindSubGrid(subgrid_id, rowid) {
  202. $("#gridList").jqGrid("setSelection", rowid, false);
  203. var subgrid_table_id;
  204. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  205. var subgrid_pager_id;
  206. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  207. // (5)动态添加子报表的table和pager
  208. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  209. var RCVCode = $("#gridList").jqGrid('getRowData', rowid).RCVCode;
  210. // (6)创建jqGrid对象
  211. $("#" + subgrid_table_id).dataGrid({
  212. cellEdit: true,
  213. url: "/MFWMS/ICSMOIssueSendBack/GetMOIssueApplyNegDetail?RCVCode=" + RCVCode + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  214. colModel: [
  215. { label: "主键", name: "ID", hidden: true, key: true },
  216. { label: '行号', name: 'Sequence', width: 120, align: 'left' },
  217. { label: '来源工单号', name: 'SourceCode', width: 180, align: 'left' },
  218. { label: '来源工单行号', name: 'SourceSequence', width: 180, align: 'left' },
  219. { label: '物料代码', name: 'InvCode', width: 120, align: 'left' },
  220. { label: '物料名称', name: 'InvName', width: 120, align: 'left', },
  221. { label: '数量', name: 'Quantity', width: 120, align: 'left' },
  222. { label: '已发数量', name: 'RCVQuantity', width: 120, align: 'left' },
  223. { label: '仓库代码', name: 'WHCode', width: 120, align: 'left' },
  224. { label: '仓库名称', name: 'WHName', width: 120, align: 'left' },
  225. { label: '辅计量', name: 'Amount', width: 120, align: 'left' },
  226. { label: '创建人', name: 'CreatePerson', width: 120, align: 'left' },
  227. { label: '创建时间', name: 'CreateDateTime', width: 120, align: 'left' },
  228. { label: '操作人', name: 'MUSER', width: 150, align: 'left' },
  229. { label: '操作人名称', name: 'MUSERName', width: 150, align: 'left' },
  230. { label: '操作时间', name: 'MTIME', width: 150, align: 'left' },
  231. ],
  232. sortname: 'Sequence',
  233. shrinkToFit: true,//宽度自适应
  234. //multiselect: true,
  235. prmNames: { search: "search" },
  236. viewrecords: true,
  237. height: "100%",
  238. rowNum: 20,
  239. pager: subgrid_pager_id,
  240. });
  241. }
  242. //function btn_Delete() {
  243. // var objArr = '';
  244. // var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  245. // for (var i = 0; i < objList.length; i++) {
  246. // var rowId = objList[i];
  247. // var rowData = $("#gridList").jqGrid('getRowData', rowId);
  248. // objArr += "'" + rowData.RCVCode + "',";
  249. // }
  250. // if (objArr == '') {
  251. // $.modalAlertNew("WMS00001");
  252. // return;
  253. // }
  254. // $.deleteForm({
  255. // url: "/WMS/ICSMOIssue/DeleteMOIssueApplyNeg" + "?" + Math.random(),
  256. // param: { keyValue: JSON.stringify(objArr) },
  257. // success: function () {
  258. // $.currentWindow().$("#gridList").trigger("reloadGrid");
  259. // }
  260. // })
  261. //}
  262. ////修改类型
  263. //function btn_update() {
  264. // var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
  265. // if (ids.length != 1) {
  266. // $.modalAlertNew("WMS00006");
  267. // return;
  268. // }
  269. // for (var i in ids) {
  270. // var rowData = jQuery("#gridList").jqGrid("getRowData", ids[i]);
  271. // //ID
  272. // var ID = "";
  273. // ID = rowData.ID;
  274. // var RCVCode = "";
  275. // RCVCode = rowData.RCVCode;
  276. // Type = rowData.Type == "蓝字出库单" ? 1 : 2;
  277. // $.modalOpen({
  278. // id: "Details",
  279. // title: "修改",
  280. // url: "/WMS/ICSMOIssue/ICSMOIssueEdit?ID=" + ID + "&RCVCode=" + RCVCode + "&Type=" + Type + "&At=" + '1' + "&" + Math.random(),
  281. // width: "1000px",
  282. // height: "1200px",
  283. // callBack: function (iframeId) {
  284. // top.frames[iframeId].submitForm();
  285. // }
  286. // });
  287. // }
  288. //}
  289. //function btnCreate() {
  290. // $.modalOpen({
  291. // id: "BRGCodeAdd",
  292. // title: "新增",
  293. // url: "/WMS/ICSMOIssue/ICSMOIssueEdit?" + "At=" + '0' + "&" + Math.random(),
  294. // width: "1000px",
  295. // height: "1200px",
  296. // callBack: function (iframeId) {
  297. // top.frames[iframeId].submitForm();
  298. // }
  299. // });
  300. //}
  301. function btn_Audit() {
  302. var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
  303. var RCVCodeArr = '';
  304. if (ids.length != 1) {
  305. $.modalAlertNew("WMS00087");
  306. return;
  307. }
  308. var RoleEnCode = '@NFine.Code.OperatorProvider.Provider.GetCurrent().UserCode'
  309. var WorkPoint = '@NFine.Code.OperatorProvider.Provider.GetCurrent().Location'
  310. var date = new Date();
  311. for (var i in ids) {
  312. RCVCode = $("#gridList").jqGrid('getRowData', ids[i]).RCVCode;
  313. Status = $("#gridList").jqGrid('getRowData', ids[i]).Status;
  314. if (Status != '开立') {
  315. $.modalAlertNew("WMS00088");
  316. return;
  317. }
  318. RCVCodeArr = RCVCodeArr == '' ? "'" + RCVCode + "'" : RCVCodeArr + ",'" + RCVCode + "'";
  319. }
  320. $.submitForm({
  321. url: "/MFWMS/ICSMOIssueSendBack/ICSMOIssueSendBackAndReduceStocks?" + Math.random(),
  322. param: { keyValue: RCVCodeArr },
  323. success: function () {
  324. $.currentWindow().$("#gridList").trigger("reloadGrid");
  325. }
  326. })
  327. }
  328. function btn_AbstentionOfAudit() {
  329. var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
  330. var RCVCodeArr = '';
  331. if (ids.length != 1) {
  332. $.modalAlertNew("WMS00087");
  333. return;
  334. }
  335. var RoleEnCode = '@NFine.Code.OperatorProvider.Provider.GetCurrent().UserCode'
  336. var WorkPoint = '@NFine.Code.OperatorProvider.Provider.GetCurrent().Location'
  337. var date = new Date();
  338. for (var i in ids) {
  339. RCVCode = $("#gridList").jqGrid('getRowData', ids[i]).RCVCode;
  340. Status = $("#gridList").jqGrid('getRowData', ids[i]).Status;
  341. if (Status != '审核') {
  342. $.modalAlertNew("WMSOur0008");
  343. return;
  344. }
  345. RCVCodeArr = RCVCodeArr == '' ? "'" + RCVCode + "'" : RCVCodeArr + ",'" + RCVCode + "'";
  346. }
  347. $.submitForm({
  348. url: "/MFWMS/ICSMOIssueSendBack/ICSMOIssueSendBackAuditRollback?" + Math.random(),
  349. param: { keyValue: RCVCodeArr },
  350. success: function () {
  351. $.currentWindow().$("#gridList").trigger("reloadGrid");
  352. }
  353. })
  354. }
  355. </script>
  356. <iframe id="ifrm" src="" width="0" height="0"></iframe>
  357. <script>
  358. </script>
  359. <div class="topPanel" style="height: 100px">
  360. <div class="toolbar">
  361. <div class="btn-group">
  362. <a id="NF-Audit" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btn_Audit()"><i class="fa fa-pencil-square-o"></i>审核</a>
  363. <a id="NF-RollbackAudit" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btn_AbstentionOfAudit()"><i class="fa fa-pencil-square-o"></i>弃审</a>
  364. @*<a id="NF-Delete" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btn_Delete()"><i class="fa fa-trash-o"></i>删除</a>*@
  365. <a class="btn btn-primary" onclick="$.reload()"><span class="glyphicon glyphicon-refresh"></span></a>
  366. </div>
  367. @*<div class="btn-group" style="display:block;padding-left:2px;">
  368. <a class="btn btn-primary" id="downPrintControl" href="~/PrintActivex.exe" style="display:none">点击下载打印组件</a>
  369. <a id="NF-Import" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btn_Import()"><i class="fa fa-pencil-square-o"></i>导入</a>
  370. <a id="NF-Rebind" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btn_Rebind()"><i class="fa fa-pencil-square-o"></i>重新绑定</a>
  371. <a id="NF-Looks" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btnCreateLook()"><i class="fa fa-pencil-square-o"></i>查看子件信息</a>
  372. </div>*@
  373. <script>$('.toolbar').authorizeButton()</script>
  374. </div>
  375. <div class="search">
  376. <table>
  377. <tr>
  378. <td class="POCodeShow" style="text-align:right;"><label class="lglabel HideItems" id="POCodeShowLable" for="txt_POCode">&nbsp;&nbsp;&nbsp;&nbsp;生产退库单号</label>:</td>
  379. <td class="POCodeShow">
  380. <div class="input-group HideItems">
  381. <input id="txt_POCode" type="text" class="form-control" style="width: 130px;">
  382. </div>
  383. </td>
  384. @*<td class="HideItems" style="text-align:right;"><label class="lglabel HideItems" for="txt_VenCode">&nbsp;&nbsp;&nbsp;&nbsp;供应商代码</label>:</td>
  385. <td class="HideItems">
  386. <div class="input-group HideItems">
  387. <input id="txt_VenCode" type="text" class="form-control HideItems" style="width: 130px;">
  388. </div>
  389. </td>
  390. <td class="HideItems" style="text-align:right;"><label class="lglabel HideItems" for="txt_VenName">&nbsp;&nbsp;&nbsp;&nbsp;供应商名称</label>:</td>
  391. <td class="HideItems">
  392. <div class="input-group HideItems">
  393. <input id="txt_VenName" type="text" class="form-control HideItems" style="width: 130px;">
  394. </div>
  395. </td>*@
  396. <td class="HideItems" style="text-align:right;"><label class="lglabel HideItems" for="txt_WHCode">&nbsp;&nbsp;&nbsp;&nbsp;仓库编码</label>:</td>
  397. <td>
  398. <div class="input-group HideItems">
  399. <input id="txt_WHCode" type="text" class="form-control HideItems" style="width: 130px;">
  400. </div>
  401. </td>
  402. <td style="text-align:right;"><label class="lglabel" for="txt_WHName">&nbsp;&nbsp;&nbsp;&nbsp;仓库名称</label>:</td>
  403. <td>
  404. <div class="input-group">
  405. <input id="txt_WHName" type="text" class="form-control" style="width: 130px;">
  406. </div>
  407. </td>
  408. @*<td class="HideItems2" style="text-align:right;"><label class="lglabel HideItems2" for="txt_VenName">&nbsp;&nbsp;&nbsp;&nbsp;源头单据号</label>:</td>
  409. <td class="HideItems2">
  410. <div class="input-group HideItems2">
  411. <input id="txt_SCode" type="text" class="form-control HideItems2" style="width: 130px;">
  412. </div>
  413. </td>*@
  414. <td class="HideItemsTime" style="text-align:right;"><label class="lglabel HideItemsTime" for="txt_VenName">&nbsp;&nbsp;&nbsp;&nbsp;日期(从)</label>:</td>
  415. <td class="HideItemsTime">
  416. <div class="input-group HideItemsTime">
  417. <input id="FromTime" name="FromTime" type="text" class="form-control HideItemsTime" style="width:130px;" maxlength="10" onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd' })" placeholder="日期(从)" />
  418. </div>
  419. </td>
  420. <td class="HideItemsTime" style="text-align:right;"><label class="lglabel HideItemsTime" for="txt_VenName">&nbsp;&nbsp;&nbsp;&nbsp;日期(到)</label>:</td>
  421. <td class="HideItemsTime">
  422. <div class="input-group HideItemsTime">
  423. <input id="ToTime" name="ToTime" type="text" class="form-control HideItemsTime" style="width:130px;" maxlength="10" onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd' })" placeholder="日期(到)" />
  424. </div>
  425. </td>
  426. </tr>
  427. <tr>
  428. <td class="HideItems" style="text-align:right;"><label class="lglabel HideItems" for="txt_InvCode">&nbsp;&nbsp;&nbsp;&nbsp;物料编码</label>:</td>
  429. <td>
  430. <div class="input-group HideItems">
  431. <input id="txt_InvCode" type="text" class="form-control HideItems" style="width: 130px;">
  432. </div>
  433. </td>
  434. <td style="text-align:right;"><label class="lglabel" for="txt_InvName">&nbsp;&nbsp;&nbsp;&nbsp;物料名称</label>:</td>
  435. <td>
  436. <div class="input-group">
  437. <input id="txt_InvName" type="text" class="form-control" style="width: 130px;">
  438. </div>
  439. </td>
  440. @*<td style="text-align:right;"><label class="lglabel" for="txt_BatchCode">&nbsp;&nbsp;&nbsp;&nbsp;批次号</label>:</td>
  441. <td>
  442. <div class="input-group">
  443. <input id="txt_BatchCode" type="text" class="form-control" style="width: 130px;">
  444. </div>
  445. </td>*@
  446. <td>
  447. <label>&nbsp;&nbsp;&nbsp;是否审核:&nbsp;&nbsp;&nbsp;&nbsp;</label>
  448. </td>
  449. <td>
  450. <div class="input-group">
  451. <select id="F_Type" name="F_Type" class="form-control" style="width: 130px;">
  452. <option value="0">显示全部</option>
  453. <option value="1">已审核</option>
  454. <option value="2" selected="selected">未审核</option>
  455. </select>
  456. </div>
  457. </td>
  458. @*<td id="GDLX">
  459. <label>&nbsp;&nbsp;&nbsp;工单类型:&nbsp;&nbsp;&nbsp;&nbsp;</label>
  460. </td>
  461. <td id="GDLX2">
  462. <div class="input-group">
  463. <select id="SelGDLX" name="SelShow" class="form-control" style="width: 130px;">
  464. </select>
  465. </div>
  466. </td>
  467. <td class="GDLX" style="display:none">
  468. <label>&nbsp;&nbsp;&nbsp;工单类型:&nbsp;&nbsp;&nbsp;&nbsp;</label>
  469. </td>
  470. <td class="GDLX" style="display:none">
  471. <div class="input-group">
  472. <select id="selShow" name="F_Target" class="form-control" style="width: 100px;">
  473. <option value="0">显示全部</option>
  474. <option value="1">已全部生成</option>
  475. <option value="2" selected="selected">未全部生成</option>
  476. </select>
  477. </div>
  478. </td>*@
  479. <td>
  480. <span class="input-group-btn">
  481. <button id="btn_search" type="button" class="btn btn-primary"><i class="fa fa-search"></i></button>
  482. </span>
  483. </td>
  484. </tr>
  485. </table>
  486. </div>
  487. </div>
  488. <div class="gridPanel">
  489. <table id="gridList"></table>
  490. <div id="gridPager"></div>
  491. </div>