guhongwei 4 éve
szülő
commit
956edc81c2

+ 12 - 11
src/store/index.js

@@ -13,14 +13,16 @@ import product from '@common/src/store/product';
 import productIndex from '@common/src/store/productIndex';
 // 展会
 import dock from '@common/src/store/dock/dock';
+// 展会视频
+import dockVideo from '@common/src/store/dock/dockVideo';
+// 展会图文
+import dockImgtxt from '@common/src/store/dock/dockImgtxt';
 // 申请管理
 import dockUser from '@common/src/store/dock/dock_user';
-// // 展会图文
-// import dockPw from '@common/src/store/dockPw';
-// // 展会用户
-// import dockUser from '@common/src/store/dockUser';
-// // 展会公共聊天
-// import dockChat from '@common/src/store/dock_chat';
+// 展会vip
+import dockVip from '@common/src/store/dock/dockVip';
+// 交易记录
+import dockTranscation from '@common/src/store/dock/dockTranscation';
 // 培训问诊
 import trainLive from '@common/src/store/trainLive';
 import trainchat from '@common/src/store/trainchat';
@@ -72,12 +74,13 @@ export default new Vuex.Store({
     product,
     productIndex,
     dock,
+    dockVideo,
+    dockImgtxt,
     dockUser,
+    dockVip,
+    dockTranscation,
     trainLive,
     trainchat,
-    // transaction,
-    // dockPw,
-    // dockChat,
     channel,
     channelVideo,
     patent,
@@ -92,10 +95,8 @@ export default new Vuex.Store({
     place,
     survey,
     statistics,
-
     personRoom,
     personChat,
-
     questionnaire,
     answer,
     apply,

+ 80 - 78
src/views/admin/live/achieve.vue

@@ -1,78 +1,80 @@
-<template>
-  <div id="achieve">
-    <admin-frame>
-      <template #menu>
-        <admin-meun :list="menus"></admin-meun>
-      </template>
-      <component :is="component"></component>
-    </admin-frame>
-  </div>
-</template>
-
-<script>
-import adminFrame from '../model/frame.vue';
-import adminMeun from '../model/menu.vue';
-import { mapState, createNamespacedHelpers } from 'vuex';
-export default {
-  name: 'achieve',
-  props: {},
-  components: {
-    adminFrame,
-    adminMeun,
-    aBase: () => import('./achieve/base.vue'),
-    aPw: () => import('./achieve/pw.vue'),
-    aApply: () => import('./achieve/apply.vue'),
-    aVip: () => import('./achieve/vip.vue'),
-    aTransaction: () => import('./achieve/trans.vue'),
-    aInterview: () => import('./achieve/interview.vue'),
-    aRoadShow: () => import('./achieve/road_show.vue'),
-    aStatistics: () => import('./achieve/statistics.vue'),
-  },
-  data: function() {
-    return {
-      menus: [
-        { num: '1', title: '展会管理', icon: 'el-icon-s-tools', component: 'aBase' },
-        { num: '2', title: '图文管理', icon: 'el-icon-pie-chart', component: 'aPw' },
-        { num: '3', title: '申请管理', icon: 'el-icon-pie-chart', component: 'aApply' },
-        { num: '4', title: 'vip用户', icon: 'el-icon-user-solid', component: 'aVip' },
-        { num: '5', title: '交易记录', icon: 'el-icon-notebook-1', component: 'aTransaction' },
-        { num: '6', title: '嘉宾访谈', icon: 'el-icon-user-solid', component: 'aInterview' },
-        { num: '7', title: '项目路演', icon: 'el-icon-video-camera-solid', component: 'aRoadShow' },
-        { num: '8', title: '统计报表', icon: 'el-icon-s-operation', component: 'aStatistics' },
-        {
-          num: '10',
-          title: '退出登陆',
-          icon: 'el-icon-circle-close',
-          component: () => this.$router.push({ path: '/channel/index', query: { id: this.user.id } }),
-        },
-      ],
-    };
-  },
-  created() {},
-  methods: {},
-  computed: {
-    ...mapState(['user', 'menuParams']),
-    pageTitle() {
-      return `${this.$route.meta.title}`;
-    },
-    num() {
-      return this.$route.query.num || '1';
-    },
-    component() {
-      let component = 'aBase';
-      const res = this.menus.find(f => f.num === this.num);
-      if (res && _.isFunction(res)) {
-        res();
-      } else if (res) {
-        component = _.get(res, 'component', 'aBase');
-      }
-      return component;
-    },
-  },
-  metaInfo() {
-    return { title: this.$route.meta.title };
-  },
-};
-</script>
-
-<style lang="less" scoped></style>
+<template>
+  <div id="achieve">
+    <admin-frame>
+      <template #menu>
+        <admin-meun :list="menus"></admin-meun>
+      </template>
+      <component :is="component"></component>
+    </admin-frame>
+  </div>
+</template>
+
+<script>
+import adminFrame from '../model/frame.vue';
+import adminMeun from '../model/menu.vue';
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'achieve',
+  props: {},
+  components: {
+    adminFrame,
+    adminMeun,
+    aBase: () => import('./achieve/base.vue'),
+    aVideo: () => import('./achieve/video.vue'),
+    aPw: () => import('./achieve/pw.vue'),
+    aApply: () => import('./achieve/apply.vue'),
+    aVip: () => import('./achieve/vip.vue'),
+    aTransaction: () => import('./achieve/trans.vue'),
+    aInterview: () => import('./achieve/interview.vue'),
+    aRoadShow: () => import('./achieve/road_show.vue'),
+    aStatistics: () => import('./achieve/statistics.vue'),
+  },
+  data: function() {
+    return {
+      menus: [
+        { num: '1', title: '展会管理', icon: 'el-icon-s-tools', component: 'aBase' },
+        { num: '2', title: '视频管理', icon: 'el-icon-pie-chart', component: 'aVideo' },
+        { num: '3', title: '图文管理', icon: 'el-icon-pie-chart', component: 'aPw' },
+        { num: '4', title: '申请管理', icon: 'el-icon-pie-chart', component: 'aApply' },
+        { num: '5', title: 'vip用户', icon: 'el-icon-user-solid', component: 'aVip' },
+        { num: '6', title: '交易记录', icon: 'el-icon-notebook-1', component: 'aTransaction' },
+        { num: '7', title: '嘉宾访谈', icon: 'el-icon-user-solid', component: 'aInterview' },
+        { num: '8', title: '项目路演', icon: 'el-icon-video-camera-solid', component: 'aRoadShow' },
+        { num: '9', title: '统计报表', icon: 'el-icon-s-operation', component: 'aStatistics' },
+        {
+          num: '10',
+          title: '退出登陆',
+          icon: 'el-icon-circle-close',
+          component: () => this.$router.push({ path: '/channel/index', query: { id: this.user.id } }),
+        },
+      ],
+    };
+  },
+  created() {},
+  methods: {},
+  computed: {
+    ...mapState(['user', 'menuParams']),
+    pageTitle() {
+      return `${this.$route.meta.title}`;
+    },
+    num() {
+      return this.$route.query.num || '1';
+    },
+    component() {
+      let component = 'aBase';
+      const res = this.menus.find(f => f.num === this.num);
+      if (res && _.isFunction(res)) {
+        res();
+      } else if (res) {
+        component = _.get(res, 'component', 'aBase');
+      }
+      return component;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 159 - 15
src/views/admin/live/achieve/base.vue

@@ -1,10 +1,70 @@
 <template>
-  <div id="base">
+  <div id="aBase">
     <el-row>
-      <el-col :span="24" class="main">
+      <el-col :span="24">
         <el-col :span="24" class="leftTop"> <span>|</span> <span>展会管理</span> </el-col>
         <el-col :span="24" class="info">
-          详情
+          <el-row>
+            <el-col :span="24">
+              <el-form :model="form" ref="form" label-width="100px" class="demo-ruleForm">
+                <el-form-item label="对接会标题">
+                  <el-input v-model="form.title"></el-input>
+                </el-form-item>
+                <el-form-item label="开始时间">
+                  <el-date-picker
+                    v-model="form.start_time"
+                    type="datetime"
+                    placeholder="选择日期时间"
+                    format="yyyy-MM-dd HH:mm:ss"
+                    value-format="yyyy-MM-dd HH:mm:ss"
+                  >
+                  </el-date-picker>
+                </el-form-item>
+                <el-form-item label="结束时间">
+                  <el-date-picker
+                    v-model="form.end_time"
+                    type="datetime"
+                    placeholder="请选择结束时间"
+                    format="yyyy-MM-dd HH:mm:ss"
+                    value-format="yyyy-MM-dd HH:mm:ss"
+                  >
+                  </el-date-picker>
+                </el-form-item>
+                <el-form-item label="省份">
+                  <el-select v-model="form.province" placeholder="请选择省份" @change="searchOther">
+                    <el-option v-for="item in provinceList" :key="item.code" :label="item.name" :value="item.code"> </el-option>
+                  </el-select>
+                </el-form-item>
+                <el-form-item label="市">
+                  <el-select v-model="form.city" placeholder="请选择市">
+                    <el-option v-for="item in placeList" :key="item.code" :label="item.name" :value="item.code"> </el-option>
+                  </el-select>
+                </el-form-item>
+                <el-form-item label="负责人">
+                  <el-input v-model="form.admin" placeholder="请输入用户名"></el-input>
+                </el-form-item>
+                <el-form-item label="负责人手机号">
+                  <el-input v-model="form.phone" maxlength="11" placeholder="请输入手机号" disabled> </el-input>
+                </el-form-item>
+                <el-form-item label="主办方">
+                  <el-input v-model="form.sponsor" placeholder="请输入主办方"></el-input>
+                </el-form-item>
+                <el-form-item label="承办方">
+                  <el-input v-model="form.organizer" placeholder="请输入承办方"></el-input>
+                </el-form-item>
+                <el-form-item label="状态">
+                  <el-radio v-model="form.status" label="1">开始</el-radio>
+                  <el-radio v-model="form.status" label="-1">结束</el-radio>
+                </el-form-item>
+                <el-form-item>
+                  <el-button type="primary" @click="submitForm('form')">保存</el-button>
+                  <el-button type="primary" @click="submitStatus('form')" v-if="this.form.status == '1' || this.form.status == '-1'">
+                    展会开启&结束提交
+                  </el-button>
+                </el-form-item>
+              </el-form>
+            </el-col>
+          </el-row>
         </el-col>
       </el-col>
     </el-row>
@@ -12,30 +72,114 @@
 </template>
 
 <script>
+const _ = require('lodash');
 import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: dock } = createNamespacedHelpers('dock');
+const { mapActions: place } = createNamespacedHelpers('place');
 export default {
-  name: 'base',
+  name: 'aBase',
   props: {},
   components: {},
   data: function() {
-    return {};
+    return {
+      form: {},
+      provinceList: [],
+      placeList: [],
+    };
+  },
+  created() {
+    this.search();
+    this.searchOther();
+  },
+  methods: {
+    ...place({ placeQuery: 'query' }),
+    ...dock(['fetch', 'update']),
+    async search() {
+      const res = await this.fetch(this.user._id);
+      if (this.$checkRes(res)) {
+        this.$set(this, `form`, res.data);
+        if (this.form.city) {
+          this.searchOther(this.form.province);
+        }
+      }
+    },
+
+    async submitForm() {
+      const res = await this.update(_.cloneDeep(this.form));
+      if (this.$checkRes(res)) {
+        this.$message({
+          message: '修改信息成功',
+          type: 'success',
+        });
+        this.search();
+      }
+    },
+    async submitStatus() {
+      const res = await this.update(_.cloneDeep(this.form));
+      if (this.$checkRes(res)) {
+        this.$message({
+          message: '对接会审核成功',
+          type: 'success',
+        });
+        this.search();
+      }
+    },
+
+    async searchOther(val) {
+      const query = {};
+      if (val) query.code = val;
+      let res = await this.placeQuery(query);
+      if (this.$checkRes(res)) {
+        if (!val) this.$set(this, `provinceList`, res.data);
+        else this.$set(this, `placeList`, res.data);
+      }
+    },
   },
-  created() {},
-  methods: {},
   computed: {
     ...mapState(['user']),
+    pageTitle() {
+      return `${this.$route.meta.title}`;
+    },
   },
   metaInfo() {
     return { title: this.$route.meta.title };
   },
-  watch: {
-    test: {
-      deep: true,
-      immediate: true,
-      handler(val) {},
-    },
-  },
 };
 </script>
 
-<style lang="less" scoped></style>
+<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 {
+  padding: 0 38px 0 10px;
+}
+/deep/.el-dialog__body {
+  height: 350px;
+  overflow: hidden;
+  padding: 20px;
+}
+.table {
+  height: 328px;
+  overflow: hidden;
+}
+/deep/.el-table td {
+  padding: 5px 0;
+}
+/deep/.el-table th {
+  padding: 5px 0;
+}
+.page {
+  text-align: center;
+  padding: 10px 0;
+}
+</style>

+ 172 - 177
src/views/admin/live/achieve/pw.vue

@@ -1,177 +1,172 @@
-<template>
-  <div id="aPw">
-    <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-col :span="24" class="top">
-            <el-button type="primary" size="mini" @click="dialog = true">添加信息</el-button>
-          </el-col>
-          <el-col :span="24" class="list">
-            <data-table :fields="fields" :opera="opera" :data="list" :total="total" @edit="toEdit" @delete="toDelete" @query="search"></data-table>
-          </el-col>
-        </el-col>
-      </el-col>
-    </el-row>
-    <el-dialog title="信息管理" :visible.sync="dialog" @closed="handleClose" width="50%" :append-to-body="true">
-      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
-        <el-form-item label="信息内容" prop="content">
-          <el-input v-model="form.content" type="textarea" placeholder="请输入信息内容"></el-input>
-        </el-form-item>
-        <el-form-item label="图片" prop="url">
-          <uploadArray
-            :limit="6"
-            :data="form.url"
-            :uploadBtn="true"
-            type="url"
-            :url="`/files/image/upload`"
-            @upload="uploadSuccess"
-            @delete="uploadDelete"
-          ></uploadArray>
-        </el-form-item>
-        <el-form-item label="视频文件" prop="file_path">
-          <upload
-            :limit="1"
-            :data="form.file_path"
-            type="file_path"
-            listType=""
-            :url="'/files/imgpath/upload'"
-            @upload="uploadSuccess"
-            @delete="uploadDelete"
-          ></upload>
-        </el-form-item>
-        <el-form-item>
-          <el-button type="primary" @click="save">保存</el-button>
-        </el-form-item>
-      </el-form>
-    </el-dialog>
-  </div>
-</template>
-
-<script>
-const _ = require('lodash');
-import dataTable from '@common/src/components/frame/filter-page-table.vue';
-import upload from '@common/src/components/frame/upload.vue';
-import uploadArray from '@common/src/components/upload/uploadArray.vue';
-import { mapState, createNamespacedHelpers } from 'vuex';
-const { mapActions: dockPw } = createNamespacedHelpers('dockPw');
-export default {
-  name: 'aPw',
-  props: {},
-  components: { dataTable, upload, uploadArray },
-  data: function() {
-    return {
-      opera: [
-        {
-          label: '修改',
-          icon: 'el-icon-edit',
-          method: 'edit',
-        },
-        {
-          label: '删除',
-          icon: 'el-icon-delete',
-          method: 'delete',
-        },
-      ],
-      fields: [
-        { label: '信息内容', prop: 'content' },
-        { label: '发布时间', prop: 'create_time' },
-      ],
-      list: [],
-      total: 0,
-      dialog: false,
-      form: { url: [] },
-      rules: {},
-    };
-  },
-  created() {
-    this.search();
-  },
-  methods: {
-    ...dockPw(['query', 'fetch', 'update', 'delete', 'create']),
-    async search({ skip = 0, limit = 10 } = {}) {
-      const res = await this.query({ dock_id: this.user.id, skip, limit });
-      if (this.$checkRes(res)) {
-        this.$set(this, `list`, res.data);
-        this.$set(this, `total`, res.total);
-      }
-    },
-    // 修改
-    toEdit({ data }) {
-      this.$set(this, `form`, data);
-      this.dialog = true;
-    },
-    // 保存
-    async save() {
-      let data = _.cloneDeep(this.form);
-      if (data.id) {
-        let res = await this.update(data);
-        if (this.$checkRes(res, '信息修改成功', res.errmsg || '信息修改失败')) this.handleClose();
-      } else {
-        data.dock_id = this.user.id;
-        let res = await this.create(data);
-        if (this.$checkRes(res, '信息添加成功', res.errmsg || '信息添加失败')) this.handleClose();
-      }
-    },
-    // 删除
-    async toDelete({ data }) {
-      let res = await this.delete(data.id);
-      if (this.$checkRes(res, '信息删除成功', res.errmsg || '信息删除失败')) this.search();
-    },
-    // 取消
-    handleClose() {
-      this.form = { url: [] };
-      this.dialog = false;
-      this.search();
-    },
-    uploadSuccess({ type, data }) {
-      let arr = _.get(this.form, type);
-      if (_.isArray(arr)) {
-        let datas = { name: data.name, url: data.uri };
-        this.form[type].push({ name: data.name, url: data.uri });
-      } else {
-        this.$set(this.form, `${type}`, data.uri);
-      }
-    },
-    uploadDelete(data) {
-      if (_.isObject(data)) this.$set(this.form, data.type, null);
-      else this.form.url.splice(data, 1);
-      this.$message({
-        message: '删除成功',
-        type: 'success',
-      });
-    },
-  },
-  computed: {
-    ...mapState(['user', 'menuParams']),
-    pageTitle() {
-      return `${this.$route.meta.title}`;
-    },
-  },
-  metaInfo() {
-    return { title: this.$route.meta.title };
-  },
-};
-</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 {
-  padding: 0 38px 0 10px;
-  .top {
-    text-align: right;
-    padding: 10px 0;
-  }
-}
-</style>
+<template>
+  <div id="aPw">
+    <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-row type="flex" justify="end" style="padding:10px">
+            <el-col :span="2">
+              <el-button type="primary" size="mini" @click="toAdd()">添加</el-button>
+            </el-col>
+          </el-row>
+          <data-table :fields="fields" :opera="opera" :data="list" :usePage="false" @delete="toDelete" @edit="toAdd"></data-table>
+        </el-col>
+      </el-col>
+    </el-row>
+
+    <el-dialog title="图文信息" :visible.sync="dialog" width="40%">
+      <el-form ref="form" :model="form" label-width="80px" class="form">
+        <el-form-item label="信息内容">
+          <el-input v-model="form.content" type="textarea" placeholder="请输入信息内容"></el-input>
+        </el-form-item>
+        <el-form-item label="图片">
+          <upload
+            :limit="1"
+            :data="form.img_url"
+            type="img_url"
+            listType=""
+            :url="'/files/live/dock_imgtxt/upload'"
+            @upload="uploadSuccess"
+            @delete="uploadDelete"
+          ></upload>
+        </el-form-item>
+        <el-form-item label="视频">
+          <upload
+            :limit="1"
+            :data="form.file_url"
+            type="file_url"
+            listType=""
+            :url="'/files/live/dock_imgtxt/upload'"
+            @upload="uploadSuccess"
+            @delete="uploadDelete"
+          ></upload>
+        </el-form-item>
+        <el-form-item>
+          <el-button type="primary" @click="vSubmit">保存</el-button>
+        </el-form-item>
+      </el-form>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import dataTable from '@common/src/components/frame/filter-page-table.vue';
+import upload from '@common/src/components/frame/upload.vue';
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: dockImgtxt } = createNamespacedHelpers('dockImgtxt');
+export default {
+  name: 'aPw',
+  props: {},
+  components: { dataTable, upload },
+  data: function() {
+    return {
+      dialog: false,
+      list: [],
+      opera: [
+        {
+          label: '编辑',
+          method: 'edit',
+        },
+        {
+          label: '删除',
+          type: 'danger',
+          method: 'delete',
+        },
+      ],
+      fields: [{ label: '信息', prop: 'content', model: 'content' }],
+      form: {},
+    };
+  },
+  created() {
+    this.search();
+  },
+  methods: {
+    ...dockImgtxt(['query', 'create', 'update', 'delete']),
+    async search() {
+      const res = await this.query({ dock_id: this.user._id });
+      if (this.$checkRes(res)) {
+        this.$set(this, `list`, res.data);
+      }
+    },
+    async vSubmit() {
+      let dup = _.cloneDeep(this.form);
+      let res;
+      if (!dup.id) {
+        dup.user_id = this.user.user_id;
+        dup.dock_id = this.user._id;
+        res = await this.create(dup);
+      } else {
+        res = await this.update(dup);
+      }
+      if (this.$checkRes(res, '保存成功', res.errmsg || '保存失败')) {
+        this.search();
+        this.dialog = false;
+      }
+    },
+    async toDelete({ data }) {
+      const { _id } = data;
+      const res = await this.delete(_id);
+      if (this.$checkRes(res, '删除成功', res.errmsg || '删除失败')) {
+        this.search();
+      }
+    },
+    toAdd({ data = {} } = {}) {
+      this.dialog = true;
+      this.$set(this, `form`, data);
+    },
+    uploadSuccess({ type, data }) {
+      const { uri } = data;
+      this.$set(this.form, type, uri);
+    },
+    uploadDelete({ file, type }) {
+      delete this.form[type];
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+    pageTitle() {
+      return `${this.$route.meta.title}`;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</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 {
+  padding: 0 38px 0 10px;
+}
+/deep/.el-dialog__body {
+  height: 350px;
+  overflow: hidden;
+  padding: 20px;
+}
+.table {
+  height: 328px;
+  overflow: hidden;
+}
+/deep/.el-table td {
+  padding: 5px 0;
+}
+/deep/.el-table th {
+  padding: 5px 0;
+}
+.page {
+  text-align: center;
+  padding: 10px 0;
+}
+</style>

+ 64 - 64
src/views/admin/live/achieve/trans/deal.vue

@@ -1,64 +1,64 @@
-<template>
-  <div id="deal">
-    <data-table :fields="fields" :opera="opera" :operaWidth="150" :data="list" :total="total" @query="search"></data-table>
-  </div>
-</template>
-
-<script>
-import dataTable from '@common/src/components/frame/filter-page-table.vue';
-import { mapState, createNamespacedHelpers } from 'vuex';
-const { mapActions: transaction } = createNamespacedHelpers('transaction');
-export default {
-  name: 'deal',
-  props: {},
-  components: { dataTable },
-  data: function() {
-    return {
-      opera: [],
-      fields: [
-        { label: '商品名称', prop: 'product' },
-        { label: '购买人名称', prop: 'd_name' },
-        { label: '营销人名称', prop: 's_name' },
-        {
-          label: '状态',
-          prop: 'status',
-          format: i => {
-            let word = '正在洽谈';
-            if (i == '1') word = '达成意向';
-            else if (i == '2') word = '待确定';
-            else if (i == '3') word = '交易完成';
-            else if (i == '4') word = '交易失败';
-            return word;
-          },
-        },
-      ],
-      list: [],
-      total: 0,
-    };
-  },
-  created() {
-    this.search();
-  },
-  methods: {
-    ...transaction(['query']),
-    async search({ skip = 0, limit = 10, ...info } = {}) {
-      const res = await this.query({ skip, limit, dock_id: this.user.id, status: '2' });
-      if (this.$checkRes(res)) {
-        this.$set(this, `list`, res.data);
-        this.$set(this, `total`, res.total);
-      }
-    },
-  },
-  computed: {
-    ...mapState(['user', 'menuParams']),
-    pageTitle() {
-      return `${this.$route.meta.title}`;
-    },
-  },
-  metaInfo() {
-    return { title: this.$route.meta.title };
-  },
-};
-</script>
-
-<style lang="less" scoped></style>
+<template>
+  <div id="deal">
+    <data-table :fields="fields" :opera="opera" :operaWidth="150" :data="list" :total="total" @query="search"></data-table>
+  </div>
+</template>
+
+<script>
+import dataTable from '@common/src/components/frame/filter-page-table.vue';
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: dockTranscation } = createNamespacedHelpers('dockTranscation');
+export default {
+  name: 'deal',
+  props: {},
+  components: { dataTable },
+  data: function() {
+    return {
+      opera: [],
+      fields: [
+        { label: '商品名称', prop: 'product' },
+        { label: '购买人名称', prop: 'd_name' },
+        { label: '营销人名称', prop: 's_name' },
+        {
+          label: '状态',
+          prop: 'status',
+          format: i => {
+            let word = '正在洽谈';
+            if (i == '1') word = '达成意向';
+            else if (i == '2') word = '待确定';
+            else if (i == '3') word = '交易完成';
+            else if (i == '4') word = '交易失败';
+            return word;
+          },
+        },
+      ],
+      list: [],
+      total: 0,
+    };
+  },
+  created() {
+    this.search();
+  },
+  methods: {
+    ...dockTranscation(['query']),
+    async search({ skip = 0, limit = 10, ...info } = {}) {
+      const res = await this.query({ skip, limit, dock_id: this.user.id, status: '2' });
+      if (this.$checkRes(res)) {
+        this.$set(this, `list`, res.data);
+        this.$set(this, `total`, res.total);
+      }
+    },
+  },
+  computed: {
+    ...mapState(['user', 'menuParams']),
+    pageTitle() {
+      return `${this.$route.meta.title}`;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 63 - 63
src/views/admin/live/achieve/trans/finish.vue

@@ -1,63 +1,63 @@
-<template>
-  <div id="finish">
-    <data-table :fields="fields" :opera="[]" :data="list" :total="total"></data-table>
-  </div>
-</template>
-
-<script>
-import dataTable from '@common/src/components/frame/filter-page-table.vue';
-import { mapState, createNamespacedHelpers } from 'vuex';
-const { mapActions: transaction } = createNamespacedHelpers('transaction');
-export default {
-  name: 'finish',
-  props: {},
-  components: { dataTable },
-  data: function() {
-    return {
-      fields: [
-        { label: '商品名称', prop: 'product' },
-        { label: '购买人名称', prop: 'd_name' },
-        { label: '营销人名称', prop: 's_name' },
-        {
-          label: '状态',
-          prop: 'status',
-          format: i => {
-            let word = '正在洽谈';
-            if (i == '1') word = '达成意向';
-            else if (i == '2') word = '交易备案';
-            else if (i == '3') word = '交易完成';
-            else if (i == '4') word = '交易失败';
-            return word;
-          },
-        },
-      ],
-      list: [],
-      total: 0,
-    };
-  },
-  created() {
-    this.search();
-  },
-  methods: {
-    ...transaction(['query']),
-    async search({ skip = 0, limit = 10, ...info } = {}) {
-      const res = await this.query({ skip, limit, dock_id: this.user.id, status: '3' });
-      if (this.$checkRes(res)) {
-        this.$set(this, `list`, res.data);
-        this.$set(this, `total`, res.total);
-      }
-    },
-  },
-  computed: {
-    ...mapState(['user', 'menuParams']),
-    pageTitle() {
-      return `${this.$route.meta.title}`;
-    },
-  },
-  metaInfo() {
-    return { title: this.$route.meta.title };
-  },
-};
-</script>
-
-<style lang="less" scoped></style>
+<template>
+  <div id="finish">
+    <data-table :fields="fields" :opera="[]" :data="list" :total="total"></data-table>
+  </div>
+</template>
+
+<script>
+import dataTable from '@common/src/components/frame/filter-page-table.vue';
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: dockTranscation } = createNamespacedHelpers('dockTranscation');
+export default {
+  name: 'finish',
+  props: {},
+  components: { dataTable },
+  data: function() {
+    return {
+      fields: [
+        { label: '商品名称', prop: 'product' },
+        { label: '购买人名称', prop: 'd_name' },
+        { label: '营销人名称', prop: 's_name' },
+        {
+          label: '状态',
+          prop: 'status',
+          format: i => {
+            let word = '正在洽谈';
+            if (i == '1') word = '达成意向';
+            else if (i == '2') word = '交易备案';
+            else if (i == '3') word = '交易完成';
+            else if (i == '4') word = '交易失败';
+            return word;
+          },
+        },
+      ],
+      list: [],
+      total: 0,
+    };
+  },
+  created() {
+    this.search();
+  },
+  methods: {
+    ...dockTranscation(['query']),
+    async search({ skip = 0, limit = 10, ...info } = {}) {
+      const res = await this.query({ skip, limit, dock_id: this.user.id, status: '3' });
+      if (this.$checkRes(res)) {
+        this.$set(this, `list`, res.data);
+        this.$set(this, `total`, res.total);
+      }
+    },
+  },
+  computed: {
+    ...mapState(['user', 'menuParams']),
+    pageTitle() {
+      return `${this.$route.meta.title}`;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 66 - 66
src/views/admin/live/achieve/trans/list.vue

@@ -1,66 +1,66 @@
-<template>
-  <div id="deal">
-    <data-table :fields="fields" :opera="opera" :operaWidth="150" :data="list" :total="total" @query="search"></data-table>
-  </div>
-</template>
-
-<script>
-import dataTable from '@common/src/components/frame/filter-page-table.vue';
-import { mapState, createNamespacedHelpers } from 'vuex';
-const { mapActions: transaction } = createNamespacedHelpers('transaction');
-export default {
-  name: 'deal',
-  props: {
-    status: { type: String, default: '1' },
-  },
-  components: { dataTable },
-  data: function() {
-    return {
-      opera: [],
-      fields: [
-        { label: '商品名称', prop: 'product' },
-        { label: '购买人名称', prop: 'd_name' },
-        { label: '营销人名称', prop: 's_name' },
-        {
-          label: '状态',
-          prop: 'status',
-          format: i => {
-            let word = '正在洽谈';
-            if (i == '1') word = '达成意向';
-            else if (i == '2') word = '待确定';
-            else if (i == '3') word = '交易完成';
-            else if (i == '4') word = '交易失败';
-            return word;
-          },
-        },
-      ],
-      list: [],
-      total: 0,
-    };
-  },
-  created() {
-    this.search();
-  },
-  methods: {
-    ...transaction(['query']),
-    async search({ skip = 0, limit = 10, ...info } = {}) {
-      const res = await this.query({ skip, limit, dock_id: this.user.id, status: this.status });
-      if (this.$checkRes(res)) {
-        this.$set(this, `list`, res.data);
-        this.$set(this, `total`, res.total);
-      }
-    },
-  },
-  computed: {
-    ...mapState(['user', 'menuParams']),
-    pageTitle() {
-      return `${this.$route.meta.title}`;
-    },
-  },
-  metaInfo() {
-    return { title: this.$route.meta.title };
-  },
-};
-</script>
-
-<style lang="less" scoped></style>
+<template>
+  <div id="deal">
+    <data-table :fields="fields" :opera="opera" :operaWidth="150" :data="list" :total="total" @query="search"></data-table>
+  </div>
+</template>
+
+<script>
+import dataTable from '@common/src/components/frame/filter-page-table.vue';
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: dockTranscation } = createNamespacedHelpers('dockTranscation');
+export default {
+  name: 'deal',
+  props: {
+    status: { type: String, default: '1' },
+  },
+  components: { dataTable },
+  data: function() {
+    return {
+      opera: [],
+      fields: [
+        { label: '商品名称', prop: 'product' },
+        { label: '购买人名称', prop: 'd_name' },
+        { label: '营销人名称', prop: 's_name' },
+        {
+          label: '状态',
+          prop: 'status',
+          format: i => {
+            let word = '正在洽谈';
+            if (i == '1') word = '达成意向';
+            else if (i == '2') word = '待确定';
+            else if (i == '3') word = '交易完成';
+            else if (i == '4') word = '交易失败';
+            return word;
+          },
+        },
+      ],
+      list: [],
+      total: 0,
+    };
+  },
+  created() {
+    this.search();
+  },
+  methods: {
+    ...dockTranscation(['query']),
+    async search({ skip = 0, limit = 10, ...info } = {}) {
+      const res = await this.query({ skip, limit, dock_id: this.user.id, status: this.status });
+      if (this.$checkRes(res)) {
+        this.$set(this, `list`, res.data);
+        this.$set(this, `total`, res.total);
+      }
+    },
+  },
+  computed: {
+    ...mapState(['user', 'menuParams']),
+    pageTitle() {
+      return `${this.$route.meta.title}`;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 167 - 0
src/views/admin/live/achieve/video.vue

@@ -0,0 +1,167 @@
+<template>
+  <div id="aVideo">
+    <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-row type="flex" justify="end" style="padding:10px">
+            <el-col :span="2">
+              <el-button type="primary" size="mini" @click="toAdd()">添加</el-button>
+            </el-col>
+          </el-row>
+          <data-table :fields="fields" :opera="opera" :data="list" :usePage="false" @delete="toDelete" @edit="toAdd"></data-table>
+        </el-col>
+      </el-col>
+    </el-row>
+
+    <el-dialog title="视频信息" :visible.sync="dialog" width="40%">
+      <el-form ref="form" :model="form" label-width="80px" class="form">
+        <el-form-item label="标题">
+          <el-input v-model="form.title" placeholder="请输入标题"></el-input>
+        </el-form-item>
+        <el-form-item label="简介">
+          <el-input v-model="form.brief" type="textarea" placeholder="请输入简介"></el-input>
+        </el-form-item>
+        <el-form-item label="视频路径">
+          <upload
+            :limit="1"
+            :data="form.file_url"
+            type="file_url"
+            listType=""
+            :url="'/files/live/dock_video/upload'"
+            @upload="uploadSuccess"
+            @delete="uploadDelete"
+          ></upload>
+        </el-form-item>
+        <el-form-item>
+          <el-button type="primary" @click="vSubmit">保存</el-button>
+        </el-form-item>
+      </el-form>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import dataTable from '@common/src/components/frame/filter-page-table.vue';
+import upload from '@common/src/components/frame/upload.vue';
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: dockVideo } = createNamespacedHelpers('dockVideo');
+export default {
+  name: 'aVideo',
+  props: {},
+  components: { dataTable, upload },
+  data: function() {
+    return {
+      dialog: false,
+      list: [],
+      opera: [
+        {
+          label: '编辑',
+          method: 'edit',
+        },
+        {
+          label: '删除',
+          type: 'danger',
+          method: 'delete',
+        },
+      ],
+      fields: [
+        { label: '标题', prop: 'title', model: 'title' },
+        { label: '简介', prop: 'brief', model: 'origin' },
+      ],
+      form: {},
+    };
+  },
+  created() {
+    this.search();
+  },
+  methods: {
+    ...dockVideo(['query', 'create', 'update', 'delete']),
+    async search() {
+      const res = await this.query({ dock_id: this.user._id });
+      if (this.$checkRes(res)) {
+        this.$set(this, `list`, res.data);
+      }
+    },
+    async vSubmit() {
+      let dup = _.cloneDeep(this.form);
+      let res;
+      if (!dup.id) {
+        dup.user_id = this.user.user_id;
+        dup.dock_id = this.user._id;
+        res = await this.create(dup);
+      } else {
+        res = await this.update(dup);
+      }
+      if (this.$checkRes(res, '保存成功', res.errmsg || '保存失败')) {
+        this.search();
+        this.dialog = false;
+      }
+    },
+    async toDelete({ data }) {
+      const { _id } = data;
+      const res = await this.delete(_id);
+      if (this.$checkRes(res, '删除成功', res.errmsg || '删除失败')) {
+        this.search();
+      }
+    },
+    toAdd({ data = {} } = {}) {
+      this.dialog = true;
+      this.$set(this, `form`, data);
+    },
+    uploadSuccess({ type, data }) {
+      const { uri } = data;
+      this.$set(this.form, type, uri);
+    },
+    uploadDelete({ file, type }) {
+      delete this.form[type];
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+    pageTitle() {
+      return `${this.$route.meta.title}`;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</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 {
+  padding: 0 38px 0 10px;
+}
+/deep/.el-dialog__body {
+  height: 350px;
+  overflow: hidden;
+  padding: 20px;
+}
+.table {
+  height: 328px;
+  overflow: hidden;
+}
+/deep/.el-table td {
+  padding: 5px 0;
+}
+/deep/.el-table th {
+  padding: 5px 0;
+}
+.page {
+  text-align: center;
+  padding: 10px 0;
+}
+</style>

+ 143 - 146
src/views/admin/live/achieve/vip.vue

@@ -1,146 +1,143 @@
-<template>
-  <div id="vip">
-    <el-row>
-      <el-col :span="24">
-        <el-col :span="24" class="leftTop"> <span>|</span> <span>VIP用户</span> </el-col>
-        <el-col :span="24" class="info">
-          <el-col :span="24" class="add">
-            <el-button type="primary" size="mini" @click="dialog = true">添加用户</el-button>
-          </el-col>
-          <el-col :span="24">
-            <data-table :fields="fields" :opera="opera" :data="list" :usePage="false" @edit="toEdit" @delete="toDelete"></data-table>
-          </el-col>
-        </el-col>
-      </el-col>
-    </el-row>
-    <el-dialog title="vip用户" :visible.sync="dialog" width="30%" center :before-close="toClose">
-      <data-form v-model="form" :fields="fields" @save="toSave"></data-form>
-    </el-dialog>
-  </div>
-</template>
-
-<script>
-const _ = require('lodash');
-import dataTable from '@common/src/components/frame/filter-page-table.vue';
-import dataForm from '@common/src/components/frame/vform.vue';
-import { mapState, createNamespacedHelpers } from 'vuex';
-const { mapActions: dock } = createNamespacedHelpers('dock');
-export default {
-  name: 'vip',
-  props: {},
-  components: { dataTable, dataForm },
-  data: function() {
-    return {
-      dialog: false,
-      opera: [
-        {
-          label: '编辑',
-          method: 'edit',
-        },
-        {
-          label: '删除',
-          type: 'danger',
-          method: 'delete',
-        },
-      ],
-      fields: [
-        { label: '姓名', prop: 'vipname', model: 'vipname' },
-        { label: '手机号', prop: 'vipphone', model: 'vipphone' },
-        { label: '邮箱', prop: 'email', model: 'email' },
-        { label: '简介', prop: 'content', model: 'content', notable: true, type: 'textarea' },
-      ],
-      list: [],
-      form: {},
-    };
-  },
-  created() {
-    this.search();
-  },
-  methods: {
-    ...dock(['fetch', 'update']),
-    async search() {
-      const res = await this.fetch(this.user.id);
-      if (this.$checkRes(res)) {
-        this.$set(this, `list`, _.get(res.data, 'vipuser', []));
-      }
-    },
-    async toSave() {
-      const dup = _.cloneDeep(this.form);
-      dup.password = this.user.room_id;
-      const vipuser = _.cloneDeep(this.list);
-      if (dup._id) {
-        const index = vipuser.findIndex(f => f._id == dup._id);
-        vipuser[index] = dup;
-      } else vipuser.push(dup);
-      const res = await this.update({ id: this.user.id, vipuser });
-      if (this.$checkRes(res, 'vip用户保存成功', res.errmsg || 'vip用户保存失败')) {
-        this.search();
-        this.toClose();
-      }
-    },
-    toEdit({ data }) {
-      this.dialog = true;
-      this.$set(this, `form`, data);
-    },
-    toDelete({ data }) {
-      this.$confirm('您确定要删除此用户吗?', '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning',
-      })
-        .then(async () => {
-          console.log(index);
-          let vipuser = _.cloneDeep(this.list);
-          vipuser = vipuser.filter(f => f._id !== data._id);
-          const res = await this.update({ id: this.user.id, vipuser });
-          if (this.$checkRes(res, 'vip用户删除成功', res.errmsg || 'vip用户删除失败')) {
-            this.search();
-          }
-        })
-        .catch(() => {});
-    },
-    toClose() {
-      this.dialog = false;
-      this.form = {};
-    },
-  },
-  computed: {
-    ...mapState(['user', 'menuParams']),
-    pageTitle() {
-      return `${this.$route.meta.title}`;
-    },
-  },
-  metaInfo() {
-    return { title: this.$route.meta.title };
-  },
-};
-</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 {
-  padding: 0 40px 0 10px;
-  .add {
-    text-align: right;
-    padding: 10px 0;
-  }
-}
-.page {
-  text-align: right;
-  padding: 10px 0;
-}
-/deep/.el-dialog__body {
-  min-height: 300px;
-}
-</style>
+<template>
+  <div id="vip">
+    <el-row>
+      <el-col :span="24">
+        <el-col :span="24" class="leftTop"> <span>|</span> <span>VIP用户</span> </el-col>
+        <el-col :span="24" class="info">
+          <el-col :span="24" class="add">
+            <el-button type="primary" size="mini" @click="dialog = true">添加用户</el-button>
+          </el-col>
+          <el-col :span="24">
+            <data-table :fields="fields" :opera="opera" :data="list" :usePage="false" @edit="toEdit" @delete="toDelete"></data-table>
+          </el-col>
+        </el-col>
+      </el-col>
+    </el-row>
+    <el-dialog title="vip用户" :visible.sync="dialog" width="30%" center :before-close="toClose">
+      <data-form v-model="form" :fields="fields" @save="toSave"></data-form>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+const _ = require('lodash');
+import dataTable from '@common/src/components/frame/filter-page-table.vue';
+import dataForm from '@common/src/components/frame/vform.vue';
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: dockVip } = createNamespacedHelpers('dockVip');
+export default {
+  name: 'vip',
+  props: {},
+  components: { dataTable, dataForm },
+  data: function() {
+    return {
+      dialog: false,
+      opera: [
+        {
+          label: '编辑',
+          method: 'edit',
+        },
+        {
+          label: '删除',
+          type: 'danger',
+          method: 'delete',
+        },
+      ],
+      fields: [
+        { label: '姓名', prop: 'name', model: 'name' },
+        { label: '手机号', prop: 'phone', model: 'phone' },
+        { label: '邮箱', prop: 'email', model: 'email' },
+        { label: '简介', prop: 'brief', model: 'brief', notable: true, type: 'textarea' },
+      ],
+      list: [],
+      form: {},
+    };
+  },
+  created() {
+    this.search();
+  },
+  methods: {
+    ...dockVip(['query', 'create', 'update', 'delete']),
+    async search() {
+      const res = await this.query({ dock_id: this.user._id });
+      if (this.$checkRes(res)) {
+        this.$set(this, `list`, res.data);
+      }
+    },
+    async toSave() {
+      const dup = _.cloneDeep(this.form);
+      let res;
+      if (!dup._id) {
+        dup.dock_id = this.user._id;
+        res = await this.create(dup);
+      } else {
+        res = await this.update(dup);
+      }
+      if (this.$checkRes(res, 'vip用户保存成功', res.errmsg || 'vip用户保存失败')) {
+        this.search();
+        this.toClose();
+      }
+    },
+    toEdit({ data }) {
+      this.dialog = true;
+      this.$set(this, `form`, data);
+    },
+    toDelete({ data }) {
+      this.$confirm('您确定要删除此用户吗?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning',
+      })
+        .then(async () => {
+          const res = await this.delete(data.id);
+          if (this.$checkRes(res, 'vip用户删除成功', res.errmsg || 'vip用户删除失败')) {
+            this.search();
+          }
+        })
+        .catch(() => {});
+    },
+    toClose() {
+      this.dialog = false;
+      this.form = {};
+    },
+  },
+  computed: {
+    ...mapState(['user', 'menuParams']),
+    pageTitle() {
+      return `${this.$route.meta.title}`;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</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 {
+  padding: 0 40px 0 10px;
+  .add {
+    text-align: right;
+    padding: 10px 0;
+  }
+}
+.page {
+  text-align: right;
+  padding: 10px 0;
+}
+/deep/.el-dialog__body {
+  min-height: 300px;
+}
+</style>