SMRTS00700.js 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750
  1. var MAX_WID = 800;
  2. var BASE_PATH = "/root/main/dutinfo/dutqestlist";
  3. var VALU_PATH = "/root/main/dutinfo/dutitemlist";
  4. // 성적입력폼이 그려져 있는지의 여부
  5. var gIsDrawDutRept = false;
  6. // 콘트롤생성때 임의적인 id부여에 사용됨.
  7. var gCtrlMaxID = 1;
  8. // 중간합계를 구하기 위한 인스턴스의 갯수를 카운트
  9. var gValueFlagCnt = 0;
  10. function fFormReady()
  11. {
  12. submit("TRRTS00602");
  13. rszfGetLabelControlComboList("R0314", "cmb_instcd", "detldesc");
  14. misfComboComCdListMulti("R0009", "cmb_mm");
  15. model.makeValue("/root/temp/cmbmm_nodeset", cmb_mm.choices.itemset.attribute("nodeset"));
  16. var today = getCurrentDate();
  17. var cur_yy = parseInt(today.substring(0, 4));
  18. var cur_mm = parseInt(today.substring(4, 6));
  19. model.setValue("/root/send/reqlist/valueyy", cur_yy);
  20. model.setValue("/root/send/reqlist/dutvaluemm", cur_mm);
  21. model.setValue("/root/send/reqlist/dutvaluemm", model.getValue("/root/send/reqlist/dutvaluemm").getLeftPad(2, "0"));
  22. if (!checkAuth("P"))
  23. {
  24. model.setValue("/root/send/req/instcd", getUserInfo("dutplceinstcd"));
  25. model.setValue("/root/send/req/valupsnidnm", getUserId());
  26. if (!checkAuth("P"))
  27. {
  28. cmb_instcd.disabled = true;
  29. cmb_deptcd.disabled = true;
  30. }
  31. }
  32. fCheckAuth();
  33. model.refresh();
  34. }
  35. //========================================================================================
  36. //버튼에 대한 화면 권한 체크(R : 읽기, X : 입력/수정/삭제, P : 출력)
  37. //========================================================================================
  38. function fCheckAuth() {
  39. btn_search.disabled = !checkAuth("R") ;
  40. btn_save.disabled = !checkAuth("X") ;
  41. btn_helppsn.disabled = !checkAuth("P") ;
  42. }
  43. function fRefDutRept()
  44. {
  45. if (submit("TRRTS00701"))
  46. {
  47. fDrawDutRept();
  48. }
  49. }
  50. function fDrawDutRept()
  51. {
  52. var cnt = getNodesetCount(BASE_PATH);
  53. if (cnt == 0 || getNodesetCount(VALU_PATH) == 0)
  54. {
  55. messageBox("근무성적 입력을 위한 구성정보가 존재하지 않습니다.", "E", "");
  56. return;
  57. } else {
  58. //인턴일 경우 평가자 중복체크
  59. if (rdo_valueflag.value == "11") {
  60. cnt = checkDupNode(cnt);
  61. }
  62. }
  63. if (gIsDrawDutRept)
  64. {
  65. var childObj;
  66. for (var i=grup_base.children.length-1; i>=0; i--)
  67. {
  68. childObj = grup_base.children.item(i);
  69. grup_base.removeChild(childObj.attribute("id"));
  70. }
  71. grup_base.refresh();
  72. }
  73. gCtrlMaxID = 1;
  74. gValueFlagCnt = 0;
  75. try
  76. {
  77. var preCatgryid = "";
  78. var prePath = "";
  79. var topPos = 5;
  80. var prePos = 0;
  81. var subRowIdx = 0;
  82. for (var i = 1; i <= cnt; i++)
  83. {
  84. prePath = BASE_PATH + "["+i+"]/";
  85. if (preCatgryid != model.getValue(prePath + "valueitemflagcd"))
  86. {
  87. if (preCatgryid != "")
  88. {
  89. var cataCtrl = document.controls("cat_" + preCatgryid);
  90. cataCtrl.attribute("height") = topPos - parseInt(cataCtrl.attribute("top"));
  91. }
  92. topPos += 3;
  93. prePos = topPos;
  94. topPos += fDrawCatgry(prePath, topPos);
  95. fDrawHorLine(prePath, prePos-3, "line_1");
  96. preCatgryid = model.getValue(prePath + "valueitemflagcd");
  97. subRowIdx = 0;
  98. //topPos += fDrawResiExtrCtrl(prePath, topPos);
  99. //레지던트 종합표시
  100. topPos += fDrawResiExtrCtrl(prePath, topPos, "A");
  101. }
  102. prePos = topPos;
  103. topPos += fDrawQest(prePath, topPos);
  104. fDrawSelItem(prePath, prePos);
  105. if (model.getValue(prePath + "/valueflag") == "11") {
  106. //fDrawExtrCtrl(prePath, prePos, subRowIdx, 530);
  107. fDrawExtrCtrl(prePath, prePos, subRowIdx, 600);
  108. }
  109. subRowIdx++;
  110. }
  111. var cataCtrl = document.controls("cat_" + preCatgryid);
  112. cataCtrl.attribute("height") = topPos - parseInt(cataCtrl.attribute("top"));
  113. fDrawHorLine(prePath, topPos - 3, "line_1");
  114. fDrawExtrCtrl(prePath, topPos, -1, 530);
  115. //레지던트 하단표시
  116. fDrawResiExtrCtrl(prePath, topPos+50, "B");
  117. model.recalculate();
  118. model.refresh();
  119. gIsDrawDutRept = true;
  120. }
  121. catch (e)
  122. {
  123. gIsDrawDutRept = false;
  124. throw e;
  125. }
  126. }
  127. //중복평가자 노드확인
  128. function checkDupNode(cnt) {
  129. var prePath;
  130. var dupcnt = 0;
  131. var isCheck = false;
  132. for (var i = 1; i <= cnt; i++) {
  133. prePath = BASE_PATH + "["+i+"]/";
  134. valueitemflagcd = model.getValue(prePath + "valueitemflagcd");
  135. valueitemcd = model.getValue(prePath + "valueitemcd");
  136. dupcnt = getNodesetCount(BASE_PATH + "[valueitemflagcd = '"+valueitemflagcd+"' and valueitemcd='"+valueitemcd+"']");
  137. if (dupcnt > 1) {
  138. removeDupNode(valueitemflagcd, valueitemcd);
  139. isCheck = true
  140. } else {
  141. continue;
  142. }
  143. }
  144. if (isCheck) {
  145. cnt = getNodesetCount(BASE_PATH);
  146. }
  147. return cnt;
  148. }
  149. //중복평가자 노드삭제
  150. function removeDupNode(valueitemflagcd, valueitemcd){
  151. var firtstnode = null;
  152. var node = null;
  153. var nodelist = instance1.selectNodes(BASE_PATH + "[valueitemflagcd = '"+valueitemflagcd+"' and valueitemcd='"+valueitemcd+"']");
  154. firtstnode = nodelist.nextNode();
  155. var valupsnidnmlist = firtstnode.getXPathString("valupsnidnm");
  156. var kornamelist = firtstnode.getXPathString("korname");
  157. while (node = nodelist.nextNode()) {
  158. valupsnidnmlist = valupsnidnmlist + "," + node.getXPathString("valupsnidnm");
  159. kornamelist = kornamelist + "," + node.getXPathString("korname");
  160. model.removenode(node);
  161. }
  162. firtstnode.valupsnidnm.nodeValue = valupsnidnmlist;
  163. firtstnode.korname.nodeValue = kornamelist;
  164. }
  165. function fDrawHorLine(prePath, topPos, classNm) {
  166. var ctrlid = "lin_" + gCtrlMaxID++;
  167. var leftPos = 10;
  168. //var ctrlWid = 700;
  169. var ctrlWid = 690;
  170. if (classNm == null) {
  171. classNm = "line_3";
  172. leftPos = 55;
  173. if (model.getValue(prePath + "/valueflag") == "11") {
  174. ctrlWid = 600;
  175. } else {
  176. ctrlWid = 690;
  177. }
  178. }
  179. ctrl = grup_base.createChild("xforms:line", "id:" + ctrlid + "; class:" + classNm +
  180. "; x1:" + leftPos + "px; y1:" + topPos + "px; x2:" + ctrlWid + "px; y2:" + topPos + "px");
  181. }
  182. function fDrawSelItem(prePath, topPos)
  183. {
  184. var valueitemflagcd = model.getValue(prePath + "valueitemflagcd");
  185. var valueitemcd = model.getValue(prePath + "valueitemcd");
  186. var ctrlid = "rdo_" + valueitemcd;
  187. var leftPos = 270;
  188. var ctrlWid = 300;
  189. var ctrlHei = 20;
  190. topPos += 7;
  191. var ctrlName = "select1";
  192. var cols = "cellspacing:15; cols:5";
  193. if (model.getValue(prePath + "valueflag") == "12")
  194. {
  195. cols = "cellspacing:10; cols:10";
  196. }
  197. var ctrl = grup_base.createChild("xforms:" + ctrlName, "id:" + ctrlid +
  198. "; left:" + leftPos + "px; top:" +topPos + "px; width:" + ctrlWid +
  199. "px; height:" + ctrlHei + "px; border-style:none; overflow:visible; appearance:full; " + cols +
  200. "; ref:" + prePath + "valueitempnt");
  201. var choices = ctrl.createChild("xforms:choices", "id:cho_" + valueitemcd + ";");
  202. var itemset = choices.createChild("xforms:itemset", "id:iset_" + valueitemcd +
  203. "; nodeset:" + VALU_PATH + "[valueitemflagcd='" + valueitemflagcd + "'];");
  204. itemset.createChild("xforms:label", "ref:valueitemcnts;");
  205. itemset.createChild("xforms:value", "ref:valueitemscor;");
  206. ctrl.disabled = gCtrlDisAbled;
  207. ctrl.attribute("xforms-value-changed") = "fSetRowStatus('valueitempnt')";
  208. }
  209. function fSetRowStatus(flag)
  210. {
  211. var ctrl = document.controls(event.target);
  212. var ref = ctrl.attribute("ref").replace(flag, "status");
  213. if (model.getValue(ref) == "")
  214. model.setValue(ref, "i");
  215. else if (model.getValue(ref) == "r")
  216. model.setValue(ref, "u");
  217. }
  218. function fDrawQest(prePath, topPos)
  219. {
  220. var ctrlid = "qes_" + model.getValue(prePath + "valueitemcd");
  221. var leftPos = 55;
  222. var ctrlWid = 200;
  223. var ctrlHei = 30;
  224. var ctrl = grup_base.createChild("xforms:caption", "id:" + ctrlid +
  225. "; left:" + leftPos + "px; top:" +topPos + "px; width:" + ctrlWid +
  226. "px; height:" + ctrlHei + "px; vertical-align:top; text:" + model.getValue(prePath + "valueitemnm")
  227. );
  228. fDrawHorLine(prePath, topPos);
  229. return ctrlHei;
  230. }
  231. var gCtrlDisAbled = false;
  232. function fDrawCatgry(prePath, topPos)
  233. {
  234. var ctrlid = "cat_" + model.getValue(prePath + "valueitemflagcd");
  235. var leftPos = 10;
  236. var ctrlWid = 40;
  237. var ctrlHei = 20;
  238. var ctrl = grup_base.createChild("xforms:caption", "id:" + ctrlid +
  239. "; left:" + leftPos + "px; top:" +topPos + "px; width:" + ctrlWid +
  240. "px; height:" + ctrlHei + "px; vertical-align:top; text:" + model.getValue(prePath + "valueitemflagnm") +
  241. "; font-size:15pt; font-weight:bold; class:cell_1");
  242. //return ctrlHei + 20;
  243. //평가자에게 할당된 항목만 활성화 된다.
  244. //평가자의 다음단계가 입력되지 않았다면 활성화 된다.
  245. //평가자의 이전단계가 입력되었다면 활성화 된다.
  246. var valueitemflagcd = model.getValue(prePath + "valueitemflagcd");
  247. var valupsnidnm = model.getValue(prePath + "valupsnidnm");
  248. if(checkAuth("X") && checkAuth("P"))
  249. {
  250. gCtrlDisAbled = false;
  251. }
  252. else
  253. {
  254. if (model.getValue(prePath + "cfrmyn") == "Y")
  255. {
  256. gCtrlDisAbled = true;
  257. }
  258. else if (valupsnidnm.indexOf(model.getValue("/root/send/req/valupsnidnm")) != -1 &&
  259. //getNodesetCount(BASE_PATH + "[valupsnidnm != '"+valupsnidnm+"' and valueitemflagcd > '"+valueitemflagcd+"' and valueitempnt != '']") == 0 &&
  260. //getNodesetCount(BASE_PATH + "[valupsnidnm != '"+valupsnidnm+"' and valueitemflagcd < '"+valueitemflagcd+"' and valueitempnt = '']") == 0)
  261. getNodesetCount(BASE_PATH + "[not(contains(valupsnidnm, '"+valupsnidnm+"')) and valueitemflagcd > '"+valueitemflagcd+"' and valueitempnt != '']") == 0 &&
  262. getNodesetCount(BASE_PATH + "[not(contains(valupsnidnm, '"+valupsnidnm+"')) and valueitemflagcd < '"+valueitemflagcd+"' and valueitempnt = '']") == 0)
  263. {
  264. gCtrlDisAbled = false;
  265. }
  266. else
  267. {
  268. gCtrlDisAbled = true;
  269. }
  270. }
  271. return 0;
  272. }
  273. function fDrawResiExtrCtrl_old(prePath, topPos)
  274. {
  275. if (model.getValue(prePath + "/valueflag") != "12") return 0;
  276. fDrawExtrCtrl(prePath, topPos, 0, 55);
  277. fDrawExtrCtrl(prePath, topPos, 1, 170);
  278. fDrawExtrCtrl(prePath, topPos, 2, 295);
  279. var ctrlid = "cmt_" + model.getValue(prePath + "valueitemflagcd");
  280. var ctrl = document.controls(ctrlid);
  281. ctrl.attribute("top") = topPos+5;
  282. ctrl.attribute("left") = 345;
  283. ctrl.attribute("height") = 20;
  284. ctrl.attribute("width") = 330;
  285. return 30;
  286. }
  287. function fDrawResiExtrCtrl(prePath, topPos, flag)
  288. {
  289. if (model.getValue(prePath + "/valueflag") != "12") return 0;
  290. if (flag == "A") {
  291. fDrawExtrCtrl(prePath, topPos, 1, 170);
  292. return 30;
  293. } else {
  294. fDrawExtrCtrl(prePath, topPos, 2, 10);
  295. fDrawExtrCtrl(prePath, topPos+30, 0, 10);
  296. var ctrlid = "cmt_" + model.getValue(prePath + "valueitemflagcd");
  297. var ctrl = document.controls(ctrlid);
  298. ctrl.attribute("top") = topPos+5;
  299. ctrl.attribute("left") = 60;
  300. ctrl.attribute("height") = 20;
  301. ctrl.attribute("width") = 500;
  302. //레지던트 확인자
  303. fDrawExtrCtrl(prePath, topPos+60, 4, 10);
  304. }
  305. }
  306. function fDrawExtrCtrl(prePath, topPos, subRowIdx, leftPos)
  307. {
  308. if (subRowIdx == 0)
  309. {
  310. ptext = "평가자:";
  311. fDrawOptPsnNm(prePath, topPos, "korname", leftPos+50);
  312. }
  313. else if (subRowIdx == 1)
  314. {
  315. ptext = "종합:";
  316. fDrawBind(prePath, topPos, model.getValue(prePath + "/valueitemflagcd"), leftPos+40);
  317. }
  318. else if (subRowIdx == 2)
  319. {
  320. ptext = "의견란:";
  321. fDrawMtxCmt(prePath, topPos);
  322. }
  323. else if (subRowIdx == 3)
  324. {
  325. var mtxid = "cmt_" + model.getValue(prePath + "valueitemflagcd");
  326. var mtxCtrl = document.controls(mtxid);
  327. mtxCtrl.attribute("top") = topPos - 5;
  328. return;
  329. }
  330. else if (subRowIdx == -1)
  331. {
  332. ptext = "합계";
  333. fDrawBind(prePath, topPos, "00", leftPos+50);
  334. topPos += 10;
  335. }
  336. else
  337. {
  338. //레지던트 확인자 그려주기(20081006)
  339. if (model.getValue(prePath + "valueflag") == "12" && subRowIdx == 4)
  340. {
  341. ptext = "확인자:";
  342. fDrawOptCfmNm(prePath, topPos, leftPos+50);
  343. }
  344. else {
  345. return;
  346. }
  347. }
  348. var ctrlid = "cap_" + gCtrlMaxID++;
  349. var ctrlWid = 50;
  350. var ctrlHei = 30;
  351. var ctrl = grup_base.createChild("xforms:caption", "id:" + ctrlid +
  352. "; left:" + leftPos + "px; top:" +topPos + "px; width:" + ctrlWid +
  353. "px; height:" + ctrlHei + "px; vertical-align:top; text:" + ptext
  354. );
  355. }
  356. // 중간합계를 구하기 위한 bind생성
  357. function fDrawBind(prePath, topPos, valueitemflagcd, leftPos)
  358. {
  359. var oriTopPos = topPos;
  360. var bindpath = "/root/main/sumlist";
  361. if (valueitemflagcd == "00") //합계
  362. {
  363. bindpath = "/root/main/totlist[1]";
  364. model.makeValue(bindpath + "/valueitemflagcd/valueitemflagcd", valueitemflagcd);
  365. model.makeValue(bindpath + "/valueitemflagcd/vsum", "0");
  366. model.makeValue(bindpath + "/valueitemflagcd/vtot", model.getXPathValue("sum(/root/main/sumlist/valueitemflagcd/vtot)"));
  367. }
  368. else
  369. {
  370. gValueFlagCnt++;
  371. bindpath = bindpath + "[" +gValueFlagCnt+ "]";
  372. model.makeValue(bindpath + "/valueitemflagcd/valueitemflagcd", valueitemflagcd);
  373. model.makeValue(bindpath + "/valueitemflagcd/vsum", "0");
  374. model.makeValue(bindpath + "/valueitemflagcd/vtot", model.getValue(prePath + "/valuepnt"));
  375. }
  376. var bindid = "bind_" + gCtrlMaxID++;
  377. var refPath = bindpath + "/valueitemflagcd/vsum";
  378. var calPath = BASE_PATH + "[valueitemflagcd='" +valueitemflagcd+ "']/valueitempnt";
  379. if (valueitemflagcd == "00") //합계
  380. {
  381. calPath = BASE_PATH + "/valueitempnt";
  382. //model.createChild("xforms:bind", "id:" + bindid + "; ref:" + refPath + "; calculate:sum(" + calPath + "); ");
  383. model.createChild("xforms:bind", "id:" + bindid + "; ref:" + refPath + "; calculate:round(sum(" + calPath + ") * power(10, (-2)*(-1)-1)) div power(10, (-2)*(-1)-1); ");
  384. topPos += 15;
  385. oriTopPos += 10;
  386. }
  387. else
  388. {
  389. //model.createChild("xforms:bind", "id:" + bindid + "; ref:" + refPath + "; calculate:sum(" + calPath + "); ");
  390. model.createChild("xforms:bind", "id:" + bindid + "; ref:" + refPath + "; calculate:round(sum(" + calPath + ") * power(10, (-2)*(-1)-1)) div power(10, (-2)*(-1)-1); ");
  391. topPos += 5;
  392. }
  393. var ctrlWid = 40;
  394. var ctrlHei = 30;
  395. //입력된 성적의 합계
  396. var ctrlid = "opt_" + gCtrlMaxID++;
  397. ctrl = grup_base.createChild("xforms:output", "id:" + ctrlid +
  398. "; left:" + leftPos + "px; top:" + topPos + "px; width:" + ctrlWid + "px; height:" + ctrlHei + "px" +
  399. "; bind:" + bindid);
  400. leftPos += 35;
  401. ctrlid = "cap_" + gCtrlMaxID++;
  402. ctrl = grup_base.createChild("xforms:caption", "id:" + ctrlid +
  403. "; left:" + leftPos + "px; top:" +oriTopPos + "px; width:10" +
  404. "px; height:" + ctrlHei + "px; vertical-align:top; text:/");
  405. //성적의 총합계
  406. leftPos += 15;
  407. ctrlid = "opt_" + gCtrlMaxID++;
  408. ctrl = grup_base.createChild("xforms:output", "id:" + ctrlid +
  409. "; left:" + leftPos + "px; top:" + topPos + "px; width:" + ctrlWid + "px; height:" + ctrlHei + "px" +
  410. "; ref:" + bindpath + "/valueitemflagcd/vtot");
  411. }
  412. function fDrawMtxCmt(prePath, topPos)
  413. {
  414. var ctrlid = "cmt_" + model.getValue(prePath + "valueitemflagcd");
  415. var leftPos = 600;
  416. var ctrlWid = 160;
  417. var ctrlHei = 60;
  418. var ctrl = grup_base.createChild("xforms:textarea", "id:" + ctrlid + "; scroll:autovscroll" +
  419. "; left:" + leftPos + "px; top:" + topPos + "px; width:" + ctrlWid + "px; height:" + ctrlHei + "px" +
  420. "; ref:" + prePath + "cmt");
  421. ctrl.attribute("editable") = (!gCtrlDisAbled) + "";
  422. if (gCtrlDisAbled)
  423. {
  424. ctrl.attribute("background-color") = "#ecebec";
  425. }
  426. ctrl.attribute("xforms-value-changed") = "fSetRowStatus('cmt')";
  427. }
  428. function fDrawOptPsnNm(prePath, topPos, refColNm, leftPos)
  429. {
  430. var ctrlid = "psn_" + model.getValue(prePath + "valueitemflagcd");
  431. var ctrlWid = 100;
  432. var ctrlHei = 30;
  433. topPos += 5;
  434. ctrl = grup_base.createChild("xforms:output", "id:" + ctrlid +
  435. "; left:" + leftPos + "px; top:" + topPos + "px; width:" + ctrlWid + "px; height:" + ctrlHei + "px" +
  436. "; ref:" + prePath + refColNm);
  437. }
  438. function fDrawOptCfmNm(prePath, topPos, leftPos)
  439. {
  440. var ctrlid = "cfm_" + model.getValue(prePath + "valueitemflagcd");
  441. var ctrlWid = 100;
  442. var ctrlHei = 30;
  443. topPos += 5;
  444. ctrl = grup_base.createChild("xforms:output", "id:" + ctrlid +
  445. "; left:" + leftPos + "px; top:" + topPos + "px; width:" + ctrlWid + "px; height:" + ctrlHei + "px" +
  446. "; ref:" + "/root/main/confirminfo/confirmorlist/cfrname");
  447. }
  448. function fSave()
  449. {
  450. model.refresh();
  451. var childLen = grup_base.children.length;
  452. var tmpChildObj = null;
  453. for( var i = 0; i < childLen; i++ ) {
  454. tmpChildObj = grup_base.children.item(i);
  455. if( tmpChildObj.elementName == "xforms:select1" ) {
  456. tmpChildObj.attribute("background-color") = "transparent";
  457. }
  458. }
  459. var nodelist;
  460. var ctrl;
  461. //실무자일때 성적을 모두 입력했는지를 검사
  462. if (model.getValue("/root/send/reqlist/checkflag") == "X") {
  463. nodelist = instance1.selectNodes(BASE_PATH + "[valueitempnt='']");
  464. if (nodelist.length > 0) {
  465. for (var i=0; i<nodelist.length; i++) {
  466. ctrl = document.controls("rdo_" + nodelist.item(i).getXPathString("valueitemcd"));
  467. ctrl.attribute("background-color") = "#ffd799";
  468. if (nodelist.item(i).getXPathString("valueitempnt") == "") {
  469. messageBox("모든 성적을 입력 해주시기 바랍니다.", "I", "");
  470. return;
  471. }
  472. }
  473. }
  474. }
  475. //평가자에게 할당된 성적을 모두 입력했는지를 검사
  476. var valupsnidnm = model.getValue("/root/send/reqlist/valupsnidnm");
  477. //nodelist = instance1.selectNodes(BASE_PATH + "[valupsnidnm = '"+valupsnidnm+"' and valueitempnt='']");
  478. nodelist = instance1.selectNodes(BASE_PATH + "[contains(valupsnidnm, '"+valupsnidnm+"') and valueitempnt='']");
  479. if (nodelist.length > 0)
  480. {
  481. var ctrl;
  482. for (var i=0; i<nodelist.length; i++)
  483. {
  484. ctrl = document.controls("rdo_" + nodelist.item(i).getXPathString("valueitemcd"));
  485. ctrl.attribute("background-color") = "#ffd799";
  486. if (nodelist.item(i).getXPathString("valueitempnt") == "") {
  487. messageBox("모든 성적을 입력 해주시기 바랍니다.", "I", "");
  488. return;
  489. }
  490. }
  491. }
  492. //입력된 항목에 한해서 등급을 찾아 입력
  493. var colref_status = grd_saverept.colRef("status");
  494. var colref_valueitemflagcd = grd_saverept.colRef("valueitemflagcd");
  495. var colref_valueitempnt = grd_saverept.colRef("valueitempnt");
  496. var colref_valueitemgrde = grd_saverept.colRef("valueitemgrde");
  497. var itemGrade;
  498. var chgcnt = 0;
  499. for (var i=1; i<=grd_saverept.rows; i++)
  500. {
  501. var val_status = grd_saverept.valueMatrix(i, colref_status);
  502. if (val_status == "i" || val_status == "u")
  503. {
  504. chgcnt++;
  505. grd_saverept.rowStatus(i) = 2;
  506. itemGrade = fGetItemGrade( grd_saverept.valueMatrix(i, colref_valueitemflagcd), grd_saverept.valueMatrix(i, colref_valueitempnt) );
  507. grd_saverept.valueMatrix(i, colref_valueitemgrde) = itemGrade;
  508. }
  509. }
  510. //평가자의 할당된 성적이 모두 최고 또는 최저점수 일때는 의견란은 필수
  511. nodelist = instance1.selectNodes(BASE_PATH + "[valupsnidnm = '"+valupsnidnm+"']/valueitemflagcd");
  512. var valueitemflagcd = "";
  513. for (var i=0; i<nodelist.length; i++)
  514. {
  515. if (valueitemflagcd != nodelist.item(i).text)
  516. {
  517. valueitemflagcd = nodelist.item(i).text;
  518. var num_max = model.getXPathValue("max("+VALU_PATH+"[valueitemflagcd = '"+valueitemflagcd+"']/rownum)");
  519. var num_min = model.getXPathValue("min("+VALU_PATH+"[valueitemflagcd = '"+valueitemflagcd+"']/rownum)");
  520. var val_max = model.getXPathValue(VALU_PATH+"[valueitemflagcd = '"+valueitemflagcd+"' and rownum = '"+num_max+"']/valueitemgrde");
  521. var val_min = model.getXPathValue(VALU_PATH+"[valueitemflagcd = '"+valueitemflagcd+"' and rownum = '"+num_min+"']/valueitemgrde");
  522. var cnt_all = getNodesetCount(BASE_PATH + "[valueitemflagcd = '"+valueitemflagcd+"']");
  523. var cnt_max = getNodesetCount(BASE_PATH + "[valueitemflagcd = '"+valueitemflagcd+"' and valueitemgrde='"+val_max+"']");
  524. var cnt_min = getNodesetCount(BASE_PATH + "[valueitemflagcd = '"+valueitemflagcd+"' and valueitemgrde='"+val_min+"']");
  525. if (cnt_all == cnt_max || cnt_all == cnt_min)
  526. {
  527. var ctrl = document.controls("cmt_" + valueitemflagcd);
  528. if (model.getValue(ctrl.attribute("ref")) == "")
  529. {
  530. messageBox("모든 성적이 최고 또는 최저 일때는 의견이 필요합니다.", "I", "");
  531. return;
  532. }
  533. }
  534. }
  535. }
  536. if (chgcnt > 0)
  537. {
  538. model.setValue("/root/main/savelist", grd_saverept.getUpdateData());
  539. if (submit("TXRTS00701"))
  540. {
  541. grd_dutemplist.valueMatrix(grd_dutemplist.row, grd_dutemplist.colRef("recyn")) = "Y";
  542. grd_dutemplist.rowStatus(grd_dutemplist.row) = 2;
  543. grd_dutemplist.refresh();
  544. fRefDutRept();
  545. }
  546. }
  547. else
  548. {
  549. messageBox("변경된 내역이 없습니다.", "I", "");
  550. }
  551. }
  552. function fGetItemGrade(pValueItemFlagCd, pValueItemPnt)
  553. {
  554. if (pValueItemFlagCd == "" || pValueItemPnt == "")
  555. return;
  556. var node = instance1.selectSingleNode(VALU_PATH + "[valueitemflagcd='"+pValueItemFlagCd+"' and valueitemscor='"+pValueItemPnt+"']");
  557. return node.getXPathString("valueitemgrde");
  558. }
  559. function fOpenPsnHelp()
  560. {
  561. setParameter("SMRTC00200_yy", model.getValue("/root/send/reqlist/valueyy"));
  562. setParameter("SMRTC00200_mm", model.getValue("/root/send/reqlist/dutvaluemm"));
  563. setParameter("SMRTC00200_valueflag", model.getValue("/root/send/reqlist/valueflag"));
  564. setParameter("SMRTC00200_instcd", model.getValue("/root/send/req/instcd"));
  565. setParameter("SMRTC00200_deptcd", model.getValue("/root/send/req/deptcd"));
  566. setParameter("SMRTC00200_valupsnidnm", "");
  567. modalUrl("../../../mis/tistrngeducbaseinfomngtweb/xrw/SMRTC00200_근무평가자관리.xrw", 1, 0, 0, "", "", "");
  568. if (getParameter("SMRTC00200_valupsnidnm") != "")
  569. {
  570. model.setValue("/root/send/reqlist/valupsnidnm", getParameter("SMRTC00200_valupsnidnm"));
  571. btn_search.dispatch("DOMActivate");
  572. }
  573. }
  574. function fSetMultiPnt(valueitemgrde) {
  575. var cnt = getNodesetCount(BASE_PATH);
  576. var valueitempntpath;
  577. var statuspath;
  578. var node;
  579. for (var i = 1; i <= cnt; i++) {
  580. valueitempntpath = BASE_PATH + "["+i+"]/valueitempnt";
  581. statuspath = BASE_PATH + "["+i+"]/status";
  582. valueitemflagcd = model.getValue(BASE_PATH + "["+i+"]/valueitemflagcd");
  583. node = instance1.selectSingleNode(VALU_PATH+"[valueitemflagcd='"+valueitemflagcd+"' and valueitemgrde='"+valueitemgrde+"']");
  584. model.setValue(valueitempntpath, node.getXPathString("valueitemscor"));
  585. //상태변경
  586. if (model.getValue(statuspath) == "") {
  587. model.setValue(statuspath, "i");
  588. } else if (model.getValue(statuspath) == "r") {
  589. model.setValue(statuspath, "u");
  590. }
  591. }
  592. model.recalculate();
  593. model.refresh();
  594. }