quickProductList.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. <template>
  2. <view class="partList-box flex flex_column">
  3. <view class="partList-list">
  4. <view class="partList-list-box" v-for="item in partList" :key="item.productSn">
  5. <view class="product flex align_center">
  6. <view class="checkbox">
  7. <u-checkbox v-model="item.checked" :name="item.productSn" @change="checkChange" size="40" shape="circle"></u-checkbox>
  8. </view>
  9. <view class="flex align_center flex_1" @click="checkChange({name:item.productSn})">
  10. <view class="pimgs">
  11. <u-image :src="item.productImageUrl?item.productImageUrl:`../../static/${$config('themePath')}/def_img@2x.png`" width="128" height="128" border-radius="10"></u-image>
  12. </view>
  13. <view class="pinfo">
  14. <view class="pname">
  15. <text>{{item.shelfPlaceCode}}</text>
  16. {{item.productCode}}
  17. </view>
  18. <view class="pname pname1">
  19. {{item.productName}}
  20. </view>
  21. </view>
  22. </view>
  23. </view>
  24. <view class="ptxt flex align_center justify_end">
  25. <view>
  26. 最大库容:<text class="pnums">{{item.maxQty}}</text>
  27. 当前库存:<text class="pnums">{{item.qty}}</text>
  28. 补货在途:<text class="pnums">{{item.afloatQty||0}}</text>
  29. </view>
  30. </view>
  31. <view class="ptools flex align_center justify_between">
  32. <view></view>
  33. <view class="pcurnums flex align_center">
  34. <text>补货数量</text>
  35. <view class="u-ninput">
  36. <u-number-box color="#000" :long-press="false" :input-height="60" bg-color="#fff" v-model="item.printQty" :min="0" :max="999999"></u-number-box>
  37. </view>
  38. </view>
  39. </view>
  40. </view>
  41. <view class="nodata" v-if="partList.length==0">
  42. <u-empty :src="`/static/${$config('themePath')}/def_no_data@3x.png`" icon-size="120" :text="noDataText" img-width="120" mode="list"></u-empty>
  43. </view>
  44. </view>
  45. </view>
  46. </template>
  47. <script>
  48. export default {
  49. props: {
  50. list: {
  51. type: Array,
  52. default: function(){
  53. return []
  54. }
  55. },
  56. noDataText: {
  57. type: String,
  58. default: '暂无产品'
  59. },
  60. title: {
  61. type: String,
  62. default: '列表'
  63. },
  64. // model: checkbox 可选择模式,view 只显示
  65. model: {
  66. type: String,
  67. default: 'checkbox'
  68. },
  69. },
  70. data() {
  71. return {
  72. partList: [],
  73. }
  74. },
  75. methods: {
  76. setData(list){
  77. const _this = this
  78. list.map(item => {
  79. item.printQty = item.replenishBillQty
  80. item.checked = false
  81. })
  82. this.partList = list
  83. },
  84. // 全选
  85. allSelect(val){
  86. this.partList.map(item => {
  87. item.checked = val
  88. })
  89. this.partList.splice()
  90. },
  91. checkChange(e){
  92. const row = this.partList.find(item => item.productSn == e.name)
  93. if(row){
  94. row.checked = !row.checked
  95. this.partList.splice()
  96. }
  97. // 判断是否全选
  98. const isAllNoChecked = this.partList.filter(item => !item.checked)
  99. this.$emit('allChecked',isAllNoChecked.length == 0)
  100. },
  101. // 获取所有选择的
  102. getAllChecked(){
  103. return this.partList.filter(item => item.checked && item.printQty)
  104. },
  105. // 获取所有数据
  106. getAllData(){
  107. return this.partList
  108. },
  109. // 数量 change
  110. numberChange(value, index){
  111. this.$emit('numberChange', value, index)
  112. }
  113. }
  114. }
  115. </script>
  116. <style lang="less" scoped>
  117. .partList-box{
  118. height: 100%;
  119. position: relative;
  120. .nodata{
  121. padding: 10vh 0;
  122. }
  123. .partList-list{
  124. flex-grow: 1;
  125. }
  126. .partList-list-box{
  127. padding: 10px 0;
  128. border-bottom: 2rpx solid #f5f5f5;
  129. .product{
  130. flex-grow: 1;
  131. .checkbox{
  132. width: 60rpx;
  133. }
  134. .pinfo{
  135. flex-grow: 1;
  136. padding-left: 20rpx;
  137. .pname{
  138. color: #191919;
  139. margin-bottom: 5rpx;
  140. text{
  141. font-weight: normal;
  142. margin-right: 10rpx;
  143. padding: 0 10rpx;
  144. background: rgba(3, 54, 146, 0.15);
  145. border-radius: 30rpx;
  146. color: #033692;
  147. font-size: 24rpx;
  148. }
  149. }
  150. }
  151. }
  152. .ptxt{
  153. font-size: 28rpx;
  154. color: #999;
  155. .pnums{
  156. color: #222;
  157. margin-right: 20upx;
  158. }
  159. }
  160. .ptools{
  161. margin-top: 20rpx;
  162. .pcurnums{
  163. > text{
  164. margin-right: 20rpx;
  165. }
  166. }
  167. .u-ninput{
  168. border: 2rpx solid #eee;
  169. border-radius: 50rpx;
  170. padding: 0 6rpx;
  171. }
  172. /deep/ .u-icon-disabled{
  173. background: #fff!important;
  174. }
  175. /deep/ .u-number-input{
  176. margin: 0 0;
  177. border: 2rpx solid #eee;
  178. border-top: 0;
  179. border-bottom: 0;
  180. }
  181. /deep/ .u-icon-plus, /deep/ .u-icon-minus{
  182. border-radius: 50rpx;
  183. }
  184. }
  185. }
  186. }
  187. </style>