stockModal.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <template>
  2. <u-mask class="stockModal" :show="isShow" :mask-click-able="false">
  3. <view class="modal-con">
  4. <view class="modal-title">以下产品库存不足<br/>确认继续补货吗?</view>
  5. <scroll-view scroll-y class="modal-main">
  6. <view class="modal-box" v-for="(item, index) in list" :key="index">
  7. <view class="modal-p-header">
  8. <view class="modal-p-code">{{item.product&&item.product.code?item.product.code:'--'}}</view>
  9. <view class="modal-p-num">库存<text class="txt-red">{{item.stockQty||item.stockQty==0?item.stockQty:'--'}}</text>/补货<text class="txt-main">{{item.confirmQty||item.confirmQty==0?item.confirmQty:'--'}}</text>{{item.product&&item.product.unit?item.product.unit:'--'}}</view>
  10. </view>
  11. <view class="modal-p-footer">{{item.product&&item.product.name?item.product.name:'--'}}</view>
  12. </view>
  13. </scroll-view>
  14. <view class="modal-footer">
  15. <view class="button-cancel" @click="isShow=false">返回修改</view>
  16. <view class="button-confirm" @click="handleConfirm">仍然补货</view>
  17. </view>
  18. </view>
  19. </u-mask>
  20. </template>
  21. <script>
  22. export default {
  23. props: {
  24. openModal: { // 弹框显示状态
  25. type: Boolean,
  26. default: false
  27. },
  28. list: { // 库存不足产品信息
  29. type: Array,
  30. default: () => {
  31. return []
  32. }
  33. },
  34. params: {
  35. type: Object,
  36. default: () => {
  37. return {}
  38. }
  39. }
  40. },
  41. data() {
  42. return {
  43. isShow: this.openModal, // 是否打开弹框
  44. }
  45. },
  46. methods: {
  47. // 确认
  48. handleConfirm(){
  49. this.$emit('confirm', this.params)
  50. }
  51. },
  52. watch: {
  53. // 父页面传过来的弹框状态
  54. openModal (newValue, oldValue) {
  55. this.isShow = newValue
  56. },
  57. // 重定义的弹框状态
  58. isShow (newValue, oldValue) {
  59. if (!newValue) {
  60. this.$emit('close')
  61. }
  62. }
  63. }
  64. }
  65. </script>
  66. <style lang="scss" scoped>
  67. .stockModal{
  68. width: 100%;
  69. height: 100%;
  70. position: absolute;
  71. left: 0;
  72. top: 0;
  73. .modal-con{
  74. width: 78%;
  75. margin: 40% auto 0;
  76. background-color: #fff;
  77. border-radius: 24upx;
  78. .modal-title{
  79. text-align: center;
  80. font-size: 28upx;
  81. color: #000;
  82. padding: 30upx 30upx 0;
  83. }
  84. .modal-main{
  85. padding: 30upx 20upx 40upx;
  86. box-sizing: border-box;
  87. height: 400upx;
  88. overflow: hidden;
  89. .modal-box{
  90. padding: 20upx 0;
  91. border-top: 1upx dashed #E5E5E5;
  92. .modal-p-header{
  93. display: flex;
  94. justify-content: space-between;
  95. align-content: center;
  96. color: #999999;
  97. margin-bottom: 20upx;
  98. .modal-p-num{
  99. .txt-red{
  100. color: red;
  101. }
  102. .txt-main{
  103. color: #000;
  104. }
  105. }
  106. }
  107. }
  108. }
  109. .modal-footer{
  110. font-size: 30upx;
  111. display: flex;
  112. justify-content: space-between;
  113. align-items: center;
  114. text-align: center;
  115. border-top: 1upx solid #E5E5E5;
  116. .button-cancel{
  117. color: #999;
  118. border-right: 1upx solid #E5E5E5;
  119. flex-grow: 1;
  120. padding: 20upx 0;
  121. }
  122. .button-confirm{
  123. color: #2A86F4;
  124. flex-grow: 1;
  125. padding: 20upx 0;
  126. }
  127. }
  128. }
  129. }
  130. </style>