123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- import { ref } from "vue";
- import dayjs from "dayjs";
- import { statusList, inv_type_list } from "./status";
- export function useColumns() {
- const columns = ref([
- {
- type: "selection",
- width: 55,
- hide: ({ checkList }) => !checkList.includes("勾选列")
- },
- {
- label: "序号",
- type: "index",
- width: 70,
- hide: ({ checkList }) => !checkList.includes("序号列")
- },
- {
- label: "发票申请编号",
- prop: "invNo",
- width: 160
- },
- {
- label: "企业客户",
- prop: "customerName",
- width: 160
- },
- {
- label: "企业客户编码",
- prop: "inv_in",
- width: 160
- },
- {
- label: "业务企业编号",
- prop: "inv_out"
- },
- {
- label: "发票额度",
- prop: "inv_value",
- width: 110
- },
- {
- label: "状态",
- prop: "status",
- minWidth: 80,
- cellRenderer: ({ row, props }) => (
- <el-tag
- size={props.size}
- type={
- (statusList.find(item => item.value == row.status + "") || {})
- .type || "info"
- }
- effect="plain"
- >
- {(statusList.find(item => item.value == row.status + "") || {})
- .label || "--"}
- </el-tag>
- )
- },
- {
- label: "发票类型",
- prop: "inv_type",
- minWidth: 80,
- cellRenderer: ({ row, props }) => (
- <el-tag
- size={props.size}
- type={
- (inv_type_list.find(item => item.value == row.inv_type + "") || {})
- .type || "info"
- }
- effect="plain"
- >
- {(inv_type_list.find(item => item.value == row.inv_type + "") || {})
- .label || "--"}
- </el-tag>
- )
- },
- {
- label: "申请人",
- prop: "apply_name",
- width: 80
- },
- {
- label: "创建时间",
- width: 145,
- prop: "addtime",
- formatter: ({ addtime }) =>
- addtime ? dayjs(addtime).format("YYYY-MM-DD HH:mm:ss") : ""
- },
- {
- label: "操作",
- fixed: "right",
- width: 55,
- slot: "operation"
- }
- ]);
- return {
- columns
- };
- }
|