UIB010130.xrw 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375
  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. <CoName/>
  13. <CODE/>
  14. </formData>
  15. <datagrid1/>
  16. <datagrid2/>
  17. <initData>
  18. <ComputerCDResult_Row>
  19. <LABEL/>
  20. <VALUE/>
  21. </ComputerCDResult_Row>
  22. </initData>
  23. <reqData/>
  24. <tempData/>
  25. <CO_CD/>
  26. <CUSTPARAM/>
  27. <datagrid3/>
  28. <findInitData>
  29. <LOT/>
  30. <LEN/>
  31. <WTH/>
  32. </findInitData>
  33. </root>
  34. </instance>
  35. <script type="javascript" ev:event="xforms-ready">
  36. <![CDATA[
  37. if(window.parent==null) Init();
  38. ]]>
  39. </script>
  40. </model>
  41. <script type="javascript" src="../../js/boaCommon.js"/>
  42. <script type="javascript" src="../../js/b01.js"/>
  43. <script type="javascript">
  44. <![CDATA[
  45. var currentRow = 0;
  46. function Init(node)
  47. {
  48. InitParams(node);
  49. model.removenode("/root/reqData");
  50. model.makeNode("/root/reqData");
  51. //对下拉框中的信息进行初始化
  52. commSubmit("UIB010130-service", "success", "glueAction.do");
  53. model.copyNode("/root/findInitData/LOT","/root/resData/LotResult_VO");//取样批次
  54. model.copyNode("/root/findInitData/LEN","/root/resData/LenResult_VO");//取样长度方向位置
  55. model.copyNode("/root/findInitData/WTH","/root/resData/WthResult_VO");//取样宽度方向位置
  56. model.refresh();
  57. }
  58. /*根据客户公司代码查询客户参数号*/
  59. function find()
  60. {
  61. model.removenode("/root/reqData");
  62. model.makeNode("/root/reqData");
  63. commSendReq("/root/formData");
  64. commSubmit("UIB010130-service", "find", "glueAction.do");
  65. model.copyNode("/root/datagrid1","/root/resData/Customer_VO");
  66. datagrid1.clearStatus();
  67. datagrid2.clearStatus();
  68. datagrid3.clearStatus();
  69. datagrid2.rebuildStyle();
  70. model.removenode("/root/datagrid2");
  71. model.makeNode("/root/datagrid2");
  72. model.removenode("/root/datagrid3");
  73. model.makeNode("/root/datagrid3");
  74. model.refresh();
  75. datagrid1.cellAttribute("disabled",datagrid1.fixedRows , datagrid1.fixedCols , datagrid1.rows - 1 , datagrid1.cols - 1) = "true";
  76. }
  77. function find_qlty()
  78. {
  79. model.removenode("/root/reqData");
  80. model.makeNode("/root/reqData");
  81. commSendReq("/root/datagrid1/Customer_Row["+currentRow+"]");
  82. commSubmit("UIB010130-service", "onclick", "glueAction.do");
  83. model.copyNode("/root/datagrid2" , "/root/resData/QLTY_VO");
  84. model.copyNode("/root/datagrid3" , "/root/resData/SMPResult_VO");
  85. model.refresh();
  86. setDatagrid();
  87. }
  88. function save()
  89. {
  90. if(currentRow == 0) {window.alert("非法操作" , "提示");return;}
  91. if(commComfirmBox("确认保存?","提示")=="0") return;
  92. //验证datagrid2中的信息 QLTY_MIN QLTY_MAX
  93. for(var i = 1;i<datagrid2.rows;i++)
  94. {
  95. var min = datagrid2.valueMatrix(i,datagrid2.colRef("QLTY_MIN"));
  96. MIN = Number(min);
  97. var max = datagrid2.valueMatrix(i,datagrid2.colRef("QLTY_MAX"));
  98. MAX = Number(max);
  99. ///转化为数值型,要不然会出现6大于11等情况
  100. if(MIN != "" && MAX != "" && MIN>MAX )///min != ""&&max != "" &&min>max
  101. {
  102. var QLTY_CD_CFNM = datagrid2.valueMatrix(i,1);
  103. alert("【"+QLTY_CD_CFNM+"】 最小值必须小于最大值!"," 警告 ");
  104. return;
  105. }
  106. }
  107. model.removenode("/root/reqData");
  108. model.makeNode("/root/reqData");
  109. model.removenode("/root/tempData2");//对应表1
  110. model.makeNode("/root/tempData2");
  111. model.removenode("/root/tempData3");//取样方法
  112. model.makeNode("/root/tempData3");
  113. b01MultiUpdate(datagrid2,"/root/tempData2" ,"A", true, "rowStatu1");
  114. b01MultiUpdate(datagrid3,"/root/tempData3" ,"A", true, "rowStatu2");
  115. commSendReq("/root/tempData2","/root/tempData3" ,"/root/datagrid1/Customer_Row["+currentRow+"]");
  116. getLoggingInInfo();
  117. commSubmit("UIB010130-service", "save", "glueAction.do");
  118. var returnInfoMsg = model.getValue("/root/resData/returnInfoMsg_VO/returnInfoMsg_Row");
  119. if(returnInfoMsg != "") {
  120. window.alert(returnInfoMsg, "操作信息");
  121. find_qlty();
  122. }
  123. model.refresh();
  124. currentRow = 0;
  125. datagrid1.clearStatus();
  126. datagrid2.clearStatus();
  127. datagrid3.clearStatus();
  128. datagrid1.cellAttribute("disabled",datagrid1.fixedRows , datagrid1.fixedCols , datagrid1.rows - 1 , datagrid1.cols - 1) = "true";
  129. }
  130. function setDatagrid()
  131. {
  132. datagrid2.rebuildStyle();
  133. for(var i=datagrid1.fixedRows;i<datagrid2.rows;i++)
  134. {
  135. var QLTY_MIN_TP = datagrid2.valueMatrix(i,datagrid2.colRef("QLTY_MIN_TP"));
  136. var QLTY_MAX_TP = datagrid2.valueMatrix(i,datagrid2.colRef("QLTY_MAX_TP"));
  137. var QLTY_UNIT_TP = datagrid2.valueMatrix(i,datagrid2.colRef("QLTY_UNIT_TP"));
  138. if(QLTY_MIN_TP != "Y")//不允许编辑
  139. {
  140. datagrid2.cellAttribute("editable",i,datagrid2.colRef("QLTY_MIN")) = "false";
  141. }
  142. else
  143. {
  144. datagrid2.cellAttribute("editable",i,datagrid2.colRef("QLTY_MIN")) = "true";
  145. datagrid2.cellStyle("background-color",i,datagrid2.colRef("QLTY_MIN")) = "#ffff99";
  146. }
  147. if(QLTY_MAX_TP != "Y")
  148. {
  149. datagrid2.cellAttribute("editable",i,datagrid2.colRef("QLTY_MAX")) = "false";
  150. }
  151. else
  152. {
  153. datagrid2.cellAttribute("editable",i,datagrid2.colRef("QLTY_MAX")) = "true"
  154. datagrid2.cellStyle("background-color",i,datagrid2.colRef("QLTY_MAX")) = "#ffff99";
  155. }
  156. if(QLTY_UNIT_TP != "Y")
  157. {
  158. datagrid2.cellAttribute("editable",i,datagrid2.colRef("QLTY_UNIT")) = "false";
  159. }
  160. else
  161. {
  162. datagrid2.cellAttribute("editable",i,datagrid2.colRef("QLTY_UNIT")) = "true"
  163. datagrid2.cellStyle("background-color",i,datagrid2.colRef("QLTY_UNIT")) = "#ffff99";
  164. }
  165. }
  166. }
  167. ]]>
  168. </script>
  169. </xhtml:head>
  170. <xhtml:body pagewidth="980" pageheight="620" style="font-family:宋体; font-size:14pt; ">
  171. <datagrid id="datagrid1" nodeset="/root/datagrid1/Customer_Row" caption="客户公司代码^交货状态^序号^生产线^标准牌号^公司名称^查询" colsep="^" colwidth="50, 40, 40, 48, 90, 95, 43" defaultrows="28" mergecellsfixedrows="bycolrec" rowheader="seq" rowheight="35" rowsep="|" tooltip="label" style="left:0px; top:60px; width:450px; height:470px; border-style:solid; ">
  172. <col editable="false" ref="CUST_CD" type="input" style="text-align:right; background-color:#ffffff; "/>
  173. <col ref="PRDNM_CD" type="input" style="text-align:left; background-color:#ffff99; "/>
  174. <col ref="SEQ" type="input" style="left:215px; top:21px; width:70px; height:21px; text-align:right; background-color:#ffff99; "/>
  175. <col ref="PROD_LINE" type="input" style="background-color:#ffff99; "/>
  176. <col ref="SPEC_STL_GRD" type="input" style="text-align:left; background-color:#ffff99; "/>
  177. <col ref="CUST_NM" style="text-align:left; "/>
  178. <col ref="QUERY" style="cursor:hand; "/>
  179. <script type="javascript" ev:event="onclick">
  180. <![CDATA[
  181. if(datagrid1.colRef("QUERY") == datagrid1.col && datagrid1.row >= datagrid1.fixedRows)
  182. {
  183. if(datagrid1.rowStatus(datagrid1.rows-1) == 1)
  184. {
  185. window.alert("增加状态下不允许该操作!" , "警告");
  186. datagrid1.row = datagrid1.rows-1;
  187. return;
  188. }
  189. if(beGridChanged(datagrid1,datagrid2,datagrid3) == "1" && currentRow != 0)
  190. {
  191. if(commComfirmBox("数据已修改,是否保存被修改的数据?","提示")=="0")
  192. {
  193. datagrid1.clearStatus();
  194. datagrid2.clearStatus();
  195. datagrid3.clearStatus();
  196. }
  197. else
  198. {
  199. save();
  200. }
  201. }
  202. currentRow = datagrid1.row;
  203. datagrid1.col = 1;
  204. find_qlty();
  205. }
  206. ]]>
  207. </script>
  208. <script type="javascript" ev:event="onentercell">
  209. <![CDATA[
  210. datagrid1.editCell();
  211. ]]>
  212. </script>
  213. <script type="javascript" ev:event="onkeydown">
  214. <![CDATA[
  215. onkeydownmove(datagrid1);
  216. ]]>
  217. </script>
  218. </datagrid>
  219. <datagrid id="datagrid2" nodeset="/root/datagrid2/QLTY_Row" caption="材质代码^材质项目^最小^最大^单位^材质类型^类型说明^检验类型^备注^QLTY_MIN_TP^QLTY_MAX_TP^QLTY_UNIT_TP^QLTY_TYPE_TP" colsep="^" colwidth="66, 182, 45, 45, 45, 37, 87, 40, 69, 51, 35, -7, 30" defaultrows="40" mergecellsfixedrows="bycolrec" rowheight="30" rowsep="|" selectionmode="free" tooltip="label" style="left:455px; top:35px; width:525px; height:585px; border-style:solid; ">
  220. <col disabled="true" ref="QLTY_CD" visibility="hidden"/>
  221. <col ref="QLTY_CD_CFNM" style="text-align:left; "/>
  222. <col ref="QLTY_MIN" type="input" style="text-align:right; "/>
  223. <col ref="QLTY_MAX" type="input" style="text-align:right; "/>
  224. <col ref="QLTY_UNIT" type="input" style="text-align:left; "/>
  225. <col ref="QLTY_TYPE" style="text-align:left; "/>
  226. <col editable="false" ref="SM_CFNM" type="input" visibility="hidden" style="text-align:left; background-color:#ffffff; "/>
  227. <col ref="QLTY_DEC_CD" type="input" style="background-color:#ffff99; "/>
  228. <col ref="QLTY_DETAIL" type="input" style="text-align:left; background-color:#ffff99; "/>
  229. <col ref="QLTY_MIN_TP" visibility="hidden"/>
  230. <col ref="QLTY_MAX_TP" visibility="hidden"/>
  231. <col ref="QLTY_UNIT_TP" visibility="hidden"/>
  232. <col ref="QLTY_TYPE_TP" visibility="hidden"/>
  233. <script type="javascript" ev:event="onentercell">
  234. <![CDATA[
  235. datagrid2.editCell();
  236. ]]>
  237. </script>
  238. <script type="javascript" ev:event="onkeydown">
  239. <![CDATA[
  240. onkeydownmove(datagrid2);
  241. ]]>
  242. </script>
  243. <script type="javascript" ev:event="xforms-value-changed">
  244. <![CDATA[
  245. compareMINMAX(datagrid2,"QLTY_MIN","QLTY_MAX") //验证最大值不能小于最小值
  246. ]]>
  247. </script>
  248. </datagrid>
  249. <button id="button3" style="left:325px; top:35px; width:70px; height:20px; background-image:../../images/btn_add.gif; ">
  250. <caption>添加</caption>
  251. <script type="javascript" ev:event="onclick">
  252. <![CDATA[
  253. if(model.getValue("/root/formData/CODE") == "")
  254. {
  255. window.alert("请选择客户公司" , "提示");
  256. return;
  257. }
  258. if(beGridChanged(datagrid1,datagrid2) == "1")
  259. {
  260. window.alert("数据已修改,请保存后再进行增加!" , "提示");
  261. return;
  262. }
  263. datagrid1.cellAttribute("disabled",datagrid1.fixedRows , datagrid1.fixedCols , datagrid1.rows - 1 , datagrid1.cols - 1) = "true";
  264. datagrid1.addRow();
  265. currentRow = datagrid1.row;
  266. datagrid1.valueMatrix(currentRow , datagrid1.colRef("CUST_CD")) = model.getValue("/root/formData/CODE");
  267. find_qlty();
  268. ]]>
  269. </script>
  270. </button>
  271. <button id="button4" style="left:392px; top:35px; width:70px; height:20px; background-image:../../images/btn_move.gif; ">
  272. <caption>删除</caption>
  273. <script type="javascript" ev:event="onclick">
  274. <![CDATA[
  275. if(beGridChanged(datagrid1 ,datagrid2) == "1")
  276. {
  277. window.alert("数据已修改,请保存或初始化!" , "警告");
  278. return;
  279. }
  280. if(commComfirmBox("确认删除?","提示")=="0") return;
  281. model.removenode("/root/reqData");
  282. model.makeNode("/root/reqData");
  283. datagrid1.deleteRow(datagrid1.row);
  284. b01MultiUpdate(datagrid1,"/root/reqData" ,"A", true, "rowStatus0");
  285. getLoggingInInfo();
  286. commSubmit("UIB010130-service", "save", "glueAction.do");
  287. currentRow = 0;
  288. find();
  289. ]]>
  290. </script>
  291. </button>
  292. <line id="line1" style="x1:0px; y1:30px; x2:980px; y2:30px; "/>
  293. <line id="line2" style="x1:0px; y1:0px; x2:980px; y2:0px; "/>
  294. <button id="button1" style="left:255px; top:5px; width:70px; height:20px; text-align:center; background-image:../../images/btn_add.gif; ">
  295. <caption>选择</caption>
  296. <script type="javascript" ev:event="onclick">
  297. <![CDATA[
  298. var vleft = window.screenLeft +100 ; //- 355;
  299. var vtop = window.screenTop + 100 ;//- 250;
  300. window.load("../Common/_Customer.xrw",
  301. "modal",
  302. "",
  303. "left:"+vleft+"; top:"+vtop+"; width:810; height:510; sysmenu:visible; min:visible; max:true; resize:true; caption:hidden;",
  304. "/root/interface", "/root/initData");
  305. ]]>
  306. </script>
  307. </button>
  308. <caption id="caption1" class="cell" style="left:5px; top:5px; width:70px; height:20px; text-align:left; border-color:#000000; border-style:solid; ">客户公司</caption>
  309. <input id="input1" ref="/root/formData/CODE" visibility="hidden" style="left:330px; top:5px; width:100px; height:20px; "/>
  310. <input id="input2" ref="/root/formData/CoName" editable="false" style="left:75px; top:5px; width:175px; height:20px; "/>
  311. <button id="button99" visibility="hidden" style="left:220px; top:35px; width:70px; height:20px; ">
  312. <caption>FIND</caption>
  313. <script type="javascript" ev:event="onclick">
  314. <![CDATA[
  315. find();
  316. ]]>
  317. </script>
  318. </button>
  319. <caption id="caption2" style="left:455px; top:5px; width:510px; height:20px; background-color:#ffcc99; border-color:#ff9900; border-style:solid; ">提示:与成分不同,客户性能特殊要求项目必须全部录入,不能仅仅录入与标准不相同的项目。</caption>
  320. <caption id="caption6" class="cell" visibility="visible" style="left:0px; top:536px; width:130px; height:21px; font-size:16pt; font-weight:bolder; vertical-align:middle; border-style:solid; ">取样方法</caption>
  321. <datagrid id="datagrid3" nodeset="/root/datagrid3/SMPResult_Row" caption="取样批次^长度方向位置^宽度方向位置" colsep="^" colwidth="177, 145, 88" defaultrows="2" mergecellsfixedrows="bycolrec" rowheight="30" rowsep="|" tooltip="label" style="left:0px; top:555px; width:450px; height:59px; ">
  322. <col ref="SMP_LOT_CD" type="combo" style="text-align:left; background-color:#ffff99; ">
  323. <choices>
  324. <itemset nodeset="/root/findInitData/LOT/LotResult_Row">
  325. <label ref="SM_CFNM"/>
  326. <value ref="SM_CD"/>
  327. </itemset>
  328. </choices>
  329. </col>
  330. <col ref="SMP_LEN_LOC" type="combo" style="text-align:left; background-color:#ffff99; ">
  331. <choices>
  332. <itemset nodeset="/root/findInitData/LEN/LenResult_Row">
  333. <label ref="SM_CFNM"/>
  334. <value ref="SM_CD"/>
  335. </itemset>
  336. </choices>
  337. </col>
  338. <col ref="SMP_WTH_LOC" type="combo" style="text-align:left; background-color:#ffff99; ">
  339. <choices>
  340. <itemset nodeset="/root/findInitData/WTH/WthResult_Row">
  341. <label ref="SM_CFNM"/>
  342. <value ref="SM_CD"/>
  343. </itemset>
  344. </choices>
  345. </col>
  346. </datagrid>
  347. <button id="button2" style="left:390px; top:535px; width:70px; height:20px; background-image:../../images/btn_add.gif; ">
  348. <caption>增加</caption>
  349. <script type="javascript" ev:event="onclick">
  350. <![CDATA[
  351. if(datagrid3.rows == datagrid3.fixedRows)
  352. {
  353. datagrid3.addRow();
  354. }
  355. ]]>
  356. </script>
  357. </button>
  358. <button id="button5" visibility="hidden" style="left:120px; top:35px; width:100px; height:20px; ">
  359. <caption>button5</caption>
  360. <script type="javascript" ev:event="onclick">
  361. <![CDATA[
  362. save();
  363. ]]>
  364. </script>
  365. </button>
  366. </xhtml:body>
  367. </xhtml:html>