<template>
  <div>
    <div style="margin:40px;">
      <vue-gic-store-new class="inline-block" ref="storeNew" :options="options" :uuid.sync="uuid" :isAdd="isAdd"></vue-gic-store-new>
      <el-button @click="isSaveFun" type="primary">检查是否保存</el-button> {{isSave}}
    </div>
    <div style="margin:40px;">
      <vue-gic-store-card  ref="storeCard" :uuid.sync="uuid"></vue-gic-store-card>
      <el-button style="margin:10px;" @click="isStoreEmpty" type="primary">检查是否为空</el-button> {{isEmpty}}
    </div>
  </div>
</template>
<script>
import gicStoreNew from '../component/dmStore/index.vue'
import gicStoreCard from '../component/dmStore/store-card.vue'
  export default {
    components:{
      'vue-gic-store-new':gicStoreNew,
      'vue-gic-store-card':gicStoreCard

    },
    data() {
      return {
        // 参数
        uuid:'8f02ccc0e35911e8aaf8672621cbd00c',  // 新增传空，编辑必传,
        // 需要的下拉 默认为全部[0,1,2,3,4,5]
        // 0 全部 1 门店类型 2门店标签 3 门店区域 4 门店分组 5 部分门店
        options:[0,1,2,3,4,5],
        isAdd:false,
        isSave:false,
        isEmpty:0
      }
    },
    mounted() {
      this.$refs.storeCard.init();
    },
    methods:{
      isSaveFun() {
        this.$refs.storeNew.isStoreSave().then(res => {
          this.$tips({type:'warning',message:res?'已保存':'未保存'});
          this.isSave = res;
        })
      },
      isStoreEmpty() {
          this.$refs.storeCard.getRightList().then(res => {
          this.$tips({type:'warning',message:res?'有数据':'没有数据'});
          this.isEmpty = res;
        })
      }
    }
  };
</script>



