| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313 |
- <?xml version="1.0" encoding="UTF-8"?>
- <?xml-stylesheet href="../../css/body.css" type="text/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[热轧作业>>钢卷库管理>>钢卷标识打印(UIJ020600)]]>
- </xhtml:title>
- <model id="model1">
- <instance id="instance1">
- <root xmlns="">
- <reqData/>
- <resData/>
- <datagrid1>
- </datagrid1>
- <datagrid2>
- <COILResult_VO/>
- </datagrid2>
- <searchData>
- <DLIV_DIRNO/>
- </searchData>
- </root>
- </instance>
- </model>
- <script type="javascript" src="../../js/boaMsg.js"/>
- <script type="javascript" src="../../js/boaCommon.js"/>
- <script type="javascript">
- <![CDATA[
- function InitParams(node) {
- if (typeof node == "undefined" && typeof node != "object") return;
- model.removenode("/root/initData/rcvInfo");
- model.makeNode("/root/initData/rcvInfo");
- var nodeList = node.childNodes;
- node = model.instances(0).selectSingleNode("/root/initData/rcvInfo");
- for (var i = 0; i < nodeList.length; i++)
- node.appendChild(nodeList.item(i));
- }
-
- function Init(node)
- {
- InitParams(node);
- }
-
- function find(){
- model.removenode("/root/reqData");
- model.makeNode("/root/reqData");
-
- model.removenode("/root/datagrid1");
- model.makeNode("/root/datagrid1");
-
- //不能为空
- if(model.getValue("/root/searchData/DLIV_DIRNO") == ""){
- alert(" 发货指示号不能为空!!!! ");
- return;
- }
- if(model.getValue("/root/searchData/DLIV_DIRNO").length < 8){
- alert(" 发运指示号长度不正确!!! ");
- return;
- }
-
- //不选择就查全部
- model.duplicate("/root/reqData","/root/searchData/DLIV_DIRNO");
-
- commSubmit("UIJ020600-service", "find", "glueAction.do");
-
- commAppendData("/root/datagrid1/COILResult_VO","/root/resData/COILResult_VO");
-
- model.refresh();
-
- }
-
- function save(){
- model.removenode("/root/reqData");
- model.makeNode("/root/reqData");
-
- commMultiUpdate(datagrid1,"/root/reqData","A",true,"rowStuts");
- //这里加入登录用户名,会不会与已有的initData冲突
- model.makeValue("/root/reqData/REG_ID",model.getValue("/root/initData/rcvInfo/REG_ID"));
-
- commSubmit("UIJ020600-service", "save", "glueAction.do");
-
- model.refresh();
-
- if(model.getValue("/root/resData/rs_VO/rs_Row") == "ERRORC"){
- alert(" 钢卷没有打印出明细,不能进行标签打印操作 ");
- return;
- }
-
- if(model.getValue("/root/resData/rs_VO/rs_Row") == "ERRORT"){
- alert(" 钢卷没有排车,不能进行标签打印操作 ");
- return;
- }
-
- if(model.getValue("/root/resData/rs_VO/rs_Row") == "DLIV_TP"){
- alert(" 钢卷没有排车,请联系管理员 ");
- return;
- }
-
- alert(" 钢卷标志保存成功! ");
-
- //再查询一次
- find();
- }
-
- function saveExcelScript(sDGridName, sExcelSheetName, saveType) {
-
-
- var sExcelName = window.fileDialog( "save", "", false, "SaveFileName", "xls", "Excel Files(*.xls)|*.xls" );
- if ( sExcelName == "" ) {
- return;
- }
- // var sCSVName = "C:\\TFSmartUpdater\\" + sExcelName.lastIndexOf(".") +".csv";
- //这里先把数据放入csv文件,再从csv导入xls
- 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
- //Setting up EXCEL Layout.
- //这里可以指定特定的行列不
- var nRows = sDGridName.rows - sDGridName.fixedRows + 1;
-
- var nCols = sDGridName.cols;
-
- ObjTFExcel.fontcolor ( 01, 01, nRows, nCols ) = "#000000" ;
- ObjTFExcel.font ( 01, 01, nRows, nCols ) = "SimSun" ;
- //这里不需要加入边框信息
- //ObjTFExcel.setBorderColor( 02, 02, nRows, nCols, "#000000") ;
- ObjTFExcel.bold ( 01, 01, nRows, nCols ) = true ;
- ObjTFExcel.fontsize ( 01, 01, nRows, nCols ) = 12 ;
- ObjTFExcel.underline ( 01, 01, nRows, nCols ) = 0 ;
- ObjTFExcel.valign ( 01, 01, nRows, nCols ) ="middle" ;
- ObjTFExcel.halign ( 01, 02, nRows, nCols ) ="left" ;
- //Query-Results Data
- var iRow = 1; // iRow = HeaderLine + 1;
- for(var i = iRow; i <= nRows; i++ ) {
- if( (i%8) == 1 ) {
- ObjTFExcel.rowHeight( i ) = 60;
- ObjTFExcel.mergeCell( i, 01, i, nCols );
- } else {
- //这里设置标志主题的行宽
- ObjTFExcel.rowHeight( i ) = 40;
- }
- }
- ObjTFExcel.colwidth ( 01 ) = 20 ;
- ObjTFExcel.colwidth ( 02 ) = 20 ;
- ObjTFExcel.colwidth ( 03 ) = 20 ;
- ObjTFExcel.colwidth ( 04 ) = 20 ;
-
- 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
- }
-
- ]]>
- </script>
- </xhtml:head>
- <xhtml:body>
- <caption id="caption1" class="cell" style="left:0px; top:10px; width:80px; height:20px; ">发货指示号</caption>
- <object id="ObjTFExcel" clsid="{fe8d1001-6a9d-424d-ae2a-301493bb12da}" style="left:215px; top:10px; width:155px; height:25px; "/>
- <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; ">
- <col checkvalue="Y,N" ref="CHK" type="checkbox"/>
- <col editable="false" ref="OLD_SAMPL_NO" type="input" style="background-color:#ffffff; "/>
- <col editable="false" ref="COIL_NO" type="input" style="background-color:#ffffff; "/>
- <col editable="false" ref="CHARE_NO" type="input" style="background-color:#ffffff; "/>
- <col editable="false" ref="SPEC_STL_GRD" type="input" style="background-color:#ffffff; "/>
- <col ref="CHANGE_SPEC_STL_GRD" type="input" maxlength="20" style="background-color:#ffff99; "/>
- <col editable="false" ref="ORD_NO" type="input" style="background-color:#ffffff; "/>
- <col editable="false" ref="ACT_WGT" type="input" style="background-color:#ffffff; "/>
- <col editable="false" ref="THK_WTH" type="input" style="background-color:#ffffff; "/>
- <col editable="false" ref="MILL_DTIME" type="input" style="background-color:#ffffff; "/>
- <col editable="false" ref="SPEC_ABBSYM" type="input" style="background-color:#ffffff; "/>
- <col ref="COIL_PAGES" type="combo" style="background-color:#ffff99; ">
- <choices>
- <item>
- <label>1</label>
- <value>1</value>
- </item>
- <item>
- <label>2</label>
- <value>2</value>
- </item>
- <item>
- <label>3</label>
- <value>3</value>
- </item>
- </choices>
- </col>
- <col ref="CHECKER_ID" type="input" maxlength="10" style="background-color:#ffff99; "/>
- <col ref="LICENSE_NO" type="input" maxlength="20" style="background-color:#ffff99; "/>
- <col ref="LICENSE_MARK" visibility="hidden"/>
- <col ref="COIL_MARK_RESVER" type="input" maxlength="50" style="background-color:#ffff99; "/>
- <col ref="DLIV_DIRNO" visibility="hidden"/>
- </datagrid>
- <button id="button2" visibility="visible" style="left:910px; top:20px; width:65px; height:25px; ">
- <caption>导出excel</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- model.removenode("/root/datagrid2");
- model.makeNode("/root/datagrid2");
-
- model.refresh();
-
- var sCol_1 = "";
- var sCol_2 = "";
- var sCol_3 = "";
- var sCol_4 = "";
- var nRows2 = datagrid2.rows - datagrid2.fixedRows + 1;
-
- //alert("nRows2 : "+nRows2);
-
- //这里需要为导出方法准备数据,以键值对的形式
- for(var i= datagrid1.fixedRows;i<datagrid1.rows;i++){
- if(datagrid1.valueMatrix(i,datagrid1.colRef("CHK")) == "Y"){
- //在这里按照需要打印的格式,拼成报表.这里nRows2 + 6代表的是总行数
- for(var k=nRows2 ;k <= (nRows2 + 6); k++){
- //这里使用套打格式的方法处理
- if(((k%8) == 1) || ((k%8) == 0) ) {
- sCol_1 = "";
- sCol_2 = "";
- sCol_3 = "";
- sCol_4 = "";
- }else if( (k%8) == 2 ) {
- sCol_1 = " ";
- sCol_2 = model.getValue("/root/resData/COILResult_VO/COILResult_Row["+ i +"]/COIL_NO" );
- sCol_3 = " ";
- sCol_4 = model.getValue("/root/resData/COILResult_VO/COILResult_Row["+ i +"]/OLD_SAMPL_NO" );
- } else if( (k%8) == 3 ) {
- sCol_1 = " ";
- sCol_2 = model.getValue("/root/resData/COILResult_VO/COILResult_Row["+ i +"]/CHARE_NO" );
- sCol_3 = " ";
- sCol_4 = model.getValue("/root/resData/COILResult_VO/COILResult_Row["+ i +"]/SPEC_STL_GRD" );
- } else if( (k%8) == 4 ) {
- sCol_1 = " ";
- sCol_2 = model.getValue("/root/resData/COILResult_VO/COILResult_Row["+ i +"]/ORD_NO" );
- sCol_3 = " ";
- sCol_4 = model.getValue("/root/resData/COILResult_VO/COILResult_Row["+ i +"]/ACT_WGT" );
- } else if( (k%8) == 5 ) {
- sCol_1 = " ";
- sCol_2 = model.getValue("/root/resData/COILResult_VO/COILResult_Row["+ i +"]/THK_WTH" );
- sCol_3 = " ";
- sCol_4 = model.getValue("/root/resData/COILResult_VO/COILResult_Row["+ i +"]/MILL_DTIME" );
- }else if( (k%8) == 6 ) {
- sCol_1 = " ";
- sCol_2 = model.getValue("/root/resData/COILResult_VO/COILResult_Row["+ i +"]/SPEC_ABBSYM" );
- sCol_3 = " ";
- sCol_4 = model.getValue("/root/resData/COILResult_VO/COILResult_Row["+ i +"]/CHECKER_ID" );
- }else if( (k%8) == 7 ) {
- sCol_1 = " ";
- sCol_2 = model.getValue("/root/resData/COILResult_VO/COILResult_Row["+ i +"]/LICENSE_NO" );
- sCol_3 = " ";
- sCol_4 = model.getValue("/root/resData/COILResult_VO/COILResult_Row["+ i +"]/LICENSE_MARK" );
- }
-
- model.makeValue("/root/datagrid2/COILResult_VO/COILResult_Row["+ k +"]/COL_1" , sCol_1 );
- model.makeValue("/root/datagrid2/COILResult_VO/COILResult_Row["+ k +"]/COL_2" , sCol_2 );
- model.makeValue("/root/datagrid2/COILResult_VO/COILResult_Row["+ k +"]/COL_3" , sCol_3 );
- model.makeValue("/root/datagrid2/COILResult_VO/COILResult_Row["+ k +"]/COL_4" , sCol_4 );
-
- }
- }
- }
-
- model.refresh();
-
- saveExcelScript(datagrid2, "Sheet1");
-
- ]]>
- </script>
- <hint>
- <![CDATA[导出的EXCEL文件请保存在C盘,
- 保存在桌面会提示相应的错误信息。
- ]]>
- </hint>
- </button>
- <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; ">
- <col ref="COL_1" type="output"/>
- <col ref="COL_2"/>
- <col ref="COL_3"/>
- <col ref="COL_4"/>
- </datagrid>
- <input id="input1" ref="/root/searchData/DLIV_DIRNO" maxlength="12" style="left:80px; top:10px; width:115px; height:20px; "/>
- <button id="button1" visibility="hidden" style="left:506px; top:15px; width:95px; height:15px; ">
- <caption>button1</caption>
- <script type="javascript" ev:event="onclick">
- <![CDATA[
- find();
- ]]>
- </script>
- </button>
- <button id="button3" visibility="hidden" style="left:655px; top:10px; width:90px; height:20px; ">
- <caption>button3</caption>
- <script type="javascript" ev:event="onclick">
- <![CDATA[
- save();
- ]]>
- </script>
- </button>
- </xhtml:body>
- </xhtml:html>
|