export default {
  data() {
    return {
      total: 0,
      loading: false,
      tableOptions: {
        sortTable: true,
        maxHeight: 'calc(100vh - 260px)',
        height: 'calc(100vh - 260px)'
      },
      columns: [
        {
          label: '序号',
          index: true
        },
        {
          label: '采购合同编号',
          prop: 'contractNumber',
          showTooltip: true,
          width: 150
        },
        {
          label: '业务编号',
          showTooltip: true,
          prop: 'businessNumber',
          width: 150
        },
        {
          label: '项目名称',
          prop: 'projectName',
          width: 120,
          showTooltip: true
        },
        {
          label: '主企业名称',
          prop: 'supplierName',
          width: 120,
          showTooltip: true
        },
        {
          label: '核心企业名称',
          prop: 'buyerName',
          showTooltip: true
        },
        {
          label: '贸易平台',
          prop: 'platformName',
          showTooltip: true
        },
        {
          label: '当前阶段',
          prop: 'stage',
          showTooltip: true
        },
        {
          label: '状态',
          prop: 'status',
          showTooltip: true
        },
        {
          label: '操作',
          show: true,
          render: (h, row) => {
            const btnList = !row.stage || (!row.stage.includes('审核') && !row.stage.includes('终审')) ? 
            (row.status == '已完成' ? [
              { msg: '查看', icon: 'iconfont icon-orange icon-a-Group957', power: 'projectNumber:delete', category: 'see' },
              { msg: '变更', icon: 'iconfont icon-orange icon-a-Group990', power: 'projectNumber:delete', category: 'edit' },
              // { msg: '查看', icon: 'iconfont icon-orange icon-a-Group957', power: 'projectNumber:delete', category: 'see' }
            ] :
            [
              { msg: '查看', icon: 'iconfont icon-orange icon-a-Group957', power: 'projectNumber:delete', category: 'see' },
              { msg: '编辑', icon: 'iconfont icon-orange icon-a-Group8151', power: 'projectNumber:delete', category: 'edit' }
            ]) : [
              { msg: '查看', icon: 'iconfont icon-orange icon-a-Group957', power: 'projectNumber:delete', category: 'see' }
            ]
            if(row.status == '已完成') {
              btnList.push({ msg: '下载签署附件', icon: 'iconfont icon-orange icon-Union', category: 'download' })
            }
            const options = btnList.map(item => {
              return (
                <el-tooltip class='item' effect='dark' content={item.msg} placement='top' >
                  <span class='table-icon-box'>
                    <i class={item.icon} style={ item.category === 'download' ? { 'font-size': '16px', 'margin-top': '20px' } : ''} onClick={() => { this.handlerOperate(item.category, row) }}></i>
                  </span>
                </el-tooltip>
              )
            })
            return <div>{ options }</div>
          },
          width: 200
        }
      ]
    }
  }

}
