b3bba1e75e124f9cf5198259bc7e4d4e00dcd0d0.svn-base 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <?xml-stylesheet href="../../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>Untitle</xhtml:title>
  6. <model id="model1">
  7. <instance id="instance1">
  8. <root xmlns="">
  9. <formData>
  10. <SLAB_NO/>
  11. <CCM_NO/>
  12. <FLOW_NO/>
  13. </formData>
  14. <gridData>
  15. <grid1/>
  16. <grid2/>
  17. </gridData>
  18. <reqData/>
  19. </root>
  20. </instance>
  21. <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"/>
  22. </model>
  23. <script type="javascript" src="../../js/boaCommon.js"/>
  24. <script type="javascript">
  25. <![CDATA[
  26. function find()
  27. {
  28. commSendReq("/root/formData");
  29. commSubmit("UIG050020-service","find","glueAction.do");
  30. model.copyNode("/root/gridData/grid1","/root/resData/WEIGHT_INFO_RST_VO");
  31. model.copyNode("/root/gridData/grid2","/root/resData/SLAB_INFO_RST_VO");
  32. model.refresh();
  33. //if(combo2.value =='3')//三号铸机暂时不稳定
  34. //var rows = datagrid2.Rows -1 ;
  35. //var WGTValue = null;
  36. // for(var i = rows; i >= 1; i--)
  37. // {
  38. // WGTValue = datagrid2.valueMatrix(i, 2);
  39. // if(WGTValue < 9000)
  40. // {
  41. // datagrid2.deleteRow(i,false);
  42. // }
  43. // }
  44. //model.refresh();
  45. }
  46. //选择
  47. function selectAll(datagrid)
  48. {
  49. var endRow = datagrid.row;
  50. var startRow = "0";
  51. for(var i = 0 ; i < datagrid.rows - datagrid.fixedRows +1; i++)
  52. {
  53. if(datagrid.valueMatrix(i,datagrid.colRef("CHK")) == "Y" && i != datagrid.row)
  54. {
  55. startRow = i;
  56. }
  57. }
  58. if(startRow == "0")
  59. {
  60. return;
  61. }
  62. if(startRow > endRow)
  63. {
  64. var temp = startRow;
  65. startRow = endRow;
  66. endRow = temp;
  67. }
  68. for(var i = startRow; i<= endRow;i++)
  69. {
  70. datagrid.valueMatrix(i,datagrid.colRef("CHK")) = "Y";
  71. datagrid.rowStatus(i) = '1';
  72. }
  73. model.refresh();
  74. }
  75. //选择确定
  76. function copySlabWgt()
  77. {
  78. var chkCnt1 = 0;
  79. var chkCnt2 = 0;
  80. for(var i = 0 ; i < datagrid1.rows - datagrid1.fixedRows +1 ; i++)
  81. {
  82. if(datagrid1.valueMatrix(i,datagrid1.colRef("CHK")) == "Y")
  83. {
  84. chkCnt1 = chkCnt1 +1;
  85. }
  86. }
  87. for(var j = 0 ; j < datagrid2.rows - datagrid2.fixedRows + 1; j++)
  88. {
  89. //alert("------------j========" + j);
  90. if(datagrid2.valueMatrix(j,datagrid2.colRef("CHK")) == "Y")
  91. {
  92. chkCnt2 = chkCnt2 + 1;
  93. }
  94. }
  95. if(chkCnt1 != chkCnt2){
  96. alert("选择坯料块数不匹配!");
  97. return;
  98. }
  99. for(var i = 0 ; i < datagrid1.rows - datagrid1.fixedRows +1 ; i++)
  100. {
  101. if(datagrid1.valueMatrix(i,datagrid1.colRef("CHK")) == "Y")
  102. { //alert("-----i ===" + i);
  103. for(var j = 0 ; j < datagrid2.rows - datagrid2.fixedRows + 1; j++)
  104. {
  105. //alert("------------j========" + j);
  106. if(datagrid2.valueMatrix(j,datagrid2.colRef("CHK")) == "Y" ) //&& datagrid2.valueMatrix(j,datagrid2.colRef("CHK2")) == ""
  107. {
  108. datagrid1.valueMatrix(i,datagrid1.colRef("WEIGHT_WGT"))= datagrid2.valueMatrix(j,datagrid2.colRef("WEIGHT"));
  109. datagrid1.valueMatrix(i,datagrid1.colRef("SAMPLINGID"))= datagrid2.valueMatrix(j,datagrid2.colRef("SAMPLINGID"));
  110. datagrid2.valueMatrix(j,datagrid2.colRef("CHK")) = "N";
  111. break;
  112. }
  113. }
  114. }
  115. }
  116. }
  117. //保存
  118. function receive()
  119. {
  120. model.removenode("/root/reqData");
  121. model.makeNode("/root/reqData");
  122. commMultiUpdate(datagrid1,"/root/reqData","A",true,"rowStatus");
  123. commSubmit("UIG050020-service","get","glueAction.do");
  124. find();
  125. }
  126. //保存
  127. function save()
  128. {
  129. model.removenode("/root/reqData");
  130. model.makeNode("/root/reqData");
  131. commMultiUpdate(datagrid1,"/root/reqData","A",true,"rowStatus");
  132. model.makeValue("/root/reqData/USER","st002");
  133. model.makeValue("/root/reqData/TYPE","SV");
  134. commSubmit("UIG050020-service","save","glueAction.do");
  135. find();
  136. }
  137. //取消
  138. function cancle()
  139. {
  140. model.removenode("/root/reqData");
  141. model.makeNode("/root/reqData");
  142. commMultiUpdate(datagrid1,"/root/reqData","A",true,"rowStatus");
  143. model.makeValue("/root/reqData/USER","st002");
  144. model.makeValue("/root/reqData/TYPE","CC");
  145. commSubmit("UIG050020-service","save","glueAction.do");
  146. find();
  147. }
  148. function rightClick()
  149. {
  150. var checkValue = model.getValue("/root/formData/SLAB_NO");
  151. if(checkValue == null || checkValue == "")return;
  152. var tstvalue = parseInt(checkValue.substr(4,5),10);
  153. var tailValue = checkValue.substr(9,4);
  154. tstvalue = (tstvalue + 1) + "";
  155. var strLen = tstvalue.length;
  156. checkValue = checkValue.substr(0,4);
  157. for(var i = 0 ; i < (5 - strLen) ; i++){
  158. checkValue = checkValue + "0";
  159. }
  160. checkValue = checkValue + tstvalue + tailValue;
  161. model.setValue("/root/formData/SLAB_NO",checkValue);
  162. find();
  163. }
  164. function leftClick()
  165. {
  166. var checkValue = model.getValue("/root/formData/SLAB_NO");
  167. if(checkValue == null || checkValue == "")return;
  168. if(checkValue.length < 9){
  169. alert(" 炉次号长度不符! ");
  170. return;
  171. }
  172. var tstvalue = parseInt(checkValue.substr(4,5),10);
  173. var tailValue = checkValue.substr(9,4);
  174. tstvalue = (tstvalue - 1) + "";
  175. var strLen = tstvalue.length;
  176. checkValue = checkValue.substr(0,4);
  177. for(var i = 0 ; i < (5 - strLen) ; i++){
  178. checkValue = checkValue + "0";
  179. }
  180. checkValue = checkValue + tstvalue + tailValue;
  181. model.setValue("/root/formData/SLAB_NO",checkValue);
  182. find();
  183. }
  184. ]]>
  185. </script>
  186. </xhtml:head>
  187. <xhtml:body>
  188. <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; ">
  189. <col ref="SLAB_SIZE"/>
  190. <col ref="STL_GRD"/>
  191. <col ref="SLAB_NO"/>
  192. <col ref="SLAB_WGT"/>
  193. <col ref="WEIGHT_WGT" type="input"/>
  194. <col checkvalue="Y,N" ref="CHK" type="checkbox"/>
  195. <col ref="SAMPLINGID" visibility="visible"/>
  196. <script type="javascript" ev:event="xforms-select">
  197. <![CDATA[
  198. selectAll(datagrid1);
  199. ]]>
  200. </script>
  201. </datagrid>
  202. <datagrid id="datagrid2" nodeset="/root/gridData/grid1/WEIGHT_INFO_RST_Row" caption="选择^顺序号^坯料重量&#xA;^称重时间^铸机号&#xA;^铸流号&#xA;^caption1" colsep="^" colwidth="40, 88, 65, 122, 45, 49, 100" mergecellsfixedrows="bycolrec" rowsep="|" style="left:510px; top:40px; width:430px; height:380px; ">
  203. <col checkvalue="Y,N" ref="CHK" type="checkbox"/>
  204. <col ref="SAMPLINGID"/>
  205. <col ref="WEIGHT"/>
  206. <col ref="SAMPLINGTIME"/>
  207. <col ref="CCMID"/>
  208. <col ref="FLOWNO"/>
  209. <col ref="CHK2" visibility="hidden"/>
  210. <script type="javascript" ev:event="xforms-select">
  211. <![CDATA[
  212. selectAll(datagrid2);
  213. ]]>
  214. </script>
  215. <script type="javascript" ev:event="onclick">
  216. <![CDATA[
  217. //window.alert(datagrid2.valueMatrix(datagrid2.row, datagrid2.colRef("WEIGHT")))
  218. /* if(combo2.value =='3')//三号铸机暂时不稳定
  219. var rows = datagrid2.Rows -1 ;
  220. var WGTValue = null;
  221. for(var i = rows; i >= 1; i--)
  222. {
  223. WGTValue = datagrid2.valueMatrix(i, 2);
  224. if(WGTValue < 9000)
  225. {
  226. datagrid2.deleteRow(i,false);
  227. }
  228. }
  229. model.refresh();
  230. */
  231. ]]>
  232. </script>
  233. <script type="javascript" ev:event="ondblclick">
  234. <![CDATA[
  235. /* if(combo2.value =='3')//三号铸机暂时不稳定
  236. var rows = datagrid2.Rows -1 ;
  237. var WGTValue = null;
  238. for(var i = rows; i >= 1; i--)
  239. {
  240. WGTValue = datagrid2.valueMatrix(i, 2);
  241. if(WGTValue < 9000)
  242. {
  243. datagrid2.deleteRow(i,false);
  244. }
  245. }
  246. model.refresh(); */
  247. ]]>
  248. </script>
  249. </datagrid>
  250. <button id="button1" style="left:755px; top:10px; width:50px; height:20px; ">
  251. <caption>查询</caption>
  252. <script type="javascript" ev:event="DOMActivate">
  253. <![CDATA[
  254. find();
  255. ]]>
  256. </script>
  257. </button>
  258. <button id="button2" style="left:465px; top:110px; width:44px; height:90px; ">
  259. <caption>选择</caption>
  260. <script type="javascript" ev:event="DOMActivate">
  261. <![CDATA[
  262. copySlabWgt();
  263. ]]>
  264. </script>
  265. </button>
  266. <button id="button3" style="left:805px; top:10px; width:55px; height:20px; ">
  267. <caption>保存</caption>
  268. <script type="javascript" ev:event="DOMActivate">
  269. <![CDATA[
  270. save();
  271. ]]>
  272. </script>
  273. </button>
  274. <button id="button4" style="left:860px; top:10px; width:44px; height:20px; ">
  275. <caption>取消</caption>
  276. <script type="javascript" ev:event="DOMActivate">
  277. <![CDATA[
  278. cancle();
  279. ]]>
  280. </script>
  281. </button>
  282. <caption id="caption3" class="cell" style="left:0px; top:5px; width:74px; height:20px; font-weight:bold; border-color:#000000; ">板坯号</caption>
  283. <select1 id="combo1" ref="/root/formData/SLAB_NO" appearance="minimal" editmode="input" style="left:70px; top:5px; width:110px; height:20px; border-color:#000000; ">
  284. <choices>
  285. <itemset nodeset="/root/comboData/slab_no/SLAB_NO_INIT_RES_Row">
  286. <label ref="LABEL"/>
  287. <value ref="VALUE"/>
  288. </itemset>
  289. </choices>
  290. </select1>
  291. <button id="button5" style="left:205px; top:7px; width:20px; height:20px; background-image:../../images/cal_next_m.gif; ">
  292. <caption/>
  293. <script type="javascript" ev:event="DOMActivate">
  294. <![CDATA[
  295. rightClick();
  296. ]]>
  297. </script>
  298. </button>
  299. <button id="button6" style="left:180px; top:7px; width:20px; height:20px; background-image:../../images/cal_pre_m.gif; ">
  300. <caption/>
  301. <script type="javascript" ev:event="DOMActivate">
  302. <![CDATA[
  303. leftClick();
  304. ]]>
  305. </script>
  306. </button>
  307. <select1 id="combo2" ref="/root/formData/CCM_NO" appearance="minimal" editmode="input" style="left:300px; top:5px; width:75px; height:20px; border-color:#000000; ">
  308. <choices>
  309. <item>
  310. <label>1号铸机</label>
  311. <value>1</value>
  312. </item>
  313. <item>
  314. <label>2号铸机</label>
  315. <value>2</value>
  316. </item>
  317. <item>
  318. <label>3号铸机</label>
  319. <value>3</value>
  320. </item>
  321. </choices>
  322. </select1>
  323. <caption id="caption1" class="cell" style="left:230px; top:5px; width:74px; height:20px; font-weight:bold; border-color:#000000; ">连铸机号</caption>
  324. <caption id="caption2" class="cell" style="left:380px; top:5px; width:74px; height:20px; font-weight:bold; border-color:#000000; ">流号</caption>
  325. <select1 id="combo3" ref="/root/formData/FLOW_NO" appearance="minimal" editmode="input" style="left:450px; top:5px; width:50px; height:20px; border-color:#000000; ">
  326. <choices>
  327. <item>
  328. <label>1流</label>
  329. <value>1</value>
  330. </item>
  331. <item>
  332. <label>2流</label>
  333. <value>2</value>
  334. </item>
  335. </choices>
  336. </select1>
  337. <button id="button7" style="left:685px; top:10px; width:75px; height:20px; ">
  338. <caption>接收</caption>
  339. <script type="javascript" ev:event="DOMActivate">
  340. <![CDATA[
  341. receive();
  342. ]]>
  343. </script>
  344. </button>
  345. </xhtml:body>
  346. </xhtml:html>