GoodsDetailForm.html 104 KB

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