|
@@ -2,7 +2,7 @@
|
|
|
<el-dialog
|
|
|
:title="title"
|
|
|
:visible.sync="open"
|
|
|
- width="70%"
|
|
|
+ width="90%"
|
|
|
append-to-body
|
|
|
:close-on-click-modal="false"
|
|
|
@close="cancel"
|
|
@@ -20,13 +20,27 @@
|
|
|
>
|
|
|
<el-form :model="form" ref="form" :rules="rules" label-width="150px">
|
|
|
<div class="form-title"><span>基本信息</span></div>
|
|
|
- <el-form-item label="门店名称:" prop="name">
|
|
|
- <el-input style="width: 350px;" v-model="form.name" placeholder="请输入门店名称" maxlength="50" show-word-limit />
|
|
|
+ <el-form-item label="酒店名称:" prop="name">
|
|
|
+ <el-input style="width: 350px;" v-model="form.name" placeholder="请输入酒店名称" maxlength="50" show-word-limit />
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="归属景区:" prop="affiliationArea">
|
|
|
- <el-input style="width: 350px;" v-model="form.affiliationArea" placeholder="请输入归属景区" maxlength="50" show-word-limit />
|
|
|
+ <el-form-item label="类型:" prop="shopModel">
|
|
|
+ <el-select v-model="form.shopModel" clearable placeholder="请选择类型">
|
|
|
+ <el-option
|
|
|
+ v-for="item in [
|
|
|
+ { value: 1, label: '酒店' },
|
|
|
+ { value: 2, label: '名宿' }
|
|
|
+ ]"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="餐厅Logo:" prop="shopLogo">
|
|
|
+ <!-- <el-form-item label="归属景区:" prop="affiliationArea">
|
|
|
+ <el-rate v-model="form.rate"></el-rate>
|
|
|
+ </el-form-item> -->
|
|
|
+
|
|
|
+ <el-form-item label="酒店Logo:" prop="shopLogo">
|
|
|
<div
|
|
|
style="width: 120px;"
|
|
|
v-loading="actionUrlLoading"
|
|
@@ -54,7 +68,34 @@
|
|
|
</div>
|
|
|
<span>建议上传图片尺寸40px X 40px,支持jpg/png/gif,支持5MB大小以内的图片上传</span>
|
|
|
</el-form-item>
|
|
|
-
|
|
|
+ <el-form-item label="酒店门头照:" prop="shopHeadImg">
|
|
|
+ <div
|
|
|
+ style="width: 120px;"
|
|
|
+ v-loading="actionUrlLoading_1"
|
|
|
+ element-loading-text="上传中..."
|
|
|
+ element-loading-spinner="el-icon-loading"
|
|
|
+ element-loading-background="rgba(0, 0, 0, 0.8)"
|
|
|
+ >
|
|
|
+ <el-upload
|
|
|
+ class="avatar-uploader"
|
|
|
+ :action="actionUrl"
|
|
|
+ :data="{
|
|
|
+ bucket: 'tourism'
|
|
|
+ }"
|
|
|
+ :show-file-list="false"
|
|
|
+ accept=".jpg, .png, jpeg"
|
|
|
+ :on-success="handleAvatarSuccess_1"
|
|
|
+ :on-progress="handleAvatarProgress_1"
|
|
|
+ :before-upload="beforeAvatarUpload_1"
|
|
|
+ :disabled="actionUrlLoading_1"
|
|
|
+ :on-error="handleAvatarError_1"
|
|
|
+ >
|
|
|
+ <img v-if="form.shopHeadImg" style="width: 100px;height: 100px;" :src="form.shopHeadImg" class="avatar">
|
|
|
+ <i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
|
|
+ </el-upload>
|
|
|
+ </div>
|
|
|
+ <span>建议上传图片尺寸40px X 40px,支持jpg/png/gif,支持5MB大小以内的图片上传</span>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="门店宣传" prop="shopAdvImgs">
|
|
|
<div style="display: flex;">
|
|
|
<div
|
|
@@ -98,7 +139,6 @@
|
|
|
</div>
|
|
|
<span>建议上传图片尺寸140px X 90px,支持jpg、png、gif,支持5MB大小以内的图片上传</span>
|
|
|
</el-form-item>
|
|
|
-
|
|
|
<el-form-item label="营业时间:" prop="openTimeStart">
|
|
|
<div style="display: flex;">
|
|
|
<el-form-item label-width="0" label="">
|
|
@@ -110,103 +150,125 @@
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
-
|
|
|
- <el-form-item label="餐厅地址" prop="address">
|
|
|
- <el-input
|
|
|
- v-model="form.address"
|
|
|
- placeholder="请输入餐厅地址"
|
|
|
- clearable
|
|
|
- style="width: 300px"
|
|
|
- />
|
|
|
+ <el-form-item label-width="80px" label="酒店介绍">
|
|
|
+ <editor ref="editor" v-model="form.shopDetail" :fileSize="20" :min-height="200" />
|
|
|
</el-form-item>
|
|
|
- <div style="display: flex;">
|
|
|
- <el-form-item label="经度" prop="longitude">
|
|
|
- <el-input
|
|
|
- v-model="form.longitude"
|
|
|
- placeholder="请输入经度"
|
|
|
- clearable
|
|
|
- style="width: 300px"
|
|
|
- readonly
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="纬度" prop="latitude">
|
|
|
+ <div style="display: flex;width: 100%;padding: 10px 0;">
|
|
|
+ <div style="width: 50%;flex-shrink: 0;">
|
|
|
+ <el-form-item label="酒店标签:" prop="shopLabel">
|
|
|
+ <div>
|
|
|
+ <div>
|
|
|
+ <el-input style="width: 150px;" v-model="shopLabel" placeholder="请输入门店标签" maxlength="6" show-word-limit />
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ v-if="form.shopLabel.length<5"
|
|
|
+ @click="addshopLabel"
|
|
|
+ style="margin-left: 10px;"
|
|
|
+ >
|
|
|
+ 添加标签
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ type="danger"
|
|
|
+ @click="clearAllshopLabel"
|
|
|
+ style="margin-left: 10px;"
|
|
|
+ size="mini"
|
|
|
+ >
|
|
|
+ 全部清除
|
|
|
+ </el-button>
|
|
|
+ <span style="font-size: 12px;color: #ccc;margin-left: 15px;">(最多可添加5个标签)</span>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <el-tag
|
|
|
+ v-for="(tag,index) in form.shopLabel"
|
|
|
+ :key="index"
|
|
|
+ @close="clearshopLabel(tag,index)"
|
|
|
+ style="margin-right: 5px;"
|
|
|
+ closable>
|
|
|
+ {{tag}}
|
|
|
+ </el-tag>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="酒店地址" prop="address">
|
|
|
<el-input
|
|
|
- v-model="form.latitude"
|
|
|
- placeholder="请输入纬度"
|
|
|
- clearable
|
|
|
- style="width: 300px"
|
|
|
- readonly
|
|
|
+ v-model="form.address"
|
|
|
+ placeholder="请输入酒店地址"
|
|
|
+ clearable
|
|
|
+ style="width: 300px"
|
|
|
/>
|
|
|
- </el-form-item>
|
|
|
- </div>
|
|
|
- <div style="width: 100%;height: 300px;">
|
|
|
- <qqMapBox ref="qqMapBox" @setDot="setDot" />
|
|
|
- </div>
|
|
|
- <el-form-item label="联系电话:" style="margin-top: 20px;">
|
|
|
- <el-input style="width: 350px;" v-model="form.contactsMobile" placeholder="请输入联系电话" />
|
|
|
- </el-form-item>
|
|
|
- <div style="display: flex;">
|
|
|
- <el-form-item label="门店标签:" prop="shopLabel">
|
|
|
- <div>
|
|
|
- <div>
|
|
|
- <el-input style="width: 250px;" v-model="shopLabel" placeholder="请输入门店标签" maxlength="6" show-word-limit />
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- v-if="form.shopLabel.length<5"
|
|
|
- @click="addshopLabel"
|
|
|
- style="margin-left: 10px;"
|
|
|
- >
|
|
|
- 添加标签
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- type="danger"
|
|
|
- @click="clearAllshopLabel"
|
|
|
- style="margin-left: 10px;"
|
|
|
- >
|
|
|
- 全部清除
|
|
|
- </el-button>
|
|
|
- <span style="font-size: 12px;color: #ccc;margin-left: 15px;">(最多可添加5个标签)</span>
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- <el-tag
|
|
|
- v-for="(tag,index) in form.shopLabel"
|
|
|
- :key="index"
|
|
|
- @close="clearshopLabel(tag,index)"
|
|
|
- style="margin-right: 5px;"
|
|
|
- closable>
|
|
|
- {{tag}}
|
|
|
- </el-tag>
|
|
|
- </div>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="经度" prop="longitude">
|
|
|
+ <el-input
|
|
|
+ v-model="form.longitude"
|
|
|
+ placeholder="请输入经度"
|
|
|
+ clearable
|
|
|
+ style="width: 300px"
|
|
|
+ readonly
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="纬度" prop="latitude">
|
|
|
+
|
|
|
+ <el-input
|
|
|
+ v-model="form.latitude"
|
|
|
+ placeholder="请输入纬度"
|
|
|
+ clearable
|
|
|
+ style="width: 300px"
|
|
|
+ readonly
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="酒店电话:" style="margin-top: 20px;" prop="contactsMobile">
|
|
|
+ <el-input style="width: 350px;" v-model="form.contactsMobile" placeholder="请输入酒店电话" />
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ <div style="width: 50%;flex-shrink: 0;">
|
|
|
+ <div style="width: 100%;height: 350px;">
|
|
|
+ <qqMapBox ref="qqMapBox" @setDot="setDot" />
|
|
|
</div>
|
|
|
-
|
|
|
- </el-form-item>
|
|
|
-
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- <el-form-item label="是否支持取消订单:" :prop="'cancelOrderFlag'">
|
|
|
+ <div class="form-title"><span>规则设置</span></div>
|
|
|
+ <el-form-item label="自动审核退款:" :prop="'cancelOrderFlag'">
|
|
|
<div style="display: flex;align-items: center;">
|
|
|
<el-radio-group v-model="form.cancelOrderFlag" @input="radioInputs">
|
|
|
<div style="display: flex;align-items: center;">
|
|
|
- <el-radio label="-1">否</el-radio>
|
|
|
- <el-radio label="-2">随时可取消</el-radio>
|
|
|
+ <el-radio label="-1">关闭</el-radio>
|
|
|
<el-radio style="display: flex;align-items: center;" label="-3">
|
|
|
<el-form-item label="" label-width="0" :prop="'cancelOrderTime'">
|
|
|
- <span>下单后</span>
|
|
|
+ <span>自游客取消订单</span>
|
|
|
<el-input-number
|
|
|
:disabled="form.cancelOrderFlag!=-3"
|
|
|
v-model="form.cancelOrderTime"
|
|
|
placeholder="请输入分钟"
|
|
|
controls-position="right">
|
|
|
</el-input-number>
|
|
|
- <span>分钟内可取消订单</span>
|
|
|
+ <span>分钟内,管理员未对订单进行审核操作,系统自动通过审核退款</span>
|
|
|
</el-form-item>
|
|
|
</el-radio>
|
|
|
</div>
|
|
|
</el-radio-group>
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label-width="80px" label="须知说明">
|
|
|
- <editor ref="editor" v-model="form.shopDetail" :fileSize="20" :min-height="200" />
|
|
|
+ <el-form-item label="自动接单:" :prop="'acceptOrderFlag'">
|
|
|
+ <div style="display: flex;align-items: center;">
|
|
|
+ <el-radio-group v-model="form.acceptOrderFlag" @input="radioInputs1">
|
|
|
+ <div style="display: flex;align-items: center;">
|
|
|
+ <el-radio label="-1">关闭</el-radio>
|
|
|
+ <el-radio style="display: flex;align-items: center;" label="-3">
|
|
|
+ <el-form-item label="" label-width="0" :prop="'acceptOrderTime'">
|
|
|
+ <span>下单后</span>
|
|
|
+ <el-input-number
|
|
|
+ :disabled="form.acceptOrderFlag!=-3"
|
|
|
+ v-model="form.acceptOrderTime"
|
|
|
+ placeholder="请输入分钟"
|
|
|
+ controls-position="right">
|
|
|
+ </el-input-number>
|
|
|
+ <span>分钟内,管理员未对订单进行审核操作,系统自动接单</span>
|
|
|
+ </el-form-item>
|
|
|
+ </el-radio>
|
|
|
+ </div>
|
|
|
+ </el-radio-group>
|
|
|
+ </div>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</div>
|
|
@@ -261,25 +323,32 @@ export default {
|
|
|
cancelOrderFlag: '-1'
|
|
|
},
|
|
|
rules: {
|
|
|
- name: [{ required: true, message: "请输入门店名称", trigger: ["change","blur"] }],
|
|
|
+ name: [{ required: true, message: "请输入酒店名称", trigger: ["change","blur"] }],
|
|
|
affiliationArea: [{ required: true, message: "请输入归属景区", trigger: ["change","blur"] }],
|
|
|
- shopLogo: [{ required: true, message: "请上传商铺Logo", trigger: ["change","blur"] }],
|
|
|
- shopAdvImgs: [{ required: true, message: "请上传门店宣传", trigger: ["change","blur"] }],
|
|
|
+ shopModel: [{ required: true, message: "请选择类型", trigger: ["change","blur"] }],
|
|
|
+ shopLogo: [{ required: true, message: "请上传酒店Logo", trigger: ["change","blur"] }],
|
|
|
+ shopHeadImg: [{ required: true, message: "请上传酒店门头照", trigger: ["change","blur"] }],
|
|
|
+ shopAdvImgs: [{ required: true, message: "请上传酒店宣传", trigger: ["change","blur"] }],
|
|
|
shopDetail: [{ required: true, message: "请输须知说明", trigger: ["change","blur"] }],
|
|
|
openTimeStart: [{ required: true, message: "请输入开始时间", trigger: ["change","blur"] }],
|
|
|
openTimeEnd: [{ required: true, message: "请输入结束时间", trigger: ["change","blur"] }],
|
|
|
- address: [{ required: true, message: "请输入餐厅地址", trigger: ["change","blur"] }],
|
|
|
+ address: [{ required: true, message: "请输入酒店地址", trigger: ["change","blur"] }],
|
|
|
longitude: [{ required: true, message: "请输入经度", trigger: ["change","blur"] }],
|
|
|
latitude: [{ required: true, message: "请输入纬度", trigger: ["change","blur"] }],
|
|
|
-
|
|
|
- cancelOrderFlag: [{ required: true, message: "请选择是否支持取消订单", trigger: ["change","blur"] }],
|
|
|
+ contactsMobile: [{ required: true, message: "请输入酒店电话", trigger: ["change","blur"] }],
|
|
|
+
|
|
|
+ cancelOrderFlag: [{ required: true, message: "请选择是否自动审核退款", trigger: ["change","blur"] }],
|
|
|
cancelOrderTime: [{ required: false, message: "请输入分钟", trigger: ["change","blur"] }],
|
|
|
+
|
|
|
+ acceptOrderFlag: [{ required: true, message: "请选择是否自动接单", trigger: ["change","blur"] }],
|
|
|
+ acceptOrderTime: [{ required: false, message: "请输入分钟", trigger: ["change","blur"] }],
|
|
|
},
|
|
|
scenicAreaProducts: [],// 景点产品关联
|
|
|
|
|
|
// 上传文件
|
|
|
actionUrl: process.env.VUE_APP_BASE_API + process.env.VUE_APP_UPLOAD_IMAGE,
|
|
|
actionUrlLoading: false,
|
|
|
+ actionUrlLoading_1: false,
|
|
|
actionUrlMoreLoading: false,
|
|
|
shopLabel: '',
|
|
|
};
|
|
@@ -298,7 +367,8 @@ export default {
|
|
|
row,
|
|
|
shopAdvImgs: [],
|
|
|
shopLabel: [],
|
|
|
- cancelOrderFlag: '-1'
|
|
|
+ cancelOrderFlag: '-1',
|
|
|
+ acceptOrderFlag: '-1'
|
|
|
})
|
|
|
this.formStatus = 1
|
|
|
}else if(model=='EDIT') { // 新增
|
|
@@ -315,6 +385,7 @@ export default {
|
|
|
if(this.$refs["form"]) {
|
|
|
this.$refs["form"].clearValidate();
|
|
|
this.radioInputs(this.form.cancelOrderFlag)
|
|
|
+ this.radioInputs1(this.form.acceptOrderFlag)
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -333,11 +404,14 @@ export default {
|
|
|
if(obj.cancelOrderFlag == 0) {
|
|
|
obj.cancelOrderFlag = '-1'
|
|
|
obj['cancelOrderTime'] = undefined
|
|
|
- }else if(obj.cancelOrderFlag == 1 && obj.cancelOrderTime > 0){
|
|
|
+ }else if(obj.cancelOrderFlag == 1){
|
|
|
+ obj.cancelOrderFlag = '-3'
|
|
|
+ }
|
|
|
+ if(obj.acceptOrderFlag == 0) {
|
|
|
+ obj.acceptOrderFlag = '-1'
|
|
|
+ obj['acceptOrderTime'] = undefined
|
|
|
+ }else if(obj.acceptOrderFlag == 1){
|
|
|
obj.cancelOrderFlag = '-3'
|
|
|
- }else if(obj.cancelOrderFlag == 1 && obj.cancelOrderTime == 0) {
|
|
|
- obj.cancelOrderFlag = '-2'
|
|
|
- obj['cancelOrderTime'] = undefined
|
|
|
}
|
|
|
this.$set(this,'form',JSON.parse(JSON.stringify(obj)))
|
|
|
this.formStatus = 1
|
|
@@ -381,9 +455,12 @@ export default {
|
|
|
params['cancelOrderTime'] = null
|
|
|
}else if(params.cancelOrderFlag == -3) {
|
|
|
params['cancelOrderFlag'] = 1
|
|
|
- }else if(params.cancelOrderFlag == -2) {
|
|
|
- params['cancelOrderFlag'] = 1
|
|
|
- params['cancelOrderTime'] = 0
|
|
|
+ }
|
|
|
+ if(params.acceptOrderFlag == -1){
|
|
|
+ params['acceptOrderFlag'] = 0
|
|
|
+ params['acceptOrderTime'] = null
|
|
|
+ }else if(params.acceptOrderFlag == -3) {
|
|
|
+ params['acceptOrderFlag'] = 1
|
|
|
}
|
|
|
params.shopLabel = params.shopLabel.join(',')
|
|
|
params.shopAdvImgs = params.shopAdvImgs.join(',')
|
|
@@ -391,7 +468,7 @@ export default {
|
|
|
addTableApi(
|
|
|
this.configUrl.edit,{
|
|
|
...params,
|
|
|
- shopType: 4,
|
|
|
+ shopType: 5,
|
|
|
}).then(response => {
|
|
|
this.$modal.msgSuccess("修改成功");
|
|
|
this.loading = false
|
|
@@ -404,7 +481,7 @@ export default {
|
|
|
} else {
|
|
|
addTableApi(this.configUrl.edit,{
|
|
|
...params,
|
|
|
- shopType: 4,
|
|
|
+ shopType: 5,
|
|
|
}).then(response => {
|
|
|
this.$modal.msgSuccess("新增成功");
|
|
|
this.loading = false
|
|
@@ -468,6 +545,36 @@ export default {
|
|
|
handleAvatarError() {
|
|
|
this.actionUrlLoading = false
|
|
|
},
|
|
|
+ /** 上传图片 单张 */
|
|
|
+ handleAvatarSuccess_1(res, file) {
|
|
|
+ console.log("res, file",res, file)
|
|
|
+ this.actionUrlLoading_1 = false
|
|
|
+ if(res.code != 200) {
|
|
|
+ this.$set(this.form,'shopHeadImg',null)
|
|
|
+ }else {
|
|
|
+ this.$set(this.form,'shopHeadImg',res.data.url)
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+ beforeAvatarUpload_1(file) {
|
|
|
+ const isLt2M = file.size / 1024 / 1024 <= 5;
|
|
|
+ let testmsg = file.name.substring(file.name.lastIndexOf('.')+1)
|
|
|
+ let typeList = ['png','jepg','jpg','gif']
|
|
|
+ const isJPG = typeList.includes(testmsg);
|
|
|
+ if (!isJPG) {
|
|
|
+ this.$message.error(`上传图片图片只能是 ${typeList} 格式!`);
|
|
|
+ }
|
|
|
+ if (!isLt2M) {
|
|
|
+ this.$message.error('上传图片图片大小不能超过 5MB!');
|
|
|
+ }
|
|
|
+ return isJPG && isLt2M;
|
|
|
+ },
|
|
|
+ handleAvatarProgress_1(){
|
|
|
+ this.actionUrlLoading_1 = true
|
|
|
+ },
|
|
|
+ handleAvatarError_1() {
|
|
|
+ this.actionUrlLoading_1 = false
|
|
|
+ },
|
|
|
/** 上传图片 多张 */
|
|
|
beforeAvatarUploadMore(file) {
|
|
|
const isLt2M = file.size / 1024 / 1024 <= 5;
|
|
@@ -528,9 +635,15 @@ export default {
|
|
|
this.$refs.form.clearValidate('cancelOrderTime');
|
|
|
}else if( value == -3 ) {
|
|
|
this.rules.cancelOrderTime[0].required = true
|
|
|
- }else if( value == -2 ) {
|
|
|
- this.rules.cancelOrderTime[0].required = false
|
|
|
- this.$refs.form.clearValidate('cancelOrderTime');
|
|
|
+ }
|
|
|
+ },
|
|
|
+ /** */
|
|
|
+ radioInputs1(value) {
|
|
|
+ if( value == -1 ){
|
|
|
+ this.rules.acceptOrderTime[0].required = false
|
|
|
+ this.$refs.form.clearValidate('acceptOrderTime');
|
|
|
+ }else if( value == -3 ) {
|
|
|
+ this.rules.acceptOrderTime[0].required = true
|
|
|
}
|
|
|
},
|
|
|
setDot(params){
|