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.

156 lines
5.8 KiB

1 month ago
  1. @{
  2. ViewBag.Title = "Index";
  3. Layout = "~/Views/Shared/_Index.cshtml";
  4. }
  5. <link href="~/Content/js/select2/select2.min.css" rel="stylesheet" />
  6. <script src="~/Content/js/select2/select2.min.js"></script>
  7. <script>
  8. var list = "";
  9. var CERTIFICATETPYECODE = $.request("CERTIFICATETPYECODE");
  10. var ID = $.request("ID");
  11. var WorkPoints = $.request("WorkPoint");
  12. $(function () {
  13. debugger;
  14. //InitControl1();
  15. //if (CERTIFICATETPYECODE != null && CERTIFICATETPYECODE != "") {
  16. $("#sel_WorkPoint").attr("disabled", "disabled");
  17. $("#sel_WorkPoint").val(WorkPoints);
  18. $.ajax({
  19. url: "/SRM/BicDoc_Publish/GetWorkPointByUser" + "?" + Math.random(),
  20. dataType: "json",
  21. async: false,
  22. success: function (data) {
  23. $("#sel_WorkPoint").val(data.rows[0].F_Location).trigger("change");
  24. }
  25. });
  26. //加载物料编码
  27. $.ajax({
  28. url: "/SRM/BicDoc_Publish/GetBidItemCode" + "?" + Math.random() + "&WorkPoint=" + WorkPoints,
  29. dataType: "json",
  30. async: false,
  31. success: function (data) {
  32. if (data.BidItemCode != '') {
  33. $("#txt_InvCode").val(data.BidItemCode);
  34. $("#txtBidCode").attr("disabled", "disabled");
  35. }
  36. }
  37. });
  38. })
  39. //function InitControl1() {
  40. // var $VenCode = $("#sel_WorkPoint");
  41. // $VenCode.select2({
  42. // allowClear: true,
  43. // escapeMarkup: function (m) {
  44. // return m;
  45. // }
  46. // });
  47. // $.ajax({
  48. // url: "/SRM/ASNAdd/GetVendors" + "?" + Math.random(),
  49. // dataType: "json",
  50. // async: false,
  51. // success: function (data) {
  52. // $.each(data, function (index, item) {
  53. // $VenCode.append("<option value='" + item.WorkPointCode + "'>&nbsp;" + item.WorkPointName + "</option>");
  54. // });
  55. // }
  56. // });
  57. //}
  58. //保存项目资料
  59. function submitForm() {
  60. debugger
  61. var INVCODE = $("#txt_InvCode").val();//编码
  62. var InvName = $("#txt_InvName").val();//名称
  63. var WorkPoint = $("#sel_WorkPoint").children('option:selected').val();
  64. var InvStd = $("#txt_InvStd").val();//规格
  65. var INVUOM = $("#txt_INVUOM").val();//单位
  66. var arrayData_item = new Array();
  67. if (INVCODE == "" || InvName == "" || InvStd == "" || INVUOM == "") {
  68. $.modalAlert("必填项不能为空!", "warning")
  69. return false;
  70. }
  71. //提交
  72. //var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
  73. var objs = [];
  74. //for (var i = 0; i < ids.length; i++) {
  75. var obj = {
  76. ID: GUID(),
  77. INVCODE: INVCODE,
  78. INVNAME: InvName,
  79. Quantity: null,
  80. InvUnit: INVUOM,
  81. DeliveryTime: null,
  82. Source:"手工",
  83. InvStd: InvStd
  84. };
  85. objs.push(obj);
  86. //}
  87. var obj = {
  88. INVCODE: INVCODE,
  89. InvName: InvName,
  90. WorkPoint: WorkPoint,
  91. InvStd:InvStd,
  92. INVUOM:INVUOM
  93. };
  94. //arrayData_item.push(obj);
  95. //$.ajax({
  96. // url: "/SRM/BicDoc_Publish/SubmitICSBicDocAddFCS?" + Math.random(),
  97. // param: { keyValue: JSON.stringify(arrayData_item)},
  98. // success: function (data) {
  99. //// if (data.msg != "") {
  100. // $.modalClose();
  101. //return objs
  102. //}
  103. // }
  104. //})
  105. return objs
  106. }
  107. function GUID() {
  108. return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
  109. var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
  110. return v.toString(16);
  111. });
  112. }
  113. </script>
  114. <form id="form1">
  115. <div style="padding-top: 10px; margin-left: 50px;">
  116. <table class="form">
  117. <tr>
  118. <th class="formTitle"><span style="color: red;">*</span>站点:</th>
  119. <td class="formValue">
  120. <input id="sel_WorkPoint" type="text" class="form-control" placeholder="站点" style="width: 327px;">
  121. @*<select id="sel_WorkPoint" name="sel_WorkPoint" class="form-control select2" style="width: 120px" placeholder="请选择站点..."></select>*@
  122. <input type="hidden" id="hidetext" />
  123. </td>
  124. </tr>
  125. <tr>
  126. <th class="formTitle"><span style="color: red;">*</span>物料编码:</th>
  127. <td class="formValue">
  128. <input id="txt_InvCode" type="text" class="form-control" placeholder="物料编码" style="width: 327px;">
  129. </td>
  130. </tr>
  131. <tr></tr>
  132. <tr>
  133. <th class="formTitle"><span style="color: red;">*</span>物料名称:</th>
  134. <td class="formValue">
  135. <input id="txt_InvName" type="text" class="form-control" placeholder="物料名称" style="width: 327px;">
  136. </td>
  137. </tr>
  138. <tr>
  139. <th class="formTitle"><span style="color: red;">*</span>规格型号:</th>
  140. <td class="formValue">
  141. <input id="txt_InvStd" type="text" class="form-control" placeholder="规格型号" style="width: 327px;">
  142. </td>
  143. </tr>
  144. <tr>
  145. <th class="formTitle"><span style="color: red;">*</span>单位:</th>
  146. <td class="formValue">
  147. <input id="txt_INVUOM" type="text" class="form-control" placeholder="单位" style="width: 327px;">
  148. </td>
  149. </tr>
  150. </table>
  151. </div>
  152. </form>