wxy 4 år sedan
förälder
incheckning
cee94d93d3

+ 7 - 0
src/router/index.js

@@ -92,6 +92,13 @@ const routes = [
     meta: { title: '事项管理', isleftarrow: true },
     component: () => import('../views/userCenter/matter/index.vue'),
   },
+  // 用户-申请
+  {
+    path: '/userCenter/matter/apply',
+    name: 'apply',
+    meta: { title: '申请', isleftarrow: true },
+    component: () => import('../views/userCenter/matter/apply.vue'),
+  },
   // 用户-展会管理
   {
     path: '/userCenter/dock/index',

+ 2 - 2
src/views/user/parts/clickBtn.vue

@@ -5,8 +5,8 @@
         <span v-if="user.role == '4' || user.role == '5' || user.role == '6'">
           <van-cell is-link title="基本信息" @click="$router.push({ path: '/userCenter/user/index' })" />
           <van-cell is-link title="我的发布" @click="$router.push({ path: '/userCenter/myProduct/index' })" />
-          <!--<van-cell is-link title="事项管理" @click="$router.push({ path: '/userCenter/matter/index' })" />
-          <van-cell is-link title="展会管理" @click="$router.push({ path: '/userCenter/dock/index' })" />
+          <van-cell is-link title="事项管理" @click="$router.push({ path: '/userCenter/matter/index' })" />
+          <!--<van-cell is-link title="展会管理" @click="$router.push({ path: '/userCenter/dock/index' })" />
           <van-cell is-link title="退出登录" @click="$router.push({ path: '/userCenter/out/index' })" /> -->
         </span>
         <span v-else>

+ 52 - 0
src/views/userCenter/matter/apply.vue

@@ -0,0 +1,52 @@
+<template>
+  <div id="apply">
+    <el-row>
+      <el-col :span="24">
+        <el-col :span="24" class="top">
+          <NavBar v-show="navShow" :title="title" :isleftarrow="isleftarrow"> </NavBar>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+import NavBar from '@/layout/common/topInfo.vue';
+export default {
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  name: 'apply',
+  props: {},
+  components: {
+    NavBar,
+  },
+  data: function() {
+    return {
+      // 头部标题
+      title: '',
+      // meta为true
+      isleftarrow: '',
+      // 返回
+      navShow: true,
+    };
+  },
+  created() {},
+  methods: {},
+  computed: {
+    ...mapState(['user']),
+  },
+  mounted() {
+    this.title = this.$route.meta.title;
+    this.isleftarrow = this.$route.meta.isleftarrow;
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.top {
+  height: 46px;
+  overflow: hidden;
+}
+</style>

+ 68 - 128
src/views/userCenter/matter/index.vue

@@ -6,127 +6,95 @@
           <NavBar v-show="navShow" :title="title" :isleftarrow="isleftarrow"> </NavBar>
         </el-col>
         <el-col :span="24" class="main">
-          <el-col :span="24" class="main">
-            <el-col :span="24" class="one">
-              <van-tabs v-model="active" animated>
-                <van-tab>
-                  <template #title>
-                    <van-icon name="todo-list" />
-                    <p>我的全部</p>
-                  </template>
-                  <wholeList></wholeList>
-                </van-tab>
-                <van-tab>
-                  <template #title>
-                    <van-icon name="column" />
-                    <p>我的洽谈</p>
-                  </template>
-                  <negotiation></negotiation>
-                </van-tab>
-                <van-tab>
-                  <template #title>
-                    <van-icon name="label" />
-                    <p>我的意向</p>
-                  </template>
-                  <intentionList @submit="submit"></intentionList>
-                </van-tab>
-
-                <van-tab>
-                  <template #title>
-                    <van-icon name="label" />
-                    <p>我的交易</p>
-                  </template>
-                  <transaction></transaction>
-                </van-tab>
-              </van-tabs>
-            </el-col>
+          <el-col :span="24">
+            <van-tabs v-model="active">
+              <van-tab title="下期直播">
+                <docklist :list="nextList" @detailBtn="detailBtn" :province="province" :place="place"></docklist>
+              </van-tab>
+              <van-tab title="以往直播">
+                <docklist :list="pastList" @detailBtn="detailBtn" :province="province" :place="place"></docklist>
+              </van-tab>
+            </van-tabs>
           </el-col>
         </el-col>
       </el-col>
     </el-row>
-    <van-popup v-model="show" position="bottom"
-      ><van-form @submit="onSubmit">
-        <van-field
-          v-model="newform.product_name"
-          name="产品名称"
-          label="产品名称"
-          placeholder="用户名"
-          :rules="[{ required: true, message: '请填写用户名' }]"
-        />
-        <van-field
-          v-model="newform.username"
-          name="购买人名称"
-          label="购买人名称"
-          placeholder="购买人名称"
-          :rules="[{ required: true, message: '请填写购买人名称' }]"
-        />
-        <van-field v-model="newform.market_username" name="营销人名称" label="营销人名称" placeholder="营销人名称" />
-        <van-field v-model="newform.description" name="描述" label="描述" placeholder="描述" />
-        <div style="margin: 16px;">
-          <van-button round block type="info" native-type="submit">
-            提交
-          </van-button>
-        </div>
-      </van-form></van-popup
-    >
   </div>
 </template>
 
 <script>
-import { mapState, createNamespacedHelpers } from 'vuex';
+import docklist from './parts/docklist.vue';
 import NavBar from '@/layout/common/topInfo.vue';
-import wholeList from './parts/wholeList.vue';
-import negotiation from './parts/negotiation.vue';
-import intentionList from './parts/intentionList.vue';
-import transaction from './parts/transaction.vue';
-const { mapActions: transactions } = createNamespacedHelpers('transaction');
-const { mapActions: productpact } = createNamespacedHelpers('productpact');
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: dock } = createNamespacedHelpers('dock');
+const { mapActions: place } = createNamespacedHelpers('place');
 export default {
   name: 'index',
   props: {},
-  components: { NavBar, wholeList, negotiation, intentionList, transaction },
-  data: () => ({
-    // 头部标题
-    title: '',
-    // meta为true
-    isleftarrow: '',
-    // 返回
-    navShow: true,
-    img_path: require('@/assets/logo.png'),
-    active: 0,
-    show: false,
-    newform: {},
-  }),
-  created() {},
-  computed: {},
+  components: {
+    NavBar,
+    docklist,
+  },
+  data: function() {
+    return {
+      // 头部标题
+      title: '',
+      // meta为true
+      isleftarrow: '',
+      // 返回
+      navShow: true,
+      active: '1',
+      // 下期直播
+      nextList: [],
+      // 以往直播
+      pastList: [],
+      // 省
+      province: [],
+      // 市
+      place: [],
+    };
+  },
+  async created() {
+    await this.searchplace();
+    await this.search();
+  },
   methods: {
-    ...transactions({ transactionList: 'query', transactiondtetle: 'delete', shenheupdate: 'update' }),
-    ...productpact({ productpactCreate: 'create' }),
-    submit(data) {
-      this.show = true;
-      this.$set(this, `newform`, data);
+    ...place({ palcequery: 'query', transactiondtetle: 'delete' }),
+    ...dock(['query', 'delete', 'update', 'create']),
+    async search() {
+      let res = await this.query({ status: '0' });
+      if (this.$checkRes(res)) this.$set(this, `nextList`, res.data);
+      res = await this.query({ status: '2' });
+      if (this.$checkRes(res)) this.$set(this, `pastList`, res.data);
+    },
+    // 申请
+    detailBtn(data) {
+      if (data.status == '0') {
+        this.$router.push({ path: '/userCenter/matter/apply', query: { id: data.id } });
+      } else {
+        console.log(data);
+      }
     },
-    async onSubmit() {
-      this.newform.status = '0';
-      this.newform.transaction_id = this.newform.id;
-      const res = await this.productpactCreate(this.newform);
-      if (this.$checkRes(res)) {
-        this.newform.status = '4';
-        const arr = await this.shenheupdate(this.newform);
-        if (this.$checkRes(arr)) {
-          this.$message({
-            message: '提交交易成功,等待管理员审核,方可交易完成',
-            type: 'success',
-          });
-        }
+    // 查询省市
+    async searchplace() {
+      let res = await this.palcequery({ level: 1 });
+      let arr = await this.palcequery({ level: 2 });
+      if (res || arr) {
+        this.$set(this, `province`, res.data);
+        this.$set(this, `place`, arr.data);
       }
-      this.show = false;
     },
   },
+  computed: {
+    ...mapState(['user']),
+  },
   mounted() {
     this.title = this.$route.meta.title;
     this.isleftarrow = this.$route.meta.isleftarrow;
   },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
 };
 </script>
 
@@ -140,36 +108,8 @@ export default {
 .top {
   height: 46px;
   overflow: hidden;
-  position: relative;
-  z-index: 999;
 }
 .main {
   min-height: 570px;
-  .two {
-    position: fixed;
-    top: 80%;
-
-    left: 10px;
-    z-index: 999;
-  }
-}
-/deep/.van-tab {
-  text-align: center;
-}
-/deep/.van-tabs--line .van-tabs__wrap {
-  height: 70px;
-  margin: 0 0 10px 0;
-}
-/deep/.van-tab--active {
-  color: red;
-}
-.van-icon {
-  font-size: 20px;
-}
-/deep/.van-popup--bottom {
-  bottom: 0;
-  left: 0;
-  width: 100%;
-  height: 300px;
 }
 </style>

+ 104 - 0
src/views/userCenter/matter/parts/docklist.vue

@@ -0,0 +1,104 @@
+<template>
+  <div id="docklist">
+    <el-row>
+      <el-col :span="24" class="docklist">
+        <el-col :span="24" class="list" v-for="(item, index) in list" :key="index">
+          <p>
+            <span class="textOver">[{{ item.room_id }}]</span>
+            <span class="textOver">{{ item.title }}</span>
+          </p>
+          <p>
+            <span class="textOver">负责人:{{ item.adminuser }}</span>
+            <span class="textOver">手机号:{{ item.phone }}</span>
+          </p>
+          <p>
+            <span class="textOver">地址:{{ getprovince(item.province) }}-{{ getplace(item.place) }}</span>
+            <span class="textOver">状态:{{ item.status == '0' ? '准备中' : item.status == '1' ? '开始' : '结束' }}</span>
+          </p>
+          <el-col :span="24" class="btn">
+            <!-- <el-button type="primary" size="mini" @click="detailBtn(item)">{{
+              item.status == '0' || item.status == '1' ? '编辑/状态审核' : '查看成果'
+            }}</el-button> -->
+            <el-button v-if="item.status === '0'" type="primary" size="mini" @click="detailBtn(item)">申请</el-button>
+          </el-col>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'docklist',
+  props: {
+    list: { type: Array },
+    // 省
+    province: { type: Array, default: () => [] },
+    // 市
+    place: { type: Array, default: () => [] },
+  },
+  components: {},
+  data: function() {
+    return {};
+  },
+  created() {},
+  methods: {
+    // 过滤省
+    getprovince(item) {
+      let res = this.province.find(i => i.code == item);
+      if (res) return res.name;
+    },
+    // 过滤市
+    getplace(item) {
+      let res = this.place.find(i => i.code == item);
+      if (res) return res.name;
+    },
+    detailBtn(data) {
+      this.$emit('detailBtn', data);
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+    pageTitle() {
+      return `${this.$route.meta.title}`;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.docklist {
+  padding: 0 10px;
+  .list {
+    border-bottom: 1px dashed #ccc;
+    padding: 10px 0;
+    p {
+      font-size: 16px;
+      color: #666;
+      padding: 0 0 5px 0;
+      span {
+        display: inline-block;
+        width: 50%;
+      }
+    }
+    p:nth-child(1) {
+      font-size: 18px;
+      font-weight: bold;
+      span:nth-child(1) {
+        width: 15%;
+        color: #ff0000;
+      }
+      span:nth-child(2) {
+        width: 85%;
+      }
+    }
+    .btn {
+      text-align: center;
+    }
+  }
+}
+</style>