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

191 lines
6.7 KiB

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