|
@@ -40,6 +40,7 @@
|
|
|
<el-table-column prop="shopCode" label="店铺编码" />
|
|
|
<el-table-column prop="chargePersonName" label="负责人" />
|
|
|
<el-table-column prop="chargePersonPhone" label="联系电话" />
|
|
|
+ <el-table-column prop="orderSort" label="当前排序" />
|
|
|
<el-table-column label="合同状态">
|
|
|
<template slot-scope="scope">
|
|
|
<span v-if="scope.row.contractState === 0">无效</span>
|
|
@@ -78,15 +79,19 @@
|
|
|
<!-- ******************************************************弹框开始****************************************************** -->
|
|
|
<!-- 新建商家弹框 -->
|
|
|
<el-dialog :title="userState === 0
|
|
|
- ? '新增商家'
|
|
|
- : userState === 1
|
|
|
- ? '修改商家'
|
|
|
- : '查看商家'
|
|
|
- " :visible.sync="dialogVisible" width="30%" center :before-close="closeFn" :close-on-click-modal="false">
|
|
|
+ ? '新增商家'
|
|
|
+ : userState === 1
|
|
|
+ ? '修改商家'
|
|
|
+ : '查看商家'
|
|
|
+ " :visible.sync="dialogVisible" width="30%" center :before-close="closeFn" :close-on-click-modal="false">
|
|
|
<div>
|
|
|
<el-tabs v-model="activeName" @tab-click="handleClick">
|
|
|
<el-tab-pane label="授权信息" name="first">
|
|
|
<el-form ref="ruleFormInfo" :model="ruleForm" :rules="rulesInfo" label-width="120px">
|
|
|
+ <el-form-item prop="orderSort" label="排序">
|
|
|
+ <el-input placeholder="请输入商家排序" v-model.number="ruleForm.orderSort"
|
|
|
+ type="number"></el-input>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="店铺名称" prop="shopName">
|
|
|
<el-input v-model="ruleForm.shopName" maxlength="20" :disabled="disabled" />
|
|
|
</el-form-item>
|
|
@@ -125,9 +130,10 @@
|
|
|
{{ ruleForm.longitude }} - {{ ruleForm.latitude }}
|
|
|
</span>
|
|
|
<el-button size="mini" type="primary" style="margin-left: 20px;"
|
|
|
- @click="$refs.selectAddressMapRef && $refs.selectAddressMapRef.show()">{{ ruleForm.longitude ? '修改'
|
|
|
- :
|
|
|
- '选择' }}</el-button>
|
|
|
+ @click="$refs.selectAddressMapRef && $refs.selectAddressMapRef.show()">{{ ruleForm.longitude ?
|
|
|
+ '修改'
|
|
|
+ :
|
|
|
+ '选择' }}</el-button>
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="生效日期" prop="effectiveDate">
|
|
@@ -154,31 +160,31 @@
|
|
|
<!-- <el-radio :disabled="disabled" :label="1">
|
|
|
品牌厂家
|
|
|
</el-radio> -->
|
|
|
- <el-radio :disabled="disabled" :label="2">
|
|
|
- 本地
|
|
|
+ <el-radio :disabled="disabled" :label="1">
|
|
|
+ 商城
|
|
|
</el-radio>
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item v-if="ruleForm.shopType === 2" prop="startTime" label="营业开始时间" :rules="[
|
|
|
- { required: true, message: '请选择营业开始时间', trigger: 'blur' }]">
|
|
|
+ { required: true, message: '请选择营业开始时间', trigger: 'blur' }]">
|
|
|
|
|
|
<el-time-select :disabled="disabled" placeholder="起始时间" v-model="ruleForm.startTime" :picker-options="{
|
|
|
- start: '00:00',
|
|
|
- step: '00:05',
|
|
|
- }">
|
|
|
+ start: '00:00',
|
|
|
+ step: '00:05',
|
|
|
+ }">
|
|
|
</el-time-select>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item v-if="ruleForm.shopType === 2" prop="endTime" label="营业结束时间" :rules="[
|
|
|
- { required: true, message: '请选择营业结束时间', trigger: 'blur' }]">
|
|
|
+ { required: true, message: '请选择营业结束时间', trigger: 'blur' }]">
|
|
|
|
|
|
<el-time-select :disabled="disabled" placeholder="营业结束时间" v-model="ruleForm.endTime" :picker-options="{
|
|
|
- start: '00:00',
|
|
|
- step: '00:05',
|
|
|
- end: '24:00',
|
|
|
- }">
|
|
|
+ start: '00:00',
|
|
|
+ step: '00:05',
|
|
|
+ end: '24:00',
|
|
|
+ }">
|
|
|
</el-time-select>
|
|
|
</el-form-item>
|
|
|
|
|
@@ -193,9 +199,9 @@
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
|
<el-form-item v-if="ruleForm.isVoucher === 1" :rules="[
|
|
|
- { required: true, message: '请输入代金券返还比例', trigger: 'blur' },
|
|
|
- { type: 'number', max: 100, min: 0, message: '请输入正确的代金券返还比例,0 ~ 100', trigger: ['blur', 'change'] }
|
|
|
- ]" label="代金券返还比例" prop="voucherReturn">
|
|
|
+ { required: true, message: '请输入代金券返还比例', trigger: 'blur' },
|
|
|
+ { type: 'number', max: 100, min: 0, message: '请输入正确的代金券返还比例,0 ~ 100', trigger: ['blur', 'change'] }
|
|
|
+ ]" label="代金券返还比例" prop="voucherReturn">
|
|
|
<el-input :disabled="disabled" placeholder="请填写代金券返还比例,范围0 ~ 100"
|
|
|
v-model.number="ruleForm.voucherReturn">
|
|
|
<template slot="append">%</template>
|
|
@@ -232,22 +238,47 @@
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item prop="perCapita" label="人均">
|
|
|
- <el-input :disabled="disabled" type="number" placeholder="请输入人均消费额" v-model.number="ruleForm.perCapita"
|
|
|
- closeable></el-input>
|
|
|
+ <el-input :disabled="disabled" type="number" placeholder="请输入人均消费额"
|
|
|
+ v-model.number="ruleForm.perCapita" closeable></el-input>
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item prop="shopBrief" label="商家简介">
|
|
|
- <el-input :disabled="disabled" autosize maxlength="250" show-word-limit type="textarea"
|
|
|
+ <el-input :disabled="disabled" autosize maxlength="2000" show-word-limit type="textarea"
|
|
|
placeholder="请输入商家简介" v-model="ruleForm.shopBrief" closeable></el-input>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item prop="label" label="主营">
|
|
|
+ <el-input :disabled="disabled" autosize maxlength="70" show-word-limit type="textarea"
|
|
|
+ placeholder="请输入主营业务" v-model="ruleForm.label" closeable></el-input>
|
|
|
+ </el-form-item>
|
|
|
|
|
|
<el-form-item prop="advertisement" label="广告图">
|
|
|
- <el-upload :disabled="disabled" class="avatar-uploader" list-type="picture-card"
|
|
|
+ <el-upload :disabled="disabled" class="avatar-uploader" list-type="picture-card" :multiple="false"
|
|
|
:file-list="advertisementList" :action="action" :on-success="handleAvatarSuccess"
|
|
|
:on-remove="handleRemovePic">
|
|
|
<i class="el-icon-plus avatar-uploader-icon" />
|
|
|
</el-upload>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item prop="videoList" label="商家视频">
|
|
|
+ <el-upload :disabled="disabled" class="avatar-uploader" :file-list="videoList" :action="action"
|
|
|
+ :on-success="videoSuccess" :on-remove="videoRemove">
|
|
|
+
|
|
|
+ <div class="list">
|
|
|
+ <div v-if="videoList.length > 0" class="list-video">
|
|
|
+ <div v-for="(item, index) in videoList" :key="index" class="video-item">
|
|
|
+ <video controls width="400">
|
|
|
+ <source :src="item.url" type="video/mp4">
|
|
|
+ Your browser does not support the video tag.
|
|
|
+ </video>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="upload-btn">
|
|
|
+ <i class="el-icon-plus avatar-uploader-icon" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-upload>
|
|
|
+
|
|
|
+
|
|
|
+ </el-form-item>
|
|
|
</el-form>
|
|
|
</el-tab-pane>
|
|
|
<el-tab-pane label="客户信息" name="second">
|
|
@@ -255,7 +286,8 @@
|
|
|
<el-form-item label="账号" prop="shopPhone">
|
|
|
<el-input v-if="shopPhoneShow" :value="hidden(ruleForm.shopPhone, 3, 4)" :disabled="disabled"
|
|
|
maxlength="20" @focus="focusShopPhoneInput" />
|
|
|
- <el-input v-else ref="shopPhoneCls" v-model="ruleForm.shopPhone" :disabled="disabled" maxlength="20" />
|
|
|
+ <el-input v-else ref="shopPhoneCls" v-model="ruleForm.shopPhone" :disabled="disabled"
|
|
|
+ maxlength="20" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="密码" prop="shopPassword">
|
|
|
<el-input v-model="ruleForm.shopPassword" type="password" :disabled="disabled" maxlength="16" />
|
|
@@ -301,7 +333,10 @@ export default {
|
|
|
// 这里存放数据
|
|
|
return {
|
|
|
action: uploadUrl,
|
|
|
+ // 图片上传的地址
|
|
|
advertisementList: [],
|
|
|
+ // 视频上传的地址
|
|
|
+ videoList: [],
|
|
|
allShopCategoryList: [],
|
|
|
areaData: {
|
|
|
lazy: true,
|
|
@@ -339,6 +374,7 @@ export default {
|
|
|
},
|
|
|
disabled: false,
|
|
|
ruleForm: {
|
|
|
+ orderSort:0,
|
|
|
shopName: '', // 店铺名称
|
|
|
chargePersonName: '', // 店铺负责人
|
|
|
chargePersonPhone: '', // 负责人电话
|
|
@@ -359,6 +395,8 @@ export default {
|
|
|
startTime: "",
|
|
|
endTime: "",
|
|
|
shopBrief: '', // 商家簡介
|
|
|
+ label: '', //主营业务
|
|
|
+ shopVideo:''
|
|
|
},
|
|
|
showPhone: false,
|
|
|
showAddress: false,
|
|
@@ -409,6 +447,13 @@ export default {
|
|
|
message: "请填写商家介绍",
|
|
|
trigger: "blur"
|
|
|
}],
|
|
|
+ label: [{
|
|
|
+ required: true,
|
|
|
+ message: "请填写主营业务",
|
|
|
+ trigger: "blur",
|
|
|
+ },
|
|
|
+ { min: 5, max: 70, message: '长度在 5 到 70 个字符', trigger: 'blur' }
|
|
|
+ ],
|
|
|
isVoucher: [
|
|
|
{
|
|
|
required: true,
|
|
@@ -555,6 +600,7 @@ export default {
|
|
|
this.newAddress = ''
|
|
|
this.personPhone = ''
|
|
|
this.ruleForm = {
|
|
|
+ orderSort:0,
|
|
|
shopName: '', // 店铺名称
|
|
|
chargePersonName: '', // 店铺负责人
|
|
|
chargePersonPhone: '', // 负责人电话
|
|
@@ -572,6 +618,8 @@ export default {
|
|
|
areaId: '', // 区域id
|
|
|
longitude: '', // 经纬度
|
|
|
latitude: '', // 经纬度
|
|
|
+ lable: '',
|
|
|
+ shopVideo:""
|
|
|
}
|
|
|
this.dialogVisible = true
|
|
|
this.advertisementList = []
|
|
@@ -617,9 +665,16 @@ export default {
|
|
|
this.$message.error('请输入生效年限')
|
|
|
return
|
|
|
}
|
|
|
+ if (submitData.label === '') {
|
|
|
+ this.$message.error('请输入主营业务')
|
|
|
+ return
|
|
|
+ }
|
|
|
|
|
|
submitData.classificationId = submitData.classificationId[2]
|
|
|
if (!this.userState) {
|
|
|
+ if(this.videoList.length > 0){
|
|
|
+ submitData.shopVideo = this.videoList.map(item => item.url).join(',')
|
|
|
+ }
|
|
|
businessListSave(submitData).then((res) => {
|
|
|
console.log(res)
|
|
|
if (res.code === '') {
|
|
@@ -633,6 +688,10 @@ export default {
|
|
|
this.$refs.ruleForm.clearValidate()
|
|
|
})
|
|
|
} else {
|
|
|
+ if(this.videoList.length > 0){
|
|
|
+ console.log(this.videoList,2222222222);
|
|
|
+ submitData.shopVideo = this.videoList.map(item => item.url).join(',')
|
|
|
+ }
|
|
|
businessListUpdate(submitData).then((res) => {
|
|
|
console.log(res)
|
|
|
if (res.code === '') {
|
|
@@ -668,13 +727,26 @@ export default {
|
|
|
this.ruleForm.voucherReturn *= 1
|
|
|
const advertisementStr = this.ruleForm.advertisement
|
|
|
if (advertisementStr && typeof advertisementStr === 'string') {
|
|
|
- this.advertisementList = advertisementStr.split(',').map(item => {
|
|
|
- return {
|
|
|
- url: item,
|
|
|
- uid: item + Math.random() + new Date()
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
+ this.advertisementList = advertisementStr.split(',').map(item => {
|
|
|
+ return {
|
|
|
+ url: item,
|
|
|
+ uid: item + Math.random() + new Date()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.advertisementList = []
|
|
|
+ }
|
|
|
+ if (videoStr && typeof videoStr === 'string') {
|
|
|
+ this.videoList = videoStr.split(',').map(item => {
|
|
|
+ return {
|
|
|
+ url: item,
|
|
|
+ uid: item + Math.random() + new Date()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.videoList = []
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
},
|
|
|
// 编辑
|
|
@@ -686,12 +758,14 @@ export default {
|
|
|
this.cpPhoneShow = true
|
|
|
const res = await businessListGetById({ shopId: row.shopId })
|
|
|
this.ruleForm = res.data
|
|
|
+ this.ruleForm.orderSort = row.orderSort
|
|
|
this.dialogVisible = true
|
|
|
this.isEdit = true
|
|
|
this.originShopDetailInfo = JSON.parse(JSON.stringify(res.data))
|
|
|
this.initShopClassPath(this.ruleForm.classificationId)
|
|
|
this.ruleForm.voucherReturn *= 1
|
|
|
const advertisementStr = this.ruleForm.advertisement
|
|
|
+ const videoStr = this.ruleForm.shopVideo
|
|
|
if (advertisementStr && typeof advertisementStr === 'string') {
|
|
|
this.advertisementList = advertisementStr.split(',').map(item => {
|
|
|
return {
|
|
@@ -699,7 +773,20 @@ export default {
|
|
|
uid: item + Math.random() + new Date()
|
|
|
}
|
|
|
})
|
|
|
+ } else {
|
|
|
+ this.advertisementList = []
|
|
|
+ }
|
|
|
+ if (videoStr && typeof videoStr === 'string') {
|
|
|
+ this.videoList = videoStr.split(',').map(item => {
|
|
|
+ return {
|
|
|
+ url: item,
|
|
|
+ uid: item + Math.random() + new Date()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.videoList = []
|
|
|
}
|
|
|
+
|
|
|
},
|
|
|
// 删除
|
|
|
async del(row) {
|
|
@@ -807,6 +894,16 @@ export default {
|
|
|
url, uid: url + Math.random() + Date.now()
|
|
|
})
|
|
|
},
|
|
|
+ videoSuccess(response) {
|
|
|
+ const { url } = response.data
|
|
|
+ this.videoList.push({
|
|
|
+ url, uid: url + Math.random() + Date.now()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ videoRemove(e) {
|
|
|
+ const { uid } = e
|
|
|
+ this.videoList = this.videoList.filter(item => item.uid !== uid)
|
|
|
+ },
|
|
|
|
|
|
handleRemovePic(e) {
|
|
|
const { uid } = e
|
|
@@ -866,10 +963,7 @@ export default {
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
-<style
|
|
|
- lang="scss"
|
|
|
- scoped
|
|
|
->
|
|
|
+<style lang="scss" scoped>
|
|
|
@import url("../../../styles/elDialog.scss");
|
|
|
|
|
|
.pending {
|
|
@@ -887,4 +981,35 @@ export default {
|
|
|
.elspan {
|
|
|
margin-left: 10px;
|
|
|
}
|
|
|
+
|
|
|
+video {
|
|
|
+ width: 150px;
|
|
|
+ height: 100px;
|
|
|
+}
|
|
|
+
|
|
|
+.upload-btn {
|
|
|
+ background-color: #fbfdff;
|
|
|
+ border: 1px dashed #c0ccda;
|
|
|
+ border-radius: 6px;
|
|
|
+ -webkit-box-sizing: border-box;
|
|
|
+ box-sizing: border-box;
|
|
|
+ width: 150px;
|
|
|
+ height: 100px;
|
|
|
+ cursor: pointer;
|
|
|
+ line-height: 100px;
|
|
|
+ vertical-align: top;
|
|
|
+ font-size: 28px;
|
|
|
+}
|
|
|
+.list-video{
|
|
|
+ display: flex;
|
|
|
+ gap: 20px;
|
|
|
+ align-items: center;
|
|
|
+ flex-wrap: wrap;
|
|
|
+}
|
|
|
+.list{
|
|
|
+ display: flex;
|
|
|
+ gap: 20px;
|
|
|
+ align-items: center;
|
|
|
+ flex-wrap: wrap;
|
|
|
+}
|
|
|
</style>
|