纽威
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.

348 lines
14 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. 
  2. @{
  3. ViewBag.Title = "Index";
  4. Layout = "~/Views/Shared/_Form.cshtml";
  5. }
  6. <style>
  7. #ISO {
  8. width: 10px;
  9. }
  10. </style>
  11. <link href="~/Content/js/select2/select2.min.css" rel="stylesheet" />
  12. <script src="~/Content/js/select2/select2.min.js"></script>
  13. <script>
  14. var ID = '';
  15. $(function () {
  16. ID = $.request("ID");
  17. debugger;
  18. if (ID != '') {
  19. GetTextValues();
  20. }
  21. });
  22. function GetTextValues() {
  23. $.ajax({
  24. url: "/WMS/BasicSettings/GetInputValue?ID=" + ID,
  25. type:"post",
  26. dataType: "json",
  27. async: false,
  28. success: function (data) {
  29. $("#InvCode").val(data.rows[0].InvCode);
  30. $("#InvName").val(data.rows[0].InvName);
  31. $("#InvDesc").val(data.rows[0].InvDesc);
  32. $("#InvStd").val(data.rows[0].InvStd);
  33. $("#InvUnit").val(data.rows[0].InvUnit);
  34. $("#AmountUnit").val(data.rows[0].AmountUnit);
  35. $("#ClassName").val(data.rows[0].ClassName);
  36. $("#ClassCode").val(data.rows[0].ClassCode);
  37. $("#InvRate").val(data.rows[0].InvRate);
  38. $("#InvVersion").val(data.rows[0].InvVersion);
  39. $("#InvBrand").val(data.rows[0].InvBrand);
  40. $("#EffectiveDays").val(data.rows[0].EffectiveDays);
  41. $("#WHUser").val(data.rows[0].WHUser);
  42. //是否IQC检验
  43. if (data.rows[0].InvIQC == '1') {
  44. $("#InvIQCYes").prop("checked", true);
  45. } else {
  46. $("#InvIQCNo").prop("checked", true);
  47. }
  48. //是否FQC检验
  49. if (data.rows[0].InvFQC == '1') {
  50. $("#InvFQCYes").prop("checked", true);
  51. } else {
  52. $("#InvFQCNo").prop("checked", true);
  53. }
  54. //是否启用有效期
  55. if (data.rows[0].EffectiveEnable == '1') {
  56. $("#EffectiveEnableYes").prop("checked", true);
  57. } else {
  58. $("#EffectiveEnableNo").prop("checked", true);
  59. }
  60. //是否启用批次
  61. if (data.rows[0].BatchEnable == '1') {
  62. $("#BatchEnableYes").prop("checked", true);
  63. } else {
  64. $("#BatchEnableNo").prop("checked", true);
  65. }
  66. //是否自动分批
  67. if (data.rows[0].LotEnable == '1') {
  68. $("#LotEnableYes").prop("checked", true);
  69. } else {
  70. $("#LotEnableNo").prop("checked", true);
  71. }
  72. //是否自动打印
  73. if (data.rows[0].PrintEnable == '1') {
  74. $("#PrintEnableYes").prop("checked", true);
  75. } else {
  76. $("#PrintEnableNo").prop("checked", true);
  77. }
  78. }
  79. });
  80. }
  81. function submitForm() {
  82. var InvCode = $("#InvCode").val();//物料代码必填
  83. var InvName = $("#InvName").val();//物料名称必填
  84. var InvDesc = $("#InvDesc").val();
  85. var ColName = $("#ColName").val();
  86. var InvStd = $("#InvStd").val();
  87. var InvUnit = $("#InvUnit").val();//主计量单位必填
  88. var AmountUnit = $("#AmountUnit").val();
  89. var ClassCode = $("#ClassCode").val();//大类编码必填
  90. var ClassName = $("#ClassName").val();//大类名称必填
  91. var InvRate = $("#InvRate").val();//固定换算率必填
  92. var InvVersion = $("#InvVersion").val();
  93. var InvBrand = $("#InvBrand").val();
  94. var EffectiveDays = $("#EffectiveDays").val();//必填
  95. var WHUser = $("#WHUser").val();
  96. var InvIQC = $('input[name="InvIQC"]:checked').val();//是否IQC检验
  97. var InvFQC = $('input[name="InvFQC"]:checked').val();//是否FQC检验
  98. var EffectiveEnable = $('input[name="EffectiveEnable"]:checked').val();//是否启用有效期
  99. var BatchEnable = $('input[name="BatchEnable"]:checked').val();//是否启用批次
  100. var LotEnable = $('input[name="LotEnable"]:checked').val();//是否自动分批
  101. var PrintEnable = $('input[name="PrintEnable"]:checked').val();//是否自动打印
  102. if (InvIQC == "" || InvIQC == undefined) {
  103. $.modalAlertNew("WMS00027");
  104. return;
  105. }
  106. if (InvFQC == "" || InvFQC == undefined) {
  107. $.modalAlertNew("WMS00028");
  108. return;
  109. }
  110. if (EffectiveEnable == "" || EffectiveEnable == undefined) {
  111. $.modalAlertNew("WMS00029");
  112. return;
  113. }
  114. if (BatchEnable == "" || BatchEnable == undefined) {
  115. $.modalAlertNew("WMS00030");
  116. return;
  117. }
  118. if (LotEnable == "" || LotEnable == undefined) {
  119. $.modalAlertNew("WMS00031");
  120. return;
  121. }
  122. if (PrintEnable == "" || PrintEnable == undefined) {
  123. $.modalAlertNew("WMS00032");
  124. return;
  125. }
  126. if (!$('#form1').formValid()) {
  127. return false;
  128. }
  129. var objArr = {
  130. ID: ID,
  131. InvCode: InvCode,
  132. InvName: InvName,
  133. InvDesc: InvDesc,
  134. ColName: ColName,
  135. InvStd: InvStd,
  136. InvUnit: InvUnit,
  137. InvDesc: InvDesc,
  138. AmountUnit: AmountUnit,
  139. ClassCode: ClassCode,
  140. ClassName: ClassName,
  141. InvRate: InvRate,
  142. InvVersion: InvVersion,
  143. InvBrand: InvBrand,
  144. EffectiveDays: EffectiveDays,
  145. WHUser: WHUser,
  146. InvIQC: InvIQC,
  147. InvFQC: InvFQC,
  148. EffectiveEnable: EffectiveEnable,
  149. BatchEnable: BatchEnable,
  150. LotEnable: LotEnable,
  151. PrintEnable: PrintEnable
  152. }
  153. debugger;
  154. if (ID!="") {
  155. $.submitForm({
  156. url: "/WMS/BasicSettings/UpdateICSInventory" + "?" + Math.random(),
  157. param: { keyValue: JSON.stringify(objArr) },
  158. success: function () {
  159. $.currentWindow().$("#gridList").trigger("reloadGrid");
  160. }
  161. })
  162. } else {
  163. $.submitForm({
  164. url: "/WMS/BasicSettings/InsertICSInventory" + "?" + Math.random(),
  165. param: { keyValue: JSON.stringify(objArr) },
  166. success: function () {
  167. $.currentWindow().$("#gridList").trigger("reloadGrid");
  168. }
  169. })
  170. }
  171. }
  172. </script>
  173. <form id="form1">
  174. <div style="padding-top: 20px; margin-right: 20px;">
  175. <table class="form">
  176. <tr>
  177. <th class="formTitle">料品编码:</th>
  178. <td class="formValue">
  179. @*<select id="sel_InvCode" name="sel_InvCode" class="form-control select2" onchange="TxTValue()" style="width: 230px" placeholder="请选择物料代码..."></select>*@
  180. <input id="InvCode" name="InvCode" type="text" class="form-control required" style="width: 200px;" maxlength="30" placeholder="料品编码" />
  181. <input type="hidden" id="hidetext" />
  182. </td>
  183. </tr>
  184. <tr>
  185. <th class="formTitle">物料描述:</th>
  186. <td class="formValue">
  187. <input id="InvName" name="InvName" type="text" class="form-control required" style="width: 200px;" maxlength="30" placeholder="物料描述" />
  188. </td>
  189. </tr>
  190. <tr>
  191. <th class="formTitle">辅助描述:</th>
  192. <td class="formValue">
  193. <input id="InvDesc" name="InvDesc" type="text" class="form-control " style="width: 200px;" maxlength="30" placeholder="辅助描述" />
  194. </td>
  195. </tr>
  196. <tr>
  197. <th class="formTitle">规格型号:</th>
  198. <td class="formValue">
  199. <input id="InvStd" name="InvStd" type="text" class="form-control " style="width: 200px;" maxlength="30" placeholder="规格型号" />
  200. </td>
  201. </tr>
  202. <tr>
  203. <th class="formTitle">主计量单位:</th>
  204. <td class="formValue">
  205. <input id="InvUnit" name="InvUnit" type="text" class="form-control required" style="width: 200px;" maxlength="10" placeholder="主计量单位" />
  206. </td>
  207. </tr>
  208. <tr>
  209. <th class="formTitle">辅计量单位:</th>
  210. <td class="formValue">
  211. <input id="AmountUnit" name="AmountUnit" type="text" class="form-control" style="width: 200px;" maxlength="10" placeholder="辅计量单位" />
  212. </td>
  213. <tr>
  214. <th class="formTitle">大类编码:</th>
  215. <td class="formValue">
  216. <input id="ClassCode" name="ClassCode" type="text" class="form-control required" style="width: 200px;" maxlength="10" placeholder="大类编码" />
  217. </td>
  218. <tr>
  219. <th class="formTitle">大类名称:</th>
  220. <td class="formValue">
  221. <input id="ClassName" name="ClassName" type="text" class="form-control " style="width: 200px;" maxlength="10" placeholder="大类名称" />
  222. </td>
  223. </tr>
  224. <tr>
  225. <th class="formTitle">固定换算率:</th>
  226. <td class="formValue">
  227. <input id="InvRate" name="InvRate" type="text" class="form-control required" style="width: 200px;" maxlength="10" placeholder="固定换算率" />
  228. </td>
  229. </tr>
  230. <tr>
  231. <th class="formTitle">版本:</th>
  232. <td class="formValue">
  233. <input id="InvVersion" name="InvVersion" type="text" class="form-control " style="width: 200px;" maxlength="10" placeholder="版本" />
  234. </td>
  235. </tr>
  236. <tr>
  237. <th class="formTitle">厂牌:</th>
  238. <td class="formValue">
  239. <input id="InvBrand" name="InvBrand" type="text" class="form-control" style="width: 200px;" maxlength="10" placeholder="厂牌" />
  240. </td>
  241. </tr>
  242. <tr>
  243. <th class="formTitle">有效期天数:</th>
  244. <td class="formValue">
  245. <input id="EffectiveDays" name="EffectiveDays" type="text" class="form-control required" style="width: 200px;" maxlength="10" placeholder="有效期天数" />
  246. </td>
  247. </tr>
  248. <tr>
  249. <th class="formTitle">仓管员:</th>
  250. <td class="formValue">
  251. <input id="WHUser" name="WHUser" type="text" class="form-control " style="width: 200px;" maxlength="10" placeholder="仓管员" />
  252. </td>
  253. </tr>
  254. <tr>
  255. <th class="formTitle">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;是否IQC检验:</th>
  256. <td class="formValue">
  257. <div class="input-group" id="InvIQCchaeckbox">
  258. <input type="radio" name="InvIQC" value="1" id="InvIQCYes" style="width:60px" /><label for="cb-NoQuotedPrice">是</label>
  259. <input type="radio" name="InvIQC" value="0" id="InvIQCNo" style="width:60px" /><label for="cb-QuotedPrice">否</label>
  260. </div>
  261. </td>
  262. </tr>
  263. <tr>
  264. <th class="formTitle">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;是否FQC检验:</th>
  265. <td class="formValue">
  266. <div class="input-group" id="InvFQCchaeckbox">
  267. <input type="radio" name="InvFQC" value="1" id="InvFQCYes" style="width:60px" /><label for="cb-NoQuotedPrice">是</label>
  268. <input type="radio" name="InvFQC" value="0" id="InvFQCNo" style="width:60px" /><label for="cb-QuotedPrice">否</label>
  269. </div>
  270. </td>
  271. </tr>
  272. <tr>
  273. <th class="formTitle">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;是否启用有效期:</th>
  274. <td class="formValue">
  275. <div class="input-group" id="EffectiveEnablechaeckbox">
  276. <input type="radio" name="EffectiveEnable" value="1" id="EffectiveEnableYes" style="width:60px" /><label for="cb-NoQuotedPrice">是</label>
  277. <input type="radio" name="EffectiveEnable" value="0" id="EffectiveEnableNo" style="width:60px" /><label for="cb-QuotedPrice">否</label>
  278. </div>
  279. </td>
  280. </tr>
  281. <tr>
  282. <th class="formTitle">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;是否启用批次:</th>
  283. <td class="formValue">
  284. <div class="input-group" id="BatchEnablechaeckbox">
  285. <input type="radio" name="BatchEnable" value="1" id="BatchEnableYes" style="width:60px" /><label for="cb-NoQuotedPrice">是</label>
  286. <input type="radio" name="BatchEnable" value="0" id="BatchEnableNo" style="width:60px" /><label for="cb-QuotedPrice">否</label>
  287. </div>
  288. </td>
  289. </tr>
  290. <tr>
  291. <th class="formTitle">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;是否自动分批:</th>
  292. <td class="formValue">
  293. <div class="input-group" id="LotEnablechaeckbox">
  294. <input type="radio" name="LotEnable" value="1" id="LotEnableYes" style="width:60px" /><label for="cb-NoQuotedPrice">是</label>
  295. <input type="radio" name="LotEnable" value="0" id="LotEnableNo" style="width:60px" /><label for="cb-QuotedPrice">否</label>
  296. </div>
  297. </td>
  298. </tr>
  299. <tr >
  300. <th class="formTitle">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;是否自动打印:</th>
  301. <td class="formValue">
  302. <div class="input-group" id="PrintEnablechaeckbox">
  303. <input type="radio" name="PrintEnable" value="1" id="PrintEnableYes" style="width:60px" /><label for="cb-NoQuotedPrice">是</label>
  304. <input type="radio" name="PrintEnable" value="0" id="PrintEnableNo" style="width:60px" /><label for="cb-QuotedPrice">否</label>
  305. </div>
  306. </td>
  307. </tr>
  308. </table>
  309. </div>
  310. </form>