GoodsDetailForm.html 77 KB

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