| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366 |
- <?xml version="1.0" encoding="UTF-8"?>
- <?xml-stylesheet type="text/css" href="../../css/body.css" ?>
- <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">
- <xhtml:head>
- <xhtml:title>
- <![CDATA[品质判定>>材质判定>>材质实绩查询]]>
- </xhtml:title>
- <model id="model1">
- <instance id="instance1">
- <root xmlns="">
- <formData>
- <serachinfo>
- <SMP/>
- <startTime/>
- <endTime/>
- <PROGCD/>
- <coilNO1/>
- <coilNO2/>
- <STLGRD/>
- </serachinfo>
- </formData>
- <initChargeNo>
- <ChargeNo_VO>
- <ChargeNo_Row>
- <LABEL>---全部---</LABEL>
- <VALUE/>
- </ChargeNo_Row>
- </ChargeNo_VO>
- </initChargeNo>
- <datagrid1/>
- <datagrid2/>
- <initStlgrd>
- <StlGrdResult_VO>
- <StlGrdResult_Row>
- <LABEL/>
- <VALUE/>
- </StlGrdResult_Row>
- </StlGrdResult_VO>
- </initStlgrd>
- </root>
- </instance>
- <script type="javascript" ev:event="xforms-ready">
- <![CDATA[
- if(window.parent==null) Init();
- ]]>
- </script>
- </model>
- <script type="javascript" src="../../js/boaCommon.js"/>
- <script type="javascript" src="../../js/b01.js"/>
- <script type="javascript">
- <![CDATA[
- function excelExport() {
- var x1 = window.fileDialog("save", ",", false, "", "xls", "Excel File(*.xls)|*.xls");
- if(x1 == "") return;
- datagrid1.saveExcel(x1, "sheetname:Transaction;colhiddenextend:true;exportfalserows:0;");
- window.alert("导出成功" + x1 + " !!!");
- //return datagrid1;
- }
-
- function saveExcelScript2(sDGridName, sExcelSheetName, saveType) {
- var sExcelName = window.fileDialog( "save", "", false, "材质实绩明细单", "xls", "Excel Files(*.xls)|*.xls" );
- if ( sExcelName == "" ) {
- return;
- }
- //var sCSVName = "C:\\TFSmartUpdater\\" + sExcelName.lastIndexOf(".") +".csv";
- var sCSVName = sExcelName + ".csv" ;
- //alert("sExcelName = ["+ sExcelName +"]\nsCSVName = ["+ sCSVName + "]");
- eval(sDGridName).saveText(sCSVName, "\n", ",", '\:', true); //DataGrid? ??? CSV??? ??
- ObjTFExcel.launchNewInstance(0); //Execute EXCEL
- ObjTFExcel.createWorkbook(); //Create new Workbook(for example:Sheet1,Sheet2,Sheet3) -- createWorkBook(Excel-TemplateFile)
- ObjTFExcel.loadCSV(sCSVName); //Loading Contents, from CSV to Excel
- //<object id="ObjTFExcel" clsid="{fe8d1001-6a9d-424d-ae2a-301493bb12da}" style="left:710px; top:40px; width:1px; height:1px; "/>
- //Setting up EXCEL Layout.
- var nRows = sDGridName.rows ; //Keep Careful !!!
- //导出表的列数
- var nCols = sDGridName.cols;
-
- //All of the range
- ObjTFExcel.fontcolor( 01, 01, nRows, nCols ) = "#000000" ;
- ObjTFExcel.font ( 01, 01, nRows, nCols ) = "SimSun" ;
- //Header
- //Line 1 : Sheet Title
- //行高的设置
- ObjTFExcel.rowheight( 01 ) = 30 ;
- ObjTFExcel.bold ( 01, 01, 01, nCols ) = true ;
- //改变字体大小
- ObjTFExcel.fontsize ( 01, 01, 01, nCols ) = 14;
- ObjTFExcel.underline( 01, 01, 01, nCols ) = 3 ;
- ObjTFExcel.halign ( 01, 01, 01, nCols ) ="center" ;
- ObjTFExcel.valign ( 01, 01, 01, nCols ) ="top" ;
- ObjTFExcel.mergeCell( 01, 01, 01, nCols ) ;
- // ObjTFExcel.colwidth ( 01 ) = 200 ;
- for(var i = 2; i <= nRows; i++ ) {
- ObjTFExcel.rowHeight( i ) = 18;
- }
- for(var i = 6; i <= nCols; i++ ) {
- ObjTFExcel.colwidth ( i) = 6 ;
- }
-
- //取消边框
- ObjTFExcel.setBorderColor( 01, 01, nRows, nCols, "#000000") ;
- //ObjTFExcel.bold ( 01, 01, nRows, nCols ) = false ;
- ObjTFExcel.bold ( 01, 01, 01, nCols) = true ;
- ObjTFExcel.bold ( 02, 02, 02, 02 ) = true ;
- ObjTFExcel.bold ( 02, 04, 02, 04) = true ;
- ObjTFExcel.bold ( 03, 02, 03, 02 ) = true ;
- ObjTFExcel.bold ( 03, 04, 03, 04 ) = true ;
- ObjTFExcel.bold ( 04, 01, 04, nCols) = true ;
- //改变字体大小
- ObjTFExcel.fontsize ( 02, 01, nRows, nCols ) = 12 ;
- ObjTFExcel.underline ( 01, 01, nRows, nCols ) = 0 ;
- ObjTFExcel.valign ( 01, 01, nRows, nCols ) ="middle" ;
- //字体居中
- ObjTFExcel.halign ( 01, 01, 02, nCols ) ="center" ;
- ObjTFExcel.halign ( 03, 02, nRows, nCols ) ="left" ;
-
-
- //字体左对齐的特殊定义
- ObjTFExcel.halign ( 01, 01, 02, nCols ) ="left" ;
- ObjTFExcel.halign ( 01, 01, 03, nCols ) ="left" ;
- //ObjTFExcel.halign ( 01, 01, 04, nCols ) ="left" ;
- //ObjTFExcel.halign ( 01, 01, 05, nCols ) ="left" ;
- //ObjTFExcel.halign ( 01, 01, 06, nCols ) ="left" ;
- ObjTFExcel.halign ( 01, 01, 01, nCols ) ="center" ;
-
- //合并单元格
- //ObjTFExcel.mergeCell(02,02,02,03);
- //ObjTFExcel.mergeCell(02,05,02,18);
- //ObjTFExcel.mergeCell(03,02,03,03);
- //ObjTFExcel.mergeCell(03,05,03,18);
-
- //设置列的宽度
- ObjTFExcel.colwidth ( 01 ) = 8 ;
- ObjTFExcel.colwidth ( 02 ) = 16 ;
- ObjTFExcel.colwidth ( 03 ) = 13 ;
- ObjTFExcel.colwidth ( 04 ) = 21 ;
- //设置表格文本常规格式
- //ObjTFExcel.setFormat(03, 04, nRows, 04, "0;@");
- ObjTFExcel.halign (03, 04, nRows,04) ="right" ;
- ObjTFExcel.setFormat(03, 04, nRows, 04, "yyyy\"-\"mm\"-\"dd\"\" hh\":\"mm\":\"ss\"\";@");
- ObjTFExcel.colwidth ( 05 ) = 21 ;
- //设置表格文本格式
- //ObjTFExcel.setFormat(03, 05, nRows, 05, "000;@");
- ObjTFExcel.halign (03, 05, nRows, 05) ="right" ;
- ObjTFExcel.setFormat(03, 05, nRows, 05, "yyyy\"-\"mm\"-\"dd\"\" hh\":\"mm\":\"ss\"\";@");
- ObjTFExcel.colwidth ( 06 ) = 10 ;
- ObjTFExcel.colwidth ( 07 ) = 10 ;
- ObjTFExcel.colwidth ( 08 ) = 10 ;
- ObjTFExcel.colwidth ( 09 ) = 10 ;
- ObjTFExcel.colwidth ( 10 ) = 12 ;
- ObjTFExcel.colwidth ( 11 ) = 10 ;
- ObjTFExcel.colwidth ( 12 ) = 10 ;
- ObjTFExcel.colwidth ( 13 ) = 15 ;
- ObjTFExcel.colwidth ( 14 ) = 12 ;
-
- ObjTFExcel.colwidth ( 15 ) = 12 ;
- ObjTFExcel.colwidth ( 16 ) = 21 ;
-
- ObjTFExcel.colwidth ( 17 ) = 12 ;
- ObjTFExcel.colwidth ( 18 ) = 21 ;
-
-
-
- ObjTFExcel.sheetName(1) = sExcelSheetName;
- ObjTFExcel.save(sExcelName); //Saving EXCEL
- ObjTFExcel.close(); //Closing EXCEL. (You must be closed EXCEL !!!)
- //window.exec("EXCEL.EXE", sExcelName); //Openning EXCEL
- }
-
- function Init(node)
- {
- InitParams(node);
- input1.value = document.readIniFile("session1" , "UIB020020_COIL1" , "" , "c:\\WINDOWS\\xgmes3.ini"); ;
- input4.value = document.readIniFile("session1" , "UIB020020_COIL2" , "" , "c:\\WINDOWS\\xgmes3.ini");
- commSubmit("UIB020120-service" , "success" , "glueAction.do");
- model.copyNode("/root/initStlgrd/StlGrdResult_VO","/root/resData/StlGrdResult_VO");
- model.refresh();
- }
- function find()
- {
- ///生成请求参数
- if(input2.value.Trim() == "")
- {
- window.alert("请选择检验开始日期!" , "警告");
- return;
- }
- model.removenode("/root/reqData");
- model.makeValue("/root/reqData/PORGCD" , combo2.value);//试样进程代码
- model.makeValue("/root/reqData/COILNO1" , input1.value.Trim());//炉次号
- if(input1.value.Trim()=="" && input3.value.Trim() =="")
- {
- window.alert("请输入轧批号或者检验结束日期查询!" , "提示");
- return;
- }
- if(input2.value.Trim()!="" && input3.value.Trim() !="" && input1.value.Trim()=="" )
- {
- var days = AddDate(input2.value.Trim(),30,"YYYYMMDD");
- if(days < input3.value.Trim())
- {
- window.alert("查询检验日期不可以超过30天,否则可能导致内存溢出!", "提示");
- return;
- }
- }
-
- if(input4.value.Trim() == "")
- {
- model.makeValue("/root/reqData/COILNO2" , input1.value.Trim());
- }
- else
- {
- model.makeValue("/root/reqData/COILNO2" , input4.value.Trim());
- }
- model.makeValue("/root/reqData/STLGRD" , combo1.value);
- document.writeIniFile("session1" , "UIB020020_COIL1" , input1.value.Trim() , "c:\\WINDOWS\\xgmes3.ini");
- document.writeIniFile("session1" , "UIB020020_COIL2" , input4.value.Trim() , "c:\\WINDOWS\\xgmes3.ini");
- model.makeValue("/root/reqData/startTime" , input2.value.Trim()+"0000");//检验开始时间
- model.makeValue("/root/reqData/endTime" , input3.value.Trim()+"9999");//检验结束时间
- commSubmit("UIB020120-service" , "find" , "glueAction.do");
-
- ///还原表格到初始状态
- for(var i = datagrid1.cols; i > 6 ; i--)
- {
- datagrid1.deleteColumn(i , false);
- }
- model.removenode("/root/datagrid1");//清除表格1的节点
- // model.removenode("/root/datagrid2");//清除表格2的节点
- datagrid1.caption = caption1;
-
- ///动态生成表格1和2
- //为了动态生成列后,可以改变列宽,所以表格1需要一个节点映射
- datagrid1.addRow(false);
- GridDynamicQlty(datagrid1 , "/root/resData/Grid1QltyNM_VO");
-
- ///copy
- model.copyNode("/root/datagrid1" , "/root/resData/LotAchievementResult_VO" );
- model.refresh();
-
- var decGrd = "";
- for(var i = datagrid1.fixedRows; i < datagrid1.rows; i++)
- {
- decGrd = datagrid1.valueMatrix(i , datagrid1.colRef("MATLQLTY_DEC_GRD"));
- if(decGrd == "2")
- {
- datagrid1.rowStyle(i , "data" , "color") = "#ff0000";
- }
- if(decGrd == "1")
- {
- datagrid1.rowStyle(i , "data" , "color") = "#0000ff";
- }
- }
- datagrid1.rebuild();
- exceptionReport();
- }
-
- var caption1 = datagrid1.caption;
-
- ///表格的动态列生成
- //ref 为"/root/resData/Grid2QltyNM_VO"形式
- function GridDynamicQlty(grid , ref)
- {
- ///获得材质名
- var node = instance1.selectSingleNode(ref);
- if(node == null) return;
- var nodeList = node.childNodes;
- var nNode;
- var i = 1;
- var tempCaption1 = "";//第一列的caption
- var tempCaption2 = "";//第二列的caption
- while(nNode=nodeList.nextNode())
- {
- grid.addColumn("ref:QLTY_VAL_WK"+i , false);
- // grid.addColumn("ref:QLTY_UNIT_WK"+i , false);
-
- ///指定某一列的caption
- grid.colWidth(grid.colRef("QLTY_VAL_WK"+i)) = 50;
- // grid.colWidth(grid.colRef("QLTY_UNIT_WK"+i)) = 50;
- tempCaption1 = tempCaption1 +"^"+nNode.childNodes.item(0).nodeValue;
- // tempCaption2 = tempCaption2 +"^"+"实绩值^"+"单位";
- i++;
- }
- ///生成最终的caption
- var caption = grid.caption ;
- grid.caption = caption.split("|")[0]+tempCaption1+"|"+caption.split("|")[1]+tempCaption1;
- }
- ]]>
- </script>
- </xhtml:head>
- <xhtml:body pagewidth="980" pageheight="620">
- <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; ">
- <col editable="false" ref="OLD_SAMPL_NO" type="input" style="background-color:#ffffff; "/>
- <col ref="SPEC_STL_GRD"/>
- <col editable="false" ref="COIL_THK" type="input" style="background-color:#ffffff; "/>
- <col editable="false" ref="SMP_WORK_DTIME" type="input" format="yyyy-mm-dd hh:nn:ss" style="background-color:#ffffff; "/>
- <col editable="false" ref="QLTY_DCS_DTIME" type="input" format="yyyy-mm-dd hh:nn:ss" style="background-color:#ffffff; "/>
- <col editable="false" ref="MATLQLTY_DEC_GRD" type="input" format="yyyy-mm-dd" style="background-color:#ffffff; "/>
- </datagrid>
- <caption id="caption2" class="cell" visibility="visible" style="left:380px; top:5px; width:60px; height:20px; ">检验日期</caption>
- <input id="input2" ref="/root/formData/serachinfo/startTime" visibility="visible" inputtype="date" style="left:440px; top:5px; width:90px; height:20px; "/>
- <input id="input3" ref="/root/formData/serachinfo/endTime" visibility="visible" inputtype="date" style="left:545px; top:5px; width:90px; height:20px; "/>
- <line id="line1" style="x1:0px; y1:30px; x2:975px; y2:30px; "/>
- <line id="line2" style="x1:0px; y1:0px; x2:975px; y2:0px; "/>
- <caption id="caption4" class="cell" style="left:0px; top:5px; width:60px; height:20px; ">试样进程</caption>
- <select1 id="combo2" ref="/root/formData/serachinfo/PROGCD" appearance="minimal" style="left:60px; top:5px; width:90px; height:20px; ">
- <choices>
- <item>
- <label>--------------</label>
- <value/>
- </item>
- <item>
- <label>试样检验待机</label>
- <value>C</value>
- </item>
- <item>
- <label>材质判定待机</label>
- <value>D</value>
- </item>
- <item>
- <label>材质判定完成</label>
- <value>E</value>
- </item>
- </choices>
- </select1>
- <button id="button1" visibility="hidden" style="left:855px; top:55px; width:65px; height:20px; ">
- <caption>FIND</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- find();
- ]]>
- </script>
- </button>
- <caption id="caption20" class="cell" style="left:850px; top:5px; width:65px; height:20px; vertical-align:middle; border-color:#000000; ">Export</caption>
- <button id="button20" style="left:850px; top:5px; width:65px; height:20px; border-color:#000000; ">
- <caption>Export</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- //saveExcelScript2(datagrid1,"材质实绩明细");
- excelExport();
- ]]>
- </script>
- </button>
- <caption id="caption1" class="cell" style="left:155px; top:5px; width:60px; height:20px; ">轧批号:</caption>
- <input id="input1" ref="/root/formData/serachinfo/coilNO1" style="left:215px; top:5px; width:75px; height:20px; "/>
- <line id="line3" style="x1:290px; y1:15px; x2:300px; y2:15px; "/>
- <input id="input4" ref="/root/formData/serachinfo/coilNO2" style="left:300px; top:5px; width:75px; height:20px; "/>
- <line id="line4" style="x1:530px; y1:15px; x2:545px; y2:15px; "/>
- <caption id="caption3" class="cell" style="left:640px; top:5px; width:60px; height:20px; ">钢种</caption>
- <select1 id="combo1" ref="/root/formData/serachinfo/STLGRD" appearance="minimal" style="left:700px; top:5px; width:120px; height:20px; ">
- <choices>
- <itemset nodeset="/root/initStlgrd/StlGrdResult_VO/StlGrdResult_Row">
- <label ref="LABEL"/>
- <value ref="VALUE"/>
- </itemset>
- </choices>
- </select1>
- </xhtml:body>
- </xhtml:html>
|