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.

276 lines
12 KiB

2 months ago
  1. @{
  2. ViewBag.Title = "Index";
  3. Layout = "~/Views/Shared/_Index.cshtml";
  4. }
  5. <script src="~/Content/js/datepicker/WdatePicker.js"></script>
  6. <link href="~/Content/js/select2/select2.min.css" rel="stylesheet" />
  7. <script src="~/Content/js/select2/select2.min.js"></script>
  8. <style>
  9. element.style {
  10. z-index: 10003;
  11. width: px;
  12. height: 900px;
  13. position: absolute;
  14. top: 177px;
  15. left: 403px;
  16. }
  17. </style>
  18. <script>
  19. $(document).ready(function () {
  20. $("input.cell").keyup(function (e) {
  21. switch (e.keyCode) {
  22. // up arrow
  23. case 40:
  24. $(this).parent()
  25. .parent()
  26. .next()
  27. .children("td")
  28. .children("input.cell[name="
  29. + $(this).attr("name") + "]")
  30. .focus();
  31. break;
  32. // down arrow
  33. case 38:
  34. $(this).parent()
  35. .parent()
  36. .prev()
  37. .children("td")
  38. .children("input.cell[name="
  39. + $(this).attr("name") + "]")
  40. .focus();
  41. break;
  42. }
  43. });
  44. });</script>
  45. <script>
  46. $(function () {
  47. gridList();
  48. InitControl();
  49. })
  50. function InitControl() {
  51. debugger;
  52. var $VenCode = $("#sel_PURCHUG");
  53. $VenCode.select2({
  54. allowClear: true,
  55. escapeMarkup: function (m) {
  56. return m;
  57. }
  58. });
  59. $.ajax({
  60. url: "/SRM/TakeEffectPrice/GetWorkPint" + "?" + Math.random(),
  61. dataType: "json",
  62. async: false,
  63. success: function (data) {
  64. $.each(data, function (index, item) {
  65. $VenCode.append("<option value='" + item.PURCHUGCODE + "'>&nbsp;" + item.PURCHUGNAME + "</option>");
  66. });
  67. }
  68. });
  69. }
  70. function gridList() {
  71. debugger;
  72. var $gridList = $("#gridList");
  73. var queryJson = {
  74. PURCHUG: '',//采购组织
  75. //PURCHUGCODE: $("#txt_PURCHUGCODE").val(),//组织代码
  76. //PURCHUGNAME: $("#txt_PURCHUGNAME").val(),//组织名称
  77. ITEMCODE: $("#txt_INVCode").val(),//物料编码
  78. ITEMName: $("#txt_INVName").val(),//物料名称
  79. INVSTD: $("#txt_INVSTD").val(),//规格型号
  80. RFQCODE: $("#txt_RFQCODE").val(),
  81. //TimeFrom: $("#txt_BeginDate").val(),
  82. //TimeTo: $("#txt_EndDate").val(),
  83. Vencode: $("#txt_VenCode").val(),
  84. VenName: $("#txt_VenName").val(),
  85. PURTEAM: $("#txt_PURTEAM").val(),
  86. }
  87. $gridList.dataGrid({
  88. cellEdit: true,
  89. url: "/SRM/PriceInquiry/GetGridPriceByPN" + "?" + Math.random(),
  90. postData: { queryJson: JSON.stringify(queryJson) },
  91. height: $(window).height() - 200,
  92. width: $(window).width() - 300,
  93. colModel: [
  94. { label: "主键", name: "ASNID", hidden: true, key: true },
  95. {
  96. label: '操作', width: 52, align: 'center',
  97. formatter: btnLook
  98. },
  99. { label: '物料编码', name: 'ITEMCODE', width: 80, align: 'left' },
  100. { label: '物料名称', name: 'ITEMNAME', width: 160, align: 'left' },
  101. { label: '规格型号', name: 'invSTD', width: 150, align: 'left' },
  102. { label: '单位', name: 'UNIT', width: 30, align: 'left' },//PoArrive
  103. { label: '最终价格', name: 'QUOPRICE', width: 50, align: 'left' },
  104. { label: '供应商名称', name: 'cVenName', width: 260, align: 'left' },
  105. { label: '供应商编码', name: 'cVenCode', width: 70, align: 'left' },
  106. { label: '询价单单号', name: 'RFQCODE', width: 120, align: 'left' },
  107. { label: '分配单号', name: 'FPRFQCODE', width: 120, align: 'left' },
  108. { label: '采购组织', name: 'PURCHUGNAME', width: 80, align: 'left', hidden: true },
  109. { label: '币种', name: 'CURRENCY', width: 100, align: 'left', hidden: true },
  110. { label: '采购负责人', name: 'PURTEAM', width: 60, align: 'left', hidden: true },
  111. { label: '站点', name: 'WorkPoint', width: 30, align: 'left', },
  112. ],
  113. gridComplete: function () {
  114. },
  115. pager: "#gridPager",
  116. sortorder: "desc",
  117. sortname: 'ITEMCODE ',
  118. viewrecords: true,
  119. //multiselect: true,
  120. //subGrid: true, // (1)开启子表格支持
  121. //subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
  122. // $("#gridList").jqGrid("setSelection", rowid, false);
  123. // bindSubGrid(subgrid_id, rowid)
  124. //},
  125. gridComplete: function () {
  126. var strIds = $("#gridList").jqGrid("getDataIDs");
  127. for (var i = 0; i < strIds.length; i++) {
  128. var strValue = $("#gridList").jqGrid("getCell", strIds[i], "STATUS");//得到单元格数据
  129. if (strValue == "3")
  130. $("#" + strIds[i]).find("td").css("background-color", "pink");
  131. }
  132. },
  133. });
  134. $("#warehouse a.btn-default").click(function () {
  135. $("#warehouse a.btn-default").removeClass("active");
  136. $(this).addClass("active");
  137. $('#btn_search').trigger("click");
  138. });
  139. $("#btn_search").click(function () {
  140. debugger;
  141. var warehouse = $("#warehouse a.active").attr('data-value');
  142. var queryJson = {
  143. PURCHUG: $("#sel_PURCHUG").children('option:selected').val(),//采购组织
  144. //PURCHUGCODE: $("#txt_PURCHUGCODE").val(),//组织代码
  145. //PURCHUGNAME: $("#txt_PURCHUGNAME").val(),//组织名称
  146. ITEMCODE: $("#txt_INVCode").val(),//物料编码
  147. ITEMName: $("#txt_INVName").val(),//物料名称
  148. INVSTD: $("#txt_INVSTD").val(),//规格型号
  149. RFQCODE: $("#txt_RFQCODE").val(),
  150. //TimeFrom: $("#txt_BeginDate").val(),
  151. //TimeTo: $("#txt_EndDate").val(),
  152. Vencode: $("#txt_VenCode").val(),
  153. VenName: $("#txt_VenName").val(),
  154. PURTEAM: $("#txt_PURTEAM").val(),
  155. }
  156. $gridList.jqGrid('setGridParam', {
  157. postData: { queryJson: JSON.stringify(queryJson) },
  158. }).trigger('reloadGrid');
  159. });
  160. }
  161. function btnLook(cellvalue, options, rowObject) {
  162. return cellvalue = "<a class=\"btn btn-info dropdown-text\" onclick=\"UpLoadClick('" + rowObject.PURCHUGNAME + "','" + rowObject.ITEMCODE + "','" + rowObject.ITEMNAME + "','" + rowObject.invSTD + "','" + rowObject.cVenCode + "','" + rowObject.cVenName + "','" + rowObject.FPRFQCODE + "','" + rowObject.PURTEAM + "','" + rowObject.WorkPoint + "')\">查看</a>";
  163. }
  164. function UpLoadClick(PURCHUGNAME, ITEMCODE, ITEMNAME, invSTD, cVenCode, cVenName, FPRFQCODE, PURTEAM, WorkPoint) {
  165. //var CartonNo = $("#CartonNo").text();
  166. $.modalOpen2({
  167. id: "ComPricelistByPN",
  168. title: "详细信息",
  169. url: "/SRM/PriceInquiry/ComPricelistByPN?PURCHUGNAME=" + encodeURI(encodeURI(PURCHUGNAME)) + "&ITEMCODE=" + ITEMCODE + "&" + Math.random() + "&ITEMNAME=" + encodeURI(encodeURI(ITEMNAME)) + "&invSTD=" + encodeURI(encodeURI(invSTD)) + "&VenCode=" + cVenCode + "&VenName=" + encodeURI(encodeURI(cVenName)) + "&FPRFQCODE=" + FPRFQCODE + "&PURTEAM=" + encodeURI(encodeURI(PURTEAM)) + "&WorkPoint=" + WorkPoint,
  170. width: "95%",
  171. height: "95%",
  172. btn: null
  173. });
  174. }
  175. </script>
  176. <iframe id="ifrm" src="" width="0" height="0"></iframe>
  177. <div class="topPanel" style="height:100px">
  178. <div class="toolbar">
  179. <div class="btn-group">
  180. @*<a id="btn_search" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btn_search()"><i class="fa fa-pencil-square-o"></i>查询</a>*@
  181. @*<a id="NF-Search" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btn_delete()"><i class="fa fa-pencil-square-o"></i>删除</a>
  182. <a class="btn btn-primary" style="margin-left:3px;" onclick="$.reload()"><span class="glyphicon glyphicon-refresh"></span></a>*@
  183. </div>
  184. </div>
  185. <div class="search">
  186. <table>
  187. <tr>
  188. @*<td>
  189. <label>采购组织:</label>
  190. </td>
  191. <td class="formValue">
  192. <select id="sel_PURCHUG" name="sel_VenCode" class="form-control select2" style="width: 100px;height:20px" placeholder="请选择采购组织..."></select>
  193. <input type="hidden" id="hidetext" />
  194. </td>*@
  195. <td>
  196. <label>采购负责人:</label>
  197. </td>
  198. <td>
  199. <div class="input-group">
  200. <input id="txt_PURTEAM" type="text" class="form-control" placeholder="采购负责人" style="width: 120px;">
  201. </div>
  202. </td>
  203. <td>
  204. <label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;物料编码:</label>
  205. </td>
  206. <td>
  207. <div class="input-group">
  208. <input id="txt_INVCode" type="text" class="form-control" placeholder="物料编码" style="width: 120px;">
  209. </div>
  210. </td>
  211. <td>
  212. <label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;物料名称:</label>
  213. </td>
  214. <td>
  215. <div class="input-group">
  216. <input id="txt_INVName" type="text" class="form-control" placeholder="物料名称" style="width: 120px;">
  217. </div>
  218. </td>
  219. <td>
  220. <label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;规格型号:</label>
  221. </td>
  222. <td>
  223. <div class="input-group">
  224. <input id="txt_INVSTD" type="text" class="form-control" placeholder="规格型号" style="width: 120px;">
  225. </div>
  226. </td>
  227. </tr>
  228. <tr>
  229. <td>
  230. <label>询价单单号:</label>
  231. </td>
  232. <td>
  233. <div class="input-group">
  234. <input id="txt_RFQCODE" type="text" class="form-control" placeholder="询价单编号" style="width: 120px;">
  235. </div>
  236. </td>
  237. <td>
  238. <label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 供应商编码:</label>
  239. </td>
  240. <td>
  241. <div class="input-group">
  242. <input id="txt_VenCode" type="text" class="form-control" placeholder="供应商编码" style="width: 120px;">
  243. </div>
  244. </td>
  245. <td>
  246. <label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;供应商名称:</label>
  247. </td>
  248. <td>
  249. <div class="input-group">
  250. <input id="txt_VenName" type="text" class="form-control" placeholder="供应商名称" style="width: 120px;">
  251. </div>
  252. </td>
  253. <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
  254. <td>
  255. <span class="input-group-btn">
  256. <button id="btn_search" type="button" class="btn btn-info"><i class="fa fa-search"></i></button>
  257. </span>
  258. </td>
  259. <td style="padding-left: 10px;"></td>
  260. </tr>
  261. </table>
  262. </div>
  263. </div>
  264. <div class="gridPanel">
  265. <table id="gridList"></table>
  266. <div id="gridPager"></div>
  267. </div>