| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484 |
- <?xml version="1.0" encoding="UTF-8"?>
- <?xml-stylesheet type="text/css" href="../../css/body.css" ?>
- <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">
- <xhtml:head>
- <xhtml:title>
- <![CDATA[品质设计>>成分参数录入>>客户成分参数录入]]>
- </xhtml:title>
- <model id="model1">
- <instance id="instance1">
- <root xmlns="">
- <formData>
- <CODE/>
- <CoName/>
- <NF_TP>1</NF_TP>
- <COPY_TP>X</COPY_TP>
- </formData>
- <datagrid1/>
- <datagrid2/>
- <datagrid3/>
- <datagrid4/>
- <datagrid5/>
- <initData>
- <ComputerCDResult_Row>
- <LABEL/>
- <VALUE/>
- </ComputerCDResult_Row>
- </initData>
- <reqData/>
- <tempData/>
- </root>
- </instance>
- <script type="javascript" ev:event="xforms-ready">
- <![CDATA[
- if(window.parent==null) Init();
- ]]>
- </script>
- </model>
- <script type="javascript" src="../../js/boaCommon.js"/>
- <script type="javascript" src="../../js/b01.js"/>
- <script type="javascript">
- <![CDATA[
- var currentRow = 0;
- /*页面函数*/
- function Init(node)
- {
- InitParams(node);
- }
-
- function find()
- {
- model.removenode("/root/reqData");
- model.makeNode("/root/reqData");
-
- commSendReq("/root/formData");
- ///若客户公司名称不为空,则按客户公司名称查询;否则按客户公司代码查询
- commSubmit("UIB010030-service", "findCode", "glueAction.do");
- model.copyNode("/root/datagrid1","/root/resData/ComputerResult_VO");
- model.refresh();
- //清除删除、插入、更新状态
- clearGridStatus();
- resetGridData();
- datagrid1.cellAttribute("disabled",datagrid1.fixedRows , datagrid1.fixedCols , datagrid1.rows - 1 , datagrid1.cols - 1) = "true";
- }
-
- function save()
- {
- if(currentRow == 0) {window.alert("非法操作" , "提示");return;}
- if(commComfirmBox("确认保存?","提示")=="0") return;
-
- model.removenode("/root/reqData");
- model.makeNode("/root/reqData");
- model.removenode("/root/tempData1");//对应表1
- model.makeNode("/root/tempData1");
- model.removenode("/root/tempData2");//对应表2
- model.makeNode("/root/tempData2");
- model.removenode("/root/tempData3");//对应表3
- model.makeNode("/root/tempData3");
- model.removenode("/root/tempData4");//对应表4
- model.makeNode("/root/tempData4");
- model.removenode("/root/tempData5");//对应表5
- model.makeNode("/root/tempData5");
-
- b01MultiUpdate(datagrid2,"/root/tempData2" ,"A", true, "rowStuts");
- b01MultiUpdate(datagrid3,"/root/tempData3" ,"A", true, "rowStuts");
- b01MultiUpdate(datagrid4,"/root/tempData4" ,"A", true, "rowStuts");
- b01MultiUpdate(datagrid5,"/root/tempData5" ,"A", true, "rowStuts");
- commSendReq("/root/datagrid1/ComputerResult_Row["+currentRow+"]"
- ,"/root/formData" , "/root/tempData1" , "/root/tempData2"
- ,"/root/tempData3" , "/root/tempData4" , "/root/tempData5");
- getLoggingInInfo();
- commSubmit("UIB010030-service", "save", "glueAction.do");
- model.refresh();
- currentRow = 0;
- clearGridStatus();
- datagrid1.cellAttribute("disabled",datagrid1.fixedRows , datagrid1.fixedCols , datagrid1.rows - 1 , datagrid1.cols - 1) = "true";
- }
-
- function clearGridStatus()
- {
- datagrid1.clearStatus();
- datagrid2.clearStatus();
- datagrid3.clearStatus();
- datagrid4.clearStatus();
- datagrid5.clearStatus();
- }
-
- function resetGridData()
- {
- model.removenode("/root/datagrid2");
- model.removenode("/root/datagrid3");
- model.removenode("/root/datagrid4");
- model.removenode("/root/datagrid5");
- model.makeNode("/root/datagrid2");
- model.makeNode("/root/datagrid3");
- model.makeNode("/root/datagrid4");
- model.makeNode("/root/datagrid5");
- model.refresh();
- }
-
- function findchem()
- {
- if(datagrid1.col !=0)
- {
- model.removenode("/root/reqData");
- model.makeNode("/root/reqData");
- commSendReq("/root/formData" , "/root/datagrid1/ComputerResult_Row["+datagrid1.row+"]");
- commSubmit("UIB010030-service", "findChem", "glueAction.do");
-
- //调用b01.js文件中的copyFixNode方法,执行拷贝
- copyFixNode("/root/datagrid2","/root/resData/ChemResult_VO/ChemResult_Row",1,13);
- copyFixNode("/root/datagrid3","/root/resData/ChemResult_VO/ChemResult_Row",14,26);
- copyFixNode("/root/datagrid4","/root/resData/ChemResult_VO/ChemResult_Row",27,50);
- model.copyNode("/root/datagrid5" , "/root/resData/CompChemResult_VO");
- model.refresh();
- }
- }
- ]]>
- </script>
- </xhtml:head>
- <xhtml:body pagewidth="980" pageheight="620" style="font-family:宋体; font-size:14pt; ">
- <caption id="caption2" class="cell" style="left:0px; top:5px; width:70px; height:20px; text-align:left; border-style:solid; ">客户公司</caption>
- <datagrid id="datagrid1" nodeset="/root/datagrid1/ComputerResult_Row" caption="客户代码^交货状态^序号^产线^标准牌号^公司名称^查询" colsep="^" colwidth="50, 36, 34, 43, 68, 83, 22" defaultrows="28" mergecellsfixedrows="bycolrec" rowheader="seq" rowheight="35" rowsep="|" tooltip="label" style="left:0px; top:55px; width:375px; height:565px; border-style:solid; ">
- <col ref="CUST_CD" type="input" style="text-align:right; background-color:#ffff99; "/>
- <col ref="PRDNM_CD" type="input" maxlength="2" style="text-align:left; background-color:#ffff99; "/>
- <col ref="SEQ" type="input" maxlength="2" style="text-align:right; background-color:#ffff99; "/>
- <col ref="PROD_LINE" type="input" style="background-color:#ffff99; "/>
- <col ref="SPEC_STL_GRD" type="input" style="text-align:left; background-color:#ffff99; "/>
- <col ref="CUST_NM" style="text-align:left; "/>
- <col ref="QUERY" style="cursor:hand; "/>
- <script type="javascript" ev:event="xforms-value-changed">
- <![CDATA[
- //当值发生改变的时候,隐藏列的值相应改变,因为删除时候使用的是隐藏列
- var row = datagrid1.row;//当前行
- datagrid1.valueMatrix(row ,datagrid1.colRef("CUST_SPEC_NO"))=datagrid1.valueMatrix(row ,1)+datagrid1.valueMatrix(row ,2)+datagrid1.valueMatrix(row ,3);
- ]]>
- </script>
- <script type="javascript" ev:event="onclick">
- <![CDATA[
- if(datagrid1.colRef("QUERY") == datagrid1.col && datagrid1.row >= datagrid1.fixedRows)
- {
- if(datagrid1.rowStatus(datagrid1.rows-1) == 1)
- {
- window.alert("增加状态下不允许该操作!" , "警告");
- datagrid1.row = datagrid1.rows-1;
- return;
- }
- if(beGridChanged(datagrid1,datagrid2,datagrid3,datagrid4,datagrid5) == "1" && currentRow != 0)
- {
- if(commComfirmBox("数据已修改,是否保存被修改的数据?","提示")=="0")
- {
- clearGridStatus();
- }
- else
- {
- save();
- }
- }
- currentRow = datagrid1.row;
- datagrid1.col = 1;//转移焦点,以免拖动滚动条时又做了查询
- findchem();
- }
- ]]>
- </script>
- <script type="javascript" ev:event="onkeydown">
- <![CDATA[
- datagrid1.editCell();
- ]]>
- </script>
- </datagrid>
- <datagrid id="datagrid2" nodeset="/root/datagrid2/ChemResult_Row" caption="成分^最小^最大^类型^COMP_YN" colsep="^" colwidth="45, 50, 50, 50, 43" defaultrows="14" mergecellsfixedrows="bycolrec" rowsep="|" selectionmode="free" style="left:376px; top:35px; width:199px; height:296px; border-style:solid; ">
- <col editable="false" ref="CHEM_CD" style="text-align:left; background-color:#ffffff; "/>
- <col ref="CHEM_MIN" type="input" style="text-align:right; background-color:#ffff99; "/>
- <col ref="CHEM_MAX" type="input" style="text-align:right; background-color:#ffff99; "/>
- <col ref="CHEM_DEC_CD" type="input" style="background-color:#ffff99; "/>
- <col ref="COMP_YN" visibility="hidden"/>
- <script type="javascript" ev:event="onkeydown">
- <![CDATA[
- onkeydownmove(datagrid2);
- ]]>
- </script>
- <script type="javascript" ev:event="onentercell">
- <![CDATA[
- datagrid2.editCell();
- ]]>
- </script>
- <script type="javascript" ev:event="xforms-value-changed">
- <![CDATA[
- compareMINMAX(datagrid2,"CHEM_MIN","CHEM_MAX") //验证最大值不能小于最小值
- ]]>
- </script>
- </datagrid>
- <datagrid id="datagrid3" nodeset="/root/datagrid3/ChemResult_Row" caption="成分^最小^最大^类型^EX" colsep="^" colwidth="45, 50, 50, 50, 58" defaultrows="14" mergecellsfixedrows="bycolrec" rowsep="|" selectionmode="free" style="left:577px; top:35px; width:201px; height:296px; border-style:solid; ">
- <col editable="false" ref="CHEM_CD" style="text-align:left; background-color:#ffffff; "/>
- <col ref="CHEM_MIN" type="input" style="text-align:right; background-color:#ffff99; "/>
- <col ref="CHEM_MAX" type="input" style="text-align:right; background-color:#ffff99; "/>
- <col ref="CHEM_DEC_CD" type="input" style="background-color:#ffff99; "/>
- <col ref="COMP_YN" visibility="hidden"/>
- <script type="javascript" ev:event="onkeydown">
- <![CDATA[
- onkeydownmove(datagrid3);
- ]]>
- </script>
- <script type="javascript" ev:event="onentercell">
- <![CDATA[
- datagrid3.editCell();
- ]]>
- </script>
- <script type="javascript" ev:event="xforms-value-changed">
- <![CDATA[
- compareMINMAX(datagrid3,"CHEM_MIN","CHEM_MAX") //验证最大值不能小于最小值
- ]]>
- </script>
- </datagrid>
- <datagrid id="datagrid4" nodeset="/root/datagrid4/ChemResult_Row" caption="成分^最小^最大^类型^COMP_YN" colsep="^" colwidth="45, 50, 50, 50, 31" defaultrows="14" mergecellsfixedrows="bycolrec" rowsep="|" selectionmode="free" style="left:780px; top:35px; width:198px; height:296px; border-style:solid; ">
- <col editable="false" ref="CHEM_CD" style="text-align:left; background-color:#ffffff; "/>
- <col ref="CHEM_MIN" type="input" style="text-align:right; background-color:#ffff99; "/>
- <col ref="CHEM_MAX" type="input" style="text-align:right; background-color:#ffff99; "/>
- <col ref="CHEM_DEC_CD" type="input" style="background-color:#ffff99; "/>
- <col ref="COMP_YN" visibility="hidden"/>
- <script type="javascript" ev:event="onentercell">
- <![CDATA[
- datagrid4.editCell();
- ]]>
- </script>
- <script type="javascript" ev:event="onkeydown">
- <![CDATA[
- onkeydownmove(datagrid4);
- ]]>
- </script>
- <script type="javascript" ev:event="xforms-value-changed">
- <![CDATA[
- compareMINMAX(datagrid4,"CHEM_MIN","CHEM_MAX") //验证最大值不能小于最小值
- ]]>
- </script>
- </datagrid>
- <datagrid id="datagrid5" nodeset="/root/datagrid5/CompChemResult_Row" caption="成分^复合元素与计算式^最小^最大^类型^COMP_YN^chem_cd" colsep="^" colwidth="60, 361, 49, 58, 57, 50, 53" defaultrows="13" mergecellsfixedrows="bycolrec" rowsep="|" selectionmode="free" style="left:375px; top:335px; width:600px; height:285px; border-style:solid; ">
- <col ref="COMP_DETAIL" style="text-align:left; "/>
- <col ref="COMP_CAL" style="text-align:left; "/>
- <col ref="CHEM_MIN" type="input" style="text-align:right; background-color:#ffff99; "/>
- <col ref="CHEM_MAX" type="input" style="text-align:right; background-color:#ffff99; "/>
- <col ref="CHEM_DEC_CD" type="input" style="background-color:#ffff99; "/>
- <col ref="COMP_YN" visibility="hidden"/>
- <col ref="CHEM_CD" visibility="hidden"/>
- <script type="javascript" ev:event="onentercell">
- <![CDATA[
- datagrid5.editCell();
- ]]>
- </script>
- <script type="javascript" ev:event="onkeydown">
- <![CDATA[
- onkeydownmove(datagrid5);
- ]]>
- </script>
- <script type="javascript" ev:event="xforms-value-changed">
- <![CDATA[
- compareMINMAX(datagrid5,"CHEM_MIN","CHEM_MAX") //验证最大值不能小于最小值
- ]]>
- </script>
- </datagrid>
- <button id="button5" style="left:230px; top:35px; width:70px; height:18px; background-image:../../images/btn_add.gif; ">
- <caption>增加</caption>
- <script type="javascript" ev:event="onclick">
- <![CDATA[
- // if(model.getValue("/root/formData/CODE") == "")
- // {
- // window.alert("请选择客户公司" , "提示");
- // return;
- // }
- if(beGridChanged(datagrid1,datagrid2,datagrid3,datagrid4,datagrid5) == "1")
- {
- window.alert("数据已修改,请保存后再进行增加!" , "提示");
- return;
- }
-
- if(datagrid2.rows > 1)
- {
- if(commComfirmBox("是否保留表中成分数据?","提示")=="0")
- {//不保留
- model.removenode("/root/reqData");
- model.makeNode("/root/reqData");
- commSubmit("UIB010030-service", "findSeqChem", "glueAction.do");
-
- //调用b01.js文件中的copyFixNode方法,执行拷贝
- copyFixNode("/root/datagrid2","/root/resData/ChemResult_VO/ChemResult_Row",1,13);
- copyFixNode("/root/datagrid3","/root/resData/ChemResult_VO/ChemResult_Row",14,26);
- copyFixNode("/root/datagrid4","/root/resData/ChemResult_VO/ChemResult_Row",27,50);
- model.copyNode("/root/datagrid5" , "/root/resData/CompChemResult_VO");
- model.refresh();
- clearGridStatus();
- }
- else
- {
- for(var i = 1;i<datagrid2.rows;i++)
- {
- //grid2
- if(datagrid2.valueMatrix(i,1) != ""||datagrid2.valueMatrix(i,2) != "")
- {
- datagrid2.addStatus(i,"update");
- }
- }
- //grid3
- for(var i = 1;i<datagrid3.rows;i++)
- {
- if(datagrid3.valueMatrix(i,1) != ""||datagrid3.valueMatrix(i,2) != "")
- {
- datagrid3.addStatus(i,"update");
- }
- }
- //grid4
- for(var i = 1;i<datagrid4.rows;i++)
- {
- if(datagrid4.valueMatrix(i,1) != ""||datagrid4.valueMatrix(i,2) != "")
- {
- datagrid4.addStatus(i,"update");
- }
- }
- //grid5
- for(var i = 1;i<datagrid5.rows;i++)
- {
- if(datagrid5.valueMatrix(i,2) != ""||datagrid5.valueMatrix(i,3) != "")
- {
- datagrid5.addStatus(i,"update");
- }
- }
- }
- }
- else
- {
- model.removenode("/root/reqData");
- model.makeNode("/root/reqData");
- commSubmit("UIB010030-service", "findSeqChem", "glueAction.do");
-
- //调用b01.js文件中的copyFixNode方法,执行拷贝
- copyFixNode("/root/datagrid2","/root/resData/ChemResult_VO/ChemResult_Row",1,13);
- copyFixNode("/root/datagrid3","/root/resData/ChemResult_VO/ChemResult_Row",14,26);
- copyFixNode("/root/datagrid4","/root/resData/ChemResult_VO/ChemResult_Row",27,50);
- model.copyNode("/root/datagrid5" , "/root/resData/CompChemResult_VO");
- model.refresh();
- clearGridStatus();
- }
- datagrid1.cellAttribute("disabled",datagrid1.fixedRows , datagrid1.fixedCols , datagrid1.rows - 1 , datagrid1.cols - 1) = "true";
- datagrid1.addRow();
- currentRow = datagrid1.row;
- datagrid1.valueMatrix(currentRow , datagrid1.colRef("CUST_CD")) = model.getValue("/root/formData/CODE");
- datagrid1.vscroll.attribute("pos") = datagrid1.rows*20;
- ]]>
- </script>
- </button>
- <button id="button4" style="left:295px; top:35px; width:80px; height:20px; background-image:../../images/btn_move.gif; ">
- <caption>删除</caption>
- <script type="javascript" ev:event="onclick">
- <![CDATA[
- if(beGridChanged(datagrid1,datagrid2,datagrid3,datagrid4,datagrid5) == "1")
- {
- window.alert("数据已修改,请保存或初始化!" , "警告");
- return;
- }
- if(datagrid1.row < datagrid1.fixedRows) return;
- if(commComfirmBox("确认删除?","提示")=="0") return;
- datagrid1.deleteRow(datagrid1.row);
- model.removenode("/root/reqData");
- model.makeNode("/root/reqData");
- b01MultiUpdate(datagrid1,"/root/tempData1" ,"A", true, "rowStuts0");
- commSendReq("/root/tempData1" ,"/root/formData" );
- getLoggingInInfo();
- commSubmit("UIB010030-service", "save", "glueAction.do");
- model.refresh();
- resetGridData();
- currentRow = 0;
- ]]>
- </script>
- </button>
- <line id="line2" style="x1:0px; y1:0px; x2:980px; y2:0px; "/>
- <line id="line1" style="x1:0px; y1:30px; x2:980px; y2:30px; "/>
- <input id="input1" ref="/root/formData/CODE" visibility="hidden" editable="false" style="left:540px; top:5px; width:100px; height:20px; "/>
- <button id="button1" style="left:360px; top:5px; width:70px; height:20px; text-align:center; background-image:../../images/btn_add.gif; ">
- <caption>选择</caption>
- <script type="javascript" ev:event="onclick">
- <![CDATA[
- var vleft = window.screenLeft +100 ; //- 355;
- var vtop = window.screenTop + 100 ;//- 250;
- window.load("../Common/_Customer.xrw",
- "modal",
- "",
- "left:"+vleft+"; top:"+vtop+"; width:810; height:510; sysmenu:visible; min:visible; max:true; resize:true; caption:hidden;",
- "/root/interface", "/root/initData");
- ]]>
- </script>
- </button>
- <input id="input2" ref="/root/formData/CoName" style="left:70px; top:5px; width:285px; height:20px; "/>
- <button id="button99" visibility="hidden" style="left:785px; top:5px; width:100px; height:20px; ">
- <caption>FIND</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- find();
- ]]>
- </script>
- </button>
- <select1 id="combo1" ref="/root/formData/NF_TP" appearance="minimal" style="left:425px; top:5px; width:100px; height:20px; ">
- <choices>
- <item>
- <label>内控</label>
- <value>1</value>
- </item>
- <item>
- <label>炼钢放行</label>
- <value>3</value>
- </item>
- <item>
- <label>成品放行</label>
- <value>2</value>
- </item>
- </choices>
- <script type="javascript" ev:event="xforms-value-changed">
- <![CDATA[
- find();
- ]]>
- </script>
- </select1>
- <button id="button2" style="left:0px; top:35px; width:70px; height:20px; text-align:center; background-image:../../images/btn_add.gif; ">
- <caption>复制到</caption>
- <script type="javascript" ev:event="onclick">
- <![CDATA[
- if(commComfirmBox("确认拷贝"+datagrid1.valueMatrix(datagrid1.row , datagrid1.colRef("CUST_CD"))+datagrid1.valueMatrix(datagrid1.row , datagrid1.colRef("PRDNM_CD"))+datagrid1.valueMatrix(datagrid1.row , datagrid1.colRef("SEQ"))
- +",从"+combo1.label+"到"+combo2.label+"?" ,"提示")=="0")
- {
- return;
- }
- if(datagrid1.row < 1 ) return ;
- if(model.getValue("/root/formData/COPY_TP") == "X")return;
- model.removenode("/root/reqData");
- model.makeNode("/root/reqData/");
- commSendReq("/root/formData" , "/root/datagrid1/ComputerResult_Row["+datagrid1.row+"]");
- model.makeValue("/root/reqData/XX" , "UIB010030");
- getLoggingInInfo();
- commSubmit("UIB010030-service", "save1", "glueAction.do");
- model.refresh();
- ]]>
- </script>
- </button>
- <select1 id="combo2" ref="/root/formData/COPY_TP" appearance="minimal" style="left:65px; top:35px; width:100px; height:20px; ">
- <choices>
- <item>
- <label/>
- <value>X</value>
- </item>
- <item>
- <label>内控</label>
- <value>1</value>
- </item>
- <item>
- <label>炼钢放行</label>
- <value>3</value>
- </item>
- <item>
- <label>成品放行</label>
- <value>2</value>
- </item>
- </choices>
- </select1>
- </xhtml:body>
- </xhtml:html>
|