| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342 |
- <?xml version="1.0" encoding="UTF-8"?>
- <?xml-stylesheet href="D:/GlueDev/work/xgmes3/WebContents/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[炼钢作业 >> 炼钢标准 >> 二级接口电文测试(UIG060030)]]>
- </xhtml:title>
- <model id="model1">
- <instance id="instance1">
- <root xmlns="">
- <dataGrid>
- <SEQ_NO/>
- <MSG_ID/>
- <MSG_NAME/>
- <DATA_TYPE/>
- <DATA_LEN/>
- <DATA_VALUE/>
- </dataGrid>
- <formData>
- <TC_ID/>
- <PROC_CD>H</PROC_CD>
- <TC_NAME/>
- <MAT_NO/>
- </formData>
- <reqData/>
- <resData/>
- <initData>
- <INIT_TC_ID/>
- <INIT_TC_NAME/>
- </initData>
- <sendInfo/>
- <datagrid1/>
- <AUTO/>
- <tempData1/>
- <tempData2/>
- <msgData/>
- </root>
- </instance>
- <script type="javascript" ev:event="xforms-ready">
- <![CDATA[
- //initPage();
-
- ]]>
- </script>
- </model>
- <script type="javascript">
- <![CDATA[
- /*
- * 初始化 函数
- */
- function initPage()
- {
- commSubmit("UIG060030-service","success","glueAction.do");
- commAppendData("/root/initData/INIT_TC_ID/InitDataResult_VO","/root/resData/InitDataResult_VO");
- model.refresh()
- }
-
- function seleOnClick1()
- {
- model.removenode("/root/reqData");
- model.makeNode("/root/reqData");
- model.duplicate("/root/reqData","/root/formData/PROC_CD");
- commSubmit("UIG060030-service","success","glueAction.do");
- commAppendData("/root/initData/INIT_TC_ID/InitDataResult_VO","/root/resData/InitDataResult_VO");
- model.refresh()
- }
-
- function seleOnClick2()
- {
- model.removenode("/root/reqData");
- model.makeNode("/root/reqData");
- model.duplicate("/root/reqData","/root/formData/TC_ID");
- commSubmit("UIG060030-service","tcfind","glueAction.do");
- model1.setValue("/root/formData/TC_NAME",model1.getValue("/root/resData/TcNmResult_VO/TcNmResult_Row/TC_NAME"));
- // alert("aa:"+model.getValue("/root/formData/TC_NAME/TcNmResult_VO"));
- model.refresh()
- }
-
- function send()
- {
- model.removenode("/root/reqData");
- model.makeNode("/root/reqData");
- var dataCnt = datagrid1.rows - datagrid1.fixedRows;
- for (var i=1; i <= dataCnt; i++ ) {
- datagrid1.valueMatrix(i,datagrid1.colRef("CHK")) = "Y";
- datagrid1.rowStatus(i) = 1;
- }
- commMultiUpdate(datagrid1,"/root/reqData","A",true,"rowStatus");
- commSubmit("UIG060030-service","send","glueAction.do");
- if (model.getValue("/root/resData/errorData") != "")
- alert("异常:" + model.getValue("/root/resData/errorData"));
- else
- alert(" @@@ 发送成功 @@@ ");
- model.refresh();
- }
-
- function find()
- {
- model.removenode("/root/reqData");
- model.makeNode("/root/reqData");
- model.duplicate("/root/reqData","/root/formData/TC_ID");
- model.removenode("/root/datagrid1");
- model.makeNode("/root/datagrid1");
- var sTcId = model.getValue("/root/formData/TC_ID");
- if ( sTcId == null || sTcId == "" ) {
- alert(" @@@@ 请选择电文ID @@@@ " );
- } else {
- commSubmit("UIG060030-service","find","glueAction.do");
- commAppendData("/root/datagrid1/MessageEdit_VO","/root/resData/MessageEdit_VO");
- // alert(sTcId);
- // datagrid1.cellattribute("maxlength",datagrid1.fixedRows, col, datagrid1.rows - 1, col) = "1";
- model.setValue(datagrid1.nodeset + "[" + 1 + "]/DATA_VALUE",sTcId );
- model.refresh();
- }
- }
-
- function save()
- {
- model.removenode("/root/reqData");
- model.makeNode("/root/reqData");
- var dataCnt = datagrid1.rows - datagrid1.fixedRows;
- for (var i=1 ; i <= dataCnt; i++ ) {
- datagrid1.valueMatrix(i,datagrid1.colRef("CHK")) = "Y";
- datagrid1.rowStatus(i) = 1;
- }
- commMultiUpdate(datagrid1,"/root/reqData","A",true,"rowStatus");
- commSubmit("UIG060030-service","save","glueAction.do");
- var TcId = model.getValue("/root/formData/TC_ID");
- alert("("+TcId+"): 电文 ID @@@ 保存成功 @@@ ");
- model.refresh();
- }
-
- function setLen(row,maxlen)
- {
- var Len = maxlen;
- datagrid1.cellAttribute("maxlength", row, 6,row,6) = Len;
- }
-
- function L2_EDIT()
- {
- model.removenode("/root/reqData");
- model.makeNode("/root/reqData");
- model.duplicate("/root/reqData","/root/formData/TC_ID");
- model.duplicate("/root/reqData","/root/formData/MAT_NO");
- model.removenode("/root/datagrid1");
- model.makeNode("/root/datagrid1");
- var sTcId = model.getValue("/root/formData/TC_ID");
- if ( sTcId == null || sTcId == "" ) {
- alert(" @@@@ Please enter TC_ID @@@@ " );
- } else {
- commSubmit("UIG060030-service","l2edit","glueAction.do");
- commAppendData("/root/datagrid1/MessageEdit_VO","/root/resData/MessageEdit_VO");
- // alert(sTcId);
- // datagrid1.cellattribute("maxlength",datagrid1.fixedRows, col, datagrid1.rows - 1, col) = "1";
- model.refresh();
- }
- }
-
- function L2_DATA_RECV()
- {
- model.removenode("/root/reqData");
- model.makeNode("/root/reqData");
- commSubmit("UIG060030-service","l2recv","glueAction.do");
- commAppendData("/root/datagrid1/MessageEdit_VO","/root/resData/MessageEdit_VO");
- // alert(sTcId);
- // datagrid1.cellattribute("maxlength",datagrid1.fixedRows, col, datagrid1.rows - 1, col) = "1";
- model.refresh();
- }
-
- function select()
- {
- model.removenode("/root/reqData");
- model.makeNode("/root/reqData");
- commSubmit("UIG060030-service","recieve","glueAction.do");
- model.refresh();
- }
-
- function call_left_UIG060031()
- {
- if(model.getValue("/root/formData/PROC_CD") != "" && model.getValue("/root/formData/PROC_CD") != null){
- var factCd = model1.getValue("/root/formData/PROC_CD");
- model1.setValue("/root/tempData1",factCd);
- }
- window.load("UIG060031.xrw","modal","", "left:228; top:78; width:420; height:480; sysmenu:visible; min:visible; max:true; resize:true; caption:visible;");
- model1.setValue("/root/formData/TC_ID",model1.getValue("/root/tempData1"));
- model1.setValue("/root/formData/TC_NAME",model1.getValue("/root/tempData2"));
- model1.removenode("/root/tempData1");
- model1.removenode("/root/tempData2");
- model1.makeNode("/root/tempData1");
- model1.makeNode("/root/tempData2");
- input1.refresh();
- input3.refresh();
- }
-
- function sendChem()
- {
- model.removenode("/root/reqData");
- model.makeNode("/root/reqData");
- commSubmit("UIG060030-service","chem","glueAction.do");
- // alert(sTcId);
- // datagrid1.cellattribute("maxlength",datagrid1.fixedRows, col, datagrid1.rows - 1, col) = "1";
- model.refresh();
- }
- var clockTimer;
- /**
- * 时间对象的格式化;
- */
- Date.prototype.format = function(format) {
- /*
- * eg:format="YYYY-MM-dd hh:mm:ss";
- */
- var o = {
- "M+" : this.getMonth()+1, //month
- "d+" : this.getDate(), //day
- "h+" : this.getHours(), //hour
- "m+" : this.getMinutes(), //minute
- "s+" : this.getSeconds(), //second
- "q+" : Math.floor((this.getMonth()+3)/3), //quarter
- "S" : this.getMilliseconds() //millisecond
- }
-
- if(/(y+)/.test(format)) {
- format = format.replace(RegExp.$1, (this.getFullYear()+"").substr(4 - RegExp.$1.length));
- }
-
- for(var k in o) {
- if(new RegExp("("+ k +")").test(format)) {
- format = format.replace(RegExp.$1, RegExp.$1.length==1 ? o[k] : ("00"+ o[k]).substr((""+ o[k]).length));
- }
- }
- return format;
- }
- ]]>
- </script>
- <script type="javascript" src="../../js/boaCommon.js"/>
- <script type="javascript" src="../../js/g02.js"/>
- </xhtml:head>
- <xhtml:body overflow="hidden" pagewidth="980" pageheight="620" style="font-family:宋体; ">
- <caption id="caption1" class="cell" style="left:22px; top:5px; width:60px; height:20px; vertical-align:middle; border-color:#000000; ">工厂区分</caption>
- <caption id="caption2" class="cell" style="left:167px; top:5px; width:80px; height:20px; vertical-align:middle; border-color:#000000; ">电文 ID</caption>
- <datagrid id="datagrid1" nodeset="/root/datagrid1/MessageEdit_VO/MessageEdit_Row" caption="chk^SEQ^项目名^项目说明^项目 Type^项目长度^DATA" colsep="^" colwidth="44, 60, 190, 240, 100, 100, 120" mergecellsfixedrows="bycolrec" rowsep="|" style="left:25px; top:55px; width:825px; height:460px; ">
- <col checkvalue="Y,N" ref="CHK" type="checkbox" visibility="hidden"/>
- <col ref="SEQ_NO"/>
- <col ref="MSG_ID" style="text-align:left; "/>
- <col ref="MSG_NAME" style="text-align:left; "/>
- <col ref="DATA_TYPE"/>
- <col ref="DATA_LEN"/>
- <col ref="DATA_VALUE" type="input" style="background-color:#ffff99; "/>
- <script type="javascript" ev:event="ondblclick">
- <![CDATA[
- setLen(datagrid1.row,model.getValue(datagrid1.nodeset + "[" +datagrid1.row+ "]/DATA_LEN"));
- ]]>
- </script>
- </datagrid>
- <select1 id="combo1" ref="/root/formData/PROC_CD" appearance="minimal" style="left:82px; top:5px; width:75px; height:20px; ">
- <choices>
- <item>
- <label>炼钢</label>
- <value>S</value>
- </item>
- <item>
- <label>热轧</label>
- <value>H</value>
- </item>
- </choices>
- <script type="javascript" ev:event="xforms-select">
- <![CDATA[
- seleOnClick1();
- ]]>
- </script>
- </select1>
- <button id="button3" class="butt_4" style="left:765px; top:30px; width:63px; height:22px; ">
- <caption>发送</caption>
- <script type="javascript" ev:event="onclick">
- <![CDATA[
- send();
- ]]>
- </script>
- </button>
- <input id="input1" ref="/root/formData/TC_NAME" style="left:380px; top:5px; width:225px; height:20px; "/>
- <button id="button1" class="butt_6" style="left:575px; top:30px; width:88px; height:19px; ">
- <caption>L2 EDIT</caption>
- <script type="javascript" ev:event="onclick">
- <![CDATA[
- L2_EDIT();
- ]]>
- </script>
- </button>
- <input id="input2" ref="/root/formData/MAT_NO" style="left:474px; top:30px; width:100px; height:20px; "/>
- <button id="button2" style="left:385px; top:30px; width:85px; height:20px; ">
- <caption>材料号:</caption>
- </button>
- <input id="input3" ref="/root/formData/TC_ID" style="left:245px; top:5px; width:115px; height:20px; ">
- <script type="javascript" ev:event="onclick">
- <![CDATA[
- call_left_UIG060031();
- ]]>
- </script>
- </input>
- <button id="button4" style="left:270px; top:30px; width:100px; height:20px; ">
- <caption>button4</caption>
- <script type="javascript" ev:event="onclick">
- <![CDATA[
- sendChem();
- ]]>
- </script>
- </button>
- <textarea id="textarea1" ref="/root/msgData" style="left:25px; top:520px; width:825px; height:95px; "/>
- <button id="button5" style="left:865px; top:560px; width:100px; height:20px; ">
- <caption>赋值</caption>
- <script type="javascript" ev:event="onclick">
- <![CDATA[
- var sTcId = model.getValue("/root/formData/TC_ID");
- if ( sTcId == null || sTcId == "" ) {
- alert(" @@@@ Please enter TC_ID @@@@ " );
- return;
- }
- var msgData = model1.getValue("/root/msgData");
- if (model1.getValue("/root/formData/PROC_CD") == "S") {
- msgData = sTcId + new Date().format("yyyyMMddhhmmss") + msgData;
- } else {
- msgData = sTcId + new Date().format("yyyyMMddhhmmss") + msgData.substring(40);
- }
- var length = msgData.length;
- var dataCnt = datagrid1.rows - datagrid1.fixedRows;
- var idx = 0;
- var col1 = datagrid1.colRef("DATA_LEN");
- var col2 = datagrid1.colRef("DATA_VALUE");
- for (var i=1 ; i <= dataCnt; i++ ) {
- var len1 = idx + parseInt(datagrid1.valueMatrix(i, col1));
- if (len1 > length) break;
- datagrid1.valueMatrix(i, col2) = msgData.substring(idx, len1);
- idx = len1;
- }
- //datagrid1.refresh();
- ]]>
- </script>
- </button>
- </xhtml:body>
- </xhtml:html>
|