PlanDetailPopupForm.html 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080
  1. <!DOCTYPE html>
  2. <html lang="ko"
  3. xmlns:th="http://www.thymeleaf.org">
  4. <!--
  5. *******************************************************************************
  6. * @source : PlanDetailForm.html
  7. * @desc : 웹 수정 / 웹 등록 팝업 화면 Page
  8. *============================================================================
  9. * SISUN
  10. * Copyright(C) 2020 TSIT, All rights reserved.
  11. *============================================================================
  12. * VER DATE AUTHOR DESCRIPTION
  13. * === =========== ========== =============================================
  14. * 1.0 2020.02.04 sowon 최초 작성
  15. *******************************************************************************
  16. -->
  17. <div class="modalPopup" data-width="1100" id="planRegisterFormDiv">
  18. <div class="panelStyle">
  19. <div class="panelTitle">
  20. <h2 th:text="${'기획전 ' + (mode == 'N' ? '등록' : '수정')}"></h2>
  21. <button type="button" class="close" onclick="uifnPopupClose('planRegisterFormDiv')"><i class="fa fa-times"></i></button>
  22. </div>
  23. <!-- 기획전 웹 수정 -->
  24. <div class="panelContent" th:if="${mode == 'U'}">
  25. <form th:object="${planInfo}" id="planUpdateForm" name="planUpdateForm" action="#" th:method="post">
  26. <input type="hidden" name="mode" th:value="${mode}"/>
  27. <input type="hidden" name="planSq" th:value="*{planSq}"/>
  28. <div class="cardArea" style="height: 700px;margin: -5px;">
  29. <table class="frmStyle">
  30. <colgroup>
  31. <col style="width:10%"/>
  32. <col style="width:40%;"/>
  33. <col style="width:10%;"/>
  34. <col style="width:35%;"/>
  35. <col/>
  36. </colgroup>
  37. <tr>
  38. <th>기획전구분<i class="star"></i></th>
  39. <td>
  40. <select name="planGb" id="planGb" th:field="*{planGb}" onchange="fnChangePlanGb(this);">
  41. <option value="P">기획전</option>
  42. <option value="E">이벤트</option>
  43. </select>
  44. </td>
  45. <th>기획전탬플릿유형<i class="star"></i></th>
  46. <td colspan="3">
  47. <select name="templateType" th:field="*{templateType}">
  48. <option value="H">HTML</option>
  49. <option value="T">TEXT</option>
  50. </select>
  51. </td>
  52. </tr>
  53. <tr>
  54. <th>프론트 구분<i class="star"></i></th>
  55. <td>
  56. <select name="frontGb" id="frontGb" th:field="*{frontGb}">
  57. <option value="A">전체</option>
  58. <option value="P">웹</option>
  59. <option value="M">모바일</option>
  60. </select>
  61. </td>
  62. <th>기획전명<i class="star"></i></th>
  63. <td colspan="3">
  64. <input type="text" name="planNm" id="planNm" th:field="*{planNm}"/>
  65. </td>
  66. </tr>
  67. <tr>
  68. <th>진행기간<i class="star"></i></th>
  69. <td>
  70. <input type="text" class="schDate w100" name="startSearchDate" maxlength="10" required="required" data-valid-name="노출기간" th:field="*{startSearchDate}"/>
  71. <select name="startSearchHour" required="required" data-valid-name="진행기간 시작시간">
  72. <th:block th:each="num, index : ${#numbers.sequence(0,23)}">
  73. <option th:value="${#numbers.formatInteger(num,2)}" th:text="|${#numbers.formatInteger(num,2)}시|" th:selected="*{#strings.substring(dispStdt, 11, 13)} == ${#strings.toString(num)} ? 'true'">시간</option>
  74. </th:block>
  75. </select>
  76. <select name="startSearchMin" required="required" data-valid-name="진행기간 시작시간">
  77. <th:block th:each="num: ${#numbers.sequence(0,59)}">
  78. <option th:value="${#numbers.formatInteger(num,2)}" th:text="|${#numbers.formatInteger(num,2)}분|" th:selected="*{#strings.substring(dispStdt, 14, 16)} == ${#strings.toString(num)} ? 'true'">분</option>
  79. </th:block>
  80. </select>
  81. ~
  82. <input type="text" class="schDate w100" name="endSearchDate" maxlength="10" required="required" data-valid-name="노출기간" th:field="*{endSearchDate}"/>
  83. <select name="endSearchHour" required="required" data-valid-name="진행기간 종료시간">
  84. <th:block th:each="num, index : ${#numbers.sequence(0,23)}">
  85. <option th:value="${#numbers.formatInteger(num,2)}" th:text="|${#numbers.formatInteger(num,2)}시|" th:selected="*{#strings.substring(dispEddt, 11, 13)} == ${#strings.toString(num)} ? 'true'">시간</option>
  86. </th:block>
  87. </select>
  88. <select name="endSearchMin" required="required" data-valid-name="진행기간 종료시간">
  89. <th:block th:each="num: ${#numbers.sequence(0,59)}">
  90. <option th:value="${#numbers.formatInteger(num,2)}" th:text="|${#numbers.formatInteger(num,2)}분|" th:selected="*{#strings.substring(dispEddt, 14, 16)} == ${#strings.toString(num)} ? 'true'">분</option>
  91. </th:block>
  92. </select>
  93. <input type="hidden" name="dispStdt" id="dispStdt"/>
  94. <input type="hidden" name="dispEddt" id="dispEddt"/>
  95. </td>
  96. <th>서브제목</th>
  97. <td colspan="3">
  98. <input type="text" name="dtlTitle1" id="dtlTitle1" th:value="*{dtlTitle1}"/>
  99. </td>
  100. </tr>
  101. <tr>
  102. <th>코너명노출 여부<i class="star"></i></th>
  103. <td>
  104. <select name="cornerNmDispYn" th:field="*{cornerNmDispYn}">
  105. <option th:if="${useYnList}" th:each="oneData, status : ${useYnList}" th:value="${oneData.cd}" th:selected="${oneData.cd} == 'Y'" th:text="|${oneData.cdNm}|"></option>
  106. </select>
  107. </td>
  108. <th>오픈여부<i class="star"></i></th>
  109. <td>
  110. <select name="openYn" th:field="*{openYn}">
  111. <option th:if="${useYnList}" th:each="oneData, status : ${useYnList}" th:value="${oneData.cd}" th:selected="${oneData.cd} == 'Y'" th:text="|${oneData.cdNm}|"></option>
  112. </select>
  113. </td>
  114. </tr>
  115. <tr>
  116. <th>사이트<i class="star"></i></th>
  117. <td>
  118. <select name="siteCd" th:field="*{siteCd}">
  119. <option value="">선택</option>
  120. <option th:if="${siteList}" th:each="oneData, status : ${siteList}" th:value="${oneData.cd}" th:text="|${oneData.cdNm}|"></option>
  121. </select>
  122. </td>
  123. <th>전시순서</th>
  124. <td>
  125. <input type="text" name="dispOrd" class="w100 aR" th:value="*{dispOrd}"/>
  126. </td>
  127. </tr>
  128. <tr>
  129. <th>사용고객등급구분<em class="required" title="필수"></em></th>
  130. <td>
  131. <label class="chkBox" th:if="${usableCustGradeList}" th:each="oneData, status : ${usableCustGradeList}">
  132. <input type="checkbox" name="usableCustGradeArr" th:value="${oneData.cd}" th:text="${oneData.cdNm}"/>
  133. </label>
  134. </td>
  135. <th>사용가능고객구분<em class="required" title="필수"></em></th>
  136. <td>
  137. <label class="chkBox" th:if="${usableCustGbList}" th:each="oneData, status : ${usableCustGbList}">
  138. <input type="checkbox" name="usableCustGbArr" th:value="${oneData.cd}" th:text="${oneData.cdNm}"/>
  139. </label>
  140. </td>
  141. </tr>
  142. <tr>
  143. <th>제휴채널<em class="required" title="필수"></em></th>
  144. <td>
  145. <label class="chkBox" th:if="${upperAfLinkCdList}" th:each="oneData, status : ${upperAfLinkCdList}">
  146. <input type="checkbox" name="upperAfLinkCdArr" th:value="${oneData.cd}" th:text="${oneData.cdNm}"/>
  147. </label>
  148. </td>
  149. <th>댓글여부</th>
  150. <td>
  151. <select name="replyYn" th:field="*{replyYn}">
  152. <option value="">선택</option>
  153. <option th:if="${useYnList}" th:each="oneData, status : ${useYnList}" th:value="${oneData.cd}" th:text="|${oneData.cdNm}|"></option>
  154. </select>
  155. </td>
  156. </tr>
  157. <tr>
  158. <th>PC 메인 이미지<i id="pMimgStar"></i><br/>[삭제여부<label class="chkBox"><input type="checkbox" name="orgMainPimgDelYn" value="Y"/></label>]</th>
  159. <td>
  160. <div th:if=*{mainPimg} id="mainPimgView" style="float:left;">
  161. <img id="PreMainPimgUrl" th:src="${@environment.getProperty('upload.image.view') + '/planning/'} + *{mainPimg}" style="max-width:720px;"/>
  162. </div>
  163. </td>
  164. <td colspan="4">
  165. <div class="uFile w400">
  166. <input id="registerMainPimg" name="registerMainPimg" type="file" accept="image/*" class="uFileInput w400"/>
  167. <label for="registerMainPimg" class="uFileLabel w400">파일선택</label>
  168. <input type="hidden" name="orgMainPimg" id="orgMainPimg" th:value="*{mainPimg}"/>
  169. <input type="hidden" name="mainPimg" id="mainPimg"/>
  170. </div>
  171. </td>
  172. </tr>
  173. <tr>
  174. <th>모바일 메인 이미지<i id="mMimgStar"></i><br/>[삭제여부<label class="chkBox"><input type="checkbox" name="orgMainMimgDelYn" value="Y"/></label>]</th>
  175. <td>
  176. <div th:if=*{mainMimg} id="imgFileView" style="float:left;">
  177. <img id="PreMainMimgUrl" th:src="${@environment.getProperty('upload.image.view') + '/planning/'} + *{mainMimg}" style="max-width:720px;"/>
  178. </div>
  179. </td>
  180. <td colspan="4">
  181. <div class="uFile w400">
  182. <input id="registerMainMimg" name="registerMainMimg" type="file" accept="image/*" class="uFileInput w400"/>
  183. <label for="registerMainMimg" class="uFileLabel w400">파일선택</label>
  184. <input type="hidden" name="orgMainMimg" id="orgMainMimg" th:value="*{mainMimg}"/>
  185. <input type="hidden" name="mainMimg" id="mainMimg"/>
  186. </div>
  187. </td>
  188. </tr>
  189. </tbody>
  190. <tbody>
  191. <!-- <tr>
  192. <th>웹용소스</th>
  193. <td colspan="5">
  194. <div style="margin-top:5px;">
  195. <textarea name="fsrcPc" id="fsrcPcDetail" rows="15" cols="95" style="width:1280px;"></textarea>
  196. </div>
  197. </td>
  198. </tr>
  199. <tr>
  200. <th>모바일용소스</th>
  201. <td colspan="5">
  202. <div style="margin-top:5px;">
  203. <textarea name="fsrcMobile" id="fsrcMobileDetail" rows="15" cols="95" style="width:1280px;"></textarea>
  204. </div>
  205. </td>
  206. </tr> -->
  207. </table>
  208. <div class="panelStyle" style="margin: unset;">
  209. <!-- TITLE -->
  210. <div class="panelTitle">
  211. <h2>카테고리 / 브랜드 등록</h2>
  212. <span class="panelControl"> <i
  213. class="fa inner-fa-chevron-up"></i> <!-- 열림/닫힘 화살표 -->
  214. </span>
  215. </div>
  216. <!-- //TITLE -->
  217. <div class="inner-panelContent">
  218. <div class="panelContent">
  219. <table class="frmStyle">
  220. <colgroup>
  221. <col width="10%" />
  222. <col width="90%" />
  223. </colgroup>
  224. <tr>
  225. <th>카테고리/브랜드</th>
  226. <td>
  227. <!-- 수정시 프로모션명 입력 : before -->
  228. <div class="padding10"
  229. style="display: inline-block; width: 49%;">
  230. <!--<span>공급업체 설정</span>-->
  231. <div class="padding10 inner-tb-solid">
  232. <span class="buttonSpan">
  233. <button type="button"
  234. class="btn btnRight btn-success btn-lg"
  235. id="btnAddCate">카테고리 추가</button>
  236. <button type="button"
  237. class="btn btnRight btn-success btn-lg"
  238. id="btnDeleteCate">선택삭제</button>
  239. </span> <br />
  240. <div id="gridFGCateList"
  241. style="width: 100%; height: 200px;"
  242. class="ag-theme-balham"></div>
  243. </div>
  244. </div>
  245. <div class="padding10"
  246. style="display: inline-block; width: 49%;">
  247. <!--<span>브랜드 설정</span>-->
  248. <div class="padding10 inner-tb-solid">
  249. <span class="buttonSpan">
  250. <button type="button"
  251. class="btn btnRight btn-success btn-lg" id="btnAddBrand">브랜드
  252. 추가</button>
  253. <button type="button"
  254. class="btn btnRight btn-success btn-lg"
  255. id="btnDeleteBrand">선택삭제</button>
  256. </span> <br />
  257. <div id="gridFGBrandList"
  258. style="width: 100%; height: 200px;"
  259. class="ag-theme-balham"></div>
  260. </div>
  261. </div>
  262. </td>
  263. </tr>
  264. </table>
  265. </div>
  266. </div>
  267. </div>
  268. </div>
  269. <div style='margin: 13px;'>
  270. <ul class="panelBar">
  271. <li class="right" th:if="${mode == 'U'}">
  272. <button type="button" class="btn btn-success btn-lg" onclick="fnPlanSave('#planUpdateForm');">저장</button>
  273. </li>
  274. </ul>
  275. </div>
  276. </form>
  277. </div>
  278. <!-- 기획전 웹 등록 -->
  279. <div class="panelContent" th:if="${mode == 'N'}">
  280. <form id="planRegisterForm" name="planRegisterForm" action="#" th:action="@{'/system/user/save'}" th:method="post">
  281. <input type="hidden" name="mode" th:value="${mode}"/>
  282. <div>
  283. <table class="frmStyle">
  284. <colgroup>
  285. <col style="width:13%;"/>
  286. <col/>
  287. </colgroup>
  288. <tr>
  289. <th>기존 기획전</th>
  290. <td>
  291. <!-- <select name="planSq" id="planSq">
  292. <option value="">선택</option>
  293. <option th:if="${planList}" th:each="oneData, status : ${planList}" th:value="${oneData.planSq}" th:text="|[${oneData.planSq}] ${oneData.planNm}|"></option>
  294. </select> -->
  295. <input type="text" class="w100" name="searchTxt" id="searchTxt" maxlength="20" readonly="readonly"/>
  296. <input type="hidden" class="w100" name="planSq_Hideen" id="planSq_Hideen" maxlength="20"/>
  297. <button type="button" class="btn icn" id="btnPopupSearchPlan"><i class="fa fa-search"></i></button>
  298. <button type="button" class="btn btn-primary btn-lg" onclick="fnPlanCopyPopup();">기획전 복사</button>
  299. </td>
  300. </tr>
  301. </table>
  302. </div>
  303. <div class="cardArea">
  304. <table class="frmStyle">
  305. <colgroup>
  306. <col style="width:10%"/>
  307. <col style="width:40%;"/>
  308. <col style="width:10%;"/>
  309. <col style="width:35%;"/>
  310. <col/>
  311. </colgroup>
  312. <tr>
  313. <th>기획전구분<i class="star"></i></th>
  314. <td>
  315. <select name="planGb" required="required" data-valid-name="기획전구분" onchange="fnChangePlanGb(this);">
  316. <option value="P">기획전</option>
  317. <option value="E">이벤트</option>
  318. </select>
  319. </td>
  320. <th>기획전탬플릿유형<i class="star"></i></th>
  321. <td colspan="3">
  322. <button type="button" class="btn btn-default btn-lg" onclick="fnPlanTemplatePopup();">템플릿</button>
  323. <!-- <select name="templateType" required="required" data-valid-name="기획전탬플릿유형">
  324. <option value="H">HTML</option>
  325. <option value="T">TEXT</option>
  326. </select> -->
  327. </td>
  328. </tr>
  329. <tr>
  330. <th>프론트 구분<i class="star"></i></th>
  331. <td>
  332. <select name="frontGb" id="frontGb" required="required" data-valid-name="프론트 구분">
  333. <option value="A">전체</option>
  334. <option value="P">웹</option>
  335. <option value="M">모바일</option>
  336. </select>
  337. </td>
  338. <th>기획전명<i class="star"></i></th>
  339. <td colspan="3">
  340. <input type="text" name="planNm" id="planNm" maxlength="50" required="required" data-valid-name="기획전명"/>
  341. </td>
  342. </tr>
  343. <tr>
  344. <th>진행기간<i class="star"></i></th>
  345. <td>
  346. <input type="text" class="schDate w100" id="viewStartDtNew" name="startSearchDate" maxlength="10" required="required" data-valid-name="노출기간" />
  347. <select name="startSearchHour" required="required" data-valid-name="진행기간 시작시간">
  348. <th:block th:each="num, index : ${#numbers.sequence(0,23)}">
  349. <option th:value="${#numbers.formatInteger(num,2)}" th:text="|${#numbers.formatInteger(num,2)}시|" >시간</option>
  350. </th:block>
  351. </select>
  352. <select name="startSearchMin" required="required" data-valid-name="진행기간 시작시간">
  353. <th:block th:each="num: ${#numbers.sequence(0,59)}">
  354. <option th:value="${#numbers.formatInteger(num,2)}" th:text="|${#numbers.formatInteger(num,2)}분|" >분</option>
  355. </th:block>
  356. </select>
  357. ~
  358. <input type="text" class="schDate w100" id="viewEndDtNew" name="endSearchDate" maxlength="10" required="required" data-valid-name="노출기간"/>
  359. <select name="endSearchHour" required="required" data-valid-name="진행기간 종료시간">
  360. <th:block th:each="num, index : ${#numbers.sequence(0,23)}">
  361. <option th:value="${#numbers.formatInteger(num,2)}" th:text="|${#numbers.formatInteger(num,2)}시|" th:selected="${#numbers.formatInteger(num,2)}==23 ? 'true'">시간</option>
  362. </th:block>
  363. </select>
  364. <select name="endSearchMin" required="required" data-valid-name="진행기간 종료시간">
  365. <th:block th:each="num: ${#numbers.sequence(0,59)}">
  366. <option th:value="${#numbers.formatInteger(num,2)}" th:text="|${#numbers.formatInteger(num,2)}분|" th:selected="${#numbers.formatInteger(num,2)}==59 ? 'true'">분</option>
  367. </th:block>
  368. </select>
  369. <input type="hidden" name="dispStdt" id="dispStdt"/>
  370. <input type="hidden" name="dispEddt" id="dispEddt"/>
  371. </td>
  372. <th>서브제목</th>
  373. <td colspan="3">
  374. <input type="text" name="dtlTitle1" id="dtlTitle1"/>
  375. </td>
  376. </tr>
  377. <tr>
  378. <th>코너명노출 여부<i class="star"></i></th>
  379. <td>
  380. <select name="cornerNmDispYn" required="required" data-valid-name="코너명노출 여부">
  381. <option th:if="${useYnList}" th:each="oneData, status : ${useYnList}" th:value="${oneData.cd}" th:selected="${oneData.cd} == 'Y'" th:text="|${oneData.cdNm}|"></option>
  382. </select>
  383. </td>
  384. <th>오픈여부<i class="star"></i></th>
  385. <td colspan="3">
  386. <select name="openYn" required="required" data-valid-name="오픈여부">
  387. <option th:if="${useYnList}" th:each="oneData, status : ${useYnList}" th:value="${oneData.cd}" th:selected="${oneData.cd} == 'Y'" th:text="|${oneData.cdNm}|"></option>
  388. </select>
  389. </td>
  390. </tr>
  391. <tr>
  392. <th>사이트<i class="star"></i></th>
  393. <td>
  394. <select name="siteCd" required="required" data-valid-name="사이트">
  395. <option th:if="${siteList}" th:each="oneData, status : ${siteList}" th:value="${oneData.cd}" th:text="|${oneData.cdNm}|"></option>
  396. </select>
  397. </td>
  398. <th>전시순서</th>
  399. <td colspan="3">
  400. <input type="text" class="w100 aR" name="dispOrd"/>
  401. </td>
  402. </tr>
  403. <tr>
  404. <th>사용고객등급구분<em class="required" title="필수"></em></th>
  405. <td>
  406. <label class="chkBox" th:if="${usableCustGradeList}" th:each="oneData, status : ${usableCustGradeList}">
  407. <input type="checkbox" name="usableCustGradeArr" th:value="${oneData.cd}" th:text="${oneData.cdNm}"/>
  408. </label>
  409. </td>
  410. <th>사용가능고객구분<em class="required" title="필수"></em></th>
  411. <td>
  412. <label class="chkBox" th:if="${usableCustGbList}" th:each="oneData, status : ${usableCustGbList}">
  413. <input type="checkbox" name="usableCustGbArr" th:value="${oneData.cd}" th:text="${oneData.cdNm}"/>
  414. </label>
  415. </td>
  416. </tr>
  417. <tr>
  418. <th>제휴채널<em class="required" title="필수"></em></th>
  419. <td>
  420. <label class="chkBox" th:if="${upperAfLinkCdList}" th:each="oneData, status : ${upperAfLinkCdList}">
  421. <input type="checkbox" name="upperAfLinkCdArr" th:value="${oneData.cd}" th:text="${oneData.cdNm}"/>
  422. </label>
  423. </td>
  424. <th>댓글여부</th>
  425. <td colspan="5">
  426. <select name="replyYn">
  427. <option th:if="${useYnList}" th:each="oneData, status : ${useYnList}" th:value="${oneData.cd}" th:selected="${oneData.cd} == 'N'" th:text="|${oneData.cdNm}|"></option>
  428. </select>
  429. </td>
  430. </tr>
  431. <tr>
  432. <th>PC 메인 이미지<i id="pMimgStar"></i></th>
  433. <td colspan="5">
  434. <div class="uFile w400">
  435. <input id="registerMainPimg" name="registerMainPimg" type="file" accept="image/*" class="uFileInput w400"/>
  436. <label for="registerMainPimg" class="uFileLabel w400">파일선택</label>
  437. <input type="hidden" name="mainPimg" id="mainPimg" value=""/>
  438. </div>
  439. </td>
  440. </tr>
  441. <tr>
  442. <th>모바일 메인 이미지<i id="mMimgStar"></i></th>
  443. <td colspan="5">
  444. <div class="uFile w400">
  445. <input id="registerMainMimg" name="registerMainMimg" type="file" accept="image/*" class="uFileInput w400"/>
  446. <label for="registerMainMimg" class="uFileLabel w400">파일선택</label>
  447. <input type="hidden" name="mainMimg" id="mainMimg" value=""/>
  448. </div>
  449. </td>
  450. </tr>
  451. </tbody>
  452. <tbody>
  453. <!-- <tr>
  454. <th>웹용소스</th>
  455. <td colspan="5">
  456. <div style="margin-top:5px;">
  457. <textarea name="fsrcPc" id="fsrcPcRegister" rows="15" cols="95" style="width:1280px;"></textarea>
  458. <textarea class="textareaR4" id="fsrcPcDetail" name="fsrcPc"></textarea>
  459. </div>
  460. </td>
  461. </tr>
  462. <tr>
  463. <th>모바일용소스</th>
  464. <td colspan="5">
  465. <div style="margin-top:5px;">
  466. <textarea name="fsrcMobile" id="fsrcMobileRegister" rows="15" cols="95" style="width:1280px;"></textarea>
  467. <textarea class="textareaR4" id="fsrcMobileDetail" name="fsrcMobile"></textarea>
  468. </div>
  469. </td>
  470. </tr> -->
  471. </table>
  472. <div class="panelStyle" style="margin: unset;">
  473. <!-- TITLE -->
  474. <div class="panelTitle">
  475. <h2>카테고리 / 브랜드 등록</h2>
  476. <span class="panelControl"> <i
  477. class="fa inner-fa-chevron-up"></i> <!-- 열림/닫힘 화살표 -->
  478. </span>
  479. </div>
  480. <!-- //TITLE -->
  481. <div class="inner-panelContent">
  482. <div class="panelContent">
  483. <table class="frmStyle">
  484. <colgroup>
  485. <col width="10%" />
  486. <col width="90%" />
  487. </colgroup>
  488. <tr>
  489. <th>카테고리/브랜드</th>
  490. <td>
  491. <!-- 수정시 프로모션명 입력 : before -->
  492. <div class="padding10"
  493. style="display: inline-block; width: 49%;">
  494. <!--<span>공급업체 설정</span>-->
  495. <div class="padding10 inner-tb-solid">
  496. <span class="buttonSpan">
  497. <button type="button"
  498. class="btn btnRight btn-success btn-lg"
  499. id="btnAddCate">카테고리 추가</button>
  500. <button type="button"
  501. class="btn btnRight btn-success btn-lg"
  502. id="btnDeleteCate">선택삭제</button>
  503. </span> <br />
  504. <div id="gridFGCateList"
  505. style="width: 100%; height: 200px;"
  506. class="ag-theme-balham"></div>
  507. </div>
  508. </div>
  509. <div class="padding10"
  510. style="display: inline-block; width: 49%;">
  511. <!--<span>브랜드 설정</span>-->
  512. <div class="padding10 inner-tb-solid">
  513. <span class="buttonSpan">
  514. <button type="button"
  515. class="btn btnRight btn-success btn-lg" id="btnAddBrand">브랜드
  516. 추가</button>
  517. <button type="button"
  518. class="btn btnRight btn-success btn-lg"
  519. id="btnDeleteBrand">선택삭제</button>
  520. </span> <br />
  521. <!-- 브랜드 선택 팝업(단수 선택 팝업... 복수를 새로 만들어야하는지 ? 아니면 변수처리해야하는지 ? -->
  522. <div id="gridFGBrandList"
  523. style="width: 100%; height: 200px;"
  524. class="ag-theme-balham"></div>
  525. </div>
  526. </div>
  527. </td>
  528. </tr>
  529. </table>
  530. </div>
  531. </div>
  532. </div>
  533. </div>
  534. <ul class="panelBar">
  535. <li class="right" th:if="${mode == 'N'}">
  536. <button type="button" class="btn btn-info btn-lg" onclick="fnPlanSave('#planRegisterForm');">저장</button>
  537. </li>
  538. </ul>
  539. </form>
  540. </div>
  541. </div>
  542. </div>
  543. <script type="text/javascript" src="/ux/plugins/summernote/summernote.js?v=2020103001"></script>
  544. <script type="text/javascript" src="/ux/plugins/gaga/gaga.summernote.js?v=2020103001"></script>
  545. <script th:inline="javascript">
  546. /*<![CDATA[*/
  547. var mode = [[${mode}]];
  548. var planInfo = [[${planInfo}]];
  549. var fsrcPc = [[${fsrcPc}]];
  550. var fsrcMobile = [[${fsrcMobile}]];
  551. var planBrandList = [[${planBrandList}]];
  552. var planCateList = [[${planCateList}]];
  553. var snOptions;
  554. // 카테고리 전시 여부
  555. var fnCataCheck = function(is, formId) {
  556. if (is.checked) {
  557. $(formId + ' input[name=cateDispYn]').val('Y');
  558. // 추후 카테고리 표시
  559. } else {
  560. $(formId + ' input[name=cateDispYn]').val('N');
  561. }
  562. }
  563. // 상품제한여부
  564. var fnGoodsCheck = function(is, formId) {
  565. if (is.checked) {
  566. $(formId + ' input[name=goodsLimitYn]').val('Y');
  567. $(formId + ' input[name=goodsLimitQty]').show();
  568. $(formId + ' input[name=goodsLimitQty]').focus();
  569. // 추후 카테고리 표시
  570. } else {
  571. $(formId + ' input[name=goodsLimitYn]').val('N');
  572. $(formId + ' input[name=goodsLimitQty]').hide();
  573. }
  574. }
  575. //템플릿 유형 설정
  576. var fnPlanTemplatePopup = function () {
  577. var actionUrl = "/marketing/planning/detail/template/form?mode=C";
  578. cfnOpenModalPopup(actionUrl,'popupPlanTemplate');
  579. }
  580. // 기존 기획전 조회 선택시
  581. $('#btnPopupSearchPlan').on('click', function(result) {
  582. cfnOpenPlanPopup('popupPlan');
  583. });
  584. var popupPlan = function (result) {
  585. $("#planSq_Hideen").val(result[0].planSq);
  586. $("#searchTxt").val("[" + result[0].planSq + "] " +result[0].planNm);
  587. }
  588. // 기획전 복사
  589. var fnPlanCopyPopup = function() {
  590. var planSq = $("#planSq_Hideen").val();
  591. if (gagajf.isNull(planSq)) {
  592. mcxDialog.alert('복사할 기획전을 선택하세요.');
  593. return;
  594. }
  595. mcxDialog.confirm('선택 된 기획전을 복사 하시겠습니까?', {
  596. cancelBtnText: "취소",
  597. sureBtnText: "확인",
  598. sureBtnClick: function() {
  599. var actionUrl = '/marketing/planning/copy';
  600. var data = {copyPlanSq : planSq};
  601. var jsonData = JSON.stringify(data);
  602. gagajf.ajaxJsonSubmit(actionUrl, jsonData, fnCopyCallback);
  603. }
  604. });
  605. }
  606. // 기획전 복사 callback
  607. var fnCopyCallback = function(result) {
  608. uifnPopupClose('planRegisterFormDiv');
  609. fnPlanListSearch();
  610. var actionUrl = "/marketing/planning/detail/form?mode=U&planSq=" + result.planSq;
  611. cfnOpenModalPopup(actionUrl,'popupPlan');
  612. }
  613. var fnPlanSave = function(formId) {
  614. if (!gagajf.validation(formId))
  615. return;
  616. // 날짜 유효성 체크
  617. var stDate = $(formId + ' input[name=startSearchDate]').val().replaceAll("-", "");
  618. var edDate = $(formId + ' input[name=endSearchDate]').val().replaceAll("-", "");
  619. var toDate = _today.replaceAll("-", "");
  620. if (Number(stDate) > Number(edDate)) {
  621. mcxDialog.alert('종료일자는 시작일자 보다 클 수 없습니다.');
  622. return;
  623. }
  624. if (Number(stDate) < Number(toDate) && mode == 'N') {
  625. mcxDialog.alert('시작일자는 오늘포함 이후로 등록해주세요.');
  626. return;
  627. }
  628. if (Number(edDate) < Number(toDate) && mode == 'N') {
  629. mcxDialog.alert('종료일자는 오늘포함 이후로 등록해주세요.');
  630. return;
  631. }
  632. stDate = $(formId + ' input[name=startSearchDate]').val();
  633. edDate = $(formId + ' input[name=endSearchDate]').val();
  634. $(formId + ' input[name=dispStdt]').val(stDate + ' ' + $(formId + ' select[name=startSearchHour]').val() + ':' + $(formId + ' select[name=startSearchMin]').val() + ':00');
  635. $(formId + ' input[name=dispEddt]').val(edDate + ' ' + $(formId + ' select[name=endSearchHour]').val() + ':' + $(formId + ' select[name=endSearchMin]').val() + ':59');
  636. /* // 댓글여부에 따른 위치 체크
  637. if ($('#replyYn').val() == 'Y') {
  638. var replyLoc = $(':radio[name="replyLoc"]:checked').val();
  639. if (typeof replyLoc == 'undefined') {
  640. mcxDialog.alert('댓글 사용 시 댓글위치를 선택해야합니다.');
  641. return;
  642. }
  643. } */
  644. // poll 관리일련번호 유효성 체크
  645. /* if (!gagajf.isNull($(formId + ' input[name=pollSq]').val())) {
  646. gagajf.ajaxFormSubmit('/marketing/poll/list', formId, function(result) {
  647. console.log(result);
  648. if (result.length < 1) {
  649. mcxDialog.alert('입력하신 투표 일련번호가 존재 하지않습니다.');
  650. return;
  651. }
  652. });
  653. } */
  654. var privacyPolicy = '';
  655. var frontGb = $('#frontGb').val();
  656. if (mode =='U') {
  657. //if($("#planGb").val()=='E'){
  658. // privacyPolicy = gagaSn.getContents('privacyPolicyDetail');
  659. //}
  660. // 이미지 처리
  661. if ((!$('input[name=orgMainPimgDelYn]').is(':checked') ? true : false) &&
  662. (gagajf.isNull($(formId + ' input[name=mainPimg]').val()) == true) ) {
  663. $(formId + ' input[name=mainPimg]').val($(formId + ' input[name=orgMainPimg]').val());
  664. }
  665. if ((!$('input[name=orgMainMimgDelYn]').is(':checked') ? true : false) &&
  666. (gagajf.isNull($(formId + ' input[name=mainMimg]').val()) == true) ) {
  667. $(formId + ' input[name=mainMimg]').val($(formId + ' input[name=orgMainMimg]').val());
  668. }
  669. if ((!$('input[name=orgDtlPimgDelYn]').is(':checked') ? true : false) &&
  670. (gagajf.isNull($(formId + ' input[name=dtlPimg]').val()) == true) ) {
  671. $(formId + ' input[name=dtlPimg]').val($(formId + ' input[name=orgDtlPimg]').val());
  672. }
  673. if ((!$('input[name=orgDtlMimgDelYn]').is(':checked') ? true : false) &&
  674. (gagajf.isNull($(formId + ' input[name=dtlMimg]').val()) == true) ) {
  675. $(formId + ' input[name=dtlMimg]').val($(formId + ' input[name=orgDtlMimg]').val());
  676. }
  677. if ((!$('input[name=orgReplyImgYn]').is(':checked') ? true : false) &&
  678. (gagajf.isNull($(formId + ' input[name=replyImg]').val()) == true) ) {
  679. $(formId + ' input[name=replyImg]').val($(formId + ' input[name=orgReplyImg]').val());
  680. }
  681. } else {
  682. //gagaSn.getContents('fsrcPcRegister');
  683. //gagaSn.getContents('fsrcMobileRegister');
  684. //if($("#planGb").val()=='E'){
  685. // privacyPolicy = gagaSn.getContents('privacyPolicyRegister');
  686. //}
  687. }
  688. if(!gagajf.isNull($(formId + ' input[name=planQtitle]').val()) && gagajf.isNull(privacyPolicy.replace(/<br>/gi, '').replace(/<p>/gi, '').replace(/<\/\p>/gi, ''))){
  689. mcxDialog.alert('입력항목 등록 시 개인정보 수집동의를 입력해 주세요.');
  690. return;
  691. }
  692. //var jsonData = JSON.stringify($("#planRegisterForm").serializeObject());
  693. let allBrandData = gagaAgGrid.getAllRowData(gridOptionsFGBrandList);
  694. var multiBrand = [];
  695. $.each(allBrandData, function(idx, item) {
  696. multiBrand.push(item.brandCd);
  697. });
  698. let allCateData = gagaAgGrid.getAllRowData(gridOptionsFGCateList);
  699. var multiCate = [];
  700. $.each(allCateData, function(idx, item) {
  701. multiCate.push(item.cateNo);
  702. });
  703. // 기획전 등록
  704. if (formId == '#planRegisterForm') {
  705. mcxDialog.confirm('등록 하시겠습니까?', {
  706. cancelBtnText: "취소",
  707. sureBtnText: "확인",
  708. sureBtnClick: function() {
  709. let data = {
  710. multiBrand : multiBrand
  711. ,brandList : allBrandData
  712. ,multiCate : multiCate
  713. ,CateList : allCateData
  714. ,mode : $('#planRegisterForm input[name=mode]').val()
  715. ,planSq : $('#planRegisterForm input[name=planSq]').val()
  716. ,planGb : $('#planRegisterForm select[name=planGb]').val()
  717. ,templateType : $('#planRegisterForm select[name=templateType]').val()
  718. ,frontGb : $('#planRegisterForm select[name=frontGb]').val()
  719. ,planNm : $('#planRegisterForm input[name=planNm]').val()
  720. ,startSearchDate : $('#planRegisterForm input[name=startSearchDate]').val()
  721. ,startSearchHour : $('#planRegisterForm input[name=startSearchHour]').val()
  722. ,startSearchMin : $('#planRegisterForm input[name=startSearchMin]').val()
  723. ,endSearchDate : $('#planRegisterForm input[name=endSearchDate]').val()
  724. ,endSearchHour : $('#planRegisterForm input[name=endSearchHour]').val()
  725. ,endSearchMin : $('#planRegisterForm input[name=endSearchMin]').val()
  726. ,dispStdt : $('#planRegisterForm input[name=dispStdt]').val()
  727. ,dispEddt : $('#planRegisterForm input[name=dispEddt]').val()
  728. ,dtlTitle1 : $('#planRegisterForm input[name=dtlTitle1]').val()
  729. ,cornerNmDispYn : $('#planRegisterForm select[name=cornerNmDispYn]').val()
  730. ,openYn : $('#planRegisterForm select[name=openYn]').val()
  731. ,siteCd :$('#planRegisterForm select[name=siteCd]').val()
  732. ,dispOrd : $('#planRegisterForm input[name=dispOrd]').val()
  733. ,replyYn : $('#planRegisterForm select[name=replyYn]').val()
  734. ,mainPimg :$('#planRegisterForm input[name=mainPimg]').val()
  735. ,mainMimg : $('#planRegisterForm input[name=mainMimg]').val()
  736. ,fsrcPc : $('#planRegisterForm input[name=fsrcPc]').val()
  737. ,fsrcMobile : $('#planRegisterForm input[name=fsrcMobile]').val()
  738. }
  739. var jsonData = JSON.stringify(data);
  740. gagajf.ajaxJsonSubmit("/marketing/planning/detail/create", jsonData, fnPlanDetailCallBack);
  741. uifnPopupClose('planRegisterFormDiv');
  742. fnPlanListSearch();
  743. //fnPlanDetailClose();
  744. }
  745. });
  746. } else { // 기획전 수정
  747. mcxDialog.confirm('저장 하시겠습니까?', {
  748. cancelBtnText: "취소",
  749. sureBtnText: "확인",
  750. sureBtnClick: function() {
  751. let data = {
  752. multiBrand : multiBrand
  753. ,brandList : allBrandData
  754. ,multiCate : multiCate
  755. ,CateList : allCateData
  756. ,mode : $('#planUpdateForm input[name=mode]').val()
  757. ,planSq : $('#planUpdateForm input[name=planSq]').val()
  758. ,planGb : $('#planUpdateForm select[name=planGb]').val()
  759. ,templateType : $('#planUpdateForm select[name=templateType]').val()
  760. ,frontGb : $('#planUpdateForm select[name=frontGb]').val()
  761. ,planNm : $('#planUpdateForm input[name=planNm]').val()
  762. ,startSearchDate : $('#planUpdateForm input[name=startSearchDate]').val()
  763. ,startSearchHour : $('#planUpdateForm input[name=startSearchHour]').val()
  764. ,startSearchMin : $('#planUpdateForm input[name=startSearchMin]').val()
  765. ,endSearchDate : $('#planUpdateForm input[name=endSearchDate]').val()
  766. ,endSearchHour : $('#planUpdateForm input[name=endSearchHour]').val()
  767. ,endSearchMin : $('#planUpdateForm input[name=endSearchMin]').val()
  768. ,dispStdt : $('#planUpdateForm input[name=dispStdt]').val()
  769. ,dispEddt : $('#planUpdateForm input[name=dispEddt]').val()
  770. ,dtlTitle1 : $('#planUpdateForm input[name=dtlTitle1]').val()
  771. ,cornerNmDispYn : $('#planUpdateForm select[name=cornerNmDispYn]').val()
  772. ,openYn : $('#planUpdateForm select[name=openYn]').val()
  773. ,siteCd :$('#planUpdateForm select[name=siteCd]').val()
  774. ,dispOrd : $('#planUpdateForm input[name=dispOrd]').val()
  775. ,replyYn : $('#planUpdateForm select[name=replyYn]').val()
  776. ,mainPimg :$('#planUpdateForm input[name=mainPimg]').val()
  777. ,mainMimg : $('#planUpdateForm input[name=mainMimg]').val()
  778. ,fsrcPc : $('#planUpdateForm input[name=fsrcPc]').val()
  779. ,fsrcMobile : $('#planUpdateForm input[name=fsrcMobile]').val()
  780. }
  781. var actionUrl = '/marketing/plan/detail/update';
  782. var jsonData = JSON.stringify(data);
  783. gagajf.ajaxJsonSubmit(actionUrl, jsonData, fnPlanDetailCallBack);
  784. uifnPopupClose('planRegisterFormDiv');
  785. fnPlanListSearch();
  786. //fnPlanDetailClose();
  787. }
  788. });
  789. }
  790. }
  791. // 이미지 첨부
  792. $('input[name=registerMainPimg],input[name=registerMainMimg],input[name=registerDtlPimg],input[name=registerDtlMimg],input[name=registerReplyImg]').on('change', function() {
  793. var name = $(this)[0].name;
  794. var file = this.files[0];
  795. gagajf.ajaxFileUpload('/common/file/upload?subDir=/planning'
  796. , file
  797. , function(result) {
  798. if (name == 'registerMainPimg')
  799. $('input[name=mainPimg]').val(result.newFileName);
  800. if (name == 'registerMainMimg')
  801. $('input[name=mainMimg]').val(result.newFileName);
  802. if (name == 'registerDtlPimg')
  803. $('input[name=dtlPimg]').val(result.newFileName);
  804. if (name == 'registerDtlMimg')
  805. $('input[name=dtlMimg]').val(result.newFileName);
  806. if (name == 'registerReplyImg')
  807. $('input[name=replyImg]').val(result.newFileName);
  808. }
  809. , 'image'
  810. );
  811. });
  812. var fnChangePlanGb = function(obj) {
  813. if($(obj).val()=='E'){
  814. $("#questionEventInsert").show();
  815. $("#questionEventUpdate").show();
  816. if (mode =='U') {
  817. if($("#privacyPolicyDetail").closest('div').children('#the_iframe').length==0){
  818. gagaSn.createSummernote(snOptions, '#privacyPolicyDetail');
  819. }
  820. }else{
  821. if($("#privacyPolicyRegister").closest('div').children('#the_iframe').length==0){
  822. gagaSn.createSummernote(snOptions, '#privacyPolicyRegister');
  823. }
  824. }
  825. }else{
  826. $("#questionEventInsert").hide();
  827. $("#questionEventUpdate").hide();
  828. }
  829. }
  830. var fnAddRow = function(obj){
  831. var html = '<div>';
  832. html += '<input type="text" class="w200" name="planQtitle"/>';
  833. html += '<label class="chkBox"><input type="checkbox" onclick="fnAttachYnClick(this);" />첨부파일</label>';
  834. html += '<button type="button" class="btn icn" onclick="fnDeleteRow(this);"><i class="fa fa-times" aria-hidden="true"></i></button>';
  835. html += '<input type="hidden" name="attachYn" value="N"/>';
  836. html += '</div>';
  837. $(obj).closest('td').append(html);
  838. }
  839. var fnDeleteRow = function(obj){
  840. $(obj).closest('div').remove();
  841. }
  842. var fnAttachYnClick = function(obj){
  843. var val = 'N';
  844. if($(obj).prop('checked')){
  845. val = 'Y';
  846. }
  847. $(obj).closest('div').find('input[name="attachYn"]').val(val);
  848. }
  849. var fnPlanDetailCallBack = function() {
  850. uifnPopupClose('planRegisterForm');
  851. fnPlanListSearch();
  852. }
  853. // 브랜드 리스트 설정
  854. var columnBrandList = [
  855. {width: 40, minWidth: 40, cellClass: 'text-center', headerCheckboxSelection: true, checkboxSelection: true, filter: false},
  856. {headerName: "브랜드ID", field: "brandCd", width: 110, cellClass: 'text-center'},
  857. {headerName: "브랜드명", field: "brandEnm", width: 120, cellClass: 'text-center'},
  858. {headerName: "브랜드그룹명", field: "brandGrpNm", width: 150, cellClass: 'text-center'},
  859. {headerName: "", field: "brandKnm", width: 150, cellClass: 'text-center'},
  860. /* {headerName: "적용대상", field: "targetGb", width: 150, cellClass: 'text-center', hide: true},
  861. {headerName: "시퀀스", field: "tmtbGoodsSq", width: 150, cellClass: 'text-center', hide: true},
  862. {headerName: "삭제여부", field: "delYn", width: 150, cellClass: 'text-center', hide: true} */
  863. ];
  864. // 브랜드 그리드 설정
  865. var gridOptionsFGBrandList = gagaAgGrid.getGridOptions(columnBrandList);
  866. gridOptionsFGBrandList.rowSelection = "multiple";
  867. gridOptionsFGBrandList.suppressRowClickSelection = true;
  868. // 브랜드 추가 버튼 클릭시 (복수 브랜드때 수정 필요)
  869. $('#btnAddBrand').on('click', function() {
  870. cfnOpenBrandListPopup("fnSetPopupBrandInfo", "M");
  871. });
  872. // 브랜드 설정 선택삭제 버튼 클릭시
  873. $('#btnDeleteBrand').on('click', function() {
  874. gridOptionsFGBrandList.api.updateRowData({remove:gagaAgGrid.selectedRowData(gridOptionsFGBrandList)});
  875. });
  876. // 브랜드 설정 / 브랜드 추가 콜백함수 (단수로 가져오므로 복수일 경우에 수정 확인 필요)
  877. var fnSetPopupBrandInfo = function(result) {
  878. for(let i = 0 ; i < result.length ; i++) {
  879. let addChk = true, gridListValue = gagaAgGrid.getAllRowData(gridOptionsFGBrandList); // 받아온 모든 데이터
  880. // 받아온 data for
  881. for(let j = 0 ; j < gridListValue.length ; j++) {
  882. if(gridListValue[j].brandCd == result[i].brandCd) { addChk = false; } // 중복체크
  883. }
  884. // 중복되지 않은 데이터 리스트에 추가
  885. if(addChk) {
  886. gagaAgGrid.addRowData(gridOptionsFGBrandList, {"brandCd" : result[i].brandCd, "brandEnm" : result[i].brandEnm, "brandKnm" : result[i].brandKnm});
  887. }
  888. }
  889. };
  890. // 카테고리 리스트 설정
  891. var columnCateList = [
  892. {width: 40, minWidth: 40, cellClass: 'text-center', headerCheckboxSelection: true, checkboxSelection: true, filter: false},
  893. {headerName: "사이트", field: "siteCd", width: 120, cellClass: 'text-center'},
  894. {headerName: "카테고리 구분", field: "cateGb", width: 110, cellClass: 'text-center'},
  895. {headerName: "카테고리 이름", field: "cateNm", width: 120, cellClass: 'text-center'},
  896. {headerName: "번호", field: "cateNo", width: 150, cellClass: 'text-center', hide: true},
  897. /* {headerName: "시퀀스", field: "tmtbGoodsSq", width: 150, cellClass: 'text-center', hide: true},
  898. {headerName: "삭제여부", field: "delYn", width: 150, cellClass: 'text-center', hide: true} */
  899. ];
  900. // 카테고리 그리드 설정
  901. var gridOptionsFGCateList = gagaAgGrid.getGridOptions(columnCateList);
  902. gridOptionsFGCateList.rowSelection = "multiple";
  903. gridOptionsFGCateList.suppressRowClickSelection = true;
  904. // 브랜드 설정 선택삭제 버튼 클릭시
  905. $('#btnDeleteCate').on('click', function() {
  906. gridOptionsFGCateList.api.updateRowData({remove:gagaAgGrid.selectedRowData(gridOptionsFGCateList)});
  907. });
  908. // 카테고리 추가
  909. $('#btnAddCate').on('click' , function () {
  910. cfnOpenCategoryPopup("fnSetPopupCategoryInfo");
  911. });
  912. // 카테고리 추가 콜백 함수
  913. var fnSetPopupCategoryInfo = function (result) {
  914. // 기존 리스트 데이터 for
  915. for(let i = 0 ; i < result.length ; i++) {
  916. let addChk = true, gridListValue = gagaAgGrid.getAllRowData(gridOptionsFGCateList); // 받아온 모든 데이터
  917. // 받아온 data for
  918. for(let j = 0 ; j < gridListValue.length ; j++) {
  919. // 동일한 data는 추가하지 않음
  920. if(gridListValue[j].cateNo == result[i].cateNo) { addChk = false; } // 중복체크
  921. }
  922. // 중복되지 않은 데이터 리스트에 추가
  923. if(addChk) {
  924. if(result[i].cate2No!=null)
  925. {
  926. mcxDialog.alert('카테고리1에서 선택하세요.');
  927. return;
  928. }
  929. gagaAgGrid.addRowData(gridOptionsFGCateList, {"siteCd":result[i].siteCd , "cateGb":result[i].cateGb, "cateNm":result[i].cateNm, "cateNo":result[i].cateNo});
  930. }
  931. }
  932. }
  933. $(document).ready(function() {
  934. snOptions = gagaSn.getToolbarOptions('media');
  935. // 썸머노트 그리기
  936. gagaSn.createSummernote(snOptions, '#fsrcPcDetail');
  937. gagaSn.createSummernote(snOptions, '#fsrcMobileDetail');
  938. // 그리드 그리기
  939. gagaAgGrid.createGrid("gridFGBrandList", gridOptionsFGBrandList);
  940. gagaAgGrid.createGrid("gridFGCateList", gridOptionsFGCateList);
  941. if (mode =='U') {
  942. /* $('#planDetailForm input[name=badgeFcolor]').spectrum({
  943. preferredFormat: "hex",
  944. showInput: true,
  945. allowEmpty: true
  946. });
  947. $('#planDetailForm input[name=badgeBcolor]').spectrum({
  948. preferredFormat: "hex",
  949. showInput: true,
  950. allowEmpty: true
  951. }); */
  952. gridOptionsFGBrandList.api.setRowData(planBrandList);
  953. gridOptionsFGCateList.api.setRowData(planCateList);
  954. if (planInfo.goodsLimitYn == 'N') {
  955. $('#planDetailForm input[name=goodsLimitQty]').hide();
  956. } else {
  957. $('#planDetailForm input[name=goodsLimitQty]').show();
  958. }
  959. // 썸머노트 값 설정
  960. $('#fsrcPcDetail').summernote('code', fsrcPc.fsrc);
  961. $('#fsrcMobileDetail').summernote('code', fsrcMobile.fsrc);
  962. if($("#planGb").val()!='E'){
  963. $("#questionEventInsert").hide();
  964. $("#questionEventUpdate").hide();
  965. }else{
  966. gagaSn.createSummernote(snOptions, '#privacyPolicyRegister');
  967. }
  968. } else {
  969. /* $('#planRegisterForm input[name=badgeFcolor]').spectrum({
  970. preferredFormat: "hex",
  971. showInput: true,
  972. allowEmpty: true
  973. });
  974. $('#planRegisterForm input[name=badgeBcolor]').spectrum({
  975. preferredFormat: "hex",
  976. showInput: true,
  977. allowEmpty: true
  978. }); */
  979. $("#viewStartDtNew").val(_today);
  980. $("#viewEndDtNew").val(_today);
  981. $("#questionEventInsert").hide();
  982. $("#questionEventUpdate").hide();
  983. }
  984. $('#frontGb').trigger('change');
  985. });
  986. /*]]>*/
  987. </script>
  988. </html>