content.config.ts 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. import { ContentConfig } from "/@/components/PageContent";
  2. import { httpList } from "/@/api/purchase/ticketReturn";
  3. import dayjs from "dayjs";
  4. import { invType_options, status_options } from "./configs";
  5. import { h } from "vue";
  6. import { ElTag } from "element-plus";
  7. const columns = [
  8. {
  9. type: "selection",
  10. width: 55,
  11. hide: ({ checkList }) => !checkList.includes("勾选列")
  12. },
  13. {
  14. label: "序号",
  15. type: "index",
  16. width: 70,
  17. hide: ({ checkList }) => !checkList.includes("序号列")
  18. },
  19. {
  20. label: "id",
  21. prop: "id"
  22. },
  23. {
  24. label: "发票类型",
  25. prop: "invoiceType_cn"
  26. },
  27. {
  28. label: "发票状态",
  29. prop: "invStatus_cn"
  30. },
  31. {
  32. label: "发票号码",
  33. prop: "invoiceNumber"
  34. },
  35. {
  36. label: "录入方式",
  37. prop: "invType",
  38. formatter: ({ invType }) =>
  39. invType_options.find(item => item.value === invType)?.label
  40. },
  41. {
  42. label: "录入人",
  43. prop: "apply_name"
  44. },
  45. {
  46. label: "状态",
  47. prop: "status",
  48. width: 160,
  49. cellRenderer: ({ row, props }) =>
  50. h(
  51. ElTag,
  52. {
  53. size: props.size
  54. },
  55. {
  56. default: () => status_options.find(s => row.status === s.value)?.label
  57. }
  58. )
  59. },
  60. {
  61. label: "开票日期",
  62. prop: "open_time",
  63. formatter: ({ open_time }) =>
  64. open_time ? dayjs(open_time).format("YYYY-MM-DD HH:mm:ss") : ""
  65. },
  66. {
  67. label: "创建时间",
  68. prop: "addtime",
  69. formatter: ({ addtime }) => dayjs(addtime).format("YYYY-MM-DD HH:mm:ss")
  70. },
  71. {
  72. label: "操作",
  73. fixed: "right",
  74. width: 60,
  75. slot: "operation"
  76. }
  77. ];
  78. const contentConfig: ContentConfig = {
  79. title: "企业客户",
  80. columns,
  81. apis: {
  82. httpList
  83. },
  84. powers: ["001", "002", "003", "004", "005", "006", "007", "008"]
  85. };
  86. export default contentConfig;