<template>
    <a-modal title="激活名单" :visible="childShow" @ok="activeOk " @cancel="activeCancel" :width=500
        :body-style="{width:200}">
        <a-row style="margin-top:20px">
            <a-col span="4">激活原因:</a-col>
            <a-col span="20">
                <a-textarea type="textarea" placeholder="请输入激活原因" v-model="remarks" :rows="5" />
            </a-col>
        </a-row>
    </a-modal> 
</template>
<script>

import { postAction } from '@/api/manage'
import store from '@/store'
export default {
    name: 'CustomerBusinessActive',
    data() {
        return {
            remarks: undefined,
            activeParam: {}
        }
    },
    props: ['childShow', 'para'],
    watch: {
        immediate: true,
        childShow: {
            handler() {
                this.activeParam = this.para;
            },
        }
    },
    methods: {
        activeOk() {
            this.activeParam.invalidReason = this.remarks;
            this.activeParam.status = '1';
            this.activeParam.createBy = store.getters.userInfo.id;
            postAction("/customer/customerBusiness/edit", this.activeParam).then((res) => {
                if (res.success) {
                    this.$message.success('激活成功');
                    this.activeParam = {};
                    this.$emit('childReturn',false);
                }
            });
        },
        activeCancel() {
            this.activeParam = {};
            this.$emit('childReturn',false);
        }
    }
}
</script>
  