AssetsCard.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. <template>
  2. <view class="listBox">
  3. <view class="listBox-sel">
  4. <uni-icons class="shanchu" v-if="type == 'output'" custom-prefix="iconfont" type="icon-shanchu" size="24" @click="deleteItem" color="#fa3534"></uni-icons>
  5. </view>
  6. <view class="listBox-con">
  7. <view class="listBox-top">
  8. <view class="listBox-name">
  9. {{ item.categoryName }}
  10. </view>
  11. </view>
  12. <view class="listBox-top">
  13. <view class="listBox-name">
  14. {{ item.categoryCode }}
  15. </view>
  16. </view>
  17. <view class="listBox-bottom">
  18. <view>牌号:{{ item.brandNum }}</view>
  19. <view>型号:{{ item.modelType }}</view>
  20. <view>规格:{{ item.specification }}</view>
  21. <view>批次号:{{ item.batchNo }}</view>
  22. <view>计量数量:{{ item.measureQuantity }}({{ item.measureUnit }})</view>
  23. <view class="w100">包装编码:{{ item.packageNo }}</view>
  24. <view>包装数量:{{ item.packingQuantity }}({{ item.packingUnit }})</view>
  25. <view>重量:{{ item.weight }}({{ item.weightUnit }})</view>
  26. <view>发货条码:{{ item.barcodes }}</view>
  27. <view>物料代号:{{ item.materielDesignation }}</view>
  28. <view>客户代号:{{ item.clientCode }}</view>
  29. <view>刻码:{{ item.engrave }}</view>
  30. <view class="w100">仓库:{{ item.warehouseName }}</view>
  31. <view class="w100">区域:{{ getLocation(item) }}</view>
  32. </view>
  33. </view>
  34. </view>
  35. </template>
  36. <script>
  37. import { tableHeader } from '../../common'
  38. import DetailDialog from './DetailDialog'
  39. import { mapActions, mapGetters } from 'vuex'
  40. export default {
  41. components: { DetailDialog },
  42. props: {
  43. item: {
  44. type: Object,
  45. default: () => ({})
  46. },
  47. isApproval: {
  48. type: Boolean,
  49. default: false
  50. },
  51. type: String
  52. },
  53. data() {
  54. return {}
  55. },
  56. computed: {
  57. // ...mapGetters(['getDictValue']),
  58. tableHeader() {
  59. return tableHeader(this.item.assetType)
  60. },
  61. curUnit() {
  62. return this.item.isUnpack
  63. ? this.item.unit || (this.item.detailReqList && this.item.detailReqList[0] && this.item.detailReqList[0].unit)
  64. : this.item.minPackUnit || (this.item.detailReqList && this.item.detailReqList[0] && this.item.detailReqList[0].minPackUnit)
  65. }
  66. },
  67. created() {
  68. // this.requestDict('物品类型')
  69. },
  70. methods: {
  71. getLocation(item) {
  72. if (item.areaName && item.goodsShelfName && item.goodsAllocationName) {
  73. return item.areaName + '/' + item.goodsShelfName + '/' + item.goodsAllocationName
  74. } else if (item.areaName && item.goodsShelfName) {
  75. return item.areaName + '/' + item.goodsShelfName
  76. } else if (item.areaName) {
  77. return item.areaName
  78. } else {
  79. return ''
  80. }
  81. },
  82. // ...mapActions('dict', ['requestDict']),
  83. deleteItem() {
  84. this.$emit('deleteItem')
  85. },
  86. handleChange(e) {
  87. if (this.type === 'input') {
  88. this.item.inputChecked = !!e.detail.value.length
  89. } else {
  90. this.$set(this.item, 'checked', !!e.detail.value.length)
  91. }
  92. },
  93. goDetail({ id }) {
  94. // uni.navigateTo({
  95. // url: `/pages/warehouse/enterHouse/details?&id=${id}`
  96. // })
  97. },
  98. handleDetail(item) {
  99. if (this.type === 'detail' && !item.detailReqList?.length) {
  100. return
  101. }
  102. this.$refs.detailRef.open(item, this.cargoSpaceId, res => {
  103. if (this.type === 'output') {
  104. this.$set(item, 'curDetailReqList', res)
  105. } else {
  106. this.$set(
  107. item,
  108. 'detailReqList',
  109. res.filter(i => i.checked)
  110. )
  111. }
  112. })
  113. }
  114. }
  115. }
  116. </script>
  117. <style lang="scss" scoped>
  118. .listBox {
  119. display: flex;
  120. // height: 180rpx;
  121. padding: 20rpx;
  122. border-bottom: 2rpx solid #e5e5e5;
  123. .listBox-sel {
  124. height: 90rpx;
  125. width: 80rpx;
  126. // line-height: 90rpx;
  127. text-align: center;
  128. checkbox {
  129. transform: scale(1.2);
  130. }
  131. }
  132. .listBox-con {
  133. width: 100%;
  134. // display: flex;
  135. // flex-wrap: wrap;
  136. // justify-content: space-between;
  137. align-items: center;
  138. padding: 0 18rpx 0 0;
  139. .listBox-top {
  140. width: 100%;
  141. display: flex;
  142. justify-content: space-between;
  143. padding-bottom: 10rpx;
  144. .listBox-name,
  145. .listBox-code {
  146. display: inline-block;
  147. font-size: $uni-font-size-sm;
  148. font-weight: bold;
  149. }
  150. }
  151. .listBox-bottom {
  152. width: 100%;
  153. display: flex;
  154. justify-content: space-between;
  155. font-size: $uni-font-size-sm;
  156. flex-wrap: wrap;
  157. > view {
  158. width: 50%;
  159. overflow: hidden;
  160. white-space: nowrap;
  161. text-overflow: ellipsis;
  162. }
  163. .input_view {
  164. display: flex;
  165. align-items: center;
  166. justify-content: center;
  167. .u-input {
  168. height: 36rpx;
  169. padding: 0 !important;
  170. margin-right: 10rpx;
  171. border: 1px solid #ddd;
  172. }
  173. }
  174. .w100 {
  175. width: 100%;
  176. }
  177. }
  178. }
  179. }
  180. .noDate {
  181. height: 100%;
  182. }
  183. </style>