Просмотр исходного кода

Merge branch 'master' of http://49.4.53.36:3000/hotel/hotel-saas-tenant-frontend

gqx лет назад: 2
Родитель
Сommit
2937a67ae0

+ 200 - 0
src/views/settings/components/storeAuthInformation.vue

@@ -0,0 +1,200 @@
+<template>
+    <a-form ref="form" :model="model" :form="form"  labelAlign="left"  :label-col="{ span: 6 }" :wrapper-col="{ span: 18 }">
+        <a-form-item v-show="false"><a-input v-decorator="['id']" /></a-form-item>
+        <a-row :gutter="[16,16]">
+            <a-col :span="8">
+                <a-form-item label="企业法人">
+                    <a-input type="text" placeholder="请填写企业法人"
+                             v-decorator="['legalPerson', { rules: [{ required: true, message: '请填写企业法人!' }] }]"></a-input>
+                </a-form-item>
+
+                <a-form-item label="经营场所">
+                    <a-input type="text" placeholder="请填写经营场所"
+                             v-decorator="['registeredAddress', { rules: [{ required: true, message: '请填写经营场所!' }] }]"></a-input>
+                </a-form-item>
+
+                <a-form-item label="有效期">
+                    <a-date-picker type="text" placeholder="请选择有效期"
+                                   v-decorator="['businessTerm', { rules: [{ required: false, message: '请选择有效期!' }] }]"></a-date-picker>
+                </a-form-item>
+                <a-form-item label="联系人姓名">
+                    <a-input type="text" placeholder="请填写联系人姓名"
+                             v-decorator="['sfzName', { rules: [{ required: true, message: '请填写联系人姓名!' }] }]"></a-input>
+                </a-form-item>
+
+                <a-form-item label="身份证号">
+                    <a-input type="text" placeholder="请填写身份证号"
+                             v-decorator="['idCard', { rules: [{ required: true, message: '请填写身份证号!' }] }]"></a-input>
+                </a-form-item>
+            </a-col>
+            <a-col :span="2">
+            </a-col>
+            <a-col :span="14">
+                <a-form-item label="上传实名证照"  :label-col="{ span: 3 }" :wrapper-col="{ span: 20 }">
+                    <a-row>
+                        <a-col span="20" push="16" >
+                            <a-button type="link" @click="warning">手持证件要求</a-button>
+                        </a-col>
+                    </a-row>
+                    <a-row >
+                        <a-col span="5" class="upload">
+                            <j-image-upload class="avatar-uploader" text="上传"
+                                            v-decorator="['ewmLogo', { rules: [{ required: true, message: '请上传门头照片!' }] }]"></j-image-upload>
+                            <span class="margin-top-18"><span style="color: red">*</span>门头照片</span>
+                        </a-col>
+                        <a-col span="5" class="upload">
+                            <j-image-upload class="avatar-uploader" text="上传"
+                                            v-decorator="['imgs', { rules: [{ required: true, message: '请上传前台照片!' }] }]"></j-image-upload>
+                            <span class="margin-top-18"><span style="color: red">*</span>前台照片</span>
+                        </a-col>
+                        <a-col span="5" class="upload">
+                            <j-image-upload class="avatar-uploader" text="上传"
+                                                        v-decorator="['sfzImg1', { rules: [{ required: true, message: '请上传法人身份证(正面)!' }] }]"></j-image-upload>
+                            <span class="margin-top-18"><span style="color: red">*</span>法人身份证(正面)</span>
+                        </a-col>
+                        <a-col span="5" class="upload">
+                            <j-image-upload class="avatar-uploader" text="上传"
+                                                         v-decorator="['sfzImg2', { rules: [{ required: true, message: '请上传法人身份证(反面)!' }] }]"></j-image-upload>
+                            <span class="margin-top-18"><span style="color: red">*</span>法人身份证(反面)</span>
+                        </a-col>
+                        <a-col span="5" class="upload">
+                            <j-image-upload class="avatar-uploader" text="上传"
+                                                        v-decorator="['sfzImg3', { rules: [{ required: true, message: '请上传法人手持身份证照片!' }] }]"></j-image-upload>
+                            <span class="margin-top-18"><span style="color: red">*</span>法人手持身份证照片</span>
+                        </a-col>
+                        <a-col span="5" class="upload">
+                            <j-image-upload class="avatar-uploader" text="上传"
+                                            v-decorator="['yyImg', { rules: [{ required: true, message: '请上传营业执照!' }] }]"></j-image-upload>
+                            <span class="margin-top-18"><span style="color: red">*</span>营业执照</span>
+                        </a-col>
+                        <a-col span="5" class="upload">
+                            <j-image-upload class="avatar-uploader" text="上传"
+                                            v-decorator="['tzhyImg']"></j-image-upload>
+                            <span class="margin-top-18">特种行业许可证</span>
+                        </a-col>
+                    </a-row>
+
+                </a-form-item>
+            </a-col>
+        </a-row>
+        <a-divider />
+        <a-row>
+            <a-col :span="24" :style="{ textAlign: 'right' }">
+                <a-button type="primary" @click="submit">确定</a-button>
+            </a-col>
+        </a-row>
+
+    </a-form>
+</template>
+
+<script>
+    import { Modal } from 'ant-design-vue';
+    import { editAuthInfo} from "../../../api/hotel";
+
+    export default {
+        created() {
+            // alert("这里获取当前缓存门店信息,照片信息");
+            var info = JSON.parse(localStorage.getItem("storeInfo"));
+            console.log(info);
+            setTimeout(() => {
+                this.form.setFieldsValue(
+                    {
+                        id: info.id,
+                        yyImg: info.yyImg,
+                        tzhyImg: info.tzhyImg,
+                        legalPerson: info.legalPerson,
+                        registeredAddress: info.registeredAddress,
+                        businessTerm: info.businessTerm,
+                        sfzImg1: info.sfzImg1,
+                        sfzImg2: info.sfzImg2,
+                        sfzImg3: info.sfzImg3,
+                        sfzName: info.sfzName,
+                        idCard: info.idCard,
+                        ewmLogo:info.ewmLogo,
+                        imgs:info.imgs
+                    }
+                )
+            },100)
+            // if (info.ewmLogo){
+            //     this.model.ewm = info.ewmLogo
+            // }
+            // if (info.imgs){
+            //     this.model.imgList = info.imgs;
+            // }
+        },
+        data() {
+            return {
+                visible: false,
+                formLayout: 'horizontal',
+                form: this.$form.createForm(this, { certImg: null }),
+                model: {
+                    certImg: null,
+                    id: 0,
+                    ewm: null,
+                    imgList: null
+                }
+            }
+        },
+        computed: {
+            formItemLayout() {
+                const { formLayout } = this;
+                return formLayout === 'horizontal'
+                    ? {
+                        labelCol: { span: 4 },
+                        wrapperCol: { span: 14 },
+                    }
+                    : {};
+            },
+        },
+        methods: {
+            warning() {
+                this.$warning({
+                    title: '手持身份证拍照要求',
+                    // JSX support
+                    content: (
+                        <ul>
+                        <li>免冠,建议未化妆,五官可见;</li>
+                <li>身份证全部信息清晰无遮挡,否则将无法通过认证;</li>
+                <li>完整露出手臂;</li>
+                <li>以酒店门头招牌为背景图片;</li>
+                <li>请勿进行任何软件处理;</li>
+                <li>单张图片不超过5M,尺寸要求500(长)X412(宽)以上,支持jpg、png、gif;</li>
+                </ul>
+            ),
+            });
+            },
+            submit() {
+                // console.log(this.form.values.certImg)
+                this.form.validateFields((err, values) => {
+                    console.log(values)
+                    if (!err) {
+                        // values['ewmLogo'] = this.model.ewm
+                        // values['imgs'] = this.model.imgList;
+                        editAuthInfo(values).then(res=>{
+                            if (res.code == 200){
+                                this.$message.success('编辑成功')
+                                localStorage.setItem("storeInfo", JSON.stringify(res.result))
+                            }else{
+                                this.$message.error(res.message)
+                            }
+
+                        })
+                    }
+                });
+            }
+        },
+    }
+</script>
+
+<style scoped>
+.upload{
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+    justify-items: center;
+    margin-top: 10px;
+}
+    .margin-top-18{
+        margin-top: -18px;
+    }
+</style>

+ 420 - 0
src/views/settings/components/storeInformation.vue

@@ -0,0 +1,420 @@
+<template>
+    <a-form ref="form" :model="model" :form="form" :rules="validatorRules"  labelAlign="left"  :label-col="{ span: 3 }" :wrapper-col="{ span: 21 }">
+        <a-form-item v-show="false"><a-input v-decorator="['id']" /></a-form-item>
+        <a-row :gutter="[16,16]">
+            <a-col :span="11">
+                <a-form-item label="门店名称">
+                    <a-input type="text" placeholder="请输入门店名称"
+                             v-decorator="['name', { rules: [{ required: true, message: '请输入门店名称!' }] }]"></a-input>
+                </a-form-item>
+<!--                <a-form-item label="所在地区">-->
+<!--                </a-form-item>-->
+                <a-form-item label="详细地址">
+                    <a-row>
+                        <a-col :span="20">
+                            <a-input type="text" placeholder="请输入详细地址"
+                                     v-decorator="['address', { rules: [{ required: true, message: '请输入详细地址!' }] }]"></a-input>
+                        </a-col>
+                        <a-col :span="3" class="padding_left_10">
+                            <a-button >地图选点</a-button>
+                        </a-col>
+                    </a-row>
+                    <a-row>
+                    <!-- 地图-->
+                    </a-row>
+                </a-form-item>
+                <a-form-item label="门店管理员">
+                    <a-input type="text" placeholder="请输入联系人"
+                             v-decorator="['linkName', { rules: [{ required: true, message: '请输入联系人!' }] }]"></a-input>
+                </a-form-item>
+
+                <a-form-item label="联系电话">
+                    <a-input type="text" placeholder="请输入联系电话"
+                             v-decorator="['linkTel', { rules: [{ required: true, message: '请输入联系电话!' }] }]"></a-input>
+                </a-form-item>
+
+                <a-form-item label="前台电话">
+                    <a-input type="text" placeholder="请输入联系电话"
+                             v-decorator="['tel', { rules: [{ required: true, message: '请输入联系电话!' }] }]"></a-input>
+                </a-form-item>
+
+                <a-form-item label="酒店设施">
+                    <a-row>
+                        <a-col span="3">
+                            <a-checkbox @change="onChange" value="1">
+                                温泉
+                            </a-checkbox>
+                        </a-col>
+                        <a-col span="3">
+                            <a-checkbox @change="onChange">
+                                租车
+                            </a-checkbox>
+                        </a-col>
+                        <a-col span="3">
+                            <a-checkbox @change="onChange">
+                                有餐饮
+                            </a-checkbox>
+                        </a-col>
+                        <a-col span="3">
+                            <a-checkbox @change="onChange">
+                                游泳池
+                            </a-checkbox>
+                        </a-col>
+                        <a-col span="3">
+                            <a-checkbox @change="onChange">
+                                叫早
+                            </a-checkbox>
+                        </a-col>
+                        <a-col span="3">
+                            <a-checkbox @change="onChange">
+                                有早餐
+                            </a-checkbox>
+                        </a-col>
+                        <a-col span="3">
+                            <a-checkbox @change="onChange">
+                                WIFI
+                            </a-checkbox>
+                        </a-col>
+                        <a-col span="4">
+                            <a-checkbox @change="onChange">
+                                电热水壶
+                            </a-checkbox>
+                        </a-col>
+                        <a-col span="3">
+                            <a-checkbox @change="onChange">
+                                电梯
+                            </a-checkbox>
+                        </a-col>
+                        <a-col span="3">
+                            <a-checkbox @change="onChange">
+                                吹风机
+                            </a-checkbox>
+                        </a-col>
+                        <a-col span="4">
+                            <a-checkbox @change="onChange">
+                                免费停车
+                            </a-checkbox>
+                        </a-col>
+                        <a-col span="3">
+                            <a-checkbox @change="onChange">
+                                会议室
+                            </a-checkbox>
+                        </a-col>
+                        <a-col span="4">
+                            <a-checkbox @change="onChange">
+                                残疾人设施
+                            </a-checkbox>
+                        </a-col>
+                        <a-col span="4">
+                            <a-checkbox @change="onChange">
+                                邮政服务
+                            </a-checkbox>
+                        </a-col>
+                        <a-col span="4">
+                            <a-checkbox @change="onChange">
+                                婚宴服务
+                            </a-checkbox>
+                        </a-col>
+                        <a-col span="4">
+                            <a-checkbox @change="onChange">
+                                全天前台
+                            </a-checkbox>
+                        </a-col>
+                        <a-col span="4">
+                            <a-checkbox @change="onChange">
+                                接待外宾
+                            </a-checkbox>
+                        </a-col>
+                        <a-col span="3">
+                            <a-checkbox @change="onChange">
+                                棋牌室
+                            </a-checkbox>
+                        </a-col>
+                        <a-col span="4">
+                            <a-checkbox @change="onChange">
+                                收费停车
+                            </a-checkbox>
+                        </a-col>
+                        <a-col span="4">
+                            <a-checkbox @change="onChange">
+                                送餐服务
+                            </a-checkbox>
+                        </a-col>
+                        <a-col span="4">
+                            <a-checkbox @change="onChange">
+                                洗衣服务
+                            </a-checkbox>
+                        </a-col>
+                        <a-col span="4">
+                            <a-checkbox @change="onChange">
+                                商务中心
+                            </a-checkbox>
+                        </a-col>
+                        <a-col span="4">
+                            <a-checkbox @change="onChange">
+                                叫车服务
+                            </a-checkbox>
+                        </a-col>
+                        <a-col span="4">
+                            <a-checkbox @change="onChange">
+                                房间WIFI
+                            </a-checkbox>
+                        </a-col>
+                    </a-row>
+                </a-form-item>
+            </a-col>
+            <a-col :span="2">
+            </a-col>
+            <a-col :span="11">
+                <a-form-item label="开业时间">
+                    <a-date-picker type="text" placeholder="请选择开业时间"
+                                   v-decorator="['openTime', { rules: [{ required: true, message: '请选择开业时间!' }] }]"></a-date-picker>
+                </a-form-item>
+
+                <a-form-item label="装修时间">
+                    <a-date-picker type="text" placeholder="请选择装修时间"
+                                   v-decorator="['renovationTime', { rules: [{ required: true, message: '请选择装修时间!' }] }]"></a-date-picker>
+                </a-form-item>
+                <a-form-item label="酒店星级" :wrapper-col="{ span: 5 }">
+                    <j-dict-select-tag v-decorator="['star', {rules: [{ required: true, message: '请选择酒店星级!' }]}]"
+                                       placeholder="请选择酒店星级" dictCode="hotel_star"/>
+                </a-form-item>
+                <a-form-item label="集团品牌">
+                    <a-input type="text" placeholder="请输入酒店品牌"
+                             v-decorator="['sellerName']"></a-input>
+                </a-form-item>
+                <a-form-item label="酒店标签">
+                    <template v-for="(tag, index) in tags">
+                        <a-tooltip v-if="tag.length > 20" :key="tag" :title="tag">
+                            <a-tag :key="tag" :closable="index !== -1" @close="() => handleClose(tag)">
+                                {{ `${tag.slice(0, 20)}...` }}
+                            </a-tag>
+                        </a-tooltip>
+                        <a-tag v-else :key="tag" :closable="index !== -1" @close="() => handleClose(tag)">
+                            {{ tag }}
+                        </a-tag>
+                    </template>
+                    <a-input
+                            v-if="inputVisible"
+                            ref="input"
+                            type="text"
+                            size="small"
+                            :style="{ width: '78px' }"
+                            :value="inputValue"
+                            @change="handleInputChange"
+                            @blur="handleInputConfirm"
+                            @keyup.enter="handleInputConfirm"
+                    />
+                    <a-tag v-else style="background: #fff; borderStyle: dashed;" @click="showInput">
+                        <a-icon type="plus" />添加
+                    </a-tag>
+                </a-form-item>
+                <a-form-item label="酒店介绍" >
+<!--                    <j-editor v-model="model.introduction"/>-->
+                    <a-textarea v-model="model.introduction" placeholder="请输入酒店介绍" :rows="5" />
+                </a-form-item>
+                <a-form-item label="预定规则">
+<!--                    <j-editor style="height: 200px;" v-model="model.reserveRemind"/>-->
+                    <a-textarea v-model="model.reserveRemind" placeholder="请输入预定规则" :rows="5" />
+                </a-form-item>
+            </a-col>
+        </a-row>
+        <a-divider />
+        <a-row>
+            <a-col :span="24" :style="{ textAlign: 'right' }">
+                <a-button type="primary" @click="submit">确定</a-button>
+            </a-col>
+        </a-row>
+
+    </a-form>
+</template>
+
+<script>
+    import {getHotelInfo, editMainInfo, hotelList} from "../../../api/hotel";
+    export default {
+        created() {
+            // alert("这里获取当前缓存门店信息");
+            var _info = JSON.parse(localStorage.getItem("storeInfo"));
+            setTimeout(() => {
+                getHotelInfo({
+                    id: _info.id
+                }).then(res => {
+                    console.log(res)
+                    if (res.code == 200 && res.result ) {
+                        var info = res.result
+
+                        this.form.setFieldsValue(
+                            {
+                                id: info.id,
+                                name: info.name,
+                                star: info.star,
+                                address: info.address,
+                                latlng: info.lat+','+info.lng,
+                                linkName: info.linkName,
+                                linkTel: info.linkTel,
+                                tel: info.tel,
+                                openTime: info.openTime,
+                                renovationTime: info.renovationTime,
+                                superiorSellerId: info.superiorSellerId,
+                                rule: info.rule,
+                                topic: info.topic,
+                                unionpay: info.unionpay,
+                                wxOpen: info.wxOpen,
+                                ddOpen: info.ddOpen,
+                                yeOpen: info.yeOpen,
+                                policy:info.policy,
+                                introduction:info.introduction,
+                                reserveRemind:info.reserveRemind,
+                                traffic:info.traffic,
+                            }
+                        )
+
+                        this.model = {
+                            policy:info.policy,
+                            introduction:info.introduction,
+                            reserveRemind:info.reserveRemind,
+                            traffic:info.traffic
+                        };
+
+                        this.tags = info.tagList.split(',')
+                    }
+                })
+            }, 100)
+        },
+        data() {
+            return {
+                visible: false,
+                formLayout: 'horizontal',
+                validatorRules: {
+                    name: [{
+                        required: true, message: '请输入酒店名称!'
+                    }],
+                    linkName: [{
+                        required: true, message: '请输入联系人!'
+                    }],
+                    linkTel: [{
+                        required: true, message: '请输入联系电话!'
+                    }, {validator: this.validatePhone}],//, {validator: this.validatePhone}
+                    tel: [{
+                        required: true, message: '请输入酒店电话!'
+                    }],
+                    address: [{
+                        required: true, message: '请输入酒店地址!'
+                    }],
+                    star: [{
+                        required: true, message: '请输入星级!'
+                    }],
+                    lng: [{
+                        required: true, message: '请输入经度!'
+                    }],
+                    lat: [{
+                        required: true, message: '请输入纬度!'
+                    }],
+                    roomCount: [{
+                        required: true, message: '请输入客房总数!'
+                    }],
+                    // openTime: [{
+                    //     required: true, message: '请输入开业时间!'
+                    // }],
+                    // renovationTime: [{
+                    //     required: true, message: '请输入装修时间!'
+                    // }],
+                    checkStatus: [{
+                        required: true, message: '请选择审核状态', trigger: 'change'
+                    }]
+                },
+                form: this.$form.createForm(this),
+                model: {
+                    policy:'',
+                    introduction:'',
+                    reserveRemind:'',
+                    traffic:'',
+                },
+                tags: [],
+                inputVisible: false,
+                inputValue: '',
+            }
+        },
+        computed: {
+            formItemLayout() {
+                const { formLayout } = this;
+                return formLayout === 'horizontal'
+                    ? {
+                        labelCol: { span: 4 },
+                        wrapperCol: { span: 14 },
+                    }
+                    : {};
+            },
+        },
+        methods: {
+            submit() {
+                // console.log(this.form.values.certImg)
+                this.form.validateFields((err, values) => {
+                    console.log(values.lnglat)
+                    if (!err) {
+                        // values['lat'] = values.latlng.split(',')[0]
+                        // values['lng'] = values.latlng.split(',')[1]
+                        values['tagList'] = this.tags.join(",");
+                        if(this.model.policy) values['policy'] = this.model.policy
+                        if(this.model.introduction) values['introduction'] = this.model.introduction
+                        if(this.model.reserveRemind) values['reserveRemind'] = this.model.reserveRemind
+                        if(this.model.traffic) values['traffic'] = this.model.traffic
+                        editMainInfo(values).then(res=>{
+                            // this.$message.success('编辑成功')
+                            // localStorage.setItem("storeInfo", JSON.stringify(res.result))
+                            if (res.code == 200){
+                                this.$message.success('编辑成功')
+                                localStorage.setItem("storeInfo", JSON.stringify(res.result))
+                            }else{
+                                this.$message.error(res.message)
+                            }
+                        })
+                    }
+                });
+            },
+            addHotelLable(){
+                console.log('添加酒店标签')
+            },
+            onChange(e) {
+                console.log(`checked = ${e.target.checked}`);
+            },
+            handleClose(removedTag) {
+                const tags = this.tags.filter(tag => tag !== removedTag);
+                console.log(tags);
+                this.tags = tags;
+            },
+
+            showInput() {
+                this.inputVisible = true;
+                this.$nextTick(function() {
+                    this.$refs.input.focus();
+                });
+            },
+
+            handleInputChange(e) {
+                this.inputValue = e.target.value;
+            },
+
+            handleInputConfirm() {
+                const inputValue = this.inputValue;
+                let tags = this.tags;
+                if (inputValue && tags.indexOf(inputValue) === -1) {
+                    tags = [...tags, inputValue];
+                }
+                console.log(tags);
+                Object.assign(this, {
+                    tags,
+                    inputVisible: false,
+                    inputValue: '',
+                });
+            }
+        },
+    }
+</script>
+
+<style scoped>
+    .padding_left_10{
+        padding-left: 10px;
+    }
+
+</style>

+ 30 - 12
src/views/settings/hotelInfo.vue

@@ -1,26 +1,40 @@
 <template>
     <a-card style="width: 100%; height:100%;">
         <a-tabs default-active-key="1">
+<!--            <a-tab-pane key="1">-->
+<!--                <span slot="tab">-->
+<!--                    <a-icon type="picture" />-->
+<!--                    门店照片-->
+<!--                </span>-->
+<!--                <store-images></store-images>-->
+<!--            </a-tab-pane>-->
+<!--            <a-tab-pane key="2">-->
+<!--                <span slot="tab">-->
+<!--                    <a-icon type="audit" />-->
+<!--                    实名信息-->
+<!--                </span>-->
+<!--                <store-auth-info></store-auth-info>-->
+<!--            </a-tab-pane>-->
+<!--            <a-tab-pane key="3">-->
+<!--                <span slot="tab">-->
+<!--                    <a-icon type="shop" />-->
+<!--                    门店信息-->
+<!--                </span>-->
+<!--                <store-infos></store-infos>-->
+<!--            </a-tab-pane>-->
             <a-tab-pane key="1">
                 <span slot="tab">
                     <a-icon type="picture" />
-                    门店照片
+                    门店信息
                 </span>
-                <store-images></store-images>
+                <store-information></store-information>
             </a-tab-pane>
             <a-tab-pane key="2">
                 <span slot="tab">
-                    <a-icon type="audit" />
-                    实名信息
-                </span>
-                <store-auth-info></store-auth-info>
-            </a-tab-pane>
-            <a-tab-pane key="3">
-                <span slot="tab">
-                    <a-icon type="shop" />
-                    门店信息
+                    <a-icon type="picture" />
+                    实名登记
                 </span>
-                <store-infos></store-infos>
+                <store-auth-information></store-auth-information>
             </a-tab-pane>
         </a-tabs>
     </a-card>
@@ -30,8 +44,12 @@
 import storeImages from './components/storeImages.vue';
 import storeAuthInfo from './components/storeAuthInfo.vue';
 import storeInfos from './components/storeInfos.vue';
+import StoreInformation from './components/storeInformation'
+import StoreAuthInformation from './components/storeAuthInformation'
 export default {
     components:{
+        StoreAuthInformation,
+        StoreInformation,
         storeImages,
         storeAuthInfo,
         storeInfos