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

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

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

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

Loading…
Cancel
Save