import store from '@/store';

const roles = store.getters.userInfo.roles;
export const teskReportapprovaldata = {
  page: false,
  align: 'center',
  menuAlign: 'center',
  indexLabel: '序号',
  index: true,
  selection: false,
  border: true,
  addBtn: false,
  delBtn: false,
  header: false,
  editBtn: false,
  searchMenuSpan: 5,
  column: [
    {
      type: 'input',
      label: '报告ID',
      prop: 'reportNo',
      search: true
      // span: 13
      // dicUrl: '/admin/wmtasktype/list',
      // props: {
      //   label: 'taskTypeName',
      //   value: 'id'
      // }
    },
    {
      label: '执行包名称',
      searchLabelWidth: 100,
      prop: 'scorePackageName',
      search: true,
      // dicUrl: '/admin/wmscorepackage/list',
      // props:{
      //   label: 'scoreId',
      //   value: 'id'
      // },
      // formatter: function (row) {
      //   return String(row.scoreId);
      // },
      span: 13
    },
    {
      label: '服务数量',
      prop: 'taskNumber',
      addDisplay: false,
      editDisplay: false,
      viewDisplay: false,
      span: 13
    },
    {
      label: '服务总值',
      addDisplay: false,
      editDisplay: false,
      viewDisplay: false,
      prop: 'totalScore',
      span: 13
    },
    {
      type: 'input',
      label: '派工方',
      prop: 'entName'
    },
    {
      label: '生成日期',
      prop: 'createTime',
      span: 13,
      type: 'date',
      addDisplay: false,
      editDisplay: false,
      viewDisplay: false,
      format: 'yyyy-MM-dd hh:mm:ss',
      valueFormat: 'yyyy-MM-dd hh:mm:ss'
    }
    // {
    //   type: "select",
    //   label: "报告状态",
    //   addDisplay: false,
    //   editDisplay: false,
    //   viewDisplay: false,
    //   searchSpan: 5,
    //   search: true,
    //   prop: "reportStatus",
    //   span: 13,
    //   dicUrl: "/admin/dict/type/report_status"
    // }
    // {
    //   label: "最新生成时间",
    //   prop: "updateTime",
    //   span: 13,
    //   type: "date",
    //   addDisplay: false,
    //   editDisplay: false,
    //   viewDisplay: false,
    //   format: "yyyy-MM-dd",
    //   valueFormat: "yyyy-MM-dd"
    // }
  ]
};

export const teskReportapprovalLookdata = {
  page: false,
  align: 'center',
  menuAlign: 'center',
  indexLabel: '序号',
  index: true,
  border: true,
  addBtn: false,
  delBtn: false,
  header: false,
  editBtn: false,
  searchMenuSpan: 5,
  selection: true,
  selectable: (row, index) => {
    // 当checkState的roleId是当前角色id可以勾选
    if (roles.includes(row.checkState.roleId)) {
      return true;
    }
    if ((roles.includes(40) || roles.includes(42)) && row.checkState.roleId == -1) {
      return true;
    }
    if (roles.includes(39) && row.checkState.nextNodeId == -1) {
      return false;
    }
    return false;
  },
  column: [
    {
      type: 'input',
      label: '服务编号',
      prop: 'taskNumber',
      search: true
    },
    {
      type: 'select',
      label: '服务类型',
      prop: 'taskTypeId',
      span: 13,
      search: true,
      searchslot: true,
      slot: true
    },
    {
      label: '服务分值',
      addDisplay: false,
      editDisplay: false,
      viewDisplay: false,
      prop: 'score',
      span: 13
    },
    {
      type: 'select',
      label: '推广员姓名',
      prop: 'taskUsername'
    },
    {
      label: '完成时间',
      prop: 'lookintoDate',
      span: 13,
      type: 'datetime',
      format: 'yyyy-MM-dd HH:mm:ss',
      valueFormat: 'yyyy-MM-dd HH:mm:ss'
    },
    {
      label: '审核状态',
      prop: 'taskStatus',
      search: true,
      type: 'select',
      dicUrl: '/admin/dict/type/task_status',
      slot: true
    },

    {
      type: 'input',
      label: '报告ID',
      prop: 'reportNo'
      // span: 13
      // dicUrl: '/admin/wmtasktype/list',
      // props: {
      //   label: 'taskTypeName',
      //   value: 'id'
      // }
    },

    // {
    //   "type": "select",
    //   "label": "执行包名称",
    //   "prop": "scorePackageName",
    //   span: 13,
    //   dicUrl: '/admin/wmscorepackage/list',
    //   props: {
    //     label: 'scoreId',
    //     value: 'id'
    //   },
    // },
    {
      type: 'input',
      label: '服务提供商',
      prop: 'entName'
    },
    // {
    //   "type": "select",
    //   "label": "服务企业",
    //   "prop": "drugEntId",
    //   dicUrl: '/admin/wmdadrugent/list',
    //   props: {
    //     label: 'entname',
    //     value: 'id'
    //   },
    //   span: 13,
    // },
    {
      type: 'input',
      label: '审批节点',
      prop: 'checkState',
      formatter(row) {
        if (row.checkState) {
          return row.checkState.displayInfo;
        }
      }
    },
    // {
    //   label: "报告审核状态",
    //   prop: "reportApprovalOpinion",
    //   type: "select",
    //   search: true,
    //   searchLabelWidth: "150",
    //   dicData: [
    //     {
    //       label: "未审核",
    //       value: "0"
    //     },
    //     {
    //       label: "通过",
    //       value: "1"
    //     },
    //     {
    //       label: "不通过",
    //       value: "2"
    //     }
    //   ]
    // },
    {
      type: 'input',
      label: '审批人',
      prop: 'deptApprovalUserName'
    }
  ]
};
