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.

143 lines
5.6 KiB

2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
  1. 
  2. @{
  3. ViewBag.Title = "Invmes";
  4. Layout = "~/Views/Shared/_Index.cshtml";
  5. }
  6. <link href="~/Content/js/select2/select2.min.css" rel="stylesheet" />
  7. <link href="~/Content/js/dialog/dialog.css" rel="stylesheet" />
  8. <script src="~/Content/js/datepicker/WdatePicker.js"></script>
  9. <script src="~/Content/js/select2/select2.min.js"></script>
  10. <script>
  11. var WorkPoint = $.request("workpoint");
  12. var sfqcode = $.request("sfqcode");
  13. $(function () {
  14. Init();
  15. })
  16. function Init() {
  17. debugger;
  18. document.getElementById("gridPanel").innerHTML = '<table id="gridList"></table><div id="gridPager"></div> ';//重置grid
  19. var invcode = $("#txt_Invcode").val();
  20. var InvName = $("#txt_InvName").val();
  21. $("#gridList").dataGrid({
  22. url: "/SRM/PriceInquiry/GetPriceInquiryItem" + "?invcode=" + invcode + "&workpoint=" + WorkPoint + "&InvName=" + InvName + "&" + Math.random() + "&sfqcode=" + sfqcode,
  23. height: $(window).height() - 150,
  24. width: $(window).width() - 300,
  25. colModel: [
  26. { label: '物料编码', name: '物料代码', width: 100, align: 'left' },
  27. { label: '物料名称', name: '物料名称', width: 100, align: 'left' },
  28. { label: '制造商', name: '制造商', width: 180, align: 'left' },
  29. { label: '制造商料号', name: '制造商料号', width: 180, align: 'left' },
  30. { label: '物料规格', name: '物料规格', width: 100, align: 'left' },
  31. { label: '单位', name: '单位', width: 100, align: 'left' },
  32. { label: '需求数量', name: '预计需求量', width: 100, align: 'left' },
  33. { label: '备注', name: '备注', width: 100, align: 'left' },
  34. { label: '技术要求文件', name: '文件路径', width: 100, align: 'left' },
  35. ],
  36. pager: "#gridPager",
  37. sortorder: "desc",
  38. sortname: '物料代码',
  39. viewrecords: true,
  40. multiselect: true,
  41. gridComplete: function () {
  42. },
  43. //beforeSelectRow: function (rowid, e) {
  44. // $("#gridList").jqGrid('resetSelection');
  45. // return (true);
  46. //},
  47. })
  48. }
  49. //function submitForm() {
  50. // var rows = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  51. // if (rows.length != 1) {
  52. // $.modalAlert("只能选择一条数据!");
  53. // return;
  54. // }
  55. // var rowdata = $("#gridList").jqGrid("getRowData", rows[0]);
  56. // var obj={ invcode:rowdata.invcode,
  57. // invname : rowdata.invname,
  58. // invuom : rowdata.invuom,
  59. // invstd: rowdata.invstd,
  60. // invclass:rowdata.invclass
  61. //}
  62. // return obj;
  63. //}
  64. function Close() {
  65. $.modalClose();
  66. }
  67. function reloadData() {
  68. }
  69. //提交
  70. function submitForm() {
  71. debugger;
  72. //提交
  73. var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
  74. var objs = [];
  75. for (var i = 0; i < ids.length; i++) {
  76. var obj = {
  77. ID: GUID(),
  78. 物料代码: $("#gridList").jqGrid('getRowData', ids[i]).物料代码,
  79. 物料名称: $("#gridList").jqGrid('getRowData', ids[i]).物料名称,
  80. 物料规格: $("#gridList").jqGrid('getRowData', ids[i]).物料规格,
  81. 制造商: $("#gridList").jqGrid('getRowData', ids[i]).制造商,
  82. 制造商料号: $("#gridList").jqGrid('getRowData', ids[i]).制造商料号,
  83. 单位: $("#gridList").jqGrid('getRowData', ids[i]).单位,
  84. 备注: $("#gridList").jqGrid('getRowData', ids[i]).备注,
  85. 预计需求量: $("#gridList").jqGrid('getRowData', ids[i]).预计需求量,
  86. 文件路径: $("#gridList").jqGrid('getRowData', ids[i]).文件路径,
  87. //技术要求: "",
  88. //参考价格: null,
  89. //成本明细: "0",
  90. //是否含税: "",
  91. //币种: ""
  92. };
  93. objs.push(obj);
  94. }
  95. return objs;
  96. }
  97. function GUID() {
  98. return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
  99. var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
  100. return v.toString(16);
  101. });
  102. }
  103. </script>
  104. <div class="topPanel" style="height:50px">
  105. <div class="search">
  106. <table>
  107. <tr>
  108. <td>
  109. <label>物料编码:</label>
  110. </td>
  111. <td>
  112. <div class="input-group">
  113. <input id="txt_Invcode" type="text" class="form-control" placeholder="物料编码" style="width: 120px;">
  114. </div>
  115. </td>
  116. <td>
  117. <label>物料名称:</label>
  118. </td>
  119. <td>
  120. <div class="input-group">
  121. <input id="txt_InvName" type="text" class="form-control" placeholder="物料名称" style="width: 120px;">
  122. </div>
  123. </td>
  124. <td>
  125. <a id="Search" authorize="yes" style="margin-left:3px;" class="btn btn-info" onclick="Init()"><i class="fa fa-pencil-square-o"></i>查询</a>
  126. </td>
  127. </tr>
  128. <tr>
  129. </tr>
  130. </table>
  131. </div>
  132. </div>
  133. <div class="gridPanel" id="gridPanel">
  134. <table id="gridList"></table>
  135. <div id="gridPager"></div>
  136. </div>