|
@@ -856,6 +856,7 @@
|
|
<div class="sku">
|
|
<div class="sku">
|
|
<input type="hidden" name="skuId">
|
|
<input type="hidden" name="skuId">
|
|
<input type="hidden" name="organizeId">
|
|
<input type="hidden" name="organizeId">
|
|
|
|
+ <input type="hidden" name="mallProductId">
|
|
<div class="sku-item sku-unit">
|
|
<div class="sku-item sku-unit">
|
|
<span class="red">*</span>包装规格:
|
|
<span class="red">*</span>包装规格:
|
|
<input name="unit" type="text" maxlength="15" style="width: 40px" class="short required"/>
|
|
<input name="unit" type="text" maxlength="15" style="width: 40px" class="short required"/>
|
|
@@ -880,9 +881,9 @@
|
|
<span class="costFlagText">成本价</span>:
|
|
<span class="costFlagText">成本价</span>:
|
|
<input style="width: 60px" name="costPrice" type="number" maxlength="11" class="short"/> 元
|
|
<input style="width: 60px" name="costPrice" type="number" maxlength="11" class="short"/> 元
|
|
</div>
|
|
</div>
|
|
- <div class="sku-item sku-costProportional" style="display: none;">
|
|
|
|
|
|
+ <div class="sku-item sku-shopPercent" style="display: none;">
|
|
<span class="red">*</span>佣金比例:
|
|
<span class="red">*</span>佣金比例:
|
|
- 供应商:<input style="width: 50px" name="costProportional" type="number" maxlength="11" class="short"/>%
|
|
|
|
|
|
+ 供应商:<input style="width: 50px" name="shopPercent" type="number" maxlength="11" class="short"/>%
|
|
集团:<input style="width: 50px" name="organizePercent" type="number" maxlength="11" class="short"/>%
|
|
集团:<input style="width: 50px" name="organizePercent" type="number" maxlength="11" class="short"/>%
|
|
采美:<input style="width: 50px" name="cmPercent" type="number" maxlength="11" class="short"/>%
|
|
采美:<input style="width: 50px" name="cmPercent" type="number" maxlength="11" class="short"/>%
|
|
</div>
|
|
</div>
|
|
@@ -944,7 +945,6 @@
|
|
<script type="text/javascript" src="${ctxStatic}/bootstrap-select/js/bootstrap-select.js"></script>
|
|
<script type="text/javascript" src="${ctxStatic}/bootstrap-select/js/bootstrap-select.js"></script>
|
|
|
|
|
|
<script type="text/javascript">
|
|
<script type="text/javascript">
|
|
-
|
|
|
|
$('#caimei').change(function () {
|
|
$('#caimei').change(function () {
|
|
var item = $('#caimei').val()
|
|
var item = $('#caimei').val()
|
|
console.log('item---'+item)
|
|
console.log('item---'+item)
|
|
@@ -1060,10 +1060,10 @@
|
|
}
|
|
}
|
|
;
|
|
;
|
|
} else {
|
|
} else {
|
|
- var costProportional = $("#costProportional").val()
|
|
|
|
|
|
+ var shopPercent = $("#shopPercent").val()
|
|
var organizePercent = $("#organizePercent").val()
|
|
var organizePercent = $("#organizePercent").val()
|
|
var cmPercent = $("#cmPercent").val()
|
|
var cmPercent = $("#cmPercent").val()
|
|
- if ($("#costProportional").val() == '') {
|
|
|
|
|
|
+ if ($("#shopPercent").val() == '') {
|
|
alertx("请输入成本比例");
|
|
alertx("请输入成本比例");
|
|
return false;
|
|
return false;
|
|
};
|
|
};
|
|
@@ -1075,7 +1075,7 @@
|
|
alertx("请输入供应商比例");
|
|
alertx("请输入供应商比例");
|
|
return false;
|
|
return false;
|
|
};
|
|
};
|
|
- /*const num = costProportional*1 + organizePercent*1 + cmPercent*1
|
|
|
|
|
|
+ /*const num = shopPercent*1 + organizePercent*1 + cmPercent*1
|
|
if (num != 100) {
|
|
if (num != 100) {
|
|
alertx("佣金比例和需为100")
|
|
alertx("佣金比例和需为100")
|
|
return false;
|
|
return false;
|
|
@@ -1179,6 +1179,8 @@
|
|
}
|
|
}
|
|
// 初始化sku
|
|
// 初始化sku
|
|
insertDefaultSkuRow();
|
|
insertDefaultSkuRow();
|
|
|
|
+ // 初始化外部商城sku
|
|
|
|
+ insertDefaultMallSkuRow();
|
|
// 初始化关联标签库
|
|
// 初始化关联标签库
|
|
initLabelSelects();
|
|
initLabelSelects();
|
|
});
|
|
});
|
|
@@ -1971,15 +1973,27 @@
|
|
var productJson = ${productJson};
|
|
var productJson = ${productJson};
|
|
console.log("productJson",productJson);
|
|
console.log("productJson",productJson);
|
|
var skuList = productJson.skuList;
|
|
var skuList = productJson.skuList;
|
|
|
|
+ var mallSkuList = productJson.mallSkuList;
|
|
var groundMall = productJson.groundMall;
|
|
var groundMall = productJson.groundMall;
|
|
console.log("groundMall",groundMall)
|
|
console.log("groundMall",groundMall)
|
|
|
|
|
|
|
|
+ if (skuList === undefined) {
|
|
|
|
+ skuList = ""
|
|
|
|
+ }
|
|
|
|
+ if (mallSkuList === undefined) {
|
|
|
|
+ mallSkuList = ""
|
|
|
|
+ }
|
|
$(".addSku").click(function () {
|
|
$(".addSku").click(function () {
|
|
var skuTemplate = $('#skuTemplate').html()
|
|
var skuTemplate = $('#skuTemplate').html()
|
|
$("#skus").append(skuTemplate).show();
|
|
$("#skus").append(skuTemplate).show();
|
|
var current = $("#skus").find('.sku').eq(-1);
|
|
var current = $("#skus").find('.sku').eq(-1);
|
|
|
|
+ if(skuList.length>0 || mallSkuList.length >0){
|
|
|
|
+ skuIndexNum = ++skuIndex;
|
|
|
|
+ }else{
|
|
|
|
+ skuIndexNum = 0;
|
|
|
|
+ }
|
|
var product = {
|
|
var product = {
|
|
- skuIndex: ++skuIndex,
|
|
|
|
|
|
+ skuIndex: ++skuIndex-1,
|
|
costCheckFlag: '1',
|
|
costCheckFlag: '1',
|
|
ladderPriceFlag: '0'
|
|
ladderPriceFlag: '0'
|
|
}
|
|
}
|
|
@@ -1991,8 +2005,13 @@
|
|
var skuTemplate = $('#skuTemplate').html()
|
|
var skuTemplate = $('#skuTemplate').html()
|
|
$("#mallSkus").append(skuTemplate).show();
|
|
$("#mallSkus").append(skuTemplate).show();
|
|
var current = $("#mallSkus").find('.sku').eq(-1);
|
|
var current = $("#mallSkus").find('.sku').eq(-1);
|
|
|
|
+ if(skuList.length>0 || mallSkuList.length >0){
|
|
|
|
+ skuIndexNum = ++skuIndex;
|
|
|
|
+ }else{
|
|
|
|
+ skuIndexNum = 0;
|
|
|
|
+ }
|
|
var product = {
|
|
var product = {
|
|
- skuIndex: ++skuIndex,
|
|
|
|
|
|
+ skuIndex: ++skuIndex-1,
|
|
costCheckFlag: '1',
|
|
costCheckFlag: '1',
|
|
ladderPriceFlag: '0'
|
|
ladderPriceFlag: '0'
|
|
}
|
|
}
|
|
@@ -2017,6 +2036,31 @@
|
|
skuEventBind(current, product);
|
|
skuEventBind(current, product);
|
|
skuIndex = i
|
|
skuIndex = i
|
|
}
|
|
}
|
|
|
|
+ } else {
|
|
|
|
+ $("#skus").hide();
|
|
|
|
+ }
|
|
|
|
+ // else {
|
|
|
|
+ // var product = {};
|
|
|
|
+ // product.skuIndex = 0;
|
|
|
|
+ // setSkuPrototypeValues(current, product);
|
|
|
|
+ // skuEventBind(current, product);
|
|
|
|
+ // }
|
|
|
|
+ }
|
|
|
|
+ function insertDefaultMallSkuRow() {
|
|
|
|
+ console.log('mallSkuList', mallSkuList);
|
|
|
|
+ if (mallSkuList) {
|
|
|
|
+ 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];
|
|
|
|
+ product.skuIndex = i;
|
|
|
|
+ setSkuPrototypeValues(current, product, product.organizeId);
|
|
|
|
+ skuEventBind(current, product);
|
|
|
|
+ skuIndex = i
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ $("#mallSkus").hide();
|
|
}
|
|
}
|
|
// else {
|
|
// else {
|
|
// var product = {};
|
|
// var product = {};
|
|
@@ -2035,6 +2079,9 @@
|
|
var organizeId = el.find('input[name$="organizeId"]');
|
|
var organizeId = el.find('input[name$="organizeId"]');
|
|
organizeId.val(organize)
|
|
organizeId.val(organize)
|
|
organizeId.attr('name', 'skuList[' + skuIndex + '].organizeId');
|
|
organizeId.attr('name', 'skuList[' + skuIndex + '].organizeId');
|
|
|
|
+ var mallProductId = el.find('input[name$="mallProductId"]');
|
|
|
|
+ mallProductId.val(product.mallProductId)
|
|
|
|
+ mallProductId.attr('name', 'skuList[' + skuIndex + '].mallProductId');
|
|
var index = el.find('input[name$="index"]');
|
|
var index = el.find('input[name$="index"]');
|
|
index.val(skuIndex);
|
|
index.val(skuIndex);
|
|
|
|
|
|
@@ -2065,9 +2112,9 @@
|
|
costPrice.val(product.costPrice)
|
|
costPrice.val(product.costPrice)
|
|
costPrice.attr('name', 'skuList[' + skuIndex + '].costPrice');
|
|
costPrice.attr('name', 'skuList[' + skuIndex + '].costPrice');
|
|
// 比例成本百分比
|
|
// 比例成本百分比
|
|
- var costProportional = el.find('input[name$="costProportional"]');
|
|
|
|
- costProportional.val(product.costProportional)
|
|
|
|
- costProportional.attr('name', 'skuList[' + skuIndex + '].costProportional');
|
|
|
|
|
|
+ var shopPercent = el.find('input[name$="shopPercent"]');
|
|
|
|
+ shopPercent.val(product.shopPercent)
|
|
|
|
+ shopPercent.attr('name', 'skuList[' + skuIndex + '].shopPercent');
|
|
// 组织百分比
|
|
// 组织百分比
|
|
var organizePercent = el.find('input[name$="organizePercent"]');
|
|
var organizePercent = el.find('input[name$="organizePercent"]');
|
|
organizePercent.val(product.organizePercent)
|
|
organizePercent.val(product.organizePercent)
|
|
@@ -2078,11 +2125,11 @@
|
|
cmPercent.attr('name', 'skuList[' + skuIndex + '].cmPercent');
|
|
cmPercent.attr('name', 'skuList[' + skuIndex + '].cmPercent');
|
|
|
|
|
|
if (product.costCheckFlag != 1) {
|
|
if (product.costCheckFlag != 1) {
|
|
- costProportional.parent('.sku-costProportional').show();
|
|
|
|
|
|
+ shopPercent.parent('.sku-shopPercent').show();
|
|
costPrice.parent('.sku-costPrice').hide();
|
|
costPrice.parent('.sku-costPrice').hide();
|
|
} else {
|
|
} else {
|
|
costPrice.parent('.sku-costPrice').show();
|
|
costPrice.parent('.sku-costPrice').show();
|
|
- costProportional.parent('.sku-costProportional').hide();
|
|
|
|
|
|
+ shopPercent.parent('.sku-shopPercent').hide();
|
|
}
|
|
}
|
|
|
|
|
|
// 机构价
|
|
// 机构价
|
|
@@ -2152,7 +2199,7 @@
|
|
// 成本价 or 百分比
|
|
// 成本价 or 百分比
|
|
var costCheckFlag = el.find('input[name$="costCheckFlag"]');
|
|
var costCheckFlag = el.find('input[name$="costCheckFlag"]');
|
|
var costPrice = el.find('input[name$="costPrice"]');
|
|
var costPrice = el.find('input[name$="costPrice"]');
|
|
- var costProportional = el.find('input[name$="costProportional"]');
|
|
|
|
|
|
+ var shopPercent = el.find('input[name$="shopPercent"]');
|
|
var organizePercent = el.find('input[name$="organizePercent"]');
|
|
var organizePercent = el.find('input[name$="organizePercent"]');
|
|
var cmPercent = el.find('input[name$="cmPercent"]');
|
|
var cmPercent = el.find('input[name$="cmPercent"]');
|
|
// 机构价
|
|
// 机构价
|
|
@@ -2268,10 +2315,10 @@
|
|
|
|
|
|
costCheckFlag.on('change', function () {
|
|
costCheckFlag.on('change', function () {
|
|
if ($(this).val() == 1) {
|
|
if ($(this).val() == 1) {
|
|
- costProportional.parent('.sku-costProportional').hide();
|
|
|
|
|
|
+ shopPercent.parent('.sku-shopPercent').hide();
|
|
costPrice.parent('.sku-costPrice').show();
|
|
costPrice.parent('.sku-costPrice').show();
|
|
} else {
|
|
} else {
|
|
- costProportional.parent('.sku-costProportional').show();
|
|
|
|
|
|
+ shopPercent.parent('.sku-shopPercent').show();
|
|
costPrice.parent('.sku-costPrice').hide();
|
|
costPrice.parent('.sku-costPrice').hide();
|
|
}
|
|
}
|
|
})
|
|
})
|