GoodsMassRegisterForm.html 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417
  1. <!DOCTYPE html>
  2. <html lang="ko"
  3. xmlns:th="http://www.thymeleaf.org" >
  4. <!--
  5. *******************************************************************************
  6. * @source : GoodsMassRegisterForm.html
  7. * @desc : 대량상품등록
  8. *============================================================================
  9. * STYLE24
  10. * Copyright(C) 2020 TSIT, All rights reserved.
  11. *============================================================================
  12. * VER DATE AUTHOR DESCRIPTION
  13. * === =========== ========== =============================================
  14. * 1.0 2020.11.18 eskim 최초 작성
  15. *******************************************************************************
  16. -->
  17. <div id="main">
  18. <!-- 메인타이틀 영역 -->
  19. <div class="main-title">
  20. </div>
  21. <!-- //메인타이틀 영역 -->
  22. <!-- 메뉴 설명 -->
  23. <div class="infoBox menu-desc">
  24. </div>
  25. <!-- 검색조건 영역 -->
  26. <form id="massForm" name="massForm" >
  27. <div class="panelStyle">
  28. <ul class="notice">
  29. <li>상품을 대량으로 등록하는 페이지입니다.</li>
  30. <li>상품을 등록 할 경우 [승인대기] 상태이며, STYLE 관리자의 [승인완료] 상태 변경 후 FRONT애 노출이 가능합니다.</li>
  31. <li><th:block th:if="${wmsSyncYn == 'N'}"><em><b>WMS연동여부가 [N]입니다. 관리자에게 문의하세요.</b></em></th:block></li>
  32. </ul>
  33. <ul class="panelBar">
  34. <li class="center">
  35. <!-- <th:block th:if="${sessionInfo.roleCd == 'G001_0000'
  36. or sessionInfo.roleCd == 'G001_A000'
  37. or sessionInfo.roleCd == 'G001_A001'
  38. or sessionInfo.roleCd == 'G001_A100'
  39. or sessionInfo.roleCd == 'G001_A101'
  40. }">
  41. <button type="button" class="btn btn-default btn-lg" id="btnInit" onclick="cfnDownloadSampleFile('SF001');">자사상품 등록양식 다운로드</button>
  42. <button th:if="${wmsSyncYn == 'Y'}" type="button" class="btn btn-primary btn-lg" id="btnGoodsSelfCreate" >자사상품 등록</button>
  43. </th:block>
  44. <th:block th:if="${sessionInfo.roleCd == 'G001_0000'
  45. or sessionInfo.roleCd == 'G001_A000'
  46. or sessionInfo.roleCd == 'G001_A001'
  47. or sessionInfo.roleCd == 'G001_A100'
  48. or sessionInfo.roleCd == 'G001_A101'
  49. }">
  50. <button type="button" class="btn btn-default btn-lg" id="btnInit" onclick="cfnDownloadSampleFile('SF005');">입점상품 등록양식 다운로드</button>
  51. <button th:if="${wmsSyncYn == 'Y'}" type="button" class="btn btn-primary btn-lg" id="btnGoodsCreate" >입점상품 등록</button> -->
  52. </th:block>
  53. <label class="off"><a href="javascript:void(0);" id="excelList" style="display: none;">엑셀다운로드</a></label>
  54. <!-- 추후 대량 수정 권한-->
  55. <span th:if="${sessionInfo.roleCd == 'G001_0000'
  56. or sessionInfo.roleCd == 'G001_A000'
  57. or sessionInfo.roleCd == 'G001_A001'
  58. or sessionInfo.roleCd == 'G001_A100'
  59. or sessionInfo.roleCd == 'G001_A101'
  60. }"
  61. th:style="'padding-left:80px;'">
  62. <button type="button" class="btn btn-default btn-lg" id="btnInit" onclick="cfnDownloadSampleFile('SF014');">상품대량수정 등록양식 다운로드</button>
  63. <button th:if="${wmsSyncYn == 'Y'}" type="button" class="btn btn-primary btn-lg" id="btnGoodsUpdate" >상품 수정</button>
  64. </span>
  65. </li>
  66. </ul>
  67. </div>
  68. <div class="panelStyle" >
  69. <!-- 검색조건 영역 -->
  70. <div class="panelTitle">
  71. <h3><i class="fa fa-info-circle"></i>아래 검색조건 중 하나를 꼭 입력해 주세요.</h3>
  72. </div>
  73. <div class="panelContent">
  74. <table class="frmStyle">
  75. <colgroup>
  76. <col width="10%"/>
  77. <col width="40%"/>
  78. <col width="10%"/>
  79. <col/>
  80. </colgroup>
  81. <tr>
  82. <th>상품코드<i class="star"></i></th>
  83. <td><input type="text" class="w130" name="condition" id="condition" maxlength="50"/></td>
  84. <th>등록여부</th>
  85. <td>
  86. <select name="regSuccYn" id="regSuccYn">
  87. <option value="">[전체]</option>
  88. <option th:if="${useYnList}" th:each="oneData, status : ${useYnList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
  89. </select>
  90. </td>
  91. </tr>
  92. <tr>
  93. <th>등록일<i class="star"></i></th>
  94. <td colspan="3" id="sellTerms"></td>
  95. </tr>
  96. </table>
  97. <ul class="panelBar">
  98. <li class="center">
  99. <button type="button" class="btn btn-gray btn-lg" id="btnInit" >초기화</button>
  100. <button type="button" class="btn btn-info btn-lg" id="btnSearch" >조회</button>
  101. </li>
  102. </ul>
  103. </div>
  104. <!-- //검색조건 영역 -->
  105. </div>
  106. <div class="panelStyle">
  107. <!-- 검색결과 영역 -->
  108. <!-- 상단버튼 영역 -->
  109. <ul class="panelBar">
  110. <li class="left">
  111. <!-- 아이콘 툴팁 -->
  112. <div class="iconTooltip">
  113. <i class="fa fa-info" aria-hidden="true"></i>
  114. <span class="left aL" style="width:580px;">
  115. <!-- class="left" 또는 class="right" -->
  116. <em>상품미등록</em><br/>
  117. - 상품코드 오류 : 빈값, 온라인상품코드 미존재<br/>
  118. - 업체 오류 : 빈값, 'S0001'나 'S0002' 가 아닌경우<br/>
  119. - 상품명 오류 : 빈값<br/>
  120. - 스타일 연도 오류 : 온라인에서 관리되지 않는 스타일 연도<br/>
  121. - 성별 오류 : 온라인에서 관리되지 않는 성별<br/>
  122. - 컬러 오류 : 온라인에서 관리되지 않는 컬러<br/>
  123. - 품목 오류 : 온라인에서 관리되지 않는 품목<br/>
  124. - 품목의 고시정보 없음 : 품목의 고시분류 매핑이 안되어 있는 경우<br/>
  125. </span>
  126. </div>
  127. <!-- //아이콘 툴팁 -->
  128. </li>
  129. <li class="right">
  130. <button type="button" class="btn btn-default btn-lg" id="btnGoodsRegExcelDownLoad">엑셀다운로드</button>
  131. </li>
  132. </ul>
  133. <!-- //상단버튼 영역 -->
  134. <div id="gridList" style="width: 100%; height: 500px;" class="ag-theme-balham"></div>
  135. <!-- 검색결과 영역 -->
  136. </div>
  137. <!-- //검색조건 영역 -->
  138. </form>
  139. </div>
  140. <script th:inline="javascript">
  141. /*<![CDATA[*/
  142. var niClsfCdList = gagajf.convertToArray([[${niClsfCdList}]]);
  143. var columnDefs = [
  144. {headerName: 'No', width: 60, cellClass: 'text-center', valueGetter: function(params) { return params.node.rowIndex + 1 }},
  145. {headerName: "작업일시", field: "regDt", width: 150, cellClass: 'text-center'},
  146. {headerName: "상품등록여부", field: "regSuccYn", width: 100, cellClass: 'text-center'},
  147. {headerName: "등록결과메세지", field: "regFailRsn", width: 200, cellClass: 'text-left'},
  148. {headerName: "등록브랜드코드", field: "brandCd", width: 120, cellClass: 'text-center'},
  149. {headerName: "업체코드", field: "supplyCompCd", width: 130, cellClass: 'text-center'},
  150. {headerName: "상품코드", field: "goodsCd", width: 130, cellClass: 'text-center'},
  151. {headerName: "상품명", field: "goodsNm", width: 150, cellClass: 'text-left'},
  152. {headerName: "상품타이틀", field: "goodsTnm", width: 150, cellClass: 'text-left'},
  153. {headerName: "검색어", field: "goodsSnm1", width: 150, cellClass: 'text-left'},
  154. {headerName: "제조국", field: "makeNm", width: 100, cellClass: 'text-center'},
  155. {headerName: "제조일", field: "makeYmd", width: 100, cellClass: 'text-center'},
  156. {headerName: "이지미타입", field: "imgType", width: 100, cellClass: 'text-center'},
  157. {headerName: "이미지경로1", field: "imgPath1", width: 200, cellClass: 'text-left'},
  158. {headerName: "이미지경로2", field: "imgPath2", width: 200, cellClass: 'text-left'},
  159. {headerName: "이미지경로3", field: "imgPath3", width: 200, cellClass: 'text-left'},
  160. {headerName: "이미지경로4", field: "imgPath4", width: 200, cellClass: 'text-left'},
  161. {headerName: "이미지경로5", field: "imgPath5", width: 200, cellClass: 'text-left'},
  162. {headerName: "이미지경로6", field: "imgPath6", width: 200, cellClass: 'text-left'},
  163. {headerName: "이미지경로7", field: "imgPath7", width: 200, cellClass: 'text-left'},
  164. {headerName: "이미지경로8", field: "imgPath8", width: 200, cellClass: 'text-left'},
  165. {headerName: "이미지경로9", field: "imgPath9", width: 200, cellClass: 'text-left'},
  166. {headerName: "이미지경로10", field: "imgPath10", width: 200, cellClass: 'text-left'},
  167. {headerName: "이미지경로11", field: "imgPath11", width: 200, cellClass: 'text-left'},
  168. {headerName: "이미지경로12", field: "imgPath12", width: 200, cellClass: 'text-left'},
  169. {headerName: "이미지경로13", field: "imgPath13", width: 200, cellClass: 'text-left'},
  170. {headerName: "이미지경로14", field: "imgPath14", width: 200, cellClass: 'text-left'},
  171. {headerName: "이미지경로15", field: "imgPath15", width: 200, cellClass: 'text-left'},
  172. {headerName: "이미지경로16", field: "imgPath16", width: 200, cellClass: 'text-left'},
  173. {headerName: "이미지경로17", field: "imgPath17", width: 200, cellClass: 'text-left'},
  174. {headerName: "이미지경로18", field: "imgPath18", width: 200, cellClass: 'text-left'},
  175. {headerName: "이미지경로19", field: "imgPath19", width: 200, cellClass: 'text-left'},
  176. {headerName: "이미지경로20", field: "imgPath20", width: 200, cellClass: 'text-left'},
  177. {headerName: "고시분류코드", field: "niClsfCd", width: 200, cellClass: 'text-center',
  178. cellEditorParams: { values: gagaAgGrid.extractValues(niClsfCdList) },
  179. valueFormatter: function (params) { return gagaAgGrid.lookupValue(niClsfCdList, params.value); },
  180. valueParser: function (params) { return gagaAgGrid.lookupKey(niClsfCdList, params.newValue); }
  181. },
  182. {headerName: "고시내용1", field: "niContent1", width: 200, cellClass: 'text-left'},
  183. {headerName: "고시내용2", field: "niContent2", width: 200, cellClass: 'text-left'},
  184. {headerName: "고시내용3", field: "niContent3", width: 200, cellClass: 'text-left'},
  185. {headerName: "고시내용4", field: "niContent4", width: 200, cellClass: 'text-left'},
  186. {headerName: "고시내용5", field: "niContent5", width: 200, cellClass: 'text-left'},
  187. {headerName: "고시내용6", field: "niContent6", width: 200, cellClass: 'text-left'},
  188. {headerName: "고시내용7", field: "niContent7", width: 200, cellClass: 'text-left'},
  189. {headerName: "고시내용8", field: "niContent8", width: 200, cellClass: 'text-left'},
  190. {headerName: "고시내용9", field: "niContent9", width: 200, cellClass: 'text-left'},
  191. {headerName: "고시내용10", field: "niContent10", width: 200, cellClass: 'text-left'},
  192. {headerName: "고시내용11", field: "niContent11", width: 200, cellClass: 'text-left'},
  193. {headerName: "고시내용12", field: "niContent12", width: 200, cellClass: 'text-left'},
  194. {headerName: "고시내용13", field: "niContent13", width: 200, cellClass: 'text-left'},
  195. {headerName: "고시내용14", field: "niContent14", width: 200, cellClass: 'text-left'},
  196. {headerName: "고시내용15", field: "niContent15", width: 200, cellClass: 'text-left'},
  197. {headerName: "고시내용16", field: "niContent16", width: 200, cellClass: 'text-left'},
  198. {headerName: "고시내용17", field: "niContent17", width: 200, cellClass: 'text-left'},
  199. {headerName: "고시내용18", field: "niContent18", width: 200, cellClass: 'text-left'},
  200. {headerName: "고시내용19", field: "niContent19", width: 200, cellClass: 'text-left'},
  201. {headerName: "고시내용20", field: "niContent20", width: 200, cellClass: 'text-left'},
  202. {headerName: "고시내용21", field: "niContent21", width: 200, cellClass: 'text-left'},
  203. {headerName: "고시내용22", field: "niContent22", width: 200, cellClass: 'text-left'},
  204. {headerName: "고시내용23", field: "niContent23", width: 200, cellClass: 'text-left'},
  205. {headerName: "고시내용24", field: "niContent24", width: 200, cellClass: 'text-left'},
  206. {headerName: "고시내용25", field: "niContent25", width: 200, cellClass: 'text-left'},
  207. {headerName: "고시내용26", field: "niContent26", width: 200, cellClass: 'text-left'},
  208. {headerName: "고시내용27", field: "niContent27", width: 200, cellClass: 'text-left'},
  209. {headerName: "고시내용28", field: "niContent28", width: 200, cellClass: 'text-left'},
  210. {headerName: "브랜드", field: "brandCd", width: 100, cellClass: 'text-center'},
  211. {headerName: "품목", field: "itemkindCd", width: 100, cellClass: 'text-center'},
  212. {headerName: "스타일연도", field: "styleYear", width: 100, cellClass: 'text-center'},
  213. {headerName: "시즌", field: "seasonCd", width: 80, cellClass: 'text-center'},
  214. {headerName: "성별", field: "sexGb", width: 80, cellClass: 'text-center'},
  215. {headerName: "품번", field: "goodsNum", width: 100, cellClass: 'text-center'},
  216. {headerName: "정상가", field: "listPrice", width: 100, cellClass: 'text-center'},
  217. {headerName: "판매가", field: "currPrice", width: 100, cellClass: 'text-center'},
  218. {headerName: "공급업체상품코드", field: "supplyGoodsCd", width: 130, cellClass: 'text-center'},
  219. {headerName: "정상이월", field: "formalGb", width: 100, cellClass: 'text-center'},
  220. /* {headerName: "옵션문자열", field: "optStr", width: 200, cellClass: 'text-center'},
  221. {headerName: "안전재고문자열", field: "baseStockStr", width: 200, cellClass: 'text-center'},
  222. {headerName: "현재고문자열", field: "currStockStr", width: 200, cellClass: 'text-center'}, */
  223. {headerName: "매입유형", field: "buyingType", width: 80, cellClass: 'text-center'}
  224. ];
  225. // Get GridOptions
  226. var gridOptions = gagaAgGrid.getGridOptions(columnDefs);
  227. $(document).ready(function() {
  228. cfnCreateCalendar('#sellTerms', 'stDate', 'edDate', true, '등록일', 'X');
  229. gagaAgGrid.createGrid('gridList', gridOptions);
  230. });
  231. //자사상품대량등록 클릭시
  232. $('#btnGoodsSelfCreate').on('click', function() {
  233. cfnExcelUploadPopup('createSelfGoods', 'createSelfGoods');
  234. });
  235. var createSelfGoods = function(result){
  236. var data = {procJob : result.procJob
  237. ,excelFileNm : result.excelFileNm
  238. };
  239. var jsonData = JSON.stringify(data);
  240. gagajf.ajaxJsonSubmit('/goods/mass/excelupload/create', jsonData, fnGoodsSelfCreateCallBack);
  241. }
  242. var fnGoodsSelfCreateCallBack = function(result){
  243. var date = new Date();
  244. $("#massForm input[name=stDate]").val(date.format("YYYY-MM-DD"));
  245. $("#massForm input[name=edDate]").val(date.format("YYYY-MM-DD"));
  246. fnGoodsListSearch();
  247. }
  248. //입점상품대량등록 클릭시
  249. $('#btnGoodsCreate').on('click', function() {
  250. cfnExcelUploadPopup('createGoods', 'createGoods');
  251. });
  252. var createGoods = function(result){
  253. var data = {procJob : result.procJob
  254. ,excelFileNm : result.excelFileNm
  255. };
  256. var jsonData = JSON.stringify(data);
  257. gagajf.ajaxJsonSubmit('/goods/mass/excelupload/create', jsonData, fnGoodsCreateCallBack);
  258. }
  259. var fnGoodsCreateCallBack = function(result){
  260. var date = new Date();
  261. $("#massForm input[name=stDate]").val(date.format("YYYY-MM-DD"));
  262. $("#massForm input[name=edDate]").val(date.format("YYYY-MM-DD"));
  263. fnGoodsListSearch();
  264. }
  265. //상품대량수정 클릭시
  266. $('#btnGoodsUpdate').on('click', function() {
  267. cfnExcelUploadPopup('updateGoods', 'updateGoods');
  268. });
  269. var updateGoods = function(result){
  270. var data = {procJob : result.procJob
  271. ,excelFileNm : result.excelFileNm
  272. };
  273. var jsonData = JSON.stringify(data);
  274. gagajf.ajaxJsonSubmit('/goods/mass/excelupload/update', jsonData, fnGoodsUpdateCallBack);
  275. }
  276. var fnGoodsUpdateCallBack = function(result){
  277. var date = new Date();
  278. $("#massForm input[name=stDate]").val(date.format("YYYY-MM-DD"));
  279. $("#massForm input[name=edDate]").val(date.format("YYYY-MM-DD"));
  280. fnGoodsListSearch();
  281. }
  282. $('#btnGoodsRegExcelDownLoad').on('click', function() {
  283. var date = new Date().format("YYYYMMDDHHmmss");
  284. var params = {
  285. fileName : "상품대량등록결과_"+ date,
  286. sheetName: "DATA"
  287. }
  288. gridOptions.excelStyles = [
  289. {
  290. id: 'text-center',
  291. dataType: 'string',
  292. font: {size : 10, bold: false}
  293. },
  294. {
  295. id: 'text-left',
  296. dataType: 'string',
  297. font: {size : 10, bold: false}
  298. }
  299. ]
  300. gridOptions.api.exportDataAsExcel(params);
  301. });
  302. // 초기화 클릭시
  303. $('#btnInit').on('click', function() {
  304. $('#massForm')[0].reset();
  305. });
  306. // 조회클릭시
  307. $('#btnSearch').on('click', function() {
  308. if( gagajf.isNull($("#massForm input[name=condition]").val())
  309. && gagajf.isNull($("#massForm input[name=stDate]").val())
  310. && gagajf.isNull($("#massForm input[name=edDate]").val())){
  311. mcxDialog.alertC("검색조건을 입력하세요.", {
  312. sureBtnText: "확인",
  313. sureBtnClick: function() {
  314. $('#massForm input[name=condition]').focus();
  315. }
  316. });
  317. return false;
  318. }
  319. var fromDate = $('#massForm input[name=stDate]').val();
  320. var toDate = $('#massForm input[name=edDate]').val();
  321. if (!gagajf.isNull(fromDate) || !gagajf.isNull(toDate)) {
  322. if (gagajf.isNull(fromDate) || gagajf.isNull(toDate)) {
  323. mcxDialog.alertC("등록일 조회시 시작일자와 종료일자를 입력하세요.", {
  324. sureBtnText: "확인",
  325. sureBtnClick: function() {
  326. $('#massForm input[name=stDate]').focus();
  327. }
  328. });
  329. return false;
  330. }
  331. if (fromDate > toDate) {
  332. mcxDialog.alertC("노출기간 시작일자는 종료일자 보다 클 수 없습니다.", {
  333. sureBtnText: "확인",
  334. sureBtnClick: function() {
  335. $('#massForm input[name=stDate]').focus();
  336. }
  337. });
  338. return false;
  339. }
  340. }
  341. fnGoodsListSearch();
  342. });
  343. // 조회
  344. var fnGoodsListSearch = function(gbn) {
  345. gagaAgGrid.fetch('/goods/reg/log/list', gridOptions, '#massForm');
  346. }
  347. //안내팝업
  348. var fnGoodsOpenCommentPopup = function(id) {
  349. var str = '<div class="popupWrap" id="'+id+'" style="z-index:30">';
  350. str = str + '<div class="popup modeless ui-widget-content ui-draggable ui-draggable-handle" style="display: block; position: relative;">';
  351. str = str + '<button type="button" class="close" onclick="uifnPopClose(\''+id+'\')"><i class="fa fa-times"></i></button>';
  352. str = str + '<div class="mdPopContent">';
  353. str = str + '<ul class="notice ">';
  354. str = str + '- <em>상품미등록</em>';
  355. str = str + '<li>상품코드 오류 : 빈값</li>';
  356. str = str + '<li>업체 오류 : 빈값</li>';
  357. str = str + '<li>상품명 오류 : 빈값</li>';
  358. str = str + '<li>제조국 오류 : 빈값</li>';
  359. str = str + '<li>제조년월일 오류 : 빈값, 날짜형식이 맞는지</li>';
  360. str = str + '<li>WMS 미존재 상품코드 : WMS에 상품코드가 존재하는지</li>';
  361. str = str + '<li>스타일 연도 오류 : 온라인에서 관리되지 않는 스타일 연도</li>';
  362. str = str + '<li>성별 오류 : 온라인에서 관리되지 않는 성별</li>';
  363. str = str + '<li>상품코드 중복등록요청 : 등록된 상품코드 등록요청</li>';
  364. str = str + '<li>품목 오류 : 온라인에서 관리되지 않는 품목</li>';
  365. str = str + '<li>WMS 브랜드 오류 : 온라인에서 관리되지 않는 WMS 브랜드</li>';
  366. str = str + '<li>이미지 유형 오류 : 온라인에서 관리되지 않는 이미지유형</li>';
  367. str = str + '<li>상품이미지 필수 오류 : A타입 : IMG_PATH1: 정사각형이미지(앞면),IMG_PATH3: 작사각형이미지(정면),<br/></li>';
  368. str = str + '<span style="padding-left:185px;"></span>';
  369. str = str + 'IMG_PATH4: 직사각형이미지(뒷면), IMG_PATH5: 상품상세컷(통자)';
  370. str = str + '<li>상품이미지 필수 오류 : B타입 : IMG_PATH1, IMG_PATH2</li>';
  371. str = str + '<li>품목의 고시정보 없음 : 품목의 고시분류 매핑이 안되어 있는 경우</li>';
  372. str = str + '<li>고시분류 오류 : 등록요청 고시분류 와 온라인에서 품목과 매핑된 고시분류가 다른 경우</li>';
  373. str = str + '- <em>상품등록</em>';
  374. str = str + '</ul>';
  375. str = str + '</div></div></div>';
  376. if ($('#'+ id).length == 0) {
  377. $('body').append(str);
  378. }
  379. $("#"+id).css({display:"block"});
  380. }
  381. /*]]>*/
  382. </script>
  383. </html>