auditDetail.vue 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <template>
  2. <div>
  3. <p>说明:以下信息来自钉钉</p>
  4. <a-spin :spinning="spinning" tip="Loading...">
  5. <s-table
  6. class="sTable fixPagination"
  7. ref="table"
  8. size="small"
  9. :rowKey="(record) => record.id"
  10. :columns="columns"
  11. :data="loadData"
  12. :scroll="{ y: 500 }"
  13. :showPagination="false"
  14. bordered>
  15. </s-table>
  16. </a-spin>
  17. </div>
  18. </template>
  19. <script>
  20. import { STable } from '@/components'
  21. import { getProcessInstance } from '@/api/expenseManagement'
  22. export default {
  23. name: 'AuditDetail',
  24. components: { STable },
  25. props: {
  26. openModal: {
  27. type: Boolean,
  28. default: false
  29. },
  30. itemSn: {
  31. type: [Number, String],
  32. default: ''
  33. },
  34. businessType: {
  35. type: [Number, String],
  36. default: ''
  37. }
  38. },
  39. data () {
  40. return {
  41. spinning: false,
  42. columns: [{ title: '序号', dataIndex: 'no', width: '8%', align: 'center' },
  43. { title: '人员姓名', width: '12%', dataIndex: 'userName', align: 'center', customRender: function (text) { return text || '--' } },
  44. { title: '人员类型', dataIndex: 'userType', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
  45. { title: '状态', dataIndex: 'state', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
  46. { title: '审批意见', dataIndex: 'remark', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
  47. { title: '附件', dataIndex: 'hasAttachments', width: '20%', align: 'center', customRender: function (text) { return text != '0' ? '请在钉钉中查看附件内容' : '--' } },
  48. { title: '操作时间', dataIndex: 'date', width: '20%', align: 'center', customRender: function (text) { return text || '--' } }],
  49. // 加载数据方法 必须为 Promise 对象
  50. loadData: parameter => {
  51. this.spinning = true
  52. delete parameter.tableId
  53. delete parameter.index
  54. return getProcessInstance({ businessType: this.businessType, businessSn: this.itemSn }).then(res => {
  55. let data
  56. if (res.status == 200) {
  57. data = res.data
  58. const no = 0
  59. for (var i = 0; i < data.length; i++) {
  60. data[i].no = no + i + 1
  61. }
  62. this.spinning = false
  63. return data
  64. } else {
  65. this.spinning = false
  66. this.$emit('loadError')
  67. return {
  68. list: [],
  69. count: 0
  70. }
  71. }
  72. })
  73. }
  74. }
  75. },
  76. methods: {
  77. clearTable () {
  78. this.$refs.table.clearTable()
  79. }
  80. }
  81. }
  82. </script>
  83. <style>
  84. </style>