contractInvoice.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <template>
  2. <view class="contact-main">
  3. <view class="todo-list">
  4. <u-empty mode="list" v-if="list.length == 0"></u-empty>
  5. <view v-else v-for="(v, i) in list" :key="i">
  6. <view class="contact-item">
  7. <view class="flex_l">
  8. <view class="label">合同编号:</view>
  9. <view class="val">{{ v.contractCode }}</view>
  10. </view>
  11. <view class="flex_l">
  12. <view class="label">开票金额:</view>
  13. <view class="val">{{ formatPrice(v.invoiceAmount) }}</view>
  14. </view>
  15. <view class="flex_l">
  16. <view class="label">开票日期:</view>
  17. <view class="val">{{ v.invoiceDate }}</view>
  18. </view>
  19. <view class="flex_l">
  20. <view class="label">开票类型:</view>
  21. <view class="val">{{ invoiceTypeData.filter((item) => item.key == v.invoiceType)[0].value || '-' }}</view>
  22. </view>
  23. <view class="flex_l">
  24. <view class="label">审核状态:</view>
  25. <view class="val"> {{
  26. v.approStatus == '10'
  27. ? '待提交审核'
  28. : v.approStatus == '20'
  29. ? '待审核'
  30. : v.approStatus == '30'
  31. ? '审核已同意'
  32. : v.approStatus == '40'
  33. ? '审核已拒绝'
  34. : v.approStatus == '50'
  35. ? '审核已撤销'
  36. : ''
  37. }}</view>
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. </template>
  44. <script>
  45. import to from 'await-to-js'
  46. import api from '@/api/contract'
  47. export default {
  48. name: 'OmsContractInvoice',
  49. props: {
  50. contractId: {
  51. type: [String, Number],
  52. default: '0',
  53. },
  54. },
  55. data() {
  56. return {
  57. invoiceTypeData: [], //发票类型
  58. list: []
  59. }
  60. },
  61. mounted() {
  62. this.getOptions()
  63. this.fetchData()
  64. },
  65. methods: {
  66. getOptions() {
  67. Promise.all([this.getDicts('invoice_type')])
  68. .then(([invoiceType]) => {
  69. this.invoiceTypeData = invoiceType.data.values || []
  70. })
  71. .catch((err) => console.log(err))
  72. },
  73. async fetchData() {
  74. const [err, res] = await to(api.getInvoice({
  75. contractId: this.contractId,
  76. pageNum: 0
  77. }))
  78. if (err) return
  79. this.list = res.data.list || []
  80. }
  81. }
  82. }
  83. </script>
  84. <style lang="scss" scoped>
  85. .contact-main {
  86. height: 100%;
  87. .todo-list {
  88. height: 100%;
  89. overflow: auto;
  90. padding: 20rpx 20rpx 0;
  91. .contact-item {
  92. padding: 20rpx;
  93. margin-bottom: 20rpx;
  94. box-shadow: 0 6rpx 19rpx 2rpx rgba(0, 45, 132, 0.15);
  95. border-radius: 8px;
  96. .label,
  97. .val {
  98. font-size: 28rpx;
  99. padding-bottom: 14rpx;
  100. }
  101. .label {
  102. color: #646464;
  103. }
  104. }
  105. }
  106. }
  107. </style>