Просмотр исходного кода

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

lrf402788946 4 лет назад
Родитель
Сommit
d8955c00a1

+ 7 - 0
src/router/index.js

@@ -277,6 +277,13 @@ const web = [
         meta: { title: '创新券信息查看' },
         component: () => import('../views/adminCenter/company/ticket/info.vue'),
       },
+      {
+        path: '/adminCenter/company/ticket/update',
+        name: 'company_ticket_update',
+        meta: { title: '创新券信息重申' },
+        component: () => import('../views/adminCenter/company/ticket/update.vue'),
+      },
+
       // 中介机构
       {
         path: '/adminCenter/inter/basic',

+ 2 - 2
src/views/adminCenter/company/policy/detail.vue

@@ -58,8 +58,8 @@
                 </el-form-item>
               </el-col>
               <el-col :span="24" class="formBtn" v-if="form.status == ''">
-                <el-button type="danger" size="mini" @click="back">取消注册</el-button>
-                <el-button type="primary" size="mini" @click="onSubmit('form')">提交注册</el-button>
+                <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>

+ 45 - 8
src/views/adminCenter/company/ticket/index.vue

@@ -5,19 +5,31 @@
         <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">
+              <el-tab-pane label="资质审中" name="0">
+                <data-table :fields="fields" :opera="opera" :data="list" :total="total" @view="toView" @edit="toEdit">
                   <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-tab-pane label="资质审查失败" name="-1">
+                <data-table :fields="fields" :opera="opera" :data="list" :total="total" @view="toView" @edit="toEdit"> </data-table>
+              </el-tab-pane>
+              <el-tab-pane label="企业准备订单" name="1">
+                <data-table :fields="fields" :opera="opera" :data="list" :total="total" @view="toView" @edit="toEdit"> </data-table>
+              </el-tab-pane>
+              <el-tab-pane label="信息资料审查中" name="2">
+                <data-table :fields="fields" :opera="opera" :data="list" :total="total" @view="toView" @edit="toEdit"> </data-table>
+              </el-tab-pane>
+              <el-tab-pane label="信息资料审查失败" name="-3"
+                ><data-table :fields="fields" :opera="opera" :data="list" :total="total" @view="toView" @edit="toEdit"> </data-table
+              ></el-tab-pane>
+              <el-tab-pane label="信息资料审查通过" name="3">
+                <data-table :fields="fields" :opera="opera" :data="list" :total="total" @view="toView" @edit="toEdit"> </data-table>
+              </el-tab-pane>
+              <el-tab-pane label="创新券领取成功" name="4">
+                <data-table :fields="fields" :opera="opera" :data="list" :total="total" @view="toView"> </data-table
+              ></el-tab-pane>
             </el-tabs>
           </el-col>
         </el-col>
@@ -44,10 +56,30 @@ export default {
           label: '查看',
           method: 'view',
         },
+        {
+          label: '编辑申请/上传合同',
+          method: 'edit',
+          display: (item) => {
+            return item.status == '-1' || item.status == '1' || item.status == '-3' || item.status == '3';
+          },
+        },
       ],
       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) => {
+            if (i == '0') return '资质审查中';
+            else if (i == '1') return '企业准备订单';
+            else if (i == '-1') return '资质审查失败';
+            else if (i == '2') return '信息资料审查中';
+            else if (i == '3') return '信息资料审查通过';
+            else if (i == '-3') return '信息资料审查失败';
+            else if (i == '4') return '创新券领取成功';
+          },
+        },
       ],
     };
   },
@@ -69,6 +101,7 @@ export default {
     // 选择tabs
     change(tab) {
       this.$set(this, `active`, tab.name);
+      this.search();
     },
     // 申领
     toAdd() {
@@ -78,6 +111,10 @@ export default {
     toView({ data }) {
       this.$router.push({ path: '/adminCenter/company/ticket/info', query: { id: data._id, status: data.status } });
     },
+    // 修改申请
+    toEdit({ data }) {
+      this.$router.push({ path: '/adminCenter/company/ticket/update', query: { id: data._id, status: data.status } });
+    },
   },
   computed: {
     ...mapState(['user']),

+ 23 - 7
src/views/adminCenter/company/ticket/info.vue

@@ -47,15 +47,21 @@
               </el-col>
             </el-col>
             <el-col :span="24" class="text">
-              <el-col :span="2" class="left"> 审核意见:</el-col>
+              <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>
+                {{ data.status }}
               </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 :span="24" class="left"> 审核意见:</el-col>
+              <el-col :span="24" class="right desc">
+                <el-timeline>
+                  <el-timeline-item v-for="(item, index) in descList" :key="index" :timestamp="item.create_time" placement="top">
+                    <el-card>
+                      <p>{{ item.desc }}</p>
+                    </el-card>
+                  </el-timeline-item>
+                </el-timeline>
               </el-col>
             </el-col>
           </el-col>
@@ -69,6 +75,7 @@
 const moment = require('moment');
 import { mapState, createNamespacedHelpers } from 'vuex';
 const { mapActions: ticket } = createNamespacedHelpers('ticket');
+
 export default {
   name: 'info',
   props: {},
@@ -77,18 +84,24 @@ export default {
     return {
       data: {},
       imgList: ['jpg', 'jpeg', 'png', 'bmp', 'gif'],
+      // 意见列表
+      descList: [],
     };
   },
   async created() {
     if (this.id) await this.search();
   },
   methods: {
-    ...ticket(['fetch']),
+    ...ticket(['fetch', 'record']),
     async search() {
-      const res = await this.fetch(this.id);
+      let res = await this.fetch(this.id);
       if (this.$checkRes(res)) {
         this.$set(this, `data`, res.data);
       }
+      res = await this.record({ ticket_id: this.id, status: this.status });
+      if (this.$checkRes(res)) {
+        this.$set(this, `descList`, res.data);
+      }
     },
     // 返回
     back() {
@@ -155,6 +168,9 @@ export default {
             border: 1px solid #ccc;
           }
         }
+        .desc {
+          margin: 10px 0 0 0;
+        }
       }
     }
   }

+ 350 - 0
src/views/adminCenter/company/ticket/update.vue

@@ -0,0 +1,350 @@
+<template>
+  <div id="update">
+    <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-col :span="24" class="name">
+                <el-form-item label="企业名称" prop="name">
+                  <el-input v-model="form.name" disabled></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="24" class="down_1">
+                <el-col :span="24" class="down_1text"><span>企业资质资料</span></el-col>
+                <el-col :span="24" class="file">
+                  <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-col>
+                <el-col :span="24" class="file">
+                  <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-col>
+                <el-col :span="24" class="file">
+                  <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>
+              </el-col>
+              <el-col :span="24" class="down_1" v-if="form.status != '-1'">
+                <el-col :span="24" class="down_1text"><span>企业准备订单</span></el-col>
+                <el-col :span="24" class="file">
+                  <el-form-item label="选择中介">
+                    <el-select v-model="form.mechanism_id" placeholder="">
+                      <el-option v-for="item in mechanismList" :key="item.id" :label="item.name" :value="item.id"> </el-option>
+                    </el-select>
+                  </el-form-item>
+                </el-col>
+                <el-col :span="24" class="file">
+                  <el-form-item label="法人复印件" prop="qyfr1">
+                    <e-upload url="/files/cysci/qyfr1_file/upload" :limit="1" v-model="form.qyfr1" type="text"></e-upload>
+                  </el-form-item>
+                </el-col>
+                <el-col :span="24" class="file">
+                  <el-form-item label="企业营业执照" prop="yyzz1">
+                    <e-upload url="/files/cysci/yyzz1_file/upload" :limit="1" v-model="form.yyzz1" type="text"></e-upload>
+                  </el-form-item>
+                </el-col>
+                <el-col :span="24" class="file">
+                  <el-form-item label="企业利润表" prop="qylr1">
+                    <e-upload url="/files/cysci/qylr1_file/upload" :limit="1" v-model="form.qylr1" type="text"></e-upload>
+                  </el-form-item>
+                </el-col>
+              </el-col>
+              <el-col :span="24" class="down_1" v-if="form.status == '3'">
+                <el-col :span="24" class="down_1text"><span>合同资料上传</span></el-col>
+                <el-col :span="24" class="file">
+                  <el-form-item label="上传合同" prop="contract">
+                    <e-upload
+                      url="/files/cysci/contract_file/upload"
+                      :limit="2"
+                      v-model="form.contract"
+                      type="text"
+                      :remove="fileRemove"
+                      :extra="{ user_id: user._id }"
+                    ></e-upload>
+                  </el-form-item>
+                </el-col>
+              </el-col>
+              <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');
+const { mapActions: mechanism } = createNamespacedHelpers('mechanism');
+export default {
+  name: 'update',
+  props: {},
+  components: {},
+  data: function () {
+    return {
+      form: {
+        qyfr: [],
+        yyzz: [],
+        qylr: [],
+        qyfr1: [],
+        yyzz1: [],
+        qylr1: [],
+      },
+      rules: {},
+      // 中介机构
+      mechanismList: [],
+    };
+  },
+  async created() {
+    await this.searchOther();
+    if (this.id) await this.search();
+  },
+  methods: {
+    ...ticket(['fetch', 'update']),
+    ...mechanism(['query']),
+    async search() {
+      let res = await this.fetch(this.id);
+      if (this.$checkRes(res)) {
+        res.data.qyfr = res.data.material.length > 0 ? [res.data.material[0]] : [];
+        res.data.yyzz = res.data.material.length > 0 ? [res.data.material[1]] : [];
+        res.data.qylr = res.data.material.length > 0 ? [res.data.material[2]] : [];
+        res.data.qyfr1 = res.data.medium_material.length > 0 ? [res.data.medium_material[0]] : [];
+        res.data.yyzz1 = res.data.medium_material.length > 0 ? [res.data.medium_material[1]] : [];
+        res.data.qylr1 = res.data.medium_material.length > 0 ? [res.data.medium_material[2]] : [];
+        this.$set(this, `form`, res.data);
+      }
+    },
+    onSubmit(formName) {
+      this.$refs[formName].validate(async (valid) => {
+        if (valid) {
+          if (this.status == '-1') {
+            this.oneSubmit();
+          } else if (this.status == '1') {
+            this.twoSubmit();
+          } else if (this.status == '-3') {
+            this.thrSubmit();
+          } else if (this.status == '3') {
+            this.fourSubmit();
+          }
+        } else {
+          console.log('error submit!!');
+          return false;
+        }
+      });
+    },
+    // 状态为-1时
+    async oneSubmit() {
+      const material = this.oneMap();
+      if (material.length < 3) {
+        this.$message.error('缺少所需资料');
+        return;
+      }
+      const data = this.form;
+      data.material = material;
+      data.status = '0';
+      let res = await this.update(data);
+      if (this.$checkRes(res)) {
+        this.$message({
+          message: '创新券重申成功,请耐心等待结果',
+          type: 'success',
+        });
+        this.back();
+      }
+    },
+    // 状态为1时
+    async twoSubmit() {
+      const material = this.oneMap();
+      const medium_material = this.twoMap();
+      if (material.length < 3) {
+        this.$message.error('缺少所需资料');
+        return;
+      }
+      if (medium_material.length < 3) {
+        this.$message.error('缺少所需资料');
+        return;
+      }
+      const data = this.form;
+      data.material = material;
+      data.medium_material = medium_material;
+      data.status = '2';
+      let res = await this.update(data);
+      if (this.$checkRes(res)) {
+        this.$message({
+          message: '创新券信息资料提交成功,请耐心等待结果',
+          type: 'success',
+        });
+        this.back();
+      }
+    },
+    // 状态为-3时
+    async thrSubmit() {
+      const material = this.oneMap();
+      const medium_material = this.twoMap();
+      if (material.length < 3) {
+        this.$message.error('缺少所需资料');
+        return;
+      }
+      if (medium_material.length < 3) {
+        this.$message.error('缺少所需资料');
+        return;
+      }
+      const data = this.form;
+      data.material = material;
+      data.medium_material = medium_material;
+      data.status = '2';
+      let res = await this.update(data);
+      if (this.$checkRes(res)) {
+        this.$message({
+          message: '创新券信息资料提交成功,请耐心等待结果',
+          type: 'success',
+        });
+        this.back();
+      }
+    },
+    // 状态为3时
+    async fourSubmit() {
+      const material = this.oneMap();
+      const medium_material = this.twoMap();
+      if (material.length < 3) {
+        this.$message.error('缺少所需资料');
+        return;
+      }
+      if (medium_material.length < 3) {
+        this.$message.error('缺少所需资料');
+        return;
+      }
+      const data = this.form;
+      data.material = material;
+      data.medium_material = medium_material;
+      data.status = '3';
+      let res = await this.update(data);
+      if (this.$checkRes(res)) {
+        this.$message({
+          message: '创新券合同资料提交成功,请耐心等待结果',
+          type: 'success',
+        });
+        this.back();
+      }
+    },
+    oneMap() {
+      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;
+    },
+    twoMap() {
+      let data = _.cloneDeep(this.form);
+      const arr = ['qyfr1', 'yyzz1', 'qylr1'];
+      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' });
+    },
+    // 查询其他
+    async searchOther() {
+      let res = await this.query();
+      if (this.$checkRes(res)) {
+        this.$set(this, `mechanismList`, res.data);
+      }
+    },
+    // 删除合同之前判断
+    fileRemove(file) {
+      if (file.user_id === this.user._id) {
+        return { result: true };
+      } else {
+        return { result: false, msg: '不允许删除自己上传以外的合同' };
+      }
+    },
+  },
+  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 {
+      .name {
+        border-bottom: 1px dashed #ccc;
+        margin: 0 0 10px 0;
+      }
+      .down_1 {
+        border-bottom: 1px dashed #ccc;
+        margin: 0 0 10px 0;
+        .down_1text {
+          font-weight: bold;
+          margin: 0 0 10px 0;
+          span {
+            display: inline-block;
+            background-color: #242f42;
+            color: #fff;
+            padding: 8px;
+            border-radius: 10px;
+          }
+        }
+        .file {
+          border: 1px dashed #ccc;
+          padding: 10px 50% 10px 0;
+        }
+      }
+      .formBtn {
+        text-align: center;
+      }
+    }
+  }
+}
+.main:hover {
+  box-shadow: 0 0 5px #409eff;
+}
+</style>