stockModal.vue 3.1 KB

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