| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360 |
- <?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>Untitle</xhtml:title>
- <model id="model1">
- <instance id="instance1">
- <root xmlns="">
- <formData>
- <SLAB_NO/>
- <CCM_NO/>
- <FLOW_NO/>
- </formData>
- <gridData>
- <grid1/>
- <grid2/>
- </gridData>
- <reqData/>
- </root>
- </instance>
- <bind id="bind1" ref="/root/gridData/grid1/WEIGHT_INFO_RST_Row/CHK2" calculate="/root/gridData/grid1/WEIGHT_INFO_RST_Row/CHK2 = /root/gridData/grid1/WEIGHT_INFO_RST_Row/CHK" type="xsd:string"/>
- </model>
- <script type="javascript" src="../../js/boaCommon.js"/>
- <script type="javascript">
- <![CDATA[
-
- function find()
- {
- commSendReq("/root/formData");
- commSubmit("UIG050020-service","find","glueAction.do");
- model.copyNode("/root/gridData/grid1","/root/resData/WEIGHT_INFO_RST_VO");
- model.copyNode("/root/gridData/grid2","/root/resData/SLAB_INFO_RST_VO");
- model.refresh();
-
- //if(combo2.value =='3')//三号铸机暂时不稳定
- //var rows = datagrid2.Rows -1 ;
- //var WGTValue = null;
- // for(var i = rows; i >= 1; i--)
- // {
- // WGTValue = datagrid2.valueMatrix(i, 2);
- // if(WGTValue < 9000)
- // {
- // datagrid2.deleteRow(i,false);
- // }
- // }
- //model.refresh();
- }
- //选择
- function selectAll(datagrid)
- {
- var endRow = datagrid.row;
- var startRow = "0";
- for(var i = 0 ; i < datagrid.rows - datagrid.fixedRows +1; i++)
- {
- if(datagrid.valueMatrix(i,datagrid.colRef("CHK")) == "Y" && i != datagrid.row)
- {
- startRow = i;
- }
- }
-
- if(startRow == "0")
- {
- return;
- }
- if(startRow > endRow)
- {
- var temp = startRow;
- startRow = endRow;
- endRow = temp;
- }
- for(var i = startRow; i<= endRow;i++)
- {
- datagrid.valueMatrix(i,datagrid.colRef("CHK")) = "Y";
- datagrid.rowStatus(i) = '1';
- }
- model.refresh();
- }
-
- //选择确定
- function copySlabWgt()
- {
- var chkCnt1 = 0;
- var chkCnt2 = 0;
-
- for(var i = 0 ; i < datagrid1.rows - datagrid1.fixedRows +1 ; i++)
- {
- if(datagrid1.valueMatrix(i,datagrid1.colRef("CHK")) == "Y")
- {
- chkCnt1 = chkCnt1 +1;
- }
- }
-
- for(var j = 0 ; j < datagrid2.rows - datagrid2.fixedRows + 1; j++)
- {
- //alert("------------j========" + j);
- if(datagrid2.valueMatrix(j,datagrid2.colRef("CHK")) == "Y")
- {
- chkCnt2 = chkCnt2 + 1;
- }
- }
-
- if(chkCnt1 != chkCnt2){
- alert("选择坯料块数不匹配!");
- return;
- }
- for(var i = 0 ; i < datagrid1.rows - datagrid1.fixedRows +1 ; i++)
- {
- if(datagrid1.valueMatrix(i,datagrid1.colRef("CHK")) == "Y")
- { //alert("-----i ===" + i);
- for(var j = 0 ; j < datagrid2.rows - datagrid2.fixedRows + 1; j++)
- {
- //alert("------------j========" + j);
- if(datagrid2.valueMatrix(j,datagrid2.colRef("CHK")) == "Y" ) //&& datagrid2.valueMatrix(j,datagrid2.colRef("CHK2")) == ""
- {
- datagrid1.valueMatrix(i,datagrid1.colRef("WEIGHT_WGT"))= datagrid2.valueMatrix(j,datagrid2.colRef("WEIGHT"));
- datagrid1.valueMatrix(i,datagrid1.colRef("SAMPLINGID"))= datagrid2.valueMatrix(j,datagrid2.colRef("SAMPLINGID"));
- datagrid2.valueMatrix(j,datagrid2.colRef("CHK")) = "N";
- break;
- }
- }
- }
- }
-
- }
-
- //保存
- function receive()
- {
- model.removenode("/root/reqData");
- model.makeNode("/root/reqData");
- commMultiUpdate(datagrid1,"/root/reqData","A",true,"rowStatus");
- commSubmit("UIG050020-service","get","glueAction.do");
- find();
- }
-
- //保存
- function save()
- {
- model.removenode("/root/reqData");
- model.makeNode("/root/reqData");
- commMultiUpdate(datagrid1,"/root/reqData","A",true,"rowStatus");
- model.makeValue("/root/reqData/USER","st002");
- model.makeValue("/root/reqData/TYPE","SV");
- commSubmit("UIG050020-service","save","glueAction.do");
- find();
- }
-
- //取消
- function cancle()
- {
- model.removenode("/root/reqData");
- model.makeNode("/root/reqData");
- commMultiUpdate(datagrid1,"/root/reqData","A",true,"rowStatus");
- model.makeValue("/root/reqData/USER","st002");
- model.makeValue("/root/reqData/TYPE","CC");
- commSubmit("UIG050020-service","save","glueAction.do");
- find();
- }
-
- function rightClick()
- {
- var checkValue = model.getValue("/root/formData/SLAB_NO");
- if(checkValue == null || checkValue == "")return;
- var tstvalue = parseInt(checkValue.substr(4,5),10);
- var tailValue = checkValue.substr(9,4);
- tstvalue = (tstvalue + 1) + "";
- var strLen = tstvalue.length;
- checkValue = checkValue.substr(0,4);
- for(var i = 0 ; i < (5 - strLen) ; i++){
- checkValue = checkValue + "0";
- }
- checkValue = checkValue + tstvalue + tailValue;
- model.setValue("/root/formData/SLAB_NO",checkValue);
- find();
- }
-
- function leftClick()
- {
- var checkValue = model.getValue("/root/formData/SLAB_NO");
- if(checkValue == null || checkValue == "")return;
- if(checkValue.length < 9){
- alert(" 炉次号长度不符! ");
- return;
- }
- var tstvalue = parseInt(checkValue.substr(4,5),10);
- var tailValue = checkValue.substr(9,4);
- tstvalue = (tstvalue - 1) + "";
- var strLen = tstvalue.length;
- checkValue = checkValue.substr(0,4);
- for(var i = 0 ; i < (5 - strLen) ; i++){
- checkValue = checkValue + "0";
- }
-
- checkValue = checkValue + tstvalue + tailValue;
- model.setValue("/root/formData/SLAB_NO",checkValue);
- find();
- }
- ]]>
- </script>
- </xhtml:head>
- <xhtml:body>
- <datagrid id="datagrid1" nodeset="/root/gridData/grid2/SLAB_INFO_RST_Row" caption="规格^牌号^板坯号^理论重量^称重重量^选择^顺序号" colsep="^" colwidth="78, 67, 92, 58, 61, 42, 61" mergecellsfixedrows="bycolrec" rowsep="|" style="left:0px; top:40px; width:470px; height:380px; ">
- <col ref="SLAB_SIZE"/>
- <col ref="STL_GRD"/>
- <col ref="SLAB_NO"/>
- <col ref="SLAB_WGT"/>
- <col ref="WEIGHT_WGT" type="input"/>
- <col checkvalue="Y,N" ref="CHK" type="checkbox"/>
- <col ref="SAMPLINGID" visibility="visible"/>
- <script type="javascript" ev:event="xforms-select">
- <![CDATA[
- selectAll(datagrid1);
- ]]>
- </script>
- </datagrid>
- <datagrid id="datagrid2" nodeset="/root/gridData/grid1/WEIGHT_INFO_RST_Row" caption="选择^顺序号^坯料重量
^称重时间^铸机号
^铸流号
^caption1" colsep="^" colwidth="40, 88, 65, 122, 45, 49, 100" mergecellsfixedrows="bycolrec" rowsep="|" style="left:510px; top:40px; width:430px; height:380px; ">
- <col checkvalue="Y,N" ref="CHK" type="checkbox"/>
- <col ref="SAMPLINGID"/>
- <col ref="WEIGHT"/>
- <col ref="SAMPLINGTIME"/>
- <col ref="CCMID"/>
- <col ref="FLOWNO"/>
- <col ref="CHK2" visibility="hidden"/>
- <script type="javascript" ev:event="xforms-select">
- <![CDATA[
- selectAll(datagrid2);
- ]]>
- </script>
- <script type="javascript" ev:event="onclick">
- <![CDATA[
- //window.alert(datagrid2.valueMatrix(datagrid2.row, datagrid2.colRef("WEIGHT")))
- /* if(combo2.value =='3')//三号铸机暂时不稳定
- var rows = datagrid2.Rows -1 ;
- var WGTValue = null;
- for(var i = rows; i >= 1; i--)
- {
- WGTValue = datagrid2.valueMatrix(i, 2);
- if(WGTValue < 9000)
- {
- datagrid2.deleteRow(i,false);
- }
- }
- model.refresh();
- */
- ]]>
- </script>
- <script type="javascript" ev:event="ondblclick">
- <![CDATA[
- /* if(combo2.value =='3')//三号铸机暂时不稳定
- var rows = datagrid2.Rows -1 ;
- var WGTValue = null;
- for(var i = rows; i >= 1; i--)
- {
- WGTValue = datagrid2.valueMatrix(i, 2);
- if(WGTValue < 9000)
- {
- datagrid2.deleteRow(i,false);
- }
- }
- model.refresh(); */
- ]]>
- </script>
- </datagrid>
- <button id="button1" style="left:755px; top:10px; width:50px; height:20px; ">
- <caption>查询</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- find();
- ]]>
- </script>
- </button>
- <button id="button2" style="left:465px; top:110px; width:44px; height:90px; ">
- <caption>选择</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- copySlabWgt();
- ]]>
- </script>
- </button>
- <button id="button3" style="left:805px; top:10px; width:55px; height:20px; ">
- <caption>保存</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- save();
- ]]>
- </script>
- </button>
- <button id="button4" style="left:860px; top:10px; width:44px; height:20px; ">
- <caption>取消</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- cancle();
- ]]>
- </script>
- </button>
- <caption id="caption3" class="cell" style="left:0px; top:5px; width:74px; height:20px; font-weight:bold; border-color:#000000; ">板坯号</caption>
- <select1 id="combo1" ref="/root/formData/SLAB_NO" appearance="minimal" editmode="input" style="left:70px; top:5px; width:110px; height:20px; border-color:#000000; ">
- <choices>
- <itemset nodeset="/root/comboData/slab_no/SLAB_NO_INIT_RES_Row">
- <label ref="LABEL"/>
- <value ref="VALUE"/>
- </itemset>
- </choices>
- </select1>
- <button id="button5" style="left:205px; top:7px; width:20px; height:20px; background-image:../../images/cal_next_m.gif; ">
- <caption/>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- rightClick();
- ]]>
- </script>
- </button>
- <button id="button6" style="left:180px; top:7px; width:20px; height:20px; background-image:../../images/cal_pre_m.gif; ">
- <caption/>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- leftClick();
- ]]>
- </script>
- </button>
- <select1 id="combo2" ref="/root/formData/CCM_NO" appearance="minimal" editmode="input" style="left:300px; top:5px; width:75px; height:20px; border-color:#000000; ">
- <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>
- </select1>
- <caption id="caption1" class="cell" style="left:230px; top:5px; width:74px; height:20px; font-weight:bold; border-color:#000000; ">连铸机号</caption>
- <caption id="caption2" class="cell" style="left:380px; top:5px; width:74px; height:20px; font-weight:bold; border-color:#000000; ">流号</caption>
- <select1 id="combo3" ref="/root/formData/FLOW_NO" appearance="minimal" editmode="input" style="left:450px; top:5px; width:50px; height:20px; border-color:#000000; ">
- <choices>
- <item>
- <label>1流</label>
- <value>1</value>
- </item>
- <item>
- <label>2流</label>
- <value>2</value>
- </item>
- </choices>
- </select1>
- <button id="button7" style="left:685px; top:10px; width:75px; height:20px; ">
- <caption>接收</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- receive();
- ]]>
- </script>
- </button>
- </xhtml:body>
- </xhtml:html>
|