UserDetailForm.html 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545
  1. <!DOCTYPE html>
  2. <html lang="ko"
  3. xmlns:th="http://www.thymeleaf.org">
  4. <!--
  5. *******************************************************************************
  6. * @source : UserDetailForm.html
  7. * @desc : 사용자 상세 팝업 Page
  8. *============================================================================
  9. * STYLE24
  10. * Copyright(C) 2020 TSIT, All rights reserved.
  11. *============================================================================
  12. * VER DATE AUTHOR DESCRIPTION
  13. * === =========== ========== =============================================
  14. * 1.0 2020.10.07 gagamel 최초 작성
  15. *******************************************************************************
  16. -->
  17. <div class="modalPopup" data-width="900" id="popupUser">
  18. <div class="panelStyle">
  19. <!-- TITLE -->
  20. <div class="panelTitle">
  21. <strong th:text="${'사용자 ' + (mode == 'N' ? '등록' : '상세')}">사용자 상세</strong>
  22. <button type="button" class="close" onclick="uifnPopupClose('popupUser');"><em class="fa fa-times"></em></button>
  23. </div>
  24. <!-- //TITLE -->
  25. <!-- CONTENT -->
  26. <div class="panelContent" th:if="${mode == 'N'}">
  27. <form id="userRegisterForm" name="userRegisterForm" action="#" th:action="@{'/system/user/save'}" th:method="post">
  28. <input type="hidden" name="mode" th:value="${mode}"/>
  29. <table class="frmStyle" aria-describedby="등록폼">
  30. <colgroup>
  31. <col style="width:10%"/>
  32. <col style="width:40%;"/>
  33. <col style="width:10%;"/>
  34. <col/>
  35. </colgroup>
  36. <tr>
  37. <th>사용자ID<em class="required" title="필수"></em></th>
  38. <td>
  39. <input type="hidden" name="userNo" value="" readonly="readonly"/>
  40. <input type="text" class="w150" name="userId" placeholder="" maxlength="20" required="required" data-valid-type="alphaNumeric" data-valid-name="사용자ID"/>
  41. <button type="button" class="btn btn-default btn-sm" id="userIdDupCheck">중복체크</button>
  42. </td>
  43. <th>사용자명<em class="required" title="필수"></em></th>
  44. <td>
  45. <input type="text" name="userNm" placeholder="" maxlength="50" required="required" data-valid-name="사용자명"/>
  46. </td>
  47. </tr>
  48. <tr>
  49. <th>비밀번호<em class="required" title="필수"></em></th>
  50. <td colspan="3">
  51. <input type="password" name="passwd" placeholder="비밀번호" maxlength="50" required="required" data-valid-type="password" data-valid-name="비밀번호"/> /
  52. <input type="password" name="passwdConfirm" placeholder="비밀번호확인" maxlength="50" required="required" data-valid-type="password" data-valid-name="비밀번호확인"/>
  53. <p class="dot cBlue">대문자, 소문자, 특수문자, 숫자로 구성해야 합니다.</p>
  54. <p class="dot cBlue">이 중 3개 이상은 8 ~ 20자, 2개 이상은 10 ~ 20자로 설정해야 합니다.</p>
  55. </td>
  56. </tr>
  57. <tr>
  58. <th>권한<em class="required" title="필수"></em></th>
  59. <td>
  60. <input type="hidden" name="roleChangeYn" value="Y"/>
  61. <select name="roleCd" required="required" data-valid-name="권한">
  62. <option th:if="${roleList}" th:each="oneData, status : ${roleList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
  63. </select>
  64. </td>
  65. <th><span id="registerRoleRefVal">업체</span></th>
  66. <td>
  67. <input type="hidden" name="roleRefVal"/>
  68. <select name="supplyCompCd">
  69. <option th:if="${sessionInfo.supplyCompCd == null}" value="">[선택]</option>
  70. <option th:if="${supplyCompList}" th:each="oneData, status : ${supplyCompList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
  71. </select>
  72. <select name="vendorId" style="display: none">
  73. <option th:if="${sessionInfo.vendorId == null}" value="">[선택]</option>
  74. <option th:if="${vendorList}" th:each="oneData, status : ${vendorList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
  75. </select>
  76. <select name="afLinkCd" style="display: none">
  77. <option th:if="${sessionInfo.afLinkCd == null}" value="">[선택]</option>
  78. <option th:if="${afLinkList}" th:each="oneData, status : ${afLinkList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
  79. </select>
  80. </td>
  81. </tr>
  82. <tr>
  83. <th>이메일</th>
  84. <td>
  85. <input type="text" name="email" placeholder="" maxlength="100" data-valid-type="email" data-valid-name="이메일"/>
  86. </td>
  87. <th>휴대전화번호</th>
  88. <td>
  89. <input type="text" name="cellPhnno" placeholder="" maxlength="50" data-valid-type="cellPhone" data-valid-name="휴대전화번호"/>
  90. </td>
  91. </tr>
  92. <tr>
  93. <th>포인트부여가능금액</th>
  94. <td>
  95. <input type="text" name="pntAssignAmt" class="aR" placeholder="" maxlength="6" data-valid-type="pinteger" data-valid-name="포인트부여가능금액"/>
  96. </td>
  97. <th>IP주소</th>
  98. <td>
  99. <input type="text" name="ipAddr" placeholder="" maxlength="20" data-valid-type="ipAddress" data-valid-name="IP주소"/>
  100. </td>
  101. </tr>
  102. <tr>
  103. <th>IP체크여부</th>
  104. <td>
  105. <input type="hidden" name="ipChkYn" value="Y"/>
  106. <label class="chkBox checked"><input type="checkbox" name="chkIpChkYn" value="Y"/>IP체크</label>
  107. </td>
  108. <th>사용여부</th>
  109. <td>
  110. <input type="hidden" name="useYn" value="Y"/>
  111. <label class="chkBox checked"><input type="checkbox" name="chkUseYn" value="Y" checked="checked"/>사용</label>
  112. </td>
  113. </tr>
  114. <tr>
  115. <th>마스킹여부</th>
  116. <td colspan="3">
  117. <input type="hidden" name="maskingYn" value="N"/>
  118. <label class="chkBox checked"><input type="checkbox" name="chkMaskingYn" value="Y" checked="checked"/>마스킹</label>
  119. <span class="infoTxt cBlue marL10"><i class="fa fa-info-circle" aria-hidden="true"></i>회원정보에 대한 마스킹 처리여부</span>
  120. </td>
  121. </tr>
  122. </table>
  123. </form>
  124. </div>
  125. <!-- //CONTENT -->
  126. <!-- 버튼 배치 영역 -->
  127. <ul class="panelBar" th:if="${mode == 'N'}">
  128. <li class="right">
  129. <button type="button" class="btn btn-info btn-lg" onclick="fnSaveUser('#userRegisterForm');">저장</button>
  130. <button type="button" class="btn btn-gray btn-lg" onclick="$('#userRegisterForm')[0].reset();">초기화</button>
  131. </li>
  132. </ul>
  133. <!-- //버튼 배치 영역 -->
  134. <!-- CONTENT -->
  135. <div class="panelContent" th:if="${mode == 'U'}">
  136. <form id="userDetailForm" name="userDetailForm" action="#" th:action="@{'/system/user/save'}" th:method="post" th:object="${userInfo}">
  137. <input type="hidden" name="mode" th:value="${mode}"/>
  138. <table class="frmStyle" aria-describedby="상세폼">
  139. <colgroup>
  140. <col style="width:10%"/>
  141. <col style="width:40%;"/>
  142. <col style="width:10%;"/>
  143. <col/>
  144. </colgroup>
  145. <tr>
  146. <th>사용자ID<em class="required" title="필수"></em></th>
  147. <td>
  148. <input type="hidden" name="userNo" readonly="readonly" th:field="*{userNo}"/>
  149. <input type="text" name="userId" placeholder="" readonly="readonly" th:field="*{userId}"/>
  150. </td>
  151. <th>사용자명<em class="required" title="필수"></em></th>
  152. <td>
  153. <input type="text" name="userNm" placeholder="" maxlength="50" required="required" data-valid-name="사용자명" th:field="*{userNm}"/>
  154. </td>
  155. </tr>
  156. <tr>
  157. <th>비밀번호</th>
  158. <td colspan="3">
  159. <input type="password" name="passwd" placeholder="비밀번호" maxlength="50" data-valid-type="password" data-valid-name="비밀번호"/> /
  160. <input type="password" name="passwdConfirm" placeholder="비밀번호확인" maxlength="50" data-valid-type="password" data-valid-name="비밀번호확인"/>
  161. <button type="button" class="btn btn-info btn-sm" id="btnChangePassword">비밀번호변경</button>
  162. <p class="dot cBlue">대문자, 소문자, 특수문자, 숫자로 구성해야 합니다.</p>
  163. <p class="dot cBlue">이 중 3개 이상은 8 ~ 20자, 2개 이상은 10 ~ 20자로 설정해야 합니다.</p>
  164. </td>
  165. </tr>
  166. <tr>
  167. <th>권한<em class="required" title="필수"></em></th>
  168. <td>
  169. <input type="hidden" name="roleChangeYn" value="N"/>
  170. <select name="roleCd" required="required" data-valid-name="권한" th:field="*{roleCd}">
  171. <option th:if="${roleList}" th:each="oneData, status : ${roleList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}" th:selected="${roleCd == oneData.cd}"></option>
  172. </select>
  173. </td>
  174. <th>
  175. <span id="detailRoleRefVal" th:if="${userInfo.roleCd == 'G001_B000'}">업체</span>
  176. <span id="detailRoleRefVal" th:if="${userInfo.roleCd == 'G001_C000'}">외부몰벤더</span>
  177. <span id="detailRoleRefVal" th:if="${userInfo.roleCd == 'G001_D000'}">제휴채널</span>
  178. <span id="detailRoleRefVal" th:if="${userInfo.roleCd != 'G001_B000' and userInfo.roleCd != 'G001_C000' and userInfo.roleCd != 'G001_D000'}"></span>
  179. </th>
  180. <td>
  181. <input type="hidden" name="roleRefVal" th:value="${userInfo.roleRefVal}"/>
  182. <select name="supplyCompCd" th:style="${userInfo.roleCd == 'G001_B000' ? '' : 'display: none'}">
  183. <option th:if="${sessionInfo.supplyCompCd == null}" value="">[선택]</option>
  184. <option th:if="${supplyCompList}" th:each="oneData, status : ${supplyCompList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}" th:selected="${userInfo.roleRefVal == oneData.cd}"></option>
  185. </select>
  186. <select name="vendorId" th:style="${userInfo.roleCd == 'G001_C000' ? '' : 'display: none'}">
  187. <option th:if="${sessionInfo.vendorId == null}" value="">[선택]</option>
  188. <option th:if="${vendorList}" th:each="oneData, status : ${vendorList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}" th:selected="${userInfo.roleRefVal == oneData.cd}"></option>
  189. </select>
  190. <select name="afLinkCd" th:style="${userInfo.roleCd == 'G001_D000' ? '' : 'display: none'}">
  191. <option th:if="${sessionInfo.afLinkCd == null}" value="">[선택]</option>
  192. <option th:if="${afLinkList}" th:each="oneData, status : ${afLinkList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}" th:selected="${userInfo.roleRefVal == oneData.cd}"></option>
  193. </select>
  194. </td>
  195. </tr>
  196. <tr>
  197. <th>이메일</th>
  198. <td colspan="3">
  199. <input type="text" name="email" placeholder="" maxlength="100" data-valid-type="email" data-valid-name="이메일" th:field="*{email}"/>
  200. <!-- <button type="button" class="btn btn-info btn-sm" id="btnSendTempPassword">임시비밀번호 발송</button> -->
  201. </td>
  202. </tr>
  203. <tr>
  204. <th>휴대전화번호</th>
  205. <td>
  206. <input type="text" name="cellPhnno" placeholder="" maxlength="50" data-valid-type="cellPhone" data-valid-name="휴대전화번호" th:field="*{cellPhnno}"/>
  207. </td>
  208. <th>포인트부여가능금액</th>
  209. <td>
  210. <input type="text" class="aR" name="pntAssignAmt" placeholder="" maxlength="6" data-valid-type="pinteger" data-valid-name="포인트부여가능금액" th:field="*{pntAssignAmt}"/>
  211. </td>
  212. </tr>
  213. <tr>
  214. <th>IP주소</th>
  215. <td>
  216. <input type="text" name="ipAddr" placeholder="" maxlength="20" data-valid-type="ipAddress" data-valid-name="IP주소" th:field="*{ipAddr}"/>
  217. </td>
  218. <th>IP체크여부</th>
  219. <td>
  220. <input type="hidden" name="ipChkYn" th:value="${userInfo.ipChkYn}"/>
  221. <label th:class="${'chkBox' + (userInfo.ipChkYn == 'Y' ? ' checked' : '')}"><input type="checkbox" name="chkIpChkYn" th:value="${userInfo.ipChkYn}" th:checked="${userInfo.ipChkYn == 'Y'}"/>IP체크</label>
  222. </td>
  223. </tr>
  224. <tr>
  225. <th>마스킹여부</th>
  226. <td>
  227. <input type="hidden" name="maskingYn" th:value="${userInfo.maskingYn}"/>
  228. <label th:class="${'chkBox' + (userInfo.maskingYn == 'Y' ? ' checked' : '')}"><input type="checkbox" name="chkMaskingYn" th:value="${userInfo.maskingYn}" th:checked="${userInfo.maskingYn == 'Y'}"/>마스킹</label>
  229. </td>
  230. <th>사용여부</th>
  231. <td>
  232. <input type="hidden" name="useYn" th:value="${userInfo.useYn}"/>
  233. <label th:class="${'chkBox' + (userInfo.useYn == 'Y' ? ' checked' : '')}"><input type="checkbox" name="chkUseYn" th:value="${userInfo.useYn}" th:checked="${userInfo.useYn == 'Y'}"/>사용</label>
  234. </td>
  235. </tr>
  236. <tr>
  237. <th>최종로그인일시</th>
  238. <td th:text="*{loginLdt}">
  239. </td>
  240. <th>비밀번호변경일시</th>
  241. <td th:text="*{passwdChgDt}">
  242. </td>
  243. </tr>
  244. </table>
  245. </form>
  246. </div>
  247. <!-- //CONTENT -->
  248. <!-- 버튼 배치 영역 -->
  249. <ul class="panelBar" th:if="${mode == 'U'}">
  250. <li class="right">
  251. <button type="button" class="btn btn-info btn-lg" onclick="fnSaveUser('#userDetailForm');">저장</button>
  252. <button type="button" class="btn btn-gray btn-lg" onclick="fnInitialize(false);">초기화</button>
  253. </li>
  254. </ul>
  255. </div>
  256. </div>
  257. <script th:inline="javascript">
  258. /*<![CDATA[*/
  259. var mode = [[${mode}]];
  260. var roleCd = [[${userInfo.roleCd}]];
  261. // 사용자ID 중복 체크
  262. var isUnique = true;
  263. $('#userIdDupCheck').on('click', function() {
  264. var $e = $('#userRegisterForm input[name=userId]');
  265. if (gagajf.isNull($e.val())) {
  266. mcxDialog.alert('사용자ID를 입력해 주세요.');
  267. $e.focus();
  268. return;
  269. }
  270. $.get('/system/user/id/' + $e.val()
  271. , function(data) {
  272. if (data > 0) {
  273. mcxDialog.alertC('이 ID는 이미 사용중입니다. 다른 ID를 입력해 주세요.', {
  274. sureBtnText: "확인",
  275. sureBtnClick: function() {
  276. isUnique = false;
  277. $e.val('');
  278. $e.focus();
  279. }
  280. });
  281. } else {
  282. mcxDialog.alert('이 ID는 사용 가능합니다.');
  283. isUnique = true;
  284. }
  285. });
  286. });
  287. // 등록화면 권한 변경 시
  288. $('#userRegisterForm select[name=roleCd]').on('change', function() {
  289. var abRoleCd = $(this).val().substring(0,6);
  290. if (abRoleCd == 'G001_A' || abRoleCd == 'G001_B') { // 입점업체
  291. $('#userRegisterForm select[name=supplyCompCd]').show();
  292. $('#userRegisterForm select[name=vendorId]').hide();
  293. $('#userRegisterForm select[name=afLinkCd]').hide();
  294. $('#registerRoleRefVal').text('업체');
  295. } else if (abRoleCd == 'G001_C') { // 외부몰벤더
  296. $('#userRegisterForm select[name=supplyCompCd]').hide();
  297. $('#userRegisterForm select[name=vendorId]').show();
  298. $('#userRegisterForm select[name=afLinkCd]').hide();
  299. $('#registerRoleRefVal').text('외부몰벤더');
  300. } else if (abRoleCd == 'G001_D') { // 제휴채널
  301. $('#userRegisterForm select[name=supplyCompCd]').hide();
  302. $('#userRegisterForm select[name=vendorId]').hide();
  303. $('#userRegisterForm select[name=afLinkCd]').show();
  304. $('#registerRoleRefVal').text('제휴채널');
  305. } else { // 외부몰벤더
  306. $('#userRegisterForm select[name=supplyCompCd]').hide();
  307. $('#userRegisterForm select[name=vendorId]').hide();
  308. $('#userRegisterForm select[name=afLinkCd]').hide();
  309. $('#registerRoleRefVal').text('');
  310. }
  311. });
  312. // 비밀번호 변경
  313. $('#btnChangePassword').on('click', function() {
  314. // 기본 이벤트 실행 안 되게
  315. //if (event.preventDefault) event.preventDefault(); else event.returnValue = false;
  316. var passwd = $('#userDetailForm input[name=passwd]').val();
  317. var passwdConfirm = $('#userDetailForm input[name=passwdConfirm]').val();
  318. if (gagajf.isNull(passwd)) {
  319. mcxDialog.alertC('비밀번호를 입력해 주세요.', {
  320. sureBtnText: "확인",
  321. sureBtnClick: function() {
  322. $('#userDetailForm input[name=passwd]').focus();
  323. }
  324. });
  325. return;
  326. }
  327. if (gagajf.isNull(passwdConfirm)) {
  328. mcxDialog.alertC('비밀번호확인을 입력해 주세요.', {
  329. sureBtnText: "확인",
  330. sureBtnClick: function() {
  331. $('#userDetailForm input[name=passwdConfirm]').focus();
  332. }
  333. });
  334. return;
  335. }
  336. if (passwd != passwdConfirm) {
  337. mcxDialog.alertC('비밀번호를 확인해 주세요.', {
  338. sureBtnText: "확인",
  339. sureBtnClick: function() {
  340. $('#userDetailForm input[name=passwdConfirm]').focus();
  341. }
  342. });
  343. return;
  344. }
  345. mcxDialog.confirm("비밀번호를 변경하시겠습니까?", {
  346. cancelBtnText: "취소",
  347. sureBtnText: "확인",
  348. sureBtnClick: function() {
  349. var jsonData = JSON.stringify($('#userDetailForm').serializeObject());
  350. gagajf.ajaxJsonSubmit('/system/user/password/change', jsonData);
  351. }
  352. });
  353. });
  354. // 임시비밀번호 발송
  355. $('#btnSendTempPassword').on('click', function() {
  356. // 기본 이벤트 실행 안 되게
  357. //if (event.preventDefault) event.preventDefault(); else event.returnValue = false;
  358. var email = $('#userDetailForm input[name=email]').val();
  359. if (gagajf.isNull(email)) {
  360. mcxDialog.alertC('이메일을 입력해 주세요.', {
  361. sureBtnText: "확인",
  362. sureBtnClick: function() {
  363. $('#userDetailForm input[name=email]').focus();
  364. }
  365. });
  366. return;
  367. }
  368. mcxDialog.confirm("임시비밀번호를 발송하시겠습니까?", {
  369. cancelBtnText: "취소",
  370. sureBtnText: "확인",
  371. sureBtnClick: function() {
  372. var jsonData = JSON.stringify($('#userDetailForm').serializeObject());
  373. gagajf.ajaxJsonSubmit('/system/user/tempPassword/send', jsonData);
  374. }
  375. });
  376. });
  377. // 수정화면 권한 변경 시
  378. $('#userDetailForm select[name=roleCd]').on('change', function() {
  379. if (roleCd == $(this).val()) {
  380. $('#userDetailForm input[name=roleChangeYn]').val('N');
  381. } else {
  382. $('#userDetailForm input[name=roleChangeYn]').val('Y');
  383. }
  384. var abRoleCd = $(this).val().substring(0,6);
  385. if (abRoleCd == 'G001_A' || abRoleCd == 'G001_B') { // 입점업체
  386. $('#userDetailForm select[name=supplyCompCd]').show();
  387. $('#userDetailForm select[name=vendorId]').hide();
  388. $('#userDetailForm select[name=afLinkCd]').hide();
  389. $('#detailRoleRefVal').text('업체');
  390. } else if (abRoleCd == 'G001_C') { // 외부몰벤더
  391. $('#userDetailForm select[name=supplyCompCd]').hide();
  392. $('#userDetailForm select[name=vendorId]').show();
  393. $('#userDetailForm select[name=afLinkCd]').hide();
  394. $('#detailRoleRefVal').text('외부몰벤더');
  395. } else if (abRoleCd == 'G001_D') { // 제휴채널
  396. $('#userDetailForm select[name=supplyCompCd]').hide();
  397. $('#userDetailForm select[name=vendorId]').hide();
  398. $('#userDetailForm select[name=afLinkCd]').show();
  399. $('#detailRoleRefVal').text('제휴채널');
  400. } else {
  401. $('#userDetailForm select[name=supplyCompCd]').hide();
  402. $('#userDetailForm select[name=vendorId]').hide();
  403. $('#userDetailForm select[name=afLinkCd]').hide();
  404. $('#detailRoleRefVal').text('');
  405. }
  406. });
  407. // 초기화
  408. var fnInitialize = function(isFirst) {
  409. if (!isFirst) {
  410. $('#userDetailForm')[0].reset();
  411. }
  412. // 상세/수정 화면이면
  413. if (mode == 'U') {
  414. }
  415. }
  416. // 저장
  417. var fnSaveUser = function(formId) {
  418. // 입력 값 체크
  419. if (!gagajf.validation(formId))
  420. return false;
  421. if (mode == 'N') {
  422. if (!isUnique) {
  423. mcxDialog.alert('사용자ID를 중복체크해 주세요.');
  424. return;
  425. }
  426. if ($(formId + ' input[name=passwd]').val() != $(formId + ' input[name=passwdConfirm]').val()) {
  427. mcxDialog.alertC('비밀번호와 비밀번호확인 값이 다릅니다.', {
  428. sureBtnText: "확인",
  429. sureBtnClick: function() {
  430. $(formId + ' input[name=passwdConfirm]').focus();
  431. }
  432. });
  433. return;
  434. }
  435. }
  436. var abRoleCd = $(formId + ' select[name=roleCd]').val().substring(0,6);
  437. if (abRoleCd == 'G001_B') { // 입점업체
  438. if (gagajf.isNull($(formId + ' select[name=supplyCompCd]').val())) {
  439. mcxDialog.alertC('업체를 선택해 주세요.', {
  440. sureBtnText: "확인",
  441. sureBtnClick: function() {
  442. $(formId + ' select[name=supplyCompCd]').focus();
  443. }
  444. });
  445. return;
  446. }
  447. } else if (abRoleCd == 'G001_C') { // 외부몰벤더
  448. if (gagajf.isNull($(formId + ' select[name=vendorId]').val())) {
  449. mcxDialog.alertC('외부몰벤더를 선택해 주세요.', {
  450. sureBtnText: "확인",
  451. sureBtnClick: function() {
  452. $(formId + ' select[name=vendorId]').focus();
  453. }
  454. });
  455. return;
  456. }
  457. } else if (abRoleCd == 'G001_D') { // 제휴채널
  458. if (gagajf.isNull($(formId + ' select[name=afLinkCd]').val())) {
  459. mcxDialog.alertC('제휴채널을 선택해 주세요.', {
  460. sureBtnText: "확인",
  461. sureBtnClick: function() {
  462. $(formId + ' select[name=afLinkCd]').focus();
  463. }
  464. });
  465. return;
  466. }
  467. }
  468. if ($(formId + ' input:checkbox[name=chkIpChkYn]').is(":checked")) {
  469. if (gagajf.isNull($(formId + ' input[name=ipAddr]').val())) {
  470. mcxDialog.alertC('IP주소를 입력해 주세요.', {
  471. sureBtnText: "확인",
  472. sureBtnClick: function() {
  473. $(formId + ' input[name=ipAddr]').focus();
  474. }
  475. });
  476. return;
  477. }
  478. }
  479. mcxDialog.confirm("저장하시겠습니까?", {
  480. cancelBtnText: "취소",
  481. sureBtnText: "확인",
  482. sureBtnClick: function() {
  483. $(formId + ' input[name=ipChkYn]').val($(formId + ' input:checkbox[name=chkIpChkYn]').is(":checked") ? 'Y' : 'N');
  484. $(formId + ' input[name=maskingYn]').val($(formId + ' input:checkbox[name=chkMaskingYn]').is(":checked") ? 'Y' : 'N');
  485. $(formId + ' input[name=useYn]').val($(formId + ' input:checkbox[name=chkUseYn]').is(":checked") ? 'Y' : 'N');
  486. if (abRoleCd == 'G001_A' || abRoleCd == 'G001_B' || abRoleCd == 'G001_E') { // 자사,입점,촬영업체
  487. $(formId + ' input[name=roleRefVal]').val($(formId + ' select[name=supplyCompCd]').val());
  488. } else if (abRoleCd == 'G001_C') { // 외부몰벤더
  489. $(formId + ' input[name=roleRefVal]').val($(formId + ' select[name=vendorId]').val());
  490. } else if (abRoleCd == 'G001_D') { // 제휴채널
  491. $(formId + ' input[name=roleRefVal]').val($(formId + ' select[name=afLinkCd]').val());
  492. } else {
  493. $(formId + ' input[name=roleRefVal]').val('');
  494. }
  495. gagajf.ajaxFormSubmit($(formId).prop('action'), formId, function() {
  496. uifnPopupClose('popupUser');
  497. $('#btnSearch').trigger('click');
  498. });
  499. }
  500. });
  501. }
  502. $(document).ready(function() {
  503. // 상세/수정 화면이면
  504. if (mode == 'U') {
  505. fnInitialize(true);
  506. }
  507. });
  508. /*]]>*/
  509. </script>
  510. </html>