<template>
  <div>
    <ImportDialog
      :tablename="tablename"
      :main-table="mainTable"
      :title="title"
      :visible="visible"
      :main-id="mainId"
      :father-method="fatherClose"
      :joinType='type'
      :custom-import="mainId=='3139'?true:false"
      @closeDialog="fatherClose"
      @changeJoinGoods="changeJoinGoods($event)"
      
    />
  </div>
</template>
<script>


  import ImportDialog from '../customizedContent/ImportDialog';

  export default {
    components: { ImportDialog },
    props: {
      visible: { // 获取ID用于多选
        type: Boolean,
        default: false
      },
      pageMsgId: { // 活动明细id
        type: String,
        default: ''
      },
      type: { // 参与商品或者排除商品
        type: String,
        default: ''
      } 
    },
    data() {
      return {
        tablename: 'T_OMSACTIVEJOINGOODS',
        mainTable: 'T_V_OMSACTIVE',
        mainId: this.pageMsgId,
        title: '参与商品',
      };
    },
    watch: {
      type(val) {
        if (val == 'name2') {
          this.title = '参与商品';
        } else if (val == 'name3') {
          this.title = '排除商品';
        }
      },
    },
    methods: {
      fatherClose() {
        this.$emit('closeActionDialog', true);
      },
      changeJoinGoods(value) {
        this.$emit('changeJoinGoods', value);
      }
    }
  };
</script>
