86312563b7c94db01e6271702a76818bafd435b2.svn-base 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <?xml-stylesheet type="text/css" href="../../css/body.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[品质判定>>成分判定>>板坯号成分实绩录入]]>
  7. </xhtml:title>
  8. <model id="model1">
  9. <instance id="instance1">
  10. <root xmlns="">
  11. <formData>
  12. <CHARGENO/>
  13. <PROCCD>JJ</PROCCD>
  14. </formData>
  15. <initChargeData/>
  16. <grid>
  17. <datagrid1/>
  18. <datagrid2/>
  19. <datagrid3/>
  20. <datagrid4/>
  21. <datagrid5/>
  22. <datagrid6/>
  23. </grid>
  24. <tempData>
  25. <tempData1/>
  26. <tempData2/>
  27. <tempData3/>
  28. <tempData4/>
  29. <tempData5/>
  30. </tempData>
  31. <jisuanshi/>
  32. <initProc>
  33. <ProcCDResult_Row>
  34. <LABEL/>
  35. <VALUE/>
  36. </ProcCDResult_Row>
  37. </initProc>
  38. <panding/>
  39. <fwdData>
  40. <UIB020030>
  41. <URL/>
  42. </UIB020030>
  43. </fwdData>
  44. <OtherInfo>
  45. <StlGrdResult_Row>
  46. <STL_GRD/>
  47. <PRODNM_CD/>
  48. <SLAB_RT/>
  49. </StlGrdResult_Row>
  50. </OtherInfo>
  51. <flag>UIB020035</flag>
  52. </root>
  53. </instance>
  54. <script type="javascript" ev:event="xforms-ready">
  55. <![CDATA[
  56. if(window.parent==null) Init();
  57. ]]>
  58. </script>
  59. </model>
  60. <script type="javascript" src="../../js/boaCommon.js"/>
  61. <script type="javascript" src="../../js/b01.js"/>
  62. <script type="javascript">
  63. <![CDATA[
  64. function Init(node)
  65. {
  66. InitParams(node);
  67. datagrid1.colStatus(0)=false; //使表格1中“选择”列不对结果产生影响
  68. //炉次号初始化
  69. commSubmit("UIB020035-service", "success", "glueAction.do");
  70. model.copyNode("/root/initChargeData" , "/root/resData/ChargeNOResult_VO");
  71. ///读取上一次的结果到炉次号中
  72. checkbox1.value = document.readIniFile("session1" , "key2" , "" , "c:\\WINDOWS\\xgmes3.ini");
  73. input40.value = document.readIniFile("session1" , "UIB020035" , "" , "c:\\WINDOWS\\xgmes3.ini") ;
  74. model.refresh();
  75. }
  76. function find()
  77. {
  78. ///获得请求参数
  79. model.removenode("/root/reqData");
  80. model.makeValue("/root/reqData/SLABNO" , input40.value.Trim());//板坯号
  81. ///写入炉次号到文件中
  82. document.writeIniFile("session1" , "key2" , checkbox1.value.Trim() , "c:\\WINDOWS\\xgmes3.ini");
  83. document.writeIniFile("session1" , "UIB020035" , input40.value.Trim() , "c:\\WINDOWS\\xgmes3.ini");
  84. ///submit
  85. commSubmit("UIB020035-service", "findSlabInfo", "glueAction.do");
  86. //厂内钢号
  87. // input1.value = model.getValue("/root/resData/StlGrdResult_VO/StlGrdResult_Row/STL_GRD");//厂内钢号
  88. // input3.value = model.getValue("/root/resData/StlGrdResult_VO/StlGrdResult_Row/PRODNM_CD");//交货状态
  89. // combo1.value = model.getValue("/root/resData/StlGrdResult_VO/StlGrdResult_Row/SLAB_RT");//生产线
  90. model.copyNode("/root/OtherInfo" , "/root/resData/StlGrdResult_VO");
  91. ///copy to datagrid1
  92. model.copyNode("/root/grid/datagrid1" , "/root/resData/SlabList_VO");
  93. model.copyNode("/root/grid/datagrid6" , "/root/resData/XSlabResult_VO");
  94. removeGridData();//清除表2、3、4、5数据
  95. model.refresh();
  96. //恢复被改变的颜色
  97. datagrid2.rebuildStyle();
  98. datagrid3.rebuildStyle();
  99. datagrid4.rebuildStyle();
  100. datagrid5.rebuildStyle();
  101. datagrid1.clearStatus();
  102. datagrid2.clearStatus();
  103. datagrid3.clearStatus();
  104. datagrid4.clearStatus();
  105. datagrid5.clearStatus();
  106. }
  107. var selectRow = 0;//用于保存表1中查询的列
  108. function save()
  109. {
  110. if(checkbox1.value=="Y")
  111. {
  112. if(commComfirmBox("确认判定?","提示")=="0") return;
  113. }
  114. else
  115. {
  116. if(commComfirmBox("确认保存?","提示")=="0") return;
  117. }
  118. model.removenode("/root/reqData");
  119. model.makeNode("/root/reqData");
  120. model.removenode("/root/tempData");
  121. model.makeNode("/root/tempData/tempData1");
  122. model.makeNode("/root/tempData/tempData2");
  123. model.makeNode("/root/tempData/tempData3");
  124. model.makeNode("/root/tempData/tempData4");
  125. model.makeNode("/root/tempData/tempData5");
  126. model.makeNode("/root/tempData/tempData6");
  127. ///生成请求参数
  128. b01MultiUpdate(datagrid1,"/root/tempData/tempData1" ,"A", true, "rowStuts1");//获得表1中增加的记录
  129. b01MultiUpdate(datagrid2,"/root/tempData/tempData2" ,"A", true, "rowStuts2");//表2
  130. b01MultiUpdate(datagrid3,"/root/tempData/tempData3" ,"A", true, "rowStuts2");//表3
  131. b01MultiUpdate(datagrid4,"/root/tempData/tempData4" ,"A", true, "rowStuts2");//表4
  132. b01MultiUpdate(datagrid5,"/root/tempData/tempData5" ,"A", true, "rowStuts2");//表5
  133. b01MultiUpdate(datagrid6,"/root/tempData/tempData6" ,"A", true, "rowStuts3");//表6
  134. commSendReq("/root/tempData/tempData1","/root/tempData/tempData2","/root/tempData/tempData3","/root/tempData/tempData4","/root/tempData/tempData5" , "/root/tempData/tempData6");
  135. //仅在表2、3、4、5被更新时其作用,成分判定时炉号也起作用;在更新或插入后的查询也起来作用
  136. model.makeValue("/root/reqData/SLABNO" , datagrid1.valueMatrix(selectRow , 1));//板坯号
  137. model.makeValue("/root/reqData/SEQ" , datagrid1.valueMatrix(selectRow , 2));//次数
  138. model.makeValue("/root/reqData/STLGRD" , input1.value);//厂内牌号
  139. model.makeValue("/root/reqData/FACCODE", combo1.value);//板坯取向
  140. getLoggingInInfo();//获取登录人信息
  141. if(checkbox1.value=="Y")
  142. {
  143. model.makeValue("/root/reqData/XX" , "UIB020035");//成分判定标识
  144. }
  145. commSubmit("UIB020035-service", "save", "glueAction.do");
  146. copyFixNode("/root/grid/datagrid2","/root/resData/SingleChem_VO/SingleChem_Row",1 , 13);//表2
  147. copyFixNode("/root/grid/datagrid3","/root/resData/SingleChem_VO/SingleChem_Row",14, 26);//表3
  148. copyFixNode("/root/grid/datagrid4","/root/resData/SingleChem_VO/SingleChem_Row",27,50);//表4
  149. model.copyNode("/root/grid/datagrid5" , "/root/resData/CompChem_VO");//表5
  150. model.refresh();
  151. changeColor(datagrid2);
  152. changeColor(datagrid3);
  153. changeColor(datagrid4);
  154. changeColor(datagrid5);
  155. datagrid1.clearStatus();
  156. datagrid2.clearStatus();
  157. datagrid3.clearStatus();
  158. datagrid4.clearStatus();
  159. datagrid5.clearStatus();
  160. exceptionReport();
  161. }
  162. //查询表格1时需要清除表2、3、4、5原来数据
  163. function removeGridData()
  164. {
  165. // model.resetInstanceNode("/root/grid/datagrid2");//清除表2数据
  166. // model.resetInstanceNode("/root/grid/datagrid3");//清除表3数据
  167. // model.resetInstanceNode("/root/grid/datagrid4");//清除表4数据
  168. // model.resetInstanceNode("/root/grid/datagrid5");//清除表5数据
  169. model.removenode("/root/grid/datagrid2");
  170. model.removenode("/root/grid/datagrid3");
  171. model.removenode("/root/grid/datagrid4");
  172. model.removenode("/root/grid/datagrid5");
  173. model.makeNode("/root/grid/datagrid2");
  174. model.makeNode("/root/grid/datagrid3");
  175. model.makeNode("/root/grid/datagrid4");
  176. model.makeNode("/root/grid/datagrid5");
  177. }
  178. //不合格项变为红色
  179. function changeColor(grid)
  180. {
  181. var valCol = grid.colRef("CHEM_VAL");//实绩值做在列
  182. var minCol = grid.colRef("CHEM_MIN");//最小值的列
  183. var maxCol = grid.colRef("CHEM_MAX");//最大值的列
  184. grid.colstyle(valCol, "data", "background-color") = "#ffff99";//恢复初始的黄色再染色
  185. var min = "";
  186. var max = "";
  187. var val = "";
  188. for(var i = 1; i < grid.rows; i++)
  189. {
  190. min = grid.valueMatrix(i , minCol);//成分最小
  191. max = grid.valueMatrix(i , maxCol);//最大
  192. val = grid.valueMatrix(i , valCol);//实绩
  193. if(val != "" && min !="" && parseFloat(min) > parseFloat(val) )//实绩值应大于等于指示最小值,否则不合格
  194. {
  195. grid.cellStyle("background-color" , i , valCol) = "#ff0000";
  196. }
  197. if(val != "" && max != "" && parseFloat(max) < parseFloat(val))//实绩值应小于等于指示最大值,否则不合格
  198. {
  199. grid.cellStyle("background-color" , i , valCol) = "#ff0000";
  200. }
  201. if(val =="" && (max != "" || min !="") )
  202. {
  203. grid.cellStyle("background-color" , i , valCol) = "#cc99ff";
  204. }
  205. }
  206. }
  207. var value;//用于保存最终的计算值
  208. function calculateChem(grid)
  209. {
  210. var storChem;//保存每一个元素
  211. var chemCal = datagrid5.valueMatrix(datagrid5.row , datagrid5.colRef("COMP_CAL"));//保存复合元素计算式
  212. var chemRow = grid.colRef("CHEM_CD");//元素名所在列
  213. var chemVal = grid.colRef("CHEM_VAL"); //元素值所在列
  214. for(var i = grid.fixedRows; i < grid.rows; i++)
  215. {
  216. storChem = grid.valueMatrix(i , chemRow);
  217. chemCal = chemCal.replaceAll(storChem , grid.valueMatrix(i , chemVal)==""?0:grid.valueMatrix(i , chemVal));
  218. }
  219. value = eval(chemCal.replaceAll("=" , ""));
  220. }
  221. var count = 0;//控制表格2、3、4最后一次的回车数,若值变为2则跳到下一个表格
  222. ]]>
  223. </script>
  224. </xhtml:head>
  225. <xhtml:body accesskey="f2" pagewidth="980" pageheight="620" guideline="1,980;1,980;" style="text-align:center; ">
  226. <datagrid id="datagrid1" nodeset="/root/grid/datagrid1/SlabList_Row" caption="选择^板坯号^次数^是否已发质保书" colsep="^" colwidth="43, 117, 45, 44" defaultrows="35" mergecellsfixedrows="bycolrec" rowsep="|" style="left:0px; top:60px; width:265px; height:530px; ">
  227. <col checkvalue="Y,N" ref="CHK" type="checkbox"/>
  228. <col ref="SLAB_NO" style="font-weight:bold; "/>
  229. <col ref="CHEM_SEQ" style="left:80px; top:20px; width:30px; height:20px; font-weight:bold; "/>
  230. <col ref="UPDATE_NO_TP" visibility="hidden"/>
  231. <script type="javascript" ev:event="ondblclick">
  232. <![CDATA[
  233. // datagrid1.editCell();
  234. if(datagrid1.row > 0) //若双击的不是标题行
  235. {
  236. selectRow = datagrid1.row;//selectRow为全局变量
  237. ///获得请求参数
  238. model.removenode("/root/reqData");
  239. commSendReq("/root/grid/datagrid1/SlabList_Row["+datagrid1.row+"]"); //当前行的请求参数
  240. model.makeValue("/root/reqData/STL_GRD" , input1.value);//厂内排号
  241. model.makeValue("/root/reqData/FAC_CODE", combo1.value);//板坯去向
  242. ///submit
  243. commSubmit("UIB020035-service", "findIngr", "glueAction.do");
  244. copyFixNode("/root/grid/datagrid2","/root/resData/SingleChem_VO/SingleChem_Row",1 , 13);//表2
  245. copyFixNode("/root/grid/datagrid3","/root/resData/SingleChem_VO/SingleChem_Row",14, 26);//表3
  246. copyFixNode("/root/grid/datagrid4","/root/resData/SingleChem_VO/SingleChem_Row",27,50);//表4
  247. model.copyNode("/root/grid/datagrid5" , "/root/resData/CompChem_VO");//表5
  248. model.refresh();
  249. changeColor(datagrid2);
  250. changeColor(datagrid3);
  251. changeColor(datagrid4);
  252. changeColor(datagrid5);
  253. }
  254. ]]>
  255. </script>
  256. <script type="javascript" ev:event="onentercell">
  257. <![CDATA[
  258. datagrid1.editCell();
  259. ]]>
  260. </script>
  261. </datagrid>
  262. <datagrid id="datagrid2" nodeset="/root/grid/datagrid2/SingleChem_Row" caption="成分^最小^最大^实绩^EX" colsep="^" colwidth="45, 60, 60, 60, 42" defaultrows="14" mergecellsfixedrows="bycolrec" rowsep="|" selectionmode="free" tooltip="true" style="left:275px; top:35px; width:236px; height:296px; font-family:宋体; ">
  263. <col ref="CHEM_CD" style="font-weight:bold; "/>
  264. <col ref="CHEM_MIN" style="font-weight:bold; "/>
  265. <col ref="CHEM_MAX" style="font-weight:bold; "/>
  266. <col ref="CHEM_VAL" type="input" format="0.9999999" style="font-weight:bold; background-color:#ffff99; "/>
  267. <col ref="EX" visibility="hidden"/>
  268. <script type="javascript" ev:event="onclick">
  269. <![CDATA[
  270. datagrid2.editCell();
  271. ]]>
  272. </script>
  273. <script type="javascript" ev:event="onkeydown">
  274. <![CDATA[
  275. if(event.keyCode==13)//回车事件
  276. {
  277. datagrid2.row++;
  278. if(datagrid2.row == datagrid2.rows-1)//到表格2最后一行时,焦点转移到表格3,并将表格2的焦点移动到第0行
  279. {
  280. count++;
  281. if(count==2)
  282. {
  283. model.setFocus("datagrid3" , true);//设置焦点
  284. datagrid3.col = datagrid3.colRef("CHEM_VAL");//设置表格3的焦点位置
  285. datagrid3.row = 1; //设置表格3的焦点位置
  286. datagrid2.row = 0;
  287. count = 0;//重新归0;为下一个表格准备
  288. }
  289. }
  290. }
  291. if(event.keyCode==109)//"-"事件
  292. {
  293. datagrid2.row--;
  294. datagrid2.endEditCell();
  295. }
  296. if(event.keyCode==107)//"+"事件
  297. {
  298. datagrid2.row++;
  299. datagrid2.endEditCell();
  300. }
  301. ]]>
  302. </script>
  303. <script type="javascript" ev:event="xforms-value-changed">
  304. <![CDATA[
  305. changeColor(datagrid2);
  306. ]]>
  307. </script>
  308. </datagrid>
  309. <datagrid id="datagrid3" nodeset="/root/grid/datagrid3/SingleChem_Row" caption="成分^最小^最大^实绩^EX" colsep="^" colwidth="45, 60, 60, 60, 41" defaultrows="14" mergecellsfixedrows="bycolrec" rowsep="|" selectionmode="free" style="left:516px; top:35px; width:227px; height:296px; ">
  310. <col ref="CHEM_CD" style="font-weight:bold; "/>
  311. <col ref="CHEM_MIN" style="font-weight:bold; "/>
  312. <col ref="CHEM_MAX" style="font-weight:bold; "/>
  313. <col ref="CHEM_VAL" type="input" format="0.9999999" style="font-weight:bold; background-color:#ffff99; "/>
  314. <col ref="EX" visibility="hidden"/>
  315. <script type="javascript" ev:event="onclick">
  316. <![CDATA[
  317. datagrid3.editCell();
  318. ]]>
  319. </script>
  320. <script type="javascript" ev:event="onkeydown">
  321. <![CDATA[
  322. if(event.keyCode==13)
  323. {
  324. datagrid3.row++;
  325. if(datagrid3.row == datagrid3.rows-1)//到表格3最后一行时,焦点转移到表格4,并将表格2的焦点移动到第0行
  326. {
  327. count++;
  328. if(count==2)
  329. {
  330. model.setFocus("datagrid4" , true);//设置焦点
  331. datagrid4.col = datagrid4.colRef("CHEM_VAL");//设置表格4的焦点位置
  332. datagrid4.row = 1; //设置表格4的焦点位置
  333. datagrid3.row = 0;
  334. count = 0;//为下一个表格最准备
  335. }
  336. }
  337. }
  338. if(event.keyCode==109)//"-"事件
  339. {
  340. datagrid3.row--;
  341. datagrid3.endEditCell();
  342. }
  343. if(event.keyCode==107)//"+"事件
  344. {
  345. datagrid3.row++;
  346. datagrid3.endEditCell();
  347. }
  348. ]]>
  349. </script>
  350. <script type="javascript" ev:event="xforms-value-changed">
  351. <![CDATA[
  352. changeColor(datagrid3);
  353. ]]>
  354. </script>
  355. </datagrid>
  356. <datagrid id="datagrid4" nodeset="/root/grid/datagrid4/SingleChem_Row" caption="成分^最小^最大^实绩^EX" colsep="^" colwidth="45, 60, 60, 60, 41" defaultrows="14" mergecellsfixedrows="bycolrec" rowsep="|" selectionmode="free" style="left:748px; top:35px; width:227px; height:296px; ">
  357. <col ref="CHEM_CD" style="font-weight:bold; "/>
  358. <col ref="CHEM_MIN" style="font-weight:bold; "/>
  359. <col ref="CHEM_MAX" style="font-weight:bold; "/>
  360. <col ref="CHEM_VAL" type="input" format="0.9999999" style="font-weight:bold; background-color:#ffff99; "/>
  361. <col ref="EX" visibility="hidden"/>
  362. <script type="javascript" ev:event="onclick">
  363. <![CDATA[
  364. datagrid4.editCell();
  365. ]]>
  366. </script>
  367. <script type="javascript" ev:event="onkeydown">
  368. <![CDATA[
  369. if(event.keyCode==13)
  370. {
  371. datagrid4.row++;
  372. if(datagrid4.rows-1 == datagrid4.row)
  373. {
  374. count++;
  375. if(count==2)
  376. {
  377. model.setFocus("datagrid2" , true);//设置焦点
  378. datagrid2.col = datagrid2.colRef("CHEM_VAL");//设置表格4的焦点位置
  379. datagrid2.row = 1; //设置表格4的焦点位置
  380. datagrid2.row = 0;
  381. count = 0;//重新归0,避免会到表格2时出问题
  382. }
  383. }
  384. }
  385. if(event.keyCode==109)//"-"事件
  386. {
  387. datagrid4.row--;
  388. datagrid4.editCell();
  389. }
  390. if(event.keyCode==107)//"+"事件
  391. {
  392. datagrid4.row++;
  393. datagrid4.editCell();
  394. }
  395. ]]>
  396. </script>
  397. <script type="javascript" ev:event="xforms-value-changed">
  398. <![CDATA[
  399. changeColor(datagrid4);
  400. ]]>
  401. </script>
  402. </datagrid>
  403. <datagrid id="datagrid5" nodeset="/root/grid/datagrid5/CompChem_Row" caption="元素标识^复合元素或计算式^最小^最大^实绩^EX^成分" colsep="^" colwidth="112, 396, 60, 60, 60, 28, 56" defaultrows="12" mergecellsfixedrows="bycolrec" rowsep="|" selectionmode="free" tooltip="true" style="left:275px; top:335px; width:700px; height:230px; font-weight:bold; ">
  404. <col ref="COMP_DETAIL" style="font-weight:bold; "/>
  405. <col ref="COMP_CAL" style="font-weight:bold; text-align:left; "/>
  406. <col ref="CHEM_MIN" style="font-weight:bold; "/>
  407. <col ref="CHEM_MAX" style="font-weight:bold; "/>
  408. <col ref="CHEM_VAL" type="input" style="background-color:#ffff99; "/>
  409. <col ref="EX" visibility="hidden"/>
  410. <col ref="CHEM_CD" visibility="hidden"/>
  411. <script type="javascript" ev:event="onclick">
  412. <![CDATA[
  413. if(datagrid5.row <= 0) return;
  414. try
  415. {
  416. var storChem;//保存每一个元素
  417. var chemCal = datagrid5.valueMatrix(datagrid5.row , datagrid5.colRef("COMP_CAL"));//保存复合元素计算式
  418. var chemRow = 0;//元素名所在列
  419. var chemVal = 3; //元素值所在列
  420. //在grid1、2、3中找到与复合计算式中相同的元素,并将对应元素的值替换到计算式中
  421. for(var i = datagrid2.fixedRows; i < datagrid2.rows; i++)
  422. {
  423. storChem = datagrid2.valueMatrix(i , chemRow);//元素名
  424. chemCal = chemCal.replaceAll(storChem , datagrid2.valueMatrix(i , chemVal).Trim()==""?0:datagrid2.valueMatrix(i , chemVal));
  425. }
  426. for(var i = datagrid3.fixedRows; i < datagrid3.rows; i++)
  427. {
  428. storChem = datagrid3.valueMatrix(i , chemRow);
  429. chemCal = chemCal.replaceAll(storChem , datagrid3.valueMatrix(i , chemVal).Trim()==""?0:datagrid3.valueMatrix(i , chemVal));
  430. }
  431. for(var i = datagrid4.fixedRows; i < datagrid4.rows; i++)
  432. {
  433. storChem = datagrid4.valueMatrix(i , chemRow);
  434. chemCal = chemCal.replaceAll(storChem , datagrid4.valueMatrix(i , chemVal).Trim()==""?0:datagrid4.valueMatrix(i , chemVal));
  435. }
  436. // alert(chemCal);
  437. input2.value = eval(chemCal.replace("=" , "")) + "";
  438. model.refresh();
  439. datagrid5.valueMatrix(datagrid5.row , datagrid5.colRef("CHEM_VAL")) = input2.value.toFixed(2);//四舍五入
  440. datagrid5.addStatus(datagrid5.row , "update");
  441. model.refresh();
  442. }catch(e)
  443. {
  444. }
  445. ]]>
  446. </script>
  447. <script type="javascript" ev:event="onkeydown">
  448. <![CDATA[
  449. if(event.keyCode==13)
  450. {
  451. datagrid5.row = datagrid5.row+1;
  452. }
  453. ]]>
  454. </script>
  455. <script type="javascript" ev:event="xforms-value-changed">
  456. <![CDATA[
  457. changeColor(datagrid5);
  458. ]]>
  459. </script>
  460. </datagrid>
  461. <caption id="caption10" class="cell" style="left:175px; top:597px; width:70px; height:20px; ">厂内钢号</caption>
  462. <caption id="caption2" class="cell" style="left:0px; top:5px; width:80px; height:20px; ">板坯号</caption>
  463. <input id="input1" ref="/root/OtherInfo/StlGrdResult_Row/STL_GRD" editable="false" style="left:245px; top:597px; width:100px; height:20px; "/>
  464. <button id="button1" style="left:110px; top:35px; width:75px; height:20px; background-color:#ccffcc; border-style:solid; ">
  465. <caption>增加</caption>
  466. <script type="javascript" ev:event="DOMActivate">
  467. <![CDATA[
  468. if(beGridChanged(datagrid1 ,datagrid2 , datagrid3 , datagrid4 ,datagrid5)=="1")
  469. {
  470. window.alert("请先保存被修改的记录!", "警告");
  471. return;
  472. }
  473. model.removenode("/root/reqData");
  474. datagrid1.addRow();
  475. var currentRow = datagrid1.row;
  476. if(datagrid1.rows == 2)//若表格1中开始没有任何信息,增加一行后才变为2行
  477. {
  478. //赋值到新增的行中
  479. datagrid1.valueMatrix(currentRow , datagrid1.colRef("SLAB_NO"))=input40.value.Trim();
  480. datagrid1.valueMatrix(currentRow , datagrid1.colRef("CHEM_SEQ")) = "01";
  481. }
  482. else
  483. {
  484. ///获得增加行的上一行的各个值
  485. var chargeNO = datagrid1.valueMatrix(currentRow-1 , datagrid1.colRef("SLAB_NO")) ;//炉次号//工序
  486. var chemSEQ = datagrid1.valueMatrix(currentRow-1 , datagrid1.colRef("CHEM_SEQ")); //次数
  487. chemSEQ = eval(chemSEQ)+1;
  488. if(chemSEQ <= 9)
  489. {
  490. chemSEQ = "0"+chemSEQ;
  491. }
  492. ///赋值到当前增加的行
  493. datagrid1.valueMatrix(currentRow , datagrid1.colRef("SLAB_NO"))= chargeNO;
  494. datagrid1.valueMatrix(currentRow , datagrid1.colRef("CHEM_SEQ")) = "0"+chemSEQ;
  495. }
  496. selectRow = datagrid1.row;
  497. //炉次号
  498. // model.makeValue("/root/reqData/CHARGENO" , datagrid1.valueMatrix(currentRow , datagrid1.colRef("CHARGE_NO")));
  499. model.makeValue("/root/reqData/ADDPARAM" , input1.value+combo1.value);//厂内牌号+生产线
  500. //将TBB01_FAC_INGR中的单一和复合元素放入后面2、3、4、5表格中,并清除原来存在的数据
  501. removeGridData();
  502. commSubmit("UIB020035-service", "addRow", "glueAction.do");
  503. ///copy成分到2、3、4、5表格中,单一成分每个表为13个,最多容纳50个单一元素(表4可多于13个)
  504. copyFixNode("/root/grid/datagrid2","/root/resData/SingleChem_VO/SingleChem_Row",1 , 13);//表2
  505. copyFixNode("/root/grid/datagrid3","/root/resData/SingleChem_VO/SingleChem_Row",14, 26);//表3
  506. copyFixNode("/root/grid/datagrid4","/root/resData/SingleChem_VO/SingleChem_Row",27,50);//表4
  507. model.copyNode("/root/grid/datagrid5" , "/root/resData/CompChem_VO");//表5
  508. model.refresh();
  509. ]]>
  510. </script>
  511. </button>
  512. <button id="button2" style="left:190px; top:35px; width:73px; height:20px; background-color:#ccffcc; border-style:solid; ">
  513. <caption>删除</caption>
  514. <script type="javascript" ev:event="DOMActivate">
  515. <![CDATA[
  516. //遍历寻找需要删除的行
  517. if(commComfirmBox("确认删除?","提示")=="0") return;
  518. for(var i = datagrid1.rows; i >= 1; i--)
  519. {
  520. if(datagrid1.valueMatrix(i , 0)=="Y")
  521. {
  522. datagrid1.deleteRow(i , false);
  523. }
  524. }
  525. model.removenode("/root/reqData");
  526. model.makeNode("/root/reqData");
  527. b01MultiUpdate(datagrid1,"/root/reqData" ,"A", true, "rowStuts1");//获得表1中增加的记录
  528. commSubmit("UIB020035-service", "delete", "glueAction.do");//delete row
  529. removeGridData();//清除2\3\4原来的数据
  530. datagrid2.rebuildStyle();
  531. datagrid3.rebuildStyle();
  532. datagrid4.rebuildStyle();
  533. datagrid5.rebuildStyle();
  534. datagrid1.clearStatus();//清除表格1被删除的状态记录
  535. datagrid2.clearStatus();
  536. datagrid3.clearStatus();
  537. datagrid4.clearStatus();
  538. datagrid5.clearStatus();
  539. ]]>
  540. </script>
  541. </button>
  542. <line id="line1" style="x1:0px; y1:593px; x2:978px; y2:593px; "/>
  543. <line id="line2" style="x1:2px; y1:0px; x2:980px; y2:0px; "/>
  544. <input id="input2" ref="/root/jisuanshi" style="left:410px; top:570px; width:170px; height:20px; "/>
  545. <caption id="caption1" class="cell" style="left:275px; top:570px; width:136px; height:20px; ">复合元素的计算实绩为:</caption>
  546. <caption id="caption4" class="cell" visibility="hidden" style="left:590px; top:570px; width:80px; height:20px; ">交货状态</caption>
  547. <input id="input3" ref="/root/OtherInfo/StlGrdResult_Row/PRODNM_CD" visibility="hidden" editable="false" style="left:670px; top:570px; width:75px; height:20px; "/>
  548. <input id="input40" ref="/root/formData/CHARGENO" style="left:80px; top:5px; width:100px; height:20px; "/>
  549. <button id="button3" visibility="hidden" style="left:180px; top:5px; width:85px; height:20px; background-color:#ccffcc; border-style:solid; ">
  550. <caption>选择</caption>
  551. <script type="javascript" ev:event="DOMActivate">
  552. <![CDATA[
  553. window.load("./_0200SLAB.xrw", "modal", "modalWin", "left:400; top:40; width:500px; height:400px;sysmenu:visible; min:visible; max:hidden; resize:false;" , "/root/initChargeData" , "/root/RadioResult");
  554. ]]>
  555. </script>
  556. </button>
  557. <script type="javascript" ev:event="onaccesskey">
  558. <![CDATA[
  559. openWindow("UIB020035");
  560. ]]>
  561. </script>
  562. <caption id="caption5" class="cell" style="left:0px; top:597px; width:80px; height:20px; ">生产线</caption>
  563. <select1 id="combo1" ref="/root/OtherInfo/StlGrdResult_Row/SLAB_RT" disabled="true" appearance="minimal" style="left:80px; top:597px; width:85px; height:20px; ">
  564. <choices>
  565. <item>
  566. <label>热轧厂</label>
  567. <value>H</value>
  568. </item>
  569. <item>
  570. <label>冷轧厂</label>
  571. <value>C</value>
  572. </item>
  573. <item>
  574. <label>厚板厂</label>
  575. <value>P</value>
  576. </item>
  577. <item>
  578. <label>中板厂</label>
  579. <value>Z</value>
  580. </item>
  581. <item>
  582. <label/>
  583. <value/>
  584. </item>
  585. </choices>
  586. </select1>
  587. <button id="button99" visibility="hidden" style="left:855px; top:5px; width:65px; height:20px; ">
  588. <caption>FIND</caption>
  589. <script type="javascript" ev:event="DOMActivate">
  590. <![CDATA[
  591. find();
  592. ]]>
  593. </script>
  594. </button>
  595. <button id="button4" visibility="hidden" style="left:590px; top:5px; width:100px; height:20px; background-color:#00ff00; border-style:solid; ">
  596. <caption>过渡坯成分复写</caption>
  597. <script type="javascript" ev:event="DOMActivate">
  598. <![CDATA[
  599. datagrid6.visible = !datagrid6.visible;
  600. ]]>
  601. </script>
  602. </button>
  603. <datagrid id="datagrid6" nodeset="/root/grid/datagrid6/XSlabResult_Row" visibility="hidden" caption="复写板坯号^选择" colsep="^" colwidth="100, 59" mergecellsfixedrows="bycolrec" rowsep="|" style="left:590px; top:25px; width:185px; height:185px; ">
  604. <col ref="X_SLABNO"/>
  605. <col checkvalue="Y,N" ref="CHECKED" type="checkbox"/>
  606. </datagrid>
  607. <caption id="caption6" class="cell" visibility="visible" style="left:275px; top:5px; width:75px; height:20px; ">判定</caption>
  608. <select id="checkbox1" ref="/root/panding" class="cell" visibility="visible" overflow="visible" appearance="full" style="left:330px; top:6px; width:26px; height:20px; font-family:宋体; font-size:14pt; font-weight:bold; ">
  609. <choices>
  610. <item>
  611. <label/>
  612. <value>Y</value>
  613. </item>
  614. </choices>
  615. </select>
  616. <caption id="caption3" class="cell" visibility="hidden" style="left:355px; top:597px; width:80px; height:20px; ">检验人员</caption>
  617. <caption id="caption7" class="cell" visibility="hidden" style="left:555px; top:597px; width:80px; height:20px; ">判定人员</caption>
  618. <caption id="caption8" class="cell" visibility="hidden" style="left:760px; top:597px; width:80px; height:20px; ">判定时间</caption>
  619. <input id="input4" visibility="hidden" style="left:434px; top:597px; width:100px; height:20px; "/>
  620. <input id="input5" visibility="hidden" style="left:635px; top:597px; width:100px; height:20px; "/>
  621. <input id="input6" visibility="hidden" style="left:840px; top:597px; width:100px; height:20px; "/>
  622. <line id="line3" style="x1:2px; y1:30px; x2:980px; y2:30px; "/>
  623. <caption id="caption9" class="cell" visibility="hidden" style="left:365px; top:5px; width:95px; height:20px; ">改判牌号选择</caption>
  624. <select1 id="combo2" visibility="hidden" appearance="minimal" style="left:460px; top:5px; width:100px; height:20px; ">
  625. <choices>
  626. <item>
  627. <label>combo2</label>
  628. <value>combo2</value>
  629. </item>
  630. </choices>
  631. </select1>
  632. </xhtml:body>
  633. </xhtml:html>