master
271556543@qq.com 4 years ago
parent d1f1925fab
commit 65b63027e3

@ -0,0 +1,89 @@
import request from '@/utils/request'
export function index(params){
return request({
method:'get',
url:'/api/admin/confinement-product/index',
params
})
}
export function show(params){
return request({
method:'get',
url:'/api/admin/confinement-product/show',
params
})
}
export function store(data){
return request({
method:'post',
url:'/api/admin/confinement-product/store',
data
})
}
export function save(data){
return request({
method:'post',
url:'/api/admin/confinement-product/save',
data
})
}
export function destroy(data){
return request({
method:'post',
url:'/api/admin/confinement-product/destroy',
data
})
}
export function getPicture(params){
return request({
method:'get',
url:'/api/admin/confinement-product/get-picture',
params
})
}
export function getCombo(params){
return request({
method:'get',
url:'/api/admin/confinement-product/get-combo',
params
})
}
export function storePicture(data){
return request({
method:'post',
url:'/api/admin/confinement-product/store-picture',
data
})
}
export function destroyPicture(data){
return request({
method:'post',
url:'/api/admin/confinement-product/destroy-picture',
data
})
}
export function storeCombo(data){
return request({
method:'post',
url:'/api/admin/confinement-product/store-combo',
data
})
}
export function destroyCombo(data){
return request({
method:'post',
url:'/api/admin/confinement-product/destroy-combo',
data
})
}

@ -1,7 +1,8 @@
import request from '@/utils/request'
export function index(params){
export function index(params,isLoading=true){
return request({
isLoading,
method:'get',
url:'/api/admin/confinement-service/index',
params
@ -39,3 +40,51 @@ export function destroy(data){
data
})
}
export function storeMerchantItems(data){
return request({
method:'post',
url:'/api/admin/confinement-service/store-merchant-items',
data
})
}
export function getMerchantItems(params){
return request({
method:'get',
url:'/api/admin/confinement-service/get-merchant-items',
params
})
}
export function destroyMerchantItems(data){
return request({
method:'post',
url:'/api/admin/confinement-service/destroy-merchant-items',
data
})
}
export function savePicture(data){
return request({
method:'post',
url:'/api/admin/confinement-service/store-picture',
data
})
}
export function getPicture(params){
return request({
method:'get',
url:'/api/admin/confinement-service/get-picture',
params
})
}
export function destroyPicture(data){
return request({
method:'post',
url:'/api/admin/confinement-service/destroy-picture',
data
})
}

@ -1,7 +1,8 @@
import request from '@/utils/request'
export function index(params){
export function index(params,isLoading=true){
return request({
isLoading,
method:'get',
url:'/api/admin/merchant/index',
params

@ -41,12 +41,22 @@ export default {
},
methods: {
footerRender(){
return (
<div>
<Button ghost type="primary" on-click={this.reset}>重置</Button>
<Button type="primary" on-click={this.submit}>确定</Button>
</div>
)
if(this.type === 'form'){
return (
<div>
<Button ghost type="primary" on-click={this.reset}>重置</Button>
<Button type="primary" on-click={this.submit}>{this.okText || '确定'}</Button>
</div>
)
}
if(this.type === 'normal'){
return (
<div>
<Button ghost type="primary" on-click={()=>{this.$emit('update:isShow',false)}}>取消</Button>
<Button type="primary" on-click={()=>{this.$emit('on-ok')}}>{this.okText || '确定'}</Button>
</div>
)
}
},
showChange(e){
this.$emit('update:isShow',e)
@ -140,14 +150,14 @@ export default {
return (
<div
style={title.length === 0 ? {'margin-top':'32px'} : {}}>
{$scopedSlots.normalContent ? $scopedSlots.normalContent() : ''}
{$scopedSlots.default ? $scopedSlots.default() : ''}
</div>
)
}
},
footer(){
{
if(type === 'form') return ($scopedSlots.footerContent ? $scopedSlots.footerContent() : footerRender())
if(type === 'form' || type === 'normal') return ($scopedSlots.footerContent ? $scopedSlots.footerContent() : footerRender())
}
}
}}>

@ -315,8 +315,8 @@ export default {
<el-backtop
target=".el-table__body-wrapper"
visibility-height={120}
bottom={68}
right={48}>
bottom={100}
right={36}>
</el-backtop>
{ createPage() }
</div>

@ -8,18 +8,21 @@ let loading;
const service = axios.create({
baseURL: process.env.VUE_APP_BASE_API, // url = base url + request url
// withCredentials: true, // send cookies when cross-domain requests
timeout: 5000 // request timeout
timeout: 5000, // request timeout
isLoading:true
})
// request interceptor
service.interceptors.request.use(
config => {
// do something before request is sent
loading = Loading.service({
lock:true,
background:"rgba(0,0,0,0.4)",
text:"正在加载中..."
})
if(config.isLoading){
loading = Loading.service({
lock:true,
background:"rgba(0,0,0,0.4)",
text:"正在加载中..."
})
}
if (store.getters.token) {
// let each request carry token
@ -51,7 +54,9 @@ service.interceptors.response.use(
* You can also judge the status by HTTP Status Code
*/
response => {
loading.close()
if(loading) {
loading.close()
}
const res = response.data
// if the custom code is not 20000, it is judged as an error.

@ -130,7 +130,7 @@
:before-upload="uploadBefore">
<i class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
<div style="font-size: 10px;">建议尺寸 690*300像素</div>
<div style="font-size: 10px;white-space: nowrap;word-break: keep-all">建议尺寸 690*300</div>
</div>
</div>
</template>

@ -16,17 +16,42 @@
</lx-header>
</div>
<xy-table></xy-table>
<xy-table
:total="total"
:list="list"
:table-item="table"
@pageSizeChange="e => select.pageSize = e"
@pageIndexChange="pageChange">
<template v-slot:btns>
<el-table-column fixed="right" label="操作" :width="130" align="left" header-align="center">
<template slot-scope="scope">
<Button ghost size="small" type="primary" @click="editorClick(scope.row)" style="margin: 0 6px 4px 0">编辑</Button>
<Poptip confirm transfer title="确认要删除吗" @on-ok="destroyProduct(scope.row)">
<Button ghost size="small" type="primary" style="margin: 0 6px 4px 0">删除</Button>
</Poptip>
<Button ghost size="small" type="primary" style="margin: 0 6px 4px 0;width: 95px" @click="comboClick(scope.row)"></Button>
<Button ghost size="small" type="primary" style="margin: 0 6px 4px 0;width: 95px">产品图片</Button>
</template>
</el-table-column>
</template>
</xy-table>
<addClubProduct ref="addClubProduct"></addClubProduct>
<addClubProduct ref="addClubProduct" @refresh="getClubProduct"></addClubProduct>
<addProductCombo ref="addProductCombo"></addProductCombo>
</div>
</template>
<script>
import addClubProduct from '@/views/productService/components/addClubProduct'
import {index,destroy} from '@/api/clubProduct'
import { parseTime } from '@/utils'
import { Message } from 'element-ui'
import addClubProduct from '@/views/productService/components/confinement/addClubProduct'
import addProductCombo from '@/views/productService/components/confinement/addProductCombo'
export default {
components:{
addClubProduct
addClubProduct,
addProductCombo
},
data() {
return {
@ -39,10 +64,91 @@ export default {
total:0,
list:[],
table:[]
table:[
{
prop:'name',
label:'名称',
width: 220
},
{
label:'所属会所',
prop:'service.name',
width: 220
},
{
label:'产品信息',
width: 300,
align:'left',
customFn:(row)=>{
return (
<div>
<div>房间朝向{row.room_orientation}</div>
<div>房间面积{row.room_area}(平方米)</div>
<div>房间价格{row.price}()</div>
</div>
)
}
},
{
label:'排序',
width: 160,
prop:'sort_number'
},
{
label:'提交人',
width: 200,
prop:'admin.name'
},
{
label:'提交日期',
prop:'created_at',
minWidth: 200,
formatter:(cell,data,value)=>{
return parseTime(new Date(value),'{y}-{m}-{d}')
}
}
]
}
},
methods: {
pageChange(e){
this.select.page = e
this.getClubProduct()
},
async getClubProduct(){
const res = await index({
keyword:this.select.keywords,
page:this.select.page,
page_size:this.select.pageSize
})
this.total = res.total
this.list = res.rows
console.log(res)
},
destroyProduct(row){
destroy({id:row.id}).then(res => {
Message({
type:'success',
message:'删除月子产品成功'
})
this.getClubProduct()
})
},
editorClick(row){
this.$refs['addClubProduct'].type = 'editor'
this.$refs['addClubProduct'].id = row.id
this.$refs['addClubProduct'].isShow = true
},
comboClick(row){
this.$refs['addProductCombo'].id = row.id
this.$refs['addProductCombo'].isShow = true
}
},
methods: {}
mounted() {
this.getClubProduct()
}
}
</script>

@ -1,24 +0,0 @@
<template>
<div>
<xy-dialog type="form" :is-show.sync="isShow" :title="this.type === 'add' ? '新增会所产品' : '编辑会所产品'">
</xy-dialog>
</div>
</template>
<script>
export default {
data() {
return {
id:'',
isShow:false,
type:''
}
},
methods: {}
}
</script>
<style scoped lang="scss">
</style>

@ -0,0 +1,109 @@
<template>
<div>
<xy-dialog :is-show.sync="isShow" title="商户简介" ok-text="" @on-ok="submit">
<Button type="primary" icon="md-add" @click="addList" style="margin-bottom: 10px">新增</Button>
<xy-table :height="260" :is-page="false" :list="list" :table-item="table">
<template v-slot:btns>
<el-table-column label="操作" width="90" header-align="center" align="center">
<template slot-scope="scope">
<Button size="small" type="primary" ghost @click="deleteItem(scope)"></Button>
</template>
</el-table-column>
</template>
</xy-table>
</xy-dialog>
</div>
</template>
<script>
import {storeMerchantItems,getMerchantItems,destroyMerchantItems} from '@/api/confinementClub'
export default {
data() {
return {
id:'',
isShow:false,
list:[],
table:[
{
label:'名称',
sortable:false,
minWidth:60,
customFn:(row)=>{
return (
<div>
<el-input size='small' placeholder="请输入名称" value={row.name} on={{['input']:(e)=>{row.name = e}}}/>
</div>
)
}
},
{
label:'内容',
sortable:false,
customFn:(row)=>{
return (
<div>
<el-input size='small' placeholder="请输入内容" value={row.content} on={{['input']:(e)=>{row.content = e}}}/>
</div>
)
}
}
]
}
},
methods: {
async getMerchantItems(){
const res = await getMerchantItems({confinement_services_id:this.id})
console.log(res)
},
addList(){
this.list.push({
name:'',
content:''
})
},
submit(){
//console.log(this.list)
Promise.all(this.list.map(item => {
return storeMerchantItems({
confinement_services_id:this.id,
name:item.name,
content:item.content
})
})).then(res => {
console.log(res)
this.isShow = false
}).catch(err => {
console.log(err)
})
},
deleteItem(scope){
if(scope.row?.id){
destroyMerchantItems({id:scope.row.id}).then(res => {
this.getMerchantItems()
})
}else{
this.list.splice(scope.$index,1)
}
}
},
watch:{
isShow(newVal){
if(newVal){
this.getMerchantItems()
}else{
this.id = ''
this.list = []
}
}
}
}
</script>
<style scoped lang="scss">
</style>

@ -0,0 +1,107 @@
<template>
<div>
<xy-dialog :is-show.sync="isShow" title="商户图片" ok-text="" @on-ok="submit">
<el-upload
class="upload-demo"
:action="action"
:before-upload="handleBefore"
:on-success="handleSuccess"
:on-preview="handlePreview"
:before-remove="handleBeforeRemove"
:on-remove="handleRemove"
:file-list="fileList"
list-type="picture">
<el-button size="small" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件且不超过500kb</div>
</el-upload>
</xy-dialog>
</div>
</template>
<script>
import {getPicture,savePicture,destroyPicture} from '@/api/confinementClub'
import { Message } from 'element-ui'
export default {
data() {
return {
id:'',
isShow:false,
action:`${process.env.VUE_APP_BASE_API}api/admin/upload-file`,
fileList:[],
pics:[],//
}
},
methods: {
getPic(){
getPicture({confinement_services_id:this.id}).then(res => {
this.fileList = []
this.fileList.push(...res.map(item => {
return { url:item.picture,name:item.name || item.picture,id:item.id }
}))
})
},
handleBefore(file){
console.log(file)
if((file.size/1000) > 2048){
Message({
type:'warning',
message:'上传图片大小超过2M'
})
return false
}
},
handleRemove(file, fileList) {
console.log(file, fileList);
},
handlePreview(file) {
console.log(file);
},
handleSuccess(response, file, fileList){
this.pics.push(response.url)
},
handleBeforeRemove(file){
console.log(file)
destroyPicture({id:file.id}).then(res => {
Message({
type:'success',
message:'删除图片成功'
})
}).catch(err => {
this.getPic()
})
},
submit(){
Promise.all(this.fileList.map(item => {
savePicture({
confinement_services_id:this.id,
picture:item.url
})
})).then(res => {
Message({
type:'success',
message:`${res.length}张图片保存成功`
})
this.isShow = false
}).catch(err => {
console.log(err)
})
}
},
watch:{
isShow(newVal){
if(newVal){
this.getPic()
}else{
this.id = ''
this.fileList = []
}
}
}
}
</script>
<style scoped lang="scss">
</style>

@ -0,0 +1,524 @@
<template>
<div>
<xy-dialog ref="dialog" :width="74" type="form" :is-show.sync="isShow" :title="this.type === 'add' ? '新增会所产品' : '编辑会所产品'" :form="form" :rules="rules" @submit="submit">
<template v-slot:name>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>产品名称
</div>
<div class="xy-table-item-content">
<el-input v-model="form.name" placeholder="请输入会所名称" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:confinementServicesId>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>所属月子会所
</div>
<div class="xy-table-item-content">
<el-select clearable v-model="form.confinementServicesId" style="width: 300px;" placeholder="请选择所属月子会所">
<Scroll :on-reach-bottom="loadMoreClub">
<el-option v-for="item in clubs" :value="item.id" :key="item.id" :label="item.name">
</el-option>
</Scroll>
</el-select>
</div>
</div>
</template>
<template v-slot:roomType>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>房间类型
</div>
<div class="xy-table-item-content">
<el-select clearable v-model="form.roomType" style="width: 300px;" placeholder="请选择房间类型">
<el-option v-for="item in roomTypes" :value="item.id" :key="item.id" :label="item.value">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:state>
<div class="xy-table-item">
<div class="xy-table-item-label">
是否启用
</div>
<div class="xy-table-item-content">
<el-switch v-model="form.state" type="primary"></el-switch>
</div>
</div>
</template>
<template v-slot:recommend>
<div class="xy-table-item">
<div class="xy-table-item-label">
是否推荐主页
</div>
<div class="xy-table-item-content">
<el-switch v-model="form.recommend" type="primary"></el-switch>
</div>
</div>
</template>
<template v-slot:sortNumber>
<div class="xy-table-item">
<div class="xy-table-item-label">
排序
</div>
<div class="xy-table-item-content">
<el-input-number :precision="0" :controls="false" v-model="form.sortNumber" placeholder="请输入排序" clearable style="width: 300px;"></el-input-number>
</div>
</div>
</template>
<template v-slot:featuredLabel>
<div class="xy-table-item">
<div class="xy-table-item-label">
特色标签
</div>
<div class="xy-table-item-content">
<div class="xy-table-item-content-label">
<template v-for="(item,index) in form.featuredLabel">
<el-tag type="primary" closable @close="labelClose(index)" style="margin-right: 6px;margin-bottom: 4px;">{{item}}</el-tag>
</template>
<div style="margin-top: 15px;">
<el-input clearable placeholder="请填写并添加特色标签" style="width: 300px" ref="labelInput" v-model="labelText">
<el-button type="primary" slot="append" icon="el-icon-plus" @click="appendLabel"></el-button>
</el-input>
</div>
</div>
</div>
</div>
</template>
<template v-slot:roomOrientation>
<div class="xy-table-item">
<div class="xy-table-item-label">
房间朝向
</div>
<div class="xy-table-item-content">
<el-input v-model="form.roomOrientation" placeholder="请输入房间朝向" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:roomFacility>
<div class="xy-table-item">
<div class="xy-table-item-label">
房间设备
</div>
<div class="xy-table-item-content">
<el-select multiple clearable v-model="form.roomFacility" placeholder="请选择房间设备" style="width: 300px;">
<el-option v-for="item in equips" :value="item.id" :key="item.id" :label="item.value">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:roomArea>
<div class="xy-table-item">
<div class="xy-table-item-label">
房间面积
</div>
<div class="xy-table-item-content xy-table-item-area">
<el-input-number :precision="2" :controls="false" v-model="form.roomArea" placeholder="请输入房间面积" clearable style="width: 300px;"></el-input-number>
</div>
</div>
</template>
<template v-slot:price>
<div class="xy-table-item">
<div class="xy-table-item-label">
价格
</div>
<div class="xy-table-item-content xy-table-item-price">
<el-input-number :precision="2" :controls="false" v-model="form.price" placeholder="请输入价格" clearable style="width: 300px;"></el-input-number>
</div>
</div>
</template>
<template v-slot:coverPicture>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>封面图
</div>
<div class="xy-table-item-content">
<div v-if="form.coverPicture" style="position: relative;">
<img :src="form.coverPicture" class="avatar">
<Button
shape="circle"
icon="md-close"
type="error"
size="small"
class="img__delete"
@click="form.coverPicture = ''"></Button>
</div>
<el-upload
v-else
accept="picture"
:limit="1"
class="avatar-uploader"
list-type="picture-card"
:action="action"
:show-file-list="true"
:on-error="uploadFailPic"
:on-success="uploadSuccessPic"
:before-upload="uploadBeforePic">
<i class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</div>
</div>
</template>
<template v-slot:timeLimit>
<div class="xy-table-item">
<div class="xy-table-item-label">
限时
</div>
<div class="xy-table-item-content">
<el-date-picker
clearable
style="width: 440px;"
v-model="form.timeLimit"
type="datetimerange"
range-separator="至"
start-placeholder="开始时间"
end-placeholder="结束时间"
align="right"
value-format="yyyy-MM-dd hh:mm:ss">
</el-date-picker>
</div>
</div>
</template>
<template v-slot:content>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>内容
</div>
<div class="xy-table-item-content">
<tinymce ref="tinymce" :height="200" v-model="form.content" id='tinymce'></tinymce>
</div>
</div>
</template>
</xy-dialog>
</div>
</template>
<script>
import {store,show,save} from "@/api/clubProduct"
import {index as clubIndex} from '@/api/confinementClub'
import {getparameter} from "@/api/system/dictionary"
import { Message } from 'element-ui'
import tinymce from '@/components/Tinymce'
export default {
components:{
tinymce
},
data() {
return {
id:'',
isShow:false,
type:'',
action:`${process.env.VUE_APP_BASE_API}api/admin/upload-file`,
clubSelect:{
pageSize:10,
page:1
},
clubs:[],
roomTypes:[],
equips:[],
labelText:'',
form:{
name:'',
confinementServicesId:'',//
roomType:'',
state:true,
recommend:false,
sortNumber:0,
featuredLabel:[],
roomOrientation:'',//
roomFacility:'',//
roomArea:0,
price:0,
coverPicture:'',
timeLimit:'',
content:''
},
rules:{
name:[
{required:true,message:'请填写产品名称'}
],
confinementServicesId:[
{required:true,message:'请选择所属月子会所'}
],
roomType:[
{required:true,message:'请选择房间类型'}
],
coverPicture:[
{required:true,message:'请上传封面图'}
],
content:[
{required:true,message:'请填写内容'}
]
}
}
},
methods: {
//
uploadFailPic(err){
console.log(err)
},
uploadSuccessPic(response){
console.log(response)
this.form.coverPicture = response.url
},
uploadBeforePic(file){
if((file.size/1000) > 2048){
Message({
type:'warning',
message:'上传图片大小超过2M'
})
return false
}
},
//
appendLabel(){
if(!this.$refs['labelInput'].getInput().value) return
this.form.featuredLabel.push(this.$refs['labelInput'].getInput().value)
this.labelText = ''
},
//
labelClose(index){
this.form.featuredLabel.splice(index,1)
},
async getRoomTypes(){
const res = await getparameter({number:'confinementRoomType'})
this.roomTypes = res.detail
},
async getClubs(){
const res = await clubIndex({
page:this.clubSelect.page,
page_size:this.clubSelect.pageSize
},false)
if(res?.rows?.length === 0){
this.$Message.info({
content:'没有更多会所了',
duration:1
})
this.clubSelect.page --
}
this.clubs.push(...res.rows)
},
async getEquips(){
const res = await getparameter({number:'confinementEquip'})
this.equips = res.detail
},
async getDetail(){
const res = await show({id:this.id})
console.log(res)
this.form = {
name:res?.name,
confinementServicesId:res?.confinement_services_id,//
roomType:res?.room_type,
state:!!res?.state,
recommend:!!res?.recommend,
sortNumber:res?.sort_number,
featuredLabel:res?.featured_label?.split(',') || [],//
roomOrientation:res?.room_orientation,//
roomFacility:res?.featured_label?.room_facility,//
roomArea:res?.room_area,
price:res?.price,
coverPicture:res?.cover_picture,
timeLimit:res?.time_limit?.split(','),
content:res?.content
}
this.$refs['tinymce'].setContent(this.form.content)
},
loadMoreClub(){
this.clubSelect.page ++
this.getClubs()
},
submit(){
if(this.type === 'add'){
store({
name:this.form.name,
room_type:this.form.roomType,
confinement_services_id:this.form.confinementServicesId,
state:this.form.state ? 1 : 0,
sort_number:this.form.sortNumber,
featured_label:this.form.featuredLabel?.toString(),
content:this.form.content,
recommend:this.form.recommend ? 1 : 0,
room_orientation:this.form.roomOrientation,
cover_picture:this.form.coverPicture,
room_facility:this.form.roomFacility?.toString(),
price:this.form.price,
room_area:this.form.roomArea,
time_limit:this.form.timeLimit?.toString()
}).then(res => {
Message({
type:'success',
message:'新增月子产品成功'
})
this.isShow = false
this.$emit('refresh')
})
return
}
if(this.type === 'editor'){
save({
id:this.id,
name:this.form.name,
room_type:this.form.roomType,
confinement_services_id:this.form.confinementServicesId,
state:this.form.state ? 1 : 0,
sort_number:this.form.sortNumber,
featured_label:this.form.featuredLabel?.toString(),
content:this.form.content,
recommend:this.form.recommend ? 1 : 0,
room_orientation:this.form.roomOrientation,
cover_picture:this.form.coverPicture,
room_facility:this.form.roomFacility?.toString(),
price:this.form.price,
room_area:this.form.roomArea,
time_limit:this.form.timeLimit?.toString()
}).then(res => {
Message({
type:'success',
message:'编辑月子产品成功'
})
this.isShow = false
this.$emit('refresh')
})
}
}
},
watch:{
isShow(newVal){
if(newVal){
this.getClubs()
this.getEquips()
this.getRoomTypes()
if(this.type === 'editor'){
this.getDetail()
}
}else{
this.id = ''
this.type = ''
this.clubs = []
this.clubSelect.page = 1
this.$refs['tinymce'].setContent(" ")
this.$refs['dialog'].reset()
}
}
}
}
</script>
<style scoped lang="scss">
::v-deep .ivu-select-dropdown{
}
::v-deep .ivu-scroll-container{
height: 140px !important;
&::after{
content: '加载更多..';
text-align: center;
font-size: 10px;
zoom: 0.8;
color: rgb(160,160,160);
background: #fff;
position: absolute;
left: 0;
right: 0;
bottom: 0;
}
}
.xy-table-item{
&-label{
width: 160px;
}
&-content{
&-label{
width: 300px;
display: flex;
flex-wrap: wrap;
flex: 0;
}
}
&-area{
position: relative;
&::after{
z-index: 1;
position: absolute;
right: 0;
top: 0;
content:'(平方米)'
}
::v-deep .el-input__clear{
position: relative;
right: 30px;
z-index: 2;
}
}
}
::v-deep .el-input__inner{
text-align: left;
}
</style>
<style>
.avatar-uploader .el-upload {
width: 110px;
height: 110px;
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
display: flex;
justify-content: center;
align-items: center;
}
.avatar-uploader .el-upload:hover {
border-color: #BF617C;
}
.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 110px;
height: 110px;
line-height: 110px;
text-align: center;
}
.avatar {
width: 110px;
display: block;
border-radius: 6px;
}
.img__delete{
transform: scale(0.7,0.7);
position: absolute;
top: 1px;
left: 4%;
}
</style>

@ -26,7 +26,7 @@
<template v-slot:merchantId>
<div class="xy-table-item">
<div class="xy-table-item-label">
所属商户
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>所属商户
</div>
<div class="xy-table-item-content">
<el-select v-model="form.merchantId" placeholder="请选择所属商户" style="width: 300px">
@ -299,31 +299,12 @@
</div>
</div>
</template>
<template v-slot:extraFormBottom>
<el-divider></el-divider>
<div>
商铺图片
</div>
<el-upload
class="upload-demo"
:action="action"
:before-upload="uploadBeforePic"
:on-success="handleSuccess"
:on-preview="handlePreview"
:on-remove="handleRemove"
:file-list="fileList"
list-type="picture">
<el-button size="small" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件且不超过2M</div>
</el-upload>
</template>
</xy-dialog>
</div>
</template>
<script>
import {store} from '@/api/confinementClub'
import {store,show,save} from '@/api/confinementClub'
import {index as merchantIndex} from '@/api/merchant'
import {getparameter} from "@/api/system/dictionary"
import { Message } from 'element-ui'
@ -382,8 +363,6 @@ export default {
linkmanPhone:'',
workTime:'',
},
pictures:[],
fileList:[],
rules:{
name:[
{required:true,message:'请填写会所名称'}
@ -396,6 +375,9 @@ export default {
],
linkmanPhone:[
{pattern: /^[1][3-9][\d]{9}/,message:'手机号格式错误'}
],
merchantId:[
{required:true,message:'请选择所属商户'}
]
}
}
@ -435,18 +417,6 @@ export default {
}
},
handleSuccess(res){
this.pictures.push(res.url)
},
handleRemove(file, fileList) {
console.log(this.pictures)
console.log(file, fileList);
},
handlePreview(file) {
console.log(this.pictures)
console.log(file);
},
//
appendLabel(){
if(!this.$refs['labelInput'].getInput().value) return
@ -471,6 +441,35 @@ export default {
this.merchants = res?.data
},
//show
async getDetail(){
const res = await show({id:this.id})
console.log(res)
this.form = {
name:res?.name,
subheading:res?.subheading,
merchantId:res?.merchant_id,
featuredLabel:res?.featured_label?.split(',') || [],//
relLabel:res?.rel_label?.split(','),//
reach:!!res?.reach,//,
state:!!res?.state,//
sortNumber:res?.sort_number,
content:res?.content,
recommend:!!res?.recommend,
videoFile:res?.video_file,
coverPicture:res?.cover_picture,
address:res?.address,
lat:res?.latitude,//
lng:res?.longitude,//
functionary:res?.functionary,//
functionaryPhone:res?.functionary_phone,
linkman:res?.linkman,
linkmanPhone:res?.linkman_phone,
workTime:res?.work_time?.split(','),
}
this.$refs['tinymce'].setContent(this.form.content)
},
submit(){
if(this.type === 'add'){
console.log(this.form)
@ -480,8 +479,8 @@ export default {
state:this.form.state ? 1 : 0,
reach:this.form.reach ? 1 : 0,
sort_number:this.form.sortNumber,
featured_label:this.form.featuredLabel.toString(),
rel_label:this.form.relLabel.toString(),
featured_label:this.form.featuredLabel?.toString(),
rel_label:this.form.relLabel?.toString(),
content:this.form.content,
subheading:this.form.subheading,
recommend:this.form.recommend,
@ -494,7 +493,7 @@ export default {
functionary_phone:this.form.functionaryPhone,
linkman:this.form.linkman,
linkman_phone:this.form.linkmanPhone,
workTime: this.form.workTime.toString()
work_time: this.form.workTime?.toString()
}).then(res => {
Message({
type:'success',
@ -504,6 +503,39 @@ export default {
this.$emit('refresh')
})
}
if(this.type === 'editor'){
save({
id:this.id,
name:this.form.name,
merchant_id:this.form.merchantId,
state:this.form.state ? 1 : 0,
reach:this.form.reach ? 1 : 0,
sort_number:this.form.sortNumber,
featured_label:this.form.featuredLabel?.toString(),
rel_label:this.form.relLabel?.toString(),
content:this.form.content,
subheading:this.form.subheading,
recommend:this.form.recommend,
video_file:this.form.videoFile,
cover_picture:this.form.coverPicture,
latitude:this.form.lat,
longitude:this.form.lng,
address:this.form.address,
functionary:this.form.functionary,
functionary_phone:this.form.functionaryPhone,
linkman:this.form.linkman,
linkman_phone:this.form.linkmanPhone,
work_time: this.form.workTime?.toString()
}).then(res => {
Message({
type:'success',
message:'编辑月子会所商户成功'
})
this.isShow = false
this.$emit('refresh')
})
}
}
},
watch:{
@ -512,9 +544,14 @@ export default {
this.pictures = []
this.getMerchants()
this.getLabels()
if(this.type === 'editor'){
this.getDetail()
}
}else{
this.id = ''
this.type = ''
this.labelText = ''
this.$refs['dialog'].reset()
this.$refs['tinymce'].setContent(' ')
}

@ -0,0 +1,36 @@
<template>
<div>
<xy-dialog :is-show.sync="isShow" title="产品套餐" ok-text="">
<Button type="primary" icon="md-add" @click="" style="margin-bottom: 10px">新增</Button>
<xy-table :height="260" :is-page="false" :list="list" :table-item="table">
<template v-slot:btns>
<el-table-column label="操作" width="90" header-align="center" align="center">
<template slot-scope="scope">
<Button size="small" type="primary" ghost @click="">删除</Button>
</template>
</el-table-column>
</template>
</xy-table>
</xy-dialog>
</div>
</template>
<script>
export default {
data() {
return {
id:'',
isShow:false,
table:[],
list:[],
}
},
methods: {}
}
</script>
<style scoped lang="scss">
</style>

@ -16,19 +16,46 @@
</lx-header>
</div>
<xy-table :total="total" :list="list" :table-item="table" @pageSizeChange="e => select.pageSize = e"></xy-table>
<xy-table
:total="total"
:list="list"
:table-item="table"
@pageSizeChange="e => select.pageSize = e">
<template v-slot:btns>
<el-table-column fixed="right" label="操作" :width="130" align="left" header-align="center">
<template slot-scope="scope">
<Button ghost size="small" type="primary" @click="editorClub(scope.row)" style="margin: 0 6px 4px 0">编辑</Button>
<Poptip confirm transfer title="确认要删除吗" @on-ok="clubDelete(scope.row)">
<Button ghost size="small" type="primary" style="margin: 0 6px 4px 0">删除</Button>
</Poptip>
<Button ghost size="small" type="primary" @click="showInfo(scope.row)" style="margin: 0 6px 4px 0;width: 95px">商户信息</Button>
<Button ghost size="small" type="primary" @click="showPic(scope.row)" style="margin: 0 6px 4px 0;width: 95px">商户图片</Button>
</template>
</el-table-column>
</template>
</xy-table>
<addConfinementClub ref="addConfinementClub" @refresh="getClubs"></addConfinementClub>
<addClubInfo ref="addClubInfo"></addClubInfo>
<addClubPic ref="addClubPic"></addClubPic>
</div>
</template>
<script>
import {index} from '@/api/confinementClub'
import {index,destroy} from '@/api/confinementClub'
import {parseTime} from '@/utils'
import { Message } from 'element-ui'
import addConfinementClub from '@/views/productService/components/addConfinementClub'
import addConfinementClub from '@/views/productService/components/confinement/addConfinementClub'
import addClubInfo from '@/views/productService/components/confinement/addClubInfo'
import addClubPic from '@/views/productService/components/confinement/addClubPic'
export default {
components:{
addConfinementClub
addConfinementClub,
addClubInfo,
addClubPic
},
data() {
return {
@ -41,7 +68,60 @@ export default {
total:0,
list:[],
table:[],
table:[
{
prop:'name',
label:'名称',
width:200,
align:'left'
},
{
prop:'reach',
label:'是否到店',
width: 160,
customFn:(row)=>{
return (
<div style={{'color': row.reach === 1 ? 'green' : 'red'}}>{row.reach === 1 ? '已到店' : '未到店'}</div>
)
}
},
{
label:'特色标签',
width: 260,
align:'left',
prop:'featured_label',
customFn:(row) => {
return (
<div>
{
row.featured_label ?
row.featured_label?.split(',').map(item => {
return <el-tag type="border" style={{'margin':'0 6px 4px 0'}}>{item}</el-tag>
}) : <div style={{'text-align':'center'}}></div>
}
</div>
)
}
},
{
label:'排序',
width: 120,
prop:'sort_number'
},
{
label:'提交人',
prop:'admin.name',
width:180
},
{
label:'提交日期',
prop:'created_at',
minWidth: 200,
formatter:(cell,data,value)=>{
return parseTime(new Date(value),'{y}-{m}-{d}')
}
}
],
}
},
@ -52,6 +132,33 @@ export default {
pageSize:this.select.pageSize
})
console.log(res)
this.list = res.rows
this.total = res.total
},
clubDelete(row){
destroy({
id:row.id
}).then(res => {
Message({
type:'success',
message:'删除月子商户成功'
})
this.getClubs()
})
},
editorClub(row){
this.$refs['addConfinementClub'].type = 'editor'
this.$refs['addConfinementClub'].id = row.id
this.$refs['addConfinementClub'].isShow = true
},
showInfo(row){
this.$refs['addClubInfo'].id = row.id
this.$refs['addClubInfo'].isShow = true
},
showPic(row){
this.$refs['addClubPic'].id = row.id
this.$refs['addClubPic'].isShow = true
}
},
mounted() {

@ -11,7 +11,7 @@
</div>
<div class="selector-item">
<div class="selector-item__label">所属商户</div>
<Select clearable v-model="select.merchantId" style="width: 180px;" placeholder="所属商户">
<Select clearable v-model="select.merchantId" style="width: 140px;" placeholder="所属商户">
<Scroll :on-reach-bottom="loadMoreMerchant">
<Option v-for="item in merchants" :value="item.id" :key="item.id">
{{item.name}}
@ -21,7 +21,7 @@
</div>
<div class="selector-item">
<div class="selector-item__label">状态选择</div>
<Select clearable style="width: 140px;" clearable placeholder="状态选择" v-model="select.state">
<Select clearable style="width: 130px;" clearable placeholder="状态选择" v-model="select.state">
<Option v-for="item in [{value:'active',label:'已上架'},{label:'已下架',value:'inactive'}]" :value="item.value">{{item.label}}</Option>
</Select>
</div>
@ -30,7 +30,7 @@
<el-cascader
clearable
placeholder="类别选择"
style="width: 180px;"
style="width: 170px;"
size="small"
:options="types"
:show-all-levels="false"
@ -231,7 +231,7 @@ export default {
const res = await merchantIndex({
page:this.merchantSelect.pageIndex,
page_size:this.merchantSelect.pageSize
})
},false)
if(res.data.length == 0){
this.$Message.info({
content:'没有更多商户了',
@ -279,13 +279,16 @@ export default {
height: 180px !important;
&::after{
content: '加载更多..';
text-align: center;
font-size: 10px;
color: rgb(160,160,160);
transform: translateX(-50%) scale(.8,.8);
background: #fff;
zoom: 0.8;
position: absolute;
left: 0;
right: 0;
bottom: 0;
left: 50%;
}
}
</style>

@ -30,7 +30,7 @@
import {index,destroy} from '@/api/strategy'
import {parseTime,deepCopy} from '@/utils'
import addStrategy from './components/addStrategy'
import addStrategy from './components/strategy/addStrategy'
import { Message } from 'element-ui'
export default {
components:{

@ -30,7 +30,7 @@
import {index,destroy} from "@/api/strategyType"
import {parseTime} from "@/utils"
import addStrategyType from '@/views/productService/components/addStrategyType'
import addStrategyType from '@/views/productService/components/strategy/addStrategyType'
import { Message } from 'element-ui'
export default {
components:{

Loading…
Cancel
Save