updateActiveModal.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <template>
  2. <a-modal
  3. v-model="opened"
  4. :title="title"
  5. centered
  6. :maskClosable="false"
  7. :confirmLoading="confirmLoading"
  8. width="450px"
  9. :footer="null"
  10. @cancel="cancel"
  11. >
  12. <a-spin :spinning="spinning" tip="Loading...">
  13. <div style="padding: 0 30px;">
  14. <aRadioGroup v-model="upActiveVal">
  15. <aRadio :style="radioStyle" value="0">
  16. 不参加促销
  17. </aRadio>
  18. <div v-for="(item,idx) in activeList" :key="idx">
  19. <div>
  20. <strong>{{ item.title }}</strong>
  21. <!-- <a-popover title="活动详情">
  22. <div slot="content">
  23. <ul class="active-li">
  24. <li><strong>促销类型:</strong> 买产品送产品</li>
  25. <li><strong>促销门槛:</strong> 购买1000元门槛产品,可使用200元配额,采购正价产品</li>
  26. <li><strong>促销规则:</strong> 购买满10个正价产品,送10个促销产品</li>
  27. <li><strong>限制正价产品款数</strong> 40</li>
  28. <li><strong>订单起订金额:</strong> 20000</li>
  29. <li><strong>活动经费上线:</strong> 5000</li>
  30. </ul>
  31. </div>
  32. <a-button type="link">详情</a-button>
  33. </a-popover> -->
  34. </div>
  35. <aRadio :style="radioStyle" v-for="(sitem,sindex) in item.promotionRuleList" :key="sindex" :value="item.promotionSn+'-'+sitem.promotionRuleSn+'-'+sitem.promotionProductType">
  36. {{sindex+1}}、{{ sitem.description }}
  37. </aRadio>
  38. </div>
  39. </aRadioGroup>
  40. </div>
  41. <div style="padding: 30px 0 0;text-align: center;">
  42. <a-button @click="cancel" style="margin-right: 15px" id="chooseCustom-btn-back">取消</a-button>
  43. <a-button type="primary" :loading="confirmLoading" @click="handleSubmit" id="chooseCustom-btn-submit">确定</a-button>
  44. </div>
  45. </a-spin>
  46. </a-modal>
  47. </template>
  48. <script>
  49. import { commonMixin } from '@/utils/mixin'
  50. import { salesPromoMatchProduct } from '@/api/salesNew'
  51. export default {
  52. name: 'SetWarehouse',
  53. mixins: [commonMixin],
  54. props: {
  55. show: [Boolean]
  56. },
  57. data () {
  58. return {
  59. opened: this.show,
  60. spinning: false,
  61. title: '确定换促销活动?',
  62. confirmLoading: false,
  63. upActiveVal: null,
  64. radioStyle:"display:block;height: '30px';lineHeight: '30px';padding:5px 0;",
  65. activeList: null,
  66. editRow: null
  67. }
  68. },
  69. methods: {
  70. getActiveList(data, record){
  71. this.editRow = record
  72. this.spinning = true
  73. salesPromoMatchProduct(data).then(res => {
  74. this.activeList = res.data
  75. this.spinning = false
  76. })
  77. },
  78. // 保存
  79. handleSubmit (e) {
  80. e.preventDefault()
  81. const _this = this
  82. if(_this.upActiveVal){
  83. _this.$emit('ok', _this.upActiveVal, _this.editRow)
  84. }else{
  85. _this.$message.info("请选择活动规则!")
  86. }
  87. },
  88. cancel () {
  89. this.opened = false
  90. this.upActiveVal = null
  91. this.$emit('cancel')
  92. }
  93. },
  94. watch: {
  95. show (newValue, oldValue) {
  96. this.opened = newValue
  97. if (!newValue) {
  98. this.upActiveVal = null
  99. }
  100. }
  101. }
  102. }
  103. </script>