printStickerModal.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <template>
  2. <u-mask class="commonModal" :show="isShow" :mask-click-able="false">
  3. <view class="modal-con">
  4. <view class="modal-title">打印贴签</view>
  5. <view class="modal-main">
  6. <u-radio-group v-model="printType">
  7. <u-radio name="manual">
  8. <view class="print-con">
  9. <u-image class="item-pic" src="../../static/default/icon_print_manual.png" width="80" height="80"></u-image>
  10. <view class="print-main">
  11. <text class="print-type">打印【{{layer}}】层</text>
  12. <text class="print-exp">打印当前层的所有产品</text>
  13. </view>
  14. </view>
  15. </u-radio>
  16. <u-radio name="scan">
  17. <view class="print-con">
  18. <u-image class="item-pic" src="../../static/default/icon_search.png" width="80" height="80"></u-image>
  19. <view class="print-main">
  20. <text class="print-type">自选打印</text>
  21. <text class="print-exp">按产品编码搜索后进行打印</text>
  22. </view>
  23. </view>
  24. </u-radio>
  25. </u-radio-group>
  26. </view>
  27. <view class="modal-footer">
  28. <view class="button-cancel" @click="isShow=false">取消</view>
  29. <view class="button-confirm" @click="handleConfirm">确定</view>
  30. </view>
  31. </view>
  32. </u-mask>
  33. </template>
  34. <script>
  35. export default {
  36. props: {
  37. openModal: { // 弹框显示状态
  38. type: Boolean,
  39. default: false
  40. },
  41. layer: {
  42. type: String,
  43. default:''
  44. }
  45. },
  46. data() {
  47. return {
  48. isShow: this.openModal, // 是否打开弹框
  49. printType: 'manual'
  50. }
  51. },
  52. methods: {
  53. // 确认
  54. handleConfirm(){
  55. this.$emit('confirm', this.printType)
  56. }
  57. },
  58. watch: {
  59. // 父页面传过来的弹框状态
  60. openModal (newValue, oldValue) {
  61. this.isShow = newValue
  62. },
  63. // 重定义的弹框状态
  64. isShow (newValue, oldValue) {
  65. if (!newValue) {
  66. this.$emit('close')
  67. }
  68. }
  69. }
  70. }
  71. </script>
  72. <style lang="scss" scoped>
  73. .commonModal{
  74. width: 100%;
  75. height: 100%;
  76. position: absolute;
  77. left: 0;
  78. top: 0;
  79. .modal-con{
  80. width: 70%;
  81. margin: 50% auto 0;
  82. background-color: #fff;
  83. border-radius: 24upx;
  84. font-size: 26upx;
  85. .modal-title{
  86. text-align: center;
  87. font-size: 30upx;
  88. color: #000;
  89. padding: 30upx 30upx 0;
  90. }
  91. .modal-main{
  92. margin: 20upx 0 30upx;
  93. /deep/ .u-radio{
  94. width: 94%!important;
  95. flex-direction: row-reverse;
  96. justify-content: space-between;
  97. margin: 0 3%;
  98. }
  99. /deep/ .u-radio__icon-wrap{
  100. flex-shrink: 0;
  101. }
  102. /deep/ .u-radio__label{
  103. flex-grow: 1;
  104. border-bottom: 2upx dashed #E5E5E5;
  105. padding: 3% 0;
  106. }
  107. .print-con{
  108. display: flex;
  109. justify-content: space-between;
  110. align-items: center;
  111. .item-pic{
  112. flex-shrink: 0;
  113. margin-right: 20upx;
  114. }
  115. .print-main{
  116. flex-grow: 1;
  117. .print-type{
  118. display: block;
  119. font-size: 30upx;
  120. color: #222;
  121. }
  122. .print-exp{
  123. display: block;
  124. font-size: 26upx;
  125. color: #666E75;
  126. line-height: 40upx;
  127. }
  128. }
  129. }
  130. }
  131. .modal-footer{
  132. font-size: 30upx;
  133. display: flex;
  134. justify-content: space-between;
  135. align-items: center;
  136. text-align: center;
  137. border-top: 1upx solid #E5E5E5;
  138. .button-cancel{
  139. color: #999;
  140. border-right: 1upx solid #E5E5E5;
  141. flex-grow: 1;
  142. padding: 20upx 0;
  143. }
  144. .button-confirm{
  145. color: #2A86F4;
  146. flex-grow: 1;
  147. padding: 20upx 0;
  148. }
  149. }
  150. }
  151. }
  152. </style>