Commit e30d1e7f by dongjipeng

add

parent cf6f09d7
......@@ -22,6 +22,11 @@
box-sizing: border-box
}
}
&.el-button--primary {
span {
a {color: #ffffff}
}
}
}
/*
......
......@@ -25,6 +25,7 @@ if (process.env.VUE_APP_API_PREFIX === 'development') { // 开发
axios.defaults.baseURL = 'http://10.2.98.32:8081/admin/'
Vue.prototype.$baseURL = 'http://10.2.98.32:8081/admin/'
Vue.prototype.$imgUrl = 'http://10.2.98.32:8081/admin/images/'
Vue.prototype.$export = 'http://10.2.98.32:8081/admin/export/'
Vue.prototype.$uploaderUrl = 'http://10.2.98.32:8081/admin/'
} else { // 生产
axios.defaults.baseURL = 'http://happy.cfldpe.com/admin/'
......@@ -36,6 +37,11 @@ if (process.env.VUE_APP_API_PREFIX === 'development') { // 开发
axios.interceptors.response.use(function (response) {
if (response.data.code === '0') {
return response.data.data
} else {
Vue.prototype.$message({
type: 'error',
message: '操作失败!'
})
}
})
......
......@@ -337,6 +337,14 @@ export default new Router({
meta: {
title: '主题活动'
}
},
{
path: '/restaurant/restaurantClassify',
name: 'restaurantClassify',
component: r => { require(['./views/restaurant/RestaurantClassify'], r) },
meta: {
title: '主题活动'
}
}
]
}
......
......@@ -10,7 +10,7 @@
:value="item.id">
</el-option>
</el-select>
<p style="display: inline-block; vertical-align: middle; font-size: 14px; color: #666666; margin-right: 20px">领队人:xxx <span style="padding-left: 20px">电话:139132134</span></p>
<p style="display: inline-block; vertical-align: middle; font-size: 14px; color: #666666; margin-right: 20px">领队人:{{leaderName}} <span style="padding-left: 20px">电话:{{leaderTel}}</span></p>
<el-button type="text" size="small" style="font-size: 14px" @click="centerDialogVisible1 = true">修改</el-button>
<el-button type="primary" size="small" @click="centerDialogVisible = true" class="fr">新增</el-button>
</div>
......@@ -88,11 +88,6 @@
width="35%"
center>
<el-form :model="form">
<!--<el-form-item label="标题" :label-width="formLabelWidth">
<el-col :sm="18">
<el-input v-model="form.pictureOriginalName" autocomplete="off" disabled="disabled"></el-input>
</el-col>
</el-form-item>-->
<el-form-item label="图片上传" :label-width="formLabelWidth">
<el-col :sm="24">
<el-row class="img_load">
......@@ -104,7 +99,7 @@
:multiple="true"
:on-success="handleAvatarSuccess"
:before-upload="beforeAvatarUpload">
<img v-if="imageUrl" :src="$imgUrl + form.picturePath" class="avatar">
<img v-if="form.picturePath" :src="$imgUrl + form.picturePath" class="avatar">
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
<p style="font-size: 12px; line-height: 14px">*请上传尺寸为 <em>1920*502</em>,大小不超过5M的图片</p>
......@@ -191,17 +186,20 @@ export default {
pictureOrder: '',
pictureMark: ''
},
imageUrl: '',
centerDialogVisible1: false,
formLabelWidth1: '80px',
form1: {
leaderName: '',
leaderTel: ''
}
},
leaderList: [],
leaderName: '',
leaderTel: ''
}
},
mounted () {
this._getClassify()
this._getLeaderList()
},
methods: {
_getClassify () {
......@@ -213,15 +211,27 @@ export default {
_this._getPhotoList()
})
},
handleSizeChange: function (size) {
this.pageSize = size
_getLeaderList () { // 获取领队人列表
let _this = this
this.$axios.get('/team/leader/list')
.then(function (res) {
if (res) {
_this.leaderList = res
}
})
},
handleCurrentChange: function (currentPage) {
this.currentPage = currentPage
this._getPhotoList()
_handleLeader () {
this.leaderList.forEach((item, index) => {
if (item.classify_Id === this.classifyId) {
this.leaderName = item.leader_name
this.leaderTel = item.tel
}
})
},
_getPhotoList () { // 图集列表
let _this = this
_this.leaderName = ''
_this.leaderTel = ''
this.$axios.get('/team/list', {
params: {
'p': _this.currentPage,
......@@ -231,10 +241,17 @@ export default {
}).then(function (res) {
_this.totalPage = res.count
_this.photoList = res.list
_this._handleLeader()
})
},
handleSizeChange: function (size) {
this.pageSize = size
},
handleCurrentChange: function (currentPage) {
this.currentPage = currentPage
this._getPhotoList()
},
handleAvatarSuccess (res, file) { // 上传
this.imageUrl = URL.createObjectURL(file.raw)
this.form.pictureName = res.data[0].fileName
this.form.pictureOriginalName = res.data[0].fileOriginalName
this.form.pictureSize = res.data[0].fileSize
......
......@@ -2,7 +2,6 @@
<div>
<div class="btn-warp tr mb20">
<el-button type="primary" size="small" @click="addClassifyImg(item)" v-for="(item, index) in classifyList" :key="index">{{item.classifyName}}</el-button>
<!--<el-button type="primary" size="small">农场运营</el-button>-->
</div>
<el-table
:data="photoList"
......@@ -74,27 +73,23 @@
</el-pagination>
</div>
<el-dialog
title="上传团建活动"
title="幸福农场"
:visible.sync="centerDialogVisible"
width="35%"
center>
<el-form :model="form1">
<el-form-item label="标题" :label-width="formLabelWidth">
<el-col :sm="18">
<el-input v-model="form1.pictureOriginalName" autocomplete="off" disabled="disabled"></el-input>
</el-col>
</el-form-item>
<el-form-item label="图片上传" :label-width="formLabelWidth">
<el-col :sm="24">
<el-row class="img_load">
<el-col :sm="18">
<el-upload
class="avatar-uploader"
action="http://10.2.98.32:8081/index/banner/upload"
:action="$baseURL + '/farm/photoUpdate'"
:show-file-list="false"
name="img"
:on-success="handleAvatarSuccess"
:before-upload="beforeAvatarUpload">
<img v-if="imageUrl" :src="imageUrl" class="avatar">
<img v-if="form1.picturePath" :src="$imgUrl + form1.picturePath" class="avatar">
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
<p style="font-size: 12px; line-height: 14px">*请上传尺寸为 <em>1920*502</em>,大小不超过5M的图片</p>
......@@ -102,6 +97,11 @@
</el-row>
</el-col>
</el-form-item>
<el-form-item label="图片名称" :label-width="formLabelWidth">
<el-col :sm="18">
<el-input v-model="form1.pictureOriginalName" autocomplete="off" disabled="disabled"></el-input>
</el-col>
</el-form-item>
<el-form-item label="介绍" :label-width="formLabelWidth">
<el-col :sm="18">
<el-input v-model="form1.pictureMark" autocomplete="off"></el-input>
......@@ -142,7 +142,6 @@ export default {
picturePath: '',
pictureMark: ''
},
imageUrl: '',
formLabelWidth: '120px'
}
},
......@@ -151,21 +150,14 @@ export default {
this._getPhotoList()
},
methods: {
_getClassify () {
_getClassify () { // 图集分类列表
let _this = this
this.$axios.get('/module/classify/幸福农场')
.then(function (res) {
_this.classifyList = res
})
},
handleSizeChange: function (size) {
this.pageSize = size
},
handleCurrentChange: function (currentPage) {
this.currentPage = currentPage
this._getPhotoList()
},
_getPhotoList () { // 图集列表
_getPhotoList () { // 图片列表
let _this = this
this.$axios.get('/farm/photoList', {
params: {
......@@ -177,12 +169,14 @@ export default {
_this.photoList = res.list
})
},
addClassifyImg (item) {
this.classifyId = item.id
this.centerDialogVisible = true
handleSizeChange: function (size) {
this.pageSize = size
},
handleCurrentChange: function (currentPage) {
this.currentPage = currentPage
this._getPhotoList()
},
handleAvatarSuccess (res, file) { // 图片上传
this.imageUrl = URL.createObjectURL(file.raw)
this.form1.pictureName = res.data.fileName
this.form1.pictureOriginalName = res.data.fileOriginalName
this.form1.picturePath = res.data.filePath
......@@ -195,7 +189,14 @@ export default {
}
return isLt5M
},
uploadImg () { // 上传
addClassifyImg (item) {
this.classifyId = item.id
this.form1.pictureOriginalName = ''
this.form1.picturePath = ''
this.form1.pictureMark = ''
this.centerDialogVisible = true
},
uploadImg () { // 图片添加
let _this = this
let params = {
'classifyId': _this.classifyId,
......@@ -213,7 +214,7 @@ export default {
}
})
},
photoDel (item) {
photoDel (item) { // 图片删除
this.$confirm('确定删除这条数据吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
......
......@@ -7,54 +7,60 @@
<!--<planting-trees ref="mychild" :id="item.id"></planting-trees>-->
<el-form ref="form">
<el-form-item label="活动状态:">
<el-col :sm="5">{{activityStatusComp}}</el-col>
<el-col :sm="7">{{activityStatusComp}}</el-col>
</el-form-item>
<el-form-item label="活动期限:">
<el-col :span="3">
<el-col :sm="3">
<el-date-picker type="datetime" placeholder="选择日期" v-model="startTime" value-format="yyyy-MM-dd HH:mm:ss" style="width: 100%;"></el-date-picker>
</el-col>
<el-col class="line tc" :span="1"></el-col>
<el-col :span="3">
<el-col class="line tc" :sm="1"></el-col>
<el-col :sm="3">
<el-date-picker type="datetime" placeholder="选择日期" v-model="endTime" value-format="yyyy-MM-dd HH:mm:ss" style="width: 100%;"></el-date-picker>
</el-col>
</el-form-item>
<el-form-item label="活动介绍:">
<!--<el-form-item label="活动介绍:">
<el-col :sm="6">
<el-upload
class="activity-upload"
action="http://10.2.98.32:8081/farm/activityFileUpdate"
:action="$baseURL + '/farm/activityFileUpdate'"
:multiple="false"
:limit="1"
name="fileUpdate"
:file-list="introduceFile"
:on-success="introduceHandleAvatarSuccess">
<el-button size="small" type="text" icon="el-icon-upload2" class="btn-upload"></el-button>
<!--<div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过500kb</div>-->
</el-upload>
</el-col>
</el-form-item>-->
<el-form-item label="活动介绍:">
<el-col :sm="7">
<el-input v-model="introduceName" type="textarea" :rows="5"></el-input>
</el-col>
</el-form-item>
<el-form-item label="活动指引:">
<el-col :sm="6">
<el-col :sm="7">
<el-upload
class="activity-upload"
action="http://10.2.98.32:8081/farm/activityFileUpdate"
style="margin-top: -6px"
:action="$baseURL + '/farm/activityFileUpdate'"
name="fileUpdate"
:limit="1"
:multiple="false"
:file-list="guideFile"
:on-success="guideHandleAvatarSuccess">
<el-button size="small" type="text" icon="el-icon-upload2" class="btn-upload"></el-button>
<!--<div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过500kb</div>-->
</el-upload>
</el-col>
</el-form-item>
<el-form-item label="二维码:">
<el-col :sm="6">
<el-col :sm="7">
<el-upload
class="avatar-uploader"
action="http://10.2.98.32:8081/index/banner/upload"
:action="$baseURL + '/farm/photoUpdate'"
:show-file-list="false"
name="img"
:on-success="qrcodeHandleAvatarSuccess">
<img v-if="imageUrl" :src="imageUrl" class="avatar">
<img v-if="qrcodePath" :src="$imgUrl + qrcodePath" class="avatar">
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</el-col>
......@@ -88,10 +94,10 @@ export default {
endTime: '',
introduceFile: [],
guideFile: [],
qrcodePath: '',
qrcodeUniqueName: '',
qrcodeName: '',
qrcodePath: '',
imageUrl: ''
introduceName: ''
}
},
mounted () {
......@@ -121,6 +127,7 @@ export default {
_this.status = res.status
_this.startTime = res.startTime
_this.endTime = res.endTime
_this.introduceName = res.introduceName
_this.introduceFile = [
{
name: res.guideName,
......@@ -137,7 +144,7 @@ export default {
_this.qrcodePath = res.qrcodePath
})
},
introduceHandleAvatarSuccess (res, file) {
introduceHandleAvatarSuccess (res, file) { // 活动介绍文件上传
this.introduceFile = [
{
name: file.name,
......@@ -145,7 +152,8 @@ export default {
}
]
},
guideHandleAvatarSuccess (res, file) {
guideHandleAvatarSuccess (res, file) { // 活动指引文件上传
console.log(res)
this.guideFile = [
{
name: file.name,
......@@ -153,11 +161,10 @@ export default {
}
]
},
qrcodeHandleAvatarSuccess (res, file) {
this.imageUrl = URL.createObjectURL(file.raw)
qrcodeHandleAvatarSuccess (res, file) { // 二维码图片上传
this.qrcodePath = res.data.filePath
this.qrcodeUniqueName = res.data.fileOriginalName
this.qrcodeName = res.data.fileName
this.qrcodePath = res.data.filePath
},
saveHandle (item) { // 保存
let _this = this
......@@ -165,9 +172,7 @@ export default {
'activityType': _this.activityType,
'startTime': _this.startTime,
'endTime': _this.endTime,
'introduceUniqueName': _this.introduceFile[0].name,
'introduceName': _this.introduceFile[0].name,
'introducePath': _this.introduceFile[0].url,
'introduceName': _this.introduceName,
'guideUniqueName': _this.guideFile[0].name,
'guideName': _this.guideFile[0].name,
'guidePath': _this.guideFile[0].url,
......@@ -175,7 +180,6 @@ export default {
'qrcodeName': _this.qrcodeName,
'qrcodePath': _this.qrcodePath
}
console.log(params)
this.$axios.post('/farm/activityAdd', params)
.then(function (res) {
console.log(res)
......
......@@ -11,7 +11,7 @@
:show-file-list="false">
<el-button size="small" type="primary">导入数据</el-button>
</el-upload>
<el-button size="small" class="el-button-link"><a :href="$baseURL + marathonExportHref" target="_blank" download="download">导出模板</a></el-button>
<el-button size="small" class="el-button-link"><a :href="$export + marathonExportHref" target="_blank" download="download">导出模板</a></el-button>
</el-form-item>
</el-form>
<el-table
......@@ -58,7 +58,7 @@
</template>
</el-table-column>
</el-table>
<div class="pagination">
<div class="pagination" v-if="dailyList.length">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
......@@ -109,14 +109,15 @@ export default {
this._getDailyList()
},
switchChange (item) { // 修改发布状态
console.log(item)
let _this = this
let params = {
this.$axios.get('/exercise/dailyIsShow', {
params: {
'isShow': item.isShow,
'exerciseDailyId': item.id
}
this.$axios.post('/exercise/dailyIsShow', params)
.then(function (res) {
if (res === 'OK') {
}).then(function (res) {
if (res) {
_this.$message({
type: 'success',
message: '状态修改成功!'
......@@ -132,7 +133,11 @@ export default {
type: 'warning'
}).then(() => {
let _this = this
this.$axios.post('/exercise/dailyDelete', { 'exerciseDailyId': id })
this.$axios.get('/exercise/dailyDelete', {
params: {
'exerciseDailyId': id
}
})
.then(function (res) {
if (res === 'OK') {
_this.$message({
......@@ -146,10 +151,10 @@ export default {
},
importCoolRunHandle (id) { // 导出数据
let _this = this
this.$axios.get('/exercise/dailyDateImport', {
this.$axios.get('/exercise/dailyDateExport', {
params: { 'exerciseDailyId': id }
}).then(function (res) {
let href = _this.$baseURL + res
let href = _this.$export + res
window.open(href)
})
},
......
......@@ -17,7 +17,7 @@
:show-file-list="false">
<el-button size="small" type="primary">导入数据</el-button>
</el-upload>
<el-button size="small" class="el-button-link"><a :href="$baseURL + marathonExportHref" target="_blank" download="download">导出模板</a></el-button>
<el-button size="small" class="el-button-link"><a :href="$export + marathonExportHref" target="_blank" download="download">导出模板</a></el-button>
</el-form-item>
</el-form>
<el-table
......@@ -118,9 +118,10 @@ export default {
'c': _this.pageSizeMarathon
}
}).then(function (res) {
if (res) {
_this.totalPageMarathon = res.count
_this.marathonData = res.list
_this.exerciseMarathonName = ''
}
})
},
marathonDel (item) { // 马拉松删除
......
......@@ -12,7 +12,7 @@
</el-select>
</el-col>
<el-col :span="4" align="right">
<el-button type="primary" size="small" @click="exportFile">导出</el-button>
<el-button size="small" class="el-button-link"><a :href="$baseURL + exportHref" target="_blank" download="download">导出</a></el-button>
</el-col>
</el-row>
<el-table
......@@ -156,12 +156,14 @@ export default {
messageList: [],
leaveMessageId: '',
centerDialogVisible: false,
remarks: ''
remarks: '',
exportHref: ''
}
},
mounted () {
this._getModuleList()
this._getMessageList()
this.exportFile()
},
methods: {
noteHandle (id) {
......@@ -204,6 +206,9 @@ export default {
this.$axios.post('/leave/message/add/remarks', params)
.then(function (res) {
console.log(res)
if (res === 'OK') {
_this.centerDialogVisible = false
}
})
},
confirmDeal (id) { // 确认处理
......@@ -216,6 +221,12 @@ export default {
_this.$axios.post('/leave/message/update/status', { 'leaveMessageId': id })
.then(function (res) {
console.log(res)
if (res === 'OK') {
_this.$message({
type: 'success',
message: '确认处理成功!'
});
}
})
}).catch(function () {
console.log('取消此操作')
......@@ -228,7 +239,9 @@ export default {
'moduleId': _this.moduleVal
}
}).then(function (res) {
console.log(res)
if (res) {
_this.exportHref = res
}
})
}
}
......
......@@ -26,11 +26,6 @@
align="center"
label="名称">
</el-table-column>
<!--<el-table-column
prop="pictureOrder"
align="center"
label="图片排序">
</el-table-column>-->
<el-table-column
prop="pictureSize"
align="center"
......@@ -72,28 +67,24 @@
</el-pagination>
</div>
<el-dialog
title="无忧办公"
title="幸福传递"
:visible.sync="centerDialogVisible"
width="35%"
center>
<el-form :model="form">
<el-form-item label="标题" :label-width="formLabelWidth">
<el-col :sm="18">
<el-input v-model="form.pictureOriginalName" autocomplete="off" disabled="disabled"></el-input>
</el-col>
</el-form-item>
<el-form-item label="图片上传" :label-width="formLabelWidth">
<el-col :sm="24">
<el-row class="img_load">
<el-col :sm="18">
<el-upload
class="avatar-uploader"
action="http://10.2.98.32:8081/roomofmother/picture/upload"
:action="$baseURL + 'warmth/pictureUpdate'"
name="img"
:show-file-list="false"
:multiple="true"
:on-success="handleAvatarSuccess"
:before-upload="beforeAvatarUpload">
<img v-if="imageUrl" :src="imageUrl" class="avatar">
<img v-if="form.picturePath" :src="$imgUrl + form.picturePath" class="avatar">
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
<p style="font-size: 12px; line-height: 14px">*请上传尺寸为 <em>1920*502</em>,大小不超过5M的图片</p>
......@@ -101,6 +92,11 @@
</el-row>
</el-col>
</el-form-item>
<el-form-item label="标题" :label-width="formLabelWidth">
<el-col :sm="18">
<el-input v-model="form.pictureOriginalName" autocomplete="off" disabled="disabled"></el-input>
</el-col>
</el-form-item>
<el-form-item label="图片大小" :label-width="formLabelWidth">
<el-col :sm="18">
<el-input v-model="form.pictureSize" autocomplete="off" disabled="disabled"></el-input>
......@@ -146,6 +142,7 @@ export default {
form: {
pictureName: '',
pictureOriginalName: '',
picturePath: '',
pictureSize: '',
pictureOrder: '',
pictureMark: ''
......@@ -157,7 +154,7 @@ export default {
this._getClassify()
},
methods: {
_getClassify () {
_getClassify () { // 图集列表
let _this = this
this.$axios.get('/module/classify/幸福传递')
.then(function (res) {
......@@ -165,14 +162,7 @@ export default {
_this._getPhotoList()
})
},
handleSizeChange: function (size) {
this.pageSize = size
},
handleCurrentChange: function (currentPage) {
this.currentPage = currentPage
this._getPhotoList()
},
_getPhotoList () { // 图集列表
_getPhotoList () { // 图片列表
let _this = this
this.$axios.get('/warmth/warmthPictureList', {
params: {
......@@ -184,12 +174,18 @@ export default {
_this.photoList = res.list
})
},
handleSizeChange: function (size) {
this.pageSize = size
},
handleCurrentChange: function (currentPage) {
this.currentPage = currentPage
this._getPhotoList()
},
handleAvatarSuccess (res, file) { // 上传
this.imageUrl = URL.createObjectURL(file.raw)
this.form.pictureName = res.data[0].fileName
this.form.pictureOriginalName = res.data[0].fileOriginalName
this.form.pictureSize = res.data[0].fileSize
this.form.picturePath = res.data[0].filePath
this.form.pictureName = res.data.fileName
this.form.pictureOriginalName = res.data.fileOriginalName
this.form.pictureSize = res.data.fileSize
this.form.picturePath = res.data.filePath
},
beforeAvatarUpload (file) {
const isLt5M = file.size / 1024 / 1024 < 5
......
<template>
<div class="restaurant-classify">
<el-form ref="form" label-width="100px">
<el-form-item label="图集">
<el-col :sm="5">
<el-select v-model="classifyId" placeholder="请选择" style="width: 100%">
<el-option
v-for="item in classifyList"
:key="item.id"
:label="item.classifyName"
:value="item.id">
</el-option>
</el-select>
</el-col>
<el-col :sm="3" :offset="1">
<div style="width: 100%; position: relative" class="classify-manage">
<el-button @click="classfiyHandleShow = true">图集管理</el-button>
<div class="classify-warp" v-if="classfiyHandleShow">
<el-form class="classify-add-form" :inline="true" size="mini">
<el-form-item style="margin-bottom: 13px; float: left">
<el-input v-model="newClassfiyName" placeholder="请输入图集名称"></el-input>
</el-form-item>
<el-input-number style="margin-bottom: 13px; float: left" v-model="newClassfiyOrder" controls-position="right" :min="1" size="mini"></el-input-number>
<el-form-item style="margin-bottom: 13px; float: right">
<el-button @click="addNewClassfiyHandle">添加</el-button>
<el-button @click="classfiyHandleShow = false">关闭</el-button>
</el-form-item>
</el-form>
<el-table
:data="classifyList"
height="250"
border
size="mini"
:header-cell-style="{'background-color': '#3D4851', 'color': '#fff', 'padding': '2px 0'}"
:cell-style="{'padding': '4px 0'}"
class="classfiy-add-table"
style="width: 100%">
<el-table-column
type="index"
label="序号"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="classifyName"
label="名称"
align="center"
width="120">
</el-table-column>
<el-table-column
prop="createUser"
label="创建人"
align="center"
width="100">
</el-table-column>
<el-table-column
prop="createTime"
align="center"
width="120"
label="创建时间">
</el-table-column>
<el-table-column
prop="address"
width="100"
align="center"
fixed="right"
label="操作">
<template slot-scope="scope">
<button type="text" style="color: #666; text-decoration: underline" @click="changeClassfiyHandle(scope.row)">修改</button>
<button type="text" style="color: #666; text-decoration: underline" @click="delClassfiyHandle(scope.row.id)">删除</button>
</template>
</el-table-column>
</el-table>
</div>
</div>
</el-col>
</el-form-item>
<el-form-item label="图片上传">
<el-col :sm="5">
<el-upload
class="avatar-uploader"
:action="$uploaderUrl + '/diningroom/picture/upload'"
:show-file-list="false"
:multiple="true"
name="files"
:on-success="handleAvatarSuccess"
:before-upload="beforeAvatarUpload">
<img v-if="picturePath" :src="$imgUrl + picturePath" class="avatar">
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
<p style="font-size: 12px; line-height: 14px">*请上传尺寸为 <em>1920*502</em>,大小不超过5M的图片</p>
</el-col>
</el-form-item>
<el-form-item label="图片大小">
<el-col :sm="5">
<el-input v-model="pictureSize" autocomplete="off" disabled="disabled"></el-input>
</el-col>
</el-form-item>
<el-form-item label="图片排序">
<el-col :sm="18">
<el-input-number v-model="pictureOrder" controls-position="right" :min="1"></el-input-number>
</el-col>
</el-form-item>
<el-form-item label="备注">
<el-col :sm="5">
<el-input v-model="pictureMark" autocomplete="off" type="textarea" :rows="5"></el-input>
</el-col>
</el-form-item>
</el-form>
<el-row style="margin-top: 50px">
<el-col :span="3" :offset="2">
<el-row type="flex" justify="space-between">
<el-col :sm="2">
<el-button size="small">取消</el-button>
</el-col>
<el-col :sm="2">
<el-button type="danger" size="small">确认</el-button>
</el-col>
</el-row>
</el-col>
</el-row>
<el-dialog
title="图集修改"
:visible.sync="classfiyDialogVisible"
width="26%"
center>
<el-form :model="classfiyForm" label-width="120px">
<el-form-item label="图集名称">
<el-col :sm="15">
<el-input v-model="classfiyForm.classifyName" autocomplete="off"></el-input>
</el-col>
</el-form-item>
<el-form-item label="图集名称">
<el-col :sm="15">
<el-input-number v-model="classfiyForm.classifyOrder" controls-position="right" :min="1"></el-input-number>
</el-col>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-row type="flex" justify="center">
<el-col :sm="10">
<div class="btn-warp">
<el-button @click="classfiyDialogVisible = false">取 消</el-button>
<el-button type="danger" @click="saveChangeClassfiyHandle">保 存</el-button>
</div>
</el-col>
</el-row>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
name: 'restaurantClassify',
data () {
return {
pictureName: '',
picturePath: '',
pictureOriginalName: '',
pictureSize: '',
pictureOrder: '',
pictureMark: '',
classfiyHandleShow: false,
moduleId: '',
classifyId: '',
classifyList: [],
newClassfiyName: '',
newClassfiyOrder: '',
classfiyDialogVisible: false,
classfiyForm: {
classfiyId: '',
classifyName: '',
classifyOrder: ''
}
}
},
mounted () {
this._getClassify()
},
methods: {
_getClassify () { // 图集列表
let _this = this
this.$axios.get('/module/classify/幸福餐厅')
.then(function (res) {
_this.moduleId = res[0].moduleId // 模块id
_this.classifyId = res[0].id
_this.classifyList = res
})
},
handleAvatarSuccess (res, file) { // 上传
this.pictureName = res.data[0].fileName
this.pictureOriginalName = res.data[0].fileOriginalName
this.pictureSize = res.data[0].fileSize
this.picturePath = res.data[0].filePath
},
beforeAvatarUpload (file) {
const isLt5M = file.size / 1024 / 1024 < 5
if (!isLt5M) {
this.$message.error('上传头像图片大小不能超过 5MB!')
}
return isLt5M
},
addNewClassfiyHandle () { // 添加图集
let _this = this
let params = {
'classifyName': _this.newClassfiyName,
'classifyOrder': _this.newClassfiyOrder,
'moduleId': _this.moduleId
}
this.$axios.post('/diningroom/picture/classify/add', params)
.then(function (res) {
if (res === 'OK') {
_this._getClassify()
}
})
},
changeClassfiyHandle (item) {
this.classfiyForm.classfiyId = item.id
this.classfiyForm.classifyName = item.classifyName
this.classfiyForm.classifyOrder = item.classifyOrder
this.classfiyDialogVisible = true
},
saveChangeClassfiyHandle () { // 修改图集
let _this = this
let params = {
'classifyName': _this.classfiyForm.classifyName,
'classifyOrder': _this.classfiyForm.classifyOrder,
'id': _this.classfiyForm.classfiyId
}
this.$axios.post('/diningroom/picture/classify/update', params)
.then(function (res) {
if (res === 'OK') {
_this.classfiyDialogVisible = false
_this._getClassify()
_this.$message({
type: 'success',
message: '修改成功!'
})
}
})
},
delClassfiyHandle (id) { // 修改删除
let _this = this
this.$axios.get('/diningroom/picture/classify/delete', {
params: { 'id': id }
}).then(function (res) {
if (res === 'OK') {
_this.classfiyDialogVisible = false
_this._getClassify()
_this.$message({
type: 'success',
message: '删除成功!'
})
}
})
}
}
}
</script>
<style scoped lang="scss">
.classify-warp {
position: absolute;
width: 520px;
background: #fff;
border-radius: 4px;
z-index: 10;
top: 0;
left: 90px;
padding: 15px;
border: 1px solid #ededed;
box-shadow: 1px 1px 3px #ededed;
.classify-add-form {
text-align: center;
}
.classfiy-add-table {
.td_box {
padding: 0;
}
}
}
</style>
......@@ -12,7 +12,7 @@
</el-select>
</el-form-item>
<el-form-item style="float: right">
<el-button type="primary" @click="newPicHandle">新增</el-button>
<el-button size="small" class="el-button-link"><router-link to="/restaurant/restaurantClassify">新增图片</router-link></el-button>
</el-form-item>
</el-form>
<el-table
......@@ -62,9 +62,9 @@
<el-table-column
align="center"
label="操作"
width="200">
width="100">
<template slot-scope="scope">
<el-button icon="el-icon-edit" size="small" @click="pictureEditHandle(scope.row)"></el-button>
<!--<el-button icon="el-icon-edit" size="small" @click="pictureEditHandle(scope.row)"></el-button>-->
<el-button icon="el-icon-delete" size="small" @click="pictureDelHandle(scope.row)"></el-button>
</template>
</el-table-column>
......@@ -85,7 +85,7 @@
width="35%"
center>
<el-form :model="form" label-width="100px">
<el-form-item label="标题">
<el-form-item label="图集管理">
<el-col :sm="18">
<el-input v-model="form.pictureOriginalName" autocomplete="off" disabled="disabled"></el-input>
</el-col>
......@@ -169,7 +169,7 @@ export default {
this._getClassify()
},
methods: {
_getClassify () {
_getClassify () { // 图集列表
let _this = this
this.$axios.get('/module/classify/幸福餐厅')
.then(function (res) {
......@@ -178,7 +178,7 @@ export default {
_this._getPhotoList()
})
},
_getPhotoList () { // 图列表
_getPhotoList () { // 图列表
let _this = this
this.$axios.get('/diningroom/picture/list', {
params: {
......@@ -215,16 +215,6 @@ export default {
}
return isLt5M
},
newPicHandle () {
this.form.pictureName = ''
this.form.picturePath = ''
this.form.pictureOriginalName = ''
this.form.pictureSize = ''
this.form.pictureOrder = ''
this.form.pictureMark = ''
this.picId = ''
this.centerDialogVisible = true
},
addPictureHandle () { // 新增
let _this = this
let params = {
......@@ -266,16 +256,6 @@ export default {
})
}).catch(() => { console.log('取消删除') })
},
pictureEditHandle (item) { // 修改
this.form.pictureName = item.pictureName
this.form.picturePath = item.picturePath
this.form.pictureOriginalName = item.pictureOriginalName
this.form.pictureSize = item.pictureSize
this.form.pictureOrder = item.pictureOrder
this.form.pictureMark = item.pictureMark
this.picId = item.id
this.centerDialogVisible = true
},
savePictureHandle () {
let _this = this
let params = {
......
<template>
<div>
<el-form ref="form" :model="form" label-width="120px" size="small">
<el-form ref="form" label-width="120px" size="small">
<el-form-item label="所在省">
<el-col :sm="5">
<!-- <el-select v-model="form.province" placeholder="省份" style="width: 100%">
<el-option label="河北省" value="河北省"></el-option>
</el-select>-->
<el-col :sm="4">
<el-input v-model="province"></el-input>
</el-col>
</el-form-item>
<el-form-item label="所在市">
<el-col :sm="5">
<el-col :sm="4">
<el-input v-model="city"></el-input>
</el-col>
</el-form-item>
<el-form-item label="酒店名称">
<el-col :sm="5">
<el-col :sm="4">
<el-input v-model="hotelname"></el-input>
</el-col>
</el-form-item>
<el-form-item label="酒店电话">
<el-col :sm="4">
<el-input v-model="tel"></el-input>
</el-col>
</el-form-item>
<el-form-item label="详细地址">
<el-col :sm="5">
<el-col :sm="4">
<el-input v-model="address"></el-input>
<a href="http://api.map.baidu.com/lbsapi/getpoint/index.html" target="_blank" class="link">点击此处查询地区经纬度</a>
</el-col>
</el-form-item>
<el-form-item label="所在经度">
<el-col :sm="5">
<el-col :sm="4">
<el-input v-model="longitude"></el-input>
</el-col>
</el-form-item>
<el-form-item label="所在纬度">
<el-col :sm="5">
<el-col :sm="4">
<el-input v-model="latitudel"></el-input>
</el-col>
<el-col :sm="10">
<div style="position: relative; width: 450px">
<div style="position: relative; width: 400px">
<el-button type="text" style="position: absolute; left: 20px; top: 0" icon="el-icon-refresh" @click="searchMap"></el-button>
<div class="map" id="map" style="width: 100%; height: 200px; position: absolute; left: 60px; bottom: -32px"></div>
<div class="map" id="map" style="width: 100%; height: 180px; position: absolute; left: 60px; bottom: -30px"></div>
</div>
</el-col>
</el-form-item>
<el-form-item label="酒店联系人">
<el-col :sm="3">
<el-col :sm="4">
<el-input v-model="contacts"></el-input>
</el-col>
<el-col :sm="5" :offset="1">
<el-col :sm="6" :offset="1">
<el-form-item label="酒店联系人电话">
<el-col :sm="24">
<el-input v-model="contactsphone"></el-input>
......@@ -54,10 +56,10 @@
</el-col>
</el-form-item>
<el-form-item label="公司联系人">
<el-col :sm="3">
<el-col :sm="4">
<el-input v-model="person"></el-input>
</el-col>
<el-col :sm="5" :offset="1">
<el-col :sm="6" :offset="1">
<el-form-item label="公司联系人电话">
<el-col :sm="24">
<el-input v-model="persontel"></el-input>
......@@ -66,10 +68,10 @@
</el-col>
</el-form-item>
<el-form-item label="行政对接人">
<el-col :sm="3">
<el-col :sm="4">
<el-input v-model="docking"></el-input>
</el-col>
<el-col :sm="5" :offset="1">
<el-col :sm="6" :offset="1">
<el-form-item label="对接人电话">
<el-col :sm="24">
<el-input v-model="dockingphone"></el-input>
......@@ -78,13 +80,13 @@
</el-col>
</el-form-item>
<el-form-item label="房型&价格">
<el-col :sm="9">
<el-col :sm="11">
<div class="room_warp">
<div class="room_list">
<div class="room_item" v-for="(item, index) in classMap" :key="index">
<el-row>
<el-col :sm="2" :offset="1">房型:</el-col>
<el-col :sm="7"><el-input v-model="item.type"></el-input></el-col>
<el-col :sm="7"><el-input v-model="item.type" aria-required="true"></el-input></el-col>
<el-col :sm="2" :offset="3">价格:</el-col>
<el-col :sm="6"><el-input v-model="item.price"></el-input></el-col>
</el-row>
......@@ -95,21 +97,16 @@
</div>
</el-col>
</el-form-item>
<!--<el-form-item label="酒店排序">
<el-col :sm="5">
<el-input v-model="sort"></el-input>
</el-col>
<el-col :sm="5"><p style="padding-left: 20px; font-size: 12px">*请输入整数,数字越小,排序越靠前</p></el-col>
</el-form-item>-->
<el-form-item label="星级">
<el-col :sm="3">
<el-select v-model="starclass" placeholder="市区" style="width: 100%">
<el-option label="全部" value="全部"></el-option>
<el-option label="石家庄市" value="石家庄市"></el-option>
<el-option label="廊坊市" value="廊坊市"></el-option>
<el-col :sm="4">
<el-select v-model="starclass" style="width: 100%">
<el-option label="快捷" value="快捷"></el-option>
<el-option label="三星" value="三星"></el-option>
<el-option label="四星" value="四星"></el-option>
<el-option label="五星" value="五星"></el-option>
</el-select>
</el-col>
<el-col :sm="5" :offset="1">
<el-col :sm="6" :offset="1">
<el-form-item label="推荐">
<el-col :sm="24">
<el-select v-model="isrecommend" style="width: 100%">
......@@ -121,13 +118,13 @@
</el-col>
</el-form-item>
<el-form-item label="是否合同期内">
<el-col :sm="3">
<el-col :sm="4">
<el-select v-model="contractperiod" style="width: 100%">
<el-option label="是" value="0"></el-option>
<el-option label="否" value="1"></el-option>
</el-select>
</el-col>
<el-col :sm="5" :offset="1">
<el-col :sm="6" :offset="1">
<el-form-item label="合同期限">
<el-col :sm="24">
<el-input v-model="termofvalidity"></el-input>
......@@ -136,7 +133,7 @@
</el-col>
</el-form-item>
<el-form-item label="备注">
<el-col :sm="9">
<el-col :sm="11">
<el-input type="textarea" v-model="remarks" :rows="5"></el-input>
</el-col>
</el-form-item>
......@@ -145,10 +142,11 @@
<el-col :span="3" :offset="2">
<el-row type="flex" justify="space-between">
<el-col :sm="2">
<el-button size="small"></el-button>
<el-button size="small" @click="$router.go(-1)"></el-button>
</el-col>
<el-col :sm="2">
<el-button type="danger" size="small" @click="_save">确认</el-button>
<el-button type="danger" size="small" @click="addNewHotel" v-if="!$route.params.hotelId">确 认</el-button>
<el-button type="danger" size="small" @click="saveChangeHotel" v-if="$route.params.hotelId">保 存</el-button>
</el-col>
</el-row>
</el-col>
......@@ -161,40 +159,76 @@ export default {
name: 'hotelAdd',
data () {
return {
form: {
province: '河北省',
city: '全部',
laundryName: '',
detailAddress: '',
province: '',
city: '',
hotelname: '',
tel: '',
address: '',
longitude: '',
latitude: '',
pickWay: '0',
contactMan: '',
contactNumber: '',
principal: '',
principalNumber: '',
businessHours: '',
supplier: ''
},
latitudel: '',
contacts: '',
contactsphone: '',
person: '',
persontel: '',
docking: '',
dockingphone: '',
classMap: [
{
type: '11',
price: '22'
type: '',
price: ''
}
]
],
starclass: '',
isrecommend: '',
contractperiod: '',
termofvalidity: '',
remarks: ''
}
},
mounted () {
this._getDetail()
this.createMap(116.404, 39.915)
},
methods: {
_getDetail () { // 获取酒店详细信息
let _this = this
if (_this.$route.params.hotelId) {
this.$axios.get('/travel/update/list', {
params: {
'id': _this.$route.params.hotelId
}
}).then(function (res) {
_this.province = res[0].province
_this.city = res[0].city
_this.hotelname = res[0].hotelname
_this.tel = res[0].tel
_this.address = res[0].address
_this.longitude = res[0].longitude
_this.latitudel = res[0].latitudel
_this.contacts = res[0].contacts
_this.contactsphone = res[0].contactsphone
_this.person = res[0].person
_this.persontel = res[0].persontel
_this.docking = res[0].docking
_this.dockingphone = res[0].dockingphone
_this.classMap = res[0].classMap
_this.starclass = res[0].starclass
_this.isrecommend = res[0].isrecommend
_this.contractperiod = res[0].contractperiod
_this.termofvalidity = res[0].termofvalidity
_this.remarks = res[0].remarks
})
}
},
createMap (longitude, latitude) {
/* eslint-disable */
var map = new BMap.Map('map')
map.enableScrollWheelZoom(true)
var point = new BMap.Point(longitude, latitude)
let marker = new BMap.Marker(point) // 创建标注
map.addOverlay(marker) // 将标注添加到地图中
let marker = new BMap.Marker(point)
map.addOverlay(marker)
map.centerAndZoom(point, 15)
/* eslint-disable */
},
searchMap () {
this.createMap(this.form.longitude, this.form.latitude)
......@@ -206,41 +240,77 @@ export default {
})
},
roomDel (index) { // 删除房型
if (this.classMap.length > 1) {
this.classMap.splice(index, 1)
}
},
_save () {
addNewHotel () { // 添加
let _this = this
let params = {
'address': 'String',
'city': 'String',
'classMap': [
{
'price': 'string',
'type': 'string'
}
],
'contacts': 'String',
'contactsphone': 'String',
'contractperiod': 'String',
'docking': 'String',
'dockingphone': 'String',
'hotelname': 'String',
'isrecommend': 0,
'latitudel': 'String',
'longitude': 'String',
'person': 'string',
'persontel': 'string',
'price': 'String',
'province': 'String',
'remarks': 'String',
'starclass': 'String',
'tel': 'String',
'termofvalidity': 'String',
'type': 'String',
'yn_delete': 'String'
'address': _this.address,
'city': _this.city,
'classMap': _this.classMap,
'contacts': _this.contacts,
'contactsphone': _this.contactsphone,
'contractperiod': _this.contractperiod,
'docking': _this.docking,
'dockingphone': _this.dockingphone,
'hotelname': _this.hotelname,
'isrecommend': _this.isrecommend,
'latitudel': _this.latitudel,
'longitude': _this.longitude,
'person': _this.person,
'persontel': _this.persontel,
'province': _this.province,
'remarks': _this.remarks,
'starclass': _this.starclass,
'tel': _this.tel,
'termofvalidity': _this.termofvalidity
}
this.$axios.post('/travel/add', params)
.then(function (res) {
console.log(res)
if (res === 'ok') {
_this.$message({
type: 'success',
message: '添加成功!'
})
_this.$router.go(-1)
}
})
},
saveChangeHotel () { // 修改
let _this = this
let params = {
'id': _this.$route.params.hotelId,
'address': _this.address,
'city': _this.city,
'classMap': _this.classMap,
'contacts': _this.contacts,
'contactsphone': _this.contactsphone,
'contractperiod': _this.contractperiod,
'docking': _this.docking,
'dockingphone': _this.dockingphone,
'hotelname': _this.hotelname,
'isrecommend': _this.isrecommend,
'latitudel': _this.latitudel,
'longitude': _this.longitude,
'person': _this.person,
'persontel': _this.persontel,
'province': _this.province,
'remarks': _this.remarks,
'starclass': _this.starclass,
'tel': _this.tel,
'termofvalidity': _this.termofvalidity
}
this.$axios.post('/travel/update', params)
.then(function (res) {
if (res === 'ok') {
_this.$message({
type: 'success',
message: '修改成功!'
})
_this.$router.go(-1)
}
})
}
}
......
......@@ -9,6 +9,7 @@
</el-form-item>
<el-form-item>
<el-select v-model="starclass" placeholder="星级">
<el-option label="快捷" value="快捷"></el-option>
<el-option label="三星" value="三星"></el-option>
<el-option label="四星" value="四星"></el-option>
<el-option label="五星" value="五星"></el-option>
......@@ -21,8 +22,17 @@
<el-button @click="_getHodelList">搜索</el-button>
</el-form-item>
<el-form-item style="float: right">
<el-button type="primary">导入</el-button>
<el-button>导出</el-button>
<el-button type="primary" class="el-button-link" style="margin-right: 20px"><router-link to="/travel/hotelAdd">新增酒店</router-link></el-button>
<el-upload
style="display: inline-block; margin-right: 20px"
:action="$uploaderUrl + '/travel/import'"
:multiple="false"
accept=".xls,.docx,.xlsx"
:on-success="handleSuccessMarathon"
:show-file-list="false">
<el-button>导入</el-button>
</el-upload>
<el-button size="small" class="el-button-link"><a :href="$baseURL + exportHref" target="_blank" download="download">导出</a></el-button>
</el-form-item>
</el-form>
<el-table
......@@ -79,13 +89,13 @@
width="120">
</el-table-column>
<el-table-column
prop="docking"
prop="person"
align="center"
width="100"
label="公司联系人">
</el-table-column>
<el-table-column
prop="dockingphone"
prop="persontel"
align="center"
label="公司联系人电话"
width="120">
......@@ -126,8 +136,8 @@
label="操作"
width="140">
<template slot-scope="scope">
<el-button icon="el-icon-delete" size="small" @click="hotelDel(scope.row)"></el-button>
<el-button icon="el-icon-edit" size="small" @click="hotelEdit(scope.row)"></el-button>
<el-button icon="el-icon-delete" size="small" @click="hotelDel(scope.row)"></el-button>
</template>
</el-table-column>
</el-table>
......@@ -156,11 +166,13 @@ export default {
currentPage: 1,
pageSize: 8,
totalPage: null,
tableData: []
tableData: [],
exportHref: ''
}
},
mounted () {
this._getHodelList()
this._exportHotel()
},
methods: {
handleSizeChange: function (size) {
......@@ -170,7 +182,7 @@ export default {
this.currentPage = currentPage
this._getHodelList()
},
_getHodelList () { // 列表
_getHodelList () { // 酒店列表
let _this = this
this.$axios.get('/travel/list', {
params: {
......@@ -193,11 +205,12 @@ export default {
type: 'warning'
}).then(() => {
let _this = this
this.$axios.get('/travel/list', {
this.$axios.get('/travel/delete', {
params: {
'id': item.id
}
}).then(function (res) {
})
.then(function (res) {
if (res === 'ok') {
_this._getHodelList()
}
......@@ -205,7 +218,22 @@ export default {
}).catch(() => { console.log('取消删除') })
},
hotelEdit (item) { // 跳转编辑
this.$router.push({ name: 'newBranches', params: { hotelId: item.id } })
this.$router.push({ name: 'hotelAdd', params: { hotelId: item.id } })
},
_exportHotel () { // 导出
let _this = this
this.$axios.get('/travel/export')
.then(function (res) {
_this.exportHref = res
})
},
handleSuccessMarathon (response, file) { // 导入
if (response.data === 'OK') {
this._getHodelList()
this.$message.success('导入成功!')
} else {
this.$message.success('导入失败!')
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment