Browse Source

세트 상품가격노출

eskim 5 năm trước cách đây
mục cha
commit
154091b8a0
1 tập tin đã thay đổi với 39 bổ sung6 xóa
  1. 39 6
      src/main/webapp/WEB-INF/views/goods/GoodsSetForm.html

+ 39 - 6
src/main/webapp/WEB-INF/views/goods/GoodsSetForm.html

@@ -14,7 +14,7 @@
  * 1.0  2020.11.04   eskim       최초 작성
  *******************************************************************************
  -->	
-	<div class="modalPopup" data-width="1100" >
+	<div class="modalPopup" data-width="1250" >
 		<div class="panelStyle">
 			<div class="panelTitle">
 				<h2>세트 상품 구성</h2>
@@ -28,7 +28,7 @@
 						<!-- 아이콘 툴팁 -->
 						<div class="iconTooltip">
 							<i class="fa fa-info" aria-hidden="true"></i>
-							<span class="left" style="width:400px; text-align:left;">
+							<span class="left" style="width:450px; text-align:left;">
 							<!-- class="left" 또는 class="right" -->
 								* 세트상품 정보<br/>
 								&nbsp;&nbsp;- 상품상태 : 정보부족<br/>
@@ -40,7 +40,7 @@
 								&nbsp;&nbsp;- 배송비정책 : 구성상품의 기준여부 'Y'상품의 브랜드 배송비정책<br/>
 								<br/>
 								* 구성상품 정보<br/>
-								&nbsp;&nbsp;- 구상상품판매가 : 구성상품의 수량만큼의 판매가 합 입력<br/>
+								&nbsp;&nbsp;- 세트구상상품판매가 : 구성상품의 세트구성수량만큼의 판매가 합 입력<br/>
 								&nbsp;&nbsp;- 구상상품의 기준상품 : 수정 불가<br/>
 							</span>
 						</div>
@@ -91,6 +91,12 @@
 							<input type="hidden" id="makeNm" name="makeNm" />
 						</td>
 					</tr>
+					<tr>
+						<th>세트상품판매가</th>
+						<td colspan="7">
+							<div id="setGoodsCurrPrice"></div>
+						</td>
+					</tr>
 				</table>
 			</div>	
 			<ul class="panelBar">
@@ -98,6 +104,7 @@
 					<button type="button" class="btn btn-danger btn-lg" onclick="fnGoodsSetDeleteRow();">행삭제</button>
 				</li>
 				<li class="right">
+					<strong class="cRed">* 세트상품의 판매가는 세트구상상품판매가의 합로 설정되므로 구성상품의 세트구성수량과 세트구성상품판매가를 꼭 확인하세요.&nbsp;&nbsp;&nbsp;</strong>
 					<button type="button" class="btn btnRight btn-base btn-lg" onclick="fnOpenGoodsSetPopup();">구상상품추가</button>
 				</li>
 			</ul>
@@ -127,10 +134,10 @@
 			}
 		},
 		{headerName: "구성상품코드", field: "compsGoodsCd" , width: 130, cellClass: 'text-center'},
-		{headerName: "구성상품명", field: "goodsNm" , width: 250, cellClass: 'text-left'},
+		{headerName: "구성상품명", field: "goodsNm" , width: 200, cellClass: 'text-left'},
 		//{headerName: "순서", field: "dispOrd" , width: 100, cellClass: 'text-center',editable: true, required: true},
-		{headerName: "수량", field: "qty" , width: 80, cellClass: 'text-right',editable: true, required: true},
-		{headerName: "상품판매가", field: "compsCurrPrice" , width: 120, cellClass: 'text-right', editable: true, required: true,
+		{headerName: "세트구성수량", field: "qty" , width: 120, cellClass: 'text-right',editable: true, required: true},
+		{headerName: "세트구성상품판매가", field: "compsCurrPrice" , width: 150, cellClass: 'text-right', editable: true, required: true,
 			cellEditor: 'textCellEditor',
 			cellEditorParams: { maxlength: 14, validType: 'numeric'}
 		},
@@ -140,6 +147,10 @@
 			valueFormatter: function (params) { return gagaAgGrid.lookupValue(useYnList, params.value); },
 			valueParser: function (params) { return gagaAgGrid.lookupKey(useYnList, params.newValue); }
 		},
+		{headerName: "상품판매가", field: "currPrice" , width: 120, cellClass: 'text-right', editable: true, required: true,
+			cellEditor: 'textCellEditor',
+			cellEditorParams: { maxlength: 14, validType: 'numeric'}
+		},
 		{headerName: "상품상태", field: "goodsStat" , width: 100, cellClass: 'text-center',
 			cellEditorParams: { values: gagaAgGrid.extractValues(goodsStatList) },
 			valueFormatter: function (params) { return gagaAgGrid.lookupValue(goodsStatList, params.value); },
@@ -168,6 +179,7 @@
 		}	
 	}
 	
+
 	// Row 
 	gridGoodsSetOptions.onCellValueChanged = function(event) {
 		var rowIdx = null;
@@ -192,6 +204,18 @@
 				}
 			}	
 		}
+		
+		if (event.colDef.field == "compsCurrPrice"){
+			var setGoodsCurrPrice = 0;
+			
+			gridGoodsSetOptions.api.forEachNode(function(rowNode, index) {
+				if (!gagajf.isNull(rowNode.data.compsCurrPrice)){
+					setGoodsCurrPrice += Number(rowNode.data.compsCurrPrice);
+				}
+			});
+			$('#goodsSetForm').find('#setGoodsCurrPrice').html(setGoodsCurrPrice.addComma());
+		}
+		
 	}
 	
 	//창종료
@@ -215,6 +239,7 @@
 		// 기존상품
 		var oldGoodsSetList = gagaAgGrid.getAllRowData(gridGoodsSetOptions);
 		var idx = oldGoodsSetList.length+1; 
+		var setGoodsCurrPrice = 0;
 		
 		var isExist = false;
 		goodsData.forEach(function(goods){
@@ -230,6 +255,11 @@
 				if (goods.supplyCompCd != rowNode.data.supplyCompCd){
 					isExist = true;
 				}
+				
+				if (!gagajf.isNull(rowNode.data.compsCurrPrice)){
+					setGoodsCurrPrice += Number(rowNode.data.compsCurrPrice);
+				}
+				 
 			});
 
 			if (goods.goodsType != "G056_N"){
@@ -246,6 +276,7 @@
 						, dispOrd: idx
 						, qty: 1
 						, compsCurrPrice: goods.currPrice
+						, currPrice: goods.currPrice
 						, baseYn: 'N'
 						, goodsStat : goods.goodsStat
 						, useYn: 'Y'
@@ -254,6 +285,7 @@
 						, supplyCompCd : goods.supplyCompCd
 						, sysImgNm : goods.sysImgNm
 						};
+				setGoodsCurrPrice += Number(goods.currPrice);
 				//그리드 마지막에 추가해야함
 				gridGoodsSetOptions.api.updateRowData({add: [data], addIndex: idx});
 				gridGoodsSetOptions.api.refreshCells();
@@ -261,6 +293,7 @@
 			
 			}
 		});
+		$('#goodsSetForm').find('#setGoodsCurrPrice').html(setGoodsCurrPrice.addComma());
 	}
 	
 	// 저장클릭시