cm-contract-goods.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <template name="goods">
  2. <view class="goods-template">
  3. <!-- 商品列表 -->
  4. <view class="goods-list">
  5. <view class="goods-main clearfix" v-for="(supplier, index) in goodsData" :key="index">
  6. <view class="goods-item">
  7. <view class="goods-item-td">产品名称</view>
  8. <view class="goods-item-td">注册证编号/备案编号</view>
  9. <view class="goods-item-td">生产厂家</view>
  10. <view class="goods-item-td">规格</view>
  11. <view class="goods-item-td">数量(支)</view>
  12. <view class="goods-item-td">单价(元/支)</view>
  13. <view class="goods-item-td">总价(元)</view>
  14. </view>
  15. <view class="goods-item" v-for="(pros, idx) in supplier.cartList" :key="idx">
  16. <view class="goods-item-td">{{ pros.name }}</view>
  17. <view class="goods-item-td">国械注准20213130488 晋药消械生产许20150014号</view>
  18. <view class="goods-item-td">山西锦波生物医药股份有限公司</view>
  19. <view class="goods-item-td">{{ pros.unit }}</view>
  20. <view class="goods-item-td"><text class="red">{{ pros.number }}</text></view>
  21. <view class="goods-item-td"><text class="red">¥{{ pros.price | NumFormat }}</text></view>
  22. <view class="goods-item-td"><text class="red">¥{{ supplier.totalPrice | NumFormat }}</text> </view>
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. </template>
  28. <script>
  29. export default {
  30. name: 'goods',
  31. props: {
  32. goodsData: {
  33. type: Array
  34. }
  35. },
  36. data() {
  37. return {
  38. }
  39. },
  40. created() {
  41. },
  42. filters: {
  43. NumFormat(value) {
  44. //处理金额
  45. return Number(value).toFixed(2)
  46. }
  47. },
  48. watch: {
  49. goodsData: {
  50. handler: function(el) {
  51. //监听对象的变换使用 function,箭头函数容易出现this指向不正确
  52. this.goodsData = el
  53. },
  54. deep: true
  55. }
  56. },
  57. computed: {},
  58. methods: {
  59. }
  60. }
  61. </script>
  62. <style lang="scss">
  63. .goods-template {
  64. width: 100%;
  65. height: auto;
  66. background: #ffffff;
  67. box-sizing: border-box;
  68. padding: 24rpx 0;
  69. .goods-list {
  70. width: 100%;
  71. height: auto;
  72. overflow-x: scroll;
  73. padding: 24rpx 0;
  74. .goods-main {
  75. width: 1500rpx;
  76. min-height: 240rpx;
  77. border: 1px solid #666666;
  78. border-radius: 10rpx;
  79. display: flex;
  80. flex-direction: column;
  81. align-items: center;
  82. .goods-item {
  83. width: 100%;
  84. border-bottom: 1px solid #666666;
  85. display: flex;
  86. justify-content: center;
  87. &:last-child {
  88. border-bottom: none;
  89. }
  90. .goods-item-td {
  91. width: 14.28%;
  92. display: flex;
  93. justify-content: center;
  94. align-items: center;
  95. flex-wrap: wrap;
  96. padding: 20rpx;
  97. font-size: $font-size-24;
  98. line-height: 40rpx;
  99. color: #666666;
  100. box-sizing: border-box;
  101. border-right: 1px solid #666666;
  102. .red{
  103. color: #ff2a2a;
  104. }
  105. &:last-child {
  106. border-right: none;
  107. }
  108. }
  109. }
  110. }
  111. }
  112. }
  113. </style>