|
@@ -0,0 +1,249 @@
|
|
|
+<template>
|
|
|
+ <div id="index">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-col :span="24" class="leftTop">
|
|
|
+ <span>|</span>
|
|
|
+ <span>基本信息</span>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" class="info">
|
|
|
+ <el-form ref="form" :model="form" label-width="150px">
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item prop="name">
|
|
|
+ <el-col :span="21" slot="label">
|
|
|
+ 房间号
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-input v-model="form.room_id" placeholder="请输入房间号" disabled></el-input>
|
|
|
+ </el-col>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item prop=" title">
|
|
|
+ <el-col :span="21" slot="label">
|
|
|
+ 标题
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-input v-model="form.title" placeholder="请输入标题"></el-input>
|
|
|
+ </el-col>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item prop="create_time">
|
|
|
+ <el-col :span="21" slot="label">
|
|
|
+ 开始时间
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="form.create_date"
|
|
|
+ type="datetime"
|
|
|
+ placeholder="请选择"
|
|
|
+ format="yyyy-MM-dd HH:mm:ss"
|
|
|
+ value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
+ style="width:100%"
|
|
|
+ >
|
|
|
+ </el-date-picker>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item>
|
|
|
+ <el-col :span="21" slot="label">
|
|
|
+ 省份
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-select v-model="form.province" placeholder="请选择" filterable clearable @change="changePro" style="width:100%">
|
|
|
+ <el-option v-for="(i, index) in provinceList" :key="index" :label="i.name" :value="i.code"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item prop="create_time">
|
|
|
+ <el-col :span="21" slot="label">
|
|
|
+ 市区
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-select v-model="form.place" placeholder="请选择" filterable clearable style="width:100%">
|
|
|
+ <el-option v-for="(i, index) in placeList" :key="index" :label="i.name" :value="i.code"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item prop="sponsor">
|
|
|
+ <el-col :span="21" slot="label">
|
|
|
+ 主办方
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-input v-model="form.sponsor" placeholder="请输入主办方"></el-input>
|
|
|
+ </el-col>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item prop="user">
|
|
|
+ <el-col :span="21" slot="label">
|
|
|
+ 负责人
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-input v-model="form.user" placeholder="请输入负责人"></el-input>
|
|
|
+ </el-col>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item prop="phone">
|
|
|
+ <el-col :span="21" slot="label">
|
|
|
+ 联系电话
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-input v-model="form.phone" placeholder="请输入联系电话"></el-input>
|
|
|
+ </el-col>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item prop="brief" class="langInfo">
|
|
|
+ <el-col :span="21" slot="label">
|
|
|
+ 简介
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-input v-model="form.brief" type="textarea" placeholder="请输入简介"></el-input>
|
|
|
+ </el-col>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" class="btn">
|
|
|
+ <el-button type="primary" @click="onSubmit()">提交修改</el-button>
|
|
|
+ </el-col>
|
|
|
+ </el-form>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
+const { mapActions: trainlive } = createNamespacedHelpers('trainlive');
|
|
|
+const { mapActions: place } = createNamespacedHelpers('place');
|
|
|
+export default {
|
|
|
+ metaInfo() {
|
|
|
+ return { title: this.$route.meta.title };
|
|
|
+ },
|
|
|
+ name: 'index',
|
|
|
+ props: {},
|
|
|
+ components: {},
|
|
|
+ data: function() {
|
|
|
+ return {
|
|
|
+ // 类型
|
|
|
+ typelist: [],
|
|
|
+ form: {},
|
|
|
+ // 省市
|
|
|
+ provinceList: [],
|
|
|
+ placeList: [],
|
|
|
+ };
|
|
|
+ },
|
|
|
+ async created() {
|
|
|
+ await this.search();
|
|
|
+ await this.searchType();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ ...place({ palcequery: 'query', palcefetch: 'fetch' }),
|
|
|
+ ...trainlive(['fetch', 'update']),
|
|
|
+ async search() {
|
|
|
+ let data = this.user;
|
|
|
+ let res = await this.fetch(data.id);
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ console.log(res.data);
|
|
|
+ this.$set(this, `form`, res.data);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //提交修改
|
|
|
+ async onSubmit() {
|
|
|
+ let data = this.form;
|
|
|
+ if (data.id) {
|
|
|
+ const res = await this.update(data);
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ this.$message({
|
|
|
+ message: '修改成功',
|
|
|
+ type: 'success',
|
|
|
+ });
|
|
|
+ this.search();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 查询省市
|
|
|
+ async searchType() {
|
|
|
+ let res = await this.palcequery({ level: 1 });
|
|
|
+ this.$set(this, `provinceList`, res.data);
|
|
|
+ res = await this.palcequery({ level: 2 });
|
|
|
+ this.$set(this, `placeList`, res.data);
|
|
|
+ },
|
|
|
+ // 选择市
|
|
|
+ async changePro(value) {
|
|
|
+ let parent = value;
|
|
|
+ let res = await this.palcequery({ level: 2, parent });
|
|
|
+ this.$set(this, `placeList`, res.data);
|
|
|
+ },
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ ...mapState(['user']),
|
|
|
+ },
|
|
|
+ watch: {},
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="less" scoped>
|
|
|
+.leftTop {
|
|
|
+ font-size: 18px;
|
|
|
+ width: 96%;
|
|
|
+ height: 41px;
|
|
|
+ line-height: 35px;
|
|
|
+ border-bottom: 1px solid #e5e5e5;
|
|
|
+ position: relative;
|
|
|
+ bottom: 1px;
|
|
|
+ margin: 10px;
|
|
|
+ font-weight: 600;
|
|
|
+ color: #22529a;
|
|
|
+}
|
|
|
+.info {
|
|
|
+ margin: 0 40px 15px 10px;
|
|
|
+ border: 1px dashed #ccc;
|
|
|
+ width: 96%;
|
|
|
+ padding: 10px;
|
|
|
+ .btn {
|
|
|
+ text-align: center;
|
|
|
+ margin: 10px 0;
|
|
|
+ }
|
|
|
+}
|
|
|
+/deep/.el-form-item {
|
|
|
+ margin-bottom: 0px;
|
|
|
+}
|
|
|
+/deep/.el-form-item__label {
|
|
|
+ border: 1px solid #dcdfe6;
|
|
|
+}
|
|
|
+/deep/.el-radio-group {
|
|
|
+ border: 1px solid #ccc;
|
|
|
+ padding: 12px 20px;
|
|
|
+ // width: 943px;
|
|
|
+}
|
|
|
+/deep/.el-input__inner {
|
|
|
+ border-radius: 0;
|
|
|
+ height: 42px;
|
|
|
+ line-height: 42px;
|
|
|
+}
|
|
|
+/deep/.el-textarea__inner {
|
|
|
+ border-radius: 0;
|
|
|
+ height: 140px !important;
|
|
|
+}
|
|
|
+/deep/.langInfo .el-form-item__label {
|
|
|
+ padding: 49px 0;
|
|
|
+}
|
|
|
+/deep/.langInfo .workexperience .textarea__inner {
|
|
|
+ height: 140px !important;
|
|
|
+}
|
|
|
+</style>
|