|
|
@@ -0,0 +1,737 @@
|
|
|
+<template>
|
|
|
+ <a-spin :spinning="confirmLoading">
|
|
|
+ <j-form-container :disabled="formDisabled">
|
|
|
+ <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
|
|
|
+ <a-row>
|
|
|
+ <a-col :span="24">
|
|
|
+<!-- <a-form-model-item label="关联租户" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tenantId" >-->
|
|
|
+<!-- <a-input v-model="model.tenantId" placeholder="请输入关联租户" :disabled="checkFlag"></a-input>-->
|
|
|
+<!-- </a-form-model-item>-->
|
|
|
+ <a-form-model-item label="关联租户" :labelCol="labelCol" :wrapperCol="wrapperCol" >
|
|
|
+<!-- <j-dict-select-tag-->
|
|
|
+<!-- v-model="model.tenantId"-->
|
|
|
+<!-- :options="tenantsOptions"-->
|
|
|
+<!-- placeholder="请选择关联租户">-->
|
|
|
+<!-- </j-dict-select-tag>-->
|
|
|
+ <j-dict-select-tag v-model="model.tenantId" placeholder="请选择关联租户" dictCode="sys_tenant,name,id" :disabled="checkFlag"/>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="24">
|
|
|
+ <a-form-model-item label="酒店名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="name">
|
|
|
+ <a-input v-model="model.name" placeholder="请输入酒店名称" :disabled="checkFlag"></a-input>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="24">
|
|
|
+ <a-form-model-item label="联系人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="linkName">
|
|
|
+ <a-input v-model="model.linkName" placeholder="请输入联系人" :disabled="checkFlag"></a-input>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="24">
|
|
|
+ <a-form-model-item label="联系电话" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="linkTel">
|
|
|
+ <a-input v-model="model.linkTel" placeholder="请输入联系电话" :disabled="checkFlag"></a-input>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="24">
|
|
|
+ <a-form-model-item label="酒店电话" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tel">
|
|
|
+ <a-input v-model="model.tel" placeholder="请输入酒店电话" :disabled="checkFlag"></a-input>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="24">
|
|
|
+ <a-row>
|
|
|
+ <a-form-model-item label="酒店地址" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="address">
|
|
|
+ <a-col :span="19">
|
|
|
+ <a-input v-model="model.address" placeholder="请输入酒店地址" :disabled="checkFlag">
|
|
|
+ </a-input>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="4">
|
|
|
+ <a-button @click="getLonAndLat()" :disabled="checkFlag">获取经纬度</a-button>
|
|
|
+ </a-col>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-row>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="24">
|
|
|
+ <a-form-model-item label="星级" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="star">
|
|
|
+ <a-input-number v-model="model.star" placeholder="请输入星级" style="width: 100%" :disabled="checkFlag"></a-input-number>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="24">
|
|
|
+ <a-form-model-item label="经度" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="lng">
|
|
|
+ <a-input-number v-model="model.lng" placeholder="请输入经度" style="width: 100%" :disabled="checkFlag" />
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="24">
|
|
|
+ <a-form-model-item label="纬度" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="lat">
|
|
|
+ <a-input-number v-model="model.lat" placeholder="请输入纬度" style="width: 100%" :disabled="checkFlag" />
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="24">
|
|
|
+ <a-form-model-item label="客房总数" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="roomCount">
|
|
|
+ <a-input-number v-model="model.roomCount" placeholder="请输入客房总数" style="width: 100%" :disabled="checkFlag" />
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="24">
|
|
|
+ <a-form-model-item label="开业时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="openTime">
|
|
|
+ <j-date placeholder="请选择开业时间" v-model="model.openTime" style="width: 100%" :disabled="checkFlag" />
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="24">
|
|
|
+ <a-form-model-item label="装修时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="renovationTime">
|
|
|
+ <j-date placeholder="请选择装修时间" v-model="model.renovationTime" style="width: 100%" :disabled="checkFlag" />
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ <template v-if="showMore">
|
|
|
+ <a-row>
|
|
|
+ <a-col :span="24">
|
|
|
+ <a-form-model-item label="酒店主题" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="topic">
|
|
|
+ <a-input v-model="model.topic" placeholder="请输入酒店主题" :disabled="checkFlag"></a-input>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="24">
|
|
|
+<!-- <a-form-model-item label="酒店政策" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="policy">-->
|
|
|
+<!-- <a-input v-model="model.policy" placeholder="请输入酒店政策" :disabled="checkFlag"></a-input>-->
|
|
|
+<!-- <a-textarea :rows="5" v-model="model.policy" placeholder="请输入酒店政策" :disabled="checkFlag"/>-->
|
|
|
+<!-- </a-form-model-item>-->
|
|
|
+ <a-form-model-item label="酒店政策" style="min-height: 300px" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="policy">
|
|
|
+ <j-editor v-model="model.policy" :disabled="checkFlag"/>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="24">
|
|
|
+<!-- <a-form-model-item label="酒店介绍" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="introduction">-->
|
|
|
+<!--<!– <a-input v-model="model.introduction" placeholder="请输入酒店介绍" :disabled="checkFlag"></a-input>–>-->
|
|
|
+<!-- <a-textarea :rows="5" v-model="model.introduction" placeholder="请输入酒店介绍" :disabled="checkFlag"/>-->
|
|
|
+<!-- </a-form-model-item>-->
|
|
|
+ <a-form-model-item label="酒店介绍" style="min-height: 300px" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="introduction">
|
|
|
+ <j-editor v-model="model.introduction" :disabled="checkFlag"/>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="24">
|
|
|
+<!-- <a-form-model-item label="预订提醒" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="reserveRemind">-->
|
|
|
+<!--<!– <a-input v-model="model.reserveRemind" placeholder="请输入预订提醒" :disabled="checkFlag"></a-input>–>-->
|
|
|
+<!-- <a-textarea :rows="5" v-model="model.reserveRemind" placeholder="请输入预订提醒" :disabled="checkFlag"/>-->
|
|
|
+<!-- </a-form-model-item>-->
|
|
|
+ <a-form-model-item label="预订提醒" style="min-height: 300px" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="reserveRemind">
|
|
|
+ <j-editor v-model="model.reserveRemind" :disabled="checkFlag"/>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="24">
|
|
|
+<!-- <a-form-model-item label="交通和周边" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="traffic">-->
|
|
|
+<!--<!– <a-input v-model="model.traffic" placeholder="请输入交通和周边" :disabled="checkFlag"></a-input>–>-->
|
|
|
+<!-- <a-textarea :rows="5" v-model="model.traffic" placeholder="请输入交通和周边" :disabled="checkFlag"/>-->
|
|
|
+<!-- </a-form-model-item>-->
|
|
|
+ <a-form-model-item label="交通和周边" style="min-height: 300px" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="traffic">
|
|
|
+ <j-editor v-model="model.traffic" :disabled="checkFlag"/>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="24">
|
|
|
+ <a-form-model-item label="门头照" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ewmLogo">
|
|
|
+<!-- <a-input v-model="model.ewmLogo" placeholder="请输入门头照" :disabled="checkFlag"></a-input>-->
|
|
|
+ <j-image-upload class="avatar-uploader" placeholder="请上传门头照" text="上传" v-model="model.ewmLogo" :disabled="checkFlag"></j-image-upload>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="24">
|
|
|
+<!-- <a-form-model-item label="酒店图片" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="imgs">-->
|
|
|
+<!--<!– <a-input v-model="model.imgs" placeholder="请输入酒店图片" :disabled="checkFlag"></a-input>–>-->
|
|
|
+<!-- <j-image-upload :file-list="fileList" :multiple="true" :number="5" class="avatar-uploader" placeholder="请上传酒店图片" text="上传" v-model="model.imgs" :disabled="checkFlag" >-->
|
|
|
+<!-- <div v-if="fileList.length < 8">-->
|
|
|
+<!-- <a-icon type="plus" />-->
|
|
|
+<!-- <div class="ant-upload-text">-->
|
|
|
+<!-- Upload-->
|
|
|
+<!-- </div>-->
|
|
|
+<!-- </div>-->
|
|
|
+<!-- </j-image-upload>-->
|
|
|
+<!-- </a-form-model-item>-->
|
|
|
+ <a-form-model-item label="酒店图片" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback prop="imgs">
|
|
|
+ <div class="clearfix">
|
|
|
+ <a-upload
|
|
|
+ :action="uploadAction"
|
|
|
+ :headers="headers"
|
|
|
+ list-type="picture-card"
|
|
|
+ :file-list="fileList"
|
|
|
+ @preview="handlePreview"
|
|
|
+ @change="handleChange"
|
|
|
+ :remove="handleDelete"
|
|
|
+ >
|
|
|
+ <div v-if="fileList.length < 8" >
|
|
|
+ <a-icon type="plus" style="font-size: 18px;color: #5f5b5b;" />
|
|
|
+ <div class="ant-upload-text">
|
|
|
+ 上传
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </a-upload>
|
|
|
+ <a-modal :width="800" :visible="previewVisible" :footer="null" @cancel="handleFileCancel">
|
|
|
+ <div style="padding-top: 20px;">
|
|
|
+ <div v-if="previewImagePdf === 1" style="height: 700px; ">
|
|
|
+ <iframe ref="pdf" :src="previewImage" width="100%" height="100%"></iframe>
|
|
|
+ </div>
|
|
|
+ <div v-else>
|
|
|
+ <img alt="example" style="width: 100%" :src="previewImage" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </a-modal>
|
|
|
+ </div>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="24">
|
|
|
+ <a-form-model-item label="营业执照" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="yyImg">
|
|
|
+<!-- <a-input v-model="model.yyImg" placeholder="请输入营业执照" :disabled="checkFlag"></a-input>-->
|
|
|
+ <j-image-upload class="avatar-uploader" placeholder="请上传营业执照" text="上传" v-model="model.yyImg" :disabled="checkFlag" ></j-image-upload>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="24">
|
|
|
+ <a-form-model-item label="特种行业许可证" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tzhyImg">
|
|
|
+<!-- <a-input v-model="model.tzhyImg" placeholder="请输入特种行业许可证" :disabled="checkFlag"></a-input>-->
|
|
|
+ <j-image-upload class="avatar-uploader" placeholder="请上传特种行业许可证" text="上传" v-model="model.tzhyImg" :disabled="checkFlag" ></j-image-upload>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="24">
|
|
|
+ <a-form-model-item label="企业法人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="legalPerson">
|
|
|
+ <a-input v-model="model.legalPerson" placeholder="请输入企业法人" :disabled="checkFlag"></a-input>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="24">
|
|
|
+ <a-form-model-item label="经营场所" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="registeredAddress">
|
|
|
+ <a-input v-model="model.registeredAddress" placeholder="请输入经营场所" :disabled="checkFlag"></a-input>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="24">
|
|
|
+ <a-form-model-item label="注册号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="unifiedCode">
|
|
|
+ <a-input v-model="model.unifiedCode" placeholder="请输入注册号" :disabled="checkFlag"></a-input>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="24">
|
|
|
+ <a-form-model-item label="有效期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="businessTerm">
|
|
|
+ <j-date placeholder="请选择有效期" v-model="model.businessTerm" style="width: 100%" :disabled="checkFlag" />
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="24">
|
|
|
+ <a-form-model-item label="身份证正面照" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="sfzImg1">
|
|
|
+<!-- <a-input v-model="model.sfzImg1" placeholder="请输入身份证正面照" :disabled="checkFlag"></a-input>-->
|
|
|
+ <j-image-upload class="avatar-uploader" placeholder="请上传身份证正面照" text="上传" v-model="model.sfzImg1" :disabled="checkFlag" ></j-image-upload>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="24">
|
|
|
+ <a-form-model-item label="身份证反面照" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="sfzImg2">
|
|
|
+<!-- <a-input v-model="model.sfzImg2" placeholder="请输入身份证反面照" :disabled="checkFlag"></a-input>-->
|
|
|
+ <j-image-upload class="avatar-uploader" placeholder="请上传身份证反面照" text="上传" v-model="model.sfzImg2" :disabled="checkFlag" ></j-image-upload>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="24">
|
|
|
+ <a-form-model-item label="身份证手持照" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="sfzImg3">
|
|
|
+<!-- <a-input v-model="model.sfzImg3" placeholder="请输入身份证手持照" :disabled="checkFlag"></a-input>-->
|
|
|
+ <j-image-upload class="avatar-uploader" placeholder="请上传身份证手持照" text="上传" v-model="model.sfzImg3" :disabled="checkFlag" ></j-image-upload>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="24">
|
|
|
+ <a-form-model-item label="身份证姓名" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="sfzName">
|
|
|
+ <a-input v-model="model.sfzName" placeholder="请输入身份证姓名" :disabled="checkFlag"></a-input>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="24">
|
|
|
+ <a-form-model-item label="身份证号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="idCard">
|
|
|
+ <a-input v-model="model.idCard" placeholder="请输入身份证号" :disabled="checkFlag"></a-input>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="24">
|
|
|
+ <a-form-model-item label="服务商" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="sellerName">
|
|
|
+ <a-input v-model="model.sellerName" placeholder="请输入服务商" :disabled="checkFlag"></a-input>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="24">
|
|
|
+ <a-form-model-item label="邀请码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="invitationCode">
|
|
|
+ <a-input v-model="model.invitationCode" placeholder="请输入邀请码" :disabled="checkFlag"></a-input>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="24">
|
|
|
+ <a-form-model-item label="总店" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="superiorSellerId">
|
|
|
+ <a-input v-model="model.superiorSellerId" placeholder="请输入总店" :disabled="checkFlag"></a-input>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="24" :offset="5">
|
|
|
+ <a-row :gutter="[16,16]">
|
|
|
+ <a-col :span="4" >
|
|
|
+ <a-form-model-item :colon="false" :labelCol="labelCol_1" :wrapperCol="wrapperCol_1" label="银联支付">
|
|
|
+ <a-switch checkedChildren="是" unCheckedChildren="否" v-model="model.unionpay" :disabled="checkFlag"/>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="4">
|
|
|
+ <a-form-model-item :colon="false" :labelCol="labelCol_1" :wrapperCol="wrapperCol_1" label="到店支付">
|
|
|
+ <a-switch checkedChildren="是" unCheckedChildren="否" v-model="model.ddOpen" :disabled="checkFlag"/>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="4">
|
|
|
+ <a-form-model-item :colon="false" :labelCol="labelCol_1" :wrapperCol="wrapperCol_1" label="微信支付">
|
|
|
+ <a-switch checkedChildren="是" unCheckedChildren="否" v-model="model.wxOpen" :disabled="checkFlag"/>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="4">
|
|
|
+ <a-form-model-item :colon="false" :labelCol="labelCol_1" :wrapperCol="wrapperCol_1" label="余额支付">
|
|
|
+ <a-switch checkedChildren="是" unCheckedChildren="否" v-model="model.yeOpen" :disabled="checkFlag"/>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ </template>
|
|
|
+ <a-row v-if="checkFlag">
|
|
|
+ <a-col>
|
|
|
+ <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="审核状态" prop="checkStatus">
|
|
|
+ <a-radio-group v-model="model.checkStatus">
|
|
|
+ <a-radio value="1">
|
|
|
+ 通过
|
|
|
+ </a-radio>
|
|
|
+ <a-radio value="2">
|
|
|
+ 拒绝
|
|
|
+ </a-radio>
|
|
|
+ </a-radio-group>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="24">
|
|
|
+ <a-form-model-item label="审核备注" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="checkRemarks">
|
|
|
+ <a-textarea :rows="5" v-model="model.checkRemarks" placeholder="请输入审核备注"/>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ </a-form-model>
|
|
|
+ </j-form-container>
|
|
|
+ <a-row>
|
|
|
+ <a-col :span="4" :offset="20">
|
|
|
+ <a @click="handleToggleMore()" style="margin-left: 8px">
|
|
|
+ {{ showMore ? '收起' : '更多' }}
|
|
|
+ <a-icon :type="showMore ? 'up' : 'down'"/>
|
|
|
+ </a>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ </a-spin>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+
|
|
|
+ import { httpAction, getAction } from '@/api/manage'
|
|
|
+ import { validateDuplicateValue } from '@/utils/util'
|
|
|
+ import Vue from "vue";
|
|
|
+ function getBase64(file) {
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ const reader = new FileReader();
|
|
|
+ reader.readAsDataURL(file);
|
|
|
+ reader.onload = () => resolve(reader.result);
|
|
|
+ reader.onerror = error => reject(error);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ import { ACCESS_TOKEN } from "@/store/mutation-types"
|
|
|
+ import { getFileAccessHttpUrl } from '@/api/manage'
|
|
|
+
|
|
|
+ const uidGenerator=()=>{
|
|
|
+ return '-'+parseInt(Math.random()*10000+1,10);
|
|
|
+ }
|
|
|
+ const getFileName=(path)=>{
|
|
|
+ if(path.lastIndexOf("\\")>=0){
|
|
|
+ let reg=new RegExp("\\\\","g");
|
|
|
+ path = path.replace(reg,"/");
|
|
|
+ }
|
|
|
+ return path.substring(path.lastIndexOf("/")+1);
|
|
|
+ }
|
|
|
+ export default {
|
|
|
+ name: 'BusHotelForm',
|
|
|
+ components: {},
|
|
|
+ props: {
|
|
|
+ // 表单禁用
|
|
|
+ disabled: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false,
|
|
|
+ required: false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ model: {},
|
|
|
+ labelCol: {
|
|
|
+ xs: {span: 24},
|
|
|
+ sm: {span: 5}
|
|
|
+ },
|
|
|
+ wrapperCol: {
|
|
|
+ xs: {span: 24},
|
|
|
+ sm: {span: 16}
|
|
|
+ },
|
|
|
+ labelCol_1: {
|
|
|
+ xs: {span: 6},
|
|
|
+ sm: {span: 16}
|
|
|
+ },
|
|
|
+ wrapperCol_1: {
|
|
|
+ xs: {span: 3},
|
|
|
+ sm: {span: 8}
|
|
|
+ },
|
|
|
+ confirmLoading: false,
|
|
|
+ validatorRules: {
|
|
|
+ name: [{
|
|
|
+ required: true, message: '请输入酒店名称!'
|
|
|
+ }],
|
|
|
+ linkName: [{
|
|
|
+ required: true, message: '请输入联系人!'
|
|
|
+ }],
|
|
|
+ linkTel: [{
|
|
|
+ required: true, message: '请输入联系电话!'
|
|
|
+ }],
|
|
|
+ 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'
|
|
|
+ }]
|
|
|
+ },
|
|
|
+ url: {
|
|
|
+ add: '/business/busHotel/add',
|
|
|
+ edit: '/business/busHotel/edit',
|
|
|
+ queryById: '/business/busHotel/queryById',
|
|
|
+ hotelCheck: '/business/busHotel/hotelCheck',
|
|
|
+ getLonAndLat: '/business/busHotel/getLonAndLat',
|
|
|
+ queryTenantList: '/sys/tenant/queryList'
|
|
|
+ },
|
|
|
+ uploadAction: window._CONFIG['domianURL'] + "/sys/common/upload",
|
|
|
+ checkFlag: false,
|
|
|
+ detailFlag: false,
|
|
|
+ tenantsOptions: [],
|
|
|
+ showMore: false,
|
|
|
+ previews: {},
|
|
|
+ previewVisible: false,
|
|
|
+ previewImage: '',
|
|
|
+ previewImagePdf: 0,
|
|
|
+ fileList: [],
|
|
|
+ headers:{},
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ formDisabled() {
|
|
|
+ return this.disabled
|
|
|
+ },
|
|
|
+ uploadAction: function () {
|
|
|
+ return this.url.fileUpload;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch:{
|
|
|
+ value: {
|
|
|
+ handler(val,oldValue) {
|
|
|
+ if (val instanceof Array) {
|
|
|
+ this.initFileList(val.join(','))
|
|
|
+ } else {
|
|
|
+ this.initFileList(val)
|
|
|
+ }
|
|
|
+ if(!val || val.length==0){
|
|
|
+ this.picUrl = false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //立刻执行handler
|
|
|
+ immediate: true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ // 备份model原始值
|
|
|
+ this.modelDefault = JSON.parse(JSON.stringify(this.model))
|
|
|
+ this.initTenantList()
|
|
|
+ const token = Vue.ls.get(ACCESS_TOKEN);
|
|
|
+ this.headers = {"X-Access-Token": token}
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ add() {
|
|
|
+ this.edit(this.modelDefault)
|
|
|
+ },
|
|
|
+ edit(record, type) {
|
|
|
+ this.model = Object.assign({}, record)
|
|
|
+ this.visible = true
|
|
|
+ if (type === 1) {
|
|
|
+ this.detailFlag = true;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ let fileList = [];
|
|
|
+ let arr = this.model.imgs.split(",")
|
|
|
+ for(var a=0;a<arr.length;a++){
|
|
|
+ let url = getFileAccessHttpUrl(arr[a]);
|
|
|
+ fileList.push({
|
|
|
+ uid: uidGenerator(),
|
|
|
+ name: getFileName(arr[a]),
|
|
|
+ status: 'done',
|
|
|
+ url: url,
|
|
|
+ response:{
|
|
|
+ status:"history",
|
|
|
+ message:arr[a]
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ this.fileList = fileList
|
|
|
+ },
|
|
|
+ check(record) {
|
|
|
+ this.model = Object.assign({}, record)
|
|
|
+ this.visible = true
|
|
|
+ this.checkFlag = true
|
|
|
+ let fileList = [];
|
|
|
+ let arr = this.model.imgs.split(",")
|
|
|
+ for(var a=0;a<arr.length;a++){
|
|
|
+ let url = getFileAccessHttpUrl(arr[a]);
|
|
|
+ fileList.push({
|
|
|
+ uid: uidGenerator(),
|
|
|
+ name: getFileName(arr[a]),
|
|
|
+ status: 'done',
|
|
|
+ url: url,
|
|
|
+ response:{
|
|
|
+ status:"history",
|
|
|
+ message:arr[a]
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ this.fileList = fileList
|
|
|
+ },
|
|
|
+ //初始化租户字典
|
|
|
+ initTenantList() {
|
|
|
+ getAction(this.url.queryTenantList).then(res => {
|
|
|
+ if (res.success) {
|
|
|
+ this.tenantsOptions = res.result.map((item, index, arr) => {
|
|
|
+ let c = {label: item.name, value: item.id + ""}
|
|
|
+ return c;
|
|
|
+ })
|
|
|
+ console.log('this.tenantsOptions: ', this.tenantsOptions)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handleToggleMore() {
|
|
|
+ this.showMore = !this.showMore;
|
|
|
+ },
|
|
|
+ getLonAndLat() {
|
|
|
+ const that = this
|
|
|
+ let params = {address: this.model.address}
|
|
|
+ getAction(this.url.getLonAndLat, params).then((res) => {
|
|
|
+ if (res.success) {
|
|
|
+ if (res.code === 200) {
|
|
|
+ console.log(res.result)
|
|
|
+ that.model.lat = res.result.lat
|
|
|
+ that.model.lng = res.result.lng
|
|
|
+ that.model = Object.assign({}, that.model)
|
|
|
+ } else {
|
|
|
+ that.$message.warning(res.message)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ beforeUpload: function(file){
|
|
|
+ var fileType = file.type;
|
|
|
+ if(fileType.indexOf('image')<0){
|
|
|
+ this.$message.warning('请上传图片');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ submitForm() {
|
|
|
+ const that = this
|
|
|
+ // 触发表单验证
|
|
|
+ this.$refs.form.validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ that.confirmLoading = true
|
|
|
+ let httpurl = ''
|
|
|
+ let method = ''
|
|
|
+ if (!this.model.id) {
|
|
|
+ httpurl += this.url.add
|
|
|
+ method = 'post'
|
|
|
+ } else {
|
|
|
+ if (that.checkFlag) {
|
|
|
+ // 审核
|
|
|
+ httpurl += this.url.hotelCheck
|
|
|
+ method = 'put'
|
|
|
+ } else {
|
|
|
+ httpurl += this.url.edit
|
|
|
+ method = 'put'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ let path = ''
|
|
|
+ let arr = [];
|
|
|
+ if (that.fileList.length > 0) {
|
|
|
+ that.fileList.forEach((item, index) => {
|
|
|
+ arr.push(item.response.message)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (arr.length > 0) {
|
|
|
+ path = arr.join(",")
|
|
|
+ }
|
|
|
+ that.model.imgs = path;
|
|
|
+ console.log(that.model)
|
|
|
+ httpAction(httpurl, this.model, method).then((res) => {
|
|
|
+ if (res.success) {
|
|
|
+ that.$message.success(res.message)
|
|
|
+ that.$emit('ok')
|
|
|
+ } else {
|
|
|
+ that.$message.warning(res.message)
|
|
|
+ }
|
|
|
+ }).finally(() => {
|
|
|
+ that.confirmLoading = false
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handleFileCancel() {
|
|
|
+ this.previewVisible = false;
|
|
|
+ },
|
|
|
+ async handlePreview(file) {
|
|
|
+ if (!file.url && !file.preview) {
|
|
|
+ file.preview = await getBase64(file.originFileObj);
|
|
|
+ }
|
|
|
+ this.previewImage = file.url || file.preview;
|
|
|
+ if (this.previewImage.substring(this.previewImage.lastIndexOf('.') + 1) === 'pdf') {
|
|
|
+ this.previewImagePdf = 1
|
|
|
+ } else {
|
|
|
+ this.previewImagePdf = 0
|
|
|
+ }
|
|
|
+ this.previewVisible = true;
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 上传文件
|
|
|
+ */
|
|
|
+ customRequest(data) {
|
|
|
+ const formData = new FormData()
|
|
|
+ formData.append('file', data.file)
|
|
|
+ AttachmentInfoUploadContract(formData).then((res) => {
|
|
|
+ if (res.success) {
|
|
|
+ this.$message.success('上传成功')
|
|
|
+ var path = process.env.VUE_APP_API_BASE_URL + '/' + res.data.path;
|
|
|
+ this.uploadIds.push(res.data.id)
|
|
|
+ this.fileList.forEach(t => {
|
|
|
+ if (t.uid === data.file.uid) {
|
|
|
+ t.url = path
|
|
|
+ t.thumbUrl = path
|
|
|
+ t.status = 'done'
|
|
|
+ t.id = res.data.id
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.$message.error('上传失败:' + res.message)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handleDelete(file){
|
|
|
+ //如有需要新增 删除逻辑
|
|
|
+ console.log(file)
|
|
|
+ },
|
|
|
+ handleChange(info) {
|
|
|
+ this.picUrl = false;
|
|
|
+ let fileList = info.fileList
|
|
|
+ //update-begin-author:wangshuai date:20201022 for:LOWCOD-969 判断number是否大于0和是否多选,返回选定的元素。
|
|
|
+ if (this.number > 0 && this.isMultiple) {
|
|
|
+ fileList = fileList.slice(-this.number);
|
|
|
+ }
|
|
|
+ //update-end-author:wangshuai date:20201022 for:LOWCOD-969 判断number是否大于0和是否多选,返回选定的元素。
|
|
|
+ if (info.file.status === 'done') {
|
|
|
+ if (info.file.response.success) {
|
|
|
+ this.picUrl = true;
|
|
|
+ fileList = fileList.map((file) => {
|
|
|
+ if (file.response) {
|
|
|
+ file.url = file.response.message;
|
|
|
+ }
|
|
|
+ return file;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ //this.$message.success(`${info.file.name} 上传成功!`);
|
|
|
+ } else if (info.file.status === 'error') {
|
|
|
+ this.$message.error(`${info.file.name} 上传失败.`);
|
|
|
+ } else if (info.file.status === 'removed') {
|
|
|
+ this.handleDelete(info.file)
|
|
|
+ }
|
|
|
+ this.fileList = fileList
|
|
|
+ if (info.file.status === 'done' || info.file.status === 'removed') {
|
|
|
+ this.handlePathChange()
|
|
|
+ }
|
|
|
+ console.log("改变")
|
|
|
+ console.log(this.fileList)
|
|
|
+ },
|
|
|
+ handlePathChange() {
|
|
|
+ let uploadFiles = this.fileList
|
|
|
+ let path = ''
|
|
|
+ if (!uploadFiles || uploadFiles.length == 0) {
|
|
|
+ path = ''
|
|
|
+ }
|
|
|
+ let arr = [];
|
|
|
+ if (!this.isMultiple && uploadFiles.length > 0) {
|
|
|
+ arr.push(uploadFiles[uploadFiles.length - 1].response.message)
|
|
|
+ } else {
|
|
|
+ for (let a = 0; a < uploadFiles.length; a++) {
|
|
|
+ // update-begin-author:taoyan date:20200819 for:【开源问题z】上传图片组件 LOWCOD-783
|
|
|
+ if (uploadFiles[a].status === 'done') {
|
|
|
+ arr.push(uploadFiles[a].response.message)
|
|
|
+ } else {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ // update-end-author:taoyan date:20200819 for:【开源问题z】上传图片组件 LOWCOD-783
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (arr.length > 0) {
|
|
|
+ path = arr.join(",")
|
|
|
+ }
|
|
|
+ this.$emit('change', path);
|
|
|
+ },
|
|
|
+ initFileList(paths){
|
|
|
+ if(!paths || paths.length==0){
|
|
|
+ this.fileList = [];
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.picUrl = true;
|
|
|
+ let fileList = [];
|
|
|
+ let arr = paths.split(",")
|
|
|
+ for(var a=0;a<arr.length;a++){
|
|
|
+ let url = getFileAccessHttpUrl(arr[a]);
|
|
|
+ fileList.push({
|
|
|
+ uid: uidGenerator(),
|
|
|
+ name: getFileName(arr[a]),
|
|
|
+ status: 'done',
|
|
|
+ url: url,
|
|
|
+ response:{
|
|
|
+ status:"history",
|
|
|
+ message:arr[a]
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ this.fileList = fileList
|
|
|
+ },
|
|
|
+ }
|
|
|
+ }
|
|
|
+</script>
|
|
|
+<style scoped>
|
|
|
+ .avatar-uploader > .ant-upload {
|
|
|
+ width:104px;
|
|
|
+ height:104px;
|
|
|
+ }
|
|
|
+ .ant-upload-select-picture-card i {
|
|
|
+ font-size: 49px;
|
|
|
+ color: #999;
|
|
|
+ }
|
|
|
+
|
|
|
+ .ant-upload-select-picture-card .ant-upload-text {
|
|
|
+ margin-top: 8px;
|
|
|
+ color: #666;
|
|
|
+ }
|
|
|
+
|
|
|
+ .ant-table-tbody .ant-table-row td{
|
|
|
+ padding-top:10px;
|
|
|
+ padding-bottom:10px;
|
|
|
+ }
|
|
|
+ /deep/ .imgupload .iconp{padding:20px;}
|
|
|
+ /* update--end--autor:lvdandan-----date:20201016------for:j-image-upload图片组件单张图片详情回显空白*/
|
|
|
+
|
|
|
+ /deep/ .image-upload-single-over .ant-upload-select{display: none}
|
|
|
+</style>
|