|
@@ -168,9 +168,9 @@
|
|
|
title:'委托单位名称',
|
|
|
align:"center",
|
|
|
dataIndex: 'weituoClient',
|
|
|
- // customRender:function (t,r,index) {
|
|
|
- // return {children: t,attrs: {rowSpan:r.rowSpan}};
|
|
|
- // },
|
|
|
+ customRender:function (t,r,index) {
|
|
|
+ return {children: t,attrs: {rowSpan:r.rowSpan}};
|
|
|
+ },
|
|
|
// customRender: (value, row, index) => {
|
|
|
// console.log(value, row, index);
|
|
|
// const obj = {
|
|
@@ -189,7 +189,10 @@
|
|
|
{
|
|
|
title:'样品名称',
|
|
|
align:"center",
|
|
|
- dataIndex: 'sampleName'
|
|
|
+ dataIndex: 'sampleName',
|
|
|
+ customRender:function (t,r,index) {
|
|
|
+ return {children: t,attrs: {rowSpan:r.rowSpan2}};
|
|
|
+ },
|
|
|
},
|
|
|
{
|
|
|
title:'样品规格/型号',
|
|
@@ -335,12 +338,14 @@
|
|
|
this.dataSource = res.result.records||res.result;
|
|
|
//判断跨行
|
|
|
let rowSpan = 0
|
|
|
+ let rowSpan2 = 0
|
|
|
let weituoClient = ''
|
|
|
- // let sampleName = ''
|
|
|
+ let sampleName = ''
|
|
|
for (let i = that.dataSource.length-1; i >= 0; i--) {
|
|
|
if (weituoClient == '') {
|
|
|
that.dataSource[i].rowSpan = 0
|
|
|
weituoClient = that.dataSource[i].weituoClient
|
|
|
+ rowSpan++
|
|
|
} else {
|
|
|
if(weituoClient == that.dataSource[i].weituoClient){
|
|
|
that.dataSource[i].rowSpan = 0
|
|
@@ -353,8 +358,25 @@
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+ if (sampleName == '') {
|
|
|
+ that.dataSource[i].rowSpan2 = 0
|
|
|
+ sampleName = that.dataSource[i].sampleName
|
|
|
+ rowSpan2++
|
|
|
+ } else {
|
|
|
+ if(sampleName == that.dataSource[i].sampleName){
|
|
|
+ that.dataSource[i].rowSpan2 = 0
|
|
|
+ rowSpan2++
|
|
|
+ }else{
|
|
|
+ that.dataSource[i+1].rowSpan2 = rowSpan2
|
|
|
+ that.dataSource[i].rowSpan2 = 0
|
|
|
+ rowSpan2 = 1
|
|
|
+ sampleName = that.dataSource[i].sampleName
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
that.dataSource[0].rowSpan = rowSpan
|
|
|
+ that.dataSource[0].rowSpan2 = rowSpan2
|
|
|
console.log(22222222222,that.dataSource)
|
|
|
if(res.result.total)
|
|
|
{
|