index.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. <template>
  2. <CommonTable ref="commonTableRef" :tableOptions="tableConfig"> </CommonTable>
  3. </template>
  4. <script setup lang="jsx">
  5. import { ref } from 'vue';
  6. import { useRouter } from 'vue-router';
  7. import useDict from '/@/utils/dict-util';
  8. await useDict.init(['MATE_DELIVERY_STATUS']);
  9. const commonTableRef = ref(null);
  10. const tableConfig = ref({
  11. url: '/supports/invoice/queryPage',
  12. // 设置网络请求方式为GET
  13. requestMethod: 'GET',
  14. tableAttrs: {},
  15. showIndexColumn: true,
  16. search: [
  17. {
  18. label: '项目名称',
  19. field: 'deliveryName',
  20. type: 'input',
  21. attrs: {},
  22. },
  23. {
  24. label: '客户名称',
  25. field: 'CustomerName',
  26. type: 'input',
  27. attrs: {},
  28. },
  29. ],
  30. columns: [
  31. {
  32. title: '项目名称',
  33. dataIndex: 'deliveryName',
  34. align: 'center',
  35. },
  36. {
  37. title: '客户名称',
  38. dataIndex: 'customerName',
  39. align: 'center',
  40. },
  41. {
  42. title: '发票号',
  43. dataIndex: 'invoiceCode',
  44. align: 'center',
  45. },
  46. {
  47. title: '开票类型',
  48. dataIndex: 'invoiceType',
  49. align: 'center',
  50. customRender: ({ text, record, index, column }) => {
  51. return record?.invoiceType?.[0].valueName;
  52. },
  53. },
  54. {
  55. title: '开票金额',
  56. dataIndex: 'invoiceAmount',
  57. align: 'center',
  58. },
  59. {
  60. title: '开票信息',
  61. dataIndex: 'invoiceText',
  62. align: 'center',
  63. ellipsis: true,
  64. },
  65. {
  66. title: '开票目期',
  67. dataIndex: 'invoiceDate',
  68. align: 'center',
  69. },
  70. {
  71. title: '税率',
  72. dataIndex: 'inVoiceRate',
  73. align: 'center',
  74. customRender: ({ text, record, index, column }) => {
  75. return record?.invoiceRate?.[0].valueName;
  76. },
  77. },
  78. {
  79. title: '经办人',
  80. dataIndex: 'invoiceOperator',
  81. align: 'center',
  82. customRender: ({ text, record, index, column }) => {
  83. return record?.invoiceOperator?.actualName;
  84. },
  85. },
  86. {
  87. title: '发票附件',
  88. // dataIndex: 'attachment',
  89. align: 'center',
  90. customRender: ({ text, record, index, column }) => {
  91. const imageUrls = record.attachment || [
  92. 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
  93. 'https://aliyuncdn.antdv.com/vue.png',
  94. 'https://aliyuncdn.antdv.com/logo.png',
  95. ];
  96. return imageUrls.map((imgUrl, imgIndex) => <a-image width={40} src={imgUrl} alt={`发票附件 ${imgIndex + 1}`} />);
  97. },
  98. },
  99. {
  100. title: '发起人',
  101. dataIndex: 'createUserId',
  102. align: 'center',
  103. customRender: ({ text, record, index, column }) => {
  104. return record?.createUserId?.actualName;
  105. },
  106. },
  107. {
  108. title: '提交时间',
  109. dataIndex: 'createTime',
  110. align: 'center',
  111. },
  112. ],
  113. beforeFetch({ params }) {
  114. return {
  115. ...params,
  116. };
  117. },
  118. // afterFetch({ data }) {},
  119. });
  120. const router = useRouter();
  121. function goDetailPage(record) {
  122. console.log('record', record);
  123. router.push({
  124. path: '/project/report-manage/report-today/',
  125. query: {
  126. id: record.id,
  127. },
  128. });
  129. }
  130. </script>
  131. <style lang="less" scoped>
  132. ::v-deep .ant-float-btn-description {
  133. font-size: 18px !important;
  134. }
  135. :deep(.ant-progress-inner) {
  136. width: 27px !important;
  137. height: 27px !important;
  138. font-size: 11px !important;
  139. }
  140. :deep(.ant-table-column[data-key='index']) {
  141. width: 60px !important;
  142. }
  143. </style>