taxPop.jsp 52 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551
  1. <%@ page contentType="text/html; charset=utf-8"%>
  2. <%@ page import="kr.co.hwenc.system.HandlerStorage"%>
  3. <%@ page import="kr.co.hsnc.common.util.*"%>
  4. <%@ page import="kr.co.hwenc.common.ui.*"%>
  5. <%@ page import="kr.co.hwenc.hmcs.cmn.code.MaterialCodeManager"%>
  6. <%@ page import="kr.co.hwenc.hmcs.cmn.code.ItemCategoryManager"%>
  7. <%@ page import="kr.co.hwenc.hmcs.cmn.code.SizeSelectManager"%>
  8. <jsp:useBean id="ctx" class="kr.co.hwenc.system.context.SessionContext" scope="session" />
  9. <%
  10. ctx.init(request, response);
  11. HandlerStorage storage = ctx.getHandlerStorage();
  12. ValueObject user = ctx.getUser();
  13. ValueObject params = storage.getParams();
  14. String event = storage.getEvent();
  15. ValueObject vo = ctx.getParams();
  16. %>
  17. <SCRIPT language="JavaScript">
  18. var resultRowSet = null ;
  19. var rs;
  20. // 마지막으로 선택된 행의 번호를 기억하고 있음
  21. var CurMasterRow = 0;
  22. // Sheet의 초기화 작업
  23. function initIBSheet(sheetObj) {
  24. if( sheetObj.id == "sheet1" ) {
  25. with(sheetObj) {
  26. //전체 너비 설정
  27. doResizeSheet(sheetObj);
  28. //전체Merge 종류 [선택, Default msNone]
  29. MergeSheet = msNone;
  30. //전체Edit 허용 여부 [선택, Default false]
  31. Editable = true;
  32. //행정보설정[필수][HEADROWS,DATAROWS,VIEWROWS,ONEPAGEROWS=100]
  33. InitRowInfo( 1, 1, 15, 100);
  34. //컬럼정보설정[필수][COLS,FROZENCOL,LEFTHEADCOLS=0,FROZENMOVE=false]
  35. InitColumnInfo(5, 2, 0, true);
  36. //해더행정보[필수][ROW,HEADTEXT,ROWMERGE=false, HIDDEN=false]
  37. InitHeadRow(0, "ALL|STAUS|FILED1|FILED2|Item", false);
  38. //헤더기능설정 [선택][SortEnable, ColumnMove, AllCheckEnable, UserResize, RowMove, Head3D]
  39. InitHeadMode(false, true, true, true, true, true);
  40. //데이터속성[ROW,COL,DATATYPE,WIDTH,DATAALIGN,COLMERGE,SAVENAME,KEYFIELD,CALCULOGIC,DATAFORMAT,POINTCOUNT,UPDATEEDIT,INSERTEDIT,EDITLEN,FULLINPUT,SORTENABLE,TOOLTIP,ALLCHECK, SAVESTATUS, FORMATFIX]
  41. var colNum = 0;
  42. InitDataProperty(0, colNum++, dtCheckBox, 40, daCenter, false, "NUM_CHECK");
  43. InitDataProperty(0, colNum++, dtHiddenStatus, 0, daCenter, false, "STATUS");
  44. InitDataProperty(0, colNum++, dtHidden, 100,daLeft, false, "FILED1", false, "", dfNone, 0, false, false, 20);
  45. InitDataProperty(0, colNum++, dtHidden, 100,daLeft, false, "FILED2", false, "", dfNone, 0, false, false, 20);
  46. InitDataProperty(0, colNum++, dtData, 205,daLeft, false, "CODE_NAME",false, "", dfNone, 0, false, false);
  47. //Sheet 나타나도록 설정
  48. Visible = true;
  49. sheetObj.CountPosition = 0;
  50. }
  51. } else if( sheetObj.id == "sheet2" ) {
  52. with(sheetObj) {
  53. //전체 너비 설정
  54. doResizeSheet(sheetObj);
  55. //전체Merge 종류 [선택, Default msNone]
  56. MergeSheet = msNone;
  57. //전체Edit 허용 여부 [선택, Default false]
  58. Editable = true;
  59. //행정보설정[필수][HEADROWS,DATAROWS,VIEWROWS,ONEPAGEROWS=100]
  60. InitRowInfo( 1, 1, 20, 20);
  61. //컬럼정보설정[필수][COLS,FROZENCOL,LEFTHEADCOLS=0,FROZENMOVE=false]
  62. InitColumnInfo(8, 6, 0, true);
  63. //헤더기능설정
  64. InitHeadMode(false, true, true, true, true, true);
  65. //해더행정보[필수][ROW,HEADTEXT, ROWMERGE=false, HIDDEN=false]
  66. InitHeadRow(0, "All|STATUS|DEFAULT_FLAG|Item|Short Code|☞ Description|Item|Seq", false);
  67. var colNum = 0;
  68. InitDataProperty(0, colNum++, dtCheckBox, 40, daCenter, false, "NUM_CHECK");
  69. InitDataProperty(0, colNum++, dtHiddenStatus, 0, daCenter, false, "STATUS");
  70. InitDataProperty(0, colNum++, dtHidden, 0, daCenter, false, "DEFAULT_FLAG");
  71. InitDataProperty(0, colNum++, dtData, 150, daLeft, true, "F_ITEM", false, "", dfNone, 0, false, false, 20);
  72. InitDataProperty(0, colNum++, dtData, 100, daLeft, false, "SHORT_CD", false, "", dfNone, 0, false, false, 20);
  73. InitDataProperty(0, colNum++, dtData, 435, daLeft, false, "SHORT_DESC", false, "", dfNone, 0, false, false, 80);
  74. InitDataProperty(0, colNum++, dtHidden, 150, daLeft, false, "T_ITEM", false, "", dfNone, 0, false, false, 80);
  75. InitDataProperty(0, colNum++, dtHidden, 70, daCenter, false, "ITEM_ORD", false, "", dfNone, 0, false, false, 80);
  76. //Sheet 나타나도록 설정
  77. Visible = true;
  78. sheetObj.CountPosition = 0;
  79. sheetObj.DataLinkMouse("SHORT_DESC") = true;
  80. }
  81. }
  82. }
  83. // 검색
  84. function doSearch(sheetObj) {
  85. // doRequisitionGroupNumberList(sheetObj);
  86. }
  87. function addSectSelectSch(value, dscr, formname) {
  88. var selectObj = eval("document.form1."+formname) ;
  89. addOption(selectObj, value, dscr) ;
  90. }
  91. function add_select(obj, add_value, add_text, pos) {
  92. var opt = new Option(add_value, add_text);
  93. obj.options[pos] = opt;
  94. return ;
  95. }
  96. //Select Option Clear
  97. function clear_select(obj) {
  98. sel_len = obj.length;
  99. for(i = 0 ; i < sel_len; i++) {
  100. obj.options[i] = null;
  101. }
  102. return ;
  103. }
  104. // 페이지 초기화 함수
  105. function doPageInit() {
  106. var f = document.form1;
  107. if(f.pop_div.value == "1"){
  108. if(f.insert_chk.value == '1'){
  109. document.getElementById('title_detail').innerHTML = 'Add';
  110. }else{
  111. document.getElementById('title_detail').innerHTML = 'Modify';
  112. }
  113. }else{
  114. var send = window.dialogArguments;
  115. // 팝업띄울때 제목 변환을 위한 추가 - 20120322
  116. if(send.insert_chk == '1'){
  117. document.getElementById('title_detail').innerHTML = 'Add';
  118. }else{
  119. document.getElementById('title_detail').innerHTML = 'Modify';
  120. }
  121. f.projectcd.value = send.projectcd;
  122. f.projectid.value = send.projectid;
  123. f.projectnm.value = send.projectnm;
  124. f.SPEC_CLASS.value = send.SPEC_CLASS;
  125. f.SCH_GROUP.value = send.SCH_GROUP;
  126. f.SIZE_MAX.value = send.SIZE_MAX;
  127. f.SIZE_MIN.value = send.SIZE_MIN;
  128. f.MATERIAL_CODE.value = send.MATERIAL_CODE;
  129. f.RATING_CODE.value = send.RATING_CODE;
  130. f.R_SPEC_CLASS.value = send.R_SPEC_CLASS;
  131. f.click_number.value = send.click_number;
  132. f.insert_chk.value = send.insert_chk;
  133. f.GROUP_ID.value = send.GROUP_ID;
  134. f.FIELD3.value = send.FIELD3;
  135. f.FIELD4.value = send.FIELD4;
  136. f.FIELD5.value = send.FIELD5;
  137. f.FIELD6.value = send.FIELD6;
  138. f.FIELD7.value = send.FIELD7;
  139. f.FIELD8.value = send.FIELD8;
  140. f.FIELD9.value = send.FIELD9;
  141. f.FIELD10.value = send.FIELD10;
  142. f.FIELD11.value = send.FIELD11;
  143. f.CATE_CODE.value = send.CATE_CODE;
  144. f.DESIGN_CODE.value = send.DESIGN_CODE;
  145. f.FLUID_SERVICE.value = send.FLUID_SERVICE;
  146. f.p_hwen_code.value = send.p_hwen_code;
  147. makeSelect();
  148. if (f.CATE_CODE.value == '' && f.SIZE_MIN.value == '' && f.SIZE_MAX.value == '' && f.click_number.value) {
  149. f.CATE_CODE.value = '';
  150. f.SIZE_MIN.value = '';
  151. f.SIZE_MAX.value = '';
  152. f.click_number.value = '';
  153. }
  154. if (f.click_number.value != '') {
  155. submitXmlRequest("/mcms/spec/specitem_detail_data.screen", "ITEM_DETAIL_LIST", document.form1, "ROWSET");
  156. }
  157. }
  158. }
  159. function makeSelect(){
  160. var f = document.form1;
  161. if (f.projectcd.value == '') {
  162. return;
  163. }
  164. if (f.SPEC_CLASS.value != '') {
  165. var spec = f.SPEC_CLASS.value.split(";");
  166. if (spec[2] == '-') {
  167. f.DESIGN_CODE.value = '';
  168. }
  169. else {
  170. f.DESIGN_CODE.value = spec[2];
  171. }
  172. if (spec[1] == '-') {
  173. f.FLUID_SERVICE.value = '';
  174. }
  175. else {
  176. f.FLUID_SERVICE.value = spec[1];
  177. }
  178. var len = f.RATING_CODE.length;
  179. if (len > 0) {
  180. for (var i=0; i < len; i++) {
  181. var ren = f.RATING_CODE[i].value.split(":");
  182. if (spec[3] == '-') {
  183. spec[3] = '';
  184. }
  185. if (ren[0].trim() == spec[3].trim()) {
  186. f.RATING_CODE[i].selected = true;
  187. }
  188. }
  189. }
  190. f.R_SPEC_CLASS.value = spec[0];
  191. f.class_value.value = spec[0];
  192. f.C_SPEC_CLASS.value = '';
  193. f.SCH_TYPE.value = '2';
  194. submitXmlRequest("/cmn/code/schedule_group_select.screen", "SCHEDULE_GROUP_LIST", document.form1, "ROWSET");
  195. document.form1.isSubmit = false;
  196. }
  197. else {
  198. f.DESIGN_CODE.value = '';
  199. f.FLUID_SERVICE.value = '';
  200. f.MATERIAL_CODE.value = '';
  201. f.RATING_CODE.value = '';
  202. clear_select(eval('document.form1.S_SCH_GROUP'));
  203. add_select(eval('document.form1.S_SCH_GROUP'), "-- Select --", "", 0);
  204. }
  205. }
  206. //Item Category 선택시
  207. function doItemList() {
  208. if(document.form1.CATE_CODE.value == null || document.form1.CATE_CODE.value ==""){
  209. return;
  210. }
  211. document.form1.ing_change.value = '1';
  212. document.all.sheet2.RemoveAll();
  213. submitXmlRequest("/mcms/spec/specitem_category.screen", "ITEM_CATEGORY_LIST", document.form1, "ROWSET");
  214. }
  215. // 저장 처리 결과를 받는 예약 함수
  216. function doResult(resultObj) {
  217. try {
  218. var rs = resultObj.getRowSet();
  219. var f = document.form1;
  220. var cate_code = f.CATE_CODE.value.split(":");
  221. if(resultObj.getRequestEvent() == "ITEM_CATEGORY_LIST"){
  222. resultRowSet = resultObj.getRowSet();
  223. if( resultObj.getSuccess() == true){
  224. var upcnt = 0;
  225. code_cloumn = new Array();
  226. desc_column = new Array();
  227. code_table = new Array();
  228. lib_column = new Array();
  229. lib_code = new Array();
  230. order_column= new Array();
  231. desc_flag = new Array();
  232. sub_code_no = new Array();
  233. code_no = new Array();
  234. doTitleInnerHtml(rs);
  235. f.MATERIAL_ITEM_1.value = '';
  236. f.MATERIAL_ITEM_3.value = '';
  237. resultRowSetSize = rs.getRowSize();
  238. for( var i = 0 ; i < rs.getRowSize() ; i++ ) {
  239. code_cloumn[upcnt] = rs.getColValue(i, 2);
  240. desc_column[upcnt] = rs.getColValue(i, 3);
  241. code_table[upcnt] = rs.getColValue(i, 0);
  242. lib_column[upcnt] = rs.getColValue(i, 4);
  243. lib_code[upcnt] = rs.getColValue(i, 5);
  244. order_column[upcnt]= rs.getColValue(i, 6);
  245. desc_flag[upcnt] = rs.getColValue(i, 8);
  246. sub_code_no[upcnt] = rs.getColValue(i, 13);
  247. code_no[upcnt] = rs.getColValue(i, 10);
  248. upcnt++;
  249. }
  250. f.code_cloumn.value = code_cloumn.join(";");
  251. f.desc_column.value = desc_column.join(";");
  252. f.code_table.value = code_table.join(";");
  253. f.lib_column.value = lib_column.join(";");
  254. f.lib_code.value = lib_code.join(";");
  255. f.order_column.value= order_column.join(";");
  256. f.desc_flag.value = desc_flag.join(";");
  257. f.sub_code_no.value = sub_code_no.join(";");
  258. f.m_code_no.value = code_no.join(";");
  259. }
  260. else {
  261. dlgErrorMsg(resultObj);
  262. }
  263. document.form1.isSubmit = false;
  264. submitXmlRequest("/mcms/spec/specitem_material_select.screen", "MATERIAL_SLECT_VALUE", document.form1, "ROWSET");
  265. }
  266. else if(resultObj.getRequestEvent() == "SCHEDULE_GROUP_LIST" ){
  267. if( resultObj.getSuccess() ) {
  268. clear_select(eval('document.form1.S_SCH_GROUP'));
  269. add_select(eval('document.form1.S_SCH_GROUP'), "-- Select --", "", 0);
  270. for( var i = 0 ; i < rs.getRowSize() ; i++ ) {
  271. addSectSelectSch(rs.getColValue(i, 0), rs.getColValue(i, 1), "S_SCH_GROUP");
  272. }
  273. for( var j=0; j < f.S_SCH_GROUP.length; j++) {
  274. if (f.S_SCH_GROUP[j].value == f.SCH_GROUP.value) {
  275. f.S_SCH_GROUP[j].selected = true;
  276. }
  277. }
  278. }
  279. else {
  280. dlgErrorMsg(resultObj);
  281. }
  282. document.form1.isSubmit = false;
  283. }
  284. else if(resultObj.getRequestEvent() == "MATERIAL_SLECT_VALUE"){
  285. if( resultObj.getSuccess() == true){
  286. for( var i = 0 ; i < rs.getRowSize() ; i++ ) {
  287. addSectSelect(rs.getColValue(i, 3), rs.getColValue(i, 3), rs.getColValue(i, 0));
  288. }
  289. //setSelect(f.MATERIAL_ITEM_1, f.MATERIAL_CODE.value);
  290. /* else{
  291. f.MATERIAL_ITEM_1.value = f.MATERIAL_CODE.value;
  292. } */
  293. }
  294. else {
  295. dlgErrorMsg(resultObj);
  296. }
  297. document.form1.isSubmit = false;
  298. document.form1.list_count.value = '';
  299. searchIBSheet("/mcms/spec/specitem_add_data.screen", "SPECITEM_ADD_LIST", document.form1, document.all.sheet1);
  300. document.form1.isSubmit = false;
  301. if (f.click_number.value != '') {
  302. //getSubCode(1);
  303. //submitXmlRequest("/cmn/lib/lib_spec_data.screen", "MATERIAL_DETAIL_SUB", document.form1, "rowset");
  304. submitXmlRequest("/mcms/spec/specitem_sub_detail.screen", "MATERIAL_DETAIL_SUB", document.form1, "ROWSET");
  305. }
  306. }
  307. else if(resultObj.getRequestEvent() == "MATERIAL_DETAIL_SUB"){
  308. if( resultObj.getSuccess() == true){
  309. for( var i = 0 ; i < rs.getRowSize() ; i++ ) {
  310. if (i == 0) {
  311. clearSectSelectSub(rs.getColValue(i, 0));
  312. }
  313. addSectSelect(rs.getColValue(i, 3), rs.getColValue(i, 3), rs.getColValue(i, 0));
  314. }
  315. if (f.ing_change.value == '1') {
  316. setSelect(f.MATERIAL_ITEM_1, f.MATERIAL_CODE.value);
  317. //f.MATERIAL_ITEM_1.value = f.MATERIAL_CODE.value;
  318. }
  319. else {
  320. if (f.MATERIAL_ITEM_1.length > 0) {
  321. var field3 = f.FIELD3.value.split(":");
  322. for (var i=0; i < f.MATERIAL_ITEM_1.length; i++) {
  323. var material_item = f.MATERIAL_ITEM_1[i].value.split(":");
  324. if (material_item[0] == field3[0]) {
  325. f.MATERIAL_ITEM_1[i].selected = true;
  326. }
  327. }
  328. }
  329. if (f.MATERIAL_ITEM_2.length > 0) {
  330. var field4 = f.FIELD4.value.split(":");
  331. for (var i=0; i < f.MATERIAL_ITEM_2.length; i++) {
  332. var material_item = f.MATERIAL_ITEM_2[i].value.split(":");
  333. if (material_item[0] == field4[0]) {
  334. f.MATERIAL_ITEM_2[i].selected = true;
  335. }
  336. }
  337. }
  338. if (f.MATERIAL_ITEM_3.length > 0) {
  339. var field5 = f.FIELD5.value.split(":");
  340. for (var i=0; i < f.MATERIAL_ITEM_3.length; i++) {
  341. var material_item = f.MATERIAL_ITEM_3[i].value.split(":");
  342. if (material_item[0] == field5[0]) {
  343. f.MATERIAL_ITEM_3[i].selected = true;
  344. }
  345. }
  346. }
  347. if (f.MATERIAL_ITEM_4.length > 0) {
  348. var field6 = f.FIELD6.value.split(":");
  349. for (var i=0; i < f.MATERIAL_ITEM_4.length; i++) {
  350. var material_item = f.MATERIAL_ITEM_4[i].value.split(":");
  351. if (material_item[0] == field6[0]) {
  352. f.MATERIAL_ITEM_4[i].selected = true;
  353. }
  354. }
  355. }
  356. if (f.MATERIAL_ITEM_5.length > 0) {
  357. var field7 = f.FIELD7.value.split(":");
  358. for (var i=0; i < f.MATERIAL_ITEM_5.length; i++) {
  359. var material_item = f.MATERIAL_ITEM_5[i].value.split(":");
  360. if (material_item[0] == field7[0]) {
  361. f.MATERIAL_ITEM_5[i].selected = true;
  362. }
  363. }
  364. }
  365. if (f.MATERIAL_ITEM_6.length > 0) {
  366. var field8 = f.FIELD8.value.split(":");
  367. for (var i=0; i < f.MATERIAL_ITEM_6.length; i++) {
  368. var material_item = f.MATERIAL_ITEM_6[i].value.split(":");
  369. if (material_item[0] == field8[0]) {
  370. f.MATERIAL_ITEM_6[i].selected = true;
  371. }
  372. }
  373. }
  374. if (resultRowSetSize == 8 || resultRowSetSize == 10) {
  375. if (f.MATERIAL_ITEM_7.length > 0) {
  376. var field9 = f.FIELD9.value.split(":");
  377. for (var i=0; i < f.MATERIAL_ITEM_7.length; i++) {
  378. var material_item = f.MATERIAL_ITEM_7[i].value.split(":");
  379. if (material_item[0] == field9[0]) {
  380. f.MATERIAL_ITEM_7[i].selected = true;
  381. }
  382. }
  383. }
  384. }
  385. if (resultRowSetSize == 10) {
  386. if (f.MATERIAL_ITEM_8.length > 0) {
  387. var field10 = f.FIELD10.value.split(":");
  388. for (var i=0; i < f.MATERIAL_ITEM_8.length; i++) {
  389. var material_item = f.MATERIAL_ITEM_8[i].value.split(":");
  390. if (material_item[0] == field10[0]) {
  391. f.MATERIAL_ITEM_8[i].selected = true;
  392. }
  393. }
  394. }
  395. if (f.MATERIAL_ITEM_9.length > 0) {
  396. var field11 = f.FIELD11.value.split(":");
  397. for (var i=0; i < f.MATERIAL_ITEM_9.length; i++) {
  398. var material_item = f.MATERIAL_ITEM_9[i].value.split(":");
  399. if (material_item[0].trim() == field11[0].trim()) {
  400. f.MATERIAL_ITEM_9[i].selected = true;
  401. }
  402. }
  403. }
  404. }
  405. }
  406. }
  407. else {
  408. dlgErrorMsg(resultObj);
  409. }
  410. document.form1.isSubmit = false;
  411. if (f.click_number.value != '' && f.ing_change.value == '') {
  412. if (f.insert_chk.value == '') {
  413. var chk_value = f.category_code.value.split(";");
  414. for (var i=1; i < (document.all.sheet1.RowCount+1); i++) {
  415. for (var j=0; j < chk_value.length; j++) {
  416. if (document.all.sheet1.CellValue(i, "FILED1") == chk_value[j]) {
  417. document.getElementById("sheet1").CellValue(i,"NUM_CHECK")="1";
  418. }
  419. }
  420. }
  421. }
  422. searchIBSheet("/mcms/spec/auto_symbol_data.screen", "AUTO_SYMBOLITEM_LIST", document.form1, document.all.sheet2);
  423. document.form1.isSubmit = false;
  424. for (var k=1; k < (document.all.sheet2.RowCount+1); k++) {
  425. document.all.sheet2.CellText(k, "STATUS") = "입력";
  426. }
  427. var iCheckRow = document.all.sheet1.FindCheckedRow("NUM_CHECK").split("|");
  428. var itemcategory = f.CATE_CODE.value.split(":");
  429. if (itemcategory.length == 2) {
  430. //if (itemcategory[0].trim() == 'F') {
  431. if (iCheckRow.length == 2) {
  432. f.MATERIAL_ITEM_0.disabled = true;
  433. setSelect(f.MATERIAL_ITEM_0, document.all.sheet1.CellValue(iCheckRow[0], "CODE_NAME"));
  434. /*
  435. if (f.MATERIAL_ITEM_0.length > 0) {
  436. for (var i=0; i < f.MATERIAL_ITEM_0.length; i++) {
  437. if (document.all.sheet1.CellValue(iCheckRow[0], "CODE_NAME") == f.MATERIAL_ITEM_0[i].value) {
  438. //f.MATERIAL_ITEM_0[i].selected = true;
  439. }
  440. }
  441. }
  442. */
  443. }
  444. //}
  445. }
  446. }
  447. if (f.insert_chk.value == '') {
  448. var f = document.form1;
  449. var sheet1 = document.all.sheet1;
  450. var iCheckRow = sheet1.FindCheckedRow("NUM_CHECK");
  451. var arrRow = iCheckRow.split("|");
  452. if (arrRow.length == 1) {
  453. alert('Please, Check Item.');
  454. return;
  455. }
  456. item_name = new Array();
  457. item_code = new Array();
  458. var upcnt = 0;
  459. for( var i = 0 ; i < (arrRow.length-1) ; i++ ) {
  460. item_name[upcnt] = sheet1.CellValue(arrRow[i], "CODE_NAME");
  461. item_code[upcnt] = sheet1.CellValue(arrRow[i], "FILED1");
  462. upcnt++;
  463. }
  464. f.item_name.value = item_name.join(";");
  465. f.item_name.value = item_name;
  466. var cate_code = f.CATE_CODE.value.split(":");
  467. //Valve 인경우 삭제, 박정규 2009.02.05
  468. //if (cate_code[0].trim() == 'V') {
  469. //submitXmlRequest("/mcms/spec/specitem_valve.screen", "VALVE_SUB_LIST", document.form1, "ROWSET");
  470. //}
  471. }
  472. //f.MATERIAL_ITEM_0.value = f.item_name.value;
  473. if(cate_code[0].trim() == 'F'||cate_code[0].trim() == 'V'){
  474. }else{
  475. //getSearchSubCode(1); //beoms(2012.03.07): 수정모드일경우 아이템정보를 사라지게 만들어서 주석처리함
  476. }
  477. }
  478. else if(resultObj.getRequestEvent() == "MATERIAL_SUB_VALUE"){
  479. document.form1.isSubmit = false;
  480. if( resultObj.getSuccess() == true){
  481. for( var i = 0 ; i < rs.getRowSize() ; i++ ) {
  482. if (i == 0) {
  483. clearSectSelectSub(rs.getColValue(i, 0));
  484. }
  485. addSectSelect(rs.getColValue(i, 3), rs.getColValue(i, 3), rs.getColValue(i, 0));
  486. }
  487. if(document.form1.ing_change.value == '1'){
  488. setSelect(f.MATERIAL_ITEM_1, f.MATERIAL_CODE.value);
  489. }
  490. }
  491. else {
  492. dlgErrorMsg(resultObj);
  493. }
  494. }
  495. else if (resultObj.getRequestEvent() == "SPEC_ITEM_CHECK") {
  496. if (resultObj.getSuccess() == true) {
  497. var vo = resultObj.getValueObject();
  498. f.size_from.value = vo.get("size_from");
  499. f.size_to.value = vo.get("size_to");
  500. f.size_interval.value = vo.get("size_interval");
  501. f.min_size_check.value = vo.get("min_size_check");
  502. f.max_size_check.value = vo.get("max_size_check");
  503. }else{
  504. dlgErrorMsg(resultObj);
  505. }
  506. document.form1.isSubmit = false;
  507. if (parseInt(f.size_from.value) > 0 ) {
  508. alert('The size range is overlaped !');
  509. return;
  510. }
  511. if (parseInt(f.size_to.value) > 0 ) {
  512. alert('The size range is overlaped !');
  513. return;
  514. }
  515. if (parseInt(f.size_interval.value) > 0 ) {
  516. alert('The size range is overlaped !');
  517. return;
  518. }
  519. if(parseInt(f.min_size_check.value) == 0 ) {
  520. alert('Not finding the minimum value !');
  521. return;
  522. }
  523. if(parseInt(f.max_size_check.value) == 0 ) {
  524. alert('Not finding the maximum value !');
  525. return;
  526. }
  527. submitIBSheetRequest("/mcms/spec/specitem_add_process.screen", "AUTO_SPECITEM_SAVE", document.form1, document.all.sheet2);
  528. }
  529. else if (resultObj.getRequestEvent() == "AUTO_VALVE_CHK") {
  530. if (resultObj.getSuccess() == true) {
  531. var vo = resultObj.getValueObject();
  532. var item_cnt = vo.get("item_cnt");
  533. }
  534. else {
  535. dlgErrorMsg(resultObj);
  536. }
  537. document.form1.isSubmit = false;
  538. if (parseInt(item_cnt) != 1 ) {
  539. alert("One Valve Group Select...\n*. Gate, Check, Globe Valve ...\n*. Ball Valve ...\n*. Plug Valve ...\n*. Butterfly Valve ...");
  540. return;
  541. }
  542. else {
  543. doAddItem();
  544. }
  545. }
  546. else if (resultObj.getRequestEvent() == "AUTO_FLANGE_CHK") {
  547. if (resultObj.getSuccess() == true) {
  548. var vo = resultObj.getValueObject();
  549. var item_cnt = vo.get("item_cnt");
  550. }
  551. else {
  552. dlgErrorMsg(resultObj);
  553. }
  554. document.form1.isSubmit = false;
  555. if (parseInt(item_cnt) != 1 ) {
  556. alert("One Flange Group Select...\n*. 4,5,6,7,B,L,S,U,W,T,H ...\n*. C,D,P,E...");
  557. return;
  558. }
  559. else {
  560. doAddItem();
  561. }
  562. }
  563. else if (resultObj.getRequestEvent() == "AUTO_SPECITEM_SAVE") {
  564. if (resultObj.getSuccess() == true) {
  565. alertMsg('SAVE_OK','');
  566. //2009.04.30 Park Add하게되면 저장후 Window 닫히게 처리!
  567. if(f.insert_chk.value==''){
  568. window.close();
  569. }else{
  570. window.opener.doSearch1();
  571. window.parent.focus();
  572. }
  573. }
  574. else {
  575. dlgErrorMsg(resultObj);
  576. }
  577. document.form1.isSubmit = false;
  578. }
  579. else if (resultObj.getRequestEvent() == "ITEM_DETAIL_LIST") {
  580. code = new Array();
  581. var upcnt = 0;
  582. for( var i = 0 ; i < rs.getRowSize() ; i++ ) {
  583. code[upcnt] = rs.getColValue(i, 0);
  584. upcnt++;
  585. }
  586. f.category_code.value = code.join(";");
  587. document.form1.isSubmit = false;
  588. submitXmlRequest("/mcms/spec/specitem_category.screen", "ITEM_CATEGORY_LIST", document.form1, "ROWSET");
  589. }
  590. else if (resultObj.getRequestEvent() == "VALVE_SUB_LIST") {
  591. if( resultObj.getSuccess() == true){
  592. for( var i = 0 ; i < rs.getRowSize() ; i++ ) {
  593. if (rs.getColValue(i, 0) == 0) {
  594. clearSectSelectSub(rs.getColValue(i, 4));
  595. }
  596. addSectSelect(rs.getColValue(i, 2), rs.getColValue(i, 2), rs.getColValue(i, 4));
  597. }
  598. }
  599. else {
  600. dlgErrorMsg(resultObj);
  601. }
  602. }
  603. document.form1.isSubmit = false;
  604. } catch(errorObject) {
  605. showErrorDlg("doResult()", errorObject);
  606. }
  607. }
  608. //서브 코드를 찾는다.
  609. function doSubItem(sub_code) {
  610. var f = document.form1;
  611. if (sub_code != '0') {
  612. document.form1.CODE_NO.value = sub_code;
  613. f.MATERIAL_CODE.value = f.MATERIAL_ITEM_1.value;
  614. submitXmlRequest("/mcms/spec/specitem_sub_select.screen", "MATERIAL_SUB_VALUE", document.form1, "ROWSET");
  615. }
  616. }
  617. function doTitleInnerHtml(rs) {
  618. var selectBoxModel = "";
  619. var f = document.form1;
  620. var cate_code = f.CATE_CODE.value.split(":");
  621. for (var i=0; i < rs.getRowSize(); i++) {
  622. selectBoxModel+="<TABLE WIDTH='100%' BORDER='0' CELLSPACING='0' CELLPADDING='0'>\n";
  623. selectBoxModel+="<TR height='23' width='100%'>\n";
  624. selectBoxModel+="<TD width='30%' ALIGN='RIGHT' style='padding-right:3px;'>"+rs.getColValue(i, 1)+"</TD>\n";
  625. selectBoxModel+="<TD id='sheet2_td' height='23' width='55%'>\n";
  626. selectBoxModel+="<select style='width:100%;height=18' class='input_select' name='MATERIAL_ITEM_"+rs.getColValue(i, 9)+"' class='input_select' onChange='getSearchSubCode("+rs.getColValue(i, 10)+");' id=''\n";
  627. //selectBoxModel+="<select style='width:100%;height=18' class='input_select' name='MATERIAL_ITEM_"+rs.getColValue(i, 9)+"' class='input_select' onChange='doSubItem("+rs.getColValue(i, 13)+");' \n";
  628. if (i == 0) {
  629. selectBoxModel+=" disabled \n";
  630. }
  631. if (cate_code[0].trim() == 'F') {
  632. if (i ==3 || i == 5 || i == 6) {
  633. selectBoxModel+="style='background-color:00ff7f;' \n";
  634. }
  635. }
  636. if (cate_code[0].trim() == 'V') {
  637. //if (i ==3 || i == 6 || i == 7 || i == 8) {
  638. if (i ==3 || i == 7 || i == 8) {
  639. selectBoxModel+="style='background-color:00ff7f;' \n";
  640. }
  641. }
  642. selectBoxModel+=" >\n";
  643. selectBoxModel+="<OPTION value=''>-- Select --</OPTION>\n";
  644. selectBoxModel+="</select>\n";
  645. selectBoxModel+="</TD>\n";
  646. selectBoxModel+="<TD>\n";
  647. if (i != 0) {
  648. selectBoxModel+="<IMG id='search_material_button_"+rs.getColValue(i, 10)+"' onClick='doMaterialItemPopup("+rs.getColValue(i, 10)+");' src='/img/button/bt_search_right.gif' border='0' align='absmiddle' alt='[MATERIAL ITEM Select]' style='cursor:hand;'>\n";
  649. } else {
  650. selectBoxModel+="&nbsp;\n";
  651. }
  652. selectBoxModel+="</TD>\n";
  653. selectBoxModel+="</TR>\n";
  654. selectBoxModel+="</TABLE>\n";
  655. if (rs.getColValue(i, 1) == 'CLASS') {
  656. f.list_count.value = '1';
  657. }
  658. }
  659. //f.test_area.value = selectBoxModel;
  660. materialTitle.innerHTML = selectBoxModel;
  661. }
  662. // Material Item 팝업
  663. function doMaterialItemPopup(sel_no) {
  664. var f = document.form1;
  665. var result = "false";
  666. var url = '/cmn/lib/POPUPSearchMaterialItem.screen';
  667. var sel_id = sel_no - 1;
  668. var selectObj = document.getElementById(eval("'MATERIAL_ITEM_"+sel_id+"'"));
  669. var selArray = new Array();
  670. //alert(selectObj.options[1].value);
  671. for(var i=1; i < selectObj.length; i++) {
  672. var tmp = selectObj.options[i].value.split(":");
  673. selArray.push(tmp[0] + "|" + selectObj.options[i].text);
  674. }
  675. //alert(selArray[0]);
  676. result = window.showModalDialog(url, selArray,'dialogWidth:705px;dialogHeight:485px; center:yes; help:no; status:no; scroll:yes; resizable:no');
  677. if( result == null ){
  678. return;
  679. }
  680. setSelect(eval("document.getElementById('MATERIAL_ITEM_"+sel_id+"')"), result[1]);
  681. getSearchSubCode(sel_no);
  682. }
  683. //비어있는 셀렉트박스 항목 조회조건 세팅및 해당항목 조회
  684. function getSearchSubCode(dep){
  685. //alert(dep);
  686. var idx = dep -1 ;
  687. //if(eval("document.all['MATERIAL_ITEM_"+idx+"']").value == ""){
  688. // alert("1111");
  689. // return ;
  690. //}
  691. document.getElementById("isWhere1").value = "" ;
  692. document.getElementById("isKey1").value = "" ;
  693. var f = document.form1 ;
  694. var cate_code = f.CATE_CODE.value.split(":");
  695. var key = cate_code[0].trim();
  696. var category = cate_code[0].trim();
  697. var res = "" ;
  698. var tempStr = "" ;
  699. var tmpCodeId = "" ;
  700. var tObj = eval("document.all['MATERIAL_ITEM_"+(idx+1)+"']");
  701. var nextIsSubmit = false ;
  702. //alert("resultRowSet.getColValue(idx, 13)"+resultRowSet.getColValue(idx, 13));
  703. //선택항항목이 있을경우 해당 코드분리후 일치하는 SUBCODE 존재유무에 따라처리한다.
  704. if(resultRowSet.getColValue(idx, 13) != ""){
  705. tempStr = resultRowSet.getColValue(idx, 13);
  706. tmpCodeId = resultRowSet.getColValue(dep, 10);
  707. var selectObj = eval("document.all['MATERIAL_ITEM_"+dep+"']"); // 선택된 SELECT BOX 객체
  708. var nextObj = eval("document.all['MATERIAL_ITEM_"+tmpCodeId+"']");
  709. if(document.all.sheet2.RowCount == 0){
  710. alert('Please, Check Item.');
  711. return;
  712. }
  713. var flg_key = document.all.sheet2.CellValue(1, "F_ITEM").substring(0,1);
  714. for(var i = 0; i<resultRowSet.getRowSize(); i++){
  715. var keyObj = eval("document.all['MATERIAL_ITEM_"+i+"']");
  716. var value = keyObj.value.split(":");
  717. var keyvalue = value[0].trim();
  718. if(keyObj.value == ""){
  719. //FLANGE 일때 처리 부분
  720. if(i==0){
  721. key += flg_key;
  722. }else{
  723. key += "%";
  724. }
  725. }else{
  726. key += keyvalue;
  727. }
  728. }
  729. document.getElementById("isWhere1").value = key ;
  730. document.getElementById("isKey1").value = tempStr;
  731. nextIsSubmit = true;
  732. if(nextIsSubmit == true){
  733. if(tempStr != ""){
  734. getTmpStrCut(tempStr);
  735. }
  736. f.ing_change.value = dep;
  737. submitXmlRequest("/cmn/lib/lib_spec_data.screen", "MATERIAL_SUB_VALUE", document.form1, "ROWSET");
  738. }
  739. }
  740. }
  741. //Modify 후 SubCode Search
  742. function getSubCode(dep){
  743. var idx = dep -1 ;
  744. if(eval("document.all['MATERIAL_ITEM_"+idx+"']").value == ""){
  745. return ;
  746. }
  747. document.getElementById("isWhere1").value = "" ;
  748. document.getElementById("isKey1").value = "" ;
  749. var f = document.form1 ;
  750. var cate_code = f.CATE_CODE.value.split(":");
  751. var key = cate_code[0].trim();
  752. var res = "" ;
  753. var tempStr = "" ;
  754. var tmpCodeId = "" ;
  755. var tObj = eval("document.all['MATERIAL_ITEM_"+(idx+1)+"']");
  756. var nextIsSubmit = false ;
  757. //선택항항목이 있을경우 해당 코드분리후 일치하는 SUBCODE 존재유무에 따라처리한다.
  758. if(resultRowSet.getColValue(idx, 13) != "0"){
  759. tempStr = resultRowSet.getColValue(idx, 13);
  760. tmpCodeId = resultRowSet.getColValue(dep, 10);
  761. var selectObj = eval("document.all['MATERIAL_ITEM_"+dep+"']"); // 선택된 SELECT BOX 객체
  762. var nextObj = eval("document.all['MATERIAL_ITEM_"+tmpCodeId+"']");
  763. for(var i = 0; i<resultRowSet.getRowSize(); i++){
  764. var keyObj = eval("document.all['MATERIAL_ITEM_"+i+"']");
  765. var value = keyObj.value.split(":");
  766. var keyvalue = value[0].trim();
  767. if(keyObj.value == ""){
  768. key += "%";
  769. }else{
  770. key += keyvalue;
  771. }
  772. }
  773. document.getElementById("isWhere1").value = key ;
  774. document.getElementById("isKey1").value = tempStr;
  775. nextIsSubmit = true;
  776. if(nextIsSubmit == true){
  777. if(tempStr != ""){
  778. getTmpStrCut(tempStr);
  779. }
  780. return true;
  781. }
  782. }
  783. }
  784. function getTmpStrCut(str){
  785. var idx = "" ;
  786. for( var i = 0; i<str.length; i++){
  787. idx = str.substr(i, 1) ;
  788. if(idx == "0"){
  789. clearSectSelectSub(idx);
  790. }else{
  791. clearSectSelectSub(idx-1);
  792. }
  793. }
  794. }
  795. // 분류체계 SELECT 추가
  796. function addSectSelect(value, dscr, key) {
  797. var selectObj = eval("document.form1.MATERIAL_ITEM_"+key) ;
  798. addOption(selectObj, value, dscr) ;
  799. }
  800. // 분류체계 SUBCODE SELECT Clear
  801. function clearSectSelectSub(key) {
  802. if(key!=0){
  803. obj = eval("document.form1.MATERIAL_ITEM_"+key) ;
  804. removeAllOptions(obj);
  805. addOption(obj, "", "-- Select --" );
  806. }
  807. }
  808. function doSizeValue() {
  809. var f = document.form1;
  810. f.SIZE_MAX.value = f.SIZE_MIN.value;
  811. }
  812. function doSizInterval() {
  813. var f = document.form1;
  814. if (parseFloat(f.SIZE_MIN.value) > parseFloat(f.SIZE_MAX.value)) {
  815. alert('Largest size is lesser than shortest size.');
  816. f.SIZE_MAX.value = '';
  817. return;
  818. }
  819. }
  820. function doFlangeValueList(Row) {
  821. var f = document.form1;
  822. var argObj = new Object();
  823. argObj.title = 'Flange & Valve Setting List';
  824. argObj.projectcd = f.projectcd.value;
  825. argObj.cate_code = f.CATE_CODE.value;
  826. argObj.rating_code = f.RATING_CODE.value;
  827. argObj.sch_group = document.all.sheet2.CellValue(Row, "SHORT_CD");
  828. result = window.showModalDialog(getDummyUrl('/mcms/spec/flange_valve_list.screen'), argObj, 'dialogWidth:800px;dialogHeight:600px; center:yes; help:no; status:no; scroll:no; resizable:no');
  829. return;
  830. }
  831. function doValveChk() {
  832. var f = document.form1;
  833. // 화살표 버튼을 막기 위한 추가 - 20120322
  834. if(f.insert_chk.value != '1'){
  835. alert('It is only a add event.');
  836. return;
  837. }
  838. var sheet1 = document.all.sheet1;
  839. var iCheckRow = sheet1.FindCheckedRow("NUM_CHECK");
  840. var arrRow = iCheckRow.split("|");
  841. if (arrRow.length == 1) {
  842. alert('Please, Check Item.');
  843. return;
  844. }
  845. var category = f.CATE_CODE.value.split(":");
  846. item_code = new Array();
  847. item_name = new Array();
  848. var upcnt = 0;
  849. for( var i = 0 ; i < (arrRow.length-1) ; i++ ) {
  850. item_code[upcnt] = sheet1.CellValue(arrRow[i], 2);
  851. item_name[upcnt] = sheet1.CellValue(arrRow[i], 4);
  852. upcnt++;
  853. }
  854. f.item_code.value = item_code.join(";");
  855. f.item_name.value = item_name.join(";");
  856. if (category[0].trim() == 'V') {
  857. submitXmlRequest("/mcms/spec/auto_valve_check.screen", "AUTO_VALVE_CHK", document.form1, "VALUEOBJECT");
  858. }else if(category[0].trim() == 'F'){
  859. submitXmlRequest("/mcms/spec/auto_flange_check.screen", "AUTO_FLANGE_CHK", document.form1, "VALUEOBJECT");
  860. }else{
  861. doAddItem();
  862. }
  863. }
  864. function removeValveChk() {
  865. var f = document.form1;
  866. // 화살표 버튼을 막기 위한 추가 - 20120322
  867. if(f.insert_chk.value != '1'){
  868. alert('It is only a add event.');
  869. return;
  870. }
  871. var sheet2 = document.all.sheet2;
  872. var iCheckRow = sheet2.FindCheckedRow("NUM_CHECK");
  873. var arrRow = iCheckRow.split("|");
  874. if (arrRow.length == 1) {
  875. alert('Please, Check Remove Item.');
  876. return;
  877. }
  878. var category = f.CATE_CODE.value.split(":");
  879. item_code = new Array();
  880. item_name = new Array();
  881. var upcnt = 0;
  882. for( var i = 0 ; i < (arrRow.length-1) ; i++ ) {
  883. item_code[upcnt] = sheet2.CellValue(arrRow[i], 2);
  884. item_name[upcnt] = sheet2.CellValue(arrRow[i], 4);
  885. upcnt++;
  886. }
  887. f.item_code.value = item_code.join(";");
  888. f.item_name.value = item_name.join(";");
  889. doRemoveItem();
  890. }
  891. function doAddItem() {
  892. var result = "false";
  893. var f = document.form1;
  894. var iCheckRow = document.all.sheet1.FindCheckedRow("NUM_CHECK").split("|");
  895. var itemcategory = f.CATE_CODE.value.split(":");
  896. f.MATERIAL_ITEM_0.disabled = true;
  897. var url = '/mcms/spec/auto_symbol_list.screen';
  898. argObj = new Object();
  899. argObj.projectcd = f.projectcd.value;
  900. argObj.R_SPEC_CLASS = f.R_SPEC_CLASS.value;
  901. argObj.item_name = f.item_name.value;
  902. argObj.item_code = f.item_code.value;
  903. argObj.click_number = f.click_number.value;
  904. argObj.GROUP_ID = f.GROUP_ID.value;
  905. argObj.CATE_CODE = f.CATE_CODE.value;
  906. var result = window.showModalDialog(getDummyUrl(url), argObj, 'dialogWidth:700px;dialogHeight:500px;center:yes;help:no;status:no;scroll:no;resizable:no');
  907. if( result != null ) {
  908. with(document.all.sheet2) {
  909. RemoveAll();
  910. for(var i = 0; i < result.length; i++){
  911. DataInsert(i+1);
  912. CellText(i+1, "STATUS") = "입력";
  913. CellValue(i+1, "DEFAULT_FLAG")= result[i]["DEFAULT_FLAG"];
  914. CellValue(i+1, "F_ITEM") = result[i]["F_ITEM"];
  915. CellValue(i+1, "SHORT_CD") = result[i]["SHORT_CD"];
  916. CellValue(i+1, "SHORT_DESC") = result[i]["SHORT_DESC"];
  917. CellValue(i+1, "T_ITEM") = result[i]["T_ITEM"];
  918. CellValue(i+1, "ITEM_ORD") = result[i]["ITEM_ORD"];
  919. }
  920. }
  921. }else{
  922. return;
  923. }
  924. if (iCheckRow.length == 2) {
  925. f.MATERIAL_ITEM_0.disabled = false;
  926. setSelect(f.MATERIAL_ITEM_0, document.all.sheet1.CellValue(iCheckRow[0], "CODE_NAME"));
  927. f.MATERIAL_ITEM_0.disabled = true;
  928. }
  929. else {
  930. f.MATERIAL_ITEM_0.disabled = true;
  931. f.MATERIAL_ITEM_0.value = '';
  932. }
  933. /**
  934. var url_param1 = 'CATE_CODE='+f.CATE_CODE.value+'&ITEM_NAME='+f.item_name.value+'&ITEM_CODE='+f.item_code.value+'&FIELD3='+f.FIELD3.value;
  935. var url_param2 = '&FIELD4='+f.FIELD4.value+'&FIELD5='+f.FIELD5.value+'&FIELD6='+f.FIELD6.value+'&FIELD7='+f.FIELD7.value;
  936. var url_param3 = '&FIELD8='+f.FIELD8.value+'&FIELD9='+f.FIELD9.value+'&FIELD10='+f.FIELD10.value+'&FIELD11='+f.FIELD11.value;
  937. var url = '/mcms/spec/auto_symbol_list.screen?'+url_param1+url_param2+url_param3;
  938. result = window.showModalDialog(url,'addsymbol','dialogWidth:700px;dialogHeight:500px;center:yes;help:no;status:no;scroll:no;resizable:no');
  939. if( result == null ) {
  940. return;
  941. } else {
  942. var sheet2 = document.all.sheet2;
  943. var num_check = result[0].split(";");
  944. var defalut_flag= result[1].split(";");
  945. var f_item = result[2].split(";");
  946. var short_cd = result[3].split(";");
  947. var short_desc = result[4].split(";");
  948. var t_item = result[5].split(";");
  949. var item_ord = result[6].split(";");
  950. sheet2.RemoveAll();
  951. if (num_check.length > 0) {
  952. for (var i=0; i < num_check.length; i++) {
  953. var rowIndex = sheet2.DataInsert();
  954. sheet2.CellValue(rowIndex, "NUM_CHECK") = num_check[i];
  955. sheet2.CellValue(rowIndex, "DEFAULT_FLAG") = defalut_flag[i];
  956. sheet2.CellValue(rowIndex, "F_ITEM") = f_item[i];
  957. sheet2.CellValue(rowIndex, "SHORT_CD") = short_cd[i];
  958. sheet2.CellValue(rowIndex, "SHORT_DESC") = short_desc[i];
  959. sheet2.CellValue(rowIndex, "T_ITEM") = t_item[i];
  960. sheet2.CellValue(rowIndex, "ITEM_ORD") = item_ord[i];
  961. }
  962. }
  963. }
  964. */
  965. }
  966. function doRemoveItem() {
  967. var iCheckRow = document.all.sheet2.FindCheckedRow("NUM_CHECK");
  968. var removeCheckRow = iCheckRow.split("|");
  969. for (idx=(removeCheckRow.length-1); idx > 0; idx--) {
  970. document.all.sheet2.RowDelete(removeCheckRow[idx-1], false);
  971. }
  972. document.all.sheet2.CheckAll(0) = 0;
  973. //document.all.sheet1.CheckAll(0) = 0;
  974. }
  975. function doInputSch(){
  976. document.form1.SCH_GROUP.value = document.form1.S_SCH_GROUP.value;
  977. }
  978. function doAdd() {
  979. var sheet1 = document.all.sheet1;
  980. var sheet2 = document.all.sheet2;
  981. var f = document.form1;
  982. var cate_code = f.CATE_CODE.value.split(":");
  983. if (sheet1.FindCheckedRow("NUM_CHECK").length == '0') {
  984. alertMsg('SELECT_CHK','Item Grtegory.');
  985. return;
  986. }
  987. if (sheet2.CellValue(1, "F_ITEM") == '') {
  988. alertMsg('SELECT_CHK','Symbol Item.');
  989. return;
  990. }
  991. if (f.SIZE_MIN.value == '') {
  992. alertMsg('SELECT_CHK','Size Min.');
  993. return;
  994. }
  995. if (f.SIZE_MAX.value == '') {
  996. alertMsg('SELECT_CHK','Size Max.');
  997. return;
  998. }
  999. if (cate_code[0].trim() == 'F') {
  1000. if (f.MATERIAL_ITEM_1.value == '' ) {
  1001. alertMsg('SELECT_CHK','Material Code.');
  1002. f.MATERIAL_ITEM_1.focus();
  1003. return;
  1004. }
  1005. if (f.MATERIAL_ITEM_2.value == '' ) {
  1006. alertMsg('SELECT_CHK','Material Code.');
  1007. f.MATERIAL_ITEM_2.focus();
  1008. return;
  1009. }
  1010. if (f.MATERIAL_ITEM_4.value == '' ) {
  1011. alertMsg('SELECT_CHK','Material Code.');
  1012. f.MATERIAL_ITEM_4.focus();
  1013. return;
  1014. }
  1015. }
  1016. else if (cate_code[0].trim() == 'V') {
  1017. if (f.MATERIAL_ITEM_1.value == '' ) {
  1018. alertMsg('SELECT_CHK','Material Code.');
  1019. f.MATERIAL_ITEM_1.focus();
  1020. return;
  1021. }
  1022. if (f.MATERIAL_ITEM_2.value == '' ) {
  1023. alertMsg('SELECT_CHK','Material Code.');
  1024. f.MATERIAL_ITEM_2.focus();
  1025. return;
  1026. }
  1027. if (f.MATERIAL_ITEM_4.value == '' ) {
  1028. alertMsg('SELECT_CHK','Material Code.');
  1029. f.MATERIAL_ITEM_4.focus();
  1030. return;
  1031. }
  1032. if (f.MATERIAL_ITEM_5.value == '' ) {
  1033. alertMsg('SELECT_CHK','Material Code.');
  1034. f.MATERIAL_ITEM_5.focus();
  1035. return;
  1036. }
  1037. if (f.MATERIAL_ITEM_6.value == '' ) {
  1038. alertMsg('SELECT_CHK','Material Code.');
  1039. f.MATERIAL_ITEM_6.focus();
  1040. return;
  1041. }
  1042. if (f.MATERIAL_ITEM_9.value == '' ) {
  1043. alertMsg('SELECT_CHK','Material Code.');
  1044. f.MATERIAL_ITEM_9.focus();
  1045. return;
  1046. }
  1047. }
  1048. else if (cate_code[0].trim() == 'K') {
  1049. if (f.MATERIAL_ITEM_1.value == '' ) {
  1050. alertMsg('SELECT_CHK','Material Code.');
  1051. f.MATERIAL_ITEM_1.focus();
  1052. return;
  1053. }
  1054. if (f.MATERIAL_ITEM_2.value == '' ) {
  1055. alertMsg('SELECT_CHK','Material Code.');
  1056. f.MATERIAL_ITEM_2.focus();
  1057. return;
  1058. }
  1059. if (f.MATERIAL_ITEM_3.value == '' ) {
  1060. alertMsg('SELECT_CHK','Material Code.');
  1061. f.MATERIAL_ITEM_3.focus();
  1062. return;
  1063. }
  1064. if (f.MATERIAL_ITEM_4.value == '' ) {
  1065. alertMsg('SELECT_CHK','Material Code.');
  1066. f.MATERIAL_ITEM_4.focus();
  1067. return;
  1068. }
  1069. if (f.MATERIAL_ITEM_5.value == '' ) {
  1070. alertMsg('SELECT_CHK','Material Code.');
  1071. f.MATERIAL_ITEM_5.focus();
  1072. return;
  1073. }
  1074. if (f.MATERIAL_ITEM_6.value == '' ) {
  1075. alertMsg('SELECT_CHK','Material Code.');
  1076. f.MATERIAL_ITEM_6.focus();
  1077. return;
  1078. }
  1079. }
  1080. else if (cate_code[0].trim() == 'P') {
  1081. if (f.MATERIAL_ITEM_1.value == '' ) {
  1082. alertMsg('SELECT_CHK','Material Code.');
  1083. f.MATERIAL_ITEM_1.focus();
  1084. return;
  1085. }
  1086. if (f.MATERIAL_ITEM_2.value == '' ) {
  1087. alertMsg('SELECT_CHK','Material Code.');
  1088. f.MATERIAL_ITEM_2.focus();
  1089. return;
  1090. }
  1091. if (f.MATERIAL_ITEM_3.value == '' ) {
  1092. alertMsg('SELECT_CHK','Material Code.');
  1093. f.MATERIAL_ITEM_3.focus();
  1094. return;
  1095. }
  1096. if (f.MATERIAL_ITEM_4.value == '' ) {
  1097. alertMsg('SELECT_CHK','Material Code.');
  1098. f.MATERIAL_ITEM_4.focus();
  1099. return;
  1100. }
  1101. if (f.MATERIAL_ITEM_5.value == '' ) {
  1102. alertMsg('SELECT_CHK','Material Code.');
  1103. f.MATERIAL_ITEM_5.focus();
  1104. return;
  1105. }
  1106. if (f.MATERIAL_ITEM_6.value == '' ) {
  1107. alertMsg('SELECT_CHK','Material Code.');
  1108. f.MATERIAL_ITEM_6.focus();
  1109. return;
  1110. }
  1111. if (f.MATERIAL_ITEM_7.value == '' ) {
  1112. alertMsg('SELECT_CHK','Material Code.');
  1113. f.MATERIAL_ITEM_7.focus();
  1114. return;
  1115. }
  1116. }
  1117. for (var j=1; j < (sheet2.RowCount+1); j++) {
  1118. sheet2.RowStatus(j) = "I";
  1119. }
  1120. var i_row = sheet2.FindStatusRow("I").split(";");
  1121. symbol_code = new Array();
  1122. upcnt = 0;
  1123. for (var i=0; i < (i_row.length-1); i++) {
  1124. symbol_code[upcnt] = sheet2.CellValue(i_row[i], "SHORT_CD");
  1125. upcnt++;
  1126. }
  1127. f.symbol_code.value = symbol_code.join(";");
  1128. document.form1.isSubmit = false;
  1129. submitXmlRequest("/mcms/spec/auto_specitem_chk.screen", "SPEC_ITEM_CHECK", document.form1, "VALUEOBJECT");
  1130. }
  1131. function doExit() {
  1132. returnValue = new Array('OK');
  1133. window.close();
  1134. }
  1135. document.body.onload = doPageInit;
  1136. document.body.onresize = addEvent( document.body.onresize, "doResizeSheet(document.all.sheet1)");
  1137. document.body.onunload = doExit;
  1138. </SCRIPT>
  1139. <Script language="javascript" for="sheet2" event="OnClick(Row,Col)">
  1140. var sName = ColSaveName(Col);
  1141. var f = document.form1;
  1142. var category = f.CATE_CODE.value.split(":");
  1143. if (category[0].trim() == 'F' || category[0].trim() == 'V') {
  1144. switch(sName)
  1145. {
  1146. case "SHORT_DESC":
  1147. doFlangeValueList(Row);
  1148. break;
  1149. }
  1150. }
  1151. </script>
  1152. <SCRIPT language="javascript" for="sheet1" event="OnClick(Row,Col,Value)">
  1153. </SCRIPT>
  1154. <form name="form1">
  1155. <!-- <textarea rows="5" cols="50" id="test_area" name="test_area"></textarea> -->
  1156. <input type="hidden" name="projectid" value="<%= params.get("projectid") %>"/>
  1157. <input type="hidden" name="projectcd" value="<%= params.get("projectcd") %>"/>
  1158. <input type="hidden" name="projectnm" value="<%= params.get("projectnm") %>" />
  1159. <input type="hidden" name="SPEC_CLASS" value="<%= params.get("SPEC_CLASS") %>"/>
  1160. <input type="hidden" name="SCH_GROUP" value="<%= params.get("SCH_GROUP") %>"/>
  1161. <input type="hidden" name="SCH_TYPE" value="<%= params.get("SCH_TYPE") %>"/>
  1162. <input type="hidden" name="MATERIAL_CODE" value="<%= params.get("MATERIAL_CODE") %>"/>
  1163. <input type="hidden" name="RATING_CODE" value="<%= params.get("RATING_CODE") %>"/>
  1164. <input type="hidden" name="R_SPEC_CLASS" value="<%= params.get("R_SPEC_CLASS") %>"/>
  1165. <input type="hidden" name="C_SPEC_CLASS" value="<%= params.get("C_SPEC_CLASS") %>">
  1166. <input type="hidden" name="code_cloumn" value="<%= params.get("code_cloumn") %>"/>
  1167. <input type="hidden" name="desc_column" value="<%= params.get("desc_column") %>"/>
  1168. <input type="hidden" name="code_table" value="<%= params.get("code_table") %>"/>
  1169. <input type="hidden" name="lib_column" value="<%= params.get("lib_column") %>"/>
  1170. <input type="hidden" name="lib_code" value="<%= params.get("lib_code") %>"/>
  1171. <input type="hidden" name="order_column" value="<%= params.get("order_column") %>"/>
  1172. <input type="hidden" name="desc_flag" value="<%= params.get("desc_flag") %>"/>
  1173. <input type="hidden" name="list_count" value="<%= params.get("list_count") %>">
  1174. <input type="hidden" name="class_value" value="<%= params.get("class_value") %>" >
  1175. <input type="hidden" name="CODE_NO" value="">
  1176. <input type="hidden" name="item_code" value="">
  1177. <input type="hidden" name="item_name" value="">
  1178. <input type="hidden" name="fevent" value="">
  1179. <input type="hidden" name="size_from" value="">
  1180. <input type="hidden" name="size_to" value="">
  1181. <input type="hidden" name="size_interval" value="">
  1182. <input type="hidden" name="min_size_check" value="">
  1183. <input type="hidden" name="max_size_check" value="">
  1184. <input type="hidden" name="symbol_code" value="">
  1185. <input type="hidden" name="click_number" value="<%= params.get("click_number") %>">
  1186. <input type="hidden" name="GROUP_ID" value="<%= params.get("GROUP_ID") %>">
  1187. <input type="hidden" name="category_code">
  1188. <input type="hidden" name="F_CATE_CODE" value="<%= params.get("F_CATE_CODE") %>">
  1189. <input type="hidden" name="FIELD3" value="<%= params.get("FIELD3") %>">
  1190. <input type="hidden" name="FIELD4" value="<%= params.get("FIELD4") %>">
  1191. <input type="hidden" name="FIELD5" value="<%= params.get("FIELD5") %>">
  1192. <input type="hidden" name="FIELD6" value="<%= params.get("FIELD6") %>">
  1193. <input type="hidden" name="FIELD7" value="<%= params.get("FIELD7") %>">
  1194. <input type="hidden" name="FIELD8" value="<%= params.get("FIELD8") %>">
  1195. <input type="hidden" name="FIELD9" value="<%= params.get("FIELD9") %>">
  1196. <input type="hidden" name="FIELD10" value="<%= params.get("FIELD10") %>">
  1197. <input type="hidden" name="FIELD11" value="<%= params.get("FIELD11") %>">
  1198. <input type="hidden" name="ing_change">
  1199. <input type="hidden" name="sub_code_no" value="<%= params.get("sub_code_no") %>">
  1200. <input type="hidden" name="m_code_no" value="<%= params.get("m_code_no") %>">
  1201. <input type="hidden" name="insert_chk" value="<%= params.get("insert_chk") %>">
  1202. <input type="hidden" id="DESIGN_CODE" name="DESIGN_CODE" value="<%= params.get("DESIGN_CODE") %>">
  1203. <input type="hidden" id="FLUID_SERVICE" name="FLUID_SERVICE" value="<%= params.get("FLUID_SERVICE") %>">
  1204. <input type="hidden" name="p_hwen_code" value="<%= params.get("p_hwen_code") %>">
  1205. <input type="hidden" name="isKey1" value="">
  1206. <input type="hidden" name="isWhere1" value="">
  1207. <input type="hidden" name="pop_div" value="<%= params.get("pop_div") %>"> <!-- 팝업타입이 다이얼로그:0, open:1 -->
  1208. <table border="0" cellspacing="0" cellpadding="0" width="100%" height="100%">
  1209. <!-- tr>
  1210. <td height="1" colspan="3">
  1211. <table class="screen_title_table">
  1212. <tr height="2">
  1213. <td colspan="2"></td>
  1214. </tr>
  1215. <tr height="25">
  1216. <td width="16" valign="middle"><img src="/img/button/bullet_03.gif"></td>
  1217. <td width="100%" class="screen_title_text">List of Item</td>
  1218. </tr>
  1219. </table>
  1220. </td>
  1221. </tr-->
  1222. <tr height="25" style="width:100%;">
  1223. <td width="100%" colspan="3">
  1224. <table border="0" cellspacing="1" cellpadding="0" width="100%" class="search_table">
  1225. <tr height="25">
  1226. <td width="20%" class="search_table_data">&nbsp;&nbsp;<span id="title_detail" style="font:bold;"></span></td>
  1227. <td width="80%" class="search_table_data">
  1228. <div id="button" style="display:block;">
  1229. <table border="0" cellpadding="0" cellspacing="0" align="right">
  1230. <tr>
  1231. <td width="10"></td>
  1232. <td>
  1233. <div id="btn_insert" style="display:''" onclick="javascript:doAdd()" class="button_style">
  1234. <table border="0" cellpadding="0" cellspacing="0">
  1235. <tr>
  1236. <td class="button_left1"></td>
  1237. <td class="button_text2">Add</td>
  1238. <td class="button_right"></td>
  1239. </tr>
  1240. </table>
  1241. </div>
  1242. </td>
  1243. <td width="5">
  1244. </td>
  1245. <td>
  1246. <div id="btn_insert" style="display:''" onclick="javascript:doExit()" class="button_style">
  1247. <table border="0" cellpadding="0" cellspacing="0">
  1248. <tr>
  1249. <td class="button_left1"></td>
  1250. <td class="button_text2">Close</td>
  1251. <td class="button_right"></td>
  1252. </tr>
  1253. </table>
  1254. </div>
  1255. </td>
  1256. <td width="10"></td>
  1257. </tr>
  1258. </table>
  1259. </div>
  1260. </td>
  1261. </tr>
  1262. </table>
  1263. </td>
  1264. </tr>
  1265. <tr height="1">
  1266. <td colspan="3">
  1267. <table border="0" cellspacing="0" cellpadding="0" class="search_data_div_height">
  1268. <tr>
  1269. <td></td>
  1270. </tr>
  1271. </table>
  1272. </td>
  1273. </tr>
  1274. <tr>
  1275. <td height="100%">
  1276. <table border='0' cellspacing="0" cellpadding="0" style="width:100%;height:100%;">
  1277. <tr style="height:25">
  1278. <td width="10%" valign="center" class="search_table_title"><img src="/img/button/bullet_01.gif" align="middle">Item Category</td>
  1279. <td witdh="15%" class="search_table_data">
  1280. &nbsp;<%= ItemCategoryManager.getSelectCodeList1("CATE_CODE", "style='width:70%;height=22;' onchange='javascript:doItemList();'", "<option value=''>-- Select --</option>", "" , "") %>
  1281. </td>
  1282. <td width="10%" valign="center" class="search_table_title"><img src="/img/button/bullet_01.gif" align="middle">Schedule</td>
  1283. <td witdh="15%" class="search_table_data">
  1284. &nbsp;<select name="S_SCH_GROUP" class='input_select' style="width:80%;height=22;" align='absmiddle' onchange="javascript:doInputSch();">
  1285. <OPTION>-- Select --</OPTION>
  1286. </select>
  1287. </td>
  1288. <td width="10%" valign="center" class="search_table_title"><img src="/img/button/bullet_01.gif" align="middle"> Size, Min/Max</td>
  1289. <td witdh="40%" class="search_table_data">
  1290. &nbsp;<%= SizeSelectManager.getSelectCodeList(user.get("SIZE_UNIT"), "SIZE_MIN", "style='width:30%;height=22;' onchange='javascript:doSizeValue();'", "<option value=''>-- Select --</option>", "" , "") %>
  1291. &nbsp;<%= SizeSelectManager.getSelectCodeList(user.get("SIZE_UNIT"), "SIZE_MAX", "style='width:30%;height=22;' onchange='javascript:doSizInterval();'", "<option value=''>-- Select --</option>", "" , "") %>
  1292. </td>
  1293. </tr>
  1294. <tr height="6">
  1295. <td colspan="6" class="search_data_div_height"></td>
  1296. </tr>
  1297. <tr>
  1298. <td colspan="6">
  1299. <table border='1' cellspacing="0" cellpadding="0" style="width:100%;height:100%;">
  1300. <tr height="100%">
  1301. <td id="sheet1_td" width="25%" align='center'>
  1302. <script>
  1303. var sheetObj = new IBSheetObject("sheet1");
  1304. sheetObj.display();
  1305. </script>
  1306. </td>
  1307. <td width="5%" class="search_table_data" align='center'>
  1308. &nbsp;
  1309. <div id="move" >
  1310. <IMG id='search_spot_button' onClick="javascript:doValveChk();" src='/img/button/bt_arrow_1.gif' border='0' align='absmiddle' style='cursor:hand;'>
  1311. </div>
  1312. <br>
  1313. <div id="remove">
  1314. <IMG id='search_spot_button' onClick="javascript:removeValveChk();" src='/img/button/bt_arrow_3.gif' border='0' align='absmiddle' style='cursor:hand;'>
  1315. </div>
  1316. </td>
  1317. <td>
  1318. <table border='0' cellspacing="0" cellpadding="0" style="width:100%;height:100%;">
  1319. <tr height='60%'>
  1320. <td id="sheet2_td" width='100%' colspan='2'>
  1321. <script>
  1322. var sheetObj = new IBSheetObject("sheet2");
  1323. sheetObj.display();
  1324. </script>
  1325. </td>
  1326. </tr>
  1327. <tr>
  1328. <TD><DIV ID="materialTitle"></DIV></TD>
  1329. </tr>
  1330. </table>
  1331. </td>
  1332. </tr>
  1333. </table>
  1334. </td>
  1335. </tr>
  1336. </table>
  1337. </td>
  1338. </tr>
  1339. <tr>
  1340. <td colspan="3">
  1341. <table border="0" cellspacing="0" cellpadding="0" class="search_data_div_height">
  1342. <tr>
  1343. <td></td>
  1344. </tr>
  1345. </table>
  1346. </td>
  1347. </tr>
  1348. </table>
  1349. </form>