instanceBom.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. <template>
  2. <view>
  3. <view class="material rx-ss" v-for="(mate, idx) in list">
  4. <view class="left rx-ss" @click="getDelete(idx)">
  5. <uni-icons custom-prefix="iconfont" type="icon-shanchu" size="20" color="#fa3534"></uni-icons>
  6. </view>
  7. <view class="content_table">
  8. <view class="item">
  9. <view class="lable rx-cc">编码</view>
  10. <view class="content">
  11. {{mate.code}}
  12. </view>
  13. </view>
  14. <view class="item">
  15. <view class="lable rx-cc">名称</view>
  16. <view class="content rx-bc">{{mate.name}}
  17. <view class="tag_box "
  18. v-if="Object.prototype.hasOwnProperty.call(mate, 'isOut') && mate.isOut == 1" style="">委外
  19. </view>
  20. </view>
  21. </view>
  22. <view class="item" v-for="(itm, index) in tableH(mate.rootCategoryLevelId)" v-if='itm.prop'
  23. :key="index">
  24. <view class="lable rx-cc">{{ itm.label }}</view>
  25. <view class="content">{{ mate[itm.prop] }}</view>
  26. </view>
  27. <view class="item">
  28. <view class="lable rx-cc">包装库存</view>
  29. <view class="content">{{mate.packingCountBase}}/ {{mate.minUnit}}</view>
  30. </view>
  31. <view class="item" >
  32. <view class="lable rx-cc">领料数量</view>
  33. <view v-if="Object.prototype.hasOwnProperty.call(mate, 'isOut') && mate.isOut == 1">{{ mate.demandQuantity }}</view>
  34. <view class="content content_num" v-else>
  35. <input class="uni-input" v-model="mate.demandQuantity"
  36. @blur='mate.demandQuantity > mate.availableCountBase ? mate.demandQuantity = mate.availableCountBase : mate.demandQuantity'
  37. type="number"></input>
  38. <view class="unit">/{{mate.measuringUnit}}</view>
  39. <view>&nbsp;&nbsp; (库存:{{ mate.availableCountBase }} {{mate.measuringUnit}})</view>
  40. </view>
  41. </view>
  42. <view class="item" v-if="!Object.prototype.hasOwnProperty.call(mate, 'isOut') || mate.isOut == 0">
  43. <view class="lable rx-cc">领料仓库</view>
  44. <view class="content pd4">
  45. <zxz-uni-data-select :localdata="warehouseList" v-model="mate.warehouseId" dataValue='id' format='{name}'
  46. dataKey="name" filterable :clear='false'></zxz-uni-data-select>
  47. </view>
  48. </view>
  49. <view class="item" v-if="Object.prototype.hasOwnProperty.call(mate, 'isOut') && mate.isOut == 1">
  50. <view class="lable rx-cc">领料仓库</view>
  51. <view class="content pd4 rx-sc">
  52. {{ mate.warehouseName}}
  53. </view>
  54. </view>
  55. </view>
  56. </view>
  57. </view>
  58. </template>
  59. <script>
  60. import {
  61. tableHeader
  62. } from '../../common.js'
  63. export default {
  64. props: ['list','warehouseList'],
  65. data() {
  66. return {
  67. }
  68. },
  69. methods: {
  70. tableH(type) {
  71. return tableHeader(type)
  72. },
  73. getDelete(idx) {
  74. this.list.splice(idx, 1)
  75. },
  76. }
  77. }
  78. </script>
  79. <style lang="scss" scoped>
  80. .material {
  81. margin-top: 10rpx;
  82. .left {
  83. width: 40rpx;
  84. }
  85. .zdy_check {
  86. width: 30rpx;
  87. height: 30rpx;
  88. border: 2rpx solid #c8c9cc;
  89. border-radius: 4rpx;
  90. }
  91. .check_active {
  92. background: $theme-color;
  93. border: 2rpx solid $theme-color;
  94. /deep/ .u-icon__icon {
  95. color: #fff !important;
  96. }
  97. }
  98. .content_table {
  99. width: 652rpx;
  100. border: 2rpx solid $border-color;
  101. .item {
  102. display: flex;
  103. border-bottom: 2rpx solid $border-color;
  104. .lable {
  105. width: 132rpx;
  106. text-align: center;
  107. background-color: #F7F9FA;
  108. font-size: 26rpx;
  109. border-right: 2rpx solid $border-color;
  110. flex-shrink: 0;
  111. }
  112. .ww80 {
  113. width: 80rpx;
  114. }
  115. .content {
  116. width: 518rpx;
  117. min-height: 64rpx;
  118. font-size: 28rpx;
  119. line-height: 28rpx;
  120. font-style: normal;
  121. font-weight: 400;
  122. padding: 18rpx 8rpx;
  123. box-sizing: border-box;
  124. word-wrap: break-word;
  125. flex-grow: 1 !important;
  126. }
  127. .content_num {
  128. display: flex;
  129. align-items: center;
  130. padding: 0 4rpx;
  131. /deep/ .uni-input-input {
  132. width: 200rpx;
  133. border: 2rpx solid #F0F8F2;
  134. background: #F0F8F2;
  135. color: $theme-color;
  136. }
  137. .unit {
  138. padding: 0 4rpx;
  139. font-size: 24rpx;
  140. color: #404446;
  141. }
  142. }
  143. .pd4 {
  144. padding: 4rpx 8rpx;
  145. }
  146. &:last-child {
  147. border-bottom: none;
  148. }
  149. }
  150. .ww55 {
  151. width: 55%;
  152. }
  153. .ww45 {
  154. width: 45%;
  155. }
  156. }
  157. }
  158. .tag_box {
  159. padding: 2rpx 10rpx;
  160. margin-right: 12rpx;
  161. background: #E6A23C;
  162. font-size: 22rpx;
  163. color: #fff;
  164. border-radius: 4rpx;
  165. }
  166. </style>