editModal.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  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.currQty}}
  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" @click="showDetail">
  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.cost}}元</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. <!-- 冻结明细 -->
  47. <freezeDetailModal :openModal="showModal" :infoData="infoData" @close="showModal=false"></freezeDetailModal>
  48. </u-mask>
  49. </template>
  50. <script>
  51. import freezeDetailModal from './freezeDetailModal'
  52. export default {
  53. components: {
  54. freezeDetailModal
  55. },
  56. props: {
  57. openModal: { // 弹框显示状态
  58. type: Boolean,
  59. default: false
  60. },
  61. infoData: {
  62. tyoe: Object,
  63. default: ()=>{
  64. return null
  65. }
  66. },
  67. },
  68. data() {
  69. return {
  70. isShow: this.openModal, // 是否打开弹框
  71. showModal: false,
  72. }
  73. },
  74. methods: {
  75. showDetail(){
  76. this.showModal = true
  77. },
  78. // 确认
  79. handleConfirm(){
  80. this.$emit('addProduct',{
  81. shelfSn: this.infoData.shelfSn,
  82. shelfPlaceSn: this.infoData.shelfPlaceSn,
  83. shelfPlaceCode: this.infoData.shelfPlaceCode,
  84. productCode: this.infoData.productCode,
  85. productSn: this.infoData.productSn,
  86. freezeQty: this.infoData.freezeQty,
  87. stockQty: this.infoData.currQty,
  88. checkQty: this.infoData.checkQty,
  89. stockCheckDetailSn: this.infoData.stockCheckDetailSn || undefined,
  90. cost: this.infoData.cost
  91. })
  92. },
  93. },
  94. watch: {
  95. // 父页面传过来的弹框状态
  96. openModal (newValue, oldValue) {
  97. this.isShow = newValue
  98. },
  99. // 重定义的弹框状态
  100. isShow (newValue, oldValue) {
  101. if (!newValue) {
  102. this.$emit('close')
  103. }
  104. }
  105. }
  106. }
  107. </script>
  108. <style lang="scss" scoped>
  109. .productModal{
  110. width: 100%;
  111. height: 100vh;
  112. font-size: 24upx;
  113. .text-c{
  114. text-align: center;
  115. }
  116. .product-con{
  117. width: 75%;
  118. margin: 25vh auto 0;
  119. background-color: #fff;
  120. border-radius: 24upx;
  121. .product-main{
  122. padding: 30upx;
  123. max-height: 50vh;
  124. overflow: auto;
  125. .p-title{
  126. padding: 15upx 20upx;
  127. background-color: #ededed;
  128. border-radius: 60upx;
  129. text-align: center;
  130. > text{
  131. margin-right: 15rpx;
  132. }
  133. }
  134. .p-info{
  135. padding: 20upx 10upx;
  136. > text{
  137. width: 150upx;
  138. color: #666;
  139. }
  140. > view{
  141. flex-grow:1;
  142. display: flex;
  143. justify-content: space-between;
  144. >view{
  145. > text{
  146. color:#55aaff;
  147. }
  148. }
  149. }
  150. border-bottom: 2rpx solid #eee;
  151. }
  152. }
  153. .product-footer{
  154. font-size: 30upx;
  155. display: flex;
  156. justify-content: space-between;
  157. align-items: center;
  158. text-align: center;
  159. border-top: 1upx solid #E5E5E5;
  160. .button-cancel{
  161. color: #999;
  162. border-right: 1upx solid #E5E5E5;
  163. flex-grow: 1;
  164. padding: 20upx 0;
  165. }
  166. .button-confirm{
  167. color: #2A86F4;
  168. flex-grow: 1;
  169. padding: 20upx 0;
  170. }
  171. }
  172. }
  173. }
  174. </style>