editModal.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  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.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. <!-- 冻结明细 -->
  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. if(this.infoData.checkQty){
  81. this.$emit('addProduct',{
  82. shelfSn: this.infoData.shelfSn,
  83. shelfPlaceSn: this.infoData.shelfPlaceSn,
  84. shelfPlaceCode: this.infoData.shelfPlaceCode,
  85. productCode: this.infoData.productCode,
  86. productSn: this.infoData.productSn,
  87. freezeQty: this.infoData.freezeQty,
  88. stockQty: this.infoData.currQty,
  89. checkQty: this.infoData.checkQty,
  90. stockCheckDetailSn: this.infoData.stockCheckDetailSn || undefined,
  91. cost: this.infoData.cost
  92. })
  93. }else{
  94. uni.showToast({
  95. icon: "none",
  96. title: '请输入实际可用库存'
  97. })
  98. }
  99. },
  100. },
  101. watch: {
  102. // 父页面传过来的弹框状态
  103. openModal (newValue, oldValue) {
  104. this.isShow = newValue
  105. },
  106. // 重定义的弹框状态
  107. isShow (newValue, oldValue) {
  108. if (!newValue) {
  109. this.$emit('close')
  110. }
  111. }
  112. }
  113. }
  114. </script>
  115. <style lang="scss" scoped>
  116. .productModal{
  117. width: 100%;
  118. height: 100vh;
  119. font-size: 24upx;
  120. .text-c{
  121. text-align: center;
  122. }
  123. .product-con{
  124. width: 75%;
  125. margin: 25vh auto 0;
  126. background-color: #fff;
  127. border-radius: 24upx;
  128. .product-main{
  129. padding: 30upx;
  130. max-height: 50vh;
  131. overflow: auto;
  132. .p-title{
  133. padding: 15upx 20upx;
  134. background-color: #ededed;
  135. border-radius: 60upx;
  136. text-align: center;
  137. > text{
  138. margin-right: 15rpx;
  139. }
  140. }
  141. .p-info{
  142. padding: 20upx 10upx;
  143. > text{
  144. width: 150upx;
  145. color: #666;
  146. }
  147. > view{
  148. flex-grow:1;
  149. display: flex;
  150. justify-content: space-between;
  151. >view{
  152. > text{
  153. color:#55aaff;
  154. }
  155. }
  156. }
  157. border-bottom: 2rpx solid #eee;
  158. }
  159. }
  160. .product-footer{
  161. font-size: 30upx;
  162. display: flex;
  163. justify-content: space-between;
  164. align-items: center;
  165. text-align: center;
  166. border-top: 1upx solid #E5E5E5;
  167. .button-cancel{
  168. color: #999;
  169. border-right: 1upx solid #E5E5E5;
  170. flex-grow: 1;
  171. padding: 20upx 0;
  172. }
  173. .button-confirm{
  174. color: #2A86F4;
  175. flex-grow: 1;
  176. padding: 20upx 0;
  177. }
  178. }
  179. }
  180. }
  181. </style>