luobisheng
2022-11-04 eda46bf83619297600436e5015fd8977e9974219
src/views/operate/fivepack/shop/components/header/index.vue
@@ -6,13 +6,13 @@
                    <span>输入查询:</span>
                    <el-input placeholder="店铺(门店)名称" v-model="search"></el-input>
                </div>
                <div class="status">
                <!-- <div class="status">
                    <span>店铺状态:</span>
                    <el-input placeholder="选择店铺状态" v-model="search"></el-input>
                </div>
                    <el-input placeholder="选择店铺状态" v-model="shopStatus"></el-input>
                </div> -->
                <div class="findBtn">
                    <el-button type="primary" @click="setSearch" icon="el-icon-search">查询</el-button>
                    <el-button icon="el-icon-delete-solid">重置</el-button>
                    <el-button icon="el-icon-delete-solid" @click="clearSearch">重置</el-button>
                </div>
            </div>
            <div class="add">
@@ -21,7 +21,7 @@
        </div>
        <div class="footer">
            <el-dialog :visible.sync="dialogCreate" title="添加店铺" width="45%" v-if="dialogCreate">
            <el-dialog :visible.sync="dialogCreate" title="添加店铺" width="45%" v-if="dialogCreate" :before-close="handleClose">
                <createUser @sendDialog="sendDialog" />
            </el-dialog>
        </div>
@@ -37,17 +37,35 @@
        return {
            dialogCreate: false,
            search: '',
            shopStatus:'',
        }
    },
    methods: {
        // 返回给父级搜索内容
        setSearch() {
            this.$emit('getSearch', { text: this.search })
        },
        // 父级关闭dialog
        sendDialog(flag) {
            console.log(flag);
            this.dialogCreate = flag.flag;
            this.$emit('setDialog', { flag: true })
        }
        },
        //关闭dialog
        handleClose(done){
            console.log(done);
            this.$confirm('确定关闭?')
            .then(_=>{
                done();
            })
            .catch(err=>{
            })
        },
        // 清空search
        clearSearch(){
            this.search = '';
            this.$emit('getSearch',{text:this.search});
        },
    },
    props: ['setDialog', 'getSearch', 'flag'],
}