verifyModal.vue 2.9 KB

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