expense-detail.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <template>
  2. <!-- <el-dialog
  3. title="查看"
  4. width="70%"
  5. :close-on-click-modal="false"
  6. :visible.sync="visible"> -->
  7. <div>
  8. <div class="my-title">查看</div>
  9. <div style="margin-left: 20px;margin-right: 20px">
  10. <!-- 工作流 -->
  11. <div v-if="dataForm.workFlowBusinessExt && dataForm.workFlowBusinessExt.workFlowProcessStepList">
  12. <el-steps :active="stepActive" align-center finish-status="success" style="margin-bottom: 20px">
  13. <template v-for="(item, i) in dataForm.workFlowBusinessExt.workFlowProcessStepList">
  14. <el-step :title="item.stepName" :description="item.assigneeName"></el-step>
  15. </template>
  16. </el-steps>
  17. <el-collapse style="margin-bottom: 20px">
  18. <el-collapse-item>
  19. <template slot="title">
  20. <span style="color: red">操作日志(展开查看更多):</span>
  21. </template>
  22. <template v-for="(item, i) in dataForm.workFlowBusinessExt.processLogList">
  23. <div>{{++i}}:{{item.approverName}} {{item.createTime}} {{item.approvalValue}}</div>
  24. </template>
  25. </el-collapse-item>
  26. </el-collapse>
  27. </div>
  28. <div v-if="isFlow">
  29. <approve-component ref="approve" @approveFinished="approveFinished"/>
  30. </div>
  31. <e-desc title="基本信息" column="3">
  32. <e-desc-item label="编码">{{dataForm.code}}</e-desc-item>
  33. <e-desc-item label="发生日期">{{dataForm.happenTime}}</e-desc-item>
  34. <e-desc-item label="报销金额">{{dataForm.submitExpenseAmount}}</e-desc-item>
  35. <e-desc-item label="报销内容" span="3">{{dataForm.happenContent}}</e-desc-item>
  36. <e-desc-item label="备注说明" span="3">{{dataForm.notes}}</e-desc-item>
  37. </e-desc>
  38. <e-desc title="报销证明附件">
  39. <upload-component :display="true" :display-title="false" :accept="'*'" :file-obj-list="fileList"/>
  40. </e-desc>
  41. </div>
  42. <span slot="footer" class="dialog-footer">
  43. <el-button @click="onChose">返回</el-button>
  44. </span>
  45. </div>
  46. <!-- </el-dialog> -->
  47. </template>
  48. <script>
  49. import EDesc from '../common/e-desc'
  50. import EDescItem from '../common/e-desc-item'
  51. import uploadComponent from '../common/upload-component'
  52. import { getExpenseDetail } from '@/api/finance'
  53. import ApproveComponent from '@/views/modules/common/approve-component'
  54. export default {
  55. name: 'expense-detail',
  56. components: {
  57. ApproveComponent,
  58. EDesc,
  59. EDescItem,
  60. uploadComponent
  61. },
  62. data () {
  63. return {
  64. isFlow: false,
  65. visible: false,
  66. id: 0,
  67. dataForm: {},
  68. cusRCommProductVOS: [],
  69. fileList: []
  70. }
  71. },
  72. computed: {
  73. stepActive () {
  74. if (!(this.dataForm.workFlowBusinessExt && this.dataForm.workFlowBusinessExt.workFlowProcessStepList)) {
  75. return 0
  76. }
  77. let stepIndex = this.dataForm.workFlowBusinessExt.workFlowProcessStepList.findIndex(item => item.stepId === this.dataForm.workFlowBusinessExt.currentStepId)
  78. return stepIndex !== -1 ? stepIndex : 0
  79. }
  80. },
  81. methods: {
  82. onChose () {
  83. this.$emit('onChose')
  84. },
  85. async init (id, businessType) {
  86. this.isFlow = !!(businessType && businessType !== '')
  87. this.visible = true
  88. this.id = id || 0
  89. if (!id) return
  90. await getExpenseDetail(this.id).then(({data}) => {
  91. if (data && data.code === '200') {
  92. this.dataForm = data.data
  93. // 文件列表
  94. this.fileList = []
  95. if (data.data.attachList) {
  96. data.data.attachList.forEach((item) => {
  97. this.fileList.push({
  98. name: item.fileName,
  99. url: item.url,
  100. id: item.url
  101. })
  102. })
  103. }
  104. // 初始化审批Form
  105. this.showApproveForm(businessType, this.id)
  106. }
  107. })
  108. },
  109. // 初始化审批Form
  110. showApproveForm (businessType, businessId) {
  111. if (this.isFlow) {
  112. this.$nextTick(() => {
  113. this.$refs.approve.init(businessType, businessId)
  114. })
  115. }
  116. },
  117. // 审批完成
  118. approveFinished () {
  119. this.onChose()
  120. this.$emit('approveFinished')
  121. }
  122. }
  123. }
  124. </script>
  125. <style scoped>
  126. .my-line{
  127. border-bottom: 1px solid #c0c4cc;
  128. margin-bottom: 10px;
  129. }
  130. .title{
  131. padding: 10px 0 ;
  132. }
  133. </style>