|
|
|
|
@ -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>
|
|
|
|
|
|