import { httpList, httpStatus } from "/@/api/serviceParam/storeSet";

import { h } from "vue";
import { ElTag } from "element-plus";
import { options, statusOptions } from "./_options";
import { ContentConfig } from "/@/components/PageContent";

const columns = [
  {
    prop: "wsm_code",
    label: "编号",
    width: "170px",
  },
  {
    prop: "name",
    label: "仓库名称",
    minWidth:'160px'
  },
  {
    prop: "wsm_type",
    label: "仓库类型",
    width: "80px",
    cellRenderer({ row }){
      return h(ElTag, null, { default: () => options.find(({value}) => value === row.wsm_type)?.label || '--' })
    }
  },
  {
    prop: "companyNo",
    label: "业务公司编码",
    width: "140px",
  },
  {
    prop: "company_name",
    label: "业务公司",
    "min-width": "140px",
  },
  {
    prop: "status",
    label: "状态",
    width: "70px",
    cellRenderer({ row }){
      return h(ElTag, null, { default: () => statusOptions.find(({value}) => value === row.status)?.label || '--' })
    }
  },
  {
    prop: "contactor_name",
    label: "负责人",
    minWidth: "70px",
  },
  {
    prop: "mobile",
    label: "负责人电话",
    width: "100px",
  },
  {
    prop: "creater",
    label: "创建人",
    width: "70px",
  },
  {
    prop: "addtime",
    label: "创建时间",
    width: "140px",
  },
  {
    prop: "",
    label: "操作",
    width: "140px",
    fixed: "right",
    slot: "operation",
  }
]




const contentConfig: ContentConfig = {
  title: "原因管理",
  columns,
  apis: {
    httpList,
    httpAdd: true,
    httpUpdate: true,
    httpStatus
  }
};

export default contentConfig;
