Commit e30d1e7f by dongjipeng

add

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