invoiceDetail.vue 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <template>
  2. <view class="invoice-detail" v-if="detail.id">
  3. <view class="detail">
  4. <view class="detail-box">
  5. <view class="title-box">
  6. <view class="title">{{detail.name}}</view>
  7. <view class="date">{{$field.findTypeName('invoiceType',detail.type)}}</view>
  8. <view class="title-icon">
  9. <uni-icons type="icon-hetongwendang" custom-prefix="iconfont" color="#fff" size="18">
  10. </uni-icons>
  11. </view>
  12. </view>
  13. <view class="other">
  14. <view class="item">
  15. <view class="label">发票代码</view>
  16. <view class="value">{{detail.code || '-'}}</view>
  17. </view>
  18. <view class="item">
  19. <view class="label">发票号码</view>
  20. <view class="value">{{detail.number || '-'}}</view>
  21. </view>
  22. <view class="item">
  23. <view class="label">货物名称</view>
  24. <view class="value">{{detail.cargoName || '-'}}</view>
  25. </view>
  26. </view>
  27. <view class="state">
  28. <view></view>
  29. <view class="tag">
  30. <div class="status-tag success" v-if="!detail.status">正常</div>
  31. <div class="status-tag error" v-else-if="detail.status === 1">作废</div>
  32. </view>
  33. </view>
  34. </view>
  35. <view class="detail-box file-box" v-if="detail.attachment && detail.attachment !='[]'">
  36. <view class="sub-title">
  37. <uni-icons type="images-filled" class="inherit-icons" size="26" color="#08979c"></uni-icons>
  38. <text class="sub-label">发票附件</text>
  39. </view>
  40. <view class="other">
  41. <upload ref="upload" accept="all" :list="detail.attachment ? JSON.parse(detail.attachment) : []" type="preview">
  42. </upload>
  43. </view>
  44. </view>
  45. </view>
  46. </view>
  47. </template>
  48. <script>
  49. import {
  50. getInvoiceDetailById
  51. } from '@/request/api/invouce.js'
  52. import upload from '@/components/common/upload.vue'
  53. export default {
  54. data() {
  55. return {
  56. invoiceId: '',
  57. type: '',
  58. detail: {}
  59. }
  60. },
  61. onLoad(body) {
  62. this.invoiceId = body.invoiceId;
  63. this.type = body.type;
  64. this.init();
  65. },
  66. methods: {
  67. init() {
  68. if (!this.invoiceId) return;
  69. getInvoiceDetailById(this.invoiceId).then(this.invoiceSuccess);
  70. },
  71. invoiceSuccess(res) {
  72. if (res.code === 200) {
  73. this.detail = res.data;
  74. }
  75. }
  76. },
  77. components: {
  78. upload
  79. }
  80. }
  81. </script>
  82. <style>
  83. </style>