meargeOptionModal.vue 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <template>
  2. <a-modal
  3. centered
  4. :footer="null"
  5. :maskClosable="false"
  6. title="选择合并方式"
  7. v-model="isShow"
  8. @cancel="isShow=false"
  9. width="500px">
  10. <a-spin :spinning="spinning" tip="Loading...">
  11. <div style="padding:15px;">
  12. <a-icon :style="{ fontSize: '16px', color: '#666', marginRight:'6px' }" type="check-square" /> 相同客户名称
  13. </div>
  14. <div style="padding:5px 0 25px 40px;" v-if="sameCustomeName">
  15. <a-checkbox id="meargeOptions-sameRules1" v-model="sameRules1" @change="sameRules2=undefined">相同促销活动</a-checkbox>
  16. <a-checkbox id="meargeOptions-sameRules2" v-model="sameRules2" @change="sameRules1=undefined">相同活动规则(同一促销活动)</a-checkbox>
  17. </div>
  18. <div class="btn-cont" style="padding:20px 20px 0;text-align: center;">
  19. <a-button type="info" @click="isShow=false" id="meargeOptions-cancel-btn">取消</a-button>
  20. <a-button type="primary" style="margin-left: 10px" @click="submit" id="meargeOptions-ok-btn">确定</a-button>
  21. </div>
  22. </a-spin>
  23. </a-modal>
  24. </template>
  25. <script>
  26. import {
  27. commonMixin
  28. } from '@/utils/mixin'
  29. export default {
  30. name: 'ViewSelectModal',
  31. mixins: [commonMixin],
  32. props: {
  33. openModal: {
  34. type: Boolean, // 弹框显示
  35. default: false
  36. }
  37. },
  38. data () {
  39. return {
  40. spinning: false,
  41. isShow: this.openModal,
  42. sameCustomeName: true, // 是否勾选相同客户名称
  43. sameRules1: undefined, // 相同促销活动
  44. sameRules2: undefined, // 相同活动规则(同一促销活动)
  45. groupType: 'CUSTOMER'
  46. }
  47. },
  48. methods: {
  49. // 确定提交
  50. submit () {
  51. if (!this.sameRules1 && !this.sameRules2) {
  52. this.groupType = 'CUSTOMER' // 相同客户名称
  53. } else {
  54. if (this.sameRules1) {
  55. this.groupType = 'CUSTOMER_PROMO' // 相同促销活动
  56. } else if (this.sameRules2) {
  57. this.groupType = 'CUSTOMER_PROMO_RULE' // 相同活动规则(同一促销活动)
  58. }
  59. }
  60. this.$emit('meargeOk', this.groupType)
  61. this.isShow = false
  62. }
  63. },
  64. watch: {
  65. openModal (nVal, oVal) {
  66. this.isShow = nVal
  67. },
  68. isShow (nVal, oVal) {
  69. if (!nVal) {
  70. this.$emit('close')
  71. } else {
  72. this.sameRules1 = undefined
  73. this.sameRules2 = undefined
  74. this.groupType = 'CUSTOMER'
  75. }
  76. }
  77. }
  78. }
  79. </script>
  80. <style>
  81. </style>