|
@@ -8,12 +8,13 @@
|
|
|
<meta name="decorator" content="default"/>
|
|
|
<link type="text/css" rel="stylesheet" href="${ctxStatic}/bootstrap-select/css/bootstrap-select.css"></link>
|
|
|
<style>
|
|
|
- .sku-item-li{
|
|
|
+ .sku-item-li {
|
|
|
width: 100%;
|
|
|
height: auto;
|
|
|
float: left;
|
|
|
margin-bottom: 5px;
|
|
|
}
|
|
|
+
|
|
|
.sku {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
@@ -24,12 +25,14 @@
|
|
|
margin-top: 10px;
|
|
|
width: 1000px;
|
|
|
}
|
|
|
- .sku-item-delete{
|
|
|
+
|
|
|
+ .sku-item-delete {
|
|
|
width: 40%;
|
|
|
height: auto;
|
|
|
float: left;
|
|
|
margin-left: 10px;
|
|
|
}
|
|
|
+
|
|
|
.sku .sku-item {
|
|
|
float: left;
|
|
|
margin-right: 12px;
|
|
@@ -305,16 +308,16 @@
|
|
|
<c:if test="${not empty product.id}">
|
|
|
<li class="active"><a href="${ctx}/product/new/productEdit?id=${product.id}">商品信息编辑</a></li>
|
|
|
</c:if>
|
|
|
-<%-- <c:if test="${empty product.id}">--%>
|
|
|
-<%-- <li class="active"><a href="${ctx}/product/new/productEdit?id=${product.id}">发布特殊供应商商品</a></li>--%>
|
|
|
-<%-- </c:if>--%>
|
|
|
+ <%-- <c:if test="${empty product.id}">--%>
|
|
|
+ <%-- <li class="active"><a href="${ctx}/product/new/productEdit?id=${product.id}">发布特殊供应商商品</a></li>--%>
|
|
|
+ <%-- </c:if>--%>
|
|
|
</ul>
|
|
|
<form:form id="inputForm" modelAttribute="product"
|
|
|
action="${ctx}/product/new/productSave?searchShopID=${product.searchShopID}&searchShopName=${product.searchShopName}&searchBigTypeID=${product.searchBigTypeID}&searchSmallTypeID=${product.searchSmallTypeID}&searchTinyTypeID=${product.searchTinyTypeID}&searchValidFlag=${product.searchValidFlag}&searchActStatus=${product.searchActStatus}&searchProductType=${product.searchProductType}&searchBrandID=${product.searchBrandID}&searchPreferredFlag=${product.searchPreferredFlag}&searchProductCategory=${product.searchProductCategory}&editFlag=${product.editFlag}&shopType=${product.shopType}&ladderPriceFlag=${product.ladderPriceFlag}"
|
|
|
method="post" class="form-horizontal">
|
|
|
<form:hidden path="id"/>
|
|
|
<form:hidden path="searchName"/>
|
|
|
- <form:hidden path="shopID" id="shopId" />
|
|
|
+ <form:hidden path="shopID" id="shopId"/>
|
|
|
<sys:message content="${message}"/>
|
|
|
<table border="0" cellspacing="0" cellpadding="0" width="100%">
|
|
|
<tr>
|
|
@@ -370,7 +373,8 @@
|
|
|
</select>
|
|
|
<c:if test="${!empty product.keywords}">
|
|
|
<span style="display: inline-block; width: 120px">供应商关联标签:(${product.shopName})</span>
|
|
|
- <span><textarea rows="6" style="width: 700px; pointer-events: none">${product.keywords}</textarea></span>
|
|
|
+ <span><textarea rows="6"
|
|
|
+ style="width: 700px; pointer-events: none">${product.keywords}</textarea></span>
|
|
|
</c:if>
|
|
|
</td>
|
|
|
</tr>
|
|
@@ -612,8 +616,8 @@
|
|
|
<th><span class="red">*</span>上架平台:</th>
|
|
|
|
|
|
<td>
|
|
|
- <input id="caimei" type="checkbox" name="groundMall" value="0" >【采美】平台
|
|
|
- <input id="bcc" type="checkbox" name="groundMall" value="4" >【丽格集采联盟】平台
|
|
|
+ <input id="caimei" type="checkbox" name="groundMall" value="0">【采美】平台
|
|
|
+ <input id="bcc" type="checkbox" name="groundMall" value="4">【丽格集采联盟】平台
|
|
|
</td>
|
|
|
</tr>
|
|
|
<tr id="groundSkuCaimei">
|
|
@@ -747,8 +751,8 @@
|
|
|
<th><span class="red">*</span>能否退货:</th>
|
|
|
<td colspan="3">
|
|
|
<form:select path="returnGoodsStutas" class="input-large required" id="goods">
|
|
|
-<%-- ${product.returnGoodsStutas=="1" ? "selected" : ""}--%>
|
|
|
- <form:option value="1" label="能" />
|
|
|
+ <%-- ${product.returnGoodsStutas=="1" ? "selected" : ""}--%>
|
|
|
+ <form:option value="1" label="能"/>
|
|
|
<form:option value="2" label="不能"/>
|
|
|
</form:select>
|
|
|
</td>
|
|
@@ -839,7 +843,7 @@
|
|
|
<tr>
|
|
|
<th><span class="red">*</span>资质机构商品详情:</th>
|
|
|
<td><span style="color: red">(适用于资质机构)</span></td>
|
|
|
- <th style="position: relative ;right: 500px"><span class="red">*</span>普通机构商品详情:</th>
|
|
|
+ <th style="position: relative ;right: 500px"><span class="red">*</span>普通机构商品详情:</th>
|
|
|
<td style="position: relative ;right: 500px"><span style="color: red">(适用于游客和个人机构,可选择是否和资质机构商品详情相同,不相同的话需要编辑内容)</span>
|
|
|
<label>
|
|
|
<input type="radio"
|
|
@@ -856,7 +860,7 @@
|
|
|
</tr>
|
|
|
<tr>
|
|
|
<td colspan="2" style="vertical-align: top;">
|
|
|
- <div class="detailInfoEditor" style="width: 620px;">
|
|
|
+ <div class="detailInfoEditor" style="width: 620px;">
|
|
|
<form:textarea path="detailInfo" htmlEscape="false" class="input-xlarge required hide"/>
|
|
|
<!-- 富文本编辑器 -->
|
|
|
<div id="detailInfoEditor">${product.detailInfo}</div>
|
|
@@ -913,24 +917,30 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="sku-item-li">
|
|
|
-<%-- <div class="sku-item sku-costCheckFlag">--%>
|
|
|
-<%-- <span class="red">*</span>成本类型:--%>
|
|
|
-<%-- <label><input type="radio" name="costCheckFlag" value="1" checked/>固定成本</label>--%>
|
|
|
-<%-- <b class="line">|</b>--%>
|
|
|
-<%-- <label><input type="radio" name="costCheckFlag" value="2"/>比例成本</label>--%>
|
|
|
-<%-- </div>--%>
|
|
|
+ <%-- <div class="sku-item sku-costCheckFlag">--%>
|
|
|
+ <%-- <span class="red">*</span>成本类型:--%>
|
|
|
+ <%-- <label><input type="radio" name="costCheckFlag" value="1" checked/>固定成本</label>--%>
|
|
|
+ <%-- <b class="line">|</b>--%>
|
|
|
+ <%-- <label><input type="radio" name="costCheckFlag" value="2"/>比例成本</label>--%>
|
|
|
+ <%-- </div>--%>
|
|
|
<div class="sku-item sku-costPrice">
|
|
|
<span class="red">*</span>
|
|
|
<span class="costFlagText">成本价</span>:
|
|
|
- 供应商:<input style="width: 60px" name="costPrice" type="number" maxlength="11" class="short costPrice"/>
|
|
|
- 集团:<input style="width: 60px" name="organizeCostPrice" type="number" maxlength="11" class="short organizeCostPrice"/>
|
|
|
- 采美:<input style="width: 60px" name="cmCostPrice" type="number" maxlength="11" class="short cmCostPrice"/>
|
|
|
+ 供应商分帐:<input style="width: 60px" name="costPrice" type="number" maxlength="11" class="short costPrice"/>
|
|
|
+ 集团服务费:<input style="width: 60px" name="organizeCostPrice" type="number" maxlength="11"
|
|
|
+ class="short organizeCostPrice"/>
|
|
|
+ 采美服务费:<input style="width: 60px" name="cmCostPrice" type="number" maxlength="11"
|
|
|
+ class="short cmCostPrice"/>
|
|
|
+ <p style="color: red;display: inline-block" class="ownCostPrice">自营利润:¥ 0</p>
|
|
|
</div>
|
|
|
<div class="sku-item sku-shopPercent" style="display: none;">
|
|
|
<span class="red">*</span>佣金比例:
|
|
|
- 供应商:<input style="width: 50px" name="shopPercent" type="number" maxlength="11" class="short shopPercent"/>%
|
|
|
- 集团:<input style="width: 50px" name="organizePercent" type="number" maxlength="11" class="short organizePercent"/>%
|
|
|
- 采美:<input style="width: 50px" name="cmPercent" type="number" maxlength="11" class="short cmPercent"/>%
|
|
|
+ 供应商分帐:<input style="width: 50px" name="shopPercent" type="number" maxlength="11"
|
|
|
+ class="short shopPercent"/>%
|
|
|
+ 集团服务费:<input style="width: 50px" name="organizePercent" type="number" maxlength="11"
|
|
|
+ class="short organizePercent"/>%
|
|
|
+ 采美服务费:<input style="width: 50px" name="cmPercent" type="number" maxlength="11" class="short cmPercent"/>%
|
|
|
+ <p style="color: red;display: inline-block" class="ownPrice">自营利润:¥ 0</p>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="sku-item-li sku-item-delete">
|
|
@@ -942,7 +952,8 @@
|
|
|
<label> <input type="radio" name="ladderPriceFlag" value="1"/>使用阶梯价格</label>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="sku-item-delete"><span><button class="deleteSku" onclick="deleteDiv(this)">删除SKU</button></span></div>
|
|
|
+ <div class="sku-item-delete"><span><button class="deleteSku" onclick="deleteDiv(this)">删除SKU</button></span>
|
|
|
+ </div>
|
|
|
<div class="ladderPriceBox" style="display: none;">
|
|
|
<div class="ladderPrice">
|
|
|
起订量:
|
|
@@ -985,9 +996,9 @@
|
|
|
<script type="text/javascript">
|
|
|
$('#caimei').change(function () {
|
|
|
var item = $('#caimei').val()
|
|
|
- console.log('item---'+item)
|
|
|
+ console.log('item---' + item)
|
|
|
var check = $(this).prop('checked')
|
|
|
- console.log('check---'+check)
|
|
|
+ console.log('check---' + check)
|
|
|
if (check) {
|
|
|
$("#groundSkuCaimei").show(100)
|
|
|
} else {
|
|
@@ -997,9 +1008,9 @@
|
|
|
|
|
|
$('#bcc').change(function () {
|
|
|
var item = $('#bcc').val()
|
|
|
- console.log('item---'+item)
|
|
|
+ console.log('item---' + item)
|
|
|
var checkBcc = $(this).prop('checked')
|
|
|
- console.log('checkBcc---'+checkBcc)
|
|
|
+ console.log('checkBcc---' + checkBcc)
|
|
|
if (checkBcc) {
|
|
|
$("#groundSkuBcc").show(100)
|
|
|
} else {
|
|
@@ -1024,7 +1035,7 @@
|
|
|
// return ['三全鲜食(北新泾店)', 'Hot honey 首尔炸鸡(仙霞路)', '新旺角茶餐厅', '泷千家(天山西路店)', '胖仙女纸杯蛋糕(上海凌空店)', '贡茶', '豪大大香鸡排超级奶爸', '茶芝兰(奶茶,手抓饼)', '十二泷町', '星移浓缩咖啡', '阿姨奶茶/豪大大', '新麦甜四季甜品炸鸡', 'Monica摩托主题咖啡店', '浮生若茶(凌空soho店)', 'NONO JUICE 鲜榨果汁', 'CoCo都可(北新泾店)', '快乐柠檬(神州智慧店)', 'Merci Paul cafe', '猫山王(西郊百联店)', '枪会山', '纵食', '钱记', '壹杯加', '唦哇嘀咖', '爱茜茜里(西郊百联)', '爱茜茜里(近铁广场)', '鲜果榨汁(金沙江路和美广店)', '开心丽果(缤谷店)', '超级鸡车(丰庄路店)', '妙生活果园(北新泾店)', '香宜度麻辣香锅', '凡仔汉堡(老真北路店)', '港式小铺', '蜀香源麻辣香锅(剑河路店)', '北京饺子馆', '饭典*新简餐(凌空SOHO店)', '焦耳·川式快餐(金钟路店)', '动力鸡车', '浏阳蒸菜', '四海游龙(天山西路店)', '樱花食堂(凌空店)', '壹分米客家传统调制米粉(天山店)', '福荣祥烧腊(平溪路店)', '速记黄焖鸡米饭', '红辣椒麻辣烫', '(小杨生煎)西郊百联餐厅', '阳阳麻辣烫', '南拳妈妈龙虾盖浇饭'].filter(function (item) {
|
|
|
// return text && item.indexOf(text) > -1;
|
|
|
// });
|
|
|
- var keywordlist=new Array();
|
|
|
+ var keywordlist = new Array();
|
|
|
<c:forEach items="${SearchFrequencyVo}" var="search">
|
|
|
keywordlist.push("${search.keyword}")
|
|
|
</c:forEach>
|
|
@@ -1074,17 +1085,18 @@
|
|
|
$("#commodityDetailsFlag").prop("disabled", false);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
$('.costCheckFlag').on('change', function () {
|
|
|
var skus = $("#skus")
|
|
|
if ($(this).val() == 1) {
|
|
|
- skus.each(function() {
|
|
|
+ skus.each(function () {
|
|
|
skus.find('.sku-shopPercent').hide();
|
|
|
skus.find('.sku-costPrice').show();
|
|
|
})
|
|
|
//shopPercent.parent('.sku-shopPercent').hide();
|
|
|
//costPrice.parent('.sku-costPrice').show();
|
|
|
} else {
|
|
|
- skus.each(function() {
|
|
|
+ skus.each(function () {
|
|
|
skus.find('.sku-shopPercent').show();
|
|
|
skus.find('.sku-costPrice').hide();
|
|
|
})
|
|
@@ -1096,12 +1108,12 @@
|
|
|
console.log('333333')
|
|
|
var mallSkus = $("#mallSkus")
|
|
|
if ($(this).val() == 1) {
|
|
|
- mallSkus.each(function() {
|
|
|
+ mallSkus.each(function () {
|
|
|
mallSkus.find('.sku-shopPercent').hide(); // shopPercent.parent('.sku-shopPercent').hide();
|
|
|
mallSkus.find('.sku-costPrice').show();
|
|
|
})
|
|
|
} else {
|
|
|
- mallSkus.each(function() {
|
|
|
+ mallSkus.each(function () {
|
|
|
mallSkus.find('.sku-shopPercent').show(); // shopPercent.parent('.sku-shopPercent').hide();
|
|
|
mallSkus.find('.sku-costPrice').hide();
|
|
|
})
|
|
@@ -1163,7 +1175,7 @@
|
|
|
submitHandler: function (form) {
|
|
|
event.preventDefault()
|
|
|
var flag = true;
|
|
|
- var shopId = $("#shopId").val()*1;
|
|
|
+ var shopId = $("#shopId").val() * 1;
|
|
|
var commodityType = $("input[name='commodityType']:checked").val();
|
|
|
if (commodityType == '' || commodityType == null) {
|
|
|
alertx("请选择商品属性");
|
|
@@ -1177,132 +1189,132 @@
|
|
|
var costCheckFlag = $("input[name='costCheckFlag']:checked").val();
|
|
|
var skus = $("#skus .sku")
|
|
|
if (skus.length > 0) {
|
|
|
- skus.each(function() {
|
|
|
- var cost = $(this)
|
|
|
- if (costCheckFlag * 1 === 1) {
|
|
|
- var costPrice = cost.find(".costPrice").val()
|
|
|
- var organizeCostPrice = cost.find(".organizeCostPrice").val()
|
|
|
- var cmCostPrice = cost.find(".cmCostPrice").val()
|
|
|
- var price = cost.find(".computedPrice").val()*1
|
|
|
- if (costPrice == '') {
|
|
|
- alertx("请输入供应商成本价");
|
|
|
- flag = false;
|
|
|
- }
|
|
|
- if (organizeCostPrice == '') {
|
|
|
- alertx("请输入集团成本价");
|
|
|
- flag = false;
|
|
|
- }
|
|
|
- if (cmCostPrice == '') {
|
|
|
- alertx("请输入采美成本价");
|
|
|
- flag = false;
|
|
|
- }
|
|
|
- const num = costPrice*1 + organizeCostPrice*1 + cmCostPrice*1
|
|
|
- if (shopId != 1161 ) {
|
|
|
- if (num != price) {
|
|
|
- alertx("采美固定成本之和需为机构价")
|
|
|
+ skus.each(function () {
|
|
|
+ var cost = $(this)
|
|
|
+ if (costCheckFlag * 1 === 1) {
|
|
|
+ var costPrice = cost.find(".costPrice").val()
|
|
|
+ var organizeCostPrice = cost.find(".organizeCostPrice").val()
|
|
|
+ var cmCostPrice = cost.find(".cmCostPrice").val()
|
|
|
+ var price = cost.find(".computedPrice").val() * 1
|
|
|
+ if (costPrice == '') {
|
|
|
+ alertx("请输入供应商成本价");
|
|
|
flag = false;
|
|
|
}
|
|
|
- }else {
|
|
|
- if (num > price) {
|
|
|
- alertx("采美固定成本之和不能大于机构价")
|
|
|
+ if (organizeCostPrice == '') {
|
|
|
+ alertx("请输入集团成本价");
|
|
|
flag = false;
|
|
|
}
|
|
|
- }
|
|
|
- } else {
|
|
|
- var shopPercent = cost.find(".shopPercent").val()
|
|
|
- var organizePercent = cost.find(".organizePercent").val()
|
|
|
- var cmPercent = cost.find(".cmPercent").val()
|
|
|
- if (shopPercent == '') {
|
|
|
- alertx("请输入成本比例");
|
|
|
- flag = false;
|
|
|
- }
|
|
|
- if (organizePercent == '') {
|
|
|
- alertx("请输入集团比例");
|
|
|
- flag = false;
|
|
|
- }
|
|
|
- if (cmPercent == '') {
|
|
|
- alertx("请输入供应商比例");
|
|
|
- flag = false;
|
|
|
- }
|
|
|
- const num = shopPercent*1 + organizePercent*1 + cmPercent*1
|
|
|
- if (shopId != 1161 ) {
|
|
|
- if (num != 100) {
|
|
|
- alertx("采美佣金比例之和需为100")
|
|
|
+ if (cmCostPrice == '') {
|
|
|
+ alertx("请输入采美成本价");
|
|
|
+ flag = false;
|
|
|
+ }
|
|
|
+ const num = costPrice * 1 + organizeCostPrice * 1 + cmCostPrice * 1
|
|
|
+ // if (shopId != 1161) {
|
|
|
+ // if (num != price) {
|
|
|
+ // alertx("采美固定成本之和需为机构价")
|
|
|
+ // flag = false;
|
|
|
+ // }
|
|
|
+ // } else {
|
|
|
+ // if (num > price) {
|
|
|
+ // alertx("采美固定成本之和不能大于机构价")
|
|
|
+ // flag = false;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ } else {
|
|
|
+ var shopPercent = cost.find(".shopPercent").val()
|
|
|
+ var organizePercent = cost.find(".organizePercent").val()
|
|
|
+ var cmPercent = cost.find(".cmPercent").val()
|
|
|
+ if (shopPercent == '') {
|
|
|
+ alertx("请输入成本比例");
|
|
|
flag = false;
|
|
|
}
|
|
|
- }else {
|
|
|
- if (num > 100) {
|
|
|
- alertx("采美佣金比例之和不能大于100")
|
|
|
+ if (organizePercent == '') {
|
|
|
+ alertx("请输入集团比例");
|
|
|
flag = false;
|
|
|
}
|
|
|
+ if (cmPercent == '') {
|
|
|
+ alertx("请输入供应商比例");
|
|
|
+ flag = false;
|
|
|
+ }
|
|
|
+ const num = shopPercent * 1 + organizePercent * 1 + cmPercent * 1
|
|
|
+ // if (shopId != 1161) {
|
|
|
+ // if (num != 100) {
|
|
|
+ // alertx("采美佣金比例之和需为100")
|
|
|
+ // flag = false;
|
|
|
+ // }
|
|
|
+ // } else {
|
|
|
+ // if (num > 100) {
|
|
|
+ // alertx("采美佣金比例之和不能大于100")
|
|
|
+ // flag = false;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
}
|
|
|
- }
|
|
|
- })
|
|
|
+ })
|
|
|
}
|
|
|
var mallCostCheckFlag = $("input[name='mallCostCheckFlag']:checked").val();
|
|
|
var mallSkus = $("#mallSkus .sku")
|
|
|
if (mallSkus.length > 0) {
|
|
|
- mallSkus.each(function() {
|
|
|
- var mallCost = $(this)
|
|
|
- if (mallCostCheckFlag * 1 === 1) {
|
|
|
- var mallCostPrice = mallCost.find(".costPrice").val()
|
|
|
- var mallOrganizeCostPrice = mallCost.find(".organizeCostPrice").val()
|
|
|
- var mallCmCostPrice = mallCost.find(".cmCostPrice").val()
|
|
|
- var mallprice = mallCost.find(".computedPrice").val()*1
|
|
|
- if (mallCostPrice == '') {
|
|
|
- alertx("请输入供应商成本价");
|
|
|
- flag = false;
|
|
|
- }
|
|
|
- if (mallOrganizeCostPrice == '') {
|
|
|
- alertx("请输入集团成本价");
|
|
|
- flag = false;
|
|
|
- }
|
|
|
- if (mallCmCostPrice == '') {
|
|
|
- alertx("请输入采美成本价");
|
|
|
- flag = false;
|
|
|
- }
|
|
|
- const num = mallCostPrice*1 + mallOrganizeCostPrice*1 + mallCmCostPrice*1
|
|
|
- if (shopId != 1161 ) {
|
|
|
- if (num != mallprice) {
|
|
|
- alertx("丽格固定成本之和需为机构价");
|
|
|
+ mallSkus.each(function () {
|
|
|
+ var mallCost = $(this)
|
|
|
+ if (mallCostCheckFlag * 1 === 1) {
|
|
|
+ var mallCostPrice = mallCost.find(".costPrice").val()
|
|
|
+ var mallOrganizeCostPrice = mallCost.find(".organizeCostPrice").val()
|
|
|
+ var mallCmCostPrice = mallCost.find(".cmCostPrice").val()
|
|
|
+ var mallprice = mallCost.find(".computedPrice").val() * 1
|
|
|
+ if (mallCostPrice == '') {
|
|
|
+ alertx("请输入供应商成本价");
|
|
|
flag = false;
|
|
|
}
|
|
|
- } else {
|
|
|
- if (num > mallprice) {
|
|
|
- alertx("丽格固定成本之和不能大于机构价")
|
|
|
+ if (mallOrganizeCostPrice == '') {
|
|
|
+ alertx("请输入集团成本价");
|
|
|
flag = false;
|
|
|
}
|
|
|
- }
|
|
|
- } else {
|
|
|
- var mallShopPercent = mallCost.find(".shopPercent").val()
|
|
|
- var mallOrganizePercent = mallCost.find(".organizePercent").val()
|
|
|
- var mallCmPercent = mallCost.find(".cmPercent").val()
|
|
|
- if (mallShopPercent == '') {
|
|
|
- alertx("请输入成本比例");
|
|
|
- flag = false;
|
|
|
- }
|
|
|
- if (mallOrganizePercent == '') {
|
|
|
- alertx("请输入集团比例");
|
|
|
- flag = false;
|
|
|
- }
|
|
|
- if (mallCmPercent == '') {
|
|
|
- alertx("请输入供应商比例");
|
|
|
- flag = false;
|
|
|
- }
|
|
|
- const num = mallShopPercent*1 + mallOrganizePercent*1 + mallCmPercent*1
|
|
|
- if (shopId != 1161 ) {
|
|
|
- if (num != 100) {
|
|
|
- alertx("丽格佣金比例之和需为100");
|
|
|
+ if (mallCmCostPrice == '') {
|
|
|
+ alertx("请输入采美成本价");
|
|
|
flag = false;
|
|
|
}
|
|
|
+ const num = mallCostPrice * 1 + mallOrganizeCostPrice * 1 + mallCmCostPrice * 1
|
|
|
+ if (shopId != 1161) {
|
|
|
+ if (num != mallprice) {
|
|
|
+ alertx("丽格固定成本之和需为机构价");
|
|
|
+ flag = false;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (num > mallprice) {
|
|
|
+ alertx("丽格固定成本之和不能大于机构价")
|
|
|
+ flag = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
} else {
|
|
|
- if (num > 100) {
|
|
|
- alertx("丽格佣金比例之和不能大于100")
|
|
|
+ var mallShopPercent = mallCost.find(".shopPercent").val()
|
|
|
+ var mallOrganizePercent = mallCost.find(".organizePercent").val()
|
|
|
+ var mallCmPercent = mallCost.find(".cmPercent").val()
|
|
|
+ if (mallShopPercent == '') {
|
|
|
+ alertx("请输入成本比例");
|
|
|
+ flag = false;
|
|
|
+ }
|
|
|
+ if (mallOrganizePercent == '') {
|
|
|
+ alertx("请输入集团比例");
|
|
|
flag = false;
|
|
|
}
|
|
|
+ if (mallCmPercent == '') {
|
|
|
+ alertx("请输入供应商比例");
|
|
|
+ flag = false;
|
|
|
+ }
|
|
|
+ const num = mallShopPercent * 1 + mallOrganizePercent * 1 + mallCmPercent * 1
|
|
|
+ if (shopId != 1161) {
|
|
|
+ if (num != 100) {
|
|
|
+ alertx("丽格佣金比例之和需为100");
|
|
|
+ flag = false;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (num > 100) {
|
|
|
+ alertx("丽格佣金比例之和不能大于100")
|
|
|
+ flag = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- })
|
|
|
+ })
|
|
|
}
|
|
|
if ($('#minBuyNumber:visible').length > 0) {
|
|
|
var minBuyNumber = $('#minBuyNumber').val();
|
|
@@ -1361,10 +1373,10 @@
|
|
|
if (includedTax != ${product.includedTax} || invoiceType != ${product.invoiceType}) {
|
|
|
top.$.jBox.confirm("目前含税信息为:${product.includedTax eq 0?'不含税':product.includedTax eq 1?'含税':'未知'}${product.includedTax eq 2?'':product.invoiceType eq 1?'-开增值税专用发票':product.invoiceType eq 2?'-开增值税普通发票':'不开发票'},确定修改为:" + (includedTax == 0 ? '不含税' : includedTax == 1 ? '含税' : '未知') + (includedTax == 2 ? '' : invoiceType == 1 ? '-开增值税专用发票' : invoiceType == 2 ? '-开增值税普通发票' : '-不能开票') + "吗?", '保存商品提示', function (v, h, f) {
|
|
|
if (v == 'ok') {
|
|
|
- if(!$('#caimei').prop('checked')){
|
|
|
+ if (!$('#caimei').prop('checked')) {
|
|
|
$("#groundSkuCaimei").remove()
|
|
|
}
|
|
|
- if(!$('#bcc').prop('checked')){
|
|
|
+ if (!$('#bcc').prop('checked')) {
|
|
|
$("#groundSkuBcc").remove()
|
|
|
}
|
|
|
// 提交订单
|
|
@@ -1381,10 +1393,10 @@
|
|
|
}
|
|
|
});
|
|
|
} else {
|
|
|
- if(!$('#caimei').prop('checked')){
|
|
|
+ if (!$('#caimei').prop('checked')) {
|
|
|
$("#groundSkuCaimei").remove()
|
|
|
}
|
|
|
- if(!$('#bcc').prop('checked')){
|
|
|
+ if (!$('#bcc').prop('checked')) {
|
|
|
$("#groundSkuBcc").remove()
|
|
|
}
|
|
|
if (flag) {
|
|
@@ -1405,13 +1417,13 @@
|
|
|
});
|
|
|
// 初始化上平台sku显示
|
|
|
if (-1 != groundMall.indexOf("0")) {
|
|
|
- $('#caimei').attr('checked',true)
|
|
|
+ $('#caimei').attr('checked', true)
|
|
|
$('#groundSkuCaimei').show(100)
|
|
|
} else {
|
|
|
$('#groundSkuCaimei').hide(100)
|
|
|
}
|
|
|
if (-1 != groundMall.indexOf("4")) {
|
|
|
- $('#bcc').attr('checked',true)
|
|
|
+ $('#bcc').attr('checked', true)
|
|
|
$('#groundSkuBcc').show(100)
|
|
|
} else {
|
|
|
$('#groundSkuBcc').hide(100)
|
|
@@ -1424,7 +1436,7 @@
|
|
|
initLabelSelects();
|
|
|
});
|
|
|
|
|
|
- function initLabelSelects(){
|
|
|
+ function initLabelSelects() {
|
|
|
var labelSelectBox = $('#labelSelectBox');
|
|
|
labelSelectBox.selectpicker({
|
|
|
liveSearch: true,
|
|
@@ -1434,11 +1446,12 @@
|
|
|
});
|
|
|
// 回显操作
|
|
|
var str = '${product.labelIds}';
|
|
|
- if(!str) return;
|
|
|
+ if (!str) return;
|
|
|
var arr = str.split(',');
|
|
|
console.log(arr);
|
|
|
labelSelectBox.selectpicker('val', arr);
|
|
|
}
|
|
|
+
|
|
|
<%--// 商品可见度--%>
|
|
|
<%--/*$(function() {--%>
|
|
|
<%-- var initValue = ${(product.visibility <= 0) ? 3 : ((product.visibility >= 3) ? 3 : product.visibility)}--%>
|
|
@@ -1968,8 +1981,10 @@
|
|
|
loadSmallType();
|
|
|
trainingShow();
|
|
|
}
|
|
|
- var conn=0;
|
|
|
- var insertStatus='${product.insertStatus}';
|
|
|
+
|
|
|
+ var conn = 0;
|
|
|
+ var insertStatus = '${product.insertStatus}';
|
|
|
+
|
|
|
function loadSmallType(id) {
|
|
|
if (id) {
|
|
|
$("#bigType").val(id);
|
|
@@ -2011,11 +2026,11 @@
|
|
|
document.getElementById("s2id_smallType").style.cssText = "display: none";
|
|
|
}
|
|
|
loadTinyType();
|
|
|
- if(insertStatus==1){
|
|
|
- conn=1;
|
|
|
+ if (insertStatus == 1) {
|
|
|
+ conn = 1;
|
|
|
loadGoods(conn);
|
|
|
insertStatus++;
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
loadGoods(conn);
|
|
|
}
|
|
|
}
|
|
@@ -2054,47 +2069,49 @@
|
|
|
$("#tinyType").removeClass("required");
|
|
|
}
|
|
|
}
|
|
|
- function loadGoods(id){
|
|
|
- var bigType=null;
|
|
|
- if(id==1){
|
|
|
- if(typeof (bigType) != "undefined" && bigType != ""){
|
|
|
- bigType='${product.returnGoodsStutas}'
|
|
|
- $("#goods").html("");
|
|
|
- $("#goods").prev().find(".select2-chosen").text("请选择");
|
|
|
- $("#goods").append("<option value=''>请选择</option>");
|
|
|
- var not='不能';
|
|
|
- var ye='能';
|
|
|
- if(bigType=='2'){
|
|
|
- $("#goods").append("<option value='1'>" + '能' + "</option>");
|
|
|
- $("#goods").append("<option selected value='2'>" + not + "</option>");
|
|
|
- $("#goods").prev().find(".select2-chosen").text(not);
|
|
|
- }else{
|
|
|
- $("#goods").append("<option selected value='1'>" + ye + "</option>");
|
|
|
- $("#goods").append("<option value='2'>" + '不能' + "</option>");
|
|
|
- $("#goods").prev().find(".select2-chosen").text(ye);
|
|
|
- }
|
|
|
+
|
|
|
+ function loadGoods(id) {
|
|
|
+ var bigType = null;
|
|
|
+ if (id == 1) {
|
|
|
+ if (typeof (bigType) != "undefined" && bigType != "") {
|
|
|
+ bigType = '${product.returnGoodsStutas}'
|
|
|
+ $("#goods").html("");
|
|
|
+ $("#goods").prev().find(".select2-chosen").text("请选择");
|
|
|
+ $("#goods").append("<option value=''>请选择</option>");
|
|
|
+ var not = '不能';
|
|
|
+ var ye = '能';
|
|
|
+ if (bigType == '2') {
|
|
|
+ $("#goods").append("<option value='1'>" + '能' + "</option>");
|
|
|
+ $("#goods").append("<option selected value='2'>" + not + "</option>");
|
|
|
+ $("#goods").prev().find(".select2-chosen").text(not);
|
|
|
+ } else {
|
|
|
+ $("#goods").append("<option selected value='1'>" + ye + "</option>");
|
|
|
+ $("#goods").append("<option value='2'>" + '不能' + "</option>");
|
|
|
+ $("#goods").prev().find(".select2-chosen").text(ye);
|
|
|
}
|
|
|
- }else{
|
|
|
- if(typeof (bigType) != "undefined" && bigType != ""){
|
|
|
- bigType = $("#bigType").val();
|
|
|
- $("#goods").html("");
|
|
|
- $("#goods").prev().find(".select2-chosen").text("请选择");
|
|
|
- $("#goods").append("<option value=''>请选择</option>");
|
|
|
- var not='不能';
|
|
|
- var ye='能';
|
|
|
- if(bigType=='1014'||bigType=='1016'||bigType=='1021'||bigType=='1023'){
|
|
|
- $("#goods").append("<option value='1'>" + '能' + "</option>");
|
|
|
- $("#goods").append("<option selected value='2'>" + not + "</option>");
|
|
|
- $("#goods").prev().find(".select2-chosen").text(not);
|
|
|
- }else{
|
|
|
- $("#goods").append("<option selected value='1'>" + ye + "</option>");
|
|
|
- $("#goods").append("<option value='2'>" + '不能' + "</option>");
|
|
|
- $("#goods").prev().find(".select2-chosen").text(ye);
|
|
|
- }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (typeof (bigType) != "undefined" && bigType != "") {
|
|
|
+ bigType = $("#bigType").val();
|
|
|
+ $("#goods").html("");
|
|
|
+ $("#goods").prev().find(".select2-chosen").text("请选择");
|
|
|
+ $("#goods").append("<option value=''>请选择</option>");
|
|
|
+ var not = '不能';
|
|
|
+ var ye = '能';
|
|
|
+ if (bigType == '1014' || bigType == '1016' || bigType == '1021' || bigType == '1023') {
|
|
|
+ $("#goods").append("<option value='1'>" + '能' + "</option>");
|
|
|
+ $("#goods").append("<option selected value='2'>" + not + "</option>");
|
|
|
+ $("#goods").prev().find(".select2-chosen").text(not);
|
|
|
+ } else {
|
|
|
+ $("#goods").append("<option selected value='1'>" + ye + "</option>");
|
|
|
+ $("#goods").append("<option value='2'>" + '不能' + "</option>");
|
|
|
+ $("#goods").prev().find(".select2-chosen").text(ye);
|
|
|
}
|
|
|
}
|
|
|
- conn++;
|
|
|
+ }
|
|
|
+ conn++;
|
|
|
}
|
|
|
+
|
|
|
<%--window.onload=function () {--%>
|
|
|
<%-- console.log('-----------------------onload')--%>
|
|
|
<%-- $("#goods").val('${product.returnGoodsStutas}')--%>
|
|
@@ -2168,11 +2185,11 @@
|
|
|
|
|
|
var skuIndex = 0;
|
|
|
var productJson = ${productJson};
|
|
|
- console.log("productJson",productJson);
|
|
|
+ console.log("productJson", productJson);
|
|
|
var skuList = productJson.skuList;
|
|
|
var mallSkuList = productJson.mallSkuList;
|
|
|
var groundMall = productJson.groundMall;
|
|
|
- console.log("groundMall",groundMall)
|
|
|
+ console.log("groundMall", groundMall)
|
|
|
|
|
|
if (skuList === undefined) {
|
|
|
skuList = ""
|
|
@@ -2185,13 +2202,13 @@
|
|
|
var costCheckFlag = $("input[name='costCheckFlag']:checked").val();
|
|
|
$("#skus").append(skuTemplate).show();
|
|
|
var current = $("#skus").find('.sku').eq(-1);
|
|
|
- if(skuList.length>0 || mallSkuList.length >0){
|
|
|
+ if (skuList.length > 0 || mallSkuList.length > 0) {
|
|
|
skuIndexNum = ++skuIndex;
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
skuIndexNum = 0;
|
|
|
}
|
|
|
var product = {
|
|
|
- skuIndex: ++skuIndex-1,
|
|
|
+ skuIndex: ++skuIndex - 1,
|
|
|
costCheckFlag: costCheckFlag,
|
|
|
ladderPriceFlag: '0'
|
|
|
}
|
|
@@ -2204,13 +2221,13 @@
|
|
|
var mallCostCheckFlag = $("input[name='mallCostCheckFlag']:checked").val();
|
|
|
$("#mallSkus").append(skuTemplate).show();
|
|
|
var current = $("#mallSkus").find('.sku').eq(-1);
|
|
|
- if(skuList.length>0 || mallSkuList.length >0){
|
|
|
+ if (skuList.length > 0 || mallSkuList.length > 0) {
|
|
|
skuIndexNum = ++skuIndex;
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
skuIndexNum = 0;
|
|
|
}
|
|
|
var product = {
|
|
|
- skuIndex: ++skuIndex-1,
|
|
|
+ skuIndex: ++skuIndex - 1,
|
|
|
costCheckFlag: mallCostCheckFlag,
|
|
|
ladderPriceFlag: '0'
|
|
|
}
|
|
@@ -2218,7 +2235,7 @@
|
|
|
skuEventBind(current, product);
|
|
|
})
|
|
|
|
|
|
- function deleteDiv(el){
|
|
|
+ function deleteDiv(el) {
|
|
|
el.parentNode.parentNode.parentNode.parentNode.removeChild(el.parentNode.parentNode.parentNode);
|
|
|
}
|
|
|
|
|
@@ -2245,14 +2262,15 @@
|
|
|
// skuEventBind(current, product);
|
|
|
// }
|
|
|
}
|
|
|
+
|
|
|
function insertDefaultMallSkuRow() {
|
|
|
console.log('mallSkuList', mallSkuList);
|
|
|
if (mallSkuList) {
|
|
|
- for (var i = skuList.length; i < mallSkuList.length+skuList.length; i++) {
|
|
|
+ for (var i = skuList.length; i < mallSkuList.length + skuList.length; i++) {
|
|
|
var skuTemplate = $('#skuTemplate').html();
|
|
|
$("#mallSkus").append(skuTemplate).show();
|
|
|
var current = $("#mallSkus").find('.sku').eq(-1);
|
|
|
- var product = mallSkuList[i-skuList.length];
|
|
|
+ var product = mallSkuList[i - skuList.length];
|
|
|
product.skuIndex = i;
|
|
|
setSkuPrototypeValues(current, product, product.organizeId);
|
|
|
skuEventBind(current, product);
|
|
@@ -2272,7 +2290,7 @@
|
|
|
|
|
|
/* 设置新增sku属性值 */
|
|
|
function setSkuPrototypeValues(el, product, organize) {
|
|
|
- console.log(product);
|
|
|
+ console.log("prodcut-------------->" + product);
|
|
|
if (!product) return;
|
|
|
var skuIndex = product.skuIndex;
|
|
|
var organizeId = el.find('input[name$="organizeId"]');
|
|
@@ -2284,8 +2302,8 @@
|
|
|
var index = el.find('input[name$="index"]');
|
|
|
index.val(skuIndex);
|
|
|
|
|
|
- if(product.skuId){
|
|
|
- var skuId=el.find('input[name$="skuId"]');
|
|
|
+ if (product.skuId) {
|
|
|
+ var skuId = el.find('input[name$="skuId"]');
|
|
|
skuId.val(product.skuId);
|
|
|
skuId.attr('name', 'skuList[' + skuIndex + '].skuId');
|
|
|
}
|
|
@@ -2380,7 +2398,7 @@
|
|
|
buyNum.attr('name', 'skuList[' + skuIndex + '].ladderPriceList[' + index + '].buyNum');
|
|
|
|
|
|
console.log('buyNum---', ladderPrice.buyNum)
|
|
|
- if(ladderPrice.buyNum!=null){
|
|
|
+ if (ladderPrice.buyNum != null) {
|
|
|
$(this).show()
|
|
|
}
|
|
|
// 价格
|
|
@@ -2397,6 +2415,16 @@
|
|
|
delFlag.attr('name', 'skuList[' + skuIndex + '].ladderPriceList[' + index + '].delFlag');
|
|
|
});
|
|
|
|
|
|
+ var ownPrice = el.find('p[class$="ownPrice"]');
|
|
|
+ var ownCostPrice = el.find('p[class$="ownCostPrice"]');
|
|
|
+ ownPrice.attr('ckass', 'skuList[' + skuIndex + '].ownPrice');
|
|
|
+ ownCostPrice.attr('class', 'skuList[' + skuIndex + '].ownCostPrice');
|
|
|
+ // 固定成本 机构价 - 供应商 - 集团服务费 - 采美服务费
|
|
|
+ var owp = price.val() - costPrice.val() - organizeCostPrice.val() - cmCostPrice.val();
|
|
|
+ ownCostPrice.val("自营利润:¥ " + owp);
|
|
|
+ // 比例
|
|
|
+ var owpi = price.val() - price.val() * shopPercent.val() / 100 - price.val() * organizePercent.val() / 100 - price.val() * cmPercent.val() / 100;
|
|
|
+ ownPrice.val("自营利润:¥ " + owpi);
|
|
|
skuIndex++;
|
|
|
}
|
|
|
|
|
@@ -2506,7 +2534,7 @@
|
|
|
$(this).parent('.ladderPrice').prev().find('.delBtn').show();
|
|
|
})
|
|
|
|
|
|
- if(product.ladderPriceFlag == 1){
|
|
|
+ if (product.ladderPriceFlag == 1) {
|
|
|
ladderPriceBox.find('.ladderPrice').each(function (index, item) {
|
|
|
var ladderPrice = product.ladderPriceList[index]
|
|
|
var delFlag = 1
|
|
@@ -2533,6 +2561,68 @@
|
|
|
costPrice.parent('.sku-costPrice').hide();
|
|
|
}
|
|
|
})
|
|
|
+
|
|
|
+ var ownPrice = el.find('p[class$="ownPrice"]');
|
|
|
+ var ownCostPrice = el.find('p[class$="ownCostPrice"]');
|
|
|
+ var price = el.find('input[name$="price"]');
|
|
|
+ var organizeCostPrice = el.find('input[name$="organizeCostPrice"]');
|
|
|
+ var cmCostPrice = el.find('input[name$="cmCostPrice"]');
|
|
|
+ costPrice.on('change', function () {
|
|
|
+ // 固定成本 机构价 - 供应商 - 集团服务费 - 采美服务费
|
|
|
+ var owp = price.val() - costPrice.val() - organizeCostPrice.val() - cmCostPrice.val();
|
|
|
+ ownCostPrice.text("自营利润:¥ " + owp);
|
|
|
+ // 比例
|
|
|
+ var owpi = price.val() - price.val() * shopPercent.val() / 100 - price.val() * organizePercent.val() / 100 - price.val() * cmPercent.val() / 100;
|
|
|
+ ownPrice.text("自营利润:¥ " + owpi);
|
|
|
+ });
|
|
|
+ organizeCostPrice.on('change', function () {
|
|
|
+ // 固定成本 机构价 - 供应商 - 集团服务费 - 采美服务费
|
|
|
+ var owp = price.val() - costPrice.val() - organizeCostPrice.val() - cmCostPrice.val();
|
|
|
+ ownCostPrice.text("自营利润:¥ " + owp);
|
|
|
+ // 比例
|
|
|
+ var owpi = price.val() - price.val() * shopPercent.val() / 100 - price.val() * organizePercent.val() / 100 - price.val() * cmPercent.val() / 100;
|
|
|
+ ownPrice.text("自营利润:¥ " + owpi);
|
|
|
+ });
|
|
|
+ cmCostPrice.on('change', function () {
|
|
|
+ // 固定成本 机构价 - 供应商 - 集团服务费 - 采美服务费
|
|
|
+ var owp = price.val() - costPrice.val() - organizeCostPrice.val() - cmCostPrice.val();
|
|
|
+ ownCostPrice.text("自营利润:¥ " + owp);
|
|
|
+ // 比例
|
|
|
+ var owpi = price.val() - price.val() * shopPercent.val() / 100 - price.val() * organizePercent.val() / 100 - price.val() * cmPercent.val() / 100;
|
|
|
+ ownPrice.text("自营利润:¥ " + owpi);
|
|
|
+ });
|
|
|
+ price.on('change', function () {
|
|
|
+ // 固定成本 机构价 - 供应商 - 集团服务费 - 采美服务费
|
|
|
+ var owp = price.val() - costPrice.val() - organizeCostPrice.val() - cmCostPrice.val();
|
|
|
+ ownCostPrice.text("自营利润:¥ " + owp);
|
|
|
+ // 比例
|
|
|
+ var owpi = price.val() - price.val() * shopPercent.val() / 100 - price.val() * organizePercent.val() / 100 - price.val() * cmPercent.val() / 100;
|
|
|
+ ownPrice.text("自营利润:¥ " + owpi);
|
|
|
+ });
|
|
|
+ shopPercent.on('change', function () {
|
|
|
+ // 固定成本 机构价 - 供应商 - 集团服务费 - 采美服务费
|
|
|
+ var owp = price.val() - costPrice.val() - organizeCostPrice.val() - cmCostPrice.val();
|
|
|
+ ownCostPrice.text("自营利润:¥ " + owp);
|
|
|
+ // 比例
|
|
|
+ var owpi = price.val() - price.val() * shopPercent.val() / 100 - price.val() * organizePercent.val() / 100 - price.val() * cmPercent.val() / 100;
|
|
|
+ ownPrice.text("自营利润:¥ " + owpi);
|
|
|
+ });
|
|
|
+ organizePercent.on('change', function () {
|
|
|
+ // 固定成本 机构价 - 供应商 - 集团服务费 - 采美服务费
|
|
|
+ var owp = price.val() - costPrice.val() - organizeCostPrice.val() - cmCostPrice.val();
|
|
|
+ ownCostPrice.text("自营利润:¥ " + owp);
|
|
|
+ // 比例
|
|
|
+ var owpi = price.val() - price.val() * shopPercent.val() / 100 - price.val() * organizePercent.val() / 100 - price.val() * cmPercent.val() / 100;
|
|
|
+ ownPrice.text("自营利润:¥ " + owpi);
|
|
|
+ });
|
|
|
+ cmPercent.on('change', function () {
|
|
|
+ // 固定成本 机构价 - 供应商 - 集团服务费 - 采美服务费
|
|
|
+ var owp = price.val() - costPrice.val() - organizeCostPrice.val() - cmCostPrice.val();
|
|
|
+ ownCostPrice.text("自营利润:¥ " + owp);
|
|
|
+ // 比例
|
|
|
+ var owpi = price.val() - price.val() * shopPercent.val() / 100 - price.val() * organizePercent.val() / 100 - price.val() * cmPercent.val() / 100;
|
|
|
+ ownPrice.text("自营利润:¥ " + owpi);
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
|