瀏覽代碼

Merge branch 'master' of http://git.cc-lotus.info/Free-cysci/cysci-website

guhongwei 4 年之前
父節點
當前提交
3dd0d2d02f

+ 0 - 1
src/components/list/list-page.vue

@@ -71,7 +71,6 @@ export default {
       const skip = (this.currentPage - 1) * this.pageSize;
       let condition = { skip, limit: this.pageSize, ...this.condition };
       if (this.searchInfo && this.searchInfo !== '') condition[this.searchModel] = this.searchInfo;
-      console.log(condition);
       this.$emit('toSearch', condition);
     },
     toSearch(condition) {

+ 18 - 0
src/router/index.js

@@ -43,6 +43,12 @@ const web = [
         meta: { title: '科技服务-高企政策服务' },
         component: () => import('../views/service/policy.vue'),
       },
+      {
+        path: '/service/ticket',
+        name: 'service_ticket',
+        meta: { title: '科技服务-创新券服务' },
+        component: () => import('../views/service/ticket.vue'),
+      },
 
       {
         path: '/service/register',
@@ -222,6 +228,18 @@ const web = [
         meta: { title: '高企政策服务管理' },
         component: () => import('../views/adminCenter/policy/detail.vue'),
       },
+      {
+        path: '/adminCenter/ticket/:status',
+        name: 'admin_ticket_0',
+        meta: { title: '创新劵服务管理' },
+        component: () => import('../views/adminCenter/ticket/status.vue'),
+      },
+      {
+        path: '/adminCenter/ticket/detail',
+        name: 'admin_ticket_detail',
+        meta: { title: '创新劵服务管理' },
+        component: () => import('../views/adminCenter/ticket/detail.vue'),
+      },
       // 企业信息
       {
         path: '/adminCenter/company/basic',

+ 0 - 1
src/views/adminCenter/news/detail.vue

@@ -1,5 +1,4 @@
 <template>
-  <!-- TODO: 内容的富文本还需要写;上传没有查看,需要完善 -->
   <div id="detail">
     <data-form :fields="fields" :data="data" @save="toSave" returns="/adminCenter/news">
       <template #options="{ item }">

+ 152 - 0
src/views/adminCenter/ticket/detail.vue

@@ -0,0 +1,152 @@
+<template>
+  <div id="detail">
+    <el-form ref="form" label-width="150px">
+      <el-row type="flex" justify="end">
+        <el-col :span="2">
+          <el-button type="primary" size="mini" @click="toBack">返回</el-button>
+        </el-col>
+      </el-row>
+      <el-form-item label="企业名称">{{ data.name }}</el-form-item>
+      <el-form-item label="资料">
+        <template #label>
+          <el-row>
+            <el-col :span="24">资料</el-col>
+            <el-col :span="24">(图片点击放大)</el-col>
+          </el-row>
+        </template>
+        <el-row :gutter="10">
+          <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-row>
+      </el-form-item>
+      <template v-if="statusData === '2'">
+        <el-form-item label="中介机构审核资料">
+          <template #label>
+            <el-row>
+              <el-col :span="24">中介机构审核资料</el-col>
+              <el-col :span="24">(图片点击放大)</el-col>
+            </el-row>
+          </template>
+          <el-row :gutter="10">
+            <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-row>
+        </el-form-item>
+        <el-form-item label="合同">
+          <template #label>
+            <el-row>
+              <el-col :span="24">合同</el-col>
+              <el-col :span="24">(图片点击放大)</el-col>
+            </el-row>
+          </template>
+          <el-row :gutter="10">
+            <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-row>
+        </el-form-item>
+      </template>
+      <el-form-item label="审核意见">
+        <el-input v-model="form.desc" placeholder="请填写审核意见" type="textarea" :autosize="{ maxRows: 5, minRows: 3 }"></el-input>
+      </el-form-item>
+      <el-form-item label="审核" v-if="statusData === '0'">
+        <el-radio-group v-model="form.status">
+          <el-radio label="1">通过</el-radio>
+          <el-radio label="-1">拒绝</el-radio>
+        </el-radio-group>
+      </el-form-item>
+      <el-row type="flex" justify="space-around">
+        <el-col :span="2">
+          <el-button v-if="statusData === '0'" type="primary" @click="toStatus" :disabled="!form.status">保存审核结果</el-button>
+          <el-button v-if="statusData === '2'" type="primary" @click="toStatus('3')">确认</el-button>
+        </el-col>
+      </el-row>
+    </el-form>
+  </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 {
+      data: {
+        material: [],
+        medium_material: [],
+        contract: [],
+      },
+      fields: [
+        { label: '企业名称', model: 'name', type: 'text' },
+        { label: '审核资料', model: 'material', custom: true },
+      ],
+      fields2: [
+        { label: '中介机构审核资料', model: 'medium_material', custom: true },
+        { label: '合同', model: 'contract', custom: true },
+      ],
+      imgList: ['jpg', 'jpeg', 'png', 'bmp', 'gif'],
+      form: {},
+    };
+  },
+  created() {
+    if (this.statusData === '2') this.fields = this.fields.concat(this.fields2);
+    if (this.id) this.search();
+  },
+  methods: {
+    ...ticket(['fetch', 'status']),
+    async search() {
+      const res = await this.fetch(this.id);
+      if (this.$checkRes(res)) {
+        this.$set(this, `data`, res.data);
+      }
+    },
+    isImg(url) {
+      const arr = url.split('.');
+      const suffix = _.last(arr);
+      return this.imgList.includes(suffix);
+    },
+    toOpen(url) {
+      window.open(url);
+    },
+    async toStatus(status) {
+      const dup = _.cloneDeep(this.form);
+      dup.opera_id = this.user._id;
+      dup.id = this.data._id;
+      if (status) dup.status = status;
+      const res = await this.status(dup);
+      if (this.$checkRes(res, '审核成功', res.errmsg || '审核失败')) {
+        this.toBack();
+      }
+    },
+    toBack() {
+      this.$router.push(`/adminCenter/ticket/${this.statusData}`);
+    },
+  },
+  computed: {
+    ...mapState(['user', 'menuParams']),
+    pageTitle() {
+      return `${this.$route.meta.title}`;
+    },
+    statusData() {
+      return this.$route.query.status;
+    },
+    id() {
+      return this.$route.query.id;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 69 - 0
src/views/adminCenter/ticket/status-2.vue

@@ -0,0 +1,69 @@
+<template>
+  <div id="status-2">
+    <data-table :fields="fields" :opera="opera" :data="list" :total="total" @query="search" @edit="toEdit"> </data-table>
+  </div>
+</template>
+
+<script>
+const moment = require('moment');
+const { ticketType } = require('@common/dict/index');
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: ticket } = createNamespacedHelpers('ticket');
+export default {
+  name: 'status-2',
+  props: {},
+  components: {},
+  data: function () {
+    return {
+      list: [],
+      total: 0,
+      opera: [
+        {
+          label: '审核',
+          method: 'edit',
+        },
+      ],
+      fields: [
+        { label: '企业', prop: 'name', filter: true },
+        { label: '申请时间', prop: 'meta.createdAt', format: (i) => moment(i).format('YYYY-MM-DD HH:mm:ss') },
+        {
+          label: '状态',
+          prop: 'status',
+          format: (i) => {
+            const r = ticketType.find((f) => f.value === i);
+            if (r) return r.label;
+            else return '';
+          },
+        },
+      ],
+    };
+  },
+  created() {
+    this.search();
+  },
+  methods: {
+    ...ticket(['query', 'delete']),
+    async search({ skip = 0, limit = 10, ...info } = {}) {
+      const res = await this.query({ skip, limit, ...info, status: '2' });
+      if (this.$checkRes(res)) {
+        this.$set(this, `list`, res.data);
+        this.$set(this, `total`, res.total);
+      }
+    },
+    toEdit({ data }) {
+      this.$router.push({ path: '/adminCenter/ticket/detail', query: { id: data._id, status: data.status } });
+    },
+  },
+  computed: {
+    ...mapState(['user', 'menuParams']),
+    pageTitle() {
+      return `${this.$route.meta.title}`;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 83 - 0
src/views/adminCenter/ticket/status.vue

@@ -0,0 +1,83 @@
+<template>
+  <div id="status">
+    <data-table v-if="!loading" :fields="fields" :opera="opera" :data="list" :total="total" @query="search" @edit="toEdit"> </data-table>
+  </div>
+</template>
+
+<script>
+const moment = require('moment');
+const { ticketType } = require('@common/dict/index');
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: ticket } = createNamespacedHelpers('ticket');
+export default {
+  name: 'status',
+  props: {},
+  components: {},
+  data: function () {
+    return {
+      list: [],
+      total: 0,
+      opera: [
+        {
+          label: '审核',
+          method: 'edit',
+          display: (i) => this.statusData != '1',
+        },
+      ],
+      fields: [
+        { label: '企业', prop: 'name', filter: true },
+        { label: '申请时间', prop: 'meta.createdAt', format: (i) => moment(i).format('YYYY-MM-DD HH:mm:ss') },
+        {
+          label: '状态',
+          prop: 'status',
+          format: (i) => {
+            const r = ticketType.find((f) => f.value === i);
+            if (r) return r.label;
+            else return '';
+          },
+        },
+      ],
+      loading: true,
+    };
+  },
+  created() {
+    this.search();
+  },
+  methods: {
+    ...ticket(['query', 'delete']),
+    async search({ skip = 0, limit = 10, ...info } = {}) {
+      const res = await this.query({ skip, limit, ...info, status: this.statusData });
+      if (this.$checkRes(res)) {
+        this.$set(this, `list`, res.data);
+        this.$set(this, `total`, res.total);
+      }
+      this.loading = false;
+    },
+    toEdit({ data }) {
+      this.$router.push({ path: '/adminCenter/ticket/detail', query: { id: data._id, status: data.status } });
+    },
+  },
+  computed: {
+    ...mapState(['user', 'menuParams']),
+    pageTitle() {
+      return `${this.$route.meta.title}`;
+    },
+    statusData() {
+      return this.$route.params.status;
+    },
+  },
+  watch: {
+    statusData: {
+      handler(val) {
+        this.loading = true;
+        this.search();
+      },
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 137 - 0
src/views/service/ticket.vue

@@ -0,0 +1,137 @@
+<template>
+  <div id="ticket">
+    <el-row>
+      <el-col :span="24" class="main">
+        <div class="w_1200">
+          <el-col :span="24" class="one">
+            <el-col :span="24" class="btn">
+              <el-button type="primary" size="mini" @click="back">返回</el-button>
+            </el-col>
+            <el-col :span="24" class="text">环南湖科创先导区双创服务平台-创新券服务</el-col>
+            <el-col :span="24" class="dwon">
+              <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>
+        </div>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+const _ = require('lodash');
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: ticket } = createNamespacedHelpers('ticket');
+export default {
+  name: 'ticket',
+  props: {},
+  components: {},
+  data: function () {
+    return {
+      form: {
+        qyfr: [],
+        yyzz: [],
+        qylr: [],
+      },
+      rules: {},
+    };
+  },
+  created() {},
+  methods: {
+    ...ticket(['create']),
+    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;
+          let res = await this.create(obj);
+          if (this.$checkRes(res)) {
+            this.$message({
+              message: '创新券服务申报成功,请耐心等待结果',
+              type: 'success',
+            });
+            // 去中台
+            this.$router.push({ path: '/adminCenter/homeIndex' });
+          }
+        } else {
+          console.log('error submit!!');
+          return false;
+        }
+      });
+    },
+    back() {
+      this.$router.push({ path: '/service/index' });
+    },
+    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;
+    },
+  },
+  computed: {
+    ...mapState(['user', 'menuParams']),
+    pageTitle() {
+      return `${this.$route.meta.title}`;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.main {
+  min-height: 500px;
+  margin: 10px 0;
+  .one {
+    min-height: 500px;
+    border-radius: 5px;
+    border: 1px solid #ccc;
+    padding: 0 10px;
+    .btn {
+      padding: 10px;
+      text-align: right;
+    }
+    .text {
+      font-size: 30px;
+      text-align: center;
+      margin: 0 0 10px 0;
+    }
+    .dwon {
+      padding: 10px;
+      border: 1px dashed #ccc;
+      border-radius: 5px;
+      .formBtn {
+        text-align: center;
+      }
+    }
+  }
+}
+</style>