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

177 lines
5.7 KiB

3 years ago
  1. 
  2. @{
  3. ViewBag.Title = "Form";
  4. Layout = "~/Views/Shared/_Form.cshtml";
  5. }
  6. <link href="~/Content/css/CommonReport/CommonReport.css" rel="stylesheet" />
  7. <script src="~/Content/js/CommonReport/CommonReport.js"></script>
  8. <link href="~/Content/css/bootstrap/bootstrap-select.css" rel="stylesheet" />
  9. <script src="~/Content/js/bootstrap/bootstrap-select.min.js"></script>
  10. <style>
  11. * {
  12. box-sizing: border-box;
  13. }
  14. </style>
  15. <script>
  16. var ID = $.request("ID");
  17. $(function () {
  18. $("#txtLableCode").attr("disabled", "disabled");
  19. InitControl();
  20. InitContro2();
  21. if (ID != "") {
  22. GetTXT();
  23. }
  24. });
  25. function GetTXT() {
  26. if (!!ID) {
  27. $.ajax({
  28. url: "/WMS/BasicSettings/GetLabelTXT?ID=" + ID + "&" + Math.random(),
  29. dataType: "json",
  30. async: false,
  31. success: function (data) {
  32. debugger;
  33. $("#txtLableCode").val(data.rows[0].LableCode);
  34. $("#txtLableName").val(data.rows[0].LableName);
  35. $("#sel_LableType").val(data.rows[0].LableType).trigger("change");
  36. $("#sel_LableSourceID").val(data.rows[0].LableSourceID).trigger("change");
  37. }
  38. });
  39. }
  40. };
  41. function InitControl() {
  42. var $VenCode = $("#sel_LableType");
  43. $VenCode.select2({
  44. allowClear: true,
  45. escapeMarkup: function (m) {
  46. return m;
  47. }
  48. });
  49. $.ajax({
  50. url: "/WMS/BasicSettings/GetLableType" + "?" + Math.random(),
  51. dataType: "json",
  52. async: false,
  53. success: function (data) {
  54. $.each(data, function (index, item) {
  55. $VenCode.append("<option value='" + item.F_ItemCode + "'>&nbsp;" + item.F_ItemName + "</option>");
  56. });
  57. }
  58. });
  59. }
  60. function InitContro2() {
  61. var $VenCode = $("#sel_LableSourceID");
  62. $VenCode.select2({
  63. allowClear: true,
  64. escapeMarkup: function (m) {
  65. return m;
  66. }
  67. });
  68. $.ajax({
  69. url: "/WMS/BasicSettings/GetLableSourceID" + "?" + Math.random(),
  70. dataType: "json",
  71. async: false,
  72. success: function (data) {
  73. $.each(data, function (index, item) {
  74. $VenCode.append("<option value='" + item.ID + "'>&nbsp;" + item.SourceName + "</option>");
  75. });
  76. }
  77. });
  78. }
  79. function submitForm() {
  80. var strPrintData;
  81. var bIsInstallPrintControl;
  82. var strPrintControlCookie;
  83. var objArr = {
  84. };
  85. $.ajax({
  86. url: "/WMS/WMSCreateItemLot/PrintItemLot?Type=" + Type,
  87. type: "post",
  88. data: { keyValue: JSON.stringify(objArr) },
  89. dataType: "json",
  90. async: false,
  91. success: function (data) {
  92. strPrintData = data.strPrintData_1;
  93. bIsInstallPrintControl = data.bIsInstallPrintControl_1;
  94. strPrintControlCookie = data.strPrintControlCookie_1;
  95. }
  96. });
  97. if (strPrintData != '') {
  98. var test = "ChuLinPrint:" + strPrintData;
  99. $("#ifrm")[0].src = "ChuLinPrint:" + strPrintData;
  100. }
  101. if (bIsInstallPrintControl == 'False') {
  102. if (confirm("检测到打印控件未安装,您是否下载安装?")) {
  103. $("#downPrintControl").click();
  104. }
  105. }
  106. if (bIsInstallPrintControl == 'True') {
  107. var strPrintControlCookie = strPrintControlCookie;
  108. if (strPrintControlCookie != '') { //延时3秒后再次检测打印控件是否安装
  109. setTimeout("checkPrintControlInstall()", 8000);
  110. function checkPrintControlInstall() {
  111. $.ajax({
  112. url: "/WMS/WMSCreateItemLot/IsCheckInstall?checkInstall=" + strPrintControlCookie,
  113. dataType: "json",
  114. async: false,
  115. success: function (strResult) {
  116. if (strResult.indexOf("PrintControlInstall") == -1) {
  117. if (confirm("检测到打印控件未安装,您是否下载安装?")) {
  118. $("#downPrintControl").click();
  119. }
  120. }
  121. }
  122. });
  123. }
  124. }
  125. }
  126. }
  127. </script>
  128. <div class="btn-group" style="display:block;padding-left:2px;">
  129. <a class="btn btn-primary" id="downPrintControl" href="~/PrintActivex.exe" style="display:none">点击下载打印组件</a>
  130. </div>
  131. <form id="form1">
  132. <div class="widget-body">
  133. <div style="padding-top: 5px; ">
  134. <div class="step-content" id="wizard-steps" style="border-left: none; border-bottom: none; border-right: none;">
  135. <div class="step-pane active" id="step-1" style="padding-left: 5px; padding-top: 20px; margin-right: 20px;">
  136. <table class="form">
  137. <tr>
  138. <th class="formTitle">打印模板: </th>
  139. <td class="formValue">
  140. <select id="sel_LableType" name="sel_LableType" class="form-control select2" style="width: 230px" placeholder="请选择标签类型..."></select>
  141. <input type="hidden" id="hidetext" />
  142. </td>
  143. </tr>
  144. </table>
  145. </div>
  146. </div>
  147. </div>
  148. </div>
  149. </form>