UIA020010.xrw 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343
  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>Untitle</xhtml:title>
  6. <model id="model1">
  7. <instance id="instance1">
  8. <root xmlns="">
  9. <formData>
  10. <LoginUserID/>
  11. <ElmtDesc/>
  12. <ElmtSeq/>
  13. </formData>
  14. <gridData>
  15. </gridData>
  16. <reqData/>
  17. <resData/>
  18. <LOVData>
  19. </LOVData>
  20. <initData/>
  21. </root>
  22. </instance>
  23. <script type="javascript" ev:event="xforms-ready">
  24. <![CDATA[
  25. commSubmit("UIA020010-service" ,"success" ,"glueAction.do" );
  26. errorMessage();
  27. model.refresh();
  28. ]]>
  29. </script>
  30. <script type="javascript">
  31. <![CDATA[
  32. //1、获取用户登录信息,只能在页面初始化函数中调用
  33. function InitParams(node) {
  34. if (typeof node == "undefined" && typeof node != "object") return;
  35. model.removenode("/root/initData/rcvInfo");
  36. model.makeNode("/root/initData/rcvInfo");
  37. var nodeList = node.childNodes;
  38. node = model.instances(0).selectSingleNode("/root/initData/rcvInfo");
  39. for (var i = 0; i < nodeList.length; i++) {
  40. node.appendChild(nodeList.item(i));
  41. }
  42. // "/root/initData/rcvInfo/REG_ID" = "USER_CD"
  43. }
  44. //2. 页面初始化函数(必须)
  45. function Init(node)
  46. {
  47. InitParams(node); // 用于设置节点:/root/initData/rcvInfo,获取用户登录信息
  48. // 在程序中会重建该节点,最好不要重名
  49. // 函数 InitParams 在 mesCommon.js 中,仅在需要使用登录用户信息时调用
  50. //...
  51. }
  52. //3、页面标题
  53. function setTitle()
  54. {
  55. return "销售管理 > 交货期设定 > 交货期计算因素录入"; // 如:return "进程管理>>订单进程现况查询";
  56. }
  57. function find() {
  58. model.removeNodeset(dg1.nodeset);
  59. model.removeNodeset(dg2.nodeset);
  60. dg1.clearStatus();
  61. commSendReq("/root/formData");
  62. commSubmit("UIA020010-service","find","glueAction.do");
  63. errorMessage();
  64. commAppendData("/root/gridData/ListResult_1_VO" ,"/root/resData/ListResult_1_VO");
  65. commAppendData("/root/gridData/ListResult_2_VO" ,"/root/resData/ListResult_2_VO");
  66. dg1.rebuild();
  67. var iCnt = Number(model.getXPathValue("count(/root/gridData/ListResult_1_VO/ListResult_1_Row)"));
  68. if( iCnt > 0 ) {
  69. model.setFocus("dg1");
  70. dg1.row = dg1.fixedRows;
  71. dg1.isSelected(dg1.row) = true;
  72. dg1.col = dg1.colRef("ELMT_DESC");
  73. dg1.editCell();
  74. dg2.nodeset="/root/gridData/ListResult_2_VO/ListResult_2_Row[ELMT_SEQ="+dg1.valueMatrix(dg1.row,dg1.colRef("ELMT_SEQ"))+"]";
  75. }
  76. model.refresh();
  77. }
  78. // 保存按键
  79. function save() {
  80. if( (requiredRow != 0) || (requiredCol != 0) ) {
  81. dg1.row = requiredRow;
  82. dg1.col = requiredCol;
  83. dg1.editCell();
  84. return;
  85. }
  86. model.removenode("/root/reqData");
  87. model.makeNode("/root/reqData");
  88. model.makeValue("/root/reqData/REG_ID" , model.getValue("/root/initData/rcvInfo/REG_ID"));
  89. model.makeValue("/root/reqData/MOD_ID" , model.getValue("/root/initData/rcvInfo/REG_ID"));
  90. commMultiUpdate(dg1,"/root/reqData" ,"A" ,true ,"rowStatus1" );
  91. commSubmit("UIA020010-service" ,"save" ,"glueAction.do" );
  92. errorMessage();
  93. model.removeNodeset(dg1.nodeset);
  94. model.removeNodeset(dg2.nodeset);
  95. dg1.clearStatus();
  96. commAppendData("/root/gridData/ListResult_1_VO" ,"/root/resData/ListResult_1_VO");
  97. commAppendData("/root/gridData/ListResult_2_VO" ,"/root/resData/ListResult_2_VO");
  98. dg1.refresh();
  99. var iCnt = Number(model.getXPathValue("count(/root/gridData/ListResult_1_VO/ListResult_1_Row)"));
  100. if( iCnt > 0 ) {
  101. model.setFocus("dg1");
  102. dg1.row = dg1.fixedRows;
  103. dg1.isSelected(dg1.row) = true;
  104. dg1.col = dg1.colRef("ELMT_DESC");
  105. dg1.editCell();
  106. dg2.nodeset="/root/gridData/ListResult_2_VO/ListResult_2_Row[ELMT_SEQ="+dg1.valueMatrix(dg1.row,dg1.colRef("ELMT_SEQ"))+"]";
  107. }
  108. model.refresh();
  109. }
  110. // 新增按键
  111. function create() {
  112. if( (requiredRow != 0) || (requiredCol != 0) ) {
  113. dg1.row = requiredRow;
  114. dg1.col = requiredCol;
  115. dg1.editCell();
  116. return;
  117. }
  118. //commAddRow(dg1);
  119. dg1.addRow();
  120. dg1.row = dg1.rows - 1;
  121. dg1.isSelected(dg1.rows) = true;
  122. var NextElmtSeq = Number( model.getValue("/root/resData/LOVResult_3_VO/LOVResult_3_Row/MAX_ELMT_SEQ") ) + 1;
  123. model.setValue("/root/resData/LOVResult_3_VO/LOVResult_3_Row/MAX_ELMT_SEQ", NextElmtSeq);
  124. dg1.valueMatrix(dg1.row, dg1.colRef("CHK") ) = "Y";
  125. dg1.valueMatrix(dg1.row, dg1.colRef("ELMT_SEQ") ) = NextElmtSeq;
  126. dg1.col = dg1.colRef("ELMT_DESC");
  127. dg1.editCell();
  128. }
  129. // 删除按键
  130. function remove() {
  131. requiredRow = 0;
  132. requiredCol = 0;
  133. var cValue = dg1.valueMatrix(dg1.row, dg1.colRef("ELMT_SEQ"));
  134. if( cValue == model.getValue("/root/resData/LOVResult_3_VO/LOVResult_3_Row/MAX_ELMT_SEQ") ) {
  135. var NextElmtSeq = Number( model.getValue("/root/resData/LOVResult_3_VO/LOVResult_3_Row/MAX_ELMT_SEQ") ) - 1;
  136. model.setValue("/root/resData/LOVResult_3_VO/LOVResult_3_Row/MAX_ELMT_SEQ", NextElmtSeq);
  137. }
  138. var iCnt = Number(model.getXPathValue("count(/root/gridData/ListResult_2_VO/ListResult_2_Row[ELMT_SEQ='"+ cValue +"'])"));
  139. if( iCnt > 0 ) {
  140. alert("Cannot delete the row.!!! Child Record exists.");
  141. return;
  142. }
  143. dg1.deleteRow(dg1.row, true);
  144. dg1.dispatch("onrowchanged");
  145. }
  146. var requiredRow = 0;
  147. var requiredCol = 0;
  148. ]]>
  149. </script>
  150. </model>
  151. <script type="javascript" src="../../js/boaMsg.js"/>
  152. <script type="javascript" src="../../js/boaCommon.js"/>
  153. <script type="javascript" src="../../js/dCommon.js"/>
  154. </xhtml:head>
  155. <xhtml:body guideline="2,619;1,980;" style="font-family:Tahoma; ">
  156. <line id="line1" style="x1:0px; y1:0px; x2:980px; y2:0px; "/>
  157. <caption id="ctElmtDesc" class="cell" style="left:0px; top:3px; width:95px; height:20px; text-align:center; vertical-align:middle; border-color:#000000; border-style:solid; ">交货期因素名</caption>
  158. <input id="ElmtDesc" ref="/root/formData/ElmtDesc" style="left:97px; top:3px; width:135px; height:20px; "/>
  159. <line id="line3" style="x1:0px; y1:25px; x2:980px; y2:25px; "/>
  160. <datagrid id="dg1" nodeset="/root/gridData/ListResult_1_VO/ListResult_1_Row" scroll="autovscroll" caption=".交货期.因素序号^交货期因素名称^表示顺序^需要天数^录入人^录入时间^修改人^修改时间^说明|.交货期.因素序号^交货期因素名称^表示顺序^需要天数^录入人^录入时间^修改人^修改时间^说明" colsep="^" colwidth="60, 120, 60, 65, 70, 120, 70, 120, 249, 0" defaultrows="30" explorerbar="sort" mergecellsfixedrows="bycolrec" rowsep="|" style="left:0px; top:28px; width:980px; height:307px; ">
  161. <col editable="false" key="true" ref="ELMT_SEQ" type="input" style="text-align:right; "/>
  162. <col key="false" ref="ELMT_DESC" type="input" style="text-align:left; background-color:#ffff99; "/>
  163. <col key="false" ref="DEFAULT_SEQ" type="input" style="text-align:right; background-color:#ffff99; "/>
  164. <col key="false" ref="TERM_DAYS" type="input" format="#,###.#" style="text-align:right; background-color:#ffff99; "/>
  165. <col editable="false" key="false" ref="REG_ID" type="input" style="text-align:left; "/>
  166. <col editable="false" key="false" ref="REG_DTIME" type="input" style="text-align:center; "/>
  167. <col editable="false" key="false" ref="MOD_ID" type="input" style="text-align:left; "/>
  168. <col editable="false" key="false" ref="MOD_DTIME" type="input" style="text-align:center; "/>
  169. <col key="false" ref="TERM_DAYS_DESC" type="input" style="text-align:left; background-color:#ffff99; "/>
  170. <col checkvalue="Y,N" key="false" ref="CHK" type="checkbox" visibility="hidden" style="text-align:left; "/>
  171. <script type="javascript" ev:event="onrowchanged">
  172. <![CDATA[
  173. dg2.nodeset="/root/gridData/ListResult_2_VO/ListResult_2_Row[ELMT_SEQ="+dg1.valueMatrix(dg1.row,dg1.colRef("ELMT_SEQ"))+"]";
  174. ]]>
  175. </script>
  176. <script type="javascript" ev:event="onentercell">
  177. <![CDATA[
  178. if( (requiredRow != 0) || (requiredCol != 0) ) {
  179. dg1.row = requiredRow;
  180. dg1.col = requiredCol;
  181. dg1.editCell();
  182. return;
  183. }
  184. if( dg1.colAttribute(dg1.col,"editable") != "false" ) {
  185. dg1.editCell();
  186. }
  187. ]]>
  188. </script>
  189. <script type="javascript" ev:event="onendedit">
  190. <![CDATA[
  191. //
  192. var iRow = dg1.row;
  193. var reqValue_1 = dg1.valueMatrix(iRow, dg1.colRef("ELMT_DESC" ));
  194. var reqValue_2 = dg1.valueMatrix(iRow, dg1.colRef("DEFAULT_SEQ" ));
  195. var reqValue_3 = dg1.valueMatrix(iRow, dg1.colRef("TERM_DAYS" ));
  196. // Global Variables
  197. requiredRow = 0;
  198. requiredCol = 0;
  199. if( reqValue_1 == "" ) {
  200. // alert("Please, enter the ELMT_DESC value");
  201. requiredRow = iRow;
  202. requiredCol = dg1.colRef("ELMT_DESC");
  203. return;
  204. }
  205. // Global Variables
  206. requiredRow = 0;
  207. requiredCol = 0;
  208. if( reqValue_2 == "" ) {
  209. // alert("Please, enter the DEFAULT_SEQ value");
  210. requiredRow = iRow;
  211. requiredCol = dg1.colRef("DEFAULT_SEQ");
  212. return;
  213. }
  214. // Global Variables
  215. requiredRow = 0;
  216. requiredCol = 0;
  217. if( reqValue_3 == "" ) {
  218. // alert("Please, enter the TERM_DAYS value");
  219. requiredRow = iRow;
  220. requiredCol = dg1.colRef("TERM_DAYS");
  221. return;
  222. }
  223. ]]>
  224. </script>
  225. </datagrid>
  226. <datagrid id="dg2" nodeset="/root/gridData/ListResult_2_VO/ListResult_2_Row" scroll="autovscroll" caption="SEQ^标准牌号^交货期分类^需要天数^录入人^录入时间^修改人^修改时间^说明|SEQ^标准牌号^交货期分类^需要天数^录入人^录入时间^修改人^修改时间^说明" colsep="^" colwidth="45, 95, 100, 65, 70, 120, 70, 120, 309, 100, 100" defaultrows="30" explorerbar="sort" mergecellsfixedrows="bycolrec" rowsep="|" style="left:0px; top:365px; width:980px; height:254px; ">
  227. <col editable="false" ref="RN" type="input" style="text-align:center; "/>
  228. <col editable="false" ref="SPEC_STL_GRD" type="input" style="text-align:left; "/>
  229. <col editable="false" ref="DLVT_GRP_TP_DESC" type="input" style="text-align:left; "/>
  230. <col editable="false" ref="TERM_DAYS" type="input" format="#,###.#" style="text-align:right; "/>
  231. <col editable="false" ref="REG_ID" type="input" style="text-align:left; "/>
  232. <col editable="false" ref="REG_DTIME" type="input" style="text-align:center; "/>
  233. <col editable="false" ref="MOD_ID" type="input" style="text-align:left; "/>
  234. <col editable="false" ref="MOD_DTIME" type="input" style="text-align:center; "/>
  235. <col editable="false" ref="TERM_DAYS_DESC" type="input" style="text-align:left; "/>
  236. <col editable="false" ref="ELMT_SEQ" type="input" visibility="hidden" style="text-align:left; "/>
  237. <col editable="false" ref="DLVT_GRP_TP" type="input" visibility="hidden" style="text-align:left; "/>
  238. </datagrid>
  239. <button id="button1" visibility="hidden" style="left:685px; top:3px; width:70px; height:20px; background-color:#c0c0c0; ">
  240. <caption>FIND</caption>
  241. <script type="javascript" ev:event="DOMActivate">
  242. <![CDATA[
  243. find();
  244. ]]>
  245. </script>
  246. </button>
  247. <button id="button2" visibility="hidden" style="left:760px; top:3px; width:70px; height:20px; background-color:#c0c0c0; ">
  248. <caption>CREATE</caption>
  249. <script type="javascript" ev:event="DOMActivate">
  250. <![CDATA[
  251. create();
  252. ]]>
  253. </script>
  254. </button>
  255. <button id="button3" visibility="hidden" style="left:835px; top:3px; width:70px; height:20px; background-color:#c0c0c0; ">
  256. <caption>DELETE</caption>
  257. <script type="javascript" ev:event="DOMActivate">
  258. <![CDATA[
  259. remove();
  260. ]]>
  261. </script>
  262. </button>
  263. <button id="button4" visibility="hidden" style="left:910px; top:3px; width:70px; height:20px; background-color:#c0c0c0; ">
  264. <caption>SAVE</caption>
  265. <script type="javascript" ev:event="DOMActivate">
  266. <![CDATA[
  267. save();
  268. ]]>
  269. </script>
  270. </button>
  271. <line id="line4" style="x1:0px; y1:362px; x2:980px; y2:362px; "/>
  272. <line id="line2" style="x1:0px; y1:337px; x2:980px; y2:337px; "/>
  273. <caption id="caption1" class="cell" style="left:0px; top:340px; width:165px; height:20px; text-align:left; vertical-align:middle; padding-left:3px; border-color:#000000; border-style:solid; ">Instance of usage</caption>
  274. </xhtml:body>
  275. </xhtml:html>