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.

475 lines
22 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. // 001出库 002退货
  35. var moduleType = $.request("Type");
  36. $("#F_AuditStatus").val("2");
  37. $("#F_SdnQty").val("2");
  38. var _Clos = new Array();
  39. $(function () {
  40. SetCols();
  41. gridList();
  42. if (moduleType == "002") {
  43. $(".td_SdnQty").css('display', 'none');
  44. }
  45. })
  46. function SetCols() {
  47. $.ajax({
  48. url: "/Print/SelectColumnName?" + Math.random(),
  49. dataType: "json",
  50. async: false,
  51. success: function (data) {
  52. var cols = new Array();
  53. var collast = { label: "主键", name: "ID", hidden: true, key: true };
  54. cols.push(collast);
  55. var collast = { label: '工单ID', name: 'SDNCode', width: 120, align: 'left' };
  56. cols.push(collast);
  57. if (data != null && data.length > 0) {
  58. DateList = data;
  59. for (var i = 0; i < data.length; i++) {
  60. var ColName = data[i].ColName;
  61. var ColCode = data[i].ColCode;
  62. var obj = new Array();
  63. obj = {
  64. label: ColName,
  65. name: ColCode,
  66. width: 80,
  67. align: "left"
  68. }
  69. cols.push(obj);
  70. }
  71. }
  72. $.ajax({
  73. url: "/Print/SelectTableColumnName?" + Math.random(),
  74. dataType: "json",
  75. async: false,
  76. success: function (data) {
  77. if (data != null && data.length > 0) {
  78. DateList = data;
  79. for (var i = 0; i < data.length; i++) {
  80. var TableCode = data[i].TableCode;
  81. if (TableCode == "ICSSDN") {
  82. var Code = data[i].Code;
  83. var Name = data[i].Name;
  84. var obj = new Array();
  85. obj = {
  86. label: Name,
  87. name: Code,
  88. width: 80,
  89. align: "left"
  90. }
  91. cols.push(obj);
  92. }
  93. if (TableCode == "ICSInventory") {
  94. var Code = data[i].Code;
  95. var Name = data[i].Name;
  96. var obj = new Array();
  97. obj = {
  98. label: Name,
  99. name: Code,
  100. width: 80,
  101. align: "left"
  102. }
  103. cols.push(obj);
  104. //cols1.push(obj);
  105. }
  106. }
  107. }
  108. _Clos = cols;
  109. //_Clos1 = cols1;
  110. }
  111. });
  112. _Clos = cols;
  113. }
  114. });
  115. }
  116. function gridList() {
  117. var $gridList = $("#gridList");
  118. var queryJson = {
  119. POCode: $("#txt_POCode").val(),
  120. InvCode: $("#txt_InvCode").val(),
  121. InvName: $("#txt_InvName").val(),
  122. WHCode: $("#txt_WHCode").val(),
  123. WHName: $("#txt_WHName").val(),
  124. //BatchCode: $("#txt_BatchCode").val(),
  125. FromTime: $("#FromTime").val(),
  126. ToTime: $("#ToTime").val(),
  127. AuditStatus: $("#F_AuditStatus").val(),
  128. SDNQtyFlag: $("#F_SdnQty").val(),
  129. }
  130. $gridList.dataGrid({
  131. url: "/MFWMS/ICSSSD/GetSDNBackApplyNeg?Type=" + moduleType + "&" + Math.random(),
  132. postData: { queryJson: JSON.stringify(queryJson) },
  133. height: $(window).height() - 200,
  134. width: $(window).width() - 300,
  135. colModel: [
  136. { label: '出库单号', name: 'SDNCode', width: 120, align: 'left' },
  137. //{ label: '仓库代码', name: 'WHCode', width: 150, align: 'left' },
  138. //{ label: '仓库名称', name: 'WarehouseName', width: 150, align: 'left' },
  139. //{
  140. // label: "状态", name: "Status", width: 80, align: "left",
  141. // formatter: function (cellvalue) {
  142. // if (cellvalue == "1") {
  143. // return "开立";
  144. // } else if (cellvalue == "2") {
  145. // return "审核";
  146. // } else if (cellvalue == "3") {
  147. // return "关闭";
  148. // }
  149. // else { return ""; }
  150. // }
  151. //},
  152. {
  153. label: "状态", name: "AccomplishFlag", width: 80, align: "left",
  154. formatter: function (cellvalue) {
  155. if (cellvalue == "0") {
  156. return "待审核";
  157. }
  158. else {
  159. return "已审核";
  160. }
  161. }
  162. },
  163. {
  164. label: "类型", name: "Type", width: 80, align: "left",
  165. formatter: function (cellvalue) {
  166. if (cellvalue == "1") {
  167. return "发货";
  168. } else if (cellvalue == "2") {
  169. return "退货";
  170. }
  171. else { return "销售订单"; }
  172. }
  173. },
  174. { label: '操作人', name: 'MUSERName', width: 150, align: 'left' },
  175. { label: '操作时间', name: 'MTIME', width: 150, align: 'left' },
  176. ],
  177. shrinkToFit: true,//宽度自适应
  178. autoWidth: true,
  179. gridComplete: function () {
  180. },
  181. pager: "#gridPager",
  182. sortorder: "desc",
  183. sortname: 'MTIME',
  184. viewrecords: true,
  185. multiselect: true,
  186. //beforeSelectRow: function (rowid, e) {
  187. // $("#gridList").jqGrid('resetSelection');
  188. // return (true);
  189. //},
  190. subGrid: true, // (1)开启子表格支持
  191. subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  192. $("#gridList").jqGrid("setSelection", rowid, false);
  193. bindSubGrid(subgrid_id, rowid)
  194. }
  195. });
  196. $("#warehouse a.btn-default").click(function () {
  197. $("#warehouse a.btn-default").removeClass("active");
  198. $(this).addClass("active");
  199. $('#btn_search').trigger("click");
  200. });
  201. $("#btn_search").click(function () {
  202. var warehouse = $("#warehouse a.active").attr('data-value');
  203. var queryJson = {
  204. POCode: $("#txt_POCode").val(),
  205. InvCode: $("#txt_InvCode").val(),
  206. InvName: $("#txt_InvName").val(),
  207. WHCode: $("#txt_WHCode").val(),
  208. WHName: $("#txt_WHName").val(),
  209. //BatchCode: $("#txt_BatchCode").val(),
  210. FromTime: $("#FromTime").val(),
  211. ToTime: $("#ToTime").val(),
  212. AuditStatus: $("#F_AuditStatus").val(),
  213. SDNQtyFlag: $("#F_SdnQty").val(),
  214. }
  215. $gridList.jqGrid('setGridParam', {
  216. postData: { queryJson: JSON.stringify(queryJson) },
  217. }).trigger('reloadGrid');
  218. });
  219. }
  220. function bindSubGrid(subgrid_id, rowid) {
  221. $("#gridList").jqGrid("setSelection", rowid, false);
  222. var subgrid_table_id;
  223. subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
  224. var subgrid_pager_id;
  225. subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
  226. // (5)动态添加子报表的table和pager
  227. $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
  228. var SDNCode = $("#gridList").jqGrid('getRowData', rowid).SDNCode;
  229. // (6)创建jqGrid对象
  230. $("#" + subgrid_table_id).dataGrid({
  231. cellEdit: true,
  232. url: "/MFWMS/ICSSSD/GetSDNApplyNegDetail?SDNCode=" + SDNCode + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
  233. colModel: [
  234. { label: "主键", name: "ID", hidden: true, key: true },
  235. { label: '行号', name: 'Sequence', width: 120, align: 'left' },
  236. { label: '销售订单号', name: 'SOCode', width: 180, align: 'left' },
  237. { label: '销售订单行号', name: 'SOSequence', width: 180, align: 'left' },
  238. { label: '客户代码', name: 'CusCode', width: 180, align: 'left', hidden: true },
  239. { label: '客户名称', name: 'CusName', width: 180, align: 'left' },
  240. { label: '物料代码', name: 'InvCode', width: 120, align: 'left' },
  241. { label: '物料名称', name: 'InvName', width: 120, align: 'left', },
  242. { label: '物料规格', name: 'InvStd', width: 120, align: 'left', },
  243. { label: '数量', name: 'Quantity', width: 120, align: 'left' },
  244. { label: '发货日期', name: 'ArriveDate', width: 120, align: 'left' },
  245. { label: '已发数量', name: 'SDNQuantity', width: 120, align: 'left', hidden: true },
  246. { label: '仓库名称', name: 'WHName', width: 120, align: 'left' },
  247. { label: '仓库代码', name: 'WHCode', width: 120, align: 'left', hidden: true },
  248. { label: '辅计量', name: 'Amount', width: 120, align: 'left', hidden: true },
  249. { label: '创建人', name: 'CreatePerson', width: 120, align: 'left' },
  250. { label: '创建时间', name: 'CreateDateTime', width: 120, align: 'left' },
  251. { label: '操作人', name: 'MUSER', width: 150, align: 'left' },
  252. { label: '操作人名称', name: 'MUSERName', width: 150, align: 'left' },
  253. { label: '操作时间', name: 'MTIME', width: 150, align: 'left' },
  254. ],
  255. sortname: 'Sequence',
  256. shrinkToFit: true,//宽度自适应
  257. //multiselect: true,
  258. prmNames: { search: "search" },
  259. viewrecords: true,
  260. height: "100%",
  261. rowNum: 20,
  262. pager: subgrid_pager_id,
  263. });
  264. }
  265. function btn_Audit() {
  266. var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
  267. var SDNCodeArr = '';
  268. if (ids.length < 1) {
  269. $.modalAlertNew("WMS00087");
  270. return;
  271. }
  272. //卡控 已审核
  273. for (var i in ids) {
  274. SDNCode = $("#gridList").jqGrid('getRowData', ids[i]).SDNCode;
  275. AccomplishFlag = $("#gridList").jqGrid('getRowData', ids[i]).AccomplishFlag;
  276. if (AccomplishFlag != '待审核') {
  277. $.modalAlertNew("WMS00088");
  278. return;
  279. }
  280. SDNCodeArr = SDNCodeArr == '' ? "'" + SDNCode + "'" : SDNCodeArr + ",'" + SDNCode + "'";
  281. }
  282. //若为退货 则打开仓库弹出框 选择仓库
  283. if(moduleType == '002'){
  284. $.modalOpen({
  285. id: "CloneButton",
  286. title: "目标库位",
  287. url: "/MFWMS/ICSSSD/ICSWarehouseSelection?SDNCodeArr=" + SDNCodeArr + "&" + Math.random(),
  288. width: "400px",
  289. height: "450px",
  290. callBack: function (iframeId) {
  291. top.frames[iframeId].submitForm();
  292. }
  293. });
  294. }else{
  295. var RoleEnCode = '@NFine.Code.OperatorProvider.Provider.GetCurrent().UserCode'
  296. var WorkPoint = '@NFine.Code.OperatorProvider.Provider.GetCurrent().Location'
  297. var date = new Date();
  298. $.submitForm({
  299. url: "/MFWMS/ICSSSD/AuditSDN?keyValue=" + SDNCodeArr + "&Type=1&" + Math.random(),
  300. success: function () {
  301. $.currentWindow().$("#gridList").trigger("reloadGrid");
  302. }
  303. })
  304. }
  305. }
  306. </script>
  307. <iframe id="ifrm" src="" width="0" height="0"></iframe>
  308. <script>
  309. </script>
  310. <div class="topPanel" style="height: 100px">
  311. <div class="toolbar">
  312. <div class="btn-group">
  313. <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>
  314. @*<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>*@
  315. <a class="btn btn-primary" onclick="$.reload()"><span class="glyphicon glyphicon-refresh"></span></a>
  316. </div>
  317. @*<div class="btn-group" style="display:block;padding-left:2px;">
  318. <a class="btn btn-primary" id="downPrintControl" href="~/PrintActivex.exe" style="display:none">点击下载打印组件</a>
  319. <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>
  320. <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>
  321. <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>
  322. </div>*@
  323. <script>$('.toolbar').authorizeButton()</script>
  324. </div>
  325. <div class="search">
  326. <table>
  327. <tr>
  328. <td class="POCodeShow" style="text-align:right;"><label class="lglabel HideItems" id="POCodeShowLable" for="txt_POCode">&nbsp;&nbsp;&nbsp;&nbsp;单据号</label>:</td>
  329. <td class="POCodeShow">
  330. <div class="input-group HideItems">
  331. <input id="txt_POCode" type="text" class="form-control" style="width: 130px;">
  332. </div>
  333. </td>
  334. @*<td class="HideItems" style="text-align:right;"><label class="lglabel HideItems" for="txt_VenCode">&nbsp;&nbsp;&nbsp;&nbsp;供应商代码</label>:</td>
  335. <td class="HideItems">
  336. <div class="input-group HideItems">
  337. <input id="txt_VenCode" type="text" class="form-control HideItems" style="width: 130px;">
  338. </div>
  339. </td>
  340. <td class="HideItems" style="text-align:right;"><label class="lglabel HideItems" for="txt_VenName">&nbsp;&nbsp;&nbsp;&nbsp;供应商名称</label>:</td>
  341. <td class="HideItems">
  342. <div class="input-group HideItems">
  343. <input id="txt_VenName" type="text" class="form-control HideItems" style="width: 130px;">
  344. </div>
  345. </td>*@
  346. <td class="HideItems" style="text-align:right;"><label class="lglabel HideItems" for="txt_WHCode">&nbsp;&nbsp;&nbsp;&nbsp;仓库编码</label>:</td>
  347. <td>
  348. <div class="input-group HideItems">
  349. <input id="txt_WHCode" type="text" class="form-control HideItems" style="width: 130px;">
  350. </div>
  351. </td>
  352. <td style="text-align:right;"><label class="lglabel" for="txt_WHName">&nbsp;&nbsp;&nbsp;&nbsp;仓库名称</label>:</td>
  353. <td>
  354. <div class="input-group">
  355. <input id="txt_WHName" type="text" class="form-control" style="width: 130px;">
  356. </div>
  357. </td>
  358. @*<td class="HideItems2" style="text-align:right;"><label class="lglabel HideItems2" for="txt_VenName">&nbsp;&nbsp;&nbsp;&nbsp;源头单据号</label>:</td>
  359. <td class="HideItems2">
  360. <div class="input-group HideItems2">
  361. <input id="txt_SCode" type="text" class="form-control HideItems2" style="width: 130px;">
  362. </div>
  363. </td>*@
  364. <td class="HideItemsTime" style="text-align:right;"><label class="lglabel HideItemsTime" for="txt_VenName">&nbsp;&nbsp;&nbsp;&nbsp;发货日期(从)</label>:</td>
  365. <td class="HideItemsTime">
  366. <div class="input-group HideItemsTime">
  367. <input id="FromTime" name="FromTime" type="text" class="form-control HideItemsTime" style="width:130px;" maxlength="10" onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd' })" placeholder="发货日期(从)" />
  368. </div>
  369. </td>
  370. <td class="HideItemsTime" style="text-align:right;"><label class="lglabel HideItemsTime" for="txt_VenName">&nbsp;&nbsp;&nbsp;&nbsp;发货日期(到)</label>:</td>
  371. <td class="HideItemsTime">
  372. <div class="input-group HideItemsTime">
  373. <input id="ToTime" name="ToTime" type="text" class="form-control HideItemsTime" style="width:130px;" maxlength="10" onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd' })" placeholder="发货日期(到)" />
  374. </div>
  375. </td>
  376. </tr>
  377. <tr>
  378. <td class="HideItems" style="text-align:right;"><label class="lglabel HideItems" for="txt_InvCode">&nbsp;&nbsp;&nbsp;&nbsp;物料编码</label>:</td>
  379. <td>
  380. <div class="input-group HideItems">
  381. <input id="txt_InvCode" type="text" class="form-control HideItems" style="width: 130px;">
  382. </div>
  383. </td>
  384. <td style="text-align:right;"><label class="lglabel" for="txt_InvName">&nbsp;&nbsp;&nbsp;&nbsp;物料名称</label>:</td>
  385. <td>
  386. <div class="input-group">
  387. <input id="txt_InvName" type="text" class="form-control" style="width: 130px;">
  388. </div>
  389. </td>
  390. <td class="td_SdnQty">
  391. <label >&nbsp;&nbsp;&nbsp;是否全部出库:&nbsp;&nbsp;&nbsp;&nbsp;</label>
  392. </td>
  393. <td class="td_SdnQty">
  394. <div class="input-group">
  395. <select id="F_SdnQty" name="F_SdnQty" class="form-control" style="width: 130px;">
  396. <option value="0">显示全部</option>
  397. <option value="1">已全部出库</option>
  398. <option value="2" selected="selected">未全部出库</option>
  399. </select>
  400. </div>
  401. </td>
  402. <td>
  403. <label>&nbsp;&nbsp;&nbsp;是否审核:&nbsp;&nbsp;&nbsp;&nbsp;</label>
  404. </td>
  405. <td>
  406. <div class="input-group">
  407. <select id="F_AuditStatus" name="F_AuditStatus" class="form-control" style="width: 130px;">
  408. <option value="0">显示全部</option>
  409. <option value="1">已审核</option>
  410. <option value="2" selected="selected">未审核</option>
  411. </select>
  412. </div>
  413. </td>
  414. @*<td id="GDLX">
  415. <label>&nbsp;&nbsp;&nbsp;工单类型:&nbsp;&nbsp;&nbsp;&nbsp;</label>
  416. </td>
  417. <td id="GDLX2">
  418. <div class="input-group">
  419. <select id="SelGDLX" name="SelShow" class="form-control" style="width: 130px;">
  420. </select>
  421. </div>
  422. </td>
  423. <td class="GDLX" style="display:none">
  424. <label>&nbsp;&nbsp;&nbsp;工单类型:&nbsp;&nbsp;&nbsp;&nbsp;</label>
  425. </td>
  426. <td class="GDLX" style="display:none">
  427. <div class="input-group">
  428. <select id="selShow" name="F_Target" class="form-control" style="width: 100px;">
  429. <option value="0">显示全部</option>
  430. <option value="1">已全部生成</option>
  431. <option value="2" selected="selected">未全部生成</option>
  432. </select>
  433. </div>
  434. </td>*@
  435. <td>
  436. <span class="input-group-btn">
  437. <button id="btn_search" type="button" class="btn btn-primary"><i class="fa fa-search"></i></button>
  438. </span>
  439. </td>
  440. </tr>
  441. </table>
  442. </div>
  443. </div>
  444. <div class="gridPanel">
  445. <table id="gridList"></table>
  446. <div id="gridPager"></div>
  447. </div>