scaned-pop.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. <template>
  2. <view>
  3. <u-popup :show="scanedShow" :closeOnClickOverlay="false" @close="closeClick" mode="center" :round="10">
  4. <view class="error-box">
  5. <view class="flex_box flex_row_center">
  6. <u-image src="@/static/image/error-img.png" width="112rpx" height="112rpx"></u-image>
  7. </view>
  8. <view class="tips-value">请确认该商品出库数量</view>
  9. <view class="num-box">
  10. <u-number-box v-model="numberVal" :inputWidth="56" :min="min" :max="max">
  11. <!-- <view slot="minus" class="minus">
  12. <u-icon name="minus" color="#0256FF" size="12"></u-icon>
  13. </view>
  14. <text slot="input" class="input">{{numberVal}}</text>
  15. <view slot="plus" class="plus">
  16. <u-icon name="plus" color="#FFFFFF" size="12"></u-icon>
  17. </view> -->
  18. </u-number-box>
  19. </view>
  20. </good-item>
  21. <view class="btn-box">
  22. <u-button class="no-btn" type="primary" :plain="true" text="取消" @click="closeClick"></u-button>
  23. <u-button class="yes-btn" type="primary" text="确认" @click="confirmClick"></u-button>
  24. </view>
  25. </view>
  26. </u-popup>
  27. </view>
  28. </template>
  29. <script>
  30. export default{
  31. props:{
  32. value:{
  33. type:Boolean,
  34. default:false
  35. },
  36. scanNum:{
  37. type:[Number,String],
  38. default:1
  39. },
  40. min:{
  41. type:[Number,String],
  42. default:0
  43. },
  44. max:{
  45. type:[Number,String],
  46. default:Number.MAX_SAFE_INTEGER
  47. }
  48. },
  49. watch:{
  50. value: {
  51. handler(val) {
  52. this.scanedShow = val
  53. },
  54. immediate:true
  55. },
  56. scanNum: {
  57. handler(val) {
  58. console.log(val,'val')
  59. this.numberVal = val
  60. },
  61. immediate:true
  62. },
  63. },
  64. data() {
  65. return {
  66. scanedShow:false,
  67. numberVal:0
  68. }
  69. },
  70. methods:{
  71. closeClick() {
  72. this.$emit('close')
  73. },
  74. confirmClick() {
  75. this.$emit('confirm',this.numberVal)
  76. }
  77. }
  78. }
  79. </script>
  80. <style lang="scss" scoped>
  81. .error-box {
  82. width: 580rpx;
  83. padding: 48rpx 36rpx 48rpx;
  84. .tips-value {
  85. color: #1D212A;
  86. font-family: "PingFang SC";
  87. font-size: 32rpx;
  88. font-style: normal;
  89. font-weight: bold;
  90. margin-top: 30rpx;
  91. text-align: center;
  92. }
  93. .btn-box {
  94. display: flex;
  95. justify-content: space-between;
  96. margin-top: 40rpx;
  97. .no-btn {
  98. width: 244rpx;
  99. border-radius: 16rpx;
  100. border: 1px solid #BFC8DB;
  101. color: #86909C;
  102. font-size: 32rpx;
  103. }
  104. .yes-btn {
  105. width: 244rpx;
  106. border-radius: 16rpx;
  107. background: #0256FF;
  108. font-size: 32rpx;
  109. }
  110. }
  111. .num-box {
  112. display: flex;
  113. align-items: center;
  114. justify-content: center;
  115. margin-top: 30rpx;
  116. .input {
  117. width: 112rpx;
  118. text-align: center;
  119. border-bottom: 1px solid #0256FF;
  120. margin: 0 8rpx;
  121. }
  122. .minus {
  123. width: 40rpx;
  124. height: 40rpx;
  125. border-radius: 8rpx;
  126. border: 1px solid #0256FF;
  127. display: flex;
  128. align-items: center;
  129. justify-content: center;
  130. }
  131. .plus {
  132. width: 40rpx;
  133. height: 40rpx;
  134. border-radius: 8rpx;
  135. background-color: #0256FF;
  136. display: flex;
  137. align-items: center;
  138. justify-content: center;
  139. }
  140. }
  141. }
  142. </style>