UIB020120.xrw 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <?xml-stylesheet type="text/css" href="../../css/body.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[品质判定>>材质判定>>材质实绩查询]]>
  7. </xhtml:title>
  8. <model id="model1">
  9. <instance id="instance1">
  10. <root xmlns="">
  11. <formData>
  12. <serachinfo>
  13. <SMP/>
  14. <startTime/>
  15. <endTime/>
  16. <PROGCD/>
  17. <coilNO1/>
  18. <coilNO2/>
  19. <STLGRD/>
  20. </serachinfo>
  21. </formData>
  22. <initChargeNo>
  23. <ChargeNo_VO>
  24. <ChargeNo_Row>
  25. <LABEL>---全部---</LABEL>
  26. <VALUE/>
  27. </ChargeNo_Row>
  28. </ChargeNo_VO>
  29. </initChargeNo>
  30. <datagrid1/>
  31. <datagrid2/>
  32. <initStlgrd>
  33. <StlGrdResult_VO>
  34. <StlGrdResult_Row>
  35. <LABEL/>
  36. <VALUE/>
  37. </StlGrdResult_Row>
  38. </StlGrdResult_VO>
  39. </initStlgrd>
  40. </root>
  41. </instance>
  42. <script type="javascript" ev:event="xforms-ready">
  43. <![CDATA[
  44. if(window.parent==null) Init();
  45. ]]>
  46. </script>
  47. </model>
  48. <script type="javascript" src="../../js/boaCommon.js"/>
  49. <script type="javascript" src="../../js/b01.js"/>
  50. <script type="javascript">
  51. <![CDATA[
  52. function excelExport() {
  53. var x1 = window.fileDialog("save", ",", false, "", "xls", "Excel File(*.xls)|*.xls");
  54. if(x1 == "") return;
  55. datagrid1.saveExcel(x1, "sheetname:Transaction;colhiddenextend:true;exportfalserows:0;");
  56. window.alert("导出成功" + x1 + " !!!");
  57. //return datagrid1;
  58. }
  59. function saveExcelScript2(sDGridName, sExcelSheetName, saveType) {
  60. var sExcelName = window.fileDialog( "save", "", false, "材质实绩明细单", "xls", "Excel Files(*.xls)|*.xls" );
  61. if ( sExcelName == "" ) {
  62. return;
  63. }
  64. //var sCSVName = "C:\\TFSmartUpdater\\" + sExcelName.lastIndexOf(".") +".csv";
  65. var sCSVName = sExcelName + ".csv" ;
  66. //alert("sExcelName = ["+ sExcelName +"]\nsCSVName = ["+ sCSVName + "]");
  67. eval(sDGridName).saveText(sCSVName, "\n", ",", '\:', true); //DataGrid? ??? CSV??? ??
  68. ObjTFExcel.launchNewInstance(0); //Execute EXCEL
  69. ObjTFExcel.createWorkbook(); //Create new Workbook(for example:Sheet1,Sheet2,Sheet3) -- createWorkBook(Excel-TemplateFile)
  70. ObjTFExcel.loadCSV(sCSVName); //Loading Contents, from CSV to Excel
  71. //<object id="ObjTFExcel" clsid="{fe8d1001-6a9d-424d-ae2a-301493bb12da}" style="left:710px; top:40px; width:1px; height:1px; "/>
  72. //Setting up EXCEL Layout.
  73. var nRows = sDGridName.rows ; //Keep Careful !!!
  74. //导出表的列数
  75. var nCols = sDGridName.cols;
  76. //All of the range
  77. ObjTFExcel.fontcolor( 01, 01, nRows, nCols ) = "#000000" ;
  78. ObjTFExcel.font ( 01, 01, nRows, nCols ) = "SimSun" ;
  79. //Header
  80. //Line 1 : Sheet Title
  81. //行高的设置
  82. ObjTFExcel.rowheight( 01 ) = 30 ;
  83. ObjTFExcel.bold ( 01, 01, 01, nCols ) = true ;
  84. //改变字体大小
  85. ObjTFExcel.fontsize ( 01, 01, 01, nCols ) = 14;
  86. ObjTFExcel.underline( 01, 01, 01, nCols ) = 3 ;
  87. ObjTFExcel.halign ( 01, 01, 01, nCols ) ="center" ;
  88. ObjTFExcel.valign ( 01, 01, 01, nCols ) ="top" ;
  89. ObjTFExcel.mergeCell( 01, 01, 01, nCols ) ;
  90. // ObjTFExcel.colwidth ( 01 ) = 200 ;
  91. for(var i = 2; i <= nRows; i++ ) {
  92. ObjTFExcel.rowHeight( i ) = 18;
  93. }
  94. for(var i = 6; i <= nCols; i++ ) {
  95. ObjTFExcel.colwidth ( i) = 6 ;
  96. }
  97. //取消边框
  98. ObjTFExcel.setBorderColor( 01, 01, nRows, nCols, "#000000") ;
  99. //ObjTFExcel.bold ( 01, 01, nRows, nCols ) = false ;
  100. ObjTFExcel.bold ( 01, 01, 01, nCols) = true ;
  101. ObjTFExcel.bold ( 02, 02, 02, 02 ) = true ;
  102. ObjTFExcel.bold ( 02, 04, 02, 04) = true ;
  103. ObjTFExcel.bold ( 03, 02, 03, 02 ) = true ;
  104. ObjTFExcel.bold ( 03, 04, 03, 04 ) = true ;
  105. ObjTFExcel.bold ( 04, 01, 04, nCols) = true ;
  106. //改变字体大小
  107. ObjTFExcel.fontsize ( 02, 01, nRows, nCols ) = 12 ;
  108. ObjTFExcel.underline ( 01, 01, nRows, nCols ) = 0 ;
  109. ObjTFExcel.valign ( 01, 01, nRows, nCols ) ="middle" ;
  110. //字体居中
  111. ObjTFExcel.halign ( 01, 01, 02, nCols ) ="center" ;
  112. ObjTFExcel.halign ( 03, 02, nRows, nCols ) ="left" ;
  113. //字体左对齐的特殊定义
  114. ObjTFExcel.halign ( 01, 01, 02, nCols ) ="left" ;
  115. ObjTFExcel.halign ( 01, 01, 03, nCols ) ="left" ;
  116. //ObjTFExcel.halign ( 01, 01, 04, nCols ) ="left" ;
  117. //ObjTFExcel.halign ( 01, 01, 05, nCols ) ="left" ;
  118. //ObjTFExcel.halign ( 01, 01, 06, nCols ) ="left" ;
  119. ObjTFExcel.halign ( 01, 01, 01, nCols ) ="center" ;
  120. //合并单元格
  121. //ObjTFExcel.mergeCell(02,02,02,03);
  122. //ObjTFExcel.mergeCell(02,05,02,18);
  123. //ObjTFExcel.mergeCell(03,02,03,03);
  124. //ObjTFExcel.mergeCell(03,05,03,18);
  125. //设置列的宽度
  126. ObjTFExcel.colwidth ( 01 ) = 8 ;
  127. ObjTFExcel.colwidth ( 02 ) = 16 ;
  128. ObjTFExcel.colwidth ( 03 ) = 13 ;
  129. ObjTFExcel.colwidth ( 04 ) = 21 ;
  130. //设置表格文本常规格式
  131. //ObjTFExcel.setFormat(03, 04, nRows, 04, "0;@");
  132. ObjTFExcel.halign (03, 04, nRows,04) ="right" ;
  133. ObjTFExcel.setFormat(03, 04, nRows, 04, "yyyy\"-\"mm\"-\"dd\"\" hh\":\"mm\":\"ss\"\";@");
  134. ObjTFExcel.colwidth ( 05 ) = 21 ;
  135. //设置表格文本格式
  136. //ObjTFExcel.setFormat(03, 05, nRows, 05, "000;@");
  137. ObjTFExcel.halign (03, 05, nRows, 05) ="right" ;
  138. ObjTFExcel.setFormat(03, 05, nRows, 05, "yyyy\"-\"mm\"-\"dd\"\" hh\":\"mm\":\"ss\"\";@");
  139. ObjTFExcel.colwidth ( 06 ) = 10 ;
  140. ObjTFExcel.colwidth ( 07 ) = 10 ;
  141. ObjTFExcel.colwidth ( 08 ) = 10 ;
  142. ObjTFExcel.colwidth ( 09 ) = 10 ;
  143. ObjTFExcel.colwidth ( 10 ) = 12 ;
  144. ObjTFExcel.colwidth ( 11 ) = 10 ;
  145. ObjTFExcel.colwidth ( 12 ) = 10 ;
  146. ObjTFExcel.colwidth ( 13 ) = 15 ;
  147. ObjTFExcel.colwidth ( 14 ) = 12 ;
  148. ObjTFExcel.colwidth ( 15 ) = 12 ;
  149. ObjTFExcel.colwidth ( 16 ) = 21 ;
  150. ObjTFExcel.colwidth ( 17 ) = 12 ;
  151. ObjTFExcel.colwidth ( 18 ) = 21 ;
  152. ObjTFExcel.sheetName(1) = sExcelSheetName;
  153. ObjTFExcel.save(sExcelName); //Saving EXCEL
  154. ObjTFExcel.close(); //Closing EXCEL. (You must be closed EXCEL !!!)
  155. //window.exec("EXCEL.EXE", sExcelName); //Openning EXCEL
  156. }
  157. function Init(node)
  158. {
  159. InitParams(node);
  160. input1.value = document.readIniFile("session1" , "UIB020020_COIL1" , "" , "c:\\WINDOWS\\xgmes3.ini"); ;
  161. input4.value = document.readIniFile("session1" , "UIB020020_COIL2" , "" , "c:\\WINDOWS\\xgmes3.ini");
  162. commSubmit("UIB020120-service" , "success" , "glueAction.do");
  163. model.copyNode("/root/initStlgrd/StlGrdResult_VO","/root/resData/StlGrdResult_VO");
  164. model.refresh();
  165. }
  166. function find()
  167. {
  168. ///生成请求参数
  169. if(input2.value.Trim() == "")
  170. {
  171. window.alert("请选择检验开始日期!" , "警告");
  172. return;
  173. }
  174. model.removenode("/root/reqData");
  175. model.makeValue("/root/reqData/PORGCD" , combo2.value);//试样进程代码
  176. model.makeValue("/root/reqData/COILNO1" , input1.value.Trim());//炉次号
  177. if(input1.value.Trim()=="" && input3.value.Trim() =="")
  178. {
  179. window.alert("请输入轧批号或者检验结束日期查询!" , "提示");
  180. return;
  181. }
  182. if(input2.value.Trim()!="" && input3.value.Trim() !="" && input1.value.Trim()=="" )
  183. {
  184. var days = AddDate(input2.value.Trim(),30,"YYYYMMDD");
  185. if(days < input3.value.Trim())
  186. {
  187. window.alert("查询检验日期不可以超过30天,否则可能导致内存溢出!", "提示");
  188. return;
  189. }
  190. }
  191. if(input4.value.Trim() == "")
  192. {
  193. model.makeValue("/root/reqData/COILNO2" , input1.value.Trim());
  194. }
  195. else
  196. {
  197. model.makeValue("/root/reqData/COILNO2" , input4.value.Trim());
  198. }
  199. model.makeValue("/root/reqData/STLGRD" , combo1.value);
  200. document.writeIniFile("session1" , "UIB020020_COIL1" , input1.value.Trim() , "c:\\WINDOWS\\xgmes3.ini");
  201. document.writeIniFile("session1" , "UIB020020_COIL2" , input4.value.Trim() , "c:\\WINDOWS\\xgmes3.ini");
  202. model.makeValue("/root/reqData/startTime" , input2.value.Trim()+"0000");//检验开始时间
  203. model.makeValue("/root/reqData/endTime" , input3.value.Trim()+"9999");//检验结束时间
  204. commSubmit("UIB020120-service" , "find" , "glueAction.do");
  205. ///还原表格到初始状态
  206. for(var i = datagrid1.cols; i > 6 ; i--)
  207. {
  208. datagrid1.deleteColumn(i , false);
  209. }
  210. model.removenode("/root/datagrid1");//清除表格1的节点
  211. // model.removenode("/root/datagrid2");//清除表格2的节点
  212. datagrid1.caption = caption1;
  213. ///动态生成表格1和2
  214. //为了动态生成列后,可以改变列宽,所以表格1需要一个节点映射
  215. datagrid1.addRow(false);
  216. GridDynamicQlty(datagrid1 , "/root/resData/Grid1QltyNM_VO");
  217. ///copy
  218. model.copyNode("/root/datagrid1" , "/root/resData/LotAchievementResult_VO" );
  219. model.refresh();
  220. var decGrd = "";
  221. for(var i = datagrid1.fixedRows; i < datagrid1.rows; i++)
  222. {
  223. decGrd = datagrid1.valueMatrix(i , datagrid1.colRef("MATLQLTY_DEC_GRD"));
  224. if(decGrd == "2")
  225. {
  226. datagrid1.rowStyle(i , "data" , "color") = "#ff0000";
  227. }
  228. if(decGrd == "1")
  229. {
  230. datagrid1.rowStyle(i , "data" , "color") = "#0000ff";
  231. }
  232. }
  233. datagrid1.rebuild();
  234. exceptionReport();
  235. }
  236. var caption1 = datagrid1.caption;
  237. ///表格的动态列生成
  238. //ref 为"/root/resData/Grid2QltyNM_VO"形式
  239. function GridDynamicQlty(grid , ref)
  240. {
  241. ///获得材质名
  242. var node = instance1.selectSingleNode(ref);
  243. if(node == null) return;
  244. var nodeList = node.childNodes;
  245. var nNode;
  246. var i = 1;
  247. var tempCaption1 = "";//第一列的caption
  248. var tempCaption2 = "";//第二列的caption
  249. while(nNode=nodeList.nextNode())
  250. {
  251. grid.addColumn("ref:QLTY_VAL_WK"+i , false);
  252. // grid.addColumn("ref:QLTY_UNIT_WK"+i , false);
  253. ///指定某一列的caption
  254. grid.colWidth(grid.colRef("QLTY_VAL_WK"+i)) = 50;
  255. // grid.colWidth(grid.colRef("QLTY_UNIT_WK"+i)) = 50;
  256. tempCaption1 = tempCaption1 +"^"+nNode.childNodes.item(0).nodeValue;
  257. // tempCaption2 = tempCaption2 +"^"+"实绩值^"+"单位";
  258. i++;
  259. }
  260. ///生成最终的caption
  261. var caption = grid.caption ;
  262. grid.caption = caption.split("|")[0]+tempCaption1+"|"+caption.split("|")[1]+tempCaption1;
  263. }
  264. ]]>
  265. </script>
  266. </xhtml:head>
  267. <xhtml:body pagewidth="980" pageheight="620">
  268. <datagrid id="datagrid1" nodeset="/root/datagrid1/LotAchievementResult_Row" caption="钢卷号^牌号^厚度^检验日期^判定日期^判定结果|钢卷号^牌号^厚度^检验日期^判定日期^判定结果" colsep="^" colwidth="100, 84, 50, 76, 76, 76" explorerbar="sortshow" extendlastcol="false" frozencols="3" mergecellsfixedrows="bycolrec" rowheader="seq" rowsep="|" tooltip="label" style="left:0px; top:35px; width:980px; height:575px; ">
  269. <col editable="false" ref="OLD_SAMPL_NO" type="input" style="background-color:#ffffff; "/>
  270. <col ref="SPEC_STL_GRD"/>
  271. <col editable="false" ref="COIL_THK" type="input" style="background-color:#ffffff; "/>
  272. <col editable="false" ref="SMP_WORK_DTIME" type="input" format="yyyy-mm-dd hh:nn:ss" style="background-color:#ffffff; "/>
  273. <col editable="false" ref="QLTY_DCS_DTIME" type="input" format="yyyy-mm-dd hh:nn:ss" style="background-color:#ffffff; "/>
  274. <col editable="false" ref="MATLQLTY_DEC_GRD" type="input" format="yyyy-mm-dd" style="background-color:#ffffff; "/>
  275. </datagrid>
  276. <caption id="caption2" class="cell" visibility="visible" style="left:380px; top:5px; width:60px; height:20px; ">检验日期</caption>
  277. <input id="input2" ref="/root/formData/serachinfo/startTime" visibility="visible" inputtype="date" style="left:440px; top:5px; width:90px; height:20px; "/>
  278. <input id="input3" ref="/root/formData/serachinfo/endTime" visibility="visible" inputtype="date" style="left:545px; top:5px; width:90px; height:20px; "/>
  279. <line id="line1" style="x1:0px; y1:30px; x2:975px; y2:30px; "/>
  280. <line id="line2" style="x1:0px; y1:0px; x2:975px; y2:0px; "/>
  281. <caption id="caption4" class="cell" style="left:0px; top:5px; width:60px; height:20px; ">试样进程</caption>
  282. <select1 id="combo2" ref="/root/formData/serachinfo/PROGCD" appearance="minimal" style="left:60px; top:5px; width:90px; height:20px; ">
  283. <choices>
  284. <item>
  285. <label>--------------</label>
  286. <value/>
  287. </item>
  288. <item>
  289. <label>试样检验待机</label>
  290. <value>C</value>
  291. </item>
  292. <item>
  293. <label>材质判定待机</label>
  294. <value>D</value>
  295. </item>
  296. <item>
  297. <label>材质判定完成</label>
  298. <value>E</value>
  299. </item>
  300. </choices>
  301. </select1>
  302. <button id="button1" visibility="hidden" style="left:855px; top:55px; width:65px; height:20px; ">
  303. <caption>FIND</caption>
  304. <script type="javascript" ev:event="DOMActivate">
  305. <![CDATA[
  306. find();
  307. ]]>
  308. </script>
  309. </button>
  310. <caption id="caption20" class="cell" style="left:850px; top:5px; width:65px; height:20px; vertical-align:middle; border-color:#000000; ">Export</caption>
  311. <button id="button20" style="left:850px; top:5px; width:65px; height:20px; border-color:#000000; ">
  312. <caption>Export</caption>
  313. <script type="javascript" ev:event="DOMActivate">
  314. <![CDATA[
  315. //saveExcelScript2(datagrid1,"材质实绩明细");
  316. excelExport();
  317. ]]>
  318. </script>
  319. </button>
  320. <caption id="caption1" class="cell" style="left:155px; top:5px; width:60px; height:20px; ">轧批号:</caption>
  321. <input id="input1" ref="/root/formData/serachinfo/coilNO1" style="left:215px; top:5px; width:75px; height:20px; "/>
  322. <line id="line3" style="x1:290px; y1:15px; x2:300px; y2:15px; "/>
  323. <input id="input4" ref="/root/formData/serachinfo/coilNO2" style="left:300px; top:5px; width:75px; height:20px; "/>
  324. <line id="line4" style="x1:530px; y1:15px; x2:545px; y2:15px; "/>
  325. <caption id="caption3" class="cell" style="left:640px; top:5px; width:60px; height:20px; ">钢种</caption>
  326. <select1 id="combo1" ref="/root/formData/serachinfo/STLGRD" appearance="minimal" style="left:700px; top:5px; width:120px; height:20px; ">
  327. <choices>
  328. <itemset nodeset="/root/initStlgrd/StlGrdResult_VO/StlGrdResult_Row">
  329. <label ref="LABEL"/>
  330. <value ref="VALUE"/>
  331. </itemset>
  332. </choices>
  333. </select1>
  334. </xhtml:body>
  335. </xhtml:html>