UIG060030.xrw 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <?xml-stylesheet href="D:/GlueDev/work/xgmes3/WebContents/css/body.css" type="text/css" ?>
  3. <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">
  4. <xhtml:head>
  5. <xhtml:title>
  6. <![CDATA[炼钢作业 >> 炼钢标准 >> 二级接口电文测试(UIG060030)]]>
  7. </xhtml:title>
  8. <model id="model1">
  9. <instance id="instance1">
  10. <root xmlns="">
  11. <dataGrid>
  12. <SEQ_NO/>
  13. <MSG_ID/>
  14. <MSG_NAME/>
  15. <DATA_TYPE/>
  16. <DATA_LEN/>
  17. <DATA_VALUE/>
  18. </dataGrid>
  19. <formData>
  20. <TC_ID/>
  21. <PROC_CD>H</PROC_CD>
  22. <TC_NAME/>
  23. <MAT_NO/>
  24. </formData>
  25. <reqData/>
  26. <resData/>
  27. <initData>
  28. <INIT_TC_ID/>
  29. <INIT_TC_NAME/>
  30. </initData>
  31. <sendInfo/>
  32. <datagrid1/>
  33. <AUTO/>
  34. <tempData1/>
  35. <tempData2/>
  36. <msgData/>
  37. </root>
  38. </instance>
  39. <script type="javascript" ev:event="xforms-ready">
  40. <![CDATA[
  41. //initPage();
  42. ]]>
  43. </script>
  44. </model>
  45. <script type="javascript">
  46. <![CDATA[
  47. /*
  48. * 初始化 函数
  49. */
  50. function initPage()
  51. {
  52. commSubmit("UIG060030-service","success","glueAction.do");
  53. commAppendData("/root/initData/INIT_TC_ID/InitDataResult_VO","/root/resData/InitDataResult_VO");
  54. model.refresh()
  55. }
  56. function seleOnClick1()
  57. {
  58. model.removenode("/root/reqData");
  59. model.makeNode("/root/reqData");
  60. model.duplicate("/root/reqData","/root/formData/PROC_CD");
  61. commSubmit("UIG060030-service","success","glueAction.do");
  62. commAppendData("/root/initData/INIT_TC_ID/InitDataResult_VO","/root/resData/InitDataResult_VO");
  63. model.refresh()
  64. }
  65. function seleOnClick2()
  66. {
  67. model.removenode("/root/reqData");
  68. model.makeNode("/root/reqData");
  69. model.duplicate("/root/reqData","/root/formData/TC_ID");
  70. commSubmit("UIG060030-service","tcfind","glueAction.do");
  71. model1.setValue("/root/formData/TC_NAME",model1.getValue("/root/resData/TcNmResult_VO/TcNmResult_Row/TC_NAME"));
  72. // alert("aa:"+model.getValue("/root/formData/TC_NAME/TcNmResult_VO"));
  73. model.refresh()
  74. }
  75. function send()
  76. {
  77. model.removenode("/root/reqData");
  78. model.makeNode("/root/reqData");
  79. var dataCnt = datagrid1.rows - datagrid1.fixedRows;
  80. for (var i=1; i <= dataCnt; i++ ) {
  81. datagrid1.valueMatrix(i,datagrid1.colRef("CHK")) = "Y";
  82. datagrid1.rowStatus(i) = 1;
  83. }
  84. commMultiUpdate(datagrid1,"/root/reqData","A",true,"rowStatus");
  85. commSubmit("UIG060030-service","send","glueAction.do");
  86. if (model.getValue("/root/resData/errorData") != "")
  87. alert("异常:" + model.getValue("/root/resData/errorData"));
  88. else
  89. alert(" @@@ 发送成功 @@@ ");
  90. model.refresh();
  91. }
  92. function find()
  93. {
  94. model.removenode("/root/reqData");
  95. model.makeNode("/root/reqData");
  96. model.duplicate("/root/reqData","/root/formData/TC_ID");
  97. model.removenode("/root/datagrid1");
  98. model.makeNode("/root/datagrid1");
  99. var sTcId = model.getValue("/root/formData/TC_ID");
  100. if ( sTcId == null || sTcId == "" ) {
  101. alert(" @@@@ 请选择电文ID @@@@ " );
  102. } else {
  103. commSubmit("UIG060030-service","find","glueAction.do");
  104. commAppendData("/root/datagrid1/MessageEdit_VO","/root/resData/MessageEdit_VO");
  105. // alert(sTcId);
  106. // datagrid1.cellattribute("maxlength",datagrid1.fixedRows, col, datagrid1.rows - 1, col) = "1";
  107. model.setValue(datagrid1.nodeset + "[" + 1 + "]/DATA_VALUE",sTcId );
  108. model.refresh();
  109. }
  110. }
  111. function save()
  112. {
  113. model.removenode("/root/reqData");
  114. model.makeNode("/root/reqData");
  115. var dataCnt = datagrid1.rows - datagrid1.fixedRows;
  116. for (var i=1 ; i <= dataCnt; i++ ) {
  117. datagrid1.valueMatrix(i,datagrid1.colRef("CHK")) = "Y";
  118. datagrid1.rowStatus(i) = 1;
  119. }
  120. commMultiUpdate(datagrid1,"/root/reqData","A",true,"rowStatus");
  121. commSubmit("UIG060030-service","save","glueAction.do");
  122. var TcId = model.getValue("/root/formData/TC_ID");
  123. alert("("+TcId+"): 电文 ID @@@ 保存成功 @@@ ");
  124. model.refresh();
  125. }
  126. function setLen(row,maxlen)
  127. {
  128. var Len = maxlen;
  129. datagrid1.cellAttribute("maxlength", row, 6,row,6) = Len;
  130. }
  131. function L2_EDIT()
  132. {
  133. model.removenode("/root/reqData");
  134. model.makeNode("/root/reqData");
  135. model.duplicate("/root/reqData","/root/formData/TC_ID");
  136. model.duplicate("/root/reqData","/root/formData/MAT_NO");
  137. model.removenode("/root/datagrid1");
  138. model.makeNode("/root/datagrid1");
  139. var sTcId = model.getValue("/root/formData/TC_ID");
  140. if ( sTcId == null || sTcId == "" ) {
  141. alert(" @@@@ Please enter TC_ID @@@@ " );
  142. } else {
  143. commSubmit("UIG060030-service","l2edit","glueAction.do");
  144. commAppendData("/root/datagrid1/MessageEdit_VO","/root/resData/MessageEdit_VO");
  145. // alert(sTcId);
  146. // datagrid1.cellattribute("maxlength",datagrid1.fixedRows, col, datagrid1.rows - 1, col) = "1";
  147. model.refresh();
  148. }
  149. }
  150. function L2_DATA_RECV()
  151. {
  152. model.removenode("/root/reqData");
  153. model.makeNode("/root/reqData");
  154. commSubmit("UIG060030-service","l2recv","glueAction.do");
  155. commAppendData("/root/datagrid1/MessageEdit_VO","/root/resData/MessageEdit_VO");
  156. // alert(sTcId);
  157. // datagrid1.cellattribute("maxlength",datagrid1.fixedRows, col, datagrid1.rows - 1, col) = "1";
  158. model.refresh();
  159. }
  160. function select()
  161. {
  162. model.removenode("/root/reqData");
  163. model.makeNode("/root/reqData");
  164. commSubmit("UIG060030-service","recieve","glueAction.do");
  165. model.refresh();
  166. }
  167. function call_left_UIG060031()
  168. {
  169. if(model.getValue("/root/formData/PROC_CD") != "" && model.getValue("/root/formData/PROC_CD") != null){
  170. var factCd = model1.getValue("/root/formData/PROC_CD");
  171. model1.setValue("/root/tempData1",factCd);
  172. }
  173. window.load("UIG060031.xrw","modal","", "left:228; top:78; width:420; height:480; sysmenu:visible; min:visible; max:true; resize:true; caption:visible;");
  174. model1.setValue("/root/formData/TC_ID",model1.getValue("/root/tempData1"));
  175. model1.setValue("/root/formData/TC_NAME",model1.getValue("/root/tempData2"));
  176. model1.removenode("/root/tempData1");
  177. model1.removenode("/root/tempData2");
  178. model1.makeNode("/root/tempData1");
  179. model1.makeNode("/root/tempData2");
  180. input1.refresh();
  181. input3.refresh();
  182. }
  183. function sendChem()
  184. {
  185. model.removenode("/root/reqData");
  186. model.makeNode("/root/reqData");
  187. commSubmit("UIG060030-service","chem","glueAction.do");
  188. // alert(sTcId);
  189. // datagrid1.cellattribute("maxlength",datagrid1.fixedRows, col, datagrid1.rows - 1, col) = "1";
  190. model.refresh();
  191. }
  192. var clockTimer;
  193. /**
  194. * 时间对象的格式化;
  195. */
  196. Date.prototype.format = function(format) {
  197. /*
  198. * eg:format="YYYY-MM-dd hh:mm:ss";
  199. */
  200. var o = {
  201. "M+" : this.getMonth()+1, //month
  202. "d+" : this.getDate(), //day
  203. "h+" : this.getHours(), //hour
  204. "m+" : this.getMinutes(), //minute
  205. "s+" : this.getSeconds(), //second
  206. "q+" : Math.floor((this.getMonth()+3)/3), //quarter
  207. "S" : this.getMilliseconds() //millisecond
  208. }
  209. if(/(y+)/.test(format)) {
  210. format = format.replace(RegExp.$1, (this.getFullYear()+"").substr(4 - RegExp.$1.length));
  211. }
  212. for(var k in o) {
  213. if(new RegExp("("+ k +")").test(format)) {
  214. format = format.replace(RegExp.$1, RegExp.$1.length==1 ? o[k] : ("00"+ o[k]).substr((""+ o[k]).length));
  215. }
  216. }
  217. return format;
  218. }
  219. ]]>
  220. </script>
  221. <script type="javascript" src="../../js/boaCommon.js"/>
  222. <script type="javascript" src="../../js/g02.js"/>
  223. </xhtml:head>
  224. <xhtml:body overflow="hidden" pagewidth="980" pageheight="620" style="font-family:宋体; ">
  225. <caption id="caption1" class="cell" style="left:22px; top:5px; width:60px; height:20px; vertical-align:middle; border-color:#000000; ">工厂区分</caption>
  226. <caption id="caption2" class="cell" style="left:167px; top:5px; width:80px; height:20px; vertical-align:middle; border-color:#000000; ">电文 ID</caption>
  227. <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; ">
  228. <col checkvalue="Y,N" ref="CHK" type="checkbox" visibility="hidden"/>
  229. <col ref="SEQ_NO"/>
  230. <col ref="MSG_ID" style="text-align:left; "/>
  231. <col ref="MSG_NAME" style="text-align:left; "/>
  232. <col ref="DATA_TYPE"/>
  233. <col ref="DATA_LEN"/>
  234. <col ref="DATA_VALUE" type="input" style="background-color:#ffff99; "/>
  235. <script type="javascript" ev:event="ondblclick">
  236. <![CDATA[
  237. setLen(datagrid1.row,model.getValue(datagrid1.nodeset + "[" +datagrid1.row+ "]/DATA_LEN"));
  238. ]]>
  239. </script>
  240. </datagrid>
  241. <select1 id="combo1" ref="/root/formData/PROC_CD" appearance="minimal" style="left:82px; top:5px; width:75px; height:20px; ">
  242. <choices>
  243. <item>
  244. <label>炼钢</label>
  245. <value>S</value>
  246. </item>
  247. <item>
  248. <label>热轧</label>
  249. <value>H</value>
  250. </item>
  251. </choices>
  252. <script type="javascript" ev:event="xforms-select">
  253. <![CDATA[
  254. seleOnClick1();
  255. ]]>
  256. </script>
  257. </select1>
  258. <button id="button3" class="butt_4" style="left:765px; top:30px; width:63px; height:22px; ">
  259. <caption>发送</caption>
  260. <script type="javascript" ev:event="onclick">
  261. <![CDATA[
  262. send();
  263. ]]>
  264. </script>
  265. </button>
  266. <input id="input1" ref="/root/formData/TC_NAME" style="left:380px; top:5px; width:225px; height:20px; "/>
  267. <button id="button1" class="butt_6" style="left:575px; top:30px; width:88px; height:19px; ">
  268. <caption>L2 EDIT</caption>
  269. <script type="javascript" ev:event="onclick">
  270. <![CDATA[
  271. L2_EDIT();
  272. ]]>
  273. </script>
  274. </button>
  275. <input id="input2" ref="/root/formData/MAT_NO" style="left:474px; top:30px; width:100px; height:20px; "/>
  276. <button id="button2" style="left:385px; top:30px; width:85px; height:20px; ">
  277. <caption>材料号:</caption>
  278. </button>
  279. <input id="input3" ref="/root/formData/TC_ID" style="left:245px; top:5px; width:115px; height:20px; ">
  280. <script type="javascript" ev:event="onclick">
  281. <![CDATA[
  282. call_left_UIG060031();
  283. ]]>
  284. </script>
  285. </input>
  286. <button id="button4" style="left:270px; top:30px; width:100px; height:20px; ">
  287. <caption>button4</caption>
  288. <script type="javascript" ev:event="onclick">
  289. <![CDATA[
  290. sendChem();
  291. ]]>
  292. </script>
  293. </button>
  294. <textarea id="textarea1" ref="/root/msgData" style="left:25px; top:520px; width:825px; height:95px; "/>
  295. <button id="button5" style="left:865px; top:560px; width:100px; height:20px; ">
  296. <caption>赋值</caption>
  297. <script type="javascript" ev:event="onclick">
  298. <![CDATA[
  299. var sTcId = model.getValue("/root/formData/TC_ID");
  300. if ( sTcId == null || sTcId == "" ) {
  301. alert(" @@@@ Please enter TC_ID @@@@ " );
  302. return;
  303. }
  304. var msgData = model1.getValue("/root/msgData");
  305. if (model1.getValue("/root/formData/PROC_CD") == "S") {
  306. msgData = sTcId + new Date().format("yyyyMMddhhmmss") + msgData;
  307. } else {
  308. msgData = sTcId + new Date().format("yyyyMMddhhmmss") + msgData.substring(40);
  309. }
  310. var length = msgData.length;
  311. var dataCnt = datagrid1.rows - datagrid1.fixedRows;
  312. var idx = 0;
  313. var col1 = datagrid1.colRef("DATA_LEN");
  314. var col2 = datagrid1.colRef("DATA_VALUE");
  315. for (var i=1 ; i <= dataCnt; i++ ) {
  316. var len1 = idx + parseInt(datagrid1.valueMatrix(i, col1));
  317. if (len1 > length) break;
  318. datagrid1.valueMatrix(i, col2) = msgData.substring(idx, len1);
  319. idx = len1;
  320. }
  321. //datagrid1.refresh();
  322. ]]>
  323. </script>
  324. </button>
  325. </xhtml:body>
  326. </xhtml:html>