layui.use(['table'], function () {
var table =layui.table;
var tableCol = []
var tableCol = new Array()
tableCol = [
[
{ type: 'numbers', title: '序号', align: 'center', width:4 + '%', rowspan: 2,},
{ field: 'sku_code', title: 'SKU编码', align: 'center',sort: true, width:8 + '%', rowspan: 2},
{ field: 'brand', title: '品牌', align: 'center', width:8 + '%', rowspan: 2},
{ field: 'type_name', title: '品类', sort: true, align: 'center', width:8 + '%', rowspan: 2},
{ field: 'spec_name', title: '产品型号', sort: true, align: 'center', width:8 + '%', rowspan: 2},
{ field: 'bar_code', title: '条形码', sort: true, align: 'center', width:8 + '%', rowspan: 2},
{ field: 'msr_price', title: '建议零售价', sort: true, align: 'center', width:8 + '%', rowspan: 2},
{ field: 'store_price', title: '门店标价', sort: true, align: 'center', width:8 + '%', rowspan: 2},
{ title: '变更前含税供货价', align: 'center', width:8 + '%',colspan: 2},
{ title: `变更前供货折扣<i class="layui-icon alone-tips analyseTips"></i>`, align: 'center', width:8 + '%',colspan: 2},
{ title: '含税供货价', align: 'center', width:8 + '%',colspan: 2},
{ title: `供货折扣<i class="layui-icon alone-tips analyseTips"></i>`, align: 'center', width:8 + '%',colspan: 2},
{ field: 'status', align: 'center', title: '变更类型', width:8 + '%',
templet: function(d){
return tempType(d.change_type)
},
}
],
[
{field: 'old_supply_price',title: '大货/样机', align: 'center', templet: function(d){
return '<a>'+d.old_supply_price+' / '+d.old_model_price+'</a>';
}},
{title: '', field:'', hide: true},
{field: 'old_supply_discount',title: '大货/样机', align: 'center',templet: function(d){
return '<a>'+d.old_supply_discount+' / '+d.old_model_discount+'</a>';
}},
{title: '', field:'', hide: true} ,
{field: 'supply_price',title: '大货/样机', align: 'center', templet: function(d){
return '<a>'+d.supply_price+' / '+d.model_price+'</a>';
}},
{title: '', field:'', hide: true} ,
{field: 'supply_discount',title: '大货/样机', align: 'center',templet: function(d){
return '<a>'+d.supply_discount+' / '+d.model_discount+'</a>';
}},
{title: '', field:'', hide: true}
]
]
})
对应关系
注:colspan:1会出现空白列,所以讲colspan设为2,对应中其中一项设置hide: true