ebf24a8543bc69b5caadfd4b37f3e133146bd6c6.svn-base 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404
  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>指定充当</xhtml:title>
  6. <model id="model1">
  7. <instance id="instance1">
  8. <root xmlns="">
  9. <formData>
  10. <R_ORD_NO/>
  11. <R_ORD_SEQ/>
  12. <R_MAT_NO/>
  13. <SIGN_STL>Y</SIGN_STL>
  14. <SIGN_CHEN_FEN>Y</SIGN_CHEN_FEN>
  15. <SING_CAIZHI>Y</SING_CAIZHI>
  16. <SIGN_QIANGZHI/>
  17. <P_REG_ID/>
  18. <errInfo/>
  19. </formData>
  20. <reqData/>
  21. <resData/>
  22. <THK/>
  23. <datagrid1/>
  24. <searchData>
  25. <ord_no/>
  26. <ord_seq/>
  27. <coil_no/>
  28. <coil_back/>
  29. <ACT_WGT/>
  30. <act_wgt_back/>
  31. </searchData>
  32. <bool1>false</bool1>
  33. <bool2>true</bool2>
  34. <SPEC_STL_GRD/>
  35. <WTH/>
  36. <THK_1/>
  37. <WTH_1/>
  38. <ERR0R/>
  39. <reg_id/>
  40. </root>
  41. </instance>
  42. <script type="javascript" ev:event="xforms-ready">
  43. <![CDATA[
  44. v_ord_no = model.property("V_ORD_NO") ;
  45. v_ord_seq = model.property("V_ORD_SEQ") ;
  46. v_reg_id = model.property("V_REG_ID") ;
  47. v_act_wgt = model.property("V_ACT_WGT") ;
  48. v_old_sample_no = model.property("V_OLD_SAMPL_NO");
  49. v_spec_stl_grd = model.property("V_SPEC_STL_GRD");
  50. v_coil_thk = model.property("V_COIL_THK");
  51. v_coil_wth = model.property("V_COIL_WTH");
  52. output1.value = v_ord_no + "- " +v_ord_seq;
  53. output3.value = v_spec_stl_grd;
  54. output4.value = v_coil_thk +"*"+v_coil_wth;
  55. //把垛位信息显示在出来
  56. model.setValue("/root/SPEC_STL_GRD",v_spec_stl_grd);
  57. //初始化得时候,就给替换按钮赋予相应的值
  58. model.setValue("/root/searchData/coil_no",v_old_sample_no);
  59. model.setValue("/root/searchData/ord_no",v_ord_no);
  60. model.setValue("/root/searchData/ord_seq",v_ord_seq);
  61. model.setValue("/root/formData/P_REG_ID",v_reg_id);
  62. model.setValue("/root/formData/R_ORD_NO",v_ord_no);
  63. model.setValue("/root/formData/R_ORD_SEQ",v_ord_seq);
  64. model.setValue("/root/searchData/ACT_WGT",v_act_wgt);
  65. model.refresh();
  66. if(v_ord_no == null || v_ord_no == ""){
  67. alert(" 订单号为空!")
  68. }
  69. if (window.parent == null) Init();
  70. ]]>
  71. </script>
  72. </model>
  73. <script type="javascript">
  74. <![CDATA[
  75. var v_ord_no = "";
  76. var v_ord_seq = "";
  77. var v_reg_id = "";
  78. var v_old_sample_no = "";
  79. var v_act_wgt = "";
  80. function InitParams(node) {
  81. if (typeof node == "undefined" && typeof node != "object") return;
  82. model.removenode("/root/initData/rcvInfo");
  83. model.makeNode("/root/initData/rcvInfo");
  84. var nodeList = node.childNodes;
  85. node = model.instances(0).selectSingleNode("/root/initData/rcvInfo");
  86. for (var i = 0; i < nodeList.length; i++) {
  87. node.appendChild(nodeList.item(i));
  88. }
  89. model.setValue("root/formData/USER_NAME",model.getValue("/root/initData/rcvInfo/REG_ID"));
  90. //alert(model.getValue("/root/initData/rcvInfo/REG_ID"));
  91. }
  92. //2. 页面初始化函数(必须)
  93. function Init(node)
  94. {
  95. InitParams(node);
  96. }
  97. function save() {
  98. model.removenode("/root/reqData");
  99. model.makeNode("/root/reqData");
  100. //这里进行重量的对比,给出提示
  101. var act_wgt = model.getValue("/root/searchData/ACT_WGT");
  102. var act_wgt_back = model.getValue("/root/searchData/act_wgt_back");
  103. var coil_wgt = null;
  104. if(act_wgt == null){
  105. act_wgt = 0;
  106. }
  107. if(act_wgt_back == null){
  108. act_wgt_back = 0;
  109. }
  110. coil_wgt = (Number(act_wgt_back)-Number(act_wgt))/1000;
  111. var isUse = commComfirmBox("充当的卷重相差"+Math.abs(coil_wgt)+"吨,是否确认替换","提示");
  112. if(isUse == "0"){
  113. return;
  114. }
  115. var isUse = commComfirmBox("充当存在风险,请谨慎操作?","提示");
  116. if(isUse == "0"){
  117. //如果选择否的话,不进行相应操作
  118. return;
  119. }
  120. commSendReq("/root/formData");
  121. commSubmit("UIE031046-service","save","glueAction.do");
  122. if (model.getValue("/root/resData/errorData") != "") {
  123. // alert(model.getValue("/root/resData/errorData"));
  124. output2.value = model.getValue("/root/resData/errorData");
  125. return;
  126. }else{
  127. //清空错误信息提示栏,给出成功提示
  128. output2.value = "";
  129. output2.refresh();
  130. //给出成功标志值
  131. model.setValue("/root/ERR0R","Y");
  132. model.refresh();
  133. alert(" 充当成功!!! ");
  134. }
  135. }
  136. function find() {
  137. //这里根据列来查询列上面的钢卷
  138. model.removenode("/root/reqData");
  139. model.makeNode("/root/reqData");
  140. model.removenode("/root/datagrid1");
  141. model.makeNode("/root/datagrid1");
  142. model.duplicate("/root/reqData","/root/formData/R_MAT_NO");
  143. model.duplicate("/root/reqData","/root/searchData/coil_no");
  144. commSubmit("UIJ010040-service","CurLoadLoc","glueAction.do");
  145. commAppendData("/root/datagrid1/coilCurLoadLoc_VO","/root/resData/coilCurLoadLoc_VO");
  146. model.refresh();
  147. }
  148. ]]>
  149. </script>
  150. <script type="javascript" src="../../js/boaCommon.js"/>
  151. <script type="javascript" src="../../js/boaMsg.js"/>
  152. </xhtml:head>
  153. <xhtml:body>
  154. <caption id="caption4" class="cell" style="left:130px; top:68px; width:80px; height:20px; "/>
  155. <caption id="caption3" class="cell" style="left:195px; top:37px; width:80px; height:25px; "/>
  156. <caption id="caption2" class="cell" style="left:30px; top:10px; width:75px; height:20px; ">订 单 号</caption>
  157. <output id="output1" style="left:105px; top:10px; width:165px; height:20px; border-color:#000000; border-style:solid; "/>
  158. <input id="input1" ref="/root/formData/R_MAT_NO" style="left:420px; top:10px; width:125px; height:20px; "/>
  159. <datagrid id="datagrid1" nodeset="/root/datagrid1/coilCurLoadLoc_VO/coilCurLoadLoc_Row" caption="钢卷号^钢种^实际厚度^实际宽度^订单厚度^订单宽度^钢卷长度^钢卷重量^钢卷外径^垛位^当前进程^余材区分^合同号^订单号^收货单位^合同单位^目的地" colsep="^" colwidth="83, 80, 61, 62, 62, 61, 62, 64, 58, 88, 62, 61, 100, 62, 100, 100, 100" defaultrows="10" mergecellsfixedrows="bycolrec" rowsep="|" style="left:30px; top:95px; width:600px; height:190px; ">
  160. <col ref="OLD_SAMPL_NO"/>
  161. <col ref="SPEC_STL_GRD"/>
  162. <col ref="COIL_THK"/>
  163. <col ref="COIL_WTH"/>
  164. <col ref="INSTR_COIL_THK"/>
  165. <col ref="INSTR_COIL_WTH"/>
  166. <col ref="COIL_LEN"/>
  167. <col ref="ACT_WGT"/>
  168. <col ref="COIL_OUTDIA"/>
  169. <col ref="CUR_LOAD_LOC"/>
  170. <col ref="CUR_PROG_CD"/>
  171. <col ref="ORD_FL"/>
  172. <col ref="ORD_NO"/>
  173. <col ref="ORD_SEQ"/>
  174. <col ref="ORD_NM"/>
  175. <col ref="CUST_NM"/>
  176. <col ref="DEST_PCD_DESC"/>
  177. <script type="javascript" ev:event="onclick">
  178. <![CDATA[
  179. //这里增加点击事件,把钢卷号信息带到指定充当信息中
  180. var nodeSet1 = datagrid1.nodeset;
  181. var row = null;
  182. var OLD_SAMPL_NO = null;
  183. var act_wgt_tmp = null;
  184. for(var i=0;i<datagrid1.selectedRows;i++){
  185. row = datagrid1.selectedRow(i);
  186. OLD_SAMPL_NO = model.getValue(nodeSet1+"["+row+"]/OLD_SAMPL_NO");
  187. act_wgt_tmp = model.getValue(nodeSet1+"["+row+"]/ACT_WGT");
  188. model.setValue("/root/formData/R_MAT_NO",OLD_SAMPL_NO);
  189. model.setValue("/root/searchData/act_wgt_back",act_wgt_tmp);
  190. model.refresh();
  191. }
  192. ]]>
  193. </script>
  194. </datagrid>
  195. <input id="output2" ref="/root/formData/errInfo" style="left:30px; top:295px; width:600px; height:115px; "/>
  196. <line id="line1" style="x1:30px; y1:290px; x2:630px; y2:290px; "/>
  197. <select id="checkbox7" ref="/root/formData/SIGN_CHEN_FEN" disabled="true" overflow="visible" appearance="full" style="left:273px; top:69px; width:55px; height:20px; border-style:none; ">
  198. <choices>
  199. <item>
  200. <label>同成分</label>
  201. <value>Y</value>
  202. </item>
  203. </choices>
  204. </select>
  205. <select id="checkbox8" ref="/root/formData/SING_CAIZHI" disabled="true" overflow="visible" appearance="full" style="left:330px; top:69px; width:55px; height:20px; border-style:none; ">
  206. <choices>
  207. <item>
  208. <label>同材质</label>
  209. <value>Y</value>
  210. </item>
  211. </choices>
  212. </select>
  213. <select id="checkbox9" ref="/root/formData/SIGN_STL" overflow="visible" appearance="full" style="left:212px; top:69px; width:55px; height:20px; border-style:none; ">
  214. <choices>
  215. <item>
  216. <label>同牌号</label>
  217. <value>Y</value>
  218. </item>
  219. </choices>
  220. </select>
  221. <select id="checkbox1" ref="/root/formData/SIGN_QIANGZHI" visibility="hidden" overflow="visible" appearance="full" style="left:386px; top:69px; width:70px; height:20px; border-style:none; ">
  222. <choices>
  223. <item>
  224. <label>强制充当</label>
  225. <value>Y</value>
  226. </item>
  227. </choices>
  228. <script type="javascript" ev:event="xforms-select">
  229. <![CDATA[
  230. if(checkbox1.value = "Y") {
  231. alert("强制充当有风险!请谨慎操作,后果自负");
  232. }
  233. ]]>
  234. </script>
  235. </select>
  236. <button id="button1" style="left:460px; top:70px; width:70px; height:20px; text-align:right; background-image:../../images/save.gif; ">
  237. <caption>充当确定</caption>
  238. <script type="javascript" ev:event="onclick">
  239. <![CDATA[
  240. save();
  241. ]]>
  242. </script>
  243. </button>
  244. <caption id="caption1" class="cell" style="left:305px; top:10px; width:115px; height:20px; ">指定充当物料号</caption>
  245. <button id="button2" style="left:550px; top:10px; width:70px; height:20px; text-align:right; background-image:../../images/save.gif; ">
  246. <caption>物料查询</caption>
  247. <script type="javascript" ev:event="onclick">
  248. <![CDATA[
  249. find();
  250. ]]>
  251. </script>
  252. </button>
  253. <button id="button3" style="left:195px; top:37px; width:80px; height:25px; ">
  254. <caption>同规格查询</caption>
  255. <script type="javascript" ev:event="onclick">
  256. <![CDATA[
  257. //这里根据列来查询列上面的钢卷
  258. model.removenode("/root/reqData");
  259. model.makeNode("/root/reqData");
  260. model.removenode("/root/datagrid1");
  261. model.makeNode("/root/datagrid1");
  262. model.duplicate("/root/reqData","/root/formData/R_MAT_NO");
  263. model.duplicate("/root/reqData","/root/THK");
  264. model.duplicate("/root/reqData","/root/THK_1");
  265. model.duplicate("/root/reqData","/root/WTH");
  266. model.duplicate("/root/reqData","/root/WTH_1");
  267. //这里要排除选中的卷
  268. model.duplicate("/root/reqData","/root/searchData/coil_no");
  269. commSubmit("UIJ010040-service","coilCurLoadLoc","glueAction.do");
  270. commAppendData("/root/datagrid1/coilCurLoadLoc_VO","/root/resData/coilCurLoadLoc_VO");
  271. model.refresh();
  272. ]]>
  273. </script>
  274. </button>
  275. <button id="button5" style="left:550px; top:70px; width:70px; height:20px; text-align:right; background-image:../../images/save.gif; ">
  276. <caption>钢卷替换</caption>
  277. <script type="javascript" ev:event="onclick">
  278. <![CDATA[
  279. //这里给出提示,充当成功的卷才能进行替换
  280. var isUse = commComfirmBox("请确认需要替换的钢卷已经成功充到相应的订单号上面?","提示");
  281. if(isUse == "0"){
  282. //如果选择否的话,不进行相应操作
  283. return;
  284. }
  285. //这里还需要判断是否充当成功
  286. if (model.getValue("/root/resData/errorData") != "") {
  287. //alert(model.getValue("/root/resData/errorData"));
  288. output2.value = model.getValue("/root/resData/errorData");
  289. alert(" 充当出现错误信息,不能进行钢卷替换。请确认充当无误后再进行钢卷替换!!! ");
  290. return;
  291. }
  292. if(model.getValue("/root/ERR0R") == "Y"){
  293. var inputValue = model.getValue("/root/formData/R_MAT_NO");
  294. var opp1 = window.opener;
  295. opp1.model.setValue("/root/COIL/coil_back",inputValue);
  296. opp1.model.refresh();
  297. //这里还不需进行相应的数据迁移,所以需要写个类来处理
  298. //清空发送接点
  299. model.removenode("/root/reqData");
  300. model.makeNode("/root/reqData");
  301. var reg_id = model.getValue("/root/formData/P_REG_ID");
  302. model.setValue("/root/reg_id",reg_id);
  303. model.duplicate("/root/reqData","/root/reg_id");
  304. model.duplicate("/root/reqData","/root/searchData/ord_no");
  305. model.duplicate("/root/reqData","/root/searchData/ord_seq");
  306. model.duplicate("/root/reqData","/root/searchData/coil_no");
  307. model.setValue("/root/searchData/coil_back",model.getValue("/root/formData/R_MAT_NO"));
  308. model.refresh();
  309. model.duplicate("/root/reqData","/root/searchData/coil_back");
  310. //充当的替换,写死为未下计划情况的替换
  311. model.duplicate("/root/reqData","/root/bool1");
  312. model.duplicate("/root/reqData","/root/bool2");
  313. commSubmit("UIJ010040-service","F_T_coilNo","glueAction.do");
  314. window.close();
  315. }else{
  316. alert(" 不先进行充当操作,不能做钢卷替换!!! ");
  317. return;
  318. }
  319. ]]>
  320. </script>
  321. </button>
  322. <input id="input2" ref="/root/THK" style="left:70px; top:32px; width:55px; height:20px; "/>
  323. <button id="button4" style="left:130px; top:70px; width:80px; height:15px; ">
  324. <caption>同牌号查询</caption>
  325. <script type="javascript" ev:event="onclick">
  326. <![CDATA[
  327. //这里根据列来查询列上面的钢卷
  328. model.removenode("/root/reqData");
  329. model.makeNode("/root/reqData");
  330. model.removenode("/root/datagrid1");
  331. model.makeNode("/root/datagrid1");
  332. model.duplicate("/root/reqData","/root/formData/R_MAT_NO");
  333. model.duplicate("/root/reqData","/root/SPEC_STL_GRD");
  334. //这里要排除选中的卷
  335. model.duplicate("/root/reqData","/root/searchData/coil_no");
  336. commSubmit("UIJ010040-service","SpecStlGrd","glueAction.do");
  337. commAppendData("/root/datagrid1/coilCurLoadLoc_VO","/root/resData/coilCurLoadLoc_VO");
  338. model.refresh();
  339. ]]>
  340. </script>
  341. </button>
  342. <input id="input3" ref="/root/SPEC_STL_GRD" style="left:30px; top:68px; width:100px; height:20px; "/>
  343. <caption id="caption5" class="cell" style="left:280px; top:42px; width:70px; height:20px; ">订单牌号</caption>
  344. <output id="output3" style="left:350px; top:42px; width:95px; height:20px; border-color:#000000; border-style:solid; "/>
  345. <caption id="caption6" class="cell" style="left:450px; top:42px; width:70px; height:20px; ">订单规格</caption>
  346. <output id="output4" style="left:520px; top:42px; width:95px; height:20px; border-color:#000000; border-style:solid; "/>
  347. <input id="input4" ref="/root/WTH" style="left:70px; top:50px; width:55px; height:20px; "/>
  348. <caption id="caption7" class="cell" style="left:30px; top:32px; width:42px; height:20px; ">厚度</caption>
  349. <caption id="caption8" class="cell" style="left:30px; top:50px; width:42px; height:20px; ">宽度</caption>
  350. <input id="input5" ref="/root/THK_1" style="left:140px; top:32px; width:55px; height:20px; "/>
  351. <input id="input6" ref="/root/WTH_1" style="left:140px; top:50px; width:55px; height:20px; "/>
  352. <line id="line2" style="x1:125px; y1:45px; x2:140px; y2:45px; "/>
  353. <line id="line3" style="x1:125px; y1:60px; x2:140px; y2:60px; "/>
  354. </xhtml:body>
  355. </xhtml:html>