lrf402788946 4 年之前
父节点
当前提交
b231a9ba6a

+ 159 - 6
src/views/admin/live/achieve/road_show.vue

@@ -1,20 +1,149 @@
 <template>
   <div id="aRoadShow">
-    <p>aRoadShow</p>
+    <el-row>
+      <el-col :span="24">
+        <el-col :span="24" class="leftTop"> <span>|</span> <span>项目路演</span> </el-col>
+        <el-col :span="24" class="info">
+          <template v-if="view == 'list'">
+            <el-col :span="24" class="add">
+              <el-button type="primary" size="mini" @click="view = 'detail'">添加信息</el-button>
+            </el-col>
+            <el-col :span="24" class="list">
+              <data-table :fields="fields" :opera="opera" :data="list" :total="total" @query="search" @edit="toEdit" @delete="toDelete"></data-table>
+            </el-col>
+          </template>
+          <template v-else>
+            <el-col :span="24">
+              <el-col :span="24" class="back">
+                <el-button type="primary" size="mini" @click="toBack()">返回</el-button>
+              </el-col>
+              <el-col :span="24">
+                <data-form :fields="fields" v-model="form" @save="toSave">
+                  <template #custom="{item, form}">
+                    <template v-if="item.model === 'picture'">
+                      <upload
+                        :limit="1"
+                        :data="form.picture"
+                        type="picture"
+                        :url="'/files/imgpath/upload'"
+                        @upload="uploadSuccess"
+                        @delete="uploadDelete"
+                      ></upload>
+                    </template>
+                    <template v-if="item.model === 'filepath'">
+                      <upload
+                        :limit="1"
+                        :data="form.filepath"
+                        type="filepath"
+                        listType=""
+                        :url="'/files/imgpath/upload'"
+                        @upload="uploadSuccess"
+                        @delete="uploadDelete"
+                      ></upload>
+                    </template>
+                  </template>
+                </data-form>
+              </el-col>
+            </el-col>
+          </template>
+        </el-col>
+      </el-col>
+    </el-row>
   </div>
 </template>
 
 <script>
+import dataTable from '@common/src/components/frame/filter-page-table.vue';
+import dataForm from '@common/src/components/frame/vform.vue';
+import upload from '@common/src/components/frame/upload.vue';
 import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: roadShow } = createNamespacedHelpers('roadShow');
 export default {
   name: 'aRoadShow',
   props: {},
-  components: {},
+  components: { dataTable, dataForm, upload },
   data: function() {
-    return {};
+    return {
+      view: 'list',
+      opera: [
+        {
+          label: '编辑',
+          method: 'edit',
+        },
+        {
+          label: '删除',
+          type: 'danger',
+          method: 'delete',
+        },
+      ],
+      fields: [
+        { label: '信息标题', prop: 'title', model: 'title', filter: true },
+        { label: '来源', prop: 'origin', model: 'origin' },
+        { label: '图片', model: 'picture', custom: true, notable: true },
+        { label: '视频', model: 'filepath', custom: true, notable: true },
+        { label: '发布时间', prop: 'publish_time', model: 'publish_time', type: 'date' },
+        { label: '简介', prop: 'brief', model: 'brief', type: 'textarea' },
+      ],
+      list: [],
+      total: 0,
+      form: {},
+    };
+  },
+  created() {
+    this.search();
+  },
+  methods: {
+    ...roadShow(['query', 'create', 'update', 'delete']),
+    async search({ skip = 0, limit = 10, ...info } = {}) {
+      const res = await this.query({ skip, limit, ...info });
+      if (this.$checkRes(res)) {
+        this.$set(this, `list`, res.data);
+        this.$set(this, `total`, res.total);
+      }
+    },
+    async toSave() {
+      const dup = _.cloneDeep(this.form);
+      let res;
+      if (dup._id) {
+        res = await this.update(dup);
+      } else {
+        dup.dock_id = this.user.id;
+        res = await this.create(dup);
+      }
+      if (this.$checkRes(res, '嘉宾访谈保存成功', res.errmsg || '嘉宾访谈保存失败')) {
+        this.search();
+        this.toBack();
+      }
+    },
+    toEdit({ data }) {
+      this.view = 'detail';
+      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, '嘉宾访谈删除成功', res.errmsg || '嘉宾访谈删除失败')) {
+            this.search();
+          }
+        })
+        .catch(() => {});
+    },
+    toBack() {
+      this.view = 'list';
+      this.form = {};
+    },
+    uploadSuccess({ type, data }) {
+      this.$set(this.form, `${type}`, data.uri);
+    },
+    uploadDelete({ type }) {
+      this.$set(this.form, type, null);
+    },
   },
-  created() {},
-  methods: {},
   computed: {
     ...mapState(['user', 'menuParams']),
     pageTitle() {
@@ -27,4 +156,28 @@ export default {
 };
 </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 40px 0 10px;
+  .add {
+    text-align: right;
+    padding: 10px 0;
+  }
+}
+.back {
+  text-align: right;
+  padding: 10px 0;
+}
+</style>

+ 38 - 4
src/views/admin/live/achieve/statistics.vue

@@ -1,17 +1,35 @@
 <template>
   <div id="aStatistics">
-    <p>aStatistics</p>
+    <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-tabs v-model="activeName" type="card">
+            <el-tab-pane label="科技需求" name="first">
+              <achieve></achieve>
+            </el-tab-pane>
+            <el-tab-pane label="技术成果" name="second">
+              <requirement></requirement>
+            </el-tab-pane>
+          </el-tabs>
+        </el-col>
+      </el-col>
+    </el-row>
   </div>
 </template>
 
 <script>
+import achieve from './statistics/achieve.vue';
+import requirement from './statistics/requirement.vue';
 import { mapState, createNamespacedHelpers } from 'vuex';
 export default {
   name: 'aStatistics',
   props: {},
-  components: {},
+  components: { requirement, achieve },
   data: function() {
-    return {};
+    return {
+      activeName: 'first',
+    };
   },
   created() {},
   methods: {},
@@ -27,4 +45,20 @@ export default {
 };
 </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;
+}
+</style>

+ 78 - 0
src/views/admin/live/achieve/statistics/achieve.vue

@@ -0,0 +1,78 @@
+<template>
+  <div roadShow="achieve">
+    <el-row type="flex" style="padding:10px" :gutter="10">
+      <el-col :span="5">
+        <el-select v-model="form.field" placeholder="请选择所属领域" size="small" clearable @change="search">
+          <el-option v-for="(i, index) in codeList" :key="`code${index}`" :label="i.name" :value="i.name"></el-option>
+        </el-select>
+      </el-col>
+      <el-col :span="12">
+        <el-radio-group v-model="form.radio" size="small">
+          <el-radio border label="1">是我处支持范围</el-radio>
+          <el-radio border label="2">不是我处支持范围</el-radio>
+        </el-radio-group>
+      </el-col>
+    </el-row>
+    <data-table :fields="fields" :opera="opera" :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: dock } = createNamespacedHelpers('dock');
+const { mapActions: code } = createNamespacedHelpers('code');
+export default {
+  name: 'achieve',
+  props: {},
+  components: { dataTable },
+  data: function() {
+    return {
+      opera: [],
+      fields: [
+        { label: '商品名称', prop: 'name' },
+        { label: '所属领域', prop: 'field' },
+        { label: '合作方式', prop: 'cooperation' },
+        { label: '联系人', prop: 'contacts' },
+        { label: '联系电话', prop: 'phone' },
+      ],
+      list: [],
+      total: 0,
+      form: {},
+      codeList: [],
+    };
+  },
+  created() {
+    this.searchCode();
+    this.search();
+  },
+  methods: {
+    ...code(['query']),
+    ...dock(['productQuery']),
+    async search({ skip = 0, limit = 10, ...info } = {}) {
+      const res = await this.productQuery({ skip, limit, ...info, dock_id: this.user.id, type: '0', ...this.form });
+      if (this.$checkRes(res)) {
+        this.$set(this, `list`, res.data);
+        this.$set(this, `total`, res.total);
+      }
+    },
+    async searchCode() {
+      const res = await this.query({ category: '01' });
+      if (this.$checkRes(res)) {
+        this.$set(this, `codeList`, res.data);
+      }
+    },
+  },
+  computed: {
+    ...mapState(['user', 'menuParams']),
+    pageTitle() {
+      return `${this.$route.meta.title}`;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 78 - 0
src/views/admin/live/achieve/statistics/requirement.vue

@@ -0,0 +1,78 @@
+<template>
+  <div id="requirement">
+    <el-row type="flex" style="padding:10px" :gutter="10">
+      <el-col :span="5">
+        <el-select v-model="form.field" placeholder="请选择所属领域" size="small" clearable @change="search">
+          <el-option v-for="(i, index) in codeList" :key="`code${index}`" :label="i.name" :value="i.name"></el-option>
+        </el-select>
+      </el-col>
+      <el-col :span="12">
+        <el-radio-group v-model="form.radio" size="small">
+          <el-radio border label="1">是我处支持范围</el-radio>
+          <el-radio border label="2">不是我处支持范围</el-radio>
+        </el-radio-group>
+      </el-col>
+    </el-row>
+    <data-table :fields="fields" :opera="opera" :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: dock } = createNamespacedHelpers('dock');
+const { mapActions: code } = createNamespacedHelpers('code');
+export default {
+  name: 'requirement',
+  props: {},
+  components: { dataTable },
+  data: function() {
+    return {
+      opera: [],
+      fields: [
+        { label: '商品名称', prop: 'name' },
+        { label: '所属领域', prop: 'field' },
+        { label: '合作方式', prop: 'cooperation' },
+        { label: '联系人', prop: 'contacts' },
+        { label: '联系电话', prop: 'phone' },
+      ],
+      list: [],
+      total: 0,
+      form: {},
+      codeList: [],
+    };
+  },
+  created() {
+    this.searchCode();
+    this.search();
+  },
+  methods: {
+    ...code(['query']),
+    ...dock(['productQuery']),
+    async search({ skip = 0, limit = 10, ...info } = {}) {
+      const res = await this.productQuery({ skip, limit, ...info, dock_id: this.user.id, type: '1', ...this.form });
+      if (this.$checkRes(res)) {
+        this.$set(this, `list`, res.data);
+        this.$set(this, `total`, res.total);
+      }
+    },
+    async searchCode() {
+      const res = await this.query({ category: '01' });
+      if (this.$checkRes(res)) {
+        this.$set(this, `codeList`, res.data);
+      }
+    },
+  },
+  computed: {
+    ...mapState(['user', 'menuParams']),
+    pageTitle() {
+      return `${this.$route.meta.title}`;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped></style>