contractProduct.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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.prodName }}</view>
  10. </view>
  11. <view class="flex_l">
  12. <view class="label">产品型号:</view>
  13. <view class="val">{{ prodCode }}</view>
  14. </view>
  15. <view class="flex_l">
  16. <view class="label">单价:</view>
  17. <view class="val">{{ formatPrice(v.tranPrice) }}</view>
  18. </view>
  19. <view class="flex_l">
  20. <view class="label">产品数量:</view>
  21. <view class="val">{{ v.prodNum }}</view>
  22. </view>
  23. <view class="flex_l">
  24. <view class="label">合计:</view>
  25. <view class="val"> {{calculatedDiscount(v.tranPrice, v.prodNum)}}</view>
  26. </view>
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. </template>
  32. <script>
  33. import to from 'await-to-js'
  34. import api from '@/api/contract'
  35. export default {
  36. name: 'OmsContractInvoice',
  37. props: {
  38. list: {
  39. type: Array,
  40. default: () => {
  41. return []
  42. },
  43. },
  44. },
  45. data() {
  46. return {
  47. }
  48. },
  49. mounted() {},
  50. methods: {
  51. // 计算总价
  52. calculatedDiscount(price, count) {
  53. let intPrice = null
  54. if (typeof price === 'string') intPrice = this.delcommafy(price) * 100
  55. else intPrice = price * 100
  56. return this.formatPrice((intPrice * count) / 100)
  57. },
  58. }
  59. }
  60. </script>
  61. <style lang="scss" scoped>
  62. .contact-main {
  63. height: 100%;
  64. .todo-list {
  65. height: 100%;
  66. overflow: auto;
  67. padding: 20rpx 20rpx 0;
  68. .contact-item {
  69. padding: 20rpx;
  70. margin-bottom: 20rpx;
  71. box-shadow: 0 6rpx 19rpx 2rpx rgba(0, 45, 132, 0.15);
  72. border-radius: 8px;
  73. .label,
  74. .val {
  75. font-size: 28rpx;
  76. padding-bottom: 14rpx;
  77. }
  78. .label {
  79. color: #646464;
  80. }
  81. }
  82. }
  83. }
  84. </style>