FormLoca.js 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. /*
  2. * 描 述:单据详细
  3. */
  4. var acceptClick;
  5. var keyValue = request('keyValue');
  6. var currentColRow = null;
  7. var bootstrap = function ($, learun) {
  8. "use strict";
  9. var selectedRow = learun.frameTab.currentIframe().selectedRow;
  10. var page = {
  11. init: function () {
  12. page.bind();
  13. //page.initData();
  14. },
  15. bind: function () {
  16. // 仓库与区域多选
  17. $('#txt_WareaNo').lrselect({
  18. url: top.$.rootUrl + '/BaseManager/BaseWarehouse/GetCheckWWTree',
  19. //type: 'treemultiple',
  20. width: 150,
  21. maxHeight: 180,
  22. allowSearch: true
  23. });
  24. $('#btn_Print').on('click', function () {
  25. var postData = $('#gridtable').jfGridGet("rowdata");
  26. if (postData != "") {
  27. var warehouseName = $("#txt_WareaNo").text();
  28. var head = $('#form1').lrGetFormData(keyValue);
  29. if (postData.length == 0) {
  30. learun.alert.error('未选择行项目!');
  31. return false;
  32. }
  33. var heatstr = JSON.stringify(head);
  34. var frist = JSON.stringify(postData);
  35. var datas = {};
  36. datas["heatStr"] = heatstr;
  37. datas["fristData"] = frist;
  38. $.lrSaveForm(top.$.rootUrl + '/BaseManager/BasePrintLog/PrintBarCode?typeBarcode=货位', datas, function (data) {
  39. var dbdata = JSON.stringify(data.data);
  40. CSharp.LocationSupper(dbdata);
  41. });
  42. }
  43. });
  44. //$('#btn_Print').on('click', function () {
  45. // var postData = $('#gridtable').jfGridGet("rowdata");
  46. // if (postData != "") {
  47. // var warehouseName = $("#txt_WareaNo").text();
  48. // var head = $('#form1').lrGetFormData(keyValue);
  49. // if (postData.length == 0) {
  50. // learun.alert.error('未选择行项目!');
  51. // return false;
  52. // }
  53. // var heatstr = JSON.stringify(head);
  54. // var frist = JSON.stringify(postData);
  55. // var datas = {};
  56. // datas["heatStr"] = heatstr;
  57. // datas["fristData"] = frist;
  58. // $.lrSaveForm(top.$.rootUrl + '/BaseManager/BasePrintLog/PrintBarCode?typeBarcode=货位', datas, function (data) {
  59. // var options = { format: "CODE128", displayValue: false, fontSize: 12, height: 250 };
  60. // var dbdata = eval(data.data);
  61. // var htmls = "";
  62. // var i = 0;
  63. // $.each(dbdata, function (index, dbdata) {
  64. // htmls += "<div style='width: 100%;'>";
  65. // htmls += "<div style='text-align: center;font-size: 28px;'>" + warehouseName + " </div>";
  66. // htmls += "<div id='DivbarCode" + i + "'style='margin:0 auto;width: 244px;'>";
  67. // htmls += "<svg id='BarCode" + i + "'> </svg>";
  68. // htmls += "</div>";
  69. // htmls += "<div id='showText" + i + "' style='text-align: center;font-size: 20px;'></div>";
  70. // htmls += "</div>";
  71. // htmls += "<div style='page-break-after: always;'></div>";
  72. // i = i + 1;
  73. // });
  74. // $("#pringWarea").html(htmls);
  75. // i = 0;
  76. // $.each(dbdata, function (index, dbdata) {
  77. // var barcode = document.getElementById('BarCode' + i);
  78. // var barval = dbdata["F_BARCODE"];
  79. // JsBarcode(barcode, barval, options);
  80. // var widths = $("#BarCode" + i).width();
  81. // $("#DivbarCode" + i).width(widths);
  82. // $("#showText" + i).text(barval);
  83. // i = i + 1;
  84. // });
  85. // doPrint();
  86. // });
  87. // //$.each(postData, function (i, val) {
  88. // // htmls += "<div style='width: 100%;'>";
  89. // // htmls += "<div style='text-align: center;font-size: 28px;'>" + warehouseName + " </div>";
  90. // // htmls += "<div id='DivbarCode" + i + "'style='margin:0 auto;width: 244px;'>";
  91. // // htmls += "<svg id='BarCode" + i + "'> </svg>";
  92. // // htmls += "</div>";
  93. // // htmls += "<div id='showText" + i + "' style='text-align: center;font-size: 20px;'></div>";
  94. // // htmls += "</div>";
  95. // // htmls += "<div style='page-break-after: always;'></div>";
  96. // // });
  97. // //$("#pringWarea").html(htmls);
  98. // //$.each(postData, function (i, val) {
  99. // // var f_no = val["F_NO"];
  100. // // var F_WAREHOUSENO = val["F_WAREHOUSENO"];
  101. // // var barcode = document.getElementById('BarCode' + i);
  102. // // var barval = "*LOC*" + f_no;
  103. // // JsBarcode(barcode, barval, options);
  104. // // var widths = $("#BarCode" + i).width();
  105. // // $("#DivbarCode" + i).width(widths);
  106. // // $("#showText" + i).text(barval);
  107. // //});
  108. // //doPrint();
  109. // }
  110. // //learun.layerForm({
  111. // // id: '0',
  112. // // title: strmsg,
  113. // // url: top.$.rootUrl + '/BaseManager/BasePrintLog/PrintLoca',
  114. // // height: 600,
  115. // // width: 800,
  116. // // btn: ['复盘', '关闭'],
  117. // // callBack: function (id) {
  118. // // return top[id].acceptClick(refreshGirdData);
  119. // // }
  120. // //});
  121. //});
  122. $('#btn_Search').on('click', function () {
  123. var postData = $('#form1').lrGetFormData();
  124. page.search({ queryJson: JSON.stringify(postData) });
  125. });
  126. $('#gridtable').jfGrid({
  127. url: top.$.rootUrl + '/BaseManager/BaseWareCell/GetListByWare',
  128. headData: [
  129. { label: '编号', name: 'F_NO', width: 160, align: "left" },
  130. { label: '名称', name: 'F_NAME', width: 120, align: "left" },
  131. {
  132. label: '仓库名称', name: 'F_WAREHOUSENO', width: 150, align: "left"
  133. , formatterAsync: function (callback, value, row) {
  134. learun.clientdata.getAsync('warehouse', {
  135. key: value,
  136. callback: function (item) {
  137. callback(item.F_NAME);
  138. }
  139. });
  140. }
  141. },
  142. {
  143. label: '区域名称', name: 'F_WAREANO', width: 150, align: "left"
  144. , formatterAsync: function (callback, value, row) {
  145. learun.clientdata.getAsync('warea', {
  146. key: value,
  147. callback: function (item) {
  148. callback(item.F_NAME);
  149. }
  150. });
  151. }
  152. },
  153. {
  154. label: '货位状态', name: 'F_STATENUM', width: 80, align: "center"
  155. , formatterAsync: function (callback, value, row) {
  156. learun.clientdata.getAsync('dataItem', {
  157. Rowkey: value,
  158. GrpCode: 'EWareCellState',
  159. getType: 'Num',
  160. callback: function (item) {
  161. callback(item.F_NAME);
  162. }
  163. });
  164. }
  165. },
  166. { label: '行', name: 'F_LINE', width: 120, align: "left" },
  167. { label: '列', name: 'F_COL', width: 120, align: "left" },
  168. { label: '层', name: 'F_LAYER', width: 120, align: "left" },
  169. ],
  170. isMultiselect: true,
  171. reloadSelected: true,
  172. width: 1200,
  173. height: 600
  174. });
  175. page.search();
  176. },
  177. search: function (param) {
  178. $('#gridtable').jfGridSet('reload', param);
  179. }
  180. };
  181. page.init();
  182. }