guhongwei пре 4 година
родитељ
комит
747a33fa48

+ 12 - 0
src/router/index.js

@@ -253,6 +253,18 @@ const web = [
         meta: { title: '创新券申领管理' },
         component: () => import('../views/adminCenter/policy/apply.vue'),
       },
+      {
+        path: '/adminCenter/policy/apply_check',
+        name: 'admin_policy_apply_check',
+        meta: { title: '创新券申领审核管理' },
+        component: () => import('../views/adminCenter/policy/apply_check.vue'),
+      },
+      {
+        path: '/adminCenter/policy/apply_info',
+        name: 'admin_policy_apply_info',
+        meta: { title: '创新券申领审核结果查看' },
+        component: () => import('../views/adminCenter/policy/apply_info.vue'),
+      },
       {
         path: '/adminCenter/ticket',
         name: 'admin_ticket',

+ 43 - 5
src/views/adminCenter/policy/apply.vue

@@ -3,7 +3,7 @@
     <el-row>
       <el-col :span="24" class="main">
         <el-col :span="24" class="one">
-          <data-table :fields="fields" :opera="opera" :data="list" :total="total" @query="search"> </data-table>
+          <data-table :fields="fields" :opera="opera" :data="list" :total="total" @query="search" @check="toCheck" @view="toView"> </data-table>
         </el-col>
       </el-col>
     </el-row>
@@ -11,8 +11,9 @@
 </template>
 
 <script>
+const { policyStatus } = require('@common/dict/index');
 import { mapState, createNamespacedHelpers } from 'vuex';
-const { mapActions: policy } = createNamespacedHelpers('policy');
+const { mapActions: policyApply } = createNamespacedHelpers('policyApply');
 export default {
   name: 'list',
   props: {},
@@ -21,15 +22,44 @@ export default {
     return {
       list: [],
       total: 0,
-      opera: [],
-      fields: [{ label: '创新券类型', prop: 'type' }],
+      opera: [
+        {
+          label: '审核',
+          method: 'check',
+          display: (item) => {
+            return item.status == '0';
+          },
+        },
+        {
+          label: '查看',
+          method: 'view',
+          display: (item) => {
+            return item.status == '1' || item.status == '2';
+          },
+        },
+      ],
+      fields: [
+        { label: '所属创新券', prop: 'policy.name' },
+        { label: '申领企业', prop: 'company', filter: 'input' },
+        { label: '联系人', prop: 'apply_personal' },
+        { label: '联系电话', prop: 'phone' },
+        {
+          label: '审核状态',
+          prop: 'status',
+          format: (i) => {
+            const r = policyStatus.find((f) => f.value === i);
+            if (r) return r.label;
+            else return '';
+          },
+        },
+      ],
     };
   },
   created() {
     this.search();
   },
   methods: {
-    ...policy(['query', 'update']),
+    ...policyApply(['query', 'update']),
     async search({ skip = 0, limit = 10, ...info } = {}) {
       const res = await this.query({ skip, limit, ...info });
       if (this.$checkRes(res)) {
@@ -37,6 +67,14 @@ export default {
         this.$set(this, `total`, res.total);
       }
     },
+    // 审核
+    toCheck({ data }) {
+      this.$router.push({ path: '/adminCenter/policy/apply_check', query: { id: data._id } });
+    },
+    // 查看
+    toView({ data }) {
+      this.$router.push({ path: '/adminCenter/policy/apply_info', query: { id: data._id } });
+    },
   },
   computed: {
     ...mapState(['user']),

+ 210 - 0
src/views/adminCenter/policy/apply_check.vue

@@ -0,0 +1,210 @@
+<template>
+  <div id="apply_check">
+    <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" ref="form" label-width="100px">
+              <el-col :span="24" class="text">
+                <el-col :span="2" class="left"> 所属创新券</el-col>
+                <el-col :span="22" class="right">
+                  {{ form.policy.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">
+                  {{ form.company }}
+                </el-col>
+              </el-col>
+              <el-col :span="24" class="text">
+                <el-col :span="2" class="left"> 申请人</el-col>
+                <el-col :span="22" class="right">
+                  {{ form.apply_personal }}
+                </el-col>
+              </el-col>
+              <el-col :span="24" class="text">
+                <el-col :span="2" class="left"> 联系电话</el-col>
+                <el-col :span="22" class="right">
+                  {{ form.phone }}
+                </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 form.qyfr" :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-view"></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 form.yyzz" :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-view"></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 form.qylr" :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-view"></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-radio-group v-model="form.status">
+                    <el-radio v-for="(i, index) in statusList" :key="`status-${index}`" :label="i.value">{{ i.label }}</el-radio>
+                  </el-radio-group>
+                </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="form.desc" type="textarea" maxlength="300" :autosize="{ minRows: 4, maxRows: 6 }" show-word-limit></el-input>
+                </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');
+const moment = require('moment');
+const { policyStatus } = require('@common/dict/index');
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: policyApply } = createNamespacedHelpers('policyApply');
+export default {
+  name: 'apply_check',
+  props: {},
+  components: {},
+  data: function () {
+    return {
+      form: {
+        policy: {},
+      },
+      imgList: ['jpg', 'jpeg', 'png', 'bmp', 'gif'],
+      statusList: policyStatus,
+    };
+  },
+  created() {
+    if (this.id) this.search();
+  },
+  methods: {
+    ...policyApply(['fetch', 'update']),
+    async search() {
+      let res = await this.fetch(this.id);
+      if (this.$checkRes(res)) {
+        this.$set(this, `form`, res.data);
+      }
+    },
+    onSubmit(formName) {
+      this.$refs[formName].validate(async (valid) => {
+        if (valid) {
+          let data = this.form;
+          let newRecord = this.getRecord(data);
+          data.record = data.record.concat(newRecord);
+          let res = await this.update(data);
+          if (this.$checkRes(res)) {
+            this.$message({
+              message: '创新券申领审核成功',
+              type: 'success',
+            });
+            this.back();
+          }
+        } else {
+          console.log('error submit!!');
+          return false;
+        }
+      });
+    },
+    // 审核列表整合
+    getRecord(data) {
+      let arr = [{ status: data.status, desc: data.desc, desc_time: moment().format('YYYY-MM-DD HH:mm:ss') }];
+      return arr;
+    },
+    back() {
+      this.$router.push({ path: '/adminCenter/policy/apply' });
+    },
+    isImg(url) {
+      const arr = url.split('.');
+      const suffix = _.last(arr);
+      return this.imgList.includes(suffix);
+    },
+    toOpen(url) {
+      window.open(url);
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+    id() {
+      return this.$route.query.id;
+    },
+  },
+  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;
+  .top {
+    text-align: right;
+    margin: 0 0 10px 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;
+        }
+      }
+      .desc {
+        margin: 10px 0 0 0;
+      }
+    }
+    .formBtn {
+      text-align: center;
+      padding: 10px 0;
+    }
+  }
+}
+.main:hover {
+  box-shadow: 0 0 5px #409eff;
+}
+</style>

+ 190 - 0
src/views/adminCenter/policy/apply_info.vue

@@ -0,0 +1,190 @@
+<template>
+  <div id="apply_check">
+    <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" ref="form" label-width="100px">
+              <el-col :span="24" class="text">
+                <el-col :span="2" class="left"> 所属创新券</el-col>
+                <el-col :span="22" class="right">
+                  {{ form.policy.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">
+                  {{ form.company }}
+                </el-col>
+              </el-col>
+              <el-col :span="24" class="text">
+                <el-col :span="2" class="left"> 申请人</el-col>
+                <el-col :span="22" class="right">
+                  {{ form.apply_personal }}
+                </el-col>
+              </el-col>
+              <el-col :span="24" class="text">
+                <el-col :span="2" class="left"> 联系电话</el-col>
+                <el-col :span="22" class="right">
+                  {{ form.phone }}
+                </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 form.qyfr" :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-view"></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 form.yyzz" :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-view"></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 form.qylr" :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-view"></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">
+                  {{ getStatus(form.status) }}
+                </el-col>
+              </el-col>
+              <el-col :span="24" class="text">
+                <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 form.record" :key="index" :timestamp="item.desc_time" placement="top">
+                      <el-card>
+                        <p>审核状态:{{ getStatus(item.status) || '暂无' }}</p>
+                        <p>审核意见:{{ item.desc || '暂无' }}</p>
+                      </el-card>
+                    </el-timeline-item>
+                  </el-timeline>
+                </el-col>
+              </el-col>
+            </el-form>
+          </el-col>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+const _ = require('lodash');
+const moment = require('moment');
+const { policyStatus } = require('@common/dict/index');
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: policyApply } = createNamespacedHelpers('policyApply');
+export default {
+  name: 'apply_check',
+  props: {},
+  components: {},
+  data: function () {
+    return {
+      form: {
+        policy: {},
+      },
+      imgList: ['jpg', 'jpeg', 'png', 'bmp', 'gif'],
+    };
+  },
+  created() {
+    if (this.id) this.search();
+  },
+  methods: {
+    ...policyApply(['fetch', 'update']),
+    async search() {
+      let res = await this.fetch(this.id);
+      if (this.$checkRes(res)) {
+        this.$set(this, `form`, res.data);
+      }
+    },
+    back() {
+      this.$router.push({ path: '/adminCenter/policy/apply' });
+    },
+    isImg(url) {
+      const arr = url.split('.');
+      const suffix = _.last(arr);
+      return this.imgList.includes(suffix);
+    },
+    toOpen(url) {
+      window.open(url);
+    },
+    getStatus(i) {
+      const r = policyStatus.find((f) => f.value === i);
+      console.log(r);
+      if (r) return r.label;
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+    id() {
+      return this.$route.query.id;
+    },
+  },
+  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;
+  .top {
+    text-align: right;
+    margin: 0 0 10px 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;
+        }
+      }
+      .desc {
+        margin: 10px 0 0 0;
+      }
+    }
+    .formBtn {
+      text-align: center;
+      padding: 10px 0;
+    }
+  }
+}
+.main:hover {
+  box-shadow: 0 0 5px #409eff;
+}
+</style>

+ 3 - 1
src/views/adminCenter/policy/create.vue

@@ -48,7 +48,7 @@
                 </el-form-item>
               </el-col>
               <el-col :span="12" class="text">
-                <el-form-item label="补贴比例" prop="scale">
+                <el-form-item label="抵扣比例" prop="scale">
                   <el-input v-model="form.scale" style="width: 96%"></el-input>
                   <span style="padding: 0 5px">%</span>
                 </el-form-item>
@@ -108,6 +108,7 @@ export default {
     };
   },
   created() {
+    console.log(this.user);
     if (this.id) this.search();
   },
   methods: {
@@ -122,6 +123,7 @@ export default {
       this.$refs[formName].validate(async (valid) => {
         if (valid) {
           let data = this.form;
+          data.user_id = this.user.id;
           if (this.id) {
             let res = await this.update(data);
             if (this.$checkRes(res)) {