editModal.vue 4.3 KB

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