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.

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