| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430 |
- <?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[品质判定>>材质判定>>试样号材质实绩录入]]>
- </xhtml:title>
- <model id="model1">
- <instance id="instance1">
- <root xmlns="">
- <formData>
- <serachinfo>
- <Pstove/>
- </serachinfo>
- <ProcCD/>
- <cc/>
- <dd/>
- </formData>
- <datagrid1/>
- <datagrid2/>
- <initQltyCD>
- <QltyResult_Row>
- <LABEL/>
- <VALUE/>
- </QltyResult_Row>
- </initQltyCD>
- <tempData1/>
- <tempData2/>
- <initData>
- <ChargeNo_Row>
- <LABEL/>
- <VALUE/>
- </ChargeNo_Row>
- </initData>
- </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 Init(node)
- {
- InitParams(node);
- model.removenode("/root/reqData");
- model.makeNode("/root/reqData");
- datagrid1.colStatus(0)=false;
-
- input1.value = document.readIniFile("session1" , "UIB020132_1" , "" , "c:\\WINDOWS\\xgmes3.ini");
- input2.value = document.readIniFile("session1" , "UIB020132_2" , "" , "c:\\WINDOWS\\xgmes3.ini");
-
- commSubmit("UIB020132-service" , "success" , "glueAction.do");
- model.copyNode("/root/initQltyCD" , "/root/resData/QltyResult_VO");
- model.refresh();
- // combo1.select(0);
- }
-
- function find()
- {
- model.removenode("/root/reqData");
- model.resetInstanceNode("/root/datagrid2");//清空datagrid2的数据
- model.refresh();
-
- document.writeIniFile("session1" , "UIB020132_1" , input1.value.Trim() , "c:\\WINDOWS\\xgmes3.ini");
- document.writeIniFile("session1" , "UIB020132_2" , input2.value.Trim() , "c:\\WINDOWS\\xgmes3.ini");
-
- model.makeValue("/root/reqData/Pstove" , combo1.value.Trim());//炉次号
- model.makeValue("/root/reqData/PROCCD" , combo2.value);//进程状态
- model.makeValue("/root/reqData/COIL1" , input1.value.Trim());
- if(input2.value.Trim() == "")
- {
- model.makeValue("/root/reqData/COIL2" , input1.value.Trim());
- }
- else
- {
- model.makeValue("/root/reqData/COIL2" , input2.value.Trim());
- }
- // if(combo2.value.Trim() == "C")//检验待机
- // {
- // commSubmit("UIB020132-service" , "find2" , "glueAction.do");
- // }
- // else if(combo2.value.Trim() == "D")
- // {
- // commSubmit("UIB020132-service" , "find3" , "glueAction.do");
- // }
- // else
- // {
- // commSubmit("UIB020132-service" , "find1" , "glueAction.do");
- // }
- commSubmit("UIB020132-service" , "findSamp" , "glueAction.do");
- model.copyNode("/root/datagrid1" , "/root/resData/MapSmpResult_VO");
- model.refresh();
- // commSubmit("UIB020132-service" , "findSamp" , "glueAction.do");
- //
- // reset();
- // GridDynamicQlty(datagrid1 , "/root/resData/QltyNM_VO");
- // model.copyNode("/root/datagrid1" , "/root/resData/MapSmpResult_VO");
- // model.refresh();
- //
- // //改变与SMP_NO不同的CONV_SMP_NO的字体的颜色
- // var smp = "";//save SMP_NO
- // var subSmp = "";//save CONV_SMP_NO
- // for(var i = datagrid1.fixedRows; i < datagrid1.rows ; i++)
- // {
- // for(var j = 1; j < (datagrid1.cols - 6); j++)
- // {
- // subSmp = (datagrid1.valueMatrix(i,1)).substr(10,5);//试样编号
- // smp = datagrid1.valueMatrix(i , datagrid1.colRef("CD"+j));//动态生成的列
- // if(smp!="" && subSmp!= smp)
- // datagrid1.cellstyle("color", i,datagrid1.colRef("CD"+j)) = "#0000ff";//字体颜色设置
- // }
- // }
- }
-
- ///表格的动态列生成
- //ref 为"/root/resData/QltyNM_VO"形式
- function GridDynamicQlty(grid , ref)
- {
- ///获得材质名
- var node = instance1.selectSingleNode(ref);
- var nodeList = node.childNodes;
- var nNode;
- var i = 1;
- var tempCaption1 = "";//第一列的caption
- var tempCaption2 = "";//第二列的caption
- while(nNode=nodeList.nextNode())
- {
- grid.addColumn("ref:CD"+i, false);
-
- ///指定某一列的caption
- grid.colWidth(grid.colRef("CD"+i)) = 50;
- tempCaption1 = tempCaption1 +"^"+"材质实验编制项目";
- tempCaption2 = tempCaption2 +"^"+nNode.childNodes.item(0).nodeValue;
- i++;
- }
- ///生成最终的caption
- var caption = grid.caption ;
- grid.caption = caption.split("|")[0]+tempCaption1+"|"+caption.split("|")[1]+tempCaption2;
- }
-
- function save()
- {
- if(beGridChanged(datagrid1 , datagrid2)=="0")//若无修改,则不进行下面操作
- return;
- model.removenode("/root/reqData");
- model.makeNode("/root/reqData");
- model.removenode("/root/tempData1");
- model.makeNode("/root/tempData1");
- model.removenode("/root/tempData2");
- model.makeNode("/root/tempData2");
-
- // b01MultiUpdate(datagrid1 , "/root/tempData1" , "A" , true , "rowStatus1");//获得表1的更新记录
- b01MultiUpdate(datagrid2 , "/root/tempData2" , "A" , true , "rowStatus2");//获得表2的更新记录
- commSendReq("/root/tempData1" , "/root/tempData2");//生成reqData节点
- // commSendReq("/root/tempData1" );//生成reqData节点
- model.makeValue("/root/reqData/ONE_COUNT" , datagrid1.cols - datagrid1.colRef("SMP_PROG_CD"));//表1中动态生成项的数量
- getLoggingInInfo();
- commSubmit("UIB020132-service" , "save" , "glueAction.do");
- datagrid1.rebuild();
- //model.refresh();
- exceptionReport();
- }
-
- var captionxxx = datagrid1.caption;
- function reset()
- {
- model.removenode("/root/datagrid1");
- datagrid1.caption = captionxxx;
- model.makeNode("/root/datagrid1");
-
- datagrid1.addRow();
- var coll = datagrid1.cols;
- ///还原表格到初始状态
- for(var i = coll; i > 7; i--)
- {
- datagrid1.deleteColumn(i , false);
- }
- // model.removenode("/root/datagrid1");
- // datagrid1.caption = captionxxx;
- ///生成列
- datagrid1.addRow();//先有一行才能改变表格的宽度
- }
-
- function setColor(grid)
- {
- var valCol = grid.colRef("QLTY_VAL_WK1");//实绩值做在列
- var minCol = grid.colRef("QLTY_MIN");//最小值的列
- var maxCol = grid.colRef("QLTY_MAX");//最大值的列
- grid.colstyle(valCol, "data", "background-color") = "#ffff99";//恢复初始的黄色再染色
- var min = "";
- var max = "";
- var val = "";
- for(var i = 1; i < grid.rows; i++)
- {
- min = grid.valueMatrix(i , minCol);//成分最小
- max = grid.valueMatrix(i , maxCol);//最大
- val = grid.valueMatrix(i , valCol);//实绩
-
- if(val != "" && min !="" && parseFloat(min) > parseFloat(val) )//实绩值应大于等于指示最小值,否则不合格
- {
-
- grid.cellStyle("background-color" , i , valCol) = "#ff0000";
- }
- if(val != "" && max != "" && parseFloat(max) < parseFloat(val))//实绩值应小于等于指示最大值,否则不合格
- {
- grid.cellStyle("background-color" , i , valCol) = "#ff0000";
- }
- if(val =="" && (max != "" || min !="") )
- {
- grid.cellStyle("background-color" , i , valCol) = "#cc99ff";
- }
- }
- }
- ]]>
- </script>
- </xhtml:head>
- <xhtml:body pagewidth="980" pageheight="620">
- <caption id="caption1" class="cell" visibility="hidden" style="left:575px; top:5px; width:100px; height:20px; ">炉次号</caption>
- <datagrid id="datagrid1" nodeset="/root/datagrid1/MapSmpResult_Row" caption="选择^流水号^钢卷号^试样编号^位置^取样代码^标准号^标准钢号^厚度^试样进程代码^备注|选择^流水号^钢卷号^试样编号^位置^取样代码^标准号^标准钢号^厚度^试样进程代码^备注" colsep="^" colwidth="33, 100, 100, 96, 26, 40, 145, 98, 100, 86, 120" explorerbar="sortshow" extendlastcol="false" frozencols="3" mergecellsfixedrows="bycolrec" rowsep="|" tooltip="label" style="left:0px; top:35px; width:977px; height:310px; ">
- <col checkvalue="Y,N" ref="CHK" type="radio"/>
- <col editable="false" ref="COIL_NO" type="input" visibility="hidden" style="background-color:#ffffff; "/>
- <col editable="false" ref="OLD_SAMPL_NO" type="input" style="background-color:#ffffff; "/>
- <col editable="false" ref="SMP_NO" type="input" style="background-color:#ffffff; "/>
- <col editable="false" ref="SMP_CUT_LOC" type="input" style="background-color:#ffffff; "/>
- <col editable="false" ref="SAMPLING_CODE" type="input" visibility="hidden" style="background-color:#ffffff; "/>
- <col editable="false" ref="SPEC_ABBSYM" type="input" style="background-color:#ffffff; "/>
- <col editable="false" ref="SPEC_STL_GRD" type="input" style="background-color:#ffffff; "/>
- <col editable="false" ref="DCS_THK" type="input" style="background-color:#ffffff; "/>
- <col disabled="true" ref="SMP_PROG_CD" type="combo">
- <choices>
- <item>
- <label>试样采集等待</label>
- <value>A</value>
- </item>
- <item>
- <label>试样入库等待</label>
- <value>B</value>
- </item>
- <item>
- <label>试样检验等待</label>
- <value>C</value>
- </item>
- <item>
- <label>材质判定等待</label>
- <value>D</value>
- </item>
- </choices>
- </col>
- <col ref="SMP_DETAIL" type="input" style="text-align:left; background-color:#ffff99; "/>
- <script type="javascript" ev:event="onclick">
- <![CDATA[
- // datagrid1.editCell();
- //若点击的是第一列,则进行查询操作
- var smpcol = datagrid1.colRef("SMP_NO");
- var smpcutcol = datagrid1.colRef("SMP_CUT_LOC");
- if(datagrid1.col == 0 && datagrid1.valueMatrix(datagrid1.row , datagrid1.col)=="Y")
- {
- var smpNO = datagrid1.valueMatrix(datagrid1.row, smpcol);//试样号
- var cutLOC = datagrid1.valueMatrix(datagrid1.row ,smpcutcol);//位置
- model.removenode("/root/reqData");
- model.makeValue("/root/reqData/SMPNO" , smpNO);//试样号
- model.makeValue("/root/reqData/SMPCUTLOC" , cutLOC);//位置
- //查询,生成表格2的数据
- commSubmit("UIB020132-service" , "findGrade" , "glueAction.do");
- model.copyNode("/root/datagrid2" , "/root/resData/GradeResult_VO");//copy
- model.refresh();
- //试样位置赋给表格2
- for(var i = 2; i < datagrid2.rows; i++)
- {
- datagrid2.valueMatrix( i , datagrid2.colRef("SMPCUTLOC")) = cutLOC;//位置
- }
-
- //若取样位置不是W,则隐藏“实绩2”,否则显示实绩2
- if(cutLOC=="W")
- {
- datagrid2.colHidden(datagrid2.colRef("QLTY_VAL_WK2")) = false;
- datagrid2.colHidden(datagrid2.colRef("QLTY_UNIT_WK2")) = false;
- }
- else
- {
- datagrid2.colHidden(datagrid2.colRef("QLTY_VAL_WK2")) = true;
- datagrid2.colHidden(datagrid2.colRef("QLTY_UNIT_WK2")) = true;
- }
- setColor(datagrid2);
- // datagrid1.row = 0;
- }
- ]]>
- </script>
- <script type="javascript" ev:event="xforms-value-changed">
- <![CDATA[
- var currentRow = datagrid1.row;
- var currentCol = datagrid1.col;
- if(datagrid1.valueMatrix(currentRow , currentCol)=="")
- {
- datagrid1.cellAttribute("disabled") = true;
- }
- ]]>
- </script>
- <script type="javascript" ev:event="onkeydown">
- <![CDATA[
- if(event.keyCode == 13 && datagrid1.colRef("SMP_DETAIL") == datagrid1.col)
- {
-
- datagrid1.editCell();
- model.setFocus("");
- model.removenode("/root/reqData");
- model.makeNode("/root/reqData");
- b01MultiUpdate(datagrid1 , "/root/reqData" , "A" , true , "rowStatus");
- commSubmit("UIB020132-service" , "save1" , "glueAction.do");
- datagrid1.row++;
- datagrid1.clearStatus();
-
- }
- ]]>
- </script>
- </datagrid>
- <datagrid id="datagrid2" nodeset="/root/datagrid2/GradeResult_Row" caption="材质代码^次数^材质项目^材质要求范围^材质要求范围^材质要求范围^实绩(1)^实绩(1)^实绩(2)^实绩(2)^试样号(隐)^试样位置(隐)^统一LOT试样号^统一LOT试样号^统一LOT试样号^统一LOT试样号^统一LOT试样号^统一LOT试样号^统一LOT试样号^统一LOT试样号^统一LOT试样号^统一LOT试样号^统一LOT试样号|材质代码^次数^材质项目^最小^最大^单位^材质^单位^材质^单位^试样号(隐)^试样位置(隐)^试样1^试样2^试样3^试样4^试样5^试样6^试样7^试样8^试样9^试样10^试样11" colsep="^" colwidth="60, 38, 132, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50" mergecellsfixedrows="bycolrec" rowsep="|" tooltip="true" style="left:0px; top:355px; width:977px; height:262px; ">
- <col editable="false" ref="QLTYCD" type="input" style="background-color:#ffffff; "/>
- <col editable="false" ref="QLTY_SEQ" type="input" style="background-color:#ffffff; "/>
- <col disabled="true" ref="QLTY_CD" type="combo">
- <choices>
- <itemset nodeset="/root/initQltyCD/QltyResult_Row">
- <label ref="LABEL"/>
- <value ref="VALUE"/>
- </itemset>
- </choices>
- </col>
- <col editable="false" ref="QLTY_MIN" type="input" style="background-color:#ffffff; "/>
- <col editable="false" ref="QLTY_MAX" type="input" style="border-color:#ffffff; "/>
- <col editable="false" ref="QLTY_UNIT" type="input" style="background-color:#ffffff; "/>
- <col ref="QLTY_VAL_WK1" type="input" style="background-color:#ffff99; "/>
- <col ref="QLTY_UNIT_WK1" type="input" style="background-color:#ffff99; "/>
- <col ref="QLTY_VAL_WK2" type="input" style="background-color:#ffff99; "/>
- <col ref="QLTY_UNIT_WK2" type="input" style="background-color:#ffff99; "/>
- <col ref="SMPNO" visibility="hidden"/>
- <col ref="SMPCUTLOC" visibility="hidden"/>
- <col ref="SMP1"/>
- <col ref="SMP2"/>
- <col ref="SMP3"/>
- <col ref="SMP4"/>
- <col ref="SMP5"/>
- <col ref="SMP6"/>
- <col ref="SMP7"/>
- <col ref="SMP8" visibility="hidden"/>
- <col ref="SMP9" visibility="hidden"/>
- <col ref="SMP10" visibility="hidden"/>
- <col ref="SMP11" visibility="hidden"/>
- <script type="javascript" ev:event="onclick">
- <![CDATA[
- // datagrid2.editCell();
- ]]>
- </script>
- <script type="javascript" ev:event="onentercell">
- <![CDATA[
- if(datagrid2.col == datagrid2.colRef("QLTY_VAL_WK1") || datagrid2.col == datagrid2.colRef("QLTY_UNIT_WK1"))
- {
- datagrid2.editCell();
- }
- ]]>
- </script>
- <script type="javascript" ev:event="onkeydown">
- <![CDATA[
- if(event.keyCode==13)//回车事件
- {
- datagrid2.row++;
- }
- ]]>
- </script>
- </datagrid>
- <caption id="caption2" class="cell" style="left:0px; top:5px; width:100px; height:20px; ">试样进程代码</caption>
- <select1 id="combo2" ref="/root/formData/ProcCD" appearance="minimal" style="left:100px; top:5px; width:100px; height:20px; ">
- <choices>
- <item>
- <label>-----------</label>
- <value/>
- </item>
- <item>
- <label>试样检验等待</label>
- <value>C</value>
- </item>
- <item>
- <label>试样判定等待</label>
- <value>D</value>
- </item>
- </choices>
- </select1>
- <line id="line1" style="x1:0px; y1:30px; x2:975px; y2:30px; "/>
- <line id="line2" style="x1:0px; y1:0px; x2:975px; y2:0px; "/>
- <select1 id="combo1" ref="/root/formData/serachinfo/Pstove" visibility="hidden" appearance="minimal" cols="5" editmode="inputsearch" style="left:675px; top:5px; width:100px; height:20px; ">
- <choices>
- <itemset nodeset="/root/initData/ChargeNo_Row">
- <label ref="LABEL"/>
- <value ref="VALUE"/>
- </itemset>
- </choices>
- </select1>
- <caption id="caption3" class="cell" style="left:220px; top:5px; width:100px; height:20px; ">轧批号</caption>
- <input id="input1" ref="/root/formData/cc" style="left:320px; top:5px; width:100px; height:20px; ">
- <script type="javascript" ev:event="onkeydown">
- <![CDATA[
- if(event.keyCode==13)
- {
- model.setFocus("");
- model.setFocus("input1");
- find();
- }
- ]]>
- </script>
- </input>
- <line id="line3" style="x1:420px; y1:15px; x2:430px; y2:15px; "/>
- <input id="input2" ref="/root/formData/dd" style="left:430px; top:5px; width:100px; height:20px; ">
- <script type="javascript" ev:event="onkeydown">
- <![CDATA[
- if(event.keyCode==13)
- {
- model.setFocus("");
- model.setFocus("input2");
- find();
- }
- ]]>
- </script>
- </input>
- </xhtml:body>
- </xhtml:html>
|