123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- <template>
- <a-modal
- v-model="opened"
- :title="title"
- centered
- :maskClosable="false"
- :confirmLoading="confirmLoading"
- width="450px"
- :footer="null"
- @cancel="cancel"
- >
- <a-spin :spinning="spinning" tip="Loading...">
- <div style="padding: 0 30px;">
- <aRadioGroup v-model="upActiveVal">
- <aRadio :style="radioStyle" value="0">
- 不参加促销
- </aRadio>
- <div v-for="(item,idx) in activeList" :key="idx">
- <div>
- <strong>{{ item.title }}</strong>
- <!-- <a-popover title="活动详情">
- <div slot="content">
- <ul class="active-li">
- <li><strong>促销类型:</strong> 买产品送产品</li>
- <li><strong>促销门槛:</strong> 购买1000元门槛产品,可使用200元配额,采购正价产品</li>
- <li><strong>促销规则:</strong> 购买满10个正价产品,送10个促销产品</li>
- <li><strong>限制正价产品款数</strong> 40</li>
- <li><strong>订单起订金额:</strong> 20000</li>
- <li><strong>活动经费上线:</strong> 5000</li>
- </ul>
- </div>
- <a-button type="link">详情</a-button>
- </a-popover> -->
- </div>
- <aRadio :style="radioStyle" v-for="(sitem,sindex) in item.promotionRuleList" :key="sindex" :value="item.promotionSn+'-'+sitem.promotionRuleSn+'-'+sitem.promotionProductType">
- {{sindex+1}}、{{ sitem.description }}
- </aRadio>
- </div>
- </aRadioGroup>
- </div>
- <div style="padding: 30px 0 0;text-align: center;">
- <a-button @click="cancel" style="margin-right: 15px" id="chooseCustom-btn-back">取消</a-button>
- <a-button type="primary" :loading="confirmLoading" @click="handleSubmit" id="chooseCustom-btn-submit">确定</a-button>
- </div>
- </a-spin>
- </a-modal>
- </template>
- <script>
- import { commonMixin } from '@/utils/mixin'
- import { salesPromoMatchProduct } from '@/api/salesNew'
- export default {
- name: 'SetWarehouse',
- mixins: [commonMixin],
- props: {
- show: [Boolean]
- },
- data () {
- return {
- opened: this.show,
- spinning: false,
- title: '确定换促销活动?',
- confirmLoading: false,
- upActiveVal: null,
- radioStyle:"display:block;height: '30px';lineHeight: '30px';padding:5px 0;",
- activeList: null,
- editRow: null
- }
- },
- methods: {
- getActiveList(data, record){
- this.editRow = record
- this.spinning = true
- salesPromoMatchProduct(data).then(res => {
- this.activeList = res.data
- this.spinning = false
- })
- },
- // 保存
- handleSubmit (e) {
- e.preventDefault()
- const _this = this
- if(_this.upActiveVal){
- _this.$emit('ok', _this.upActiveVal, _this.editRow)
- }else{
- _this.$message.info("请选择活动规则!")
- }
- },
- cancel () {
- this.opened = false
- this.upActiveVal = null
- this.$emit('cancel')
- }
- },
- watch: {
- show (newValue, oldValue) {
- this.opened = newValue
- if (!newValue) {
- this.upActiveVal = null
- }
- }
- }
- }
- </script>
|