|
|
|
|
@ -164,49 +164,44 @@
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<template v-slot:set_list>
|
|
|
|
|
<div class="xy-table-item"> <div class="xy-table-item-label">
|
|
|
|
|
明细:
|
|
|
|
|
<div class="xy-table-item">
|
|
|
|
|
<div class="xy-table-item-label">
|
|
|
|
|
明细:
|
|
|
|
|
</div>
|
|
|
|
|
<div class="xy-table-item-content">
|
|
|
|
|
<Button type="primary" icon="md-add" @click="addListCombo" style="margin-bottom: 10px">新增</Button>
|
|
|
|
|
|
|
|
|
|
<xy-table :height="260" :is-page="false" :list="form.set_list" :table-item="tableCombo">
|
|
|
|
|
<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="deleteCombo(scope)">删除</Button>
|
|
|
|
|
<Button type="primary" icon="md-add" @click="addListCombo" style="margin-bottom: 10px">新增</Button>
|
|
|
|
|
|
|
|
|
|
<xy-table :height="260" :is-page="false" :list="form.set_list" :table-item="tableCombo">
|
|
|
|
|
<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="deleteCombo(scope)">删除</Button>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</template>
|
|
|
|
|
</xy-table>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<template v-slot:picture_list>
|
|
|
|
|
<div class="xy-table-item"> <div class="xy-table-item-label">
|
|
|
|
|
图集:
|
|
|
|
|
</div>
|
|
|
|
|
<div class="xy-table-item-content">
|
|
|
|
|
|
|
|
|
|
<el-upload
|
|
|
|
|
class="upload-demo"
|
|
|
|
|
:action="action"
|
|
|
|
|
:before-upload="pichandleBefore"
|
|
|
|
|
:on-success="pichandleSuccess"
|
|
|
|
|
:on-preview="pichandlePreview"
|
|
|
|
|
:before-remove="pichandleBeforeRemove"
|
|
|
|
|
:on-remove="pichandleRemove"
|
|
|
|
|
:file-list="picfileList"
|
|
|
|
|
list-type="picture" multiple>
|
|
|
|
|
<el-button size="small" type="primary">点击上传</el-button>
|
|
|
|
|
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件或者视频文件,且不超过2M</div>
|
|
|
|
|
</el-upload>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</xy-table>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<template v-slot:picture_list>
|
|
|
|
|
<div class="xy-table-item">
|
|
|
|
|
<div class="xy-table-item-label">
|
|
|
|
|
图集:
|
|
|
|
|
</div>
|
|
|
|
|
<div class="xy-table-item-content">
|
|
|
|
|
|
|
|
|
|
<el-upload class="upload-demo" :action="action" :before-upload="pichandleBefore"
|
|
|
|
|
:on-success="pichandleSuccess" :on-preview="pichandlePreview" :before-remove="pichandleBeforeRemove"
|
|
|
|
|
:on-remove="pichandleRemove" :file-list="picfileList" list-type="picture" multiple>
|
|
|
|
|
<el-button size="small" type="primary">点击上传</el-button>
|
|
|
|
|
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件或者视频文件,且不超过10M</div>
|
|
|
|
|
</el-upload>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -218,7 +213,9 @@
|
|
|
|
|
import {
|
|
|
|
|
store,
|
|
|
|
|
show,
|
|
|
|
|
save
|
|
|
|
|
save,
|
|
|
|
|
getPicture,
|
|
|
|
|
getCombo
|
|
|
|
|
} from "@/api/productService/commonServiceProduct"
|
|
|
|
|
import {
|
|
|
|
|
index as clubIndex
|
|
|
|
|
@ -236,38 +233,61 @@
|
|
|
|
|
tinymce
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
picfileList:[],
|
|
|
|
|
return {
|
|
|
|
|
picfileList: [],
|
|
|
|
|
id: '',
|
|
|
|
|
isShow: false,
|
|
|
|
|
type: '',
|
|
|
|
|
listCombo:[],
|
|
|
|
|
tableCombo:[
|
|
|
|
|
{
|
|
|
|
|
label:'名称',
|
|
|
|
|
sortable:false,
|
|
|
|
|
minWidth:220,
|
|
|
|
|
customFn:(row)=>{
|
|
|
|
|
return (
|
|
|
|
|
<div>
|
|
|
|
|
<el-input size='small' placeholder="请输入名称" value={row.name} on={{['input']:(e)=>{row.name = e}}}/>
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label:'内容',
|
|
|
|
|
sortable:false,
|
|
|
|
|
minWidth:420,
|
|
|
|
|
customFn:(row)=>{
|
|
|
|
|
return (
|
|
|
|
|
<div>
|
|
|
|
|
<el-input size='small' placeholder="请输入内容" value={row.content} on={{['input']:(e)=>{row.content = e}}}/>
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
type: '',
|
|
|
|
|
listCombo: [],
|
|
|
|
|
tableCombo: [{
|
|
|
|
|
label: '名称',
|
|
|
|
|
sortable: false,
|
|
|
|
|
minWidth: 220,
|
|
|
|
|
customFn: (row) => {
|
|
|
|
|
return ( <
|
|
|
|
|
div >
|
|
|
|
|
<el-input size = 'small'
|
|
|
|
|
placeholder = "请输入名称"
|
|
|
|
|
value = {
|
|
|
|
|
row.name
|
|
|
|
|
}
|
|
|
|
|
on = {
|
|
|
|
|
{
|
|
|
|
|
['input']: (e) => {
|
|
|
|
|
row.name = e
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/> < /
|
|
|
|
|
div >
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '内容',
|
|
|
|
|
sortable: false,
|
|
|
|
|
minWidth: 420,
|
|
|
|
|
customFn: (row) => {
|
|
|
|
|
return ( <
|
|
|
|
|
div >
|
|
|
|
|
<el-input size = 'small'
|
|
|
|
|
placeholder = "请输入内容"
|
|
|
|
|
value = {
|
|
|
|
|
row.content
|
|
|
|
|
}
|
|
|
|
|
on = {
|
|
|
|
|
{
|
|
|
|
|
['input']: (e) => {
|
|
|
|
|
row.content = e
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/> < /
|
|
|
|
|
div >
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
|
|
|
|
|
action: `${process.env.VUE_APP_BASE_API}api/admin/upload-file`,
|
|
|
|
|
clubSelect: {
|
|
|
|
|
@ -290,9 +310,9 @@
|
|
|
|
|
coverPicture: '',
|
|
|
|
|
timeLimit: '',
|
|
|
|
|
content: '',
|
|
|
|
|
video: "",
|
|
|
|
|
set_list:[],
|
|
|
|
|
picture_list:[]
|
|
|
|
|
video: "",
|
|
|
|
|
set_list: [],
|
|
|
|
|
picture_list: []
|
|
|
|
|
},
|
|
|
|
|
rules: {
|
|
|
|
|
name: [{
|
|
|
|
|
@ -314,40 +334,40 @@
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
pichandleBefore(file){
|
|
|
|
|
console.log(file)
|
|
|
|
|
if((file.size/1000) > 10240){
|
|
|
|
|
Message({
|
|
|
|
|
type:'warning',
|
|
|
|
|
message:'上传文件大小超过2M!'
|
|
|
|
|
})
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
pichandleRemove(file, fileList) {
|
|
|
|
|
//console.log(file, fileList);
|
|
|
|
|
},
|
|
|
|
|
pichandlePreview(file) {
|
|
|
|
|
console.log(file);
|
|
|
|
|
},
|
|
|
|
|
pichandleSuccess(response, file, fileList){
|
|
|
|
|
this.picfileList.push(response.url)
|
|
|
|
|
},
|
|
|
|
|
pichandleBeforeRemove(file){
|
|
|
|
|
this.picfileList.splice(this.picfileList.indexOf(file.response.id),1)
|
|
|
|
|
methods: {
|
|
|
|
|
pichandleBefore(file) {
|
|
|
|
|
console.log(file)
|
|
|
|
|
if ((file.size / 1000) > 10240) {
|
|
|
|
|
Message({
|
|
|
|
|
type: 'warning',
|
|
|
|
|
message: '上传文件大小超过10M!'
|
|
|
|
|
})
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
pichandleRemove(file, fileList) {
|
|
|
|
|
//console.log(file, fileList);
|
|
|
|
|
},
|
|
|
|
|
pichandlePreview(file) {
|
|
|
|
|
console.log(file);
|
|
|
|
|
},
|
|
|
|
|
pichandleSuccess(response, file, fileList) {
|
|
|
|
|
this.picfileList.push(response.url)
|
|
|
|
|
},
|
|
|
|
|
pichandleBeforeRemove(file) {
|
|
|
|
|
this.picfileList.splice(this.picfileList.indexOf(file.response.id), 1)
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
addListCombo() {
|
|
|
|
|
this.form.set_list.push({
|
|
|
|
|
name: '',
|
|
|
|
|
content: ''
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
deleteCombo(scope) {
|
|
|
|
|
this.form.set_list.splice(scope.$index, 1)
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
addListCombo(){
|
|
|
|
|
this.form.set_list.push({
|
|
|
|
|
name:'',
|
|
|
|
|
content:''
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
deleteCombo(scope){
|
|
|
|
|
this.form.set_list.splice(scope.$index,1)
|
|
|
|
|
},
|
|
|
|
|
//上传
|
|
|
|
|
uploadFailVideo(err) {
|
|
|
|
|
console.log(err)
|
|
|
|
|
@ -444,7 +464,9 @@
|
|
|
|
|
coverPicture: res?.cover_picture,
|
|
|
|
|
timeLimit: res?.time_limit?.split(','),
|
|
|
|
|
content: res?.content,
|
|
|
|
|
video: res?.video
|
|
|
|
|
video: res?.video,
|
|
|
|
|
set_list: [],
|
|
|
|
|
picture_list: []
|
|
|
|
|
}
|
|
|
|
|
this.$refs['tinymce'].setContent(this.form.content)
|
|
|
|
|
},
|
|
|
|
|
@ -453,13 +475,39 @@
|
|
|
|
|
this.clubSelect.page++
|
|
|
|
|
this.getClubs()
|
|
|
|
|
},
|
|
|
|
|
async getCombo() {
|
|
|
|
|
let list = []
|
|
|
|
|
const res = await getCombo({
|
|
|
|
|
common_products_id: this.id
|
|
|
|
|
})
|
|
|
|
|
list.push(...res);
|
|
|
|
|
|
|
|
|
|
return list;
|
|
|
|
|
},
|
|
|
|
|
async getPic() {
|
|
|
|
|
|
|
|
|
|
let list = []
|
|
|
|
|
const res = await getPicture({
|
|
|
|
|
common_products_id: this.id
|
|
|
|
|
})
|
|
|
|
|
list.push(...res.map(item => {
|
|
|
|
|
return {
|
|
|
|
|
url: item.picture,
|
|
|
|
|
name: item.name || item.picture,
|
|
|
|
|
id: item.id
|
|
|
|
|
}
|
|
|
|
|
}))
|
|
|
|
|
|
|
|
|
|
return list;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
submit() {
|
|
|
|
|
|
|
|
|
|
let list = [];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
submit() {
|
|
|
|
|
|
|
|
|
|
let list=[];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let _form = {
|
|
|
|
|
name: this.form.name,
|
|
|
|
|
room_type: this.form.roomType,
|
|
|
|
|
@ -475,9 +523,9 @@
|
|
|
|
|
price: this.form.price,
|
|
|
|
|
room_area: this.form.roomArea,
|
|
|
|
|
time_limit: this.form.timeLimit?.toString(),
|
|
|
|
|
video: this.form.video,
|
|
|
|
|
set_list:this.form.set_list,
|
|
|
|
|
picture_list:list
|
|
|
|
|
video: this.form.video,
|
|
|
|
|
set_list: this.form.set_list,
|
|
|
|
|
picture_list: list
|
|
|
|
|
}
|
|
|
|
|
if (this.type === 'add') {
|
|
|
|
|
store(_form).then(res => {
|
|
|
|
|
|