editModal.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. <template>
  2. <u-mask class="productModal" :show="isShow" :mask-click-able="false">
  3. <view class="product-con">
  4. <view class="product-main">
  5. <view class="p-title">
  6. <text>[{{infoData.shelfPlaceCode}}]</text> {{infoData.productCode}}
  7. </view>
  8. <view class="p-info flex align_center">
  9. <text>产品名称</text> {{infoData.productEntity.productName}}
  10. </view>
  11. <view class="p-info flex align_center">
  12. <text>单位</text> {{infoData.productEntity.unit}}
  13. </view>
  14. <view class="p-info flex align_center">
  15. <text>可用库存</text> {{infoData.qty}}
  16. </view>
  17. <view class="p-info flex align_center">
  18. <text>冻结库存</text>
  19. <view class="flex align_center">
  20. {{infoData.freezeQty}}
  21. <view v-if="infoData.freezeQty">
  22. <text>冻结明细</text>
  23. <u-icon name="arrow-right"></u-icon>
  24. </view>
  25. </view>
  26. </view>
  27. <view class="p-info flex align_center">
  28. <text>结算价格</text>
  29. <view>
  30. <text>{{infoData.price}}元</text>
  31. </view>
  32. </view>
  33. <view class="p-info flex align_center">
  34. <text>实际可用库存</text>
  35. <view>
  36. <view></view>
  37. <u-number-box v-model="infoData.checkQty" :index="infoData.id" :min="0" :max="999999"></u-number-box>
  38. </view>
  39. </view>
  40. </view>
  41. <view class="product-footer">
  42. <view class="button-cancel" @click="isShow=false">取消</view>
  43. <view class="button-confirm" @click="handleConfirm">确定</view>
  44. </view>
  45. </view>
  46. </u-mask>
  47. </template>
  48. <script>
  49. export default {
  50. props: {
  51. openModal: { // 弹框显示状态
  52. type: Boolean,
  53. default: false
  54. },
  55. infoData: {
  56. tyoe: Object,
  57. default: ()=>{
  58. return null
  59. }
  60. },
  61. },
  62. data() {
  63. return {
  64. isShow: this.openModal, // 是否打开弹框
  65. }
  66. },
  67. methods: {
  68. // 确认
  69. handleConfirm(){
  70. if(this.infoData.checkQty){
  71. this.$emit('addProduct',{
  72. shelfSn: this.infoData.shelfSn,
  73. shelfPlaceSn: this.infoData.shelfPlaceSn,
  74. shelfPlaceCode: this.infoData.shelfPlaceCode,
  75. productCode: this.infoData.productCode,
  76. productSn: this.infoData.productSn,
  77. stockQty: this.infoData.stockQty,
  78. freezeQty: this.infoData.freezeQty,
  79. stockQty: this.infoData.qty,
  80. checkQty: this.infoData.checkQty,
  81. stockCheckDetailSn: this.infoData.stockCheckDetailSn || undefined,
  82. cost: this.infoData.cost
  83. })
  84. }else{
  85. uni.showToast({
  86. icon: "none",
  87. title: '请输入实际可用库存'
  88. })
  89. }
  90. },
  91. },
  92. watch: {
  93. // 父页面传过来的弹框状态
  94. openModal (newValue, oldValue) {
  95. this.isShow = newValue
  96. },
  97. // 重定义的弹框状态
  98. isShow (newValue, oldValue) {
  99. if (!newValue) {
  100. this.$emit('close')
  101. }
  102. }
  103. }
  104. }
  105. </script>
  106. <style lang="scss" scoped>
  107. .productModal{
  108. width: 100%;
  109. height: 100vh;
  110. font-size: 24upx;
  111. .text-c{
  112. text-align: center;
  113. }
  114. .product-con{
  115. width: 75%;
  116. margin: 25vh auto 0;
  117. background-color: #fff;
  118. border-radius: 24upx;
  119. .product-main{
  120. padding: 30upx;
  121. max-height: 50vh;
  122. overflow: auto;
  123. .p-title{
  124. padding: 15upx 20upx;
  125. background-color: #ededed;
  126. border-radius: 60upx;
  127. text-align: center;
  128. > text{
  129. margin-right: 15rpx;
  130. }
  131. }
  132. .p-info{
  133. padding: 20upx 10upx;
  134. > text{
  135. width: 150upx;
  136. color: #666;
  137. }
  138. > view{
  139. flex-grow:1;
  140. display: flex;
  141. justify-content: space-between;
  142. >view{
  143. > text{
  144. color:#55aaff;
  145. }
  146. }
  147. }
  148. border-bottom: 2rpx solid #eee;
  149. }
  150. }
  151. .product-footer{
  152. font-size: 30upx;
  153. display: flex;
  154. justify-content: space-between;
  155. align-items: center;
  156. text-align: center;
  157. border-top: 1upx solid #E5E5E5;
  158. .button-cancel{
  159. color: #999;
  160. border-right: 1upx solid #E5E5E5;
  161. flex-grow: 1;
  162. padding: 20upx 0;
  163. }
  164. .button-confirm{
  165. color: #2A86F4;
  166. flex-grow: 1;
  167. padding: 20upx 0;
  168. }
  169. }
  170. }
  171. }
  172. </style>