Commit 9387cf79 by 杨树贤

sku展示成本价

parent eb2fbd16
......@@ -73,11 +73,25 @@
},
{field: 'stock', title: '库存数量', align: 'center', width: 80},
{
field: 'cn_price', title: 'RMB成本价(含税)', align: 'center', width: 120
field: 'cn_price', title: '国内含币价(¥)', align: 'left', width: 150, templet: function (data) {
if (data.ladder_price) {
let ladder = data.ladder_price[data.ladder_price.length - 1];
return '<div class="view_ladder_price_cn layui-row"><div class="layui-col-xs5"><span>'+ (ladder.purchases) + '+</span></div><div class="layui-col-xs7"><span>' + (ladder.price_cn) + '</span></div></div>';
}
return '';
}
},
{field: 'us_price', title: 'USD成本价(未税)', align: 'center', width: 120},
{
field: 'moq', title: '起订量', align: 'center', width: 70
field: 'us_price', title: 'USD成本价(未税)', align: 'left', width: 150, templet: function (data) {
if (data.ladder_price) {
let ladder = data.ladder_price[data.ladder_price.length - 1];
if (ladder.price_us) {
return '<div class="view_ladder_price_us layui-row""><div class="layui-col-xs5"><span>'+ (ladder.purchases) + '+</span></div><div class="layui-col-xs7"><span>$' + (ladder.price_us) + '</span></div></div>';
}
}
return '';
}
},
{field: 'mpq', title: '标准包装量', align: 'center', width: 120},
{
......@@ -428,5 +442,76 @@
});
});
//划过显示成本价格
let ladderPriceTipsVal = '';
$(document).on('mouseenter', '.view_ladder_price_cn', function () {
let self = this;
let rowIndex = $(this).parent().parent().parent().attr('data-index');
let data = table.cache['skuList'][rowIndex].ladder_price;
console.log(data)
if (!data) {
return false;
}
let htmlArr = [];
let color = 'green';
if (data.length > 0) {
htmlArr.push('<table class="layui-table table-status"><thead>' +
'<tr><th style="text-align: center">数量</th>' +
'<th style="text-align: center">国内含币价()</th>' +
'</tr></thead><tbody>')
for (let i = 0; i < data.length; i++) {
htmlArr.push(
'<tr>' +
' <td style="text-align: center">' + data[i].purchases + '+</td>' +
' <td style="text-align: center">' + (data[i].price_cn ? data[i].price_cn : '') + '</td>' +
'</tr>');
}
htmlArr.push('</tbody></table>')
ladderPriceTipsVal = layer.tips(htmlArr.join(''), self, {
tips: [3, "#009688"],
time: 1000000,
area: ['250px', 'auto'],
skin: 'custom'
});
}
}).on('mouseleave', '.view_ladder_price_cn', function () {
layer.close(ladderPriceTipsVal);
});
let ladderPriceTipsValUs = '';
$(document).on('mouseenter', '.view_ladder_price_us', function () {
let self = this;
let rowIndex = $(this).parent().parent().parent().attr('data-index');
let data = table.cache['skuList'][rowIndex].ladder_price;
console.log(data)
if (!data) {
return false;
}
let htmlArr = [];
let color = 'green';
if (data.length > 0) {
htmlArr.push('<table class="layui-table table-status"><thead>' +
'<tr><th style="text-align: center">数量</th>' +
'<th style="text-align: center">USD成本价(未税)</th>' +
'</tr></thead><tbody>')
for (let i = 0; i < data.length; i++) {
htmlArr.push(
'<tr>' +
' <td style="text-align: center">' + data[i].purchases + '+</td>' +
' <td style="text-align: center">' + (data[i].price_us ? data[i].price_us : '') + '</td>' +
'</tr>');
}
htmlArr.push('</tbody></table>')
ladderPriceTipsValUs = layer.tips(htmlArr.join(''), self, {
tips: [3, "#009688"],
time: 1000000,
area: ['250px', 'auto'],
skin: 'custom'
});
}
}).on('mouseleave', '.view_ladder_price_us', function () {
layer.close(ladderPriceTipsValUs);
});
});
</script>
\ No newline at end of file
@include('web.sku.SkuListCommon')
<style>
.custom .layui-layer-content .table-status {
position: relative;
margin: 0 !important;
z-index: 2;
}
.custom .layui-layer-content .table-status th {
white-space: nowrap;
}
.layui-layer-content {
padding: 3px 3px !important;
}
.custom .layui-layer-content .table-status td,
.custom .layui-layer-content .table-status th {
padding: 3px 3px !important;
}
</style>
<div style="margin-left: 20px;margin-right: 20px">
<div class="layui-btn-group demoTable" style="margin-top: 15px">
@if(checkPerm('TempTemp'))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment