Browse Source

WMS재고연동여부따라 재고항목 수정가능하게 변경

eskim 4 năm trước cách đây
mục cha
commit
52ad7e6263

+ 4 - 4
src/main/webapp/WEB-INF/views/goods/GoodsDetailForm.html

@@ -1996,11 +1996,11 @@
 				return false;
 			}
 
-			//ERP재고연동여부가 'Y'일 경우 수정여부 확인
-		/* 	if ( $('#goodsDetailForm input[name=erpStockLinkYn]:checked').val() == "Y"){
+			//ERP재고연동여부가 'Y'일 경우 수정여부 확인 20210824수정
+			if ( $('#goodsDetailForm input[name=erpStockLinkYn]:checked').val() == "Y"){
 				if (Number(editCurrStockQty) != Number(currStockQty) ){
 					optCheck = true;
-					mcxDialog.alertC("ERP가용재고가 변경되었습니다.<br/>확인해주세요", {
+					mcxDialog.alertC("WMS가용재고가 변경되었습니다.<br/>확인해주세요", {
 						sureBtnText: "확인",
 						sureBtnClick: function() {
 							$("#optionList tr").find("input[name=erpStockLinkYn]").eq(idx).focus();
@@ -2008,7 +2008,7 @@
 					});
 					return false;
 				}
-			} */
+			}
 
 			// 입점만 체크
 			if ("N" == $('#goodsDetailForm input[name=selfGoodsYn]').val()){

+ 31 - 14
src/main/webapp/WEB-INF/views/goods/GoodsDetailSizeStockForm.html

@@ -39,11 +39,11 @@
 			<td class="aC">
 				<img width="60" id="defaultImg" th:src="${uploadGoodsUrl+'/'+goodsColor.sysImgNm+'?RS=60'}" th:onerror="'this.src=\''+@{${uxImgUrl}+ '/image/no.png'}+'\';'" alt="">
 				<input type="hidden" name="sysImgNmOrg" id="sysImgNmOrg" th:value="${goodsColor.sysImgNm}"/>
-			</td>	
-			<td class="aC" ><th:block th:text="${goodsColor.optCd1}">BK</th:block> 
+			</td>
+			<td class="aC" ><th:block th:text="${goodsColor.optCd1}">BK</th:block>
 				<input type="hidden" name="colorCd" id="colorCd" th:value="${goodsColor.optCd1}"/>
 			</td>
-			<td class="aC" ><th:block th:text="${goodsColor.colorEnm}">BLACK</th:block>  
+			<td class="aC" ><th:block th:text="${goodsColor.colorEnm}">BLACK</th:block>
 				<input type="hidden" name="colorNm" id="colorNm" th:value="${goodsColor.colorEnm}"/>
 			</td>
 			<td><button type="button" id="btnDefaultImg" class="btn btn-base btn-lg" onclick="fnGoodsDetailImg(this)" th:text="${#strings.isEmpty(goodsColor.sysImgNm) ?'등록':'수정'}">등록</button></td>
@@ -117,11 +117,10 @@
 				</select>
 				<input type="hidden" name="hidDispYn" th:value="${goodsSize.dispYn}"/>
 			</td>
-			<td><input type="text" class="w100p aC" name="editCurrStockQty" th:value="${goodsSize.currStockQty}" maxlength="10" data-valid-type="numeric" th:disabled="${goods.selfGoodsYn == 'Y'}"/>
+			<td><input type="text" class="w100p aC" name="editCurrStockQty" th:value="${goodsSize.currStockQty}" maxlength="10" data-valid-type="numeric" th:disabled="${goods.erpStockLinkYn == 'Y' and goods.selfGoodsYn == 'Y'}"/>  <!-- 20210824수정 -->
 				<input type="hidden" name="currStockQty" th:value="${goodsSize.currStockQty}"/>
 			</td>
-			<td><input type="text" class="w100p aC" name="editCurrStockQty" th:value="${goodsSize.storeStockQty}" maxlength="10" data-valid-type="numeric" disabled="disabled"/>
-				<input type="hidden" name="storeStockQty" th:value="${goodsSize.storeStockQty}"/>
+			<td><input type="text" class="w100p aC" name="storeStockQty" th:value="${goodsSize.storeStockQty}" maxlength="10" data-valid-type="numeric" disabled="disabled"/>
 			</td>
 			<td><input type="text" class="w100p aC"  name="baseStockQty" th:value="${goodsSize.baseStockQty}" maxlength="7" data-valid-type="integer">
 				<input type="hidden" name="hidBaseStockQty" th:value="${goodsSize.baseStockQty}"/>
@@ -134,35 +133,53 @@
 				</select>
 				<input type="hidden" name="hidSoldoutYn" th:value="${goodsSize.soldoutYn}"/>
 				<input type="hidden" name="storeMaxQty" th:value="${goodsSize.storeMaxQty}"/>
-			</td>	
+			</td>
 		</tr>
 		</th:block>
 	</table>
 <script th:inline="javascript">
 /*<![CDATA[*/
-	
+
 	var fnGoodsDetailImg = function(obj){
 		var mode= 'U';
 		var goodsCd = $('#goodsDetailForm input[name=goodsCd]').val();
 		var colorCd = $(obj).parent().parent().find("input[name=colorCd]").val();
 		var colorNm = $(obj).parent().parent().find("input[name=colorNm]").val();
-		
+
 		if (gagajf.isNull($(obj).parent().parent().find("input[name=sysImgNmOrg]").val())){
 			mode = "C";
 		}
-		
+
 		cfnOpenGoodsImagePopup(goodsCd, colorCd, colorNm, mode);
-		
+
 	}
+
+	//ERP재고연동여부 변경시 20210824수정
+	$('#goodsDetailForm input:radio[name=erpStockLinkYn]').click(function() {
+
+		if ( $('#goodsDetailForm input[name=erpStockLinkYn]:checked').val() == "Y"){
+
+			$('#goodsDetailForm input[name=editCurrStockQty]').prop("disabled", true);
+			$('#goodsDetailForm input[name=editCurrStockQty]').attr("disabled", true);
+			$('#goodsDetailForm input[name=editCurrStockQty]').addClass("formControl");
+
+		}else{
+			$('#goodsDetailForm input[name=editCurrStockQty]').prop("disabled", false);
+			$('#goodsDetailForm input[name=editCurrStockQty]').attr("disabled", false);
+			$('#goodsDetailForm input[name=editCurrStockQty]').removeClass("formControl");
+		}
+
+	});
+
 	$(document).ready(function() {
-		
+
 		//옵션/재곡 변경여부
 		$('#goodsDetailForm').find('#goodstab2').find("input, select, textarea").on('change', function() {
 			$('#goodsDetailForm').find('.tabs .tabsNav li:eq(1) a').attr("style", "color:red;");
 		});
-		
+
 	});
-	
+
 /*]]>*/
 </script>
 </html>