刘翔宇-旅管家 3 years ago
parent 65d4b0e6f7
commit f9b32c752a

@ -27,8 +27,8 @@
<Button ghost size="small" @click="edit(scope.row)" type="primary" <Button ghost size="small" @click="edit(scope.row)" type="primary"
style="margin-left: 10px;">编辑</Button> style="margin-left: 10px;">编辑</Button>
<Button ghost size="small" type="error" @click="del(scope.row)" style="margin-left: 10px;">删除</Button> <Button ghost size="small" type="error" @click="del(scope.row)" style="margin-left: 10px;">删除</Button>
<Button v-if="scope.row['status']==1" ghost size="small" type="info" @click="changeStatus(scope.row)" <Button v-if="scope.row['status']==1" ghost size="small" type="info"
style="margin-left: 10px;">下架</Button> @click="dialogConfirmVisible=true,currentId=scope.row.id" style="margin-left: 10px;">下架</Button>
<Button v-if="scope.row['status']==0" ghost size="small" type="warning" @click="changeStatus(scope.row)" <Button v-if="scope.row['status']==0" ghost size="small" type="warning" @click="changeStatus(scope.row)"
style="margin-left: 10px;">上架</Button> style="margin-left: 10px;">上架</Button>
</div> </div>
@ -93,7 +93,7 @@
</el-col> </el-col>
<el-col :span="10"> <el-col :span="10">
<el-form-item label="地址" prop="address"> <el-form-item label="地址" prop="address">
<avue-input-map :params="mapparams" placeholder="请选择地图" v-model="mapform" ></avue-input-map> <avue-input-map :params="mapparams" placeholder="请选择地图" v-model="mapform"></avue-input-map>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -132,6 +132,20 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8">
<el-form-item label="参加范围" prop="group">
<el-select v-model="form.join_type" placeholder="请选择参加范围" style="width:100%">
<el-option v-for="item in parameters.joinTypes" :key="item.value" :label="item.value" :value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="预定截止" prop="end_plan"> <el-form-item label="预定截止" prop="end_plan">
<el-date-picker style="width:100%" v-model="form.end_plan" type="datetime" <el-date-picker style="width:100%" v-model="form.end_plan" type="datetime"
@ -141,13 +155,8 @@
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="活动时间" prop="dateRange"> <el-form-item label="活动时间" prop="dateRange">
<el-date-picker <el-date-picker style="width:100%" v-model="dateRange" type="datetimerange"
style="width:100%" value-format="yyyy-MM-dd HH:mm:ss" range-separator="至" start-placeholder="活动开始日期"
v-model="dateRange"
type="datetimerange"
value-format="yyyy-MM-dd HH:mm:ss"
range-separator="至"
start-placeholder="活动开始日期"
end-placeholder="活动结束日期"> end-placeholder="活动结束日期">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
@ -206,6 +215,24 @@
<el-dialog :visible.sync="dialogVisible"> <el-dialog :visible.sync="dialogVisible">
<img width="100%" :src="dialogImageUrl" alt=""> <img width="100%" :src="dialogImageUrl" alt="">
</el-dialog> </el-dialog>
<el-dialog :visible.sync="dialogConfirmVisible" title="下架确认" width="40%">
<el-form>
<el-form-item label="是否取消预约" prop="content">
<el-switch v-model="cancel_all" active-text="" inactive-text=""
active-color="#13ce66" inactive-color="#ff4949">
</el-switch>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogConfirmVisible=false"> </el-button>
<el-button type="primary" @click="toCancel()"> </el-button>
</div>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
@ -231,6 +258,9 @@
}, },
data() { data() {
return { return {
currentId: 0,
dialogConfirmVisible: false,
cancel_all: false,
dialogFormVisible: false, dialogFormVisible: false,
formLabelWidth: "120px", formLabelWidth: "120px",
selectedValue: null, selectedValue: null,
@ -252,6 +282,16 @@
token: "" token: ""
}, },
parameters: { parameters: {
joinTypes: [{
id: 0,
value: "不限制"
}, {
id: 1,
value: "仅团体参与"
}, {
id: 2,
value: "仅个人参与"
}],
activityArea: [{ activityArea: [{
id: 1, id: 1,
value: "本馆" value: "本馆"
@ -293,10 +333,10 @@
value: "不限" value: "不限"
}] }]
}, },
mapparams:{ mapparams: {
zoom: 11, zoom: 11,
}, },
mapform:[] , mapform: [],
form: { form: {
name: "", name: "",
area: "", area: "",
@ -314,9 +354,10 @@
price: "", price: "",
longitude: "", longitude: "",
latitude: "", latitude: "",
banners_list: [] banners_list: [],
join_type: 0,
}, },
dateRange:"", dateRange: "",
showTime: "", showTime: "",
coverlist: [], coverlist: [],
bannersList: [], bannersList: [],
@ -451,7 +492,7 @@
let result = Object.assign(that.form, res); let result = Object.assign(that.form, res);
that.form = result; that.form = result;
that.dateRange = [result.start_time, result.end_time]; that.dateRange = [result.start_time, result.end_time];
that.mapform = [result.longitude,result.latitude,result.address] that.mapform = [result.longitude, result.latitude, result.address]
console.log(that.dateRange); console.log(that.dateRange);
// that.showTime = result.start_time.substring(11, result.start_time.length); // that.showTime = result.start_time.substring(11, result.start_time.length);
// that.form.end_time = result.end_time.substring(11, result.end_time.length); // that.form.end_time = result.end_time.substring(11, result.end_time.length);
@ -479,29 +520,29 @@
var that = this; var that = this;
that.info(obj); that.info(obj);
} else { } else {
this.dateRange=[]; this.dateRange = [];
this.mapform = ['','','']; this.mapform = ['', '', ''];
} }
this.dialogFormVisible = true; this.dialogFormVisible = true;
}, },
compareDate (d1, d2) { compareDate(d1, d2) {
  let reg = new RegExp('-', 'g') let reg = new RegExp('-', 'g')
  return ((new Date(d1.replace(reg, '/'))) > (new Date(d2.replace(reg, '/')))) return ((new Date(d1.replace(reg, '/'))) > (new Date(d2.replace(reg, '/'))))
}, },
submitForm(formName) { submitForm(formName) {
var that = this; var that = this;
that.form.start_time = this.dateRange[0]; that.form.start_time = this.dateRange[0];
that.form.end_time = this.dateRange[1]; that.form.end_time = this.dateRange[1];
if(!that.form.start_time||!that.form.end_time){ if (!that.form.start_time || !that.form.end_time) {
that.$message.error('请选择活动时间'); that.$message.error('请选择活动时间');
return false; return false;
} }
// //
let checktime = that.compareDate(that.form.start_time,that.form.end_plan); let checktime = that.compareDate(that.form.start_time, that.form.end_plan);
if(!checktime){ if (!checktime) {
that.$message.error('截止时间不能晚于开始时间'); that.$message.error('截止时间不能晚于开始时间');
return false; return false;
} }
@ -550,21 +591,13 @@
let status = obj.status == 0 ? 1 : 0; let status = obj.status == 0 ? 1 : 0;
let para = { let para = {
id: obj.id, id: obj.id,
status: status status: status,
cancel_all: 0
} }
this.$Modal.confirm({ this.$Modal.confirm({
title: '确认要变更状态?', title: '确认要变更状态?',
onOk: () => { onOk: () => {
chanStatus({ that.toChangeStatus(para);
id: para.id,
status: para.status
}).then(response => {
this.$Message.success('操作成功');
that.load();
}).catch(error => {
console.log(error)
reject(error)
})
}, },
onCancel: () => { onCancel: () => {
//this.$Message.info('Clicked cancel'); //this.$Message.info('Clicked cancel');
@ -572,6 +605,26 @@
}); });
} }
}, },
toCancel() {
let para = {
id: this.currentId,
status: 0,
cancel_all: 0
}
this.toChangeStatus(para);
},
toChangeStatus(para) {
let that = this;
chanStatus({
id: para.id,
status: para.status,
cancel_all: para.cancel_all
}).then(response => {
that.dialogConfirmVisible=false;
this.$Message.success('操作成功');
that.load();
}).catch(error => {})
},
resetForm(formName) { resetForm(formName) {
var that = this; var that = this;
this.coverlist = []; this.coverlist = [];
@ -673,9 +726,9 @@
}; };
</script> </script>
<style> <style>
.nextlabel label{ .nextlabel label {
display: block; display: block;
width: 100%!important; width: 100% !important;
text-align: left; text-align: left;
} }
</style> </style>

@ -57,11 +57,7 @@
<el-col :span="10"> <el-col :span="10">
<el-form-item label="开始时间" prop="start_date"> <el-form-item label="开始时间" prop="start_date">
<template slot-scope="scope"> <template slot-scope="scope">
<el-date-picker <el-date-picker style="width:100%" v-model="form.start_date" type="date" value-format="yyyy-MM-dd"
style="width:100%"
v-model="form.start_date"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择开始时间"> placeholder="选择开始时间">
</el-date-picker> </el-date-picker>
</template> </template>
@ -70,11 +66,7 @@
<el-col :span="10" :offset="4"> <el-col :span="10" :offset="4">
<el-form-item label="结束时间" prop="end_date"> <el-form-item label="结束时间" prop="end_date">
<template slot-scope="scope"> <template slot-scope="scope">
<el-date-picker <el-date-picker style="width:100%" v-model="form.end_date" type="date" value-format="yyyy-MM-dd"
style="width:100%"
v-model="form.end_date"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择结束时间"> placeholder="选择结束时间">
</el-date-picker> </el-date-picker>
</template> </template>
@ -87,6 +79,13 @@
</div> </div>
<div v-if="isRules" class="table-tree tableswidth"> <div v-if="isRules" class="table-tree tableswidth">
<div style="display: flex;justify-content: flex-end;margin-right: 20px;margin-bottom: 10px;"> <div style="display: flex;justify-content: flex-end;margin-right: 20px;margin-bottom: 10px;">
<el-select v-model="form.selectId" placeholder="请选择" style="width:100%">
<el-option v-for="item in listVisitArr" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
<Button type="primary" @click="copyRow()" size="small" style="margin-left: 10px;" ghost>导入</Button>
<Button type="primary" @click="addRow()" size="small" style="margin-left: 10px;" ghost>新增</Button> <Button type="primary" @click="addRow()" size="small" style="margin-left: 10px;" ghost>新增</Button>
</div> </div>
<el-table :data="form.rules_list" height="400" class="v-table" style="width: 100%;margin-bottom: 20px;"> <el-table :data="form.rules_list" height="400" class="v-table" style="width: 100%;margin-bottom: 20px;">
@ -94,59 +93,43 @@
</el-table-column> </el-table-column>
<el-table-column prop="start_time" label="开始时间"> <el-table-column prop="start_time" label="开始时间">
<template slot-scope="scope"> <template slot-scope="scope">
<el-time-select <el-time-select style="width:100%" v-model="scope.row.start_time" :picker-options="{
style="width:100%"
v-model="scope.row.start_time"
:picker-options="{
start: '00:00', start: '00:00',
step: '00:15', step: '00:15',
end: '24:00' end: '24:00'
}" }" placeholder="选择开始时间">
placeholder="选择开始时间">
</el-time-select> </el-time-select>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="show_start_time" label="实际开始时间"> <el-table-column prop="show_start_time" label="实际开始时间">
<template slot-scope="scope"> <template slot-scope="scope">
<el-time-select <el-time-select style="width:100%" v-model="scope.row.show_start_time" :picker-options="{
style="width:100%"
v-model="scope.row.show_start_time"
:picker-options="{
start: '00:00', start: '00:00',
step: '00:15', step: '00:15',
end: '24:00' end: '24:00'
}" }" placeholder="选择开始时间">
placeholder="选择开始时间">
</el-time-select> </el-time-select>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="end_time" label="结束时间"> <el-table-column prop="end_time" label="结束时间">
<template slot-scope="scope"> <template slot-scope="scope">
<el-time-select <el-time-select style="width:100%" v-model="scope.row.end_time" :picker-options="{
style="width:100%"
v-model="scope.row.end_time"
:picker-options="{
start: '00:00', start: '00:00',
step: '00:15', step: '00:15',
end: '24:00', end: '24:00',
minTime: scope.row.start_time minTime: scope.row.start_time
}" }" placeholder="选择结束时间">
placeholder="选择结束时间">
</el-time-select> </el-time-select>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="show_end_time" label="实际结束时间"> <el-table-column prop="show_end_time" label="实际结束时间">
<template slot-scope="scope"> <template slot-scope="scope">
<el-time-select <el-time-select style="width:100%" v-model="scope.row.show_end_time" :picker-options="{
style="width:100%"
v-model="scope.row.show_end_time"
:picker-options="{
start: '00:00', start: '00:00',
step: '00:15', step: '00:15',
end: '24:00', end: '24:00',
minTime: scope.row.start_time minTime: scope.row.start_time
}" }" placeholder="选择结束时间">
placeholder="选择结束时间">
</el-time-select> </el-time-select>
</template> </template>
</el-table-column> </el-table-column>
@ -182,9 +165,16 @@
get, get,
delrule delrule
} from "../../api/resource/visitspecial.js"; } from "../../api/resource/visitspecial.js";
import {
listvisit,
get as getresource
} from "../../api/resource/visitresource.js";
import { import {
getparameteritem getparameteritem
} from "../../api/system/dictionary.js" } from "../../api/system/dictionary.js"
import {
Message
} from "element-ui";
export default { export default {
components: { components: {
LxHeader LxHeader
@ -194,11 +184,12 @@
dialogFormVisible: false, dialogFormVisible: false,
formLabelWidth: "120px", formLabelWidth: "120px",
tableHeight: 0, tableHeight: 0,
isRules:false, isRules: false,
// //
searchFields: { searchFields: {
name: "" name: ""
}, },
listVisitArr: [],
tableData: [], tableData: [],
paginations: { paginations: {
page: 1, page: 1,
@ -206,32 +197,35 @@
total: 0 total: 0
}, },
parameters: { parameters: {
visitType:[{ visitType: [{
id:1, id: 1,
value:"闭馆" value: "闭馆"
},{ }, {
id:2, id: 2,
value:"修改预约时间" value: "修改预约时间"
}, {
id: 3,
value: "开馆"
}] }]
}, },
form: { form: {
selectId: "",
name: "", name: "",
type:1, type: 1,
start_date:"", start_date: "",
end_date:"", end_date: "",
rules_list:[{ rules_list: [{
id:"", id: "",
start_time:"", start_time: "",
end_time:"", end_time: "",
show_start_time:"", show_start_time: "",
show_end_time:"", show_end_time: "",
total:"" total: ""
}] }]
}, },
columns: [ columns: [{
{
field: "name", field: "name",
title: "名称", title: "名称",
type: "string", type: "string",
@ -240,8 +234,8 @@
field: "type", field: "type",
title: "类型", title: "类型",
type: "type", type: "type",
width:300, width: 300,
align:"center" align: "center"
}, },
{ {
field: "操作", field: "操作",
@ -264,6 +258,7 @@
created() { created() {
this.initLoad(); this.initLoad();
this.load(); this.load();
this.listvisit();
}, },
mounted() {}, mounted() {},
methods: { methods: {
@ -281,7 +276,7 @@
listvisitspecial({ listvisitspecial({
page: this.paginations.page, page: this.paginations.page,
page_size: this.paginations.page_size, page_size: this.paginations.page_size,
name:this.searchFields.name name: this.searchFields.name
}).then(res => { }).then(res => {
this.tableData = res.data; this.tableData = res.data;
this.paginations.total = res.total this.paginations.total = res.total
@ -289,12 +284,40 @@
}) })
}, },
listvisit() {
var that = this;
listvisit({
page_size: 999
}).then(res => {
this.listVisitArr = res.data;
}).catch(error => {
})
},
getresource(id) {
var that = this;
getresource(id).then(res => {
//let result = Object.assign(that.form, res);
//that.form = result;
that.form.rules_list = res.rules;
}).catch(error => {
//reject(error)
})
},
copyRow() {
if (this.form.selectId == "") {
Message.error("请选择需要导入的模版");
return false;
}
this.getresource(this.form.selectId);
},
info(obj) { info(obj) {
var that = this; var that = this;
get(obj.id).then(res => { get(obj.id).then(res => {
let result = Object.assign(that.form, res); let result = Object.assign(that.form, res);
that.form = result; that.form = result;
if(result.type==2){ if (result.type == 2||result.type == 3) {
this.isRules = true; this.isRules = true;
} }
that.form.rules_list = result.rules; that.form.rules_list = result.rules;
@ -316,14 +339,14 @@
var that = this; var that = this;
this.$refs[formName].validate((valid) => { this.$refs[formName].validate((valid) => {
if (valid) { if (valid) {
if(!this.isRules){ if (!this.isRules) {
that.form.rules_list = [{ that.form.rules_list = [{
id:"", id: "",
start_time:"", start_time: "",
end_time:"", end_time: "",
show_start_time:"", show_start_time: "",
show_end_time:"", show_end_time: "",
total:"" total: ""
}] }]
} }
if (that.form.id) { if (that.form.id) {
@ -374,24 +397,24 @@
}); });
} }
}, },
showYy(val){ showYy(val) {
console.log(val) console.log(val)
this.isRules = !this.isRules this.isRules = (val != 1);
}, },
addRow() { addRow() {
var len = this.form.rules_list.length; var len = this.form.rules_list.length;
this.form.rules_list.push({ this.form.rules_list.push({
id:"", id: "",
start_time:"", start_time: "",
end_time:"", end_time: "",
show_start_time:"", show_start_time: "",
show_end_time:"", show_end_time: "",
total:"" total: ""
}); });
}, },
delRow(index,id) { delRow(index, id) {
var that = this var that = this
if(id){ if (id) {
delrule(id).then(response => { delrule(id).then(response => {
that.$Message.success('删除成功'); that.$Message.success('删除成功');
that.form.rules_list.splice(index, 1); that.form.rules_list.splice(index, 1);
@ -399,7 +422,7 @@
console.log(error) console.log(error)
reject(error) reject(error)
}) })
}else{ } else {
this.form.rules_list.splice(index, 1); this.form.rules_list.splice(index, 1);
} }
}, },

@ -46,9 +46,9 @@ module.exports = {
//before: require('./mock/mock-server.js'), //before: require('./mock/mock-server.js'),
proxy: { proxy: {
[process.env.VUE_APP_BASE_API]: { [process.env.VUE_APP_BASE_API]: {
target: 'https://leyiyuyue.szgmbwg.org.cn/', // target: 'https://leyiyuyue.szgmbwg.org.cn/',
// target: 'https://dangxingjiaoyujidi.langye.net/', //target: 'https://dangxingjiaoyujidi.langye.net/',
//target: 'http://leyitest.ali251.langye.net/', target: 'http://leyitest.ali251.langye.net/',
changeOrigin: true, //配置跨域 changeOrigin: true, //配置跨域
pathRewrite: { pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: '' ['^' + process.env.VUE_APP_BASE_API]: ''

Loading…
Cancel
Save