GoodsDetailForm.html 90 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245
  1. <!DOCTYPE html>
  2. <html lang="ko"
  3. xmlns:th="http://www.thymeleaf.org">
  4. <!--
  5. *******************************************************************************
  6. * @source : GoodsDetailForm.html
  7. * @desc : 상품 상세 팝업
  8. *============================================================================
  9. * STYLE24
  10. * Copyright(C) 2020 TSIT, All rights reserved.
  11. *============================================================================
  12. * VER DATE AUTHOR DESCRIPTION
  13. * === =========== ========== =============================================
  14. * 1.0 2020.10.23 eskim 최초 작성
  15. *******************************************************************************
  16. -->
  17. <div class="modalPopup" data-width="1500" > <!-- data-width="1500" data-height="870" -->
  18. <div class="panelStyle">
  19. <div class="panelTitle">
  20. <h2>상품상세</h2>
  21. <button type="button" class="close" onclick="fnGoodsDetailClose()"><i class="fa fa-times"></i></button>
  22. </div>
  23. <form id="goodsDetailForm" name="goodsDetailForm" action="#" th:method="post">
  24. <input type="hidden" id="mode" name="mode" th:value="${params.mode}"/>
  25. <input type="hidden" id="goodsCd" name="goodsCd" th:value="${params.goodsCd}"/>
  26. <input type="hidden" id="niClsfCd" name="niClsfCd"/>
  27. <input type="hidden" id="selfGoodsYn" name="selfGoodsYn"/>
  28. <input type="hidden" id="notiList" name="notiList" />
  29. <input type="hidden" id="chDataYn" name="chDataYn" />
  30. <input type="hidden" id="chStockDataYn" name="chStockDataYn" />
  31. <input type="hidden" id="goodsImageYn" name="goodsImageYn" />
  32. <input type="hidden" id="niClsfNm" name="niClsfNm" />
  33. <input type="hidden" id="uploadGoodsUrl" name="uploadGoodsUrl" th:value="${@environment.getProperty('upload.goods.view')}"/>
  34. <input type="hidden" id="mainColorCd" name="mainColorCd" />
  35. <input type="hidden" id="goodsType" name="goodsType" />
  36. <input type="hidden" id="goodsComposeList" name="goodsComposeList" />
  37. <input type="hidden" id="repGoodsCd" name="repGoodsCd" /> <!-- 대표상품(딜 가격) -->
  38. <div class="panelContent">
  39. <table class="frmStyle">
  40. <colgroup>
  41. <col width="11%"/>
  42. <col/>
  43. <col width="11%"/>
  44. <col width="14%"/>
  45. <col width="11%"/>
  46. <col width="14%"/>
  47. <col width="11%"/>
  48. <col width="14%"/>
  49. </colgroup>
  50. <tr>
  51. <th>브랜드명<em class="required" title="필수"></em></th>
  52. <td colspan="3">
  53. <select name="selSupplyCompCd" id="selSupplyCompCd" disabled="disabled" class="w40p">
  54. <option value="">[선택]</option>
  55. <option th:if="${supplyCompList}" th:each="oneData, status : ${supplyCompList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
  56. </select>
  57. <select name="selBrandCd" id="selBrandCd" disabled="disabled" class="w40p">
  58. <option value="">[선택]</option>
  59. </select>
  60. <input type="hidden" name="supplyCompCd" id="supplyCompCd" />
  61. <input type="hidden" name="brandGrpNm" id="brandGrpNm" />
  62. <input type="hidden" name="brandCd" id="brandCd" />
  63. </td>
  64. <th>상품코드<em class="required" title="필수"></em></th>
  65. <td><div id="goodsCdTxt"></div></td>
  66. <th>원코드</th>
  67. <td><span id="supplyGoodsCdTxt"></span></td>
  68. </tr>
  69. </table>
  70. <!-- TABS SPACE -->
  71. <div class="tabs">
  72. <!-- TABS NAVI -->
  73. <div class="tabsNav">
  74. <ul>
  75. <li class="on"><a href="#goodstab1">기본정보</a></li>
  76. <li><a href="#goodstab2">옵션/재고정보</a></li>
  77. <li><a href="#goodstab3">상품상세정보</a></li>
  78. <li id="goodsNotiTab"><a href="#goodstab4">고시정보</a></li>
  79. <li id="goodsComposeTab" style="display:none;"><a href="#goodstab5">구성상품</a></li>
  80. <li><a href="#goodstab6">변경이력</a></li>
  81. </ul>
  82. </div>
  83. <!-- //TABS NAVI -->
  84. <!-- TABS CONTENTS -->
  85. <ul class="tabsCont" th:with="uxImgUrl=${@environment.getProperty('domain.uximage')}">
  86. <!-- TAB1 : 기본정보 -->
  87. <li class="tab on" id="goodstab1">
  88. <!-- TAB1 CONTENTS AREA -->
  89. <div class="panelStyle">
  90. <table class="frmStyle">
  91. <colgroup>
  92. <col width="10%"/>
  93. <col width="15%"/>
  94. <col width="15%"/>
  95. <col width="15%"/>
  96. <col width="15%"/>
  97. <col width="15%"/>
  98. <col/>
  99. </colgroup>
  100. <tbody>
  101. <tr>
  102. <td rowspan="4" style="text-align:center">
  103. <img id="goodsImgUrl" src="" width="100px"/>
  104. <input type="hidden" name="sysImgNm" id="sysImgNm" />
  105. </td>
  106. <th>상품타이틀</th>
  107. <td colspan="5">
  108. <input type="text" class="w80p" id="goodsTnm" name="goodsTnm" maxlength=""></input>
  109. <span class="byteChk"><em class="cBlue" id="goodsTnmLen">0</em>/100 bytes</span>
  110. <input type="hidden" id="goodsTnmOrg" name="goodsTnmOrg"/>
  111. </td>
  112. </tr>
  113. <tr>
  114. <th>상품명<em class="required" title="필수"></em></th>
  115. <td colspan="5">
  116. <input type="text" class="w80p" id="goodsNm" name="goodsNm"></input>
  117. <span class="byteChk"><em class="cBlue" id="goodsNmLen">0</em>/200 bytes</span>
  118. <input type="hidden" id="goodsNmOrg" name="goodsNmOrg"/>
  119. </td>
  120. </tr>
  121. <tr>
  122. <th>사용자검색어</th>
  123. <td colspan="5">
  124. <input type="text" class="w60p" id="goodsSnm1" name="goodsSnm1"></input>
  125. <span class="byteChk"><em class="cBlue" id="goodsSnm1Len">0</em>/200 bytes</span><font class="cBlue padL10"><b>* 여러개설정할경우 ; 구분자 사용 / 공백은 자동삭제처리</b></font>
  126. <input type="hidden" id="goodsSnm1Org" name="goodsSnm1Org"/>
  127. </td>
  128. </tr>
  129. <tr>
  130. <th>검색어</th>
  131. <td colspan="5">
  132. <textarea class="textareaR2 w100p" id="goodsSnmTxt" name="goodsSnmTxt" disabled="disabled"></textarea>
  133. <!-- <input type="text" class="w100p" id="goodsSnmTxt" name="goodsSnmTxt" disabled="disabled"></input> -->
  134. <input type="hidden" id="goodsSnm" name="goodsSnm"></input>
  135. </td>
  136. </tr>
  137. <tr>
  138. <td class="aC cRed" style="font-weight:bold;"><span id="goodsTypeNm"></span></td> <!-- 상품타입노출 -->
  139. <th>정상/이월 구분<em class="required" title="필수"></em></th>
  140. <td>
  141. <label class="rdoBtn" th:if="${formalGbList}" th:each="oneData, status : ${formalGbList}" ><input type="radio" id="formalGb" name="formalGb" th:value="${oneData.cd}" th:text="${oneData.cdNm}" /></label>
  142. <input type="hidden" id="formalGbOrg" name="formalGbOrg"/>
  143. </td>
  144. <th>상품상태<em class="required" title="필수"></em></th>
  145. <td>
  146. <select name="goodsStat" id="goodsStat">
  147. <option value="">[선택]</option>
  148. <option th:if="${goodsStatList}" th:each="oneData, status : ${goodsStatList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
  149. </select>
  150. <input type="hidden" id="goodsStatOrg" name="goodsStatOrg"/>
  151. </td>
  152. <th>자사몰 노출여부<em class="required" title="필수"></em></th>
  153. <td>
  154. <label class="rdoBtn"><input type="radio" name="selfMallYn" id="selfMallYnY" value="Y" />Y</label>
  155. <label class="rdoBtn"><input type="radio" name="selfMallYn" id="selfMallYnN" value="N"/>N</label>
  156. <input type="hidden" id="selfMallYnOrg" name="selfMallYnOrg"/>
  157. </td>
  158. </tr>
  159. <tr>
  160. <td rowspan="12">&nbsp;</td>
  161. <th>시즌<em class="required" title="필수"></em></th>
  162. <td >
  163. <select name="seasonCd" id="seasonCd">
  164. <option value="">[선택]</option>
  165. <option th:if="${seasonList}" th:each="oneData, status : ${seasonList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
  166. </select>
  167. <input type="hidden" id="seasonCdOrg" name="seasonCdOrg"/>
  168. </td>
  169. <th>성별<em class="required" title="필수"></em></th>
  170. <td>
  171. <select name="sexGb" id="sexGb">
  172. <option value="">[선택]</option>
  173. <option th:if="${sexGbList}" th:each="oneData, status : ${sexGbList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
  174. </select>
  175. <input type="hidden" id="sexGbOrg" name="sexGbOrg"/>
  176. </td>
  177. <th>스타일년도</th>
  178. <td><span id="styleYearTxt"></span></td>
  179. </tr>
  180. <tr id="erplinkarea">
  181. <th>원산지</th>
  182. <td><span id="makeNmTxt"></span></td>
  183. <th>상품구분<em class="required" title="필수"></em></th>
  184. <td>
  185. <select name="goodsGb" id="goodsGb">
  186. <option value="">[선택]</option>
  187. <option th:if="${goodsGbList}" th:each="oneData, status : ${goodsGbList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
  188. </select>
  189. <input type="hidden" id="goodsGbOrg" name="goodsGbOrg"/>
  190. </td>
  191. <th>유통구분<em class="required" title="필수"></em></th>
  192. <td><select name="distributionGb" id="distributionGb">
  193. <option value="">[선택]</option>
  194. <option th:if="${distributionGbList}" th:each="oneData, status : ${distributionGbList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
  195. </select>
  196. <input type="hidden" id="distributionGbOrg" name="distributionGbOrg"/>
  197. </td>
  198. </tr>
  199. <tr id="erplinkarea">
  200. <th>상품연령대</th>
  201. <td>
  202. <select name="ageGrpCd" id="ageGrpCd">
  203. <option value="">[선택]</option>
  204. <option th:if="${ageGrpCdList}" th:each="oneData, status : ${ageGrpCdList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
  205. </select>
  206. <input type="hidden" id="ageGrpCdOrg" name="ageGrpCdOrg"/>
  207. </td>
  208. <th>선물 주문가능여부<em class="required" title="필수"></em></th>
  209. <td>
  210. <label class="rdoBtn"><input type="radio" name="giftPackYn" id="giftPackYnY" value="Y" />Y</label>
  211. <label class="rdoBtn"><input type="radio" name="giftPackYn" id="giftPackYnN" value="N"/>N</label>
  212. <input type="hidden" id="giftPackYnOrg" name="giftPackYnOrg"/>
  213. </td>
  214. <th>가격변경일</th>
  215. <td><span id="priceUpdDtTxt"></span></td>
  216. </tr>
  217. <tr>
  218. <th>정상가</th>
  219. <td class="aR"><span id="listPriceTxt"></span> 원
  220. <input type="hidden" id="listPrice" name="listPrice"/>
  221. </td>
  222. <th>판매가<em class="required" title="필수"></em></th>
  223. <td><input type="text" class="w80p aR" id="currPrice" name="currPrice" maxlength="10" data-valid-type="numeric"/> 원
  224. <input type="hidden" id="currPriceOrg" name="currPriceOrg"/>
  225. </td>
  226. <th>할인율</th>
  227. <td class="aR" ><span id="dcRateTxt"></span> % <input type="hidden" id="dcRate" name="dcRate"/></td>
  228. </tr>
  229. <tr id="selfGoodsNSellFeeRate">
  230. <th>최초승인일</th>
  231. <td><span id="frstCfrmDtTxt"></span></td>
  232. <th>판매수수료율<em class="required" title="필수"></em></th>
  233. <td><input type="text" class="w80p aR" id="sellFeeRate" name="sellFeeRate" maxlength="10" data-valid-type="numeric"/> %
  234. <input type="hidden" id="sellFeeRateOrg" name="sellFeeRateOrg"/>
  235. </td>
  236. <th>과세구분</th>
  237. <td>
  238. <select name="taxGb" disabled="disabled">
  239. <option value="">[선택]</option>
  240. <option value="10">과세</option>
  241. <option value="20">비과세</option>
  242. </select>
  243. </td>
  244. </tr>
  245. <tr>
  246. <th>품목코드<em class="required" title="필수"></em></th>
  247. <td colspan="3">
  248. <select name="itemkindCd" id="itemkindCd" th:disabled="${sessionInfo.roleCd != 'G001_0000' AND sessionInfo.roleCd != 'G001_A000' AND sessionInfo.roleCd != 'G001_A101' AND sessionInfo.roleCd != 'G001_A100' AND sessionInfo.roleCd != 'G001_A001'}">
  249. <option th:if="${itemkindList}" th:each="oneData, status : ${itemkindList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
  250. </select>
  251. <input type="hidden" id="orgItemkindCd" name="orgItemkindCd"/>
  252. <th:block th:if="${sessionInfo.roleCd == 'G001_0000' OR sessionInfo.roleCd == 'G001_A000' OR sessionInfo.roleCd == 'G001_A101' OR sessionInfo.roleCd == 'G001_A100' OR sessionInfo.roleCd == 'G001_A001' }">
  253. <button type="button" class="btn btn-success btn-lg" id="btnGoodsItemkindChange">품목변경</button>
  254. </th:block>
  255. </td>
  256. <th>원가</th>
  257. <td><input type="text" class="w80p aR" id="costPrice" name="costPrice" maxlength="10" data-valid-type="numeric"/> 원
  258. <input type="hidden" id="costPriceOrg" name="costPriceOrg"/>
  259. </td>
  260. </tr>
  261. <tr>
  262. <th>반품여부<em class="required" title="필수"></em></th>
  263. <td>
  264. <label class="rdoBtn"><input type="radio" name="returnableYn" id="returnableYnY" value="Y" />Y</label>
  265. <label class="rdoBtn"><input type="radio" name="returnableYn" id="returnableYnN" value="N"/>N</label>
  266. <input type="hidden" id="returnableYnOrg" name="returnableYnOrg"/>
  267. </td>
  268. <th>교환여부<em class="required" title="필수"></em></th>
  269. <td>
  270. <label class="rdoBtn"><input type="radio" name="changeableYn" id="changeableYnY" value="Y" />Y</label>
  271. <label class="rdoBtn"><input type="radio" name="changeableYn" id="changeableYnN" value="N"/>N</label>
  272. <input type="hidden" id="changeableYnOrg" name="changeableYnOrg"/>
  273. </td>
  274. <th>신규가입구매가능여부<em class="required" title="필수"></em></th>
  275. <td>
  276. <label class="rdoBtn"><input type="radio" name="newCustOrdYn" id="newCustOrdYnY" value="Y" />Y</label>
  277. <label class="rdoBtn"><input type="radio" name="newCustOrdYn" id="newCustOrdYnN" value="N"/>N</label>
  278. <input type="hidden" id="newCustOrdYnOrg" name="newCustOrdYnOrg"/>
  279. </td>
  280. </tr>
  281. <tr>
  282. <th>배송비정책<em class="required" title="필수"></em></th>
  283. <td>
  284. <select name="delvFeeCd">
  285. </select>
  286. <input type="hidden" id="delvFeeCdOrg" name="delvFeeCdOrg"/>
  287. </td>
  288. <th>기본배송비</th>
  289. <td>
  290. <input type="text" class="w100 aR" id="delvFee" name="delvFee" disabled="disabled"/> 원
  291. </td>
  292. <th>무료배송비기준</th>
  293. <td>
  294. <input type="text" class="w100 aR" id="minOrdAmt" name="minOrdAmt" disabled="disabled"/> 원
  295. </td>
  296. </tr>
  297. <tr>
  298. <th>PC포인트<em class="required" title="필수"></em></th>
  299. <td>
  300. <input type="text" class="w50 aR" id="pntPrate" name="pntPrate" data-valid-type="numeric" maxlength="3"/> % /&nbsp;
  301. <input type="hidden" id="pntPrateOrg" name="pntPrateOrg"/>
  302. <label class="rdoBtn"><input type="radio" name="prePpntUsableYn" id="prePpntUsableYnY" value="Y"/>Y</label>
  303. <label class="rdoBtn"><input type="radio" name="prePpntUsableYn" id="prePpntUsableYnN" value="N"/>N</label>
  304. <input type="hidden" id="prePpntUsableYnOrg" name="prePpntUsableYnOrg"/>
  305. </td>
  306. <th>모바일포인트<em class="required" title="필수"></em></th>
  307. <td>
  308. <input type="text" class="w50 aR" id="pntMrate" name="pntMrate" data-valid-type="numeric" maxlength="3"/> % /&nbsp;
  309. <input type="hidden" id="pntMrateOrg" name="pntMrateOrg"/>
  310. <label class="rdoBtn"><input type="radio" name="preMpntUsableYn" id="preMpntUsableYnY" value="Y"/>Y</label>
  311. <label class="rdoBtn"><input type="radio" name="preMpntUsableYn" id="preMpntUsableYnN" value="N"/>N</label>
  312. <input type="hidden" id="preMpntUsableYnOrg" name="preMpntUsableYnOrg"/>
  313. </td>
  314. <th>성인용품여부<em class="required" title="필수"></em></th>
  315. <td>
  316. <label class="rdoBtn"><input type="radio" name="adultYn" id="adultYnY" value="Y" />Y</label>
  317. <label class="rdoBtn"><input type="radio" name="adultYn" id="adultYnN" value="N"/>N</label>
  318. <input type="hidden" id="adultYnOrg" name="adultYnOrg"/>
  319. </td>
  320. </tr>
  321. <tr>
  322. <th>최소주문수량<em class="required" title="필수"></em></th>
  323. <td>
  324. <input type="text" class="w100 aR" id="minOrdQty" name="minOrdQty" data-valid-type="integer" maxlength="5"/>
  325. <input type="hidden" id="minOrdQtyOrg" name="minOrdQtyOrg"/>
  326. </td>
  327. <th>최대주문수량<em class="required" title="필수"></em></th>
  328. <td>
  329. <input type="text" class="w100 aR" id="maxOrdQty" name="maxOrdQty" data-valid-type="integer" maxlength="5"/>
  330. <input type="hidden" id="maxOrdQtyOrg" name="maxOrdQtyOrg"/>
  331. </td>
  332. <th>ID당1일최대구매수량<em class="required" title="필수"></em></th>
  333. <td>
  334. <input type="text" class="w100 aR" id="dayMaxOrdQty" name="dayMaxOrdQty" data-valid-type="integer" maxlength="5"/>
  335. <input type="hidden" id="dayMaxOrdQtyOrg" name="dayMaxOrdQtyOrg"/>
  336. </td>
  337. </tr>
  338. <tr>
  339. <th>구매등급</th>
  340. <td colspan="5">
  341. <div id="goodsCustGradeList"></div>
  342. </td>
  343. </tr>
  344. <tr>
  345. <th>안전인증번호</th>
  346. <td colspan="5">
  347. <input type="text" class="w150" id="certNum" name="certNum" maxlength="20"/>
  348. <input type="hidden" id="certNumOrg" name="certNumOrg"/>
  349. <button type="button" class="btn btn-success btn-lg" id="btnGoodsSafetyCertNum">안전인증</button>
  350. </td>
  351. </tr>
  352. </tbody>
  353. </table>
  354. </div>
  355. <!-- //TAB1 CONTENTS AREA -->
  356. </li>
  357. <!-- //TAB1 -->
  358. <!-- TAB2 : 옵셥/재고 -->
  359. <li class="tab" id="goodstab2">
  360. <!-- TAB2 CONTENTS AREA -->
  361. <div class="panelStyle">
  362. <!-- <ul class="notice cBlue">
  363. <li><strong>상품 이미지 사이즈</strong> : <em><strong>600 × 600</strong> px</em></li>
  364. </ul> -->
  365. <div id="sizeStockArea"></div>
  366. </div>
  367. <!-- //TAB2 CONTENTS AREA -->
  368. </li>
  369. <!-- //TAB2 : 이미지/옵셥/재고 -->
  370. <!-- TAB3 : 상품상세 -->
  371. <li class="tab" id="goodstab3">
  372. <!-- TAB3 CONTENTS AREA -->
  373. <div class="panelStyle">
  374. <table class="frmStyle">
  375. <colgroup>
  376. <col width="12%"/>
  377. <col/>
  378. </colgroup>
  379. <tr>
  380. <th>상세설명</th>
  381. <td><label class="chkBox"><input type="checkbox" name="chkDescKeep" checked="checked" value="Y">정보유지<span></span></label>
  382. </td>
  383. </tr>
  384. </table>
  385. <!-- TABS SPACE -->
  386. <div class="tabsJr">
  387. <!-- TABS NAVI -->
  388. <ul class="tabsJrNav">
  389. <li class="on"><a href="#goodstab11">타이틀/내용/특징</a></li>
  390. <li><a href="#goodstab12">상세html</a></li>
  391. </ul>
  392. <!-- //TABS NAVI -->
  393. <!-- TABS CONTENT -->
  394. <ul class="tabsJrCont">
  395. <!-- TAB11 CONTENTS AREA -->
  396. <!-- TAB -->
  397. <li class="tabJr on" id="goodstab11">
  398. <div class="panelStyle">
  399. <!-- TAB11 CONTENTS AREA -->
  400. <table class="frmStyle">
  401. <colgroup>
  402. <col width="12%"/>
  403. <col/>
  404. </colgroup>
  405. <tr>
  406. <th>타이틀</th>
  407. <td><input type="text" class= "w100p" id="goodsTitlesDesc" name="goodsTitlesDesc" maxlength="100" />
  408. </td>
  409. </tr>
  410. <tr>
  411. <th>내용</th>
  412. <td><div class="tabJrContArea">
  413. <textarea class="textareaR3 summernote" name="goodsContentsDesc" id="goodsContentsDesc"></textarea>
  414. </div>
  415. </td>
  416. </tr>
  417. <tr>
  418. <th>상품 특징</th>
  419. <td><div class="tabJrContArea">
  420. <textarea class="textareaR3 summernote" name="goodsCharacterDesc" id="goodsCharacterDesc"></textarea>
  421. </div>
  422. </td>
  423. </tr>
  424. </table>
  425. </div>
  426. </li>
  427. <li class="tabJr" id="goodstab12">
  428. <div class="panelStyle">
  429. <!-- TAB11 CONTENTS AREA -->
  430. <table class="frmStyle">
  431. <colgroup>
  432. <col width="12%"/>
  433. <col/>
  434. </colgroup>
  435. <tr>
  436. <th>상품상세</th>
  437. <td><div class="tabJrContArea">
  438. <textarea class="textareaR4 summernote" name="goodsDesc" id="goodsDesc"></textarea>
  439. </div>
  440. </td>
  441. </tr>
  442. <tr>
  443. <th>상위(PC)</th>
  444. <td><div class="tabJrContArea">
  445. <textarea class="textareaR4 summernote" name="goodsPcTopDesc" id="goodsPcTopDesc"></textarea>
  446. </div>
  447. </td>
  448. </tr>
  449. <tr>
  450. <th>상위(MOBILE)</th>
  451. <td><div class="tabJrContArea">
  452. <textarea class="textareaR4 summernote" name="goodsMobileTopDesc" id="goodsMobileTopDesc"></textarea>
  453. </div>
  454. </td>
  455. </tr>
  456. <tr>
  457. <th>하위(PC)</th>
  458. <td><div class="tabJrContArea">
  459. <textarea class="textareaR4 summernote" name="goodsPcDownDesc" id="goodsPcDownDesc"></textarea>
  460. </div>
  461. </td>
  462. </tr>
  463. <tr>
  464. <th>하위(MOBILE)</th>
  465. <td><div class="tabJrContArea">
  466. <textarea class="textareaR4 summernote" name="goodsMobileDownDesc" id="goodsMobileDownDesc"></textarea>
  467. </div>
  468. </td>
  469. </tr>
  470. </table>
  471. </div>
  472. </li>
  473. <!-- //TAB -->
  474. </ul>
  475. <!-- //TAB CONTENT -->
  476. </div>
  477. <!-- //TABS SPACE -->
  478. </div>
  479. <!-- //TAB3 CONTENTS AREA -->
  480. </li>
  481. <!-- //TAB3 : 상품상세 -->
  482. <!-- TAB4 : 고시정보 -->
  483. <li class="tab" id="goodstab4">
  484. <!-- TAB5 CONTENTS AREA -->
  485. <div class="panelStyle">
  486. <!-- TABS SPACE -->
  487. <table class="frmStyle">
  488. <colgroup>
  489. <col style="width:10%"/>
  490. <col/>
  491. </colgroup>
  492. <tr>
  493. <th>Details (상품상세정보 고시)<em class="required" title="필수"></em></th>
  494. <td>
  495. <select id="selNiClsfCd" name="selNiClsfCd" class="w40p">
  496. <option value="">[선택]</option>
  497. <option th:if="${niClsfCdList}" th:each="oneData, status : ${niClsfCdList}" th:value="${oneData.cd}" th:text="${oneData.cdNm}"></option>
  498. </select>
  499. <button type="button" class="btn btn-dark btn-lg" id="btnNotinfo">선택</button>
  500. <span class="padL10" id='itemkindNoti'></span>
  501. </td>
  502. </tr>
  503. </table>
  504. <hr/>
  505. <div id="notiArea"></div>
  506. <!-- //TABS SPACE -->
  507. </div>
  508. <!-- //TAB4 CONTENTS AREA -->
  509. </li>
  510. <!-- //TAB4 : 고시정보 -->
  511. <!-- 구성상품 -->
  512. <li class="tab" id="goodstab5">
  513. <!-- TAB6 CONTENTS AREA -->
  514. <div class="panelStyle">
  515. <!-- 내용 삽입 -->
  516. <ul class="panelBar" id="GoodsComposeBtnArea">
  517. <li class="right">
  518. <button type="button" class="btn btn-default btn-lg" onclick="cfnDownloadSampleFile('SF003');">양식다운로드</button>
  519. <button type="button" class="btn btn-success btn-lg" id="btnGoodsDealSearchExcel">엑셀조회</button>
  520. <button type="button" class="btn btn-base btn-lg" onclick="fnOpenGoodsDetailPopup()">상품조회</button>
  521. </li>
  522. </ul>
  523. <div id="gridGoodsComposeList" style="height: 600px;" class="ag-theme-balham lh60"></div>
  524. <!-- 내용 삽입 -->
  525. </div>
  526. <!-- //TAB6 CONTENTS AREA -->
  527. </li>
  528. <!-- TAB5 : 이력정보 -->
  529. <li class="tab" id="goodstab6">
  530. <!-- TAB8 CONTENTS AREA -->
  531. <div class="panelStyle">
  532. <!-- 내용 삽입 -->
  533. <div id="gridGoodsHstoryList" style="height: 600px;" class="ag-theme-balham"></div>
  534. <!-- 내용 삽입 -->
  535. </div>
  536. <!-- //TAB5 CONTENTS AREA -->
  537. </li>
  538. <!-- //TAB5 : 추가정보 -->
  539. </ul>
  540. <!-- //TABS CONTENTS -->
  541. <!-- TABS BUTTON AREA -->
  542. <ul class="panelBar marT10">
  543. <li class="left">
  544. <button type="button" class="btn btnLeft btn-base btn-lg" id="btnGoodsDetailPreview">미리보기</button>
  545. <!-- <button type="button" class="btn btnLeft btn-base btn-lg" id="btnGoodsDetailImg">이미지보기</button> -->
  546. </li>
  547. <li class="right">
  548. <th:block th:if="${sessionInfo.roleCd == 'G001_0000' OR sessionInfo.roleCd == 'G001_A000' OR sessionInfo.roleCd == 'G001_A101' OR sessionInfo.roleCd == 'G001_A100' OR sessionInfo.roleCd == 'G001_A001'}">
  549. <button type="button" class="btn btnRight btn-success btn-lg" id="btnGoodsDetailSave">저장</button>
  550. </th:block>
  551. </li>
  552. </ul>
  553. <!-- //TABS BUTTON AREA -->
  554. </div>
  555. <!-- //TABS SPACE -->
  556. </div> <!-- class=panelContent -->
  557. </form>
  558. </div> <!-- class=panelStyle -->
  559. </div> <!-- class=modalPopup -->
  560. <script type="text/javascript" src="/ux/plugins/summernote/summernote.js?v=2020103001"></script>
  561. <script type="text/javascript" src="/ux/plugins/gaga/gaga.summernote.js?v=2020103001"></script>
  562. <script th:inline="javascript">
  563. /*<![CDATA[*/
  564. var sessRoleCd = [[${sessionInfo.roleCd}]];
  565. var formalGbList = gagajf.convertToArray([[${formalGbList}]]);
  566. var goodsStatList = gagajf.convertToArray([[${goodsStatList}]]);
  567. var itemkindList = gagajf.convertToArray([[${itemkindList}]]);
  568. var authBrandList = [[${authBrandList}]];
  569. var useYnList = gagajf.convertToArray([[${useYnList}]]);
  570. var goodsTypeList = gagajf.convertToArray([[${goodsTypeList}]]);
  571. // Get a SmartEditor options
  572. //var seOptions = gagaSe.getEditorOptions();
  573. // specify the columns - 상품변경이력
  574. var columnGoodsHstoryDefs = [
  575. {headerName: 'No', width: 60, cellClass: 'text-center', valueGetter: function(params) { return params.node.rowIndex + 1 }},
  576. {headerName: "변경일자", field: "regDt", width: 130, cellClass: 'text-center' ,
  577. cellRenderer: function(params) {
  578. return !gagajf.isNull(params.value) ? params.value.toDate("YYYYMMDDHHmm").format("YYYY-MM-DD HH:mm") : '';
  579. }
  580. },
  581. {headerName: "변경자", field: "regNm", width: 100, cellClass: 'text-center'},
  582. {headerName: "판매가", field: "currPrice" , width: 100, cellClass: 'text-right'
  583. ,valueFormatter: function(params) { return Number(params.value).addComma();}
  584. },
  585. {headerName: "변경전판매가", field: "currBprice" , width: 100, cellClass: 'text-right'
  586. ,valueFormatter: function(params) { return Number(params.value).addComma(); }
  587. },
  588. {headerName: "상품상태", field: "goodsStat" , width: 100, cellClass: 'text-center',
  589. cellEditorParams: { values: gagaAgGrid.extractValues(goodsStatList) },
  590. valueFormatter: function (params) { return gagaAgGrid.lookupValue(goodsStatList, params.value); },
  591. valueParser: function (params) { return gagaAgGrid.lookupKey(goodsStatList, params.newValue); }
  592. },
  593. {headerName: "상품명", field: "goodsNm" , width: 180, cellClass: 'text-left'},
  594. {headerName: "상품타이틀", field: "goodsTnm" , width: 180, cellClass: 'text-left'},
  595. /* {headerName: "상품검색어", field: "goodsSnm" , width: 180, cellClass: 'text-left'}, */
  596. {headerName: "정상이월구분", field: "formalGb" , width: 100, cellClass: 'text-center',
  597. cellEditorParams: { values: gagaAgGrid.extractValues(formalGbList) },
  598. valueFormatter: function (params) { return gagaAgGrid.lookupValue(formalGbList, params.value); },
  599. valueParser: function (params) { return gagaAgGrid.lookupKey(formalGbList, params.newValue); }
  600. },
  601. {headerName: "품목", field: "itemkindCd" , width: 180, cellClass: 'text-left',
  602. cellEditorParams: { values: gagaAgGrid.extractValues(itemkindList) },
  603. valueFormatter: function (params) { return gagaAgGrid.lookupValue(itemkindList, params.value); },
  604. valueParser: function (params) { return gagaAgGrid.lookupKey(itemkindList, params.newValue); }
  605. },
  606. {headerName: "최초승인일자", field: "frstCfrmDt", width: 150, cellClass: 'text-center' ,
  607. cellRenderer: function(params) {
  608. return !gagajf.isNull(params.value) ? params.value.toDate("YYYYMMDDHHmmss").format("YYYY-MM-DD HH:mm:ss") : '';
  609. }
  610. },
  611. {headerName: "재고연동여부", field: "erpStockLinkYn" , width: 100, cellClass: 'text-center'},
  612. {headerName: "자사몰노출여부", field: "selfMallYn" , width: 120, cellClass: 'text-center'},
  613. {headerName: "선물주문여부", field: "giftPackYn" , width: 120, cellClass: 'text-center'},
  614. {headerName: "판매수수료율", field: "sellFeeRate" , width: 120, cellClass: 'text-right'},
  615. {headerName: "사용자검색어", field: "goodsSnm1" , width: 150, cellClass: 'text-left'},
  616. {headerName: "검색어", field: "goodsSnm" , width: 450, cellClass: 'text-left', tooltipField: "goodsSnm"}
  617. ];
  618. // specify the columns - 구성상품
  619. var columnGoodsComposeDefs = [
  620. {headerName: "정렬", field: "dispOrd", width: 70 ,hide: false, cellClass: 'text-center', rowDrag: true },
  621. {headerName: "CRUD", field: "crud", width: 75, minWidth: 75, hide: true},
  622. //{headerName: 'No', width: 60, cellClass: 'text-center', valueGetter: function(params) { return params.node.rowIndex + 1 }},
  623. {headerName: "이미지", field: "sysImgNm", width: 100, height: 60, cellClass: 'text-center'
  624. ,cellRenderer: function(params) {
  625. return '<img width="60" src="'+ _goodsUrl+ "/" + params.value + '" alt="" onclick="cfnOpenImagePreViewPopup(\'goodsImgView\', \''+ _goodsUrl+ "/" + params.value +'\')" onerror="this.src=\'/image/no.gif\';"/>';
  626. }
  627. },
  628. {headerName: "상품타입", field: "goodsType" , width: 100, cellClass: 'text-center',
  629. cellEditorParams: { values: gagaAgGrid.extractValues(goodsTypeList) },
  630. valueFormatter: function (params) { return gagaAgGrid.lookupValue(goodsTypeList, params.value); },
  631. valueParser: function (params) { return gagaAgGrid.lookupKey(goodsTypeList, params.newValue); }
  632. },
  633. {headerName: "구성상품코드", field: "compsGoodsCd" , width: 130, cellClass: 'text-center'},
  634. {headerName: "구성상품코드명", field: "compsGoodsNm" , width: 200, cellClass: 'text-left'},
  635. //{headerName: "순서", field: "dispOrd" , width: 80, cellClass: 'text-right',editable: true, required: true},
  636. {headerName: "수량", field: "qty" , width: 80, cellClass: 'text-right'
  637. ,valueFormatter: function(params) { return Number(params.value).addComma();}
  638. },
  639. {headerName: "판매가", field: "currPrice" , width: 100, cellClass: 'text-right'
  640. ,valueFormatter: function(params) { return Number(params.value).addComma();}
  641. },
  642. {headerName: "상품판매가", field: "compsCurrPrice" , width: 100, cellClass: 'text-right'
  643. ,valueFormatter: function(params) { return Number(params.value).addComma();}, editable: true, required: true,
  644. cellEditor: 'textCellEditor',
  645. cellEditorParams: { maxlength: 14, validType: 'numeric'}
  646. },
  647. {headerName: "상품판매가ORG", field: "compsCurrPriceOrg" , width: 100, cellClass: 'text-right', hide: true},
  648. {headerName: "기준여부(품목-카테고리)", field: "baseYn", width: 160, cellClass: 'text-center'
  649. },
  650. {headerName: "대표여부(가격)", field: "repYn", width: 160, cellClass: 'text-center',editable: true,
  651. cellEditor: 'agRichSelectCellEditor',
  652. cellEditorParams: { values: gagaAgGrid.extractValues(useYnList), required: true },
  653. valueFormatter: function (params) { return gagaAgGrid.lookupValue(useYnList, params.value); },
  654. valueParser: function (params) { return gagaAgGrid.lookupKey(useYnList, params.newValue); }
  655. },
  656. {headerName: "대표상품", field: "repGoodsCd" , width: 100, cellClass: 'text-right', hide: true},
  657. {headerName: "전시여부", field: "useYn", width: 100, cellClass: 'text-center',editable: true,
  658. cellEditor: 'agRichSelectCellEditor',
  659. cellEditorParams: { values: gagaAgGrid.extractValues(useYnList), required: true },
  660. valueFormatter: function (params) { return gagaAgGrid.lookupValue(useYnList, params.value); },
  661. valueParser: function (params) { return gagaAgGrid.lookupKey(useYnList, params.newValue); }
  662. },
  663. {headerName: "옵션명(딜상품용)", field: "compsGoodsOptNm" , width: 200, cellClass: 'text-left',editable: true, required: true},
  664. {headerName: "상품상태", field: "goodsStat" , width: 100, cellClass: 'text-center',
  665. cellEditorParams: { values: gagaAgGrid.extractValues(goodsStatList) },
  666. valueFormatter: function (params) { return gagaAgGrid.lookupValue(goodsStatList, params.value); },
  667. valueParser: function (params) { return gagaAgGrid.lookupKey(goodsStatList, params.newValue); }
  668. },
  669. {headerName: "등록일시", field: "regDt", width: 140, cellClass: 'text-center' ,
  670. cellRenderer: function(params) {
  671. return !gagajf.isNull(params.value) ? params.value.toDate("YYYYMMDDHHmmss").format("YYYY-MM-DD HH:mm:ss") : '';
  672. }
  673. },
  674. {headerName: "등록자", field: "regNm", width: 100, cellClass: 'text-center'},
  675. {headerName: "수정일시", field: "updDt", width: 140, cellClass: 'text-center' ,
  676. cellRenderer: function(params) {
  677. return !gagajf.isNull(params.value) ? params.value.toDate("YYYYMMDDHHmmss").format("YYYY-MM-DD HH:mm:ss") : '';
  678. }
  679. },
  680. {headerName: "수정자", field: "updNm", width: 100, cellClass: 'text-center'}
  681. ];
  682. // Get GridOptions
  683. var gridGoodsHstoryOptions = gagaAgGrid.getGridOptions(columnGoodsHstoryDefs);
  684. gridGoodsHstoryOptions.enableBrowserTooltips = true;
  685. var gridGoodsComposeOptions = gagaAgGrid.getGridOptions(columnGoodsComposeDefs);
  686. gridGoodsComposeOptions.enableBrowserTooltips = true;
  687. // 드래그
  688. gridGoodsComposeOptions.suppressRowClickSelection = true;
  689. gridGoodsComposeOptions.rowDragManaged = true;
  690. gridGoodsComposeOptions.stopEditingWhenGridLosesFocus = true;
  691. //gridGoodsComposeOptions.rowDeselection = true;
  692. //gridGoodsComposeOptions.enableMultiRowDragging = true;
  693. //gridGoodsComposeOptions.rowSelection = 'multiple';
  694. gridGoodsComposeOptions.rowHeight = 60; //이미지가 있을경우 높이 지정해야함.
  695. //기준여부 표시
  696. gridGoodsComposeOptions.getRowStyle = function(params) {
  697. if ("Y" == params.data.baseYn) {
  698. return { background: '#1ab394' };
  699. }else{
  700. return { background: '#ffffff' };
  701. }
  702. }
  703. // Row
  704. gridGoodsComposeOptions.onCellValueChanged = function(event) {
  705. var rowIdx = null;
  706. var isChangColor = true;
  707. if (event.colDef.field == "baseYn"){
  708. if (event.data.baseYn == "Y"){
  709. rowIdx = event.rowIndex;
  710. //다른 기준여부 'Y'가 존재하는지 확인
  711. gridGoodsComposeOptions.api.forEachNode(function(rowNode, index) {
  712. if (rowNode.data.baseYn == "Y" && index != rowIdx){
  713. event.data.baseYn = event.oldValue;
  714. gridGoodsComposeOptions.api.updateRowData({update: [event.data]});
  715. isChangColor = false;
  716. return;
  717. }
  718. });
  719. if (!isChangColor){
  720. mcxDialog.alert('다른 구성상품에 기준여부가 선택되어 있습니다.');
  721. return;
  722. }
  723. }
  724. }
  725. if ($("#goodsDetailForm input[name=goodsType]").val() == "G056_D"){
  726. isChangColor = true;
  727. if (event.colDef.field == "repYn"){
  728. if (event.data.repYn == "Y"){
  729. rowIdx = event.rowIndex;
  730. //다른 대표여부 'Y'가 존재하는지 확인
  731. gridGoodsComposeOptions.api.forEachNode(function(rowNode, index) {
  732. if (rowNode.data.repYn == "Y" && index != rowIdx){
  733. event.data.repYn = event.oldValue;
  734. gridGoodsComposeOptions.api.updateRowData({update: [event.data]});
  735. isChangColor = false;
  736. return;
  737. }
  738. });
  739. if (!isChangColor){
  740. mcxDialog.alert('다른 구성상품에 대표여부가 선택되어 있습니다.');
  741. return;
  742. }
  743. }
  744. }
  745. }
  746. }
  747. // 상품상세 조회
  748. var fnGoodsDeailSearch = function() {
  749. $('#goodsDetailForm').find('.tabs .tabsNav li a').attr("style", "color:#888;"); //탭색 초기화
  750. var params = new Object();
  751. params.mode = $('#goodsDetailForm input[name=mode]').val();
  752. params.goodsCd = $('#goodsDetailForm input[name=goodsCd]').val();
  753. cfnAjaxSubmit("/goods/detail", "json", fnGoodDetailSearchCallback, params);
  754. }
  755. var fnGoodDetailSearchCallback = function(result) {
  756. $('#goodsDetailForm').find(".tabsNav > li").removeClass('on');
  757. $('#goodsDetailForm').find(".tabsNav > li").eq(0).addClass('on');
  758. $('#goodsDetailForm').find(".tabsCont > li").removeClass('on');
  759. $('#goodsDetailForm').find(".tabsCont > li").eq(0).addClass('on');
  760. if (result != null){
  761. //기본정보
  762. $('#goodsDetailForm select[name=selSupplyCompCd]').val(result.supplyCompCd);
  763. $('#goodsDetailForm input[name=supplyCompCd]').val(result.supplyCompCd);
  764. $('#goodsDetailForm input[name=brandCd]').val(result.brandCd);
  765. fnBrand(result.supplyCompCd, result.brandCd);
  766. $('#goodsDetailForm').find('#goodsCdTxt').html(result.goodsCd);
  767. $('#goodsDetailForm').find('#supplyGoodsCdTxt').html(result.supplyGoodsCd);
  768. $("#goodsDetailForm input[name=goodsImageYn]").val(result.goodsImageYn);
  769. $("#goodsDetailForm input[name=niClsfCd]").val(result.niClsfCd);
  770. $("#goodsDetailForm select[name=selNiClsfCd]").val(result.niClsfCd);
  771. $("#goodsDetailForm input[name=selfGoodsYn]").val(result.selfGoodsYn);
  772. $('#goodsDetailForm').find('#goodsNumTxt').html(result.goodsNum);
  773. $('#goodsDetailForm input[name=goodsNum]').val(result.goodsNum);
  774. $('#goodsDetailForm select[name=goodsStat]').val(result.goodsStat);
  775. $("#goodsDetailForm input[name=goodsStatOrg]").val(result.goodsStat);
  776. $('#goodsDetailForm').find('#brandGrpNmTxt').html(result.brandGrpNm);
  777. $('#goodsDetailForm select[name=itemkindCd]').val(result.itemkindCd);
  778. $('#goodsDetailForm input[name=orgItemkindCd]').val(result.itemkindCd);
  779. $('#goodsDetailForm select[name=seasonCd]').val(result.seasonCd);
  780. $('#goodsDetailForm input[name=seasonCdOrg]').val(result.seasonCd);
  781. $('#goodsDetailForm select[name=sexGb]').val(result.sexGb);
  782. $('#goodsDetailForm input[name=sexGbOrg]').val(result.sexGb);
  783. $('#goodsDetailForm').find('#makeNmTxt').html(result.makeNm);
  784. $('#goodsDetailForm').find('#styleYearTxt').html(result.styleYear);
  785. $('#goodsDetailForm select[name=goodsGb]').val(result.goodsGb);
  786. $('#goodsDetailForm input[name=goodsGbOrg]').val(result.goodsGb);
  787. $('#goodsDetailForm input[name=mainColorCd]').val(result.mainColorCd);
  788. $("#goodsDetailForm input[name=goodsNm]").val(result.goodsNm);
  789. $('#goodsDetailForm input[name=goodsNmOrg]').val(result.goodsNm);
  790. fnDataLengthCheck('goodsNm',200);
  791. $("#goodsDetailForm input[name=goodsTnm]").val(result.goodsTnm);
  792. $('#goodsDetailForm input[name=goodsTnmOrg]').val(result.goodsTnm);
  793. fnDataLengthCheck('goodsTnm',100);
  794. $("#goodsDetailForm input[name=goodsSnm1]").val(result.goodsSnm1);
  795. $("#goodsDetailForm input[name=goodsSnm1Org]").val(result.goodsSnm1);
  796. fnDataLengthCheck('goodsSnm1',200);
  797. $("#goodsDetailForm textarea[name=goodsSnmTxt]").val(result.goodsSnm);
  798. $("#goodsDetailForm input[name=goodsSnm]").val(result.goodsSnm);
  799. $('#goodsDetailForm').find('#listPriceTxt').html(result.listPrice.addComma());
  800. $('#goodsDetailForm input[name=listPrice]').val(result.listPrice);
  801. $('#goodsDetailForm input[name=currPrice]').val(result.currPrice.addComma());
  802. $('#goodsDetailForm input[name=currPriceOrg]').val(result.currPrice);
  803. $('#goodsDetailForm').find('#dcRateTxt').html(result.dcRate);
  804. $('#goodsDetailForm input[name=dcRate]').val(result.dcRate);
  805. $('#goodsDetailForm input[name=costPrice]').val(result.costPrice.addComma());
  806. $('#goodsDetailForm input[name=costPriceOrg]').val(result.costPrice);
  807. $('#goodsDetailForm').find('#priceUpdDtTxt').html(!gagajf.isNull(result.priceUpdDt) ? result.priceUpdDt.toDate("YYYYMMDDHHmmss").format("YYYY-MM-DD") : '');
  808. $('#goodsDetailForm').find('#frstCfrmDtTxt').html(!gagajf.isNull(result.frstCfrmDt) ? result.frstCfrmDt.toDate("YYYYMMDDHHmmss").format("YYYY-MM-DD") : '');
  809. $('#goodsDetailForm select[name=distributionGb]').val(result.distributionGb);
  810. $("#goodsDetailForm input[name=distributionGbOrg]").val(result.distributionGb);
  811. $('#goodsDetailForm select[name=ageGrpCd]').val(result.ageGrpCd);
  812. $("#goodsDetailForm input[name=ageGrpCdOrg]").val(result.ageGrpCd);
  813. $('#goodsDetailForm select[name=taxGb]').val(result.taxGb);
  814. $("#goodsDetailForm input[type=radio]").parent().removeClass("checked");
  815. $("#goodsDetailForm input[type=radio]").removeAttr('checked');
  816. if (result.formalGb == "G009_20"){
  817. $("#goodsDetailForm input:radio[name=formalGb]:input[value='G009_20']").trigger('click');
  818. }else{
  819. $("#goodsDetailForm input:radio[name=formalGb]:input[value='G009_10']").trigger('click');
  820. }
  821. if (result.erpPriceLinkYn == "Y"){
  822. $("#goodsDetailForm input:radio[name=erpPriceLinkYn]:input[value='Y']").trigger('click');
  823. }else{
  824. $("#goodsDetailForm input:radio[name=erpPriceLinkYn]:input[value='N']").trigger('click');
  825. }
  826. if (result.selfMallYn == "Y"){
  827. $("#goodsDetailForm input:radio[name=selfMallYn]:input[value='Y']").trigger('click');
  828. }else{
  829. $("#goodsDetailForm input:radio[name=selfMallYn]:input[value='N']").trigger('click');
  830. }
  831. if (result.giftPackYn == "Y"){
  832. $("#goodsDetailForm input:radio[name=giftPackYn]:input[value='Y']").trigger('click');
  833. }else{
  834. $("#goodsDetailForm input:radio[name=giftPackYn]:input[value='N']").trigger('click');
  835. }
  836. if (result.returnableYn == "Y"){
  837. $("#goodsDetailForm input:radio[name=returnableYn]:input[value='Y']").trigger('click');
  838. }else{
  839. $("#goodsDetailForm input:radio[name=returnableYn]:input[value='N']").trigger('click');
  840. }
  841. if (result.changeableYn == "Y"){
  842. $("#goodsDetailForm input:radio[name=changeableYn]:input[value='Y']").trigger('click');
  843. }else{
  844. $("#goodsDetailForm input:radio[name=changeableYn]:input[value='N']").trigger('click');
  845. }
  846. if (result.newCustOrdYn == "Y"){
  847. $("#goodsDetailForm input:radio[name=newCustOrdYn]:input[value='Y']").trigger('click');
  848. }else{
  849. $("#goodsDetailForm input:radio[name=newCustOrdYn]:input[value='N']").trigger('click');
  850. }
  851. if (result.adultYn == "Y"){
  852. $("#goodsDetailForm input:radio[name=adultYn]:input[value='Y']").trigger('click');
  853. }else{
  854. $("#goodsDetailForm input:radio[name=adultYn]:input[value='N']").trigger('click');
  855. }
  856. $('#goodsDetailForm input[name=sellFeeRate]').val(result.sellFeeRate);
  857. $("#goodsDetailForm input[name=sellFeeRateOrg]").val(result.sellFeeRate);
  858. if (result.prePpntUsableYn == "Y"){
  859. $("#goodsDetailForm input:radio[name=prePpntUsableYn]:input[value='Y']").trigger('click');
  860. }else{
  861. $("#goodsDetailForm input:radio[name=prePpntUsableYn]:input[value='N']").trigger('click');
  862. }
  863. if (result.preMpntUsableYn == "Y"){
  864. $("#goodsDetailForm input:radio[name=preMpntUsableYn]:input[value='Y']").trigger('click');
  865. }else{
  866. $("#goodsDetailForm input:radio[name=preMpntUsableYn]:input[value='N']").trigger('click');
  867. }
  868. if (result.changeableYn == "Y"){
  869. $("#goodsDetailForm input:radio[name=changeableYn]:input[value='Y']").trigger('click');
  870. }else{
  871. $("#goodsDetailForm input:radio[name=changeableYn]:input[value='N']").trigger('click');
  872. }
  873. $("#goodsDetailForm input[name=formalGbOrg]").val(result.formalGb);
  874. $("#goodsDetailForm input[name=erpPriceLinkYnOrg]").val(result.erpPriceLinkYn);
  875. $("#goodsDetailForm input[name=selfMallYnOrg]").val(result.selfMallYn);
  876. $("#goodsDetailForm input[name=giftPackYnOrg]").val(result.giftPackYn);
  877. $("#goodsDetailForm input[name=prePpntUsableYnOrg]").val(result.prePpntUsableYn);
  878. $("#goodsDetailForm input[name=preMpntUsableYnOrg]").val(result.preMpntUsableYn);
  879. $("#goodsDetailForm input[name=changeableYnOrg]").val(result.changeableYn);
  880. $("#goodsDetailForm input[name=returnableYnOrg]").val(result.returnableYn);
  881. $("#goodsDetailForm input[name=newCustOrdYnOrg]").val(result.newCustOrdYn);
  882. $("#goodsDetailForm input[name=adultYnOrg]").val(result.adultYn);
  883. $("#goodsDetailForm input[type=radio][checked]").addClass("checked");
  884. //$("#goodsDetailForm input[type=radio][checked]").parent("label").addClass("checked");
  885. //입점상품일 경우
  886. if (result.selfGoodsYn == "N"){
  887. //$('#goodsDetailForm').find('#erplinkarea').hide();
  888. $("#goodsDetailForm").find("#selfGoodsDpTitle").html('원코드');
  889. $("#goodsDetailForm").find("#selfGoodsDpTxt").html('<div id="supplyGoodsCdTxt"></div>');
  890. $('#goodsDetailForm').find('#supplyGoodsCdTxt').html(result.supplyGoodsCd);
  891. $('#goodsDetailForm select[name=distributionGb]').attr('readonly', true);
  892. }
  893. $('#goodsDetailForm input[name=delvFee]').val(result.delvFee.addComma());
  894. $('#goodsDetailForm input[name=pntPrate]').val(result.pntPrate);
  895. $('#goodsDetailForm input[name=pntPrateOrg]').val(result.pntPrate);
  896. $('#goodsDetailForm input[name=pntMrate]').val(result.pntMrate);
  897. $('#goodsDetailForm input[name=pntMrateOrg]').val(result.pntMrate);
  898. $('#goodsDetailForm input[name=minOrdAmt]').val(result.minOrdAmt.addComma());
  899. $('#goodsDetailForm input[name=minOrdQty]').val(result.minOrdQty);
  900. $('#goodsDetailForm input[name=minOrdQtyOrg]').val(result.minOrdQty);
  901. $('#goodsDetailForm input[name=maxOrdQty]').val(result.maxOrdQty);
  902. $('#goodsDetailForm input[name=maxOrdQtyOrg]').val(result.maxOrdQty);
  903. $('#goodsDetailForm input[name=dayMaxOrdQty]').val(result.dayMaxOrdQty);
  904. $('#goodsDetailForm input[name=dayMaxOrdQtyOrg]').val(result.dayMaxOrdQty);
  905. $('#goodsDetailForm input[name=goodsType]').val(result.goodsType);
  906. $("#goodsDetailForm").find("#goodsTypeNm").html(result.goodsTypeNm);
  907. cfnCreateCombo('/renderer/delvFee/list/' + result.supplyCompCd, $('#goodsDetailForm select[name=delvFeeCd]'), "[선택]", result.delvFeeCd);
  908. $('#goodsDetailForm input[name=delvFeeCdOrg]').val(result.delvFeeCd);
  909. $('#goodsDetailForm input[name=certNum]').val(result.certNum);
  910. $('#goodsDetailForm input[name=certNumOrg]').val(result.certNum);
  911. //상품상세
  912. $('#goodsDetailForm input[name=goodsTitlesDesc]').val(result.goodsTitlesDesc);
  913. // Summernote에 값 세팅
  914. gagaSn.setContents('#goodsContentsDesc', result.goodsContentsDesc);
  915. gagaSn.setContents('#goodsCharacterDesc', result.goodsCharacterDesc);
  916. gagaSn.setContents('#goodsPcTopDesc', result.goodsPcTopDesc);
  917. gagaSn.setContents('#goodsMobileTopDesc', result.goodsMobileTopDesc);
  918. gagaSn.setContents('#goodsPcDownDesc', result.goodsPcDownDesc);
  919. gagaSn.setContents('#goodsMobileDownDesc', result.goodsMobileDownDesc);
  920. gagaSn.setContents('#goodsDesc', result.goodsDesc);
  921. if (!gagajf.isNull(result.niClsfNm)){
  922. $('#goodsDetailForm').find('#itemkindNoti').html('품목기준 고시분류 : ' + result.niClsfNm);
  923. $('#goodsDetailForm input[name=niClsfNm]').val(result.niClsfNm);
  924. var objNotiInfo = $("#goodsDetailForm select[name=selNiClsfCd] option");
  925. for(var i=0;i<objNotiInfo.length; i++ ){
  926. if (objNotiInfo.eq(i).text() == result.niClsfNm){
  927. objNotiInfo.eq(i).prop("selected","true");
  928. }
  929. }
  930. }
  931. $('#goodsDetailForm').find('#goodsImgUrl').attr('src', _goodsUrl + '/'+ result.sysImgNm);
  932. $('#goodsDetailForm input[name=sysImgNm]').val(result.sysImgNm);
  933. $("#goodsDetailForm input[type=checkbox][checked]").parent("label").addClass("checked");
  934. //품목변경 권한 관련 처리
  935. //md권한
  936. if(sessRoleCd == "G001_A101" || sessRoleCd == "G001_B000"){
  937. var roleFlag = "N";
  938. $.each(authBrandList, function(idx, item) {
  939. if (result.brandCd == item.cd ){
  940. roleFlag = "Y";
  941. return false;
  942. }
  943. });
  944. if (roleFlag == "N"){
  945. $('#goodsDetailForm select[name=itemkindCd]').attr('disabled',true);
  946. $('#goodsDetailForm #btnGoodsItemkindChange').addClass('off');
  947. }
  948. }
  949. //상품 구분에 따른 컬럼 사용여부처리 start
  950. //세트
  951. if ("G056_S" == result.goodsType){
  952. //$('#goodsDetailForm #erplinkarea').addClass('off');
  953. if (result.selfGoodsYn == "Y") $('#goodsDetailForm #goodsComposeTab').css('display','block');
  954. $('#goodsDetailForm #goodsNotiTab').css('display','none');
  955. $('#goodsDetailForm input[name=sellFeeRate]').attr('readonly', true);
  956. $('#goodsDetailForm input[name=currPrice]').attr('readonly', true);
  957. }else if ("G056_D" == result.goodsType){
  958. //$('#goodsDetailForm #erplinkarea').addClass('off');
  959. if (result.selfGoodsYn == "Y") $('#goodsDetailForm #goodsComposeTab').css('display','block');
  960. $('#goodsDetailForm #goodsNotiTab').css('display','none');
  961. $('#goodsDetailForm input[name=sellFeeRate]').attr('readonly', true);
  962. }
  963. //상품 구분에 따른 컬럼 사용여부처리 end
  964. var params = new Object();
  965. params.mode = $('#goodsDetailForm input[name=mode]').val();
  966. params.goodsCd = result.goodsCd;
  967. params.brandCd = result.brandCd;
  968. params.supplyCompCd = result.supplyCompCd;
  969. params.niClsfCd = result.niClsfCd;
  970. params.goodsType = result.goodsType;
  971. params.erpPriceLinkYn = result.erpPriceLinkYn;
  972. //옵셥 재고(ajax html)
  973. fnGoodsDetailSizeStockSearch(params);
  974. //정보고시
  975. fnGoodsDetailNotiInfoSearch(params);
  976. //구매등급
  977. fnGoodsDetailOrderGradeSearch(params);
  978. //구성상품
  979. if ("G056_S" == result.goodsType || "G056_D" == result.goodsType){
  980. fnGoodsComposeListSearch(params);
  981. }
  982. //이력
  983. fnGoodsDetailHstSearch();
  984. }
  985. //기본정보탭 변경여부
  986. $('#goodsDetailForm').find('#goodstab1').find("input, select, textarea").on('change', function() {
  987. $('#goodsDetailForm').find('.tabs .tabsNav li:eq(0) a').attr("style", "color:red;");
  988. });
  989. }
  990. //옵셥 재고
  991. var fnGoodsDetailSizeStockSearch = function(params) {
  992. cfnAjaxSubmit("/goods/detail/sizeStock/form", "html", "sizeStockArea", params);
  993. }
  994. //정보고시
  995. var fnGoodsDetailNotiInfoSearch = function(params) {
  996. cfnAjaxSubmit("/goods/detail/notiInfo/list", "json", fnGoodsDetailNotiInfoSearchCallback, params);
  997. }
  998. //구매등급
  999. var fnGoodsDetailOrderGradeSearch = function(params) {
  1000. cfnAjaxSubmit("/goods/detail/order/grade/list", "json", fnGoodsDetailOrderGradeSearchCallback, params);
  1001. }
  1002. //구성상품
  1003. var fnGoodsComposeListSearch = function(params) {
  1004. if ("G056_S" == params.goodsType){ //세트
  1005. gagaAgGrid.showOrHideColumn(gridGoodsComposeOptions, 'currPrice', false);
  1006. gagaAgGrid.showOrHideColumn(gridGoodsComposeOptions, 'useYn', false);
  1007. gagaAgGrid.showOrHideColumn(gridGoodsComposeOptions, 'compsGoodsOptNm', false);
  1008. gagaAgGrid.showOrHideColumn(gridGoodsComposeOptions, 'repYn', false);
  1009. $('#GoodsComposeBtnArea').addClass("off");
  1010. }else{ //딜
  1011. gagaAgGrid.showOrHideColumn(gridGoodsComposeOptions, 'qty', false);
  1012. gagaAgGrid.showOrHideColumn(gridGoodsComposeOptions, 'compsCurrPrice', false);
  1013. gagaAgGrid.showOrHideColumn(gridGoodsComposeOptions, 'compsCurrPriceOrg', false);
  1014. }
  1015. gagaAgGrid.fetch("/goods/detail/compose/list?goodsCd=" + params.goodsCd , gridGoodsComposeOptions);
  1016. }
  1017. //이력
  1018. var fnGoodsDetailHstSearch = function() {
  1019. gagaAgGrid.fetch("/goods/detail/hst/list?goodsCd=" + $('#goodsDetailForm input[name=goodsCd]').val() , gridGoodsHstoryOptions);
  1020. }
  1021. //정보고시 콜백
  1022. var fnGoodsDetailNotiInfoSearchCallback = function(result) {
  1023. if (result == null) return;
  1024. var notiHtml = "";
  1025. var idx = 0;
  1026. $('#goodsDetailForm').find('#notiArea').html('');
  1027. notiHtml += '<table class="frmStyle">';
  1028. notiHtml += '<colgroup><col style="width:20%"/><col/></colgroup>';
  1029. notiHtml += '<tbody id="infoContents">\n';
  1030. notiHtml += '<tr><th>고시항목</th><th>고시내용</th></tr>';
  1031. result.forEach(function(info){
  1032. notiHtml += '<tr><th>'+ gagajf.convNull(info.niItemNm, '') +'<input type="hidden" name="niItemCd" value="'+ gagajf.convNull(info.niItemCd, '') +'" />\n<input type="hidden" name="dispOrd" value="'+ gagajf.convNull(info.dispOrd, '') +'" /></th>';
  1033. notiHtml += '<td><input type="text" name="niContent" value="'+ gagajf.convNull(info.niContent, '') +'"/></td>\n';
  1034. notiHtml += '</tr>\n';
  1035. });
  1036. notiHtml += '</tbody></table>';
  1037. $('#goodsDetailForm').find('#notiArea').append(notiHtml);
  1038. //고시정보탭 변경여부
  1039. $('#goodsDetailForm').find('#goodstab4').find("input, select, textarea").on('change', function() {
  1040. $('#goodsDetailForm').find('.tabs .tabsNav li:eq(3) a').attr("style", "color:red;");
  1041. });
  1042. }
  1043. //구매등급 콜백
  1044. var fnGoodsDetailOrderGradeSearchCallback = function(result) {
  1045. if (result == null) return;
  1046. result.forEach(function(info){
  1047. $("#goodsDetailForm #goodsCustGradeList").find("input").each(function() {
  1048. if (info.custGrade == $(this).val() ){
  1049. $(this).prop("checked", true);
  1050. $(this).parent("label").addClass("checked");
  1051. }
  1052. });
  1053. });
  1054. }
  1055. //상품명 길이표시
  1056. $("#goodsDetailForm input[name=goodsNm]").bind('focus focusout input keyup keydown paste change', function () {
  1057. fnDataLengthCheck('goodsNm',200);
  1058. });
  1059. //상품타이틀 길이표시
  1060. $("#goodsDetailForm input[name=goodsTnm]").bind('focus focusout input keyup keydown paste change', function () {
  1061. fnDataLengthCheck('goodsTnm',100);
  1062. });
  1063. //사용자검색어 길이표시
  1064. $("#goodsDetailForm input[name=goodsSnm1]").bind('focus focusout input keyup keydown paste change', function () {
  1065. fnDataLengthCheck('goodsSnm1',200);
  1066. });
  1067. //판매가 변경시 할인율 계산
  1068. $("#goodsDetailForm input[name=currPrice]").bind('focusout paste', function () {
  1069. fnCurrPriceCheck();
  1070. });
  1071. //판매가의 할인율 확인
  1072. var fnCurrPriceCheck = function(){
  1073. var dcRate = 0;
  1074. var listPrice = $("#goodsDetailForm input[name=listPrice]").val().removeComma();
  1075. var currPrice = $("#goodsDetailForm input[name=currPrice]").val().removeComma();
  1076. dcRate = 100 - Math.floor(Number(currPrice) / Number(listPrice) * 100); //절사
  1077. $("#goodsDetailForm").find("#dcRateTxt").html(dcRate);
  1078. $("#goodsDetailForm input[name=dcRate]").val(dcRate);
  1079. }
  1080. //판매가의 할인율 확인
  1081. /* var fnCurrPriceCheck_org = function(){
  1082. var dcRate = 0;
  1083. var listPrice = $("#goodsDetailForm input[name=listPrice]").val().removeComma();
  1084. var currPrice = $("#goodsDetailForm input[name=currPrice]").val().removeComma();
  1085. //dcRate = Math.round(100 - Math.floor((Number(currPrice) / Number(listPrice) * 100)*100)/100);
  1086. //dcRate = 100 - (Number((Number(currPrice) / Number(listPrice)).toFixed(2)) *100);
  1087. dcRate = 100 - Math.floor(Number(currPrice) / Number(listPrice) * 100);
  1088. if (dcRate < 0){
  1089. mcxDialog.alert('할인율이 0보다 작습니다.\n판매가를 확인해주세요.', function(){
  1090. $("#goodsDetailForm input[name=currPrice]").focus();
  1091. });
  1092. return false;
  1093. }else if (dcRate >= 90){
  1094. gagaAlert.confirm("할인율이 90%이상입니다. 계속하시겠습니까?", function(){
  1095. $("#goodsDetailForm").find("#dcRateTxt").html(dcRate);
  1096. $("#goodsDetailForm input[name=dcRate]").val(dcRate);
  1097. return true;
  1098. },
  1099. function(){
  1100. $('#goodsDetailForm input[name=currPrice]').val($('#goodsDetailForm input[name=currPriceOrg]').val().addComma());
  1101. return false;
  1102. });
  1103. }else{
  1104. $("#goodsDetailForm").find("#dcRateTxt").html(dcRate);
  1105. $("#goodsDetailForm input[name=dcRate]").val(dcRate);
  1106. return true;
  1107. }
  1108. } */
  1109. // 브랜드 조회
  1110. var fnBrand = function(supplyCompCd, brandCd) {
  1111. var actionUrl = '/renderer/supplyCompany/brand/list/' + supplyCompCd;
  1112. if(sessRoleCd == "G001_B000"){
  1113. actionUrl = '/renderer/brand/AuthBrandlist';
  1114. }
  1115. $("#goodsDetailForm select[name=selBrandCd] option:gt(0)").remove();
  1116. cfnCreateCombo(actionUrl, $('#goodsDetailForm select[name=selBrandCd]'), "[선택]", brandCd);
  1117. }
  1118. //데이터 길이 확인
  1119. var fnDataLengthCheck = function(id , maxByte){
  1120. var maximumByte = maxByte;
  1121. var strLenEng = $('#goodsDetailForm').find('#'+id).val().length;
  1122. var cbyteStr = 0;
  1123. var liLenStr = 0;
  1124. for (i = 0; i < strLenEng; i++) {
  1125. var lsOneChar = $('#goodsDetailForm').find('#'+id).val().charAt(i);
  1126. if (lsOneChar == "\n" || lsOneChar == "\'") {
  1127. cbyteStr += 5; //엔터면 5를 더한다
  1128. } else if (lsOneChar == "\"") {
  1129. cbyteStr += 6; //쌍따옴표면 6를 더한다
  1130. } else if (escape(lsOneChar).length > 4) {
  1131. cbyteStr += 3; //한글이면 3를 더한다
  1132. } else {
  1133. cbyteStr++; //한글아니면 1을 다한다
  1134. }
  1135. if (cbyteStr <= maximumByte) {
  1136. liLenStr = i + 1;
  1137. }
  1138. }
  1139. // 사용자가 입력한 값이 제한 값을 초과하는지를 검사한다.
  1140. if (parseInt(cbyteStr) > parseInt(maximumByte)) {
  1141. mcxDialog.alertC('허용된 글자수가 초과되었습니다.\n초과된 부분은 자동으로 삭제됩니다.', {
  1142. sureBtnText: "확인",
  1143. sureBtnClick: function() {
  1144. $('#goodsDetailForm').find('#'+id).focus();
  1145. }
  1146. });
  1147. var str = $('#goodsDetailForm').find('#'+id).val().substr(0, liLenStr);
  1148. $('#goodsDetailForm').find('#'+id).val(str);
  1149. var cbyteStr = 0;
  1150. for (i = 0; i < $('#goodsDetailForm').find('#'+id).val().length; i++) {
  1151. var lsOneChar = $('#goodsDetailForm').find('#'+id).val().charAt(i);
  1152. if (lsOneChar == "\n" || lsOneChar == "\'") {
  1153. cbyteStr += 5; //엔터면 5를 더한다
  1154. } else if (lsOneChar == "\"") {
  1155. cbyteStr += 6; //쌍따옴표면 6를 더한다
  1156. } else if (escape(lsOneChar).length > 4) {
  1157. cbyteStr += 3; //한글이면 3를 더한다
  1158. } else {
  1159. cbyteStr++; //한글아니면 1을 다한다
  1160. }
  1161. }
  1162. }
  1163. $('#goodsDetailForm').find('#'+id+'Len').text(cbyteStr);
  1164. }
  1165. //상품저장 버튼 클릭 시
  1166. $('#btnGoodsDetailSave').click(function() {
  1167. var optCheck = false;
  1168. var idx = 0;
  1169. //상품상태가 승인대기나 승인 완료일 경우
  1170. if($("#goodsDetailForm select[name=goodsStat]").val() == "G008_40" || $("#goodsDetailForm select[name=goodsStat]").val() == "G008_90"){
  1171. // SUPER관리자, 어드민관리자, 계정관리자. 총괄관리자, MD 를 제외하고 승인처리 할수 없음
  1172. if ("G001_0000" != sessRoleCd && "G001_A000" != sessRoleCd && "G001_A001" != sessRoleCd && "G001_A100" != sessRoleCd && "G001_A101" != sessRoleCd ){
  1173. if ($("#goodsDetailForm select[name=goodsStat]").val() == "G008_90" && $("#goodsDetailForm input[name=goodsStatOrg]").val() != "G008_90"){
  1174. mcxDialog.alert(" '승인완료' 상태로 변경할 권한이 없습니다.");
  1175. return false;
  1176. }
  1177. }
  1178. //list가 등록되지 않은 상품은 상태변경 불가
  1179. if(Number($("#goodsDetailForm input[name=listPrice]").val()) == 0){
  1180. mcxDialog.alertC("TAG가 등록되지 않은 상품은 '승인대기'나 '승인완료' 상태로 변경할 수 없습니다.", {
  1181. sureBtnText: "확인",
  1182. sureBtnClick: function() {
  1183. $("#goodsDetailForm select[name=goodsStat]").focus();
  1184. }
  1185. });
  1186. return false;
  1187. }
  1188. //판매가가 0인 상품은 상태변경 불가
  1189. if((gagajf.isNull($("#goodsDetailForm input[name=currPrice]").val()) || $("#goodsDetailForm input[name=currPrice]").val() == 0)){
  1190. mcxDialog.alertC("판매가가 등록되지 않은 상품은 '승인대기'나 '승인완료' 상태로 변경할 수 없습니다.", {
  1191. sureBtnText: "확인",
  1192. sureBtnClick: function() {
  1193. $("#goodsDetailForm select[name=goodsStat]").focus();
  1194. }
  1195. });
  1196. return;
  1197. }
  1198. //사이즈정보가 등록되지 않은 상품은 상태변경 불가
  1199. if($("#goodsDetailForm #sizeStockArea").find("#optionList tr").length == 0){
  1200. mcxDialog.alertC("사이즈정보가 등록되지 않은 상품은 '승인대기'나 '승인완료' 상태로 변경할 수 없습니다.", {
  1201. sureBtnText: "확인",
  1202. sureBtnClick: function() {
  1203. $("#goodsDetailForm select[name=goodsStat]").focus();
  1204. }
  1205. });
  1206. return;
  1207. }
  1208. //이미지가 등록되지 않은 상품은 상태변경 불가
  1209. if($("#goodsDetailForm input[name=goodsImageYn]").val() == "N"){
  1210. mcxDialog.alertC("이미지가 등록되지 않은 상품은 '승인대기'나 '승인완료' 상태로 변경할 수 없습니다.", {
  1211. sureBtnText: "확인",
  1212. sureBtnClick: function() {
  1213. $("#goodsDetailForm select[name=goodsStat]").focus();
  1214. }
  1215. });
  1216. return;
  1217. }
  1218. //고시정보가 등록되지 않은 상품은 상태변경 불가 - 일반상품만 체크
  1219. if ("G056_N" == $("#goodsDetailForm input[name=goodsType]").val()){
  1220. if($("#goodsDetailForm #notiArea").find("#infoContents tr").length == 0){
  1221. mcxDialog.alertC("고시정보가 등록되지 않은 상품은 '승인대기'나 '승인완료' 상태로 변경할 수 없습니다.", {
  1222. sureBtnText: "확인",
  1223. sureBtnClick: function() {
  1224. $("#goodsDetailForm select[name=goodsStat]").focus();
  1225. }
  1226. });
  1227. return;
  1228. }
  1229. idx = 0;
  1230. $("#goodsDetailForm #notiArea").find("#infoContents tr").each(function() {
  1231. if (gagajf.isNull($(this).find("input[name=niContent]").val())){
  1232. optCheck = true;
  1233. mcxDialog.alertC("고시정보를 입력해주세요.");
  1234. return false;
  1235. }
  1236. idx++;
  1237. });
  1238. }
  1239. // 자사일 경우 대표색상 선택 여부
  1240. if ("Y" == $('#goodsDetailForm input[name=selfGoodsYn]').val()){
  1241. if($("#goodsDetailForm input[name=basicColor]:checked").length == 0) {
  1242. mcxDialog.alert("대표색상을 선택해주세요.")
  1243. return false;
  1244. }
  1245. }
  1246. }
  1247. if(optCheck) {
  1248. return false;
  1249. }
  1250. //상품명
  1251. if(gagajf.isNull($("#goodsDetailForm input[name=goodsNm]").val())){
  1252. mcxDialog.alertC("상품명을 입력해 주세요.", {
  1253. sureBtnText: "확인",
  1254. sureBtnClick: function() {
  1255. $("#goodsDetailForm input[name=goodsNm]").focus();
  1256. }
  1257. });
  1258. return;
  1259. }
  1260. //상품상태
  1261. if(gagajf.isNull($("#goodsDetailForm select[name=goodsStat]").val())){
  1262. mcxDialog.alertC("상품상태를 선택해 주세요.", {
  1263. sureBtnText: "확인",
  1264. sureBtnClick: function() {
  1265. $("#goodsDetailForm select[name=goodsStat]").focus();
  1266. }
  1267. });
  1268. return;
  1269. }
  1270. //성별
  1271. if(gagajf.isNull($("#goodsDetailForm select[name=sexGb]").val())){
  1272. mcxDialog.alertC("성별을 선택해 주세요.", {
  1273. sureBtnText: "확인",
  1274. sureBtnClick: function() {
  1275. $("#goodsDetailForm select[name=sexGb]").focus();
  1276. }
  1277. });
  1278. return;
  1279. }
  1280. // 상품구분
  1281. if(gagajf.isNull($("#goodsDetailForm select[name=goodsGb]").val())){
  1282. mcxDialog.alertC("상품구분을 선택해 주세요.", {
  1283. sureBtnText: "확인",
  1284. sureBtnClick: function() {
  1285. $("#goodsDetailForm select[name=goodsGb]").focus();
  1286. }
  1287. });
  1288. return;
  1289. }
  1290. //시즌
  1291. if(gagajf.isNull($("#goodsDetailForm select[name=seasonCd]").val())){
  1292. mcxDialog.alertC("시즌을 선택해 주세요.", {
  1293. sureBtnText: "확인",
  1294. sureBtnClick: function() {
  1295. $("#goodsDetailForm select[name=seasonCd]").focus();
  1296. }
  1297. });
  1298. return;
  1299. }
  1300. //판매가
  1301. if(gagajf.isNull($("#goodsDetailForm input[name=currPrice]").val())) {
  1302. mcxDialog.alertC("판매가를 올바르게 입력해주세요.", {
  1303. sureBtnText: "확인",
  1304. sureBtnClick: function() {
  1305. $("#goodsDetailForm input[name=currPrice]").focus();
  1306. }
  1307. });
  1308. return false;
  1309. }
  1310. /* if(Number($("#goodsDetailForm input[name=currPrice]").val().removeComma()) < 1000) {
  1311. mcxDialog.alertC("판매가는 1000원 이상을 입력하셔야 합니다.", {
  1312. sureBtnText: "확인",
  1313. sureBtnClick: function() {
  1314. $("#goodsDetailForm input[name=currPrice]").focus();
  1315. }
  1316. });
  1317. } */
  1318. //정상가와 판매가 비교
  1319. if ($("#goodsDetailForm input[name=goodsType]").val() != "G056_D"){
  1320. if(Number($("#goodsDetailForm input[name=listPrice]").val().removeComma()) < Number($("#goodsDetailForm input[name=currPrice]").val().removeComma())) {
  1321. mcxDialog.alertC("판매가를 올바르게 입력해주세요.", {
  1322. sureBtnText: "확인",
  1323. sureBtnClick: function() {
  1324. $("#goodsDetailForm input[name=currPrice]").focus();
  1325. }
  1326. });
  1327. return false;
  1328. }
  1329. }
  1330. //판매 수수료율
  1331. if ( gagajf.isNull($("#goodsDetailForm input[name=sellFeeRate]").val())) {
  1332. mcxDialog.alertC("판매수수료를 입력해 주세요.", {
  1333. sureBtnText: "확인",
  1334. sureBtnClick: function() {
  1335. $("#goodsDetailForm input[name=sellFeeRate]").focus();
  1336. }
  1337. });
  1338. return false;
  1339. }
  1340. if(Number($("#goodsDetailForm input[name=sellFeeRate]").val()) < 0 || Number($("#goodsDetailForm input[name=sellFeeRate]").val()) > 100) {
  1341. mcxDialog.alertC("판매수수료를 올바르게 입력해주세요.", {
  1342. sureBtnText: "확인",
  1343. sureBtnClick: function() {
  1344. $("#goodsDetailForm input[name=sellFeeRate]").focus();
  1345. }
  1346. });
  1347. return false;
  1348. }
  1349. // 배송비구분
  1350. if(gagajf.isNull($("#goodsDetailForm select[name=delvFeeCd]").val())){
  1351. mcxDialog.alertC("배송비정책을 선택해 주세요.", {
  1352. sureBtnText: "확인",
  1353. sureBtnClick: function() {
  1354. $("#goodsDetailForm select[name=delvFeeCd]").focus();
  1355. }
  1356. });
  1357. return;
  1358. }
  1359. // 포인트
  1360. if ( gagajf.isNull($("#goodsDetailForm input[name=pntPrate]").val())) {
  1361. mcxDialog.alertC("PC 포인트를 입력해 주세요.", {
  1362. sureBtnText: "확인",
  1363. sureBtnClick: function() {
  1364. $("#goodsDetailForm input[name=pntPrate]").focus();
  1365. }
  1366. });
  1367. return false;
  1368. }
  1369. if(Number($("#goodsDetailForm input[name=pntPrate]").val()) < 0 || Number($("#goodsDetailForm input[name=pntPrate]").val()) > 100) {
  1370. mcxDialog.alertC("PC 포인트를 올바르게 입력해주세요.", {
  1371. sureBtnText: "확인",
  1372. sureBtnClick: function() {
  1373. $("#goodsDetailForm input[name=pntPrate]").focus();
  1374. }
  1375. });
  1376. return false;
  1377. }
  1378. if ( gagajf.isNull($("#goodsDetailForm input[name=pntMrate]").val())) {
  1379. mcxDialog.alertC("MOBILE 포인트를 입력해 주세요.", {
  1380. sureBtnText: "확인",
  1381. sureBtnClick: function() {
  1382. $("#goodsDetailForm input[name=pntMrate]").focus();
  1383. }
  1384. });
  1385. return false;
  1386. }
  1387. if(Number($("#goodsDetailForm input[name=pntMrate]").val()) < 0 || Number($("#goodsDetailForm input[name=pntMrate]").val()) > 100) {
  1388. mcxDialog.alertC("MOBILE 포인트를 올바르게 입력해주세요.", {
  1389. sureBtnText: "확인",
  1390. sureBtnClick: function() {
  1391. $("#goodsDetailForm input[name=pntMrate]").focus();
  1392. }
  1393. });
  1394. return false;
  1395. }
  1396. // 주문수량
  1397. if ( gagajf.isNull($("#goodsDetailForm input[name=minOrdQty]").val())) {
  1398. mcxDialog.alertC("최소주문 수량을 입력해 주세요.", {
  1399. sureBtnText: "확인",
  1400. sureBtnClick: function() {
  1401. $("#goodsDetailForm input[name=minOrdQty]").focus();
  1402. }
  1403. });
  1404. return false;
  1405. }
  1406. if (Number($("#goodsDetailForm input[name=minOrdQty]").val()) <= 0) {
  1407. mcxDialog.alertC("최소주문 수량을 입력해 주세요.", {
  1408. sureBtnText: "확인",
  1409. sureBtnClick: function() {
  1410. $("#goodsDetailForm input[name=minOrdQty]").focus();
  1411. }
  1412. });
  1413. return false;
  1414. }
  1415. if ( gagajf.isNull($("#goodsDetailForm input[name=maxOrdQty]").val())) {
  1416. mcxDialog.alertC("최대주문 수량을 입력해 주세요.", {
  1417. sureBtnText: "확인",
  1418. sureBtnClick: function() {
  1419. $("#goodsDetailForm input[name=maxOrdQty]").focus();
  1420. }
  1421. });
  1422. return false;
  1423. }
  1424. if (Number($("#goodsDetailForm input[name=maxOrdQty]").val()) <= 0) {
  1425. mcxDialog.alertC("최대주문 수량을 입력해 주세요.", {
  1426. sureBtnText: "확인",
  1427. sureBtnClick: function() {
  1428. $("#goodsDetailForm input[name=maxOrdQty]").focus();
  1429. }
  1430. });
  1431. return false;
  1432. }
  1433. if ( gagajf.isNull($("#goodsDetailForm input[name=dayMaxOrdQty]").val())) {
  1434. mcxDialog.alertC("ID당1일최대구매 수량을 입력해 주세요.", {
  1435. sureBtnText: "확인",
  1436. sureBtnClick: function() {
  1437. $("#goodsDetailForm input[name=dayMaxOrdQty]").focus();
  1438. }
  1439. });
  1440. return false;
  1441. }
  1442. if (Number($("#goodsDetailForm input[name=dayMaxOrdQty]").val()) <= 0) {
  1443. mcxDialog.alertC("ID당1일최대구매 수량을 입력해 주세요.", {
  1444. sureBtnText: "확인",
  1445. sureBtnClick: function() {
  1446. $("#goodsDetailForm input[name=dayMaxOrdQty]").focus();
  1447. }
  1448. });
  1449. return false;
  1450. }
  1451. if(Number($("#goodsDetailForm input[name=minOrdQty]").val()) > Number($("#goodsDetailForm input[name=maxOrdQty]").val())){
  1452. mcxDialog.alertC("최소주문수량은 최대주문수량보다 클 수 없습니다.", {
  1453. sureBtnText: "확인",
  1454. sureBtnClick: function() {
  1455. $("#goodsDetailForm input[name=minOrdQty]").focus();
  1456. }
  1457. });
  1458. return false;
  1459. }
  1460. if(Number($("#goodsDetailForm input[name=maxOrdQty]").val()) > Number($("#goodsDetailForm input[name=dayMaxOrdQty]").val())){
  1461. mcxDialog.alertC("최대주문수량이 ID당1일최대구매수량보다 클 수 없습니다.", {
  1462. sureBtnText: "확인",
  1463. sureBtnClick: function() {
  1464. $("#goodsDetailForm input[name=maxOrdQty]").focus();
  1465. }
  1466. });
  1467. return false;
  1468. }
  1469. idx = 0;
  1470. //재고 옵션 관련 확인
  1471. $("#goodsDetailForm input[name=chStockDataYn]").val('N');
  1472. $("#optionList tr").each(function() {
  1473. var optCd1 = $(this).find("input[name=optCd1]").val();
  1474. var optCd2 = $(this).find("input[name=optCd2]").val();
  1475. //var hidOptCd1 = $(this).find("input[name=hidOptCd1]").val();
  1476. //var hidOptCd2 = $(this).find("input[name=hidOptCd2]").val();
  1477. var baseStockQty = $(this).find("input[name=baseStockQty]").val();
  1478. var hidBaseStockQty = $(this).find("input[name=hidBaseStockQty]").val();
  1479. var dispOrd = $(this).find("input[name=dispOrd]").val();
  1480. var hidDispOrd = $(this).find("input[name=hidDispOrd]").val();
  1481. var dispYn = $(this).find("select[name=dispYn]").val();
  1482. var hidDispYn = $(this).find("input[name=hidDispYn]").val();
  1483. var soldoutYn = $(this).find("select[name=soldoutYn]").val();
  1484. var hidSoldoutYn = $(this).find("input[name=hidSoldoutYn]").val();
  1485. var addPrice = $(this).find("input[name=addPrice]").val();
  1486. var hidAddPrice = $(this).find("input[name=hidAddPrice]").val();
  1487. var editCurrStockQty = $(this).find("input[name=editCurrStockQty]").val(); // 입점 확인용
  1488. var currStockQty = $(this).find("input[name=currStockQty]").val(); // 입점 확인용 (hidden)
  1489. if(gagajf.isNull(dispOrd)){
  1490. optCheck = true;
  1491. mcxDialog.alertC("우선순위를 입력해주세요", {
  1492. sureBtnText: "확인",
  1493. sureBtnClick: function() {
  1494. $("#optionList tr").find("input[name=dispOrd]").eq(idx).focus();
  1495. }
  1496. });
  1497. return false;
  1498. }
  1499. //ERP재고연동여부가 'Y'일 경우 수정여부 확인
  1500. /* if ( $('#goodsDetailForm input[name=erpStockLinkYn]:checked').val() == "Y"){
  1501. if (Number(editCurrStockQty) != Number(currStockQty) ){
  1502. optCheck = true;
  1503. mcxDialog.alertC("ERP가용재고가 변경되었습니다.<br/>확인해주세요", {
  1504. sureBtnText: "확인",
  1505. sureBtnClick: function() {
  1506. $("#optionList tr").find("input[name=erpStockLinkYn]").eq(idx).focus();
  1507. }
  1508. });
  1509. return false;
  1510. }
  1511. } */
  1512. // 입점만 체크
  1513. if ("N" == $('#goodsDetailForm input[name=selfGoodsYn]').val()){
  1514. if(gagajf.isNull(editCurrStockQty)){
  1515. optCheck = true;
  1516. mcxDialog.alertC("가용재고를 입력해주세요", {
  1517. sureBtnText: "확인",
  1518. sureBtnClick: function() {
  1519. $("#optionList tr").find("input[name=editCurrStockQty]").eq(idx).focus();
  1520. }
  1521. });
  1522. return false;
  1523. }
  1524. }
  1525. if(gagajf.isNull(addPrice)){
  1526. optCheck = true;
  1527. mcxDialog.alertC("추가가격을 입력해주세요", {
  1528. sureBtnText: "확인",
  1529. sureBtnClick: function() {
  1530. $("#optionList tr").find("input[name=addPrice]").eq(idx).focus();
  1531. }
  1532. });
  1533. return false;
  1534. }
  1535. if(gagajf.isNull(dispOrd)){
  1536. optCheck = true;
  1537. mcxDialog.alertC("노출순서를 입력해주세요", {
  1538. sureBtnText: "확인",
  1539. sureBtnClick: function() {
  1540. $("#optionList tr").find("input[name=dispOrd]").eq(idx).focus();
  1541. }
  1542. });
  1543. return false;
  1544. }
  1545. if(gagajf.isNull(baseStockQty)){
  1546. optCheck = true;
  1547. mcxDialog.alertC("안전재고를 입력해주세요", {
  1548. sureBtnText: "확인",
  1549. sureBtnClick: function() {
  1550. $("#optionList tr").find("input[name=baseStockQty]").eq(idx).focus();
  1551. }
  1552. });
  1553. return false;
  1554. }
  1555. if (editCurrStockQty != currStockQty){
  1556. $("#goodsDetailForm input[name=chStockDataYn]").val('Y');
  1557. }
  1558. if (baseStockQty != hidBaseStockQty){
  1559. $("#goodsDetailForm input[name=chStockDataYn]").val('Y');
  1560. }
  1561. if (dispOrd != hidDispOrd){
  1562. $("#goodsDetailForm input[name=chStockDataYn]").val('Y');
  1563. }
  1564. if (dispYn != hidDispYn){
  1565. $("#goodsDetailForm input[name=chStockDataYn]").val('Y');
  1566. }
  1567. if (soldoutYn != hidSoldoutYn){
  1568. $("#goodsDetailForm input[name=chStockDataYn]").val('Y');
  1569. }
  1570. if (addPrice != hidAddPrice){
  1571. $("#goodsDetailForm input[name=chStockDataYn]").val('Y');
  1572. }
  1573. idx++;
  1574. });
  1575. if(optCheck) {
  1576. return false;
  1577. }
  1578. var basicColor = $("#goodsDetailForm input[name=basicColor]:checked").val();
  1579. var dcRate = 0;
  1580. var listPrice = $("#goodsDetailForm input[name=listPrice]").val().removeComma();
  1581. var currPrice = $("#goodsDetailForm input[name=currPrice]").val().removeComma();
  1582. dcRate = 100 - Math.floor(Number(currPrice) / Number(listPrice) * 100); //절사
  1583. if (dcRate < 0 && ($("#goodsDetailForm input[name=goodsType]").val() != "G056_D")){
  1584. mcxDialog.alertC('할인율이 0보다 작습니다.\n판매가를 확인해주세요.', {
  1585. sureBtnText: "확인",
  1586. sureBtnClick: function() {
  1587. $("#goodsDetailForm input[name=currPrice]").focus();
  1588. }
  1589. });
  1590. return false;
  1591. }else if (dcRate >= 90 && ($("#goodsDetailForm input[name=goodsType]").val() != "G056_D")){
  1592. mcxDialog.confirmC("할인율이 90%이상입니다. 계속하시겠습니까?", {
  1593. btn: ["아니요","예"],
  1594. btnClick: function(index){
  1595. if (index == 1){
  1596. optCheck = true;
  1597. } else {
  1598. if (!fnGoodsComposeCheck()) return false;
  1599. fnSaveCheck();
  1600. }
  1601. }
  1602. });
  1603. }else{
  1604. $("#goodsDetailForm").find("#dcRateTxt").html(dcRate);
  1605. $("#goodsDetailForm input[name=dcRate]").val(dcRate);
  1606. if (!fnGoodsComposeCheck()) return false;
  1607. fnSaveCheck();
  1608. }
  1609. if (optCheck) return false;
  1610. });
  1611. //저장 관련 체크
  1612. var fnSaveCheck = function(idx){
  1613. if($("#goodsDetailForm input:checkbox[name=chkDescKeep]").is(':checked')){
  1614. mcxDialog.confirmC("'정보유지' 체크박스가 선택되어 있어 '상품상세설명' 항목이 저장되지 않습니다.<br/>저장을 원하시면 체크를 해제하세요. 계속하시겠습니까?", {
  1615. btn: ["아니요","예"],
  1616. btnClick: function(index){
  1617. if (index == 1){
  1618. optCheck = true;
  1619. } else {
  1620. fnGoodsSave();
  1621. }
  1622. }
  1623. });
  1624. }else{
  1625. fnGoodsSave();
  1626. }
  1627. }
  1628. // 구성 정보 관련 체크
  1629. var fnGoodsComposeCheck = function(){
  1630. if ($("#goodsDetailForm input[name=goodsType]").val() == "G056_N"){
  1631. return true;
  1632. }
  1633. var allData = gagaAgGrid.getAllRowData(gridGoodsComposeOptions);
  1634. var comSupplyCompCd = '';
  1635. var comSelfGoodsYn = '';
  1636. var index = 0;
  1637. //기준여부 Y 존재하는지 확인
  1638. var checkBaseYn = false;
  1639. //대표여부 Y 존재하는지 확인
  1640. var checkRepYn = false;
  1641. optCheck = false;
  1642. $.each(allData, function(index, item) {
  1643. if (index == 0){
  1644. comSelfGoodsYn = item.selfGoodsYn;
  1645. comSupplyCompCd = item.supplyCompCd;
  1646. $("#goodsDetailForm input[name=repGoodsCd]").val(item.repGoodsCd); // 대표상품
  1647. }
  1648. if (item.baseYn == "Y"){
  1649. checkBaseYn = true;
  1650. }
  1651. if (item.repYn == "Y"){
  1652. checkRepYn = true;
  1653. }
  1654. if (comSelfGoodsYn != item.selfGoodsYn){
  1655. optCheck = true;
  1656. mcxDialog.alertC("구성상품중 자사/입점상품 구분값이 다릅니다.<br/>확인해 주세요", {
  1657. sureBtnText: "확인",
  1658. sureBtnClick: function() {
  1659. gridGoodsComposeOptions.api.setFocusedCell(index, "goodsCd", null);
  1660. }
  1661. });
  1662. return false;
  1663. /*
  1664. }else{
  1665. if (comSelfGoodsYn == "N" && (comSupplyCompCd != item.supplyCompCd)){
  1666. optCheck = true;
  1667. mcxDialog.alertC("구성상품중 입점은 같은 업체 상품만 가능합니다.<br/>확인해 주세요", {
  1668. sureBtnText: "확인",
  1669. sureBtnClick: function() {
  1670. gridGoodsComposeOptions.api.setFocusedCell(index, "goodsCd", null);
  1671. }
  1672. });
  1673. return false;
  1674. }
  1675. */
  1676. }
  1677. // 세트 가격 체크
  1678. if ($("#goodsDetailForm input[name=goodsType]").val() == "G056_S"){
  1679. if (item.compsCurrPrice <= 0){
  1680. optCheck = true;
  1681. mcxDialog.alertC("구성상품 판매가를 확인해 주세요", {
  1682. sureBtnText: "확인",
  1683. sureBtnClick: function() {
  1684. gridGoodsComposeOptions.api.setFocusedCell(index, "compsCurrPrice", null);
  1685. }
  1686. });
  1687. return false;
  1688. }
  1689. }
  1690. index++;
  1691. });
  1692. if(optCheck) {
  1693. return false;
  1694. }
  1695. if (!checkBaseYn){
  1696. mcxDialog.alert('구성상품중 기준여부를 선택해 주세요.');
  1697. return false;
  1698. }
  1699. if (!checkRepYn && $("#goodsDetailForm input[name=goodsType]").val() == "G056_D"){
  1700. mcxDialog.alert('구성상품중 대표여부를 선택해 주세요.');
  1701. return false;
  1702. }
  1703. return true;
  1704. }
  1705. //저장처리
  1706. var fnGoodsSave = function(){
  1707. mcxDialog.confirm('저장하시겠습니까?', {
  1708. cancelBtnText: "취소",
  1709. sureBtnText: "확인",
  1710. sureBtnClick: function(){
  1711. fnGoodsDeailNotiSave();
  1712. if (fnChangeCheck()){
  1713. $("#goodsDetailForm input[name=chDataYn]").val('Y');
  1714. }else{
  1715. $("#goodsDetailForm input[name=chDataYn]").val('N');
  1716. }
  1717. $("#goodsDetailForm input[name=mainColorCd]").val($("#goodsDetailForm input[name=basicColor]:checked").val());
  1718. //구성상품
  1719. var allData = gagaAgGrid.getAllRowData(gridGoodsComposeOptions);
  1720. var jsonData = JSON.stringify(allData);
  1721. $('#goodsDetailForm input[name=goodsComposeList]').val(jsonData);
  1722. $('#goodsDetailForm input[name=goodsNm]').val($('#goodsDetailForm input[name=goodsNm]').val().trim().replace(/\n|\r/g, "<br/>").replace(/\"/gi, "&quot;").replace(/\'/gi, "&#39;"));
  1723. $('#goodsDetailForm input[name=goodsTnm]').val($('#goodsDetailForm input[name=goodsTnm]').val().trim().replace(/\n|\r/g, "<br/>").replace(/\"/gi, "&quot;").replace(/\'/gi, "&#39;"));
  1724. $('#goodsDetailForm input[name=goodsSnm1]').val($('#goodsDetailForm input[name=goodsSnm1]').val().trim().replace(/\n|\r/g, "<br/>").replace(/\"/gi, "&quot;").replace(/\'/gi, "&#39;"));
  1725. gagajf.ajaxFormSubmit("/goods/detail/save", "#goodsDetailForm", fnGoodsSaveCallBack);
  1726. }
  1727. });
  1728. }
  1729. //미리보기 클릭 시
  1730. $('#btnGoodsDetailPreview').click(function(e) {
  1731. cfnOpenFrontGoodsPopup($('#goodsDetailForm input[name=goodsCd]').val(), $('#goodsDetailForm input[name=siteCd]').val());
  1732. });
  1733. //이미지 클릭 시
  1734. $('#btnGoodsDetailImg').click(function(e) {
  1735. cfnOpenGoodsImagePopup($('#goodsDetailForm input[name=goodsCd]').val());
  1736. });
  1737. //창종료
  1738. var fnGoodsDetailClose = function(){
  1739. uifnPopupClose('popupGoodsDetail');
  1740. }
  1741. //저장후 callback
  1742. var fnGoodsSaveCallBack = function(){
  1743. var goodsCd = $('#goodsDetailForm input[name=goodsCd]').val();
  1744. fnGoodsDetailClose();
  1745. cfnOpenGoodsDetailPopup('U', goodsCd);
  1746. }
  1747. //고시정보 저장을 위한 데이터 처리
  1748. var fnGoodsDeailNotiSave = function(){
  1749. var goodsCd = $('#goodsDetailForm input[name=goodsCd]').val();
  1750. var goodsInfoList = [];
  1751. var index = 0;
  1752. $("#goodsDetailForm").find("#infoContents tr").each(function() {
  1753. if (index > 0){
  1754. var goodsInfo = {goodsCd: goodsCd
  1755. , niClsfCd : $('#goodsDetailForm input[name=niClsfCd]').val()
  1756. , niItemCd : $(this).find("input[name=niItemCd]").val()
  1757. , niContent : $(this).find("input[name=niContent]").val()
  1758. , dispOrd : $(this).find("input[name=dispOrd]").val()
  1759. };
  1760. goodsInfoList.push(goodsInfo);
  1761. }
  1762. index++;
  1763. });
  1764. $("#goodsDetailForm input[name=notiList]").val(JSON.stringify(goodsInfoList));
  1765. }
  1766. //상품기본정보 변경여부 확인
  1767. var fnChangeCheck = function(){
  1768. //상품타이틀
  1769. if ($("#goodsDetailForm input[name=goodsTnmOrg]").val() != $("#goodsDetailForm input[name=goodsTnm]").val()){
  1770. return true;
  1771. }
  1772. //사용자검색어
  1773. if ($("#goodsDetailForm input[name=goodsSnm1Org]").val() != $("#goodsDetailForm input[name=goodsSnm1]").val()){
  1774. return true;
  1775. }
  1776. //상품명
  1777. if ($("#goodsDetailForm input[name=goodsNmOrg]").val() != $("#goodsDetailForm input[name=goodsNm]").val()){
  1778. return true;
  1779. }
  1780. //상품정상이월구분
  1781. if ($("#goodsDetailForm input[name=formalGbOrg]").val() != $("input:radio[name=formalGb]:checked").val()){
  1782. return true;
  1783. }
  1784. //상품구분
  1785. if ($("#goodsDetailForm input[name=goodsGbOrg]").val() != $("#goodsDetailForm select[name=goodsGb]").val()){
  1786. return true;
  1787. }
  1788. //상품상태
  1789. if ($("#goodsDetailForm input[name=goodsStatOrg]").val() != $("#goodsDetailForm select[name=goodsStat]").val()){
  1790. return true;
  1791. }
  1792. //시즌
  1793. if ($("#goodsDetailForm input[name=seasonCdOrg]").val() != $("#goodsDetailForm select[name=seasonCd]").val()){
  1794. return true;
  1795. }
  1796. //성별
  1797. if ($("#goodsDetailForm input[name=sexGbOrg]").val() != $("#goodsDetailForm select[name=sexGb]").val()){
  1798. return true;
  1799. }
  1800. //판매가
  1801. if ($("#goodsDetailForm input[name=currPriceOrg]").val() != $("#goodsDetailForm input[name=currPrice]").val().removeComma()){
  1802. return true;
  1803. }
  1804. //원가
  1805. if ($("#goodsDetailForm input[name=costPriceOrg]").val() != $("#goodsDetailForm input[name=costPrice]").val().removeComma()){
  1806. return true;
  1807. }
  1808. //자사 일반상품만
  1809. if($("#goodsDetailForm input[name=selfGoodsYn]").val() == 'Y' && $("#goodsDetailForm input[name=goodType]").val() == 'G056_N'){
  1810. //ERP재고연동여부
  1811. if ($("#goodsDetailForm input[name=erpStockLinkYnOrg]").val() != $("#goodsDetailForm input[name=erpStockLinkYn]:checked").val()){
  1812. return true;
  1813. }
  1814. }
  1815. //자사몰 노출여부
  1816. if ($("#goodsDetailForm input[name=selfMallYnOrg]").val() != $("input[name=selfMallYn]:checked").val()){
  1817. return true;
  1818. }
  1819. //선물주문여부
  1820. if ($("#goodsDetailForm input[name=giftPackYnOrg]").val() != $("input[name=giftPackYn]:checked").val()){
  1821. return true;
  1822. }
  1823. //PC포인트
  1824. if ($("#goodsDetailForm input[name=pntPrateOrg]").val() != $("#goodsDetailForm input[name=pntPrate]").val()){
  1825. return true;
  1826. }
  1827. //PC 선포인트 사용여부
  1828. if ($("#goodsDetailForm input[name=prePpntUsableYnOrg]").val() != $("input[name=prePpntUsableYn]:checked").val()){
  1829. return true;
  1830. }
  1831. //MOBILE포인트
  1832. if ($("#goodsDetailForm input[name=pntMrateOrg]").val() != $("#goodsDetailForm input[name=pntMrate]").val()){
  1833. return true;
  1834. }
  1835. //MOBILE 선포인트 사용여부
  1836. if ($("#goodsDetailForm input[name=preMpntUsableYnOrg]").val() != $("input[name=preMpntUsableYn]:checked").val()){
  1837. return true;
  1838. }
  1839. //최소주문수량
  1840. if ($("#goodsDetailForm input[name=minOrdQtyOrg]").val() != $("#goodsDetailForm input[name=minOrdQty]").val()){
  1841. return true;
  1842. }
  1843. //최대주문수량
  1844. if ($("#goodsDetailForm input[name=maxOrdQtyOrg]").val() != $("#goodsDetailForm input[name=maxOrdQty]").val()){
  1845. return true;
  1846. }
  1847. //ID당1일최대구매수량
  1848. if ($("#goodsDetailForm input[name=dayMaxOrdQtyOrg]").val() != $("#goodsDetailForm input[name=dayMaxOrdQty]").val()){
  1849. return true;
  1850. }
  1851. //유통구분
  1852. if ($("#goodsDetailForm input[name=distributionGbOrg]").val() != $("#goodsDetailForm select[name=distributionGb]").val()){
  1853. return true;
  1854. }
  1855. //상품연령대
  1856. if ($("#goodsDetailForm input[name=ageGrpCdOrg]").val() != $("#goodsDetailForm select[name=ageGrpCd]").val()){
  1857. return true;
  1858. }
  1859. // 판매수수료율
  1860. if ($("#goodsDetailForm input[name=sellFeeRateOrg]").val() != $("#goodsDetailForm input[name=sellFeeRate]").val()){
  1861. return true;
  1862. }
  1863. // 메인 색상코드
  1864. if ($("#goodsDetailForm input[name=mainColorCd]").val() != $("#goodsDetailForm input[name=basicColor]:checked").val()){
  1865. return true;
  1866. }
  1867. // 반품가능여부
  1868. if ($("#goodsDetailForm input[name=returnableYnOrg]").val() != $("input[name=returnableYn]:checked").val()){
  1869. return true;
  1870. }
  1871. // 배송비정책
  1872. if ($("#goodsDetailForm input[name=delvFeeCdOrg]").val() != $("#goodsDetailForm select[name=delvFeeCd]").val()){
  1873. return true;
  1874. }
  1875. // 교환가능여부
  1876. if ($("#goodsDetailForm input[name=changeableYnOrg]").val() != $("input[name=changeableYn]:checked").val()){
  1877. return true;
  1878. }
  1879. // 신규가입구매가능여부
  1880. if ($("#goodsDetailForm input[name=newCustOrdYnOrg]").val() != $("input[name=newCustOrdYn]:checked").val()){
  1881. return true;
  1882. }
  1883. // 성인용품여부
  1884. if ($("#goodsDetailForm input[name=adultYnOrg]").val() != $("input[name=adultYn]:checked").val()){
  1885. return true;
  1886. }
  1887. return false;
  1888. }
  1889. // 상품 고시 선택 버튼 클릭 시
  1890. $('#btnNotinfo').click(function(e) {
  1891. if(gagajf.isNull($("#goodsDetailForm select[name=selNiClsfCd]").val())) {
  1892. mcxDialog.alertC("상품정보제공 고시를 선택해주세요.", {
  1893. sureBtnText: "확인",
  1894. sureBtnClick: function() {
  1895. $("#goodsDetailForm select[name=selNiClsfCd]").focus();
  1896. }
  1897. });
  1898. return false;
  1899. }
  1900. // 고시정보 수정은 맘대로 할수 있음 20200821 신현장 부장 확인
  1901. /* if ($("#goodsDetailForm input[name=niClsfCd]").val() != $("#goodsDetailForm select[name=selNiClsfCd]").val()){
  1902. mcxDialog.alertC("상품의 고시분류는 [" + $("#goodsDetailForm input[name=niClsfNm]").val() +"] 입니다." , {
  1903. sureBtnText: "확인",
  1904. sureBtnClick: function() {
  1905. $("#goodsDetailForm select[name=selNiClsfCd]").focus();
  1906. }
  1907. });
  1908. return false;
  1909. } */
  1910. var params = new Object();
  1911. params.supplyCompCd = $("#goodsDetailForm input[name=supplyCompCd]").val();
  1912. params.niClsfCd = $("#goodsDetailForm select[name=selNiClsfCd]").val();
  1913. params.goodsCd = $("#goodsDetailForm input[name=goodsCd]").val();
  1914. cfnAjaxSubmit("/goods/noti/goodsInfo/list", "json", fnGoodsDetailNotiInfoSearchCallback, params);
  1915. });
  1916. // 품목변경
  1917. $("#btnGoodsItemkindChange").on("click", function(){
  1918. if($("#goodsDetailForm select[name=itemkindCd]").val() == $("#goodsDetailForm input[name=orgItemkindCd]").val()){
  1919. mcxDialog.alert("품목코드가 변경되지 않았습니다.");
  1920. return false;
  1921. }
  1922. mcxDialog.confirm('품목변경 하시겠습니까?', {
  1923. cancelBtnText: "취소",
  1924. sureBtnText: "확인",
  1925. sureBtnClick: function(){
  1926. var data = [{ goodsCd : $('#goodsDetailForm input[name=goodsCd]').val()
  1927. , itemkindCd : $("#goodsDetailForm select[name=itemkindCd]").val()
  1928. , supplyCompCd : $("#goodsDetailForm input[name=supplyCompCd]").val()
  1929. }];
  1930. var jsonData = JSON.stringify(data);
  1931. gagajf.ajaxJsonSubmit('/goods/itemKind/change/save', jsonData, fnGoodsDeailSearch);
  1932. }
  1933. });
  1934. });
  1935. // 안전인증
  1936. $("#btnGoodsSafetyCertNum").on("click", function(){
  1937. /*
  1938. if($("#goodsDetailForm input[name=certNum]").val() == $("#goodsDetailForm input[name=certNumOrg]").val()){
  1939. mcxDialog.alert("안전인증번호가 변경되지 않았습니다.");
  1940. return false;
  1941. }
  1942. */
  1943. mcxDialog.confirm('안전인증번호를 변경 하시겠습니까?', {
  1944. cancelBtnText: "취소",
  1945. sureBtnText: "확인",
  1946. sureBtnClick: function(){
  1947. var data = { goodsCd : $('#goodsDetailForm input[name=goodsCd]').val()
  1948. , certNum : $("#goodsDetailForm input[name=certNum]").val()
  1949. };
  1950. var jsonData = JSON.stringify(data);
  1951. gagajf.ajaxJsonSubmit('/goods/detail/certNum/save', jsonData ); //, fnGoodsDeailSearch
  1952. }
  1953. });
  1954. });
  1955. // 상품구매등급
  1956. var fnGoodsOrderGrade = function(){
  1957. var code = $('#goodsDetailForm select[name=custGrade]').val();
  1958. var codeText = $("#goodsDetailForm select[name=custGrade] option:selected").text();
  1959. var addHtml = '';
  1960. var addFlag = true;
  1961. $("#goodsDetailForm #goodsCustGradeList").find("input").each(function() {
  1962. if (code == $(this).val() ){
  1963. addFlag = false;
  1964. }
  1965. });
  1966. if (addFlag){
  1967. addHtml = '<span class="memAdd"><input type="hidden" name="goodsOrderGrade" value="'+code+'"/>'+ codeText+' <button type="button" onclick="$(this).parent().remove();return false;">삭제</button></span>';
  1968. $('#goodsCustGradeList').append(addHtml);
  1969. //$('#goodsDetailForm').find('.tabs .tabsNav li:eq(4) a').attr("style", "color:red;");
  1970. }
  1971. }
  1972. // 구성상품 조회 팝업
  1973. var fnOpenGoodsDetailPopup = function() {
  1974. cfnOpenGoodsPopup('fnGoodsDetailGoodsDeal');
  1975. }
  1976. // 구성상품 조회 팝업 - 상품추가
  1977. var fnGoodsDetailGoodsDeal = function(goodsData) {
  1978. if (goodsData.length < 1) return;
  1979. // 기존상품
  1980. var oldGoodsDealList = gagaAgGrid.getAllRowData(gridGoodsComposeOptions);
  1981. var idx = oldGoodsDealList.length+1;
  1982. var isExist = false;
  1983. goodsData.forEach(function(goods){
  1984. isExist = false;
  1985. gridGoodsComposeOptions.api.forEachNode(function(rowNode, index) {
  1986. if (goods.goodsCd == rowNode.data.extendGoodsCd){
  1987. isExist = true;
  1988. }
  1989. });
  1990. if (goods.goodsType != 'N'){
  1991. isExist = true;
  1992. }
  1993. if(!isExist){
  1994. var data = {
  1995. goodsCd : $('#goodsDetailForm input[name=goodsCd]').val()
  1996. , extendGoodsCd: goods.goodsCd
  1997. , goodsType: $('#goodsDetailForm input[name=goodsType]').val()
  1998. , dispOrd: idx
  1999. , qty: 1
  2000. , compsCurrPrice: goods.currPrice
  2001. , extendStaffCurrPrice: goods.currPrice
  2002. , baseYn: 'N'
  2003. , goodsStat : goods.goodsStat
  2004. , useYn: 'Y'
  2005. , extendGoodsOptNm : goods.goodsNm
  2006. , extendGoodsCdNm : goods.goodsNm
  2007. , currPrice : goods.currPrice
  2008. , selfGoodsYn : goods.selfGoodsYn
  2009. , sysImgNm : goods.sysImgNm
  2010. };
  2011. gridGoodsComposeOptions.api.updateRowData({add: [data], addIndex: idx});
  2012. idx++;
  2013. $('#goodsDetailForm').find('.tabs .tabsNav li:eq(5) a').attr("style", "color:red;");
  2014. }
  2015. });
  2016. gridGoodsComposeOptions.api.refreshCells();
  2017. }
  2018. //엑셀 상품 조회
  2019. $('#btnGoodsDealSearchExcel').on('click', function() {
  2020. cfnExcelUploadPopup('goodsDetailExcelUpload', 'goodsDetailExcelUpload');
  2021. });
  2022. var goodsDetailExcelUpload = function(result){
  2023. var data = {procJob : result.procJob
  2024. ,excelFileNm : result.excelFileNm
  2025. };
  2026. var jsonData = JSON.stringify(data);
  2027. gagajf.ajaxJsonSubmit('/goods/search/excelupload/save', jsonData, goodsDetailExcelUploadCallBack);
  2028. }
  2029. var goodsDetailExcelUploadCallBack = function(result){
  2030. gagajf.ajaxJsonSubmit('/goods/excel/upload/goods/list', '', fnGoodsDetailSearchExcel);
  2031. }
  2032. var fnGoodsDetailSearchExcel = function(result){
  2033. fnGoodsDetailGoodsDeal(result.goodsExcelList);
  2034. }
  2035. $("img").on("error", function () {
  2036. $(this).attr("src", _uximgUrl+"/image/no.gif");
  2037. });
  2038. $(document).ready(function() {
  2039. cfnCreateCheckbox("/renderer/avail/commonCode/list/G101", $('#goodsCustGradeList'), "goodsOrderGrade");
  2040. gagaAgGrid.createGrid('gridGoodsHstoryList', gridGoodsHstoryOptions);
  2041. gagaAgGrid.createGrid('gridGoodsComposeList', gridGoodsComposeOptions);
  2042. fnGoodsDeailSearch();
  2043. });
  2044. /*]]>*/
  2045. </script>
  2046. </html>