guhongwei 5 лет назад
Родитель
Сommit
f30edf0406

+ 5 - 11
src/components/enterprise/appointment.vue

@@ -12,8 +12,7 @@
             </el-col>
           </el-col>
           <el-col :span="19" class="right">
-            <appointment :total="total" v-on="$listeners" :resultTable="resultTable" :limit="limit" v-if="display === 'list'"></appointment>
-            <look v-on="$listeners" :resultTable="resultTable" :pageSize="pageSize" :total="total" v-else></look>
+            <appointment v-on="$listeners" :nextData="nextData" :nextTotal="nextTotal" :pastData="pastData" :pastTotal="pastTotal"></appointment>
           </el-col>
         </div>
         <el-col :span="24" class="foots">
@@ -28,27 +27,22 @@
 import heads from '@/layout/enterprise/heads.vue';
 import mainMenu from '@/layout/enterprise/mainMenu.vue';
 import appointment from '@/layout/enterprise/appointment.vue';
-import look from '@/layout/enterprise/look.vue';
 import foot from '@/layout/live/foot.vue';
 
 export default {
   name: 'adviserList',
   props: {
-    info: null, //站点信息
     liebiaoList: null, //分类导航
-    form: null,
-    resultTable: null,
-    total: null,
-    pageSize: null,
-    limit: null,
-    display: { type: String, default: 'list' },
+    nextData: null, //下期直播
+    nextTotal: null, //总数
+    pastData: null, //以往直播
+    pastTotal: null, //总数
   },
   components: {
     heads,
     mainMenu, //分类导航
     appointment, //右侧
     foot,
-    look,
   },
   data: () => ({}),
   created() {},

+ 111 - 183
src/layout/enterprise/appointment.vue

@@ -1,94 +1,129 @@
 <template>
   <div id="technical">
-    <el-col :span="24" class="main">
-      <el-col :span="24" class="left">
-        <el-col :span="24" class="leftTop"> <span>|</span> <span>展会管理</span> <span @click="add()">创建对接会</span></el-col>
-        <!-- <el-col :span="24" class="downLeftTop">
-          <el-image :src="downLeftTopImage"></el-image>
-          <span class="topText">
-            <span>展会管理</span>
-            <span
-              ><p>A</p>
-              <p>ppointment</p></span
-            >
-            <span @click="add()">创建对接会</span>
-          </span>
-        </el-col> -->
-        <el-col :span="24" class="infoLeft">
-          <el-table :data="resultTable" stripe style="width: 96%" border>
-            <el-table-column prop="title" label="对接会标题"> </el-table-column>
-            <el-table-column prop="start_time" label="开始时间" :show-overflow-tooltip="true"> </el-table-column>
-            <el-table-column prop="join_end" label="报名截止时间" :show-overflow-tooltip="true"> </el-table-column>
-            <el-table-column prop="sheng" label="省" :show-overflow-tooltip="true"> </el-table-column>
-            <el-table-column prop="shi" label="市" :show-overflow-tooltip="true"> </el-table-column>
-            <el-table-column label="审核状态" align="center">
-              <template slot-scope="scoped">
-                {{ scoped.row.is_allowed === '0' ? '未审核' : scoped.row.is_allowed === '1' ? '审核通过' : '审核拒绝' }}
-              </template>
-            </el-table-column>
-            <el-table-column label="对接会状态" align="center">
-              <template slot-scope="scoped">
-                {{ scoped.row.status === '1' ? '开始' : scoped.row.status === '2' ? '结束' : '准备中' }}
-              </template>
-            </el-table-column>
-            <el-table-column prop="desc" label="简介" :show-overflow-tooltip="true"> </el-table-column>
-
-            <el-table-column label="操作" style="width:200px">
-              <template slot-scope="scope">
-                <el-button size="mini" type="text" @click.prevent="handleEdit(scope.row.id)"
-                  ><el-tooltip class="item" effect="dark" content="编辑" placement="top-start"> <i class="el-icon-edit"></i> </el-tooltip
-                ></el-button>
-
-                <el-button size="mini" type="text" @click.prevent="handleshenhe(scope.row.id)" v-if="scope.row.is_allowed == '0'">
-                  <el-tooltip class="item" effect="dark" content="审核" placement="top-start"><i class="el-icon-refresh"></i></el-tooltip>
-                </el-button>
-
-                <el-button size="mini" type="text" @click.prevent="deleteRow(scope.row.id)">
-                  <el-tooltip class="item" effect="dark" content="删除" placement="top-start"><i class="el-icon-delete"></i></el-tooltip>
-                </el-button>
-
-                <el-button size="mini" type="text" v-if="scope.row.is_allowed == '1'" @click.prevent="status(scope.row.id)">
-                  <el-tooltip class="item" effect="dark" content="审核对接会状态" placement="top-start"><i class="el-icon-bangzhu"></i></el-tooltip>
-                </el-button>
-
-                <el-button size="mini" type="text" v-if="scope.row.is_allowed == '1'" @click.prevent="look(scope.row)">
-                  <el-tooltip class="item" effect="dark" content="查看申请状况" placement="top-start"><i class="el-icon-pie-chart"></i></el-tooltip>
-                </el-button>
-              </template>
-            </el-table-column>
-          </el-table>
-          <el-col :span="24">
-            <page :total="total" position="center" :limit="limit" v-on="$listeners"></page>
-          </el-col>
+    <el-row>
+      <el-col :span="24" class="main">
+        <el-col :span="24" class="mainTop"> <span>展会管理</span> <span>|</span></el-col>
+        <el-col :span="24" class="mainInfo">
+          <el-tabs v-model="activeName" @tab-click="handleClick">
+            <el-tab-pane label="下期直播" name="first">
+              <el-table :data="nextData" stripe style="width: 96%" border>
+                <el-table-column prop="title" label="对接会标题" align="center"> </el-table-column>
+                <el-table-column prop="start_time" label="开始时间" align="center" :show-overflow-tooltip="true"> </el-table-column>
+                <el-table-column prop="join_end" label="报名截止时间" align="center" :show-overflow-tooltip="true"> </el-table-column>
+                <el-table-column prop="sheng" label="省" align="center" :show-overflow-tooltip="true"> </el-table-column>
+                <el-table-column prop="shi" label="市" align="center" :show-overflow-tooltip="true"> </el-table-column>
+                <el-table-column prop="desc" label="简介" align="center" :show-overflow-tooltip="true"> </el-table-column>
+                <el-table-column label="操作" style="width:200px" align="center">
+                  <template slot-scope="scope">
+                    <el-button size="mini" type="text" @click.prevent="handleEdit(scope.row.id)"
+                      ><el-tooltip class="item" effect="dark" content="申请" placement="top-start"> <i class="el-icon-view"></i> </el-tooltip
+                    ></el-button>
+                  </template>
+                </el-table-column>
+              </el-table>
+              <el-col class="page" :span="24">
+                <page :total="nextTotal" position="right"></page>
+              </el-col>
+            </el-tab-pane>
+            <el-tab-pane label="已往直播" name="second">
+              <el-table :data="pastData" stripe style="width: 96%" border>
+                <el-table-column prop="title" label="对接会标题" align="center"> </el-table-column>
+                <el-table-column prop="start_time" label="开始时间" align="center" :show-overflow-tooltip="true"> </el-table-column>
+                <el-table-column prop="join_end" label="报名截止时间" align="center" :show-overflow-tooltip="true"> </el-table-column>
+                <el-table-column prop="sheng" label="省" align="center" :show-overflow-tooltip="true"> </el-table-column>
+                <el-table-column prop="shi" label="市" align="center" :show-overflow-tooltip="true"> </el-table-column>
+                <el-table-column prop="desc" label="简介" align="center" :show-overflow-tooltip="true"> </el-table-column>
+                <!-- <el-table-column label="操作" style="width:200px" align="center">
+                <template slot-scope="scope">
+                  <el-button size="mini" type="text" @click.prevent="handleEdit(scope.row.id)"
+                    ><el-tooltip class="item" effect="dark" content="申请" placement="top-start"> <i class="el-icon-edit"></i> </el-tooltip
+                  ></el-button>
+                </template>
+              </el-table-column> -->
+              </el-table>
+              <el-col class="page" :span="24">
+                <page :total="pastTotal" position="right"></page>
+              </el-col>
+            </el-tab-pane>
+          </el-tabs>
         </el-col>
       </el-col>
-    </el-col>
+    </el-row>
+    <el-dialog title="申请" :visible.sync="dialogFormVisible">
+      <el-form :model="form">
+        <el-form-item label="联系人" :label-width="formLabelWidth">
+          <el-input v-model="form.contact" autocomplete="off"></el-input>
+        </el-form-item>
+        <el-form-item label="联系电话" :label-width="formLabelWidth">
+          <el-input v-model="form.contact_tel" autocomplete="off"></el-input>
+        </el-form-item>
+        <el-form-item label="电子邮箱" :label-width="formLabelWidth">
+          <el-input v-model="form.email" autocomplete="off"></el-input>
+        </el-form-item>
+        <el-form-item label="单位名称" :label-width="formLabelWidth">
+          <el-input v-model="form.company" autocomplete="off"></el-input>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="dialogFormVisible = false">取 消</el-button>
+        <el-button type="primary" @click="submitBtn">确 定</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
 <script>
 import _ from 'lodash';
 import { mapState, createNamespacedHelpers } from 'vuex';
-const { mapActions: news } = createNamespacedHelpers('news');
 import page from '@/components/pagination.vue';
+const { mapActions: apply } = createNamespacedHelpers('apply');
 export default {
   name: 'technical',
   props: {
-    resultTable: null,
-    total: null,
-    limit: null,
+    nextData: null,
+    nextTotal: null,
+    pastData: null,
+    pastTotal: null,
   },
   components: {
     page,
   },
   data: () => ({
-    downLeftTopImage: require('@/assets/live/square_big.png'),
-    jishuImage: require('@/assets/live/main3.png'),
+    activeName: 'first',
+    dialogFormVisible: false,
+    form: {},
+    formLabelWidth: '120px',
+    dock_id: '',
   }),
-  created() {
-    this.searchInfo();
+  created() {},
+
+  methods: {
+    ...apply({ applyCreate: 'create' }),
+    // tab
+    handleClick() {
+      console.log('tab');
+    },
+    // 申请对接会打开
+    handleEdit(id) {
+      this.dialogFormVisible = true;
+      this.$set(this, `dock_id`, id);
+    },
+    // 提交
+    async submitBtn() {
+      this.form.user_id = this.user.uid;
+      this.form.user_name = this.user.name;
+      this.form.buyer = '0';
+      const res = await this.applyCreate({ id: this.dock_id, ...this.form });
+      if (res.errcode === 0) {
+        this.$message({
+          message: '申请参加对接会成功',
+          type: 'success',
+        });
+      }
+    },
   },
   computed: {
+    ...mapState(['user']),
     pageTitle() {
       return `${this.$route.meta.title}`;
     },
@@ -96,39 +131,11 @@ export default {
   metaInfo() {
     return { title: this.$route.meta.title };
   },
-
-  methods: {
-    ...news(['query']),
-    async searchInfo() {},
-    add() {
-      this.$router.push({ path: '/enterprise/duijiedetail' });
-    },
-    handleEdit(id) {
-      console.log(id);
-      this.$router.push({ path: '/enterprise/duijiedetail', query: { id: id } });
-    },
-    handleshenhe(id) {
-      this.$router.push({ path: '/enterprise/shenhe', query: { id: id } });
-    },
-    deleteRow(id) {
-      this.$emit('deleteRow', id);
-    },
-
-    status(id) {
-      console.log(id);
-      this.$router.push({ path: '/enterprise/duijiestatus', query: { id: id } });
-    },
-
-    look(row) {
-      console.log(row);
-      this.$emit('searchinfo', row);
-    },
-  },
 };
 </script>
 
 <style lang="less" scoped>
-.leftTop {
+.mainTop {
   font-size: 18px;
   width: 96%;
   height: 41px;
@@ -136,97 +143,18 @@ export default {
   border-bottom: 1px solid #e5e5e5;
   position: relative;
   bottom: 1px;
-  margin: 10px;
+  margin: 10px 20px;
   font-weight: 600;
   color: #22529a;
 }
-.leftTop span:last-child {
-  float: right;
-  cursor: pointer;
-}
-.jishuImage {
-  width: 100%;
-  height: 100%;
-}
-.main {
-  width: 100%;
-  margin: 0 auto;
-  float: none;
-}
-.left {
+.mainTop span:last-child {
   float: left;
-  min-height: 630px;
-  overflow: hidden;
-  margin: 0 auto;
-  padding: 20px 10px 20px 10px;
-}
-.leftTitle {
-  text-align: center;
-  position: relative;
-}
-.topText {
-  width: 94%;
-  border-bottom: 2.5px solid #044b79;
-  display: inline-block;
-  position: relative;
-  top: -10px;
-  margin: 0 0 0 5px;
-}
-.topText span:first-child {
-  font-size: 24px;
-  font-weight: 700;
-  color: #000000;
-  padding: 0 10px;
-  top: 4px;
-}
-
-.topText span p:first-child {
-  font-weight: 800;
-  font-size: 34px;
-  color: #92959a;
-  top: 11px;
-  display: inline-block;
-}
-
-.topText span p:last-child {
-  display: inline-block;
-  font-weight: 700;
-  font-size: 18px;
-  color: #92959a;
-}
-.topText span:last-child {
-  float: right;
-  font-size: 16px;
-  font-weight: 700;
-  color: #044b79;
-  position: relative;
-  top: 20px;
   cursor: pointer;
 }
-.infoLeft {
-  height: 480px;
-  padding: 20px 20px;
-  margin: 1px 0 0 0;
+.mainInfo {
+  margin: 0 20px;
 }
-.leftListDown {
-  position: relative;
-}
-.leftListDown span:first-child {
-  display: inline-block;
-  width: 80%;
-  height: 3px;
-  background: rgba(4, 75, 121, 0.37);
-  margin: 0 10px 0 0;
-  position: absolute;
-  left: -10px;
-  top: 10px;
-}
-.leftListDown span:last-child {
-  font-size: 16px;
-  float: right;
-  padding: 0 15px 0 0;
-  color: #044b79;
-  font-weight: 700;
-  cursor: pointer;
+/deep/.el-dialog__footer {
+  text-align: center;
 }
 </style>

+ 152 - 0
src/views/enterprise/appointment copy.vue

@@ -0,0 +1,152 @@
+<template>
+  <div id="adviserList">
+    <appointment-detail
+      :liebiaoList="liebiaoList"
+      @query="search"
+      :total="total"
+      :resultTable="resultTable"
+      @onsave="onsaveClick"
+      @success="success"
+      @shibai="shibai"
+      :limit="limit"
+      @handleCurrentChange="handleCurrentChange"
+      :pageSize="pageSize"
+      :display="display"
+      @searchinfo="look"
+    ></appointment-detail>
+  </div>
+</template>
+
+<script>
+import appointmentDetail from '@/components/enterprise/appointment.vue';
+import { createNamespacedHelpers, mapGetters, mapState } from 'vuex';
+const { mapActions: dock } = createNamespacedHelpers('dock');
+const { mapActions: apply } = createNamespacedHelpers('apply');
+const { mapActions: login } = createNamespacedHelpers('login');
+const { mapActions: place } = createNamespacedHelpers('place');
+
+export default {
+  name: 'adviserList',
+  props: {},
+  components: {
+    appointmentDetail,
+  },
+  data: () => ({
+    total: 0,
+    limit: 4,
+    pageSize: 4,
+    info: {},
+    datas: {},
+    display: 'list',
+    liebiaoList: [
+      { name: '基本信息' },
+      { name: '消息管理' },
+      { name: '我的发布' },
+      { name: '事项管理' },
+      { name: '展会管理' },
+      //  // { name: '返回首页' },
+      { name: '修改密码' },
+      { name: '注销账号' },
+    ],
+    resultTable: [],
+    form: {},
+  }),
+  created() {
+    this.search();
+  },
+  computed: {
+    ...mapState(['user']),
+  },
+  methods: {
+    ...dock(['query', 'delete', 'update']),
+    ...apply({ applyupdate: 'update' }),
+    ...login({ logout: 'logout', transactiondtetle: 'delete' }),
+    ...place({ palcequery: 'query', palcefetch: 'fetch' }),
+    //查询
+    async search({ skip = 0, limit = 0 } = { skip: 0, limit: 0 }) {
+      let res = await this.query({ skip, limit });
+      for (const val of res.data) {
+        let parent = val.province;
+        let places = val.place;
+        let reslte = await this.palcequery({ level: 1, parent });
+        let resltes = await this.palcequery({ level: 2, parent });
+        var arr = reslte.data.filter(item => item.code === parent);
+        var cre = resltes.data.filter(item => item.code === places);
+        for (const shi of cre) {
+          val.shi = shi.name;
+        }
+        for (const sheng of arr) {
+          val.sheng = sheng.name;
+        }
+      }
+      this.$set(this, `resultTable`, res.data);
+      this.$set(this, `total`, res.total);
+    },
+
+    //查询
+    async searchinfo({ skip = 0, limit = 0, currentPage } = { skip: 0, limit: 0 }) {
+      this.display = 'dadad';
+      this.$set(this, `total`, this.datas.apply.length);
+      const newProducts = [];
+      for (let index = skip; index < skip + limit; index++) {
+        if (this.datas.apply[index]) {
+          newProducts.push(this.datas.apply[index]);
+        }
+      }
+      this.$set(this, `resultTable`, newProducts);
+    },
+
+    look(row) {
+      this.display = 'dadad';
+      this.$set(this, `datas`, row);
+      this.searchinfo();
+    },
+    async onsaveClick({ id }) {
+      if (id === '基本信息') {
+        this.$router.push({ path: '/enterprise/enterprisejb' });
+      } else if (id === '消息管理') {
+        this.$router.push({ path: '/enterprise/enterprisexx' });
+      } else if (id === '我的发布') {
+        this.$router.push({ path: '/enterprise/enterprisefabu' });
+      } else if (id === '事项管理') {
+        this.$router.push({ path: '/enterprise/enterprisedg' });
+      } else if (id === '展会管理') {
+        this.$router.push({ path: '/enterprise/appointment' });
+      } else if (id === '修改密码') {
+        this.$router.push({ path: '/enterprise/xiugai' });
+      } else if (id === '返回首页') {
+        this.$router.push({ path: '/home' });
+      } else if (id === '注销账号') {
+        this.logout();
+        this.$message({
+          message: '注销成功',
+          type: 'success',
+        });
+        this.toLogin();
+      }
+    },
+    async toLogin() {
+      this.$router.push({ path: '/platlive' });
+    },
+    handleCurrentChange({ currentPage }) {
+      this.searchinfo({ skip: (currentPage - 1) * this.pageSize, limit: this.pageSize, currentPage });
+    },
+    async success(row) {
+      row.status = '1';
+      row.dock_id = this.datas.id;
+      row.id = row._id;
+      let res = await this.applyupdate(row);
+      this.$checkRes(res, '通过审核', '添加失败');
+    },
+    async shibai(row) {
+      row.status = '2';
+      row.dock_id = this.datas.id;
+      row.id = row._id;
+      let res = await this.applyupdate(row);
+      this.$checkRes(res, '审核拒绝', '添加失败');
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 40 - 66
src/views/enterprise/appointment.vue

@@ -1,19 +1,18 @@
 <template>
-  <div id="adviserList">
-    <appointment-detail
-      :liebiaoList="liebiaoList"
-      @query="search"
-      :total="total"
-      :resultTable="resultTable"
-      @onsave="onsaveClick"
-      @success="success"
-      @shibai="shibai"
-      :limit="limit"
-      @handleCurrentChange="handleCurrentChange"
-      :pageSize="pageSize"
-      :display="display"
-      @searchinfo="look"
-    ></appointment-detail>
+  <div id="appointment">
+    <el-row>
+      <el-col :span="24">
+        <appointment-detail
+          :liebiaoList="liebiaoList"
+          @query="search"
+          @onsave="onsaveClick"
+          :nextData="nextData"
+          :nextTotal="nextTotal"
+          :pastData="pastData"
+          :pastTotal="pastTotal"
+        ></appointment-detail>
+      </el-col>
+    </el-row>
   </div>
 </template>
 
@@ -24,20 +23,13 @@ const { mapActions: dock } = createNamespacedHelpers('dock');
 const { mapActions: apply } = createNamespacedHelpers('apply');
 const { mapActions: login } = createNamespacedHelpers('login');
 const { mapActions: place } = createNamespacedHelpers('place');
-
 export default {
-  name: 'adviserList',
+  name: 'appointment',
   props: {},
   components: {
     appointmentDetail,
   },
   data: () => ({
-    total: 0,
-    limit: 4,
-    pageSize: 4,
-    info: {},
-    datas: {},
-    display: 'list',
     liebiaoList: [
       { name: '基本信息' },
       { name: '消息管理' },
@@ -48,8 +40,12 @@ export default {
       { name: '修改密码' },
       { name: '注销账号' },
     ],
-    resultTable: [],
-    form: {},
+    // 下期直播
+    nextData: [],
+    nextTotal: 0,
+    // 以往直播
+    pastData: [],
+    pastTotal: 0,
   }),
   created() {
     this.search();
@@ -62,9 +58,8 @@ export default {
     ...apply({ applyupdate: 'update' }),
     ...login({ logout: 'logout', transactiondtetle: 'delete' }),
     ...place({ palcequery: 'query', palcefetch: 'fetch' }),
-    //查询
     async search({ skip = 0, limit = 0 } = { skip: 0, limit: 0 }) {
-      let res = await this.query({ skip, limit });
+      let res = await this.query({ skip, limit, status: '0' });
       for (const val of res.data) {
         let parent = val.province;
         let places = val.place;
@@ -79,28 +74,27 @@ export default {
           val.sheng = sheng.name;
         }
       }
-      this.$set(this, `resultTable`, res.data);
-      this.$set(this, `total`, res.total);
-    },
-
-    //查询
-    async searchinfo({ skip = 0, limit = 0, currentPage } = { skip: 0, limit: 0 }) {
-      this.display = 'dadad';
-      this.$set(this, `total`, this.datas.apply.length);
-      const newProducts = [];
-      for (let index = skip; index < skip + limit; index++) {
-        if (this.datas.apply[index]) {
-          newProducts.push(this.datas.apply[index]);
+      this.$set(this, `nextData`, res.data);
+      this.$set(this, `nextTotal`, res.total);
+      res = await this.query({ skip, limit, status: '2' });
+      for (const val of res.data) {
+        let parent = val.province;
+        let places = val.place;
+        let reslte = await this.palcequery({ level: 1, parent });
+        let resltes = await this.palcequery({ level: 2, parent });
+        var arr = reslte.data.filter(item => item.code === parent);
+        var cre = resltes.data.filter(item => item.code === places);
+        for (const shi of cre) {
+          val.shi = shi.name;
+        }
+        for (const sheng of arr) {
+          val.sheng = sheng.name;
         }
       }
-      this.$set(this, `resultTable`, newProducts);
-    },
-
-    look(row) {
-      this.display = 'dadad';
-      this.$set(this, `datas`, row);
-      this.searchinfo();
+      this.$set(this, `pastData`, res.data);
+      this.$set(this, `pastTotal`, res.total);
     },
+    // 切换菜单
     async onsaveClick({ id }) {
       if (id === '基本信息') {
         this.$router.push({ path: '/enterprise/enterprisejb' });
@@ -125,26 +119,6 @@ export default {
         this.toLogin();
       }
     },
-    async toLogin() {
-      this.$router.push({ path: '/platlive' });
-    },
-    handleCurrentChange({ currentPage }) {
-      this.searchinfo({ skip: (currentPage - 1) * this.pageSize, limit: this.pageSize, currentPage });
-    },
-    async success(row) {
-      row.status = '1';
-      row.dock_id = this.datas.id;
-      row.id = row._id;
-      let res = await this.applyupdate(row);
-      this.$checkRes(res, '通过审核', '添加失败');
-    },
-    async shibai(row) {
-      row.status = '2';
-      row.dock_id = this.datas.id;
-      row.id = row._id;
-      let res = await this.applyupdate(row);
-      this.$checkRes(res, '审核拒绝', '添加失败');
-    },
   },
 };
 </script>