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,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,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>
|
||||
Loading…
Reference in new issue