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.

1768 lines
79 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. 
  2. @{
  3. ViewBag.Title = "Index";
  4. Layout = "~/Views/Shared/_Form.cshtml";
  5. }
  6. <script>
  7. var Type = $.request("Type");
  8. var InvCode = $.request("InvCode");
  9. var ApplyNegCode = $.request("ApplyNegCode");
  10. var OApplyNegCode = $.request("OApplyNegCode");
  11. var SDNCode = $.request("SDNCode");
  12. var InCode = $.request("InCode");
  13. var Sequence = $.request("Sequence");
  14. // var MOCode = $.request("MOCode");
  15. var MOCode = decodeURI($.request("MOCode"))
  16. var ReturnCode = $.request("ReturnCode");
  17. var DNCode = $.request("DNCode");
  18. var ODNCode = $.request("ODNCode");
  19. var RCVCode = $.request("RCVCode");
  20. var LLApplyNegCode = $.request("LLApplyNegCode");
  21. var CLApplyNegCode = $.request("CLApplyNegCode");
  22. var WWLLOApplyNegCode = $.request("WWLLOApplyNegCode");
  23. var WWCLOApplyNegCode = $.request("WWCLOApplyNegCode");
  24. var FGGDMOCode = $.request("FGGDMOCode");
  25. var MODetailID = $.request("MODetailID");
  26. var OODetailID = $.request("OODetailID");
  27. //var FCPMOCode = $.request("FCPMOCode");
  28. var FCPMOCode = decodeURI($.request("FCPMOCode"))
  29. var VenCode = "";
  30. var WorkPoint = "";
  31. var Mtime = new Date().getFullYear() + "-" + (new Date().getMonth() + 1) + "-" + new Date().getDate();
  32. var WorkPoints = '@NFine.Code.OperatorProvider.Provider.GetCurrent().Location'
  33. //料品辅助计量开关
  34. var InvAmountEnable = false;
  35. //主计量、辅计量标志
  36. var minPackQtyEnable = false;
  37. var AmountEnable = false;
  38. //本次生成数量、最小包装量、计量标志
  39. var thisCreateQtyEnable = false;
  40. var MeasureEnable = false;
  41. var cretePageCountEnable = false;
  42. $(function () {
  43. $("#minPackQty").keyup(function () {
  44. $(this).val($(this).val().replace(/[^0-9.]/g, ''));
  45. }).bind("paste", function () { //CTR+V事件处理
  46. $(this).val($(this).val().replace(/[^0-9.]/g, ''));
  47. }).css("ime-mode", "disabled"); //CSS设置输入法不可用
  48. $("#thisCreateQty").keyup(function () {
  49. $(this).val($(this).val().replace(/[^0-9.]/g, ''));
  50. }).bind("paste", function () { //CTR+V事件处理
  51. $(this).val($(this).val().replace(/[^0-9.]/g, ''));
  52. }).css("ime-mode", "disabled"); //CSS设置输入法不可用
  53. $("#cretePageCount").keyup(function () {
  54. $(this).val($(this).val().replace(/[^0-9.]/g, ''));
  55. }).bind("paste", function () { //CTR+V事件处理
  56. $(this).val($(this).val().replace(/[^0-9.]/g, ''));
  57. }).css("ime-mode", "disabled"); //CSS设置输入法不可用
  58. $("#PRODUCTDATE").val(Mtime);
  59. $("#INVUOM").attr("disabled", "disabled");
  60. $("#InvCode").attr("disabled", "disabled");
  61. $("#INVNAME").attr("disabled", "disabled");
  62. $("#INVSTD").attr("disabled", "disabled");
  63. $("#Quantity").attr("disabled", "disabled");
  64. $("#CreatedQty").attr("disabled", "disabled");
  65. //$("#Amount").attr("disabled", "disabled");
  66. SeachMeasure();
  67. SeachLableofDisable();
  68. SeachAmountEnablebyInvCode(InvCode);
  69. SeachInfoByCodeAndSequence();
  70. debugger;
  71. if (InvAmountEnable == true) {
  72. $("#ZHU").css('display', 'none');
  73. } else {
  74. $("#FU").css('display', 'none');
  75. }
  76. if (thisCreateQtyEnable == true && cretePageCountEnable == true)
  77. {
  78. $("#Amount").attr("disabled", "disabled");
  79. $("#minPackQty").attr("disabled", "disabled");
  80. $("#cretePageCount").change(cretePageCount_Change);
  81. $("#thisCreateQty").change(thisCreate_Change);
  82. }
  83. else if (thisCreateQtyEnable == true && MeasureEnable==true)
  84. {
  85. if (InvAmountEnable == true && AmountEnable == true)
  86. {
  87. $("#cretePageCount").attr("disabled", "disabled");
  88. $("#minPackQty").attr("disabled", "disabled");
  89. $("#Amount").change(Amount_Change);
  90. $("#thisCreateQty").change(thisCreate_Change);
  91. var YAmount = $("#YAmount").val() * 1;//单据辅计量数量
  92. //if (YAmount==0) {
  93. // $.modalMsg("源头单据辅计量数量不可0,请确认!", "warning");
  94. // return;
  95. //}
  96. }
  97. else
  98. {
  99. //基础版原逻辑
  100. $("#Amount").attr("disabled", "disabled");
  101. $("#cretePageCount").attr("disabled", "disabled");
  102. $("#minPackQty").change(minPack_Change);
  103. $("#thisCreateQty").change(thisCreate_Change);
  104. }
  105. }
  106. else if (MeasureEnable == true && cretePageCountEnable==true)
  107. {
  108. if (InvAmountEnable == true && AmountEnable == true)
  109. {
  110. $("#minPackQty").attr("disabled", "disabled");
  111. $("#thisCreateQty").attr("disabled", "disabled");
  112. $("#Amount").change(Amount_Change);
  113. $("#cretePageCount").change(cretePageCount_Change);
  114. var YAmount = $("#YAmount").val() * 1;//单据辅计量数量
  115. //if (YAmount == 0) {
  116. // $.modalMsg("源头单据辅计量数量不可0,请确认!", "warning");
  117. // return;
  118. //}
  119. }
  120. else
  121. {
  122. $("#Amount").attr("disabled", "disabled");
  123. $("#thisCreateQty").attr("disabled", "disabled");
  124. $("#minPackQty").change(minPack_Change);
  125. $("#cretePageCount").change(cretePageCount_Change);
  126. }
  127. }
  128. ControlVendorLotNo(VenCode);
  129. ControlICSExtensionEnable();
  130. ControlICSColumnEnable();
  131. LoadShow();
  132. LoadShowForColumn();
  133. });
  134. //查询料品辅计量开关
  135. function SeachAmountEnablebyInvCode(InvCode) {
  136. $.ajax({
  137. url: "/WMS/WMSCreateItemLot/SeachAmountEnablebyInvCode?InvCode=" + InvCode + "&" + Math.random(),
  138. dataType: "json",
  139. async: false,
  140. success: function (data) {
  141. if (data.rows[0].AmountEnable == '1') {
  142. InvAmountEnable = true;
  143. }
  144. $("#InvProportion").val(data.rows[0].EATTRIBUTE1);
  145. }
  146. });
  147. }
  148. //查询配置项-计量单位
  149. function SeachMeasure() {
  150. $.ajax({
  151. url: "/WMS/WMSCreateItemLot/SeachMeasure" + "?" + Math.random(),
  152. dataType: "json",
  153. async: false,
  154. success: function (data) {
  155. if (data.rows[0].Code == 'AmountEnable') {
  156. AmountEnable = true;
  157. } else {
  158. minPackQtyEnable = true;
  159. }
  160. }
  161. });
  162. }
  163. //查询配置项-栏位输入限制
  164. function SeachLableofDisable() {
  165. $.ajax({
  166. url: "/WMS/WMSCreateItemLot/SeachLableofDisable" + "?" + Math.random(),
  167. dataType: "json",
  168. async: false,
  169. success: function (data) {
  170. if (data.rows[0].Code == 'thisCreateQtyEnable' && data.rows[0].Enable==true) {
  171. thisCreateQtyEnable = true;
  172. }
  173. if (data.rows[1].Code == 'MeasureEnable' && data.rows[1].Enable == true) {
  174. MeasureEnable = true;
  175. }
  176. if (data.rows[2].Code == 'cretePageCountEnable' && data.rows[2].Enable == true) {
  177. cretePageCountEnable = true;
  178. }
  179. }
  180. });
  181. }
  182. //加载页面信息
  183. function SeachInfoByCodeAndSequence() {
  184. if (Type == '1') {
  185. if (!!ApplyNegCode && !!Sequence) {
  186. $.ajax({
  187. url: "/WMS/WMSCreateItemLot/GetSubGridJsonByCreate?ApplyNegCode=" + ApplyNegCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  188. dataType: "json",
  189. async: false,
  190. success: function (data) {
  191. LotNoInfoControlFreeTerm(data.rows[0].InvCode, data.rows[0].InvUnit, data.rows[0].InvName, data.rows[0].InvStd, data.rows[0].Quantity, data.rows[0].CreatedQty, data.rows[0].thisCreateQty, data.rows[0].Amount, data.rows[0].EffectiveEnable, data.rows[0].EffectiveDays, data.rows[0].BatchCode, data.rows[0].VenCode, data.rows[0].WorkPoint, data.rows[0].ProjectCode, data.rows[0].BatchCode, data.rows[0].Version, data.rows[0].Brand, data.rows[0].cFree1, data.rows[0].cFree2, data.rows[0].cFree3, data.rows[0].cFree4, data.rows[0].cFree5, data.rows[0].cFree6, data.rows[0].cFree7, data.rows[0].cFree8, data.rows[0].cFree9, data.rows[0].cFree10, data.rows[0].ClassCode)
  192. }
  193. });
  194. }
  195. }
  196. if (Type == '2') {
  197. if (!!OApplyNegCode && !!Sequence) {
  198. $.ajax({
  199. url: "/WMS/WMSCreateItemLot/GetSubGridJsonWeiWaiByCreate?OApplyNegCode=" + OApplyNegCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  200. dataType: "json",
  201. async: false,
  202. success: function (data) {
  203. LotNoInfoControlFreeTerm(data.rows[0].InvCode, data.rows[0].InvUnit, data.rows[0].InvName, data.rows[0].InvStd, data.rows[0].Quantity, data.rows[0].CreatedQty, data.rows[0].thisCreateQty, data.rows[0].Amount, data.rows[0].EffectiveEnable, data.rows[0].EffectiveDays, data.rows[0].BatchCode, data.rows[0].VenCode, data.rows[0].WorkPoint, data.rows[0].ProjectCode, data.rows[0].BatchCode, data.rows[0].Version, data.rows[0].Brand, data.rows[0].cFree1, data.rows[0].cFree2, data.rows[0].cFree3, data.rows[0].cFree4, data.rows[0].cFree5, data.rows[0].cFree6, data.rows[0].cFree7, data.rows[0].cFree8, data.rows[0].cFree9, data.rows[0].cFree10, data.rows[0].ClassCode)
  204. }
  205. });
  206. }
  207. }
  208. if (Type == '3') {
  209. if (!!MOCode && !!Sequence) {
  210. $.ajax({
  211. url: "/WMS/WMSCreateItemLot/GetSubGridJsonChengPingByCreate?MOCode=" + MOCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  212. dataType: "json",
  213. async: false,
  214. success: function (data) {
  215. $("#Enable").val(data.rows[0].Enable);
  216. LotNoInfoControlFreeTerm(data.rows[0].InvCode, data.rows[0].InvUnit, data.rows[0].InvName, data.rows[0].InvStd, data.rows[0].Quantity, data.rows[0].CreatedQty, data.rows[0].thisCreateQty, data.rows[0].Amount, data.rows[0].EffectiveEnable, data.rows[0].EffectiveDays, data.rows[0].BatchCode, data.rows[0].VenCode, data.rows[0].WorkPoint, data.rows[0].ProjectCode, data.rows[0].BatchCode, data.rows[0].Version, data.rows[0].Brand, data.rows[0].cFree1, data.rows[0].cFree2, data.rows[0].cFree3, data.rows[0].cFree4, data.rows[0].cFree5, data.rows[0].cFree6, data.rows[0].cFree7, data.rows[0].cFree8, data.rows[0].cFree9, data.rows[0].cFree10, data.rows[0].ClassCode)
  217. }
  218. });
  219. }
  220. }
  221. if (Type == '4') {
  222. if (!!SDNCode && !!Sequence) {
  223. $.ajax({
  224. url: "/WMS/WMSCreateItemLot/GetSubGridJsonXiaoShouByCreate?SDNCode=" + SDNCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  225. dataType: "json",
  226. async: false,
  227. success: function (data) {
  228. LotNoInfoControlFreeTerm(data.rows[0].InvCode, data.rows[0].InvUnit, data.rows[0].InvName, data.rows[0].InvStd, data.rows[0].Quantity, data.rows[0].CreatedQty, data.rows[0].thisCreateQty, data.rows[0].Amount, data.rows[0].EffectiveEnable, data.rows[0].EffectiveDays, data.rows[0].BatchCode, data.rows[0].VenCode, data.rows[0].WorkPoint, data.rows[0].ProjectCode, data.rows[0].BatchCode, data.rows[0].Version, data.rows[0].Brand, data.rows[0].cFree1, data.rows[0].cFree2, data.rows[0].cFree3, data.rows[0].cFree4, data.rows[0].cFree5, data.rows[0].cFree6, data.rows[0].cFree7, data.rows[0].cFree8, data.rows[0].cFree9, data.rows[0].cFree10, data.rows[0].ClassCode)
  229. }
  230. });
  231. }
  232. }
  233. if (Type == '5') {
  234. if (!!InCode && !!Sequence) {
  235. $.ajax({
  236. url: "/WMS/WMSCreateItemLot/GetSubGridJsonQiTaByCreate?InCode=" + InCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  237. dataType: "json",
  238. async: false,
  239. success: function (data) {
  240. LotNoInfoControlFreeTerm(data.rows[0].InvCode, data.rows[0].InvUnit, data.rows[0].InvName, data.rows[0].InvStd, data.rows[0].Quantity, data.rows[0].CreatedQty, data.rows[0].thisCreateQty, data.rows[0].Amount, data.rows[0].EffectiveEnable, data.rows[0].EffectiveDays, data.rows[0].BatchCode, data.rows[0].VenCode, data.rows[0].WorkPoint, data.rows[0].ProjectCode, data.rows[0].BatchCode, data.rows[0].Version, data.rows[0].Brand, data.rows[0].cFree1, data.rows[0].cFree2, data.rows[0].cFree3, data.rows[0].cFree4, data.rows[0].cFree5, data.rows[0].cFree6, data.rows[0].cFree7, data.rows[0].cFree8, data.rows[0].cFree9, data.rows[0].cFree10, data.rows[0].ClassCode)
  241. }
  242. });
  243. }
  244. }
  245. if (Type == '6') {
  246. if (!!ReturnCode && !!Sequence) {
  247. $.ajax({
  248. url: "/WMS/WMSCreateItemLot/GetSubGridJsonGuiHuanByCreate?ReturnCode=" + ReturnCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  249. dataType: "json",
  250. async: false,
  251. success: function (data) {
  252. LotNoInfoControlFreeTerm(data.rows[0].InvCode, data.rows[0].InvUnit, data.rows[0].InvName, data.rows[0].InvStd, data.rows[0].Quantity, data.rows[0].CreatedQty, data.rows[0].thisCreateQty, data.rows[0].Amount, data.rows[0].EffectiveEnable, data.rows[0].EffectiveDays, data.rows[0].BatchCode, data.rows[0].VenCode, data.rows[0].WorkPoint, data.rows[0].ProjectCode, data.rows[0].BatchCode, data.rows[0].Version, data.rows[0].Brand, data.rows[0].cFree1, data.rows[0].cFree2, data.rows[0].cFree3, data.rows[0].cFree4, data.rows[0].cFree5, data.rows[0].cFree6, data.rows[0].cFree7, data.rows[0].cFree8, data.rows[0].cFree9, data.rows[0].cFree10, data.rows[0].ClassCode)
  253. }
  254. });
  255. }
  256. }
  257. if (Type == '7') {
  258. if (!!DNCode && !!Sequence) {
  259. $.ajax({
  260. url: "/WMS/WMSCreateItemLot/GetSubGridJsonSHDHByCreate?DNCode=" + DNCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  261. dataType: "json",
  262. async: false,
  263. success: function (data) {
  264. LotNoInfoControlFreeTerm(data.rows[0].InvCode, data.rows[0].InvUnit, data.rows[0].InvName, data.rows[0].InvStd, data.rows[0].Quantity, data.rows[0].CreatedQty, data.rows[0].thisCreateQty, data.rows[0].Amount, data.rows[0].EffectiveEnable, data.rows[0].EffectiveDays, data.rows[0].BatchCode, data.rows[0].VenCode, data.rows[0].WorkPoint, data.rows[0].ProjectCode, data.rows[0].BatchCode, data.rows[0].Version, data.rows[0].Brand, data.rows[0].cFree1, data.rows[0].cFree2, data.rows[0].cFree3, data.rows[0].cFree4, data.rows[0].cFree5, data.rows[0].cFree6, data.rows[0].cFree7, data.rows[0].cFree8, data.rows[0].cFree9, data.rows[0].cFree10, data.rows[0].ClassCode, Type, data.rows[0].SurplusCreateQty)
  265. }
  266. });
  267. }
  268. }
  269. if (Type == '8') {
  270. if (!!ODNCode && !!Sequence) {
  271. $.ajax({
  272. url: "/WMS/WMSCreateItemLot/GetSubGridJsonWWSHDHByCreate?ODNCode=" + ODNCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  273. dataType: "json",
  274. async: false,
  275. success: function (data) {
  276. $("#Enable").val(data.rows[0].Enable);
  277. LotNoInfoControlFreeTerm(data.rows[0].InvCode, data.rows[0].InvUnit, data.rows[0].InvName, data.rows[0].InvStd, data.rows[0].Quantity, data.rows[0].CreatedQty, data.rows[0].thisCreateQty, data.rows[0].Amount, data.rows[0].EffectiveEnable, data.rows[0].EffectiveDays, data.rows[0].BatchCode, data.rows[0].VenCode, data.rows[0].WorkPoint, data.rows[0].ProjectCode, data.rows[0].BatchCode, data.rows[0].Version, data.rows[0].Brand, data.rows[0].cFree1, data.rows[0].cFree2, data.rows[0].cFree3, data.rows[0].cFree4, data.rows[0].cFree5, data.rows[0].cFree6, data.rows[0].cFree7, data.rows[0].cFree8, data.rows[0].cFree9, data.rows[0].cFree10, data.rows[0].ClassCode, Type, data.rows[0].SurplusCreateQty)
  278. }
  279. });
  280. }
  281. }
  282. if (Type == '9') {
  283. if (!!RCVCode && !!Sequence) {
  284. $.ajax({
  285. url: "/WMS/WMSCreateItemLot/GetSubGridJsonKLCPRKByCreate?RCVCode=" + RCVCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  286. dataType: "json",
  287. async: false,
  288. success: function (data) {
  289. LotNoInfoControlFreeTerm(data.rows[0].InvCode, data.rows[0].InvUnit, data.rows[0].InvName, data.rows[0].InvStd, data.rows[0].Quantity, data.rows[0].CreatedQty, data.rows[0].thisCreateQty, data.rows[0].Amount, data.rows[0].EffectiveEnable, data.rows[0].EffectiveDays, data.rows[0].BatchCode, data.rows[0].VenCode, data.rows[0].WorkPoint, data.rows[0].ProjectCode, data.rows[0].BatchCode, data.rows[0].Version, data.rows[0].Brand, data.rows[0].cFree1, data.rows[0].cFree2, data.rows[0].cFree3, data.rows[0].cFree4, data.rows[0].cFree5, data.rows[0].cFree6, data.rows[0].cFree7, data.rows[0].cFree8, data.rows[0].cFree9, data.rows[0].cFree10, data.rows[0].ClassCode)
  290. }
  291. });
  292. }
  293. }
  294. if (Type == '10') {
  295. if (!!DNCode && !!Sequence) {
  296. $.ajax({
  297. url: "/WMS/WMSCreateItemLot/GetSubGridJsonJSDByCreate?DNCode=" + DNCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  298. dataType: "json",
  299. async: false,
  300. success: function (data) {
  301. LotNoInfoControlFreeTerm(data.rows[0].InvCode, data.rows[0].InvUnit, data.rows[0].InvName, data.rows[0].InvStd, data.rows[0].Quantity, data.rows[0].CreatedQty, data.rows[0].thisCreateQty, data.rows[0].Amount, data.rows[0].EffectiveEnable, data.rows[0].EffectiveDays, data.rows[0].BatchCode, data.rows[0].VenCode, data.rows[0].WorkPoint, data.rows[0].ProjectCode, data.rows[0].BatchCode, data.rows[0].Version, data.rows[0].Brand, data.rows[0].cFree1, data.rows[0].cFree2, data.rows[0].cFree3, data.rows[0].cFree4, data.rows[0].cFree5, data.rows[0].cFree6, data.rows[0].cFree7, data.rows[0].cFree8, data.rows[0].cFree9, data.rows[0].cFree10, data.rows[0].ClassCode)
  302. }
  303. });
  304. }
  305. }
  306. if (Type == '11') {
  307. if (!!ODNCode && !!Sequence) {
  308. $.ajax({
  309. url: "/WMS/WMSCreateItemLot/GetSubGridJsonWWJSDByCreate?ODNCode=" + ODNCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  310. dataType: "json",
  311. async: false,
  312. success: function (data) {
  313. LotNoInfoControlFreeTerm(data.rows[0].InvCode, data.rows[0].InvUnit, data.rows[0].InvName, data.rows[0].InvStd, data.rows[0].Quantity, data.rows[0].CreatedQty, data.rows[0].thisCreateQty, data.rows[0].Amount, data.rows[0].EffectiveEnable, data.rows[0].EffectiveDays, data.rows[0].BatchCode, data.rows[0].VenCode, data.rows[0].WorkPoint, data.rows[0].ProjectCode, data.rows[0].BatchCode, data.rows[0].Version, data.rows[0].Brand, data.rows[0].cFree1, data.rows[0].cFree2, data.rows[0].cFree3, data.rows[0].cFree4, data.rows[0].cFree5, data.rows[0].cFree6, data.rows[0].cFree7, data.rows[0].cFree8, data.rows[0].cFree9, data.rows[0].cFree10, data.rows[0].ClassCode)
  314. }
  315. });
  316. }
  317. }
  318. if (Type == '12') {
  319. if (!!LLApplyNegCode && !!Sequence) {
  320. $.ajax({
  321. url: "/WMS/WMSCreateItemLot/GetSubGridJsonLLSQDByCreate?ApplyNegCode=" + LLApplyNegCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  322. dataType: "json",
  323. async: false,
  324. success: function (data) {
  325. LotNoInfoControlFreeTerm(data.rows[0].InvCode, data.rows[0].InvUnit, data.rows[0].InvName, data.rows[0].InvStd, data.rows[0].Quantity, data.rows[0].CreatedQty, data.rows[0].thisCreateQty, data.rows[0].Amount, data.rows[0].EffectiveEnable, data.rows[0].EffectiveDays, data.rows[0].BatchCode, data.rows[0].VenCode, data.rows[0].WorkPoint, data.rows[0].ProjectCode, data.rows[0].BatchCode, data.rows[0].Version, data.rows[0].Brand, data.rows[0].cFree1, data.rows[0].cFree2, data.rows[0].cFree3, data.rows[0].cFree4, data.rows[0].cFree5, data.rows[0].cFree6, data.rows[0].cFree7, data.rows[0].cFree8, data.rows[0].cFree9, data.rows[0].cFree10, data.rows[0].ClassCode)
  326. }
  327. });
  328. }
  329. }
  330. if (Type == '13') {
  331. if (!!CLApplyNegCode && !!Sequence) {
  332. $.ajax({
  333. url: "/WMS/WMSCreateItemLot/GetSubGridJsonCLCKByCreate?ApplyNegCode=" + CLApplyNegCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  334. dataType: "json",
  335. async: false,
  336. success: function (data) {
  337. LotNoInfoControlFreeTerm(data.rows[0].InvCode, data.rows[0].InvUnit, data.rows[0].InvName, data.rows[0].InvStd, data.rows[0].Quantity, data.rows[0].CreatedQty, data.rows[0].thisCreateQty, data.rows[0].Amount, data.rows[0].EffectiveEnable, data.rows[0].EffectiveDays, data.rows[0].BatchCode, data.rows[0].VenCode, data.rows[0].WorkPoint, data.rows[0].ProjectCode, data.rows[0].BatchCode, data.rows[0].Version, data.rows[0].Brand, data.rows[0].cFree1, data.rows[0].cFree2, data.rows[0].cFree3, data.rows[0].cFree4, data.rows[0].cFree5, data.rows[0].cFree6, data.rows[0].cFree7, data.rows[0].cFree8, data.rows[0].cFree9, data.rows[0].cFree10, data.rows[0].ClassCode)
  338. }
  339. });
  340. }
  341. }
  342. if (Type == '14') {
  343. if (!!WWLLOApplyNegCode && !!Sequence) {
  344. $.ajax({
  345. url: "/WMS/WMSCreateItemLot/GetSubGridJsonWWLLByCreate?OApplyNegCode=" + WWLLOApplyNegCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  346. dataType: "json",
  347. async: false,
  348. success: function (data) {
  349. LotNoInfoControlFreeTerm(data.rows[0].InvCode, data.rows[0].InvUnit, data.rows[0].InvName, data.rows[0].InvStd, data.rows[0].Quantity, data.rows[0].CreatedQty, data.rows[0].thisCreateQty, data.rows[0].Amount, data.rows[0].EffectiveEnable, data.rows[0].EffectiveDays, data.rows[0].BatchCode, data.rows[0].VenCode, data.rows[0].WorkPoint, data.rows[0].ProjectCode, data.rows[0].BatchCode, data.rows[0].Version, data.rows[0].Brand, data.rows[0].cFree1, data.rows[0].cFree2, data.rows[0].cFree3, data.rows[0].cFree4, data.rows[0].cFree5, data.rows[0].cFree6, data.rows[0].cFree7, data.rows[0].cFree8, data.rows[0].cFree9, data.rows[0].cFree10, data.rows[0].ClassCode)
  350. }
  351. });
  352. }
  353. }
  354. if (Type == '15') {
  355. if (!!WWCLOApplyNegCode && !!Sequence) {
  356. $.ajax({
  357. url: "/WMS/WMSCreateItemLot/GetSubGridJsonWWCLByCreate?OApplyNegCode=" + WWCLOApplyNegCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  358. dataType: "json",
  359. async: false,
  360. success: function (data) {
  361. LotNoInfoControlFreeTerm(data.rows[0].InvCode, data.rows[0].InvUnit, data.rows[0].InvName, data.rows[0].InvStd, data.rows[0].Quantity, data.rows[0].CreatedQty, data.rows[0].thisCreateQty, data.rows[0].Amount, data.rows[0].EffectiveEnable, data.rows[0].EffectiveDays, data.rows[0].BatchCode, data.rows[0].VenCode, data.rows[0].WorkPoint, data.rows[0].ProjectCode, data.rows[0].BatchCode, data.rows[0].Version, data.rows[0].Brand, data.rows[0].cFree1, data.rows[0].cFree2, data.rows[0].cFree3, data.rows[0].cFree4, data.rows[0].cFree5, data.rows[0].cFree6, data.rows[0].cFree7, data.rows[0].cFree8, data.rows[0].cFree9, data.rows[0].cFree10, data.rows[0].ClassCode)
  362. }
  363. });
  364. }
  365. }
  366. if (Type == '16') {
  367. if (!!FGGDMOCode && !!Sequence) {
  368. $.ajax({
  369. url: "/WMS/WMSCreateItemLot/GetSubGridJsonFGGDCreate?FGGDMOCode=" + FGGDMOCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  370. dataType: "json",
  371. async: false,
  372. success: function (data) {
  373. LotNoInfoControlFreeTerm(data.rows[0].InvCode, data.rows[0].InvUnit, data.rows[0].InvName, data.rows[0].InvStd, data.rows[0].Quantity, data.rows[0].CreatedQty, data.rows[0].thisCreateQty, data.rows[0].Amount, data.rows[0].EffectiveEnable, data.rows[0].EffectiveDays, data.rows[0].BatchCode, data.rows[0].VenCode, data.rows[0].WorkPoint, data.rows[0].ProjectCode, data.rows[0].BatchCode, data.rows[0].Version, data.rows[0].Brand, data.rows[0].cFree1, data.rows[0].cFree2, data.rows[0].cFree3, data.rows[0].cFree4, data.rows[0].cFree5, data.rows[0].cFree6, data.rows[0].cFree7, data.rows[0].cFree8, data.rows[0].cFree9, data.rows[0].cFree10, data.rows[0].ClassCode)
  374. }
  375. });
  376. }
  377. }
  378. if (Type == '18') {
  379. if (!!FCPMOCode && !!Sequence) {
  380. $.ajax({
  381. url: "/WMS/WMSCreateItemLot/GetSubGridJsonFCPCreate?FCPMOCode=" + FCPMOCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  382. dataType: "json",
  383. async: false,
  384. success: function (data) {
  385. LotNoInfoControlFreeTerm(data.rows[0].InvCode, data.rows[0].InvUnit, data.rows[0].InvName, data.rows[0].InvStd, data.rows[0].Quantity, data.rows[0].CreatedQty, data.rows[0].thisCreateQty, data.rows[0].Amount, data.rows[0].EffectiveEnable, data.rows[0].EffectiveDays, data.rows[0].BatchCode, data.rows[0].VenCode, data.rows[0].WorkPoint, data.rows[0].ProjectCode, data.rows[0].BatchCode, data.rows[0].Version, data.rows[0].Brand, data.rows[0].cFree1, data.rows[0].cFree2, data.rows[0].cFree3, data.rows[0].cFree4, data.rows[0].cFree5, data.rows[0].cFree6, data.rows[0].cFree7, data.rows[0].cFree8, data.rows[0].cFree9, data.rows[0].cFree10, data.rows[0].ClassCode)
  386. }
  387. });
  388. }
  389. }
  390. }
  391. //查询后台自由项表(控制前台显示)
  392. function ControlICSExtensionEnable() {
  393. $.ajax({
  394. url: "/WMS/WMSCreateItemLot/SelectICSExtensionEnable" + "?" + Math.random(),
  395. dataType: "json",
  396. async: false,
  397. success: function (data) {
  398. if (data != null && data.length > 0) {
  399. for (var i = 0; i < data.length; i++) {
  400. if (data[i].ColCode == 'ProjectCode') { $("#trProjectCode").css('display', 'none'); }
  401. if (data[i].ColCode == 'BatchCode') { $("#trBatchCode").css('display', 'none'); }
  402. if (data[i].ColCode == 'Version') { $("#trVersion").css('display', 'none'); }
  403. if (data[i].ColCode == 'Brand') { $("#trBrand").css('display', 'none'); }
  404. if (data[i].ColCode == 'cFree1') { $("#trcFree1").css('display', 'none'); }
  405. if (data[i].ColCode == 'cFree2') { $("#trcFree2").css('display', 'none'); }
  406. if (data[i].ColCode == 'cFree3') { $("#trcFree3").css('display', 'none'); }
  407. if (data[i].ColCode == 'cFree4') { $("#trcFree4").css('display', 'none'); }
  408. if (data[i].ColCode == 'cFree5') { $("#trcFree5").css('display', 'none'); }
  409. if (data[i].ColCode == 'cFree6') { $("#trcFree6").css('display', 'none'); }
  410. if (data[i].ColCode == 'cFree7') { $("#trcFree7").css('display', 'none'); }
  411. if (data[i].ColCode == 'cFree8') { $("#trcFree8").css('display', 'none'); }
  412. if (data[i].ColCode == 'cFree9') { $("#trcFree9").css('display', 'none'); }
  413. if (data[i].ColCode == 'cFree10') { $("#trcFree10").css('display', 'none'); }
  414. //if (i >= 4) {
  415. // if (data[i].ColName == 'cFree' + (i - 3)) {$("#trcFree'" + (i - 3) + "'").css('display', 'none');}
  416. //}
  417. }
  418. }
  419. }
  420. });
  421. }
  422. //查询后台条码表单据自定义项(控制前台显示)
  423. function ControlICSColumnEnable() {
  424. $.ajax({
  425. url: "/WMS/WMSCreateItemLot/SelectICSColumnEnableForLotEnable" + "?" + Math.random(),
  426. dataType: "json",
  427. async: false,
  428. success: function (data) {
  429. if (data != null && data.length > 0) {
  430. for (var i = 0; i < data.length; i++) {
  431. //if (data[i].ColumnCode == 'EATTRIBUTE1') { $("#trEATTRIBUTE1").css('display', 'none'); }
  432. if (data[i].ColumnCode == 'EATTRIBUTE2') { $("#trEATTRIBUTE2").css('display', 'none'); }
  433. if (data[i].ColumnCode == 'EATTRIBUTE3') { $("#trEATTRIBUTE3").css('display', 'none'); }
  434. if (data[i].ColumnCode == 'EATTRIBUTE4') { $("#trEATTRIBUTE4").css('display', 'none'); }
  435. if (data[i].ColumnCode == 'EATTRIBUTE5') { $("#trEATTRIBUTE5").css('display', 'none'); }
  436. if (data[i].ColumnCode == 'EATTRIBUTE6') { $("#trEATTRIBUTE6").css('display', 'none'); }
  437. if (data[i].ColumnCode == 'EATTRIBUTE7') { $("#trEATTRIBUTE7").css('display', 'none'); }
  438. if (data[i].ColumnCode == 'EATTRIBUTE8') { $("#trEATTRIBUTE8").css('display', 'none'); }
  439. if (data[i].ColumnCode == 'EATTRIBUTE9') { $("#trEATTRIBUTE9").css('display', 'none'); }
  440. if (data[i].ColumnCode == 'EATTRIBUTE10') { $("#trEATTRIBUTE10").css('display', 'none'); }
  441. }
  442. }
  443. }
  444. });
  445. }
  446. function ControlVendorLotNo(VenCode) {
  447. $.ajax({
  448. url: "/WMS/WMSCreateItemLot/GetVendorLotNo?VenCode=" + VenCode + "&WorkPoint=" + WorkPoint,
  449. //data: { keyValue: keyValue },
  450. dataType: "json",
  451. async: false,
  452. success: function (data) {
  453. $("#VendorLotNo").val(data.VendorLotNo);
  454. }
  455. });
  456. }
  457. //控制加载信息的公共方法
  458. function LotNoInfoControlFreeTerm(InvCode, InvUnit, InvName, InvStd, Quantity, CreatedQty, thisCreateQty, Amount, EffectiveEnable, EffectiveDays, BatchCode, VenCode, WorkPoint, ProjectCode, BatchCode, Version, Brand, cFree1, cFree2, cFree3, cFree4, cFree5, cFree6, cFree7, cFree8, cFree9, cFree10, ClassCode, Type, SurplusCreateQty) {
  459. $("#INVUOM").val(InvUnit);
  460. $("#InvCode").val(InvCode);
  461. $("#ClassCode").val(ClassCode);
  462. $("#INVNAME").val(InvName);
  463. $("#INVSTD").val(InvStd);
  464. $("#Quantity").val(Quantity);
  465. $("#CreatedQty").val(CreatedQty);
  466. $("#thisCreateQty").val(thisCreateQty);
  467. if (Type=='7'||Type=='8') {
  468. $("#SurplusCreateQty").val(SurplusCreateQty);
  469. } else {
  470. $("#SurplusCreateQty").val(thisCreateQty);
  471. }
  472. $("#YAmount").val(Amount);
  473. $("#EffectiveEnable").val(EffectiveEnable);
  474. $("#EffectiveDays").val(EffectiveDays);
  475. VenCode = VenCode;
  476. WorkPoint = WorkPoint;
  477. if (Quantity == CreatedQty) {
  478. $("#thisCreateQty").attr("disabled", "disabled");
  479. $("#minPackQty").attr("disabled", "disabled");
  480. $("#VendorLotNo").attr("disabled", "disabled");
  481. }
  482. if (ProjectCode != "") { $("#ProjectCode").prop("disabled", true); $("#ProjectCode").val(ProjectCode);}
  483. if (BatchCode != "") { $("#BatchCode").prop("disabled", true); $("#BatchCode").val(BatchCode); }
  484. if (Version != "") { $("#Version").prop("disabled", true); $("#Version").val(Version); }
  485. if (Brand != "") { $("#Brand").prop("disabled", true); $("#Brand").val(Brand); }
  486. if (cFree1 != "") { $("#cFree1").prop("disabled", true); $("#cFree1").val(cFree1); }
  487. if (cFree2 != "") { $("#cFree2").prop("disabled", true); $("#cFree2").val(cFree2); }
  488. if (cFree3 != "") { $("#cFree3").prop("disabled", true); $("#cFree3").val(cFree3); }
  489. if (cFree4 != "") { $("#cFree4").prop("disabled", true); $("#cFree4").val(cFree4); }
  490. if (cFree5 != "") { $("#cFree5").prop("disabled", true); $("#cFree5").val(cFree5); }
  491. if (cFree6 != "") { $("#cFree6").prop("disabled", true); $("#cFree6").val(cFree6); }
  492. if (cFree7 != "") { $("#cFree7").prop("disabled", true); $("#cFree7").val(cFree7); }
  493. if (cFree8 != "") { $("#cFree8").prop("disabled", true); $("#cFree8").val(cFree8); }
  494. if (cFree9 != "") { $("#cFree9").prop("disabled", true); $("#cFree9").val(cFree9); }
  495. if (cFree10 != "") { $("#cFree10").prop("disabled", true); $("#cFree10").val(cFree10); }
  496. }
  497. //加载自由项名字
  498. function LoadShow() {
  499. $.ajax({
  500. url: "/WMS/WMSCreateItemLot/GetLoadShow" + "?" + Math.random(),
  501. dataType: "json",
  502. async: false,
  503. success: function (data) {
  504. $("#LableProjectCode").text(data.rows[0].ColName);
  505. $("#LableBatchCode").text(data.rows[1].ColName);
  506. $("#LableVersion").text(data.rows[2].ColName);
  507. $("#LableBrand").text(data.rows[3].ColName);
  508. $("#LablecFree1").text(data.rows[4].ColName);
  509. $("#LablecFree2").text(data.rows[5].ColName);
  510. $("#LablecFree3").text(data.rows[6].ColName);
  511. $("#LablecFree4").text(data.rows[7].ColName);
  512. $("#LablecFree5").text(data.rows[8].ColName);
  513. $("#LablecFree6").text(data.rows[9].ColName);
  514. $("#LablecFree7").text(data.rows[10].ColName);
  515. $("#LablecFree8").text(data.rows[11].ColName);
  516. $("#LablecFree9").text(data.rows[12].ColName);
  517. $("#LablecFree10").text(data.rows[13].ColName);
  518. }
  519. });
  520. }
  521. //加载自定义项名字
  522. function LoadShowForColumn() {
  523. $.ajax({
  524. url: "/WMS/WMSCreateItemLot/GetLoadShowForColumn" + "?" + Math.random(),
  525. dataType: "json",
  526. async: false,
  527. success: function (data) {
  528. $("#LableEATTRIBUTE2").text(data.rows[0].Name);
  529. $("#LableEATTRIBUTE3").text(data.rows[1].Name);
  530. $("#LableEATTRIBUTE4").text(data.rows[2].Name);
  531. $("#LableEATTRIBUTE5").text(data.rows[3].Name);
  532. $("#LableEATTRIBUTE6").text(data.rows[4].Name);
  533. $("#LableEATTRIBUTE7").text(data.rows[5].Name);
  534. $("#LableEATTRIBUTE8").text(data.rows[6].Name);
  535. $("#LableEATTRIBUTE9").text(data.rows[7].Name);
  536. $("#LableEATTRIBUTE10").text(data.rows[8].Name);
  537. // $("#LableEATTRIBUTE10").text(data.rows[9].Name);
  538. }
  539. });
  540. }
  541. //最小包装量值改变事件(原输入本次+最小)
  542. function minPackQty_Change() {
  543. var thisCreateQty = $("#thisCreateQty").val() * 1;//本次生成数量
  544. thisCreateQty = thisCreateQty.toFixed(6);
  545. var minPackQty = $("#minPackQty").val() * 1;//最小包装量
  546. minPackQty = minPackQty.toFixed(6);
  547. var createPageCount = $("#cretePageCount").val() * 1;//本次生成张数
  548. var Quantity = $("#Quantity").val() * 1;//数量
  549. var YAmount = $("#YAmount").val() * 1;//辅计量数量
  550. createPageCount = createPageCount.toFixed(0);
  551. if (minPackQty <= 0) {
  552. $.modalAlertNew("WMS00102");
  553. return false;
  554. }
  555. //不可以整除,生成张数+1;
  556. //if (thisCreateQty % minPackQty != 0) {
  557. if (parseInt(Math.ceil(thisCreateQty * 10000)) % parseInt(Math.ceil(minPackQty * 10000)) != 0) {
  558. createPageCount = parseInt(thisCreateQty / minPackQty) + 1;
  559. $("#cretePageCount").val(createPageCount);
  560. }
  561. else {
  562. createPageCount = parseInt(thisCreateQty / minPackQty);
  563. $("#cretePageCount").val(createPageCount);
  564. }
  565. var Ratio = YAmount / Quantity * minPackQty;
  566. $("#Amount").val(Ratio);//自动计算出的条码辅计量数量
  567. }
  568. //本次生成数量值改变事件(原输入本次+最小)
  569. function thisCreateQty_Change() {
  570. var Quantity_str = $("#Quantity").val() * 1;//采购订单总数
  571. var CreatedQty_str = $("#CreatedQty").val() * 1;//已生成数量
  572. var thisCreateQty_str = $("#thisCreateQty").val() * 1;//本次生成数量
  573. var Quantity = Number(Quantity_str);
  574. var CreatedQty = Number(CreatedQty_str);
  575. var thisCreateQty = Number(thisCreateQty_str);
  576. if (thisCreateQty <= 0) {
  577. $.modalAlertNew("WMS00102");
  578. return false;
  579. }
  580. if (thisCreateQty <= 0 || thisCreateQty > (Quantity - CreatedQty)) {
  581. var maxQty = Quantity - CreatedQty;
  582. $.modalAlertNew("WMS00103",maxQty);
  583. //$.modalAlert("请输入0到" + maxQty + "范围内的数!");
  584. $("#thisCreateQty").val("");
  585. return false;
  586. } else {
  587. minPackQty_Change();
  588. return true;
  589. }
  590. var minPackQty = $("#minPackQty").val() * 1;//最小包装量
  591. minPackQty_Change();
  592. }
  593. //本次生成数量改变事件
  594. function thisCreate_Change() {
  595. //本+辅
  596. if (thisCreateQtyEnable == true && AmountEnable == true) {
  597. thisCreateAndAmount();
  598. }
  599. //本+张数
  600. else if (thisCreateQtyEnable == true && cretePageCountEnable == true)
  601. {
  602. thisCreateAndcretePageCount();
  603. }
  604. //本+最小
  605. else
  606. {
  607. thisCreateAndminPack();
  608. }
  609. }
  610. //最小包装量改变事件
  611. function minPack_Change() {
  612. //最小+张数
  613. if (minPackQtyEnable == true && cretePageCountEnable == true) {
  614. minPackAndcretePageCount();
  615. }
  616. //最小+本
  617. else {
  618. thisCreateAndminPack();
  619. }
  620. }
  621. //辅计量数量改变事件
  622. function Amount_Change() {
  623. //辅+张数
  624. if (AmountEnable == true && cretePageCountEnable == true) {
  625. AmountAndcretePageCount();
  626. }
  627. //辅+本
  628. else
  629. {
  630. thisCreateAndAmount();
  631. }
  632. }
  633. //生成张数改变事件
  634. function cretePageCount_Change() {
  635. //张数+本
  636. if (thisCreateQtyEnable == true && cretePageCountEnable == true) {
  637. thisCreateAndcretePageCount();
  638. }
  639. //张数+最小
  640. else if (minPackQtyEnable == true && cretePageCountEnable == true)
  641. {
  642. minPackAndcretePageCount();
  643. }
  644. //张数+辅
  645. else
  646. {
  647. AmountAndcretePageCount();
  648. }
  649. }
  650. ////辅+张数
  651. //function AmountAndcretePageCount() {
  652. // var Amount = $("#Amount").val() * 1;//辅计量数量
  653. // Amount = Amount.toFixed(6);
  654. // var cretePageCount = $("#cretePageCount").val() * 1;//张数
  655. // cretePageCount = cretePageCount.toFixed(6);
  656. // var Quantity = $("#Quantity").val() * 1;//数量
  657. // var YAmount = $("#YAmount").val() * 1;//单据辅计量数量
  658. // if (Amount <= 0) {
  659. // $.modalAlertNew("WMS00102");
  660. // return false;
  661. // }
  662. // if (cretePageCount <= 0) {
  663. // $.modalAlertNew("WMS00102");
  664. // return false;
  665. // }
  666. // var minPackQty = Amount / (YAmount / Quantity);
  667. // var thisCreateQty = minPackQty * cretePageCount;
  668. // $("#thisCreateQty").val(thisCreateQty);
  669. // $("#minPackQty").val(minPackQty);
  670. // var CreatedQty_str = $("#CreatedQty").val() * 1;//已生成数量
  671. // var CreatedQty = Number(CreatedQty_str);
  672. // if (thisCreateQty + CreatedQty > Quantity) {
  673. // var maxQty = Quantity - CreatedQty;
  674. // $.modalAlert("请输入0到" + maxQty + "范围内的数!");
  675. // return false;
  676. // }
  677. //}
  678. //辅+张数
  679. function AmountAndcretePageCount() {
  680. debugger;
  681. var Amount = $("#Amount").val() * 1;//辅计量数量
  682. Amount = Amount.toFixed(6);
  683. var cretePageCount = $("#cretePageCount").val() * 1;//张数
  684. cretePageCount = cretePageCount.toFixed(6);
  685. var Quantity = $("#Quantity").val() * 1;//数量
  686. var YAmount = $("#YAmount").val() * 1;//单据辅计量数量
  687. var InvProportion = $("#InvProportion").val();//转换率
  688. //仅测试使用
  689. //InvProportion = 2;
  690. var thisCreateQty = Amount * InvProportion * cretePageCount;
  691. var minPackQty = Amount * InvProportion;
  692. $("#thisCreateQty").val(thisCreateQty);
  693. $("#minPackQty").val(minPackQty);
  694. var CreatedQty_str = $("#CreatedQty").val() * 1;//已生成数量
  695. var CreatedQty = Number(CreatedQty_str);
  696. if (thisCreateQty + CreatedQty > Quantity) {
  697. var maxQty = (Quantity - CreatedQty) / InvProportion;
  698. maxQty = parseFloat(maxQty.toFixed(4));
  699. $.modalAlert("请输入0到" + maxQty + "范围内的数!");
  700. return false;
  701. }
  702. }
  703. //最小+张数
  704. function minPackAndcretePageCount() {
  705. var minPackQty = $("#minPackQty").val() * 1;//最小包装量
  706. minPackQty = minPackQty.toFixed(6);
  707. var cretePageCount = $("#cretePageCount").val() * 1;//张数
  708. cretePageCount = cretePageCount.toFixed(6);
  709. var Quantity = $("#Quantity").val() * 1;//数量
  710. var YAmount = $("#YAmount").val() * 1;//单据辅计量数量
  711. if (cretePageCount <= 0) {
  712. $.modalAlertNew("WMS00102");
  713. return false;
  714. }
  715. if (minPackQty <= 0) {
  716. $.modalAlertNew("WMS00102");
  717. return false;
  718. }
  719. var thisCreateQty = minPackQty * cretePageCount;
  720. $("#thisCreateQty").val(thisCreateQty);
  721. var Ratio = YAmount / Quantity * minPackQty;
  722. $("#Amount").val(Ratio);//自动计算出的条码辅计量数量
  723. var CreatedQty_str = $("#CreatedQty").val() * 1;//已生成数量
  724. var CreatedQty = Number(CreatedQty_str);
  725. if (thisCreateQty + CreatedQty > Quantity) {
  726. var maxQty = Quantity - CreatedQty;
  727. $.modalAlert("请输入0到" + maxQty + "范围内的数!");
  728. return false;
  729. }
  730. }
  731. //本+辅
  732. function thisCreateAndAmount() {
  733. var thisCreateQty = $("#thisCreateQty").val() * 1;//本次生成数量
  734. thisCreateQty = thisCreateQty.toFixed(6);
  735. var Amount = $("#Amount").val() * 1;//辅计量数量
  736. Amount = Amount.toFixed(6);
  737. var Quantity = $("#Quantity").val() * 1;//数量
  738. var YAmount = $("#YAmount").val() * 1;//单据辅计量数量
  739. if (Amount <= 0) {
  740. $.modalAlertNew("WMS00102");
  741. return false;
  742. }
  743. var minPackQty = Amount / (YAmount / Quantity);
  744. if (parseInt(Math.ceil(thisCreateQty * 10000)) % parseInt(Math.ceil(minPackQty * 10000)) != 0) {
  745. createPageCount = parseInt(thisCreateQty / minPackQty) + 1;
  746. $("#cretePageCount").val(createPageCount);
  747. }
  748. else {
  749. createPageCount = parseInt(thisCreateQty / minPackQty);
  750. $("#cretePageCount").val(createPageCount);
  751. }
  752. $("#minPackQty").val(minPackQty);
  753. var CreatedQty_str = $("#CreatedQty").val() * 1;//已生成数量
  754. var CreatedQty = Number(CreatedQty_str);
  755. if (thisCreateQty + CreatedQty > Quantity) {
  756. var maxQty = Quantity - CreatedQty;
  757. $.modalAlert("请输入0到" + maxQty + "范围内的数!");
  758. return false;
  759. }
  760. }
  761. //本+张数
  762. function thisCreateAndcretePageCount() {
  763. var thisCreateQty = $("#thisCreateQty").val() * 1;//本次生成数量
  764. thisCreateQty = thisCreateQty.toFixed(6);
  765. var cretePageCount = $("#cretePageCount").val() * 1;//张数
  766. cretePageCount = cretePageCount.toFixed(6);
  767. var Quantity = $("#Quantity").val() * 1;//数量
  768. var YAmount = $("#YAmount").val() * 1;//单据辅计量数量
  769. if (cretePageCount <= 0) {
  770. $.modalAlertNew("WMS00102");
  771. return false;
  772. }
  773. var Quantity = $("#Quantity").val() * 1;//数量
  774. var YAmount = $("#YAmount").val() * 1;//单据辅计量数量
  775. var minPackQty = thisCreateQty / cretePageCount;//最小包装量
  776. minPackQty = minPackQty.toFixed(6);
  777. $("#minPackQty").val(minPackQty);
  778. var Ratio = YAmount / Quantity * minPackQty;
  779. $("#Amount").val(Ratio);//自动计算出的条码辅计量数量
  780. var CreatedQty_str = $("#CreatedQty").val() * 1;//已生成数量
  781. var CreatedQty = Number(CreatedQty_str);
  782. if (thisCreateQty + CreatedQty > Quantity) {
  783. var maxQty = Quantity - CreatedQty;
  784. $.modalAlert("请输入0到" + maxQty + "范围内的数!");
  785. return false;
  786. }
  787. }
  788. //本+最小
  789. function thisCreateAndminPack() {
  790. var thisCreateQty = $("#thisCreateQty").val() * 1;//本次生成数量
  791. thisCreateQty = thisCreateQty.toFixed(6);
  792. var minPackQty = $("#minPackQty").val() * 1;//最小包装量
  793. minPackQty = minPackQty.toFixed(6);
  794. var Quantity = $("#Quantity").val() * 1;//数量
  795. var YAmount = $("#YAmount").val() * 1;//单据辅计量数量
  796. if (parseInt(Math.ceil(thisCreateQty * 10000)) % parseInt(Math.ceil(minPackQty * 10000)) != 0) {
  797. createPageCount = parseInt(thisCreateQty / minPackQty) + 1;
  798. $("#cretePageCount").val(createPageCount);
  799. }
  800. else {
  801. createPageCount = parseInt(thisCreateQty / minPackQty);
  802. $("#cretePageCount").val(createPageCount);
  803. }
  804. var Ratio = YAmount / Quantity * minPackQty;
  805. $("#Amount").val(Ratio);//自动计算出的条码辅计量数量
  806. var CreatedQty_str = $("#CreatedQty").val() * 1;//已生成数量
  807. var CreatedQty = Number(CreatedQty_str);
  808. if (thisCreateQty + CreatedQty > Quantity) {
  809. var maxQty = Quantity - CreatedQty;
  810. $.modalAlert("请输入0到" + maxQty + "范围内的数!");
  811. return false;
  812. }
  813. }
  814. //提交
  815. function submitForm() {
  816. if (!$('#form1').formValid()) {
  817. return false;
  818. }
  819. var AMEnable;
  820. if ($("#BatchCode").val() == "") {
  821. $.modalAlert("请输入批次!", "warning");
  822. return;
  823. }
  824. $.ajax({
  825. url: "/WMS/WMSCreateItemLot/GetAMEnable",
  826. //data: { keyValue: keyValue },
  827. dataType: "json",
  828. async: false,
  829. success: function (data) {
  830. if (data.rows != "" && data.rows=="奥美") {
  831. AMEnable = true ;
  832. } else {
  833. AMEnable = false;
  834. }
  835. }
  836. });
  837. var thisCreateQty = $("#thisCreateQty").val() * 1;//本次生成数量
  838. thisCreateQty = thisCreateQty.toFixed(6);
  839. var minPackQty = $("#minPackQty").val() * 1;//最小包装量
  840. minPackQty = minPackQty.toFixed(6);
  841. var createPageCount = $("#cretePageCount").val() * 1;//本次生成张数
  842. createPageCount = createPageCount.toFixed(0);
  843. // var YAmount = $("#YAmount").val() * 1;//单据辅计量数量
  844. //校验
  845. //var flag1 = thisCreateQty_Change();
  846. if (Number(createPageCount)>100) {
  847. $.modalAlert("生成张数不可超过100!", "warning");
  848. return;
  849. }
  850. var VendorLot = $("#VendorLotNo").val();
  851. //if (flag1) { }
  852. //else {
  853. // return false;
  854. //}
  855. var Quantity = $("#Quantity").val() * 1;//采购订单总数
  856. Quantity = Quantity.toFixed(6);
  857. var CreatedQty = $("#CreatedQty").val() * 1;//已生成数量
  858. CreatedQty = CreatedQty.toFixed(6);
  859. if (Quantity == CreatedQty ) {
  860. return false;
  861. }
  862. var ExpirationDate = '';//条码失效日期
  863. var EffectiveEnable = $("#EffectiveEnable").val();//料品是否启用有效天数
  864. var EffectiveDays = $("#EffectiveDays").val();//料品有效期天数
  865. var PRODUCTDATE = $("#PRODUCTDATE").val();//条码生产日期
  866. if (EffectiveEnable=='true') {
  867. var ExpirationDate= dateChange(EffectiveDays, PRODUCTDATE);
  868. } else {
  869. var ExpirationDate = '2999-12-31 00:00:00.000';
  870. }
  871. var InvCode= $("#InvCode").val();
  872. var ClassCode = $("#ClassCode").val();
  873. var Complete = '';
  874. $.ajax({
  875. url: "/WMS/WMSCreateItemLot/GetInvBatchEnable?InvCode=" + InvCode,
  876. dataType: "json",
  877. async: false,
  878. success: function (data) {
  879. if (data != null && data.length > 0) {
  880. Complete = data[0].BatchEnable;
  881. }
  882. }
  883. });
  884. if (Complete == true) {
  885. if ($("#BatchCode").val()=="") {
  886. $.modalAlert("该料品已开启批次,请输入批次!", "warning");
  887. return;
  888. }
  889. }
  890. var obj = {
  891. thisCreateQty: thisCreateQty,
  892. minPackQty: minPackQty,
  893. createPageCount: createPageCount,
  894. VendorLot: VendorLot,
  895. PRODUCTDATE: PRODUCTDATE,
  896. ExpirationDate:ExpirationDate,
  897. Amount: $("#Amount").val(),
  898. //自由项
  899. ProjectCode: $("#ProjectCode").val(),
  900. BatchCode: $("#BatchCode").val(),
  901. Version: $("#Version").val(),
  902. Brand: $("#Brand").val(),
  903. cFree1: $("#cFree1").val(),
  904. cFree2: $("#cFree2").val(),
  905. cFree3: $("#cFree3").val(),
  906. cFree4: $("#cFree4").val(),
  907. cFree5: $("#cFree5").val(),
  908. cFree6: $("#cFree6").val(),
  909. cFree7: $("#cFree7").val(),
  910. cFree8: $("#cFree8").val(),
  911. cFree9: $("#cFree9").val(),
  912. cFree10: $("#cFree10").val(),
  913. //单据自定义项
  914. EATTRIBUTE1:'',
  915. EATTRIBUTE2: $("#EATTRIBUTE2").val(),
  916. EATTRIBUTE3: $("#EATTRIBUTE3").val(),
  917. EATTRIBUTE4: $("#EATTRIBUTE4").val(),
  918. EATTRIBUTE5: $("#EATTRIBUTE5").val(),
  919. EATTRIBUTE6: $("#EATTRIBUTE6").val(),
  920. EATTRIBUTE7: $("#EATTRIBUTE7").val(),
  921. EATTRIBUTE8: $("#EATTRIBUTE8").val(),
  922. EATTRIBUTE9: $("#EATTRIBUTE9").val(),
  923. EATTRIBUTE10: $("#EATTRIBUTE10").val(),
  924. InvCode: InvCode,
  925. ClassCode: ClassCode
  926. }
  927. if (Type == '1') {
  928. var Flag = GetGetGeneratedNum(ApplyNegCode, Sequence, thisCreateQty);
  929. if (Flag == false) {
  930. $.modalAlert("该单据生成数量异常,请重新确认单据信息!");
  931. return;
  932. }
  933. $.submitForm({
  934. url: "/WMS/WMSCreateItemLot/SubmitForm?ApplyNegCode=" + ApplyNegCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints + "&AMEnable=" + AMEnable,
  935. param: {
  936. keyValue: JSON.stringify(obj)
  937. },
  938. success: function () {
  939. $.currentWindow().$("#gridList").trigger("reloadGrid");
  940. }
  941. })
  942. }
  943. if (Type == '2') {
  944. var Flag = GetGetGeneratedNum(OApplyNegCode, Sequence, thisCreateQty);
  945. if (Flag == false) {
  946. $.modalAlert("该单据生成数量异常,请重新确认单据信息!");
  947. return;
  948. }
  949. $.submitForm({
  950. url: "/WMS/WMSCreateItemLot/SubmitFormWeiWai?OApplyNegCode=" + OApplyNegCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  951. param: {
  952. keyValue: JSON.stringify(obj)
  953. },
  954. success: function () {
  955. $.currentWindow().$("#gridList").trigger("reloadGrid");
  956. }
  957. })
  958. }
  959. if (Type == '3') {
  960. var Flag = GetGetGeneratedNum(MOCode, Sequence, thisCreateQty);
  961. if (Flag == false) {
  962. $.modalAlert("该单据生成数量异常,请重新确认单据信息!");
  963. return;
  964. }
  965. var Complete = '';
  966. $.ajax({
  967. url: "/WMS/WMSCreateItemLot/GetComplete" + "?" + Math.random(),
  968. dataType: "json",
  969. async: false,
  970. success: function (data) {
  971. if (data != null && data.length > 0) {
  972. Complete = data[0].Enable;
  973. }
  974. }
  975. });
  976. if (Complete == true) {
  977. var QiSetNum = '';
  978. var Msg = '';
  979. if ($("#Enable").val() == 'true') {
  980. var Header = {
  981. WorkPoint: WorkPoints,
  982. DetailID: MODetailID,
  983. Type: '生产订单',
  984. }
  985. var keyValue = [];
  986. keyValue.push(Header);
  987. $.ajax({
  988. url: "/WMS/WMSCreateItemLot/GetQiSetNum" + "?" + Math.random(),
  989. data: { keyValue: JSON.stringify(keyValue) },
  990. dataType: "json",
  991. async: false,
  992. success: function (data) {
  993. Msg = data.msg;
  994. QiSetNum = data.Num;
  995. //Msg = '';
  996. //QiSetNum = 200;
  997. }
  998. });
  999. }
  1000. if (Msg != '') {
  1001. $.modalAlert(Msg);
  1002. return;
  1003. }
  1004. if (thisCreateQty > (QiSetNum - CreatedQty)) {
  1005. $.modalAlert("该订单未发料,请发料后生成条码!");
  1006. $("#thisCreateQty").val("");
  1007. return;
  1008. }
  1009. }
  1010. $.submitForm({
  1011. url: "/WMS/WMSCreateItemLot/SubmitFormChengPing?MOCode=" + MOCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  1012. param: {
  1013. keyValue: JSON.stringify(obj)
  1014. },
  1015. success: function () {
  1016. $.currentWindow().$("#gridList").trigger("reloadGrid");
  1017. }
  1018. })
  1019. }
  1020. if (Type == '4') {
  1021. var Flag = GetGetGeneratedNum(SDNCode, Sequence, thisCreateQty);
  1022. if (Flag == false) {
  1023. $.modalAlert("该单据生成数量异常,请重新确认单据信息!");
  1024. return;
  1025. }
  1026. $.submitForm({
  1027. url: "/WMS/WMSCreateItemLot/SubmitFormXiaoShou?SDNCode=" + SDNCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints + "&AMEnable=" + AMEnable,
  1028. param: {
  1029. keyValue: JSON.stringify(obj)
  1030. },
  1031. success: function () {
  1032. $.currentWindow().$("#gridList").trigger("reloadGrid");
  1033. }
  1034. })
  1035. }
  1036. if (Type == '5') {
  1037. var Flag = GetGetGeneratedNum(InCode, Sequence, thisCreateQty);
  1038. if (Flag == false) {
  1039. $.modalAlert("该单据生成数量异常,请重新确认单据信息!");
  1040. return;
  1041. }
  1042. $.submitForm({
  1043. url: "/WMS/WMSCreateItemLot/SubmitFormQiTa?InCode=" + InCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints + "&AMEnable=" + AMEnable,
  1044. param: {
  1045. keyValue: JSON.stringify(obj)
  1046. },
  1047. success: function () {
  1048. $.currentWindow().$("#gridList").trigger("reloadGrid");
  1049. }
  1050. })
  1051. }
  1052. if (Type == '6') {
  1053. var Flag = GetGetGeneratedNum(ReturnCode, Sequence, thisCreateQty);
  1054. if (Flag == false) {
  1055. $.modalAlert("该单据生成数量异常,请重新确认单据信息!");
  1056. return;
  1057. }
  1058. $.submitForm({
  1059. url: "/WMS/WMSCreateItemLot/SubmitFormGuiHuan?ReturnCode=" + ReturnCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  1060. param: {
  1061. keyValue: JSON.stringify(obj)
  1062. },
  1063. success: function () {
  1064. $.currentWindow().$("#gridList").trigger("reloadGrid");
  1065. }
  1066. })
  1067. }
  1068. if (Type == '7') {
  1069. var Flag = GetGetGeneratedNum(DNCode, Sequence, thisCreateQty);
  1070. if (Flag == false) {
  1071. $.modalAlert("该单据生成数量异常,请重新确认单据信息!");
  1072. return;
  1073. }
  1074. $.submitForm({
  1075. url: "/WMS/WMSCreateItemLot/SubmitFormSHDH?DNCode=" + DNCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints+ "&AMEnable=" + AMEnable,
  1076. param: {
  1077. keyValue: JSON.stringify(obj)
  1078. },
  1079. success: function () {
  1080. $.currentWindow().$("#gridList").trigger("reloadGrid");
  1081. }
  1082. })
  1083. }
  1084. if (Type == '8') {
  1085. var Flag = GetGetGeneratedNum(ODNCode, Sequence, thisCreateQty);
  1086. if (Flag == false) {
  1087. $.modalAlert("该单据生成数量异常,请重新确认单据信息!");
  1088. return;
  1089. }
  1090. var WWComplete = '';
  1091. $.ajax({
  1092. url: "/WMS/WMSCreateItemLot/GetWWComplete" + "?" + Math.random(),
  1093. dataType: "json",
  1094. async: false,
  1095. success: function (data) {
  1096. if (data != null && data.length > 0) {
  1097. WWComplete = data[0].Enable;
  1098. }
  1099. }
  1100. });
  1101. if (WWComplete == true) {
  1102. var QiSetNum = '';
  1103. var Msg = '';
  1104. if ($("#Enable").val() == 'true') {
  1105. var Header = {
  1106. WorkPoint: WorkPoints,
  1107. DetailID: OODetailID,
  1108. Type: '委外订单',
  1109. }
  1110. var keyValue = [];
  1111. keyValue.push(Header);
  1112. $.ajax({
  1113. url: "/WMS/WMSCreateItemLot/GetQiSetNum" + "?" + Math.random(),
  1114. data: { keyValue: JSON.stringify(keyValue) },
  1115. dataType: "json",
  1116. async: false,
  1117. success: function (data) {
  1118. Msg = data.msg;
  1119. QiSetNum = data.Num;
  1120. //Msg = '';
  1121. //QiSetNum = 200;
  1122. }
  1123. });
  1124. }
  1125. if (Msg != '') {
  1126. $.modalAlert(Msg);
  1127. return;
  1128. }
  1129. if (thisCreateQty > (QiSetNum - CreatedQty)) {
  1130. $.modalAlert("该订单未发料,请发料后生成条码!");
  1131. $("#thisCreateQty").val("");
  1132. return;
  1133. }
  1134. }
  1135. $.submitForm({
  1136. url: "/WMS/WMSCreateItemLot/SubmitFormWWSHDH?ODNCode=" + ODNCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints + "&AMEnable=" + AMEnable,
  1137. param: {
  1138. keyValue: JSON.stringify(obj)
  1139. },
  1140. success: function () {
  1141. $.currentWindow().$("#gridList").trigger("reloadGrid");
  1142. }
  1143. })
  1144. }
  1145. if (Type == '9') {
  1146. var Flag = GetGetGeneratedNum(RCVCode, Sequence, thisCreateQty);
  1147. if (Flag == false) {
  1148. $.modalAlert("该单据生成数量异常,请重新确认单据信息!");
  1149. return;
  1150. }
  1151. $.submitForm({
  1152. url: "/WMS/WMSCreateItemLot/SubmitFormKLCPRK?RCVCode=" + RCVCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  1153. param: {
  1154. keyValue: JSON.stringify(obj)
  1155. },
  1156. success: function () {
  1157. $.currentWindow().$("#gridList").trigger("reloadGrid");
  1158. }
  1159. })
  1160. }
  1161. if (Type == '10') {
  1162. var Flag = GetGetGeneratedNum(DNCode, Sequence, thisCreateQty);
  1163. if (Flag == false) {
  1164. $.modalAlert("该单据生成数量异常,请重新确认单据信息!");
  1165. return;
  1166. }
  1167. $.submitForm({
  1168. url: "/WMS/WMSCreateItemLot/SubmitFormJSD?DNCode=" + DNCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  1169. param: {
  1170. keyValue: JSON.stringify(obj)
  1171. },
  1172. success: function () {
  1173. $.currentWindow().$("#gridList").trigger("reloadGrid");
  1174. }
  1175. })
  1176. }
  1177. if (Type == '11') {
  1178. var Flag = GetGetGeneratedNum(ODNCode, Sequence, thisCreateQty);
  1179. if (Flag == false) {
  1180. $.modalAlert("该单据生成数量异常,请重新确认单据信息!");
  1181. return;
  1182. }
  1183. $.submitForm({
  1184. url: "/WMS/WMSCreateItemLot/SubmitFormWWJSD?ODNCode=" + ODNCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  1185. param: {
  1186. keyValue: JSON.stringify(obj)
  1187. },
  1188. success: function () {
  1189. $.currentWindow().$("#gridList").trigger("reloadGrid");
  1190. }
  1191. })
  1192. }
  1193. if (Type == '12') {
  1194. var Flag = GetGetGeneratedNum(ApplyNegCode, Sequence, thisCreateQty);
  1195. if (Flag == false) {
  1196. $.modalAlert("该单据生成数量异常,请重新确认单据信息!");
  1197. return;
  1198. }
  1199. $.submitForm({
  1200. url: "/WMS/WMSCreateItemLot/SubmitFormLLSQTL?ApplyNegCode=" + LLApplyNegCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  1201. param: {
  1202. keyValue: JSON.stringify(obj)
  1203. },
  1204. success: function () {
  1205. $.currentWindow().$("#gridList").trigger("reloadGrid");
  1206. }
  1207. })
  1208. }
  1209. if (Type == '13') {
  1210. var Flag = GetGetGeneratedNum(ApplyNegCode, Sequence, thisCreateQty);
  1211. if (Flag == false) {
  1212. $.modalAlert("该单据生成数量异常,请重新确认单据信息!");
  1213. return;
  1214. }
  1215. $.submitForm({
  1216. url: "/WMS/WMSCreateItemLot/SubmitFormCLCKT?ApplyNegCode=" + CLApplyNegCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  1217. param: {
  1218. keyValue: JSON.stringify(obj)
  1219. },
  1220. success: function () {
  1221. $.currentWindow().$("#gridList").trigger("reloadGrid");
  1222. }
  1223. })
  1224. }
  1225. if (Type == '14') {
  1226. var Flag = GetGetGeneratedNum(OApplyNegCode, Sequence, thisCreateQty);
  1227. if (Flag == false) {
  1228. $.modalAlert("该单据生成数量异常,请重新确认单据信息!");
  1229. return;
  1230. }
  1231. $.submitForm({
  1232. url: "/WMS/WMSCreateItemLot/SubmitFormWWLL?OApplyNegCode=" + WWLLOApplyNegCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  1233. param: {
  1234. keyValue: JSON.stringify(obj)
  1235. },
  1236. success: function () {
  1237. $.currentWindow().$("#gridList").trigger("reloadGrid");
  1238. }
  1239. })
  1240. }
  1241. if (Type == '15') {
  1242. var Flag = GetGetGeneratedNum(OApplyNegCode, Sequence, thisCreateQty);
  1243. if (Flag == false) {
  1244. $.modalAlert("该单据生成数量异常,请重新确认单据信息!");
  1245. return;
  1246. }
  1247. $.submitForm({
  1248. url: "/WMS/WMSCreateItemLot/SubmitFormWWCL?OApplyNegCode=" + WWCLOApplyNegCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  1249. param: {
  1250. keyValue: JSON.stringify(obj)
  1251. },
  1252. success: function () {
  1253. $.currentWindow().$("#gridList").trigger("reloadGrid");
  1254. }
  1255. })
  1256. }
  1257. if (Type == '16') {
  1258. var Flag = GetGetGeneratedNum(FGGDMOCode, Sequence, thisCreateQty);
  1259. if (Flag == false) {
  1260. $.modalAlert("该单据生成数量异常,请重新确认单据信息!");
  1261. return;
  1262. }
  1263. $.submitForm({
  1264. url: "/WMS/WMSCreateItemLot/SubmitFormFGGD?FGGDMOCode=" + FGGDMOCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  1265. param: {
  1266. keyValue: JSON.stringify(obj)
  1267. },
  1268. success: function () {
  1269. $.currentWindow().$("#gridList").trigger("reloadGrid");
  1270. }
  1271. })
  1272. }
  1273. if (Type == '18') {
  1274. var Flag = GetGetGeneratedNum(FCPMOCode, Sequence, thisCreateQty);
  1275. if (Flag==false) {
  1276. $.modalAlert("该单据生成数量异常,请重新确认单据信息!");
  1277. return;
  1278. }
  1279. $.submitForm({
  1280. url: "/WMS/WMSCreateItemLot/SubmitFormFCP?FCPMOCode=" + FCPMOCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
  1281. param: {
  1282. keyValue: JSON.stringify(obj)
  1283. },
  1284. success: function () {
  1285. $.currentWindow().$("#gridList").trigger("reloadGrid");
  1286. }
  1287. })
  1288. }
  1289. }
  1290. function dateChange(num ,date ) {
  1291. if (!date) {
  1292. date = new Date();//没有传入值时,默认是当前日期
  1293. date = date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate();
  1294. }
  1295. date += " 00:00:00";//设置为当天凌晨12点
  1296. date = Date.parse(new Date(date))/1000;//转换为时间戳
  1297. date += (86400) * num;//修改后的时间戳
  1298. var newDate = new Date(parseInt(date) * 1000);//转换为时间
  1299. return newDate.getFullYear() + '-' + (newDate.getMonth() + 1) + '-' + newDate.getDate();
  1300. }
  1301. //解决网络延迟问题每次实时验证本次生成数量 有没有超
  1302. function GetGetGeneratedNum(Code, Sequence, thisCreateQty) {
  1303. var Flags;
  1304. $.ajax({
  1305. url: "/WMS/WMSCreateItemLot/GetGeneratedNum?Code=" + Code + "&Sequence=" + Sequence + "&Type=" + Type + "&thisCreateQty=" + thisCreateQty,
  1306. dataType: "json",
  1307. async: false,
  1308. success: function (data) {
  1309. Flags = data.Flag;
  1310. }
  1311. });
  1312. return Flags;
  1313. }
  1314. </script>
  1315. <form id="form1">
  1316. <div style="padding-top: 20px; margin-right: 20px;">
  1317. <table class="form">
  1318. <tr>
  1319. <th class="formTitle">料品编码</th>
  1320. <td class="formValue">
  1321. <input id="InvCode" name="InvCode" type="text" class="form-control " />
  1322. <input id="Enable" name="Enable" type="text" style="display:none" />
  1323. <input id="ClassCode" name="ClassCode" type="text" style="display:none" />
  1324. </td>
  1325. </tr>
  1326. <tr>
  1327. <th class="formTitle">料品名称</th>
  1328. <td class="formValue">
  1329. <input id="INVNAME" name="INVNAME" type="text" class="form-control " />
  1330. </td>
  1331. </tr>
  1332. <tr>
  1333. <th class="formTitle">规格型号</th>
  1334. <td class="formValue">
  1335. <input id="INVSTD" name="INVSTD" type="text" class="form-control " />
  1336. </td>
  1337. </tr>
  1338. <tr style="display:none">
  1339. <th class="formTitle">计量单位</th>
  1340. <td class="formValue">
  1341. <input id="INVUOM" name="INVUOM" type="text" class="form-control " />
  1342. </td>
  1343. </tr>
  1344. <tr style="display:none">
  1345. <th class="formTitle">数量</th>
  1346. <td class="formValue">
  1347. <input id="Quantity" name="Quantity" type="text" class="form-control " />
  1348. <input id="YAmount" name="YAmount" type="text" style="display:none" />
  1349. <input id="DJQuantity" name="DJQuantity" type="text" style="display:none" />
  1350. <input id="InvProportion" name="InvProportion" type="text" style="display:none" />
  1351. </td>
  1352. </tr>
  1353. <tr>
  1354. <th class="formTitle">已生成条码数量</th>
  1355. <td class="formValue">
  1356. <input id="CreatedQty" name="CreatedQty" type="text" class="form-control " />
  1357. </td>
  1358. </tr>
  1359. <tr style="display:none">
  1360. <th class="formTitle"><span style="color: red;">*</span>本次生成数量</th>
  1361. <td class="formValue">
  1362. <input id="thisCreateQty" name="thisCreateQty" type="text" class="form-control required" placeholder="请输入本次生成数量" />
  1363. </td>
  1364. </tr>
  1365. <tr>
  1366. <th class="formTitle"><span style="color: red;">*</span>剩余可生成数量</th>
  1367. <td class="formValue">
  1368. <input id="SurplusCreateQty" name="SurplusCreateQty" type="text" class="form-control required" placeholder="请输入本次生成数量" disabled="disabled"/>
  1369. </td>
  1370. </tr>
  1371. <tr id="ZHU">
  1372. <th class="formTitle"><span style="color: red;">*</span>条码规格(主)</th>
  1373. <td class="formValue">
  1374. <input id="minPackQty" name="minPackQty" type="text" class="form-control required" placeholder="请输入条码规格" />
  1375. </td>
  1376. </tr>
  1377. <tr style="display:none">
  1378. <th class="formTitle"><span style="color: red;">*</span>生产日期</th>
  1379. <td class="formValue">
  1380. <input type="text" name="PRODUCTDATE" id="PRODUCTDATE" class="form-control required" onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd' })" placeholder="生产日期" />
  1381. <input id="EffectiveEnable" name="EffectiveEnable" type="text" style="display:none" />
  1382. <input id="EffectiveDays" name="EffectiveDays" type="text" style="display:none" />
  1383. </td>
  1384. </tr>
  1385. <tr >
  1386. <th class="formTitle"><span style="color: red;">*</span>生成张数</th>
  1387. <td class="formValue">
  1388. <input id="cretePageCount" name="cretePageCount" class="form-control required" type="text" placeholder="请输入生成张数" />
  1389. </td>
  1390. </tr>
  1391. <tr id="FU">
  1392. <th class="formTitle"><span style="color: red;">*</span>条码规格(辅)</th>
  1393. <td class="formValue">
  1394. <input id="Amount" name="Amount" class="form-control" type="text" placeholder="请输入条码规格" />
  1395. </td>
  1396. </tr>
  1397. @*自由项*@
  1398. <tr id="trProjectCode">
  1399. <th class="formTitle"><label id="LableProjectCode"></label></th>
  1400. <td class="formValue">
  1401. <input id="ProjectCode" name="ProjectCode" class="form-control " type="text" />
  1402. </td>
  1403. </tr>
  1404. <tr id="trBatchCode">
  1405. <th class="formTitle"><label id="LableBatchCode"></label></th>
  1406. <td class="formValue">
  1407. <input id="BatchCode" name="BatchCode" class="form-control " type="text" />
  1408. </td>
  1409. </tr>
  1410. <tr id="trVersion">
  1411. <th class="formTitle"><label id="LableVersion"></label></th>
  1412. <td class="formValue">
  1413. <input id="Version" name="Version" class="form-control " type="text" />
  1414. </td>
  1415. </tr>
  1416. <tr id="trBrand">
  1417. <th class="formTitle"><label id="LableBrand"></label></th>
  1418. <td class="formValue">
  1419. <input id="Brand" name="Brand" type="text" class="form-control " />
  1420. </td>
  1421. </tr>
  1422. <tr id="trcFree1">
  1423. <th class="formTitle"><label id="LablecFree1"></label></th>
  1424. <td class="formValue">
  1425. <input id="cFree1" name="cFree1" type="text" class="form-control " />
  1426. </td>
  1427. </tr>
  1428. <tr id="trcFree2">
  1429. <th class="formTitle"><label id="LablecFree2"></label></th>
  1430. <td class="formValue">
  1431. <input id="cFree2" name="cFree2" type="text" class="form-control " />
  1432. </td>
  1433. </tr>
  1434. <tr id="trcFree3">
  1435. <th class="formTitle"><label id="LablecFree3"></label></th>
  1436. <td class="formValue">
  1437. <input id="cFree3" name="cFree3" type="text" class="form-control "/>
  1438. </td>
  1439. </tr>
  1440. <tr id="trcFree4">
  1441. <th class="formTitle"><label id="LablecFree4"></label></th>
  1442. <td class="formValue">
  1443. <input id="cFree4" name="cFree4" type="text" class="form-control " />
  1444. </td>
  1445. </tr>
  1446. <tr id="trcFree5">
  1447. <th class="formTitle"><label id="LablecFree5"></label></th>
  1448. <td class="formValue">
  1449. <input id="cFree5" name="cFree5" type="text" class="form-control " />
  1450. </td>
  1451. </tr>
  1452. <tr id="trcFree6">
  1453. <th class="formTitle"><label id="LablecFree6"></label></th>
  1454. <td class="formValue">
  1455. <input id="cFree6" name="cFree6" type="text" class="form-control " />
  1456. </td>
  1457. </tr>
  1458. <tr id="trcFree7">
  1459. <th class="formTitle"><label id="LablecFree7"></label></th>
  1460. <td class="formValue">
  1461. <input id="cFree7" name="cFree7" type="text" class="form-control " />
  1462. </td>
  1463. </tr>
  1464. <tr id="trcFree8">
  1465. <th class="formTitle"><label id="LablecFree8"></label></th>
  1466. <td class="formValue">
  1467. <input id="cFree8" name="cFree8" type="text" class="form-control " />
  1468. </td>
  1469. </tr>
  1470. <tr id="trcFree9">
  1471. <th class="formTitle"><label id="LablecFree9"></label></th>
  1472. <td class="formValue">
  1473. <input id="cFree9" name="cFree9" type="text" class="form-control " />
  1474. </td>
  1475. </tr>
  1476. <tr id="trcFree10">
  1477. <th class="formTitle"><label id="LablecFree10"></label></th>
  1478. <td class="formValue">
  1479. <input id="cFree10" name="cFree10" type="text" class="form-control " />
  1480. </td>
  1481. </tr>
  1482. @*单据自由项*@
  1483. @*<tr id="trEATTRIBUTE1">
  1484. <th class="formTitle"><label id="LableEATTRIBUTE1"></label></th>
  1485. <td class="formValue">
  1486. <input id="EATTRIBUTE1" name="EATTRIBUTE1" type="text" class="form-control " />
  1487. </td>
  1488. </tr>*@
  1489. <tr id="trEATTRIBUTE2">
  1490. <th class="formTitle"><label id="LableEATTRIBUTE2"></label></th>
  1491. <td class="formValue">
  1492. <input id="EATTRIBUTE2" name="EATTRIBUTE2" type="text" class="form-control " />
  1493. </td>
  1494. </tr>
  1495. <tr id="trEATTRIBUTE3">
  1496. <th class="formTitle"><label id="LableEATTRIBUTE3"></label></th>
  1497. <td class="formValue">
  1498. <input id="EATTRIBUTE3" name="EATTRIBUTE3" type="text" class="form-control " />
  1499. </td>
  1500. </tr>
  1501. <tr id="trEATTRIBUTE4">
  1502. <th class="formTitle"><label id="LableEATTRIBUTE4"></label></th>
  1503. <td class="formValue">
  1504. <input id="EATTRIBUTE4" name="EATTRIBUTE4" type="text" class="form-control " />
  1505. </td>
  1506. </tr>
  1507. <tr id="trEATTRIBUTE5">
  1508. <th class="formTitle"><label id="LableEATTRIBUTE5"></label></th>
  1509. <td class="formValue">
  1510. <input id="EATTRIBUTE5" name="EATTRIBUTE5" type="text" class="form-control " />
  1511. </td>
  1512. </tr>
  1513. <tr id="trEATTRIBUTE6">
  1514. <th class="formTitle"><label id="LableEATTRIBUTE6"></label></th>
  1515. <td class="formValue">
  1516. <input id="EATTRIBUTE6" name="EATTRIBUTE6" type="text" class="form-control " />
  1517. </td>
  1518. </tr>
  1519. <tr id="trEATTRIBUTE7">
  1520. <th class="formTitle"><label id="LableEATTRIBUTE7"></label></th>
  1521. <td class="formValue">
  1522. <input id="EATTRIBUTE7" name="EATTRIBUTE7" type="text" class="form-control " />
  1523. </td>
  1524. </tr>
  1525. <tr id="trEATTRIBUTE8">
  1526. <th class="formTitle"><label id="LableEATTRIBUTE8"></label></th>
  1527. <td class="formValue">
  1528. <input id="EATTRIBUTE8" name="EATTRIBUTE8" type="text" class="form-control " />
  1529. </td>
  1530. </tr>
  1531. <tr id="trEATTRIBUTE9">
  1532. <th class="formTitle"><label id="LableEATTRIBUTE9"></label></th>
  1533. <td class="formValue">
  1534. <input id="EATTRIBUTE9" name="EATTRIBUTE9" type="text" class="form-control " />
  1535. </td>
  1536. </tr>
  1537. <tr id="trEATTRIBUTE10">
  1538. <th class="formTitle"><label id="LableEATTRIBUTE10"></label></th>
  1539. <td class="formValue">
  1540. <input id="EATTRIBUTE10" name="EATTRIBUTE10" type="text" class="form-control " />
  1541. </td>
  1542. </tr>
  1543. </table>
  1544. </div>
  1545. </form>