UIJ020600.xrw 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <?xml-stylesheet href="../../css/body.css" type="text/css" ?>
  3. <xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2002/01/xforms" xmlns:ev="http://www.w3.org/2001/xml-events">
  4. <xhtml:head>
  5. <xhtml:title>
  6. <![CDATA[热轧作业>>钢卷库管理>>钢卷标识打印(UIJ020600)]]>
  7. </xhtml:title>
  8. <model id="model1">
  9. <instance id="instance1">
  10. <root xmlns="">
  11. <reqData/>
  12. <resData/>
  13. <datagrid1>
  14. </datagrid1>
  15. <datagrid2>
  16. <COILResult_VO/>
  17. </datagrid2>
  18. <searchData>
  19. <DLIV_DIRNO/>
  20. </searchData>
  21. </root>
  22. </instance>
  23. </model>
  24. <script type="javascript" src="../../js/boaMsg.js"/>
  25. <script type="javascript" src="../../js/boaCommon.js"/>
  26. <script type="javascript">
  27. <![CDATA[
  28. function InitParams(node) {
  29. if (typeof node == "undefined" && typeof node != "object") return;
  30. model.removenode("/root/initData/rcvInfo");
  31. model.makeNode("/root/initData/rcvInfo");
  32. var nodeList = node.childNodes;
  33. node = model.instances(0).selectSingleNode("/root/initData/rcvInfo");
  34. for (var i = 0; i < nodeList.length; i++)
  35. node.appendChild(nodeList.item(i));
  36. }
  37. function Init(node)
  38. {
  39. InitParams(node);
  40. }
  41. function find(){
  42. model.removenode("/root/reqData");
  43. model.makeNode("/root/reqData");
  44. model.removenode("/root/datagrid1");
  45. model.makeNode("/root/datagrid1");
  46. //不能为空
  47. if(model.getValue("/root/searchData/DLIV_DIRNO") == ""){
  48. alert(" 发货指示号不能为空!!!! ");
  49. return;
  50. }
  51. if(model.getValue("/root/searchData/DLIV_DIRNO").length < 8){
  52. alert(" 发运指示号长度不正确!!! ");
  53. return;
  54. }
  55. //不选择就查全部
  56. model.duplicate("/root/reqData","/root/searchData/DLIV_DIRNO");
  57. commSubmit("UIJ020600-service", "find", "glueAction.do");
  58. commAppendData("/root/datagrid1/COILResult_VO","/root/resData/COILResult_VO");
  59. model.refresh();
  60. }
  61. function save(){
  62. model.removenode("/root/reqData");
  63. model.makeNode("/root/reqData");
  64. commMultiUpdate(datagrid1,"/root/reqData","A",true,"rowStuts");
  65. //这里加入登录用户名,会不会与已有的initData冲突
  66. model.makeValue("/root/reqData/REG_ID",model.getValue("/root/initData/rcvInfo/REG_ID"));
  67. commSubmit("UIJ020600-service", "save", "glueAction.do");
  68. model.refresh();
  69. if(model.getValue("/root/resData/rs_VO/rs_Row") == "ERRORC"){
  70. alert(" 钢卷没有打印出明细,不能进行标签打印操作 ");
  71. return;
  72. }
  73. if(model.getValue("/root/resData/rs_VO/rs_Row") == "ERRORT"){
  74. alert(" 钢卷没有排车,不能进行标签打印操作 ");
  75. return;
  76. }
  77. if(model.getValue("/root/resData/rs_VO/rs_Row") == "DLIV_TP"){
  78. alert(" 钢卷没有排车,请联系管理员 ");
  79. return;
  80. }
  81. alert(" 钢卷标志保存成功! ");
  82. //再查询一次
  83. find();
  84. }
  85. function saveExcelScript(sDGridName, sExcelSheetName, saveType) {
  86. var sExcelName = window.fileDialog( "save", "", false, "SaveFileName", "xls", "Excel Files(*.xls)|*.xls" );
  87. if ( sExcelName == "" ) {
  88. return;
  89. }
  90. // var sCSVName = "C:\\TFSmartUpdater\\" + sExcelName.lastIndexOf(".") +".csv";
  91. //这里先把数据放入csv文件,再从csv导入xls
  92. var sCSVName = sExcelName +".csv";
  93. // alert("sExcelName = ["+ sExcelName +"]\nsCSVName = ["+ sCSVName + "]");
  94. eval(sDGridName).saveText(sCSVName, "\n", ",", '\:', true); //DataGrid의 내용을 CSV파일로 생성
  95. ObjTFExcel.launchNewInstance(0); //Execute EXCEL
  96. ObjTFExcel.createWorkbook(); //Create new Workbook(for example:Sheet1,Sheet2,Sheet3) -- createWorkBook(Excel-TemplateFile)
  97. ObjTFExcel.loadCSV(sCSVName); //Loading Contents, from CSV to Excel
  98. //Setting up EXCEL Layout.
  99. //这里可以指定特定的行列不
  100. var nRows = sDGridName.rows - sDGridName.fixedRows + 1;
  101. var nCols = sDGridName.cols;
  102. ObjTFExcel.fontcolor ( 01, 01, nRows, nCols ) = "#000000" ;
  103. ObjTFExcel.font ( 01, 01, nRows, nCols ) = "SimSun" ;
  104. //这里不需要加入边框信息
  105. //ObjTFExcel.setBorderColor( 02, 02, nRows, nCols, "#000000") ;
  106. ObjTFExcel.bold ( 01, 01, nRows, nCols ) = true ;
  107. ObjTFExcel.fontsize ( 01, 01, nRows, nCols ) = 12 ;
  108. ObjTFExcel.underline ( 01, 01, nRows, nCols ) = 0 ;
  109. ObjTFExcel.valign ( 01, 01, nRows, nCols ) ="middle" ;
  110. ObjTFExcel.halign ( 01, 02, nRows, nCols ) ="left" ;
  111. //Query-Results Data
  112. var iRow = 1; // iRow = HeaderLine + 1;
  113. for(var i = iRow; i <= nRows; i++ ) {
  114. if( (i%8) == 1 ) {
  115. ObjTFExcel.rowHeight( i ) = 60;
  116. ObjTFExcel.mergeCell( i, 01, i, nCols );
  117. } else {
  118. //这里设置标志主题的行宽
  119. ObjTFExcel.rowHeight( i ) = 40;
  120. }
  121. }
  122. ObjTFExcel.colwidth ( 01 ) = 20 ;
  123. ObjTFExcel.colwidth ( 02 ) = 20 ;
  124. ObjTFExcel.colwidth ( 03 ) = 20 ;
  125. ObjTFExcel.colwidth ( 04 ) = 20 ;
  126. ObjTFExcel.sheetName(1) = sExcelSheetName;
  127. ObjTFExcel.save(sExcelName); //Saving EXCEL
  128. ObjTFExcel.close(); //Closing EXCEL. (You must be closed EXCEL !!!)
  129. window.exec("EXCEL.EXE", sExcelName); //Openning EXCEL
  130. }
  131. ]]>
  132. </script>
  133. </xhtml:head>
  134. <xhtml:body>
  135. <caption id="caption1" class="cell" style="left:0px; top:10px; width:80px; height:20px; ">发货指示号</caption>
  136. <object id="ObjTFExcel" clsid="{fe8d1001-6a9d-424d-ae2a-301493bb12da}" style="left:215px; top:10px; width:155px; height:25px; "/>
  137. <datagrid id="datagrid1" nodeset="/root/datagrid1/COILResult_VO/COILResult_Row" scroll="both" caption="选择^钢卷号^生产流水号^炉号^原牌号^修改后牌号^合同号^重量^订单规格^生产日期^标准^打印页数^检验员^许可证号^许可证标识^备注^" colsep="^" colwidth="35, 90, 90, 80, 80, 100, 90, 80, 80, 90, 80, 100, 100, 100, 83, 200, 100" defaultrows="100" mergecellsfixedrows="bycolrec" rowheight="30" rowsep="|" style="left:0px; top:45px; width:980px; height:555px; ">
  138. <col checkvalue="Y,N" ref="CHK" type="checkbox"/>
  139. <col editable="false" ref="OLD_SAMPL_NO" type="input" style="background-color:#ffffff; "/>
  140. <col editable="false" ref="COIL_NO" type="input" style="background-color:#ffffff; "/>
  141. <col editable="false" ref="CHARE_NO" type="input" style="background-color:#ffffff; "/>
  142. <col editable="false" ref="SPEC_STL_GRD" type="input" style="background-color:#ffffff; "/>
  143. <col ref="CHANGE_SPEC_STL_GRD" type="input" maxlength="20" style="background-color:#ffff99; "/>
  144. <col editable="false" ref="ORD_NO" type="input" style="background-color:#ffffff; "/>
  145. <col editable="false" ref="ACT_WGT" type="input" style="background-color:#ffffff; "/>
  146. <col editable="false" ref="THK_WTH" type="input" style="background-color:#ffffff; "/>
  147. <col editable="false" ref="MILL_DTIME" type="input" style="background-color:#ffffff; "/>
  148. <col editable="false" ref="SPEC_ABBSYM" type="input" style="background-color:#ffffff; "/>
  149. <col ref="COIL_PAGES" type="combo" style="background-color:#ffff99; ">
  150. <choices>
  151. <item>
  152. <label>1</label>
  153. <value>1</value>
  154. </item>
  155. <item>
  156. <label>2</label>
  157. <value>2</value>
  158. </item>
  159. <item>
  160. <label>3</label>
  161. <value>3</value>
  162. </item>
  163. </choices>
  164. </col>
  165. <col ref="CHECKER_ID" type="input" maxlength="10" style="background-color:#ffff99; "/>
  166. <col ref="LICENSE_NO" type="input" maxlength="20" style="background-color:#ffff99; "/>
  167. <col ref="LICENSE_MARK" visibility="hidden"/>
  168. <col ref="COIL_MARK_RESVER" type="input" maxlength="50" style="background-color:#ffff99; "/>
  169. <col ref="DLIV_DIRNO" visibility="hidden"/>
  170. </datagrid>
  171. <button id="button2" visibility="visible" style="left:910px; top:20px; width:65px; height:25px; ">
  172. <caption>导出excel</caption>
  173. <script type="javascript" ev:event="DOMActivate">
  174. <![CDATA[
  175. model.removenode("/root/datagrid2");
  176. model.makeNode("/root/datagrid2");
  177. model.refresh();
  178. var sCol_1 = "";
  179. var sCol_2 = "";
  180. var sCol_3 = "";
  181. var sCol_4 = "";
  182. var nRows2 = datagrid2.rows - datagrid2.fixedRows + 1;
  183. //alert("nRows2 : "+nRows2);
  184. //这里需要为导出方法准备数据,以键值对的形式
  185. for(var i= datagrid1.fixedRows;i<datagrid1.rows;i++){
  186. if(datagrid1.valueMatrix(i,datagrid1.colRef("CHK")) == "Y"){
  187. //在这里按照需要打印的格式,拼成报表.这里nRows2 + 6代表的是总行数
  188. for(var k=nRows2 ;k <= (nRows2 + 6); k++){
  189. //这里使用套打格式的方法处理
  190. if(((k%8) == 1) || ((k%8) == 0) ) {
  191. sCol_1 = "";
  192. sCol_2 = "";
  193. sCol_3 = "";
  194. sCol_4 = "";
  195. }else if( (k%8) == 2 ) {
  196. sCol_1 = " ";
  197. sCol_2 = model.getValue("/root/resData/COILResult_VO/COILResult_Row["+ i +"]/COIL_NO" );
  198. sCol_3 = " ";
  199. sCol_4 = model.getValue("/root/resData/COILResult_VO/COILResult_Row["+ i +"]/OLD_SAMPL_NO" );
  200. } else if( (k%8) == 3 ) {
  201. sCol_1 = " ";
  202. sCol_2 = model.getValue("/root/resData/COILResult_VO/COILResult_Row["+ i +"]/CHARE_NO" );
  203. sCol_3 = " ";
  204. sCol_4 = model.getValue("/root/resData/COILResult_VO/COILResult_Row["+ i +"]/SPEC_STL_GRD" );
  205. } else if( (k%8) == 4 ) {
  206. sCol_1 = " ";
  207. sCol_2 = model.getValue("/root/resData/COILResult_VO/COILResult_Row["+ i +"]/ORD_NO" );
  208. sCol_3 = " ";
  209. sCol_4 = model.getValue("/root/resData/COILResult_VO/COILResult_Row["+ i +"]/ACT_WGT" );
  210. } else if( (k%8) == 5 ) {
  211. sCol_1 = " ";
  212. sCol_2 = model.getValue("/root/resData/COILResult_VO/COILResult_Row["+ i +"]/THK_WTH" );
  213. sCol_3 = " ";
  214. sCol_4 = model.getValue("/root/resData/COILResult_VO/COILResult_Row["+ i +"]/MILL_DTIME" );
  215. }else if( (k%8) == 6 ) {
  216. sCol_1 = " ";
  217. sCol_2 = model.getValue("/root/resData/COILResult_VO/COILResult_Row["+ i +"]/SPEC_ABBSYM" );
  218. sCol_3 = " ";
  219. sCol_4 = model.getValue("/root/resData/COILResult_VO/COILResult_Row["+ i +"]/CHECKER_ID" );
  220. }else if( (k%8) == 7 ) {
  221. sCol_1 = " ";
  222. sCol_2 = model.getValue("/root/resData/COILResult_VO/COILResult_Row["+ i +"]/LICENSE_NO" );
  223. sCol_3 = " ";
  224. sCol_4 = model.getValue("/root/resData/COILResult_VO/COILResult_Row["+ i +"]/LICENSE_MARK" );
  225. }
  226. model.makeValue("/root/datagrid2/COILResult_VO/COILResult_Row["+ k +"]/COL_1" , sCol_1 );
  227. model.makeValue("/root/datagrid2/COILResult_VO/COILResult_Row["+ k +"]/COL_2" , sCol_2 );
  228. model.makeValue("/root/datagrid2/COILResult_VO/COILResult_Row["+ k +"]/COL_3" , sCol_3 );
  229. model.makeValue("/root/datagrid2/COILResult_VO/COILResult_Row["+ k +"]/COL_4" , sCol_4 );
  230. }
  231. }
  232. }
  233. model.refresh();
  234. saveExcelScript(datagrid2, "Sheet1");
  235. ]]>
  236. </script>
  237. <hint>
  238. <![CDATA[导出的EXCEL文件请保存在C盘,
  239. 保存在桌面会提示相应的错误信息。
  240. ]]>
  241. </hint>
  242. </button>
  243. <datagrid id="datagrid2" nodeset="/root/datagrid2/COILResult_VO/COILResult_Row" visibility="hidden" caption="col1^col2^col3^col4" colsep="^" colwidth="100, 100, 100, 100" defaultrows="100" mergecellsfixedrows="bycolrec" rowsep="|" style="left:40px; top:105px; width:425px; height:460px; ">
  244. <col ref="COL_1" type="output"/>
  245. <col ref="COL_2"/>
  246. <col ref="COL_3"/>
  247. <col ref="COL_4"/>
  248. </datagrid>
  249. <input id="input1" ref="/root/searchData/DLIV_DIRNO" maxlength="12" style="left:80px; top:10px; width:115px; height:20px; "/>
  250. <button id="button1" visibility="hidden" style="left:506px; top:15px; width:95px; height:15px; ">
  251. <caption>button1</caption>
  252. <script type="javascript" ev:event="onclick">
  253. <![CDATA[
  254. find();
  255. ]]>
  256. </script>
  257. </button>
  258. <button id="button3" visibility="hidden" style="left:655px; top:10px; width:90px; height:20px; ">
  259. <caption>button3</caption>
  260. <script type="javascript" ev:event="onclick">
  261. <![CDATA[
  262. save();
  263. ]]>
  264. </script>
  265. </button>
  266. </xhtml:body>
  267. </xhtml:html>