function columns(vm) { const cols = [ { title: '序号', key: 'rowIndex', width: 60, align: 'center', customRender: (t, r, index) => { return parseInt(index) + 1 } }, // { // title: '车间', // align: 'center', // dataIndex: 'deptName', // key: 'deptName', // customRender: (value, row, index) => { // const obj = { // children: value, // attrs: {} // } // if (index % 5 === 0) { // obj.attrs.rowSpan = 5 // } else { // obj.attrs.rowSpan = 0 // } // return obj // } // }, { title: '工区', align: 'center', dataIndex: 'teamName', key: 'teamName', customRender: (value, row, index) => { const obj = { children: value, attrs: {} } if (index % 5 === 0) { obj.attrs.rowSpan = 5 } else { obj.attrs.rowSpan = 0 } return obj } }, { title: '设备', align: 'center', dataIndex: 'sbmc', key: 'sbmc' }, { title: '总数', align: 'center', dataIndex: 'total', key: 'total' }, { title: '月份', align: 'center', dataIndex: 'yf', key: 'yf', children: [ { title: '计划', align: 'center', dataIndex: 'plan', key: 'plan' }, { title: '完成', align: 'center', dataIndex: 'actual', key: 'actual' }, { title: '兑现', align: 'center', dataIndex: 'dx', key: 'dx', scopedSlots: { customRender: 'dxs' } } ] } ] return cols } export default columns