guhongwei %!s(int64=4) %!d(string=hai) anos
pai
achega
0a36d8e3b1

+ 12 - 0
src/router/index.js

@@ -265,6 +265,18 @@ const web = [
         meta: { title: '创新券管理' },
         component: () => import('../views/adminCenter/company/ticket/index.vue'),
       },
+      {
+        path: '/adminCenter/company/ticket/detail',
+        name: 'company_ticket_detail',
+        meta: { title: '创新券信息管理' },
+        component: () => import('../views/adminCenter/company/ticket/detail.vue'),
+      },
+      {
+        path: '/adminCenter/company/ticket/info',
+        name: 'company_ticket_info',
+        meta: { title: '创新券信息查看' },
+        component: () => import('../views/adminCenter/company/ticket/info.vue'),
+      },
       // 中介机构
       {
         path: '/adminCenter/inter/basic',

+ 144 - 0
src/views/adminCenter/company/ticket/detail.vue

@@ -0,0 +1,144 @@
+<template>
+  <div id="detail">
+    <el-row>
+      <el-col :span="24" class="main">
+        <el-col :span="24" class="one">
+          <el-col :span="24" class="top">
+            <el-button type="primary" size="mini" @click="back">返回</el-button>
+          </el-col>
+          <el-col :span="24" class="down">
+            <el-form :model="form" :rules="rules" ref="form" label-width="100px">
+              <el-form-item label="法人复印件" prop="qyfr">
+                <e-upload url="/files/cysci/qyfr_file/upload" :limit="1" v-model="form.qyfr" type="text"></e-upload>
+              </el-form-item>
+              <el-form-item label="企业营业执照" prop="yyzz">
+                <e-upload url="/files/cysci/yyzz_file/upload" :limit="1" v-model="form.yyzz" type="text"></e-upload>
+              </el-form-item>
+              <el-form-item label="企业利润表" prop="qylr">
+                <e-upload url="/files/cysci/qylr_file/upload" :limit="1" v-model="form.qylr" type="text"></e-upload>
+              </el-form-item>
+              <el-col :span="24" class="formBtn">
+                <el-button type="danger" size="mini" @click="back">取消申请</el-button>
+                <el-button type="primary" size="mini" @click="onSubmit('form')">提交申请</el-button>
+              </el-col>
+            </el-form>
+          </el-col>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+const _ = require('lodash');
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: ticket } = createNamespacedHelpers('ticket');
+export default {
+  name: 'detail',
+  props: {},
+  components: {},
+  data: function () {
+    return {
+      form: {
+        qyfr: [],
+        yyzz: [],
+        qylr: [],
+      },
+      rules: {},
+    };
+  },
+  async created() {
+    if (this.id) await this.search();
+  },
+  methods: {
+    ...ticket(['fetch', 'create', 'update']),
+    async search() {
+      let res = await this.fetch(this.id);
+      if (this.$checkRes(res)) {
+        console.log(res.data);
+        // this.$set(this, `form`, res.data);
+      }
+    },
+    onSubmit(formName) {
+      this.$refs[formName].validate(async (valid) => {
+        if (valid) {
+          const obj = { user_id: this.user._id };
+          const material = this.resetData();
+          if (material.length < 3) {
+            this.$message.error('缺少所需资料');
+            return;
+          }
+          obj.material = material;
+          if (obj.id) {
+            console.log('修改');
+          } else {
+            let res = await this.create(obj);
+            if (this.$checkRes(res)) {
+              this.$message({
+                message: '创新券服务申报成功,请耐心等待结果',
+                type: 'success',
+              });
+              this.back();
+            }
+          }
+        } else {
+          console.log('error submit!!');
+          return false;
+        }
+      });
+    },
+    resetData() {
+      let data = _.cloneDeep(this.form);
+      const arr = ['qyfr', 'yyzz', 'qylr'];
+      const res = [];
+      for (const key of arr) {
+        const e = data[key];
+        if (e.length <= 0) continue;
+        const head = _.head(e);
+        res.push(head);
+      }
+      return res;
+    },
+    // 返回
+    back() {
+      this.$router.push({ path: '/adminCenter/company/ticket' });
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+    id() {
+      return this.$route.query.id;
+    },
+    status() {
+      return this.$route.query.status;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.main {
+  border-radius: 10px;
+  box-shadow: 0 0 5px #cccccc;
+  padding: 20px;
+  .one {
+    .top {
+      text-align: right;
+      margin: 0 0 15px 0;
+    }
+  }
+}
+.main:hover {
+  box-shadow: 0 0 5px #409eff;
+}
+</style>

+ 82 - 5
src/views/adminCenter/company/ticket/index.vue

@@ -1,22 +1,84 @@
 <template>
   <div id="index">
     <el-row>
-      <el-col :span="24" class="main"> test </el-col>
+      <el-col :span="24" class="main">
+        <el-col :span="24" class="one">
+          <el-col :span="24" class="down">
+            <el-tabs v-model="active" type="border-card" @tab-click="change">
+              <el-tab-pane label="资质审核中" name="0">
+                <data-table :fields="fields" :opera="opera" :data="list" :total="total" @view="toView">
+                  <template #selfbtn>
+                    <el-button type="primary" size="mini" @click="toAdd">申领创新券服务</el-button>
+                  </template>
+                </data-table>
+              </el-tab-pane>
+              <el-tab-pane label="资质审核失败" name="-1">资质审核失败</el-tab-pane>
+              <el-tab-pane label="企业准备订单" name="1">企业准备订单</el-tab-pane>
+              <el-tab-pane label="中介机构审核中" name="2">中介机构审核中</el-tab-pane>
+              <el-tab-pane label="中介机构审核失败" name="-3">中介机构审核失败</el-tab-pane>
+              <el-tab-pane label="中介机构审核通过" name="3">中介机构审核通过</el-tab-pane>
+              <el-tab-pane label="创新券领取成功" name="4">创新券领取成功</el-tab-pane>
+            </el-tabs>
+          </el-col>
+        </el-col>
+      </el-col>
     </el-row>
   </div>
 </template>
 
 <script>
+const moment = require('moment');
 import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: ticket } = createNamespacedHelpers('ticket');
 export default {
   name: 'index',
   props: {},
   components: {},
   data: function () {
-    return {};
+    return {
+      active: '0',
+      list: [],
+      total: 0,
+      opera: [
+        {
+          label: '查看',
+          method: 'view',
+        },
+      ],
+      fields: [
+        { label: '申领企业', prop: 'name', filter: true },
+        { label: '申领时间', prop: 'meta.createdAt', format: (i) => moment(i).format('YYYY-MM-DD HH:mm:ss') },
+      ],
+    };
+  },
+  async created() {
+    await this.search();
+  },
+  methods: {
+    ...ticket(['query']),
+    // 查询
+    async search({ skip = 0, limit = 10, ...info } = {}) {
+      info.user_id = this.user.id;
+      if (this.active) info.status = this.active;
+      let res = await this.query({ skip, limit, ...info });
+      if (this.$checkRes(res)) {
+        this.$set(this, `list`, res.data);
+        this.$set(this, `total`, res.total);
+      }
+    },
+    // 选择tabs
+    change(tab) {
+      this.$set(this, `active`, tab.name);
+    },
+    // 申领
+    toAdd() {
+      this.$router.push({ path: '/adminCenter/company/ticket/detail' });
+    },
+    // 查看资料
+    toView({ data }) {
+      this.$router.push({ path: '/adminCenter/company/ticket/info', query: { id: data._id, status: data.status } });
+    },
   },
-  created() {},
-  methods: {},
   computed: {
     ...mapState(['user']),
   },
@@ -33,4 +95,19 @@ export default {
 };
 </script>
 
-<style lang="less" scoped></style>
+<style lang="less" scoped>
+.main {
+  border-radius: 10px;
+  box-shadow: 0 0 5px #cccccc;
+  padding: 20px;
+  .one {
+    .top {
+      text-align: right;
+      margin: 0 0 15px 0;
+    }
+  }
+}
+.main:hover {
+  box-shadow: 0 0 5px #409eff;
+}
+</style>

+ 165 - 0
src/views/adminCenter/company/ticket/info.vue

@@ -0,0 +1,165 @@
+<template>
+  <div id="info">
+    <el-row>
+      <el-col :span="24" class="main">
+        <el-col :span="24" class="one">
+          <el-col :span="24" class="top">
+            <el-button type="primary" size="mini" @click="back">返回</el-button>
+          </el-col>
+          <el-col :span="24" class="down">
+            <el-col :span="24" class="text">
+              <el-col :span="2" class="left"> 企业名称:</el-col>
+              <el-col :span="22" class="right">
+                {{ data.name }}
+              </el-col>
+            </el-col>
+            <el-col :span="24" class="text">
+              <el-col :span="2" class="left"> 申领时间:</el-col>
+              <el-col :span="22" class="right">
+                {{ getDate(data.meta) }}
+              </el-col>
+            </el-col>
+            <el-col :span="24" class="text">
+              <el-col :span="2" class="left"> 资质资料:</el-col>
+              <el-col :span="20" class="right">
+                <el-col :span="4" v-for="(i, index) in data.material" :key="`material-${index}`">
+                  <img v-if="isImg(i.url)" :src="i.url" width="150px" height="150px" @click="toOpen(i.url)" />
+                  <el-link v-else :key="`material-${index}`" type="primary" @click="toOpen(i.url)"> <i class="el-icon-download"></i> {{ i.name }} </el-link>
+                </el-col>
+              </el-col>
+            </el-col>
+            <el-col :span="24" class="text">
+              <el-col :span="2" class="left"> 审核资料:</el-col>
+              <el-col :span="20" class="right">
+                <el-col :span="4" v-for="(i, index) in data.medium_material" :key="`medium_material-${index}`">
+                  <img v-if="isImg(i.url)" :src="i.url" width="150px" height="150px" @click="toOpen(i.url)" />
+                  <el-link v-else type="primary" @click="toOpen(i.url)"> <i class="el-icon-download"></i> {{ i.name }} </el-link>
+                </el-col>
+              </el-col>
+            </el-col>
+            <el-col :span="24" class="text">
+              <el-col :span="2" class="left"> 合同资料:</el-col>
+              <el-col :span="20" class="right">
+                <el-col :span="4" v-for="(i, index) in data.contract" :key="`contract-${index}`">
+                  <img v-if="isImg(i.url)" :src="i.url" width="150px" height="150px" @click="toOpen(i.url)" />
+                  <el-link v-else type="primary" @click="toOpen(i.url)"> <i class="el-icon-download"></i> {{ i.name }} </el-link>
+                </el-col>
+              </el-col>
+            </el-col>
+            <el-col :span="24" class="text">
+              <el-col :span="2" class="left"> 审核意见:</el-col>
+              <el-col :span="22" class="right">
+                <el-input v-model="data.desc" type="textarea" :autosize="{ minRows: 4, maxRows: 6 }" disabled></el-input>
+              </el-col>
+            </el-col>
+            <el-col :span="24" class="text">
+              <el-col :span="2" class="left"> 审核状态:</el-col>
+              <el-col :span="22" class="right">
+                {{ data.status }}
+              </el-col>
+            </el-col>
+          </el-col>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+const moment = require('moment');
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: ticket } = createNamespacedHelpers('ticket');
+export default {
+  name: 'info',
+  props: {},
+  components: {},
+  data: function () {
+    return {
+      data: {},
+      imgList: ['jpg', 'jpeg', 'png', 'bmp', 'gif'],
+    };
+  },
+  async created() {
+    if (this.id) await this.search();
+  },
+  methods: {
+    ...ticket(['fetch']),
+    async search() {
+      const res = await this.fetch(this.id);
+      if (this.$checkRes(res)) {
+        this.$set(this, `data`, res.data);
+      }
+    },
+    // 返回
+    back() {
+      this.$router.push({ path: '/adminCenter/company/ticket' });
+    },
+    getDate(date) {
+      if (date) {
+        let newDate = moment(date.createdAt).format('YYYY-MM-DD');
+        if (newDate) return newDate;
+      }
+    },
+    toOpen(url) {
+      window.open(url);
+    },
+    isImg(url) {
+      const arr = url.split('.');
+      const suffix = _.last(arr);
+      return this.imgList.includes(suffix);
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+    id() {
+      return this.$route.query.id;
+    },
+    status() {
+      return this.$route.query.status;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.main {
+  border-radius: 10px;
+  box-shadow: 0 0 5px #cccccc;
+  padding: 20px;
+  .one {
+    .top {
+      text-align: right;
+      margin: 0 0 15px 0;
+    }
+    .down {
+      .text {
+        padding: 10px 0;
+        border-bottom: 1px dashed #333;
+        .left {
+          text-align: left;
+        }
+        .right {
+          img {
+            width: 200px;
+            height: 200px;
+            border: 1px solid #ccc;
+          }
+        }
+      }
+    }
+  }
+}
+.main:hover {
+  box-shadow: 0 0 5px #409eff;
+}
+</style>