guhongwei 3 years ago
parent
commit
4bb2640fc9

+ 63 - 0
src/plugins/couindex.js

@@ -0,0 +1,63 @@
+// 创新券
+// 类型
+export const couponsType = ['科技创新券', '研发补贴', '奖励兑现'];
+// 折扣类型
+export const discounTtype = ['全额折扣券', '折扣券', '定额券'];
+// 适用服务类型
+export const useType = ['服务类型1', '服务类型2', '服务类型3'];
+// 所属分类
+export const classify = ['分类1', '分类2', '分类3'];
+// 状态
+export const couponsStatus = [
+  { label: '待上架', value: '0' },
+  { label: '上架', value: '1' },
+  { label: '下架', value: '-1' },
+];
+// 创新券申领
+// 状态
+export const couponsapplyStatus = [
+  { label: '待审中', value: '0' },
+  { label: '通过', value: '1' },
+  { label: '拒绝', value: '-1' },
+];
+// 是否使用
+export const isuse = [
+  { label: '未使用', value: '0' },
+  { label: '已使用', value: '1' },
+];
+// 高企申报
+// 是否使用
+export const iscashing = [
+  { label: '未兑付', value: '0' },
+  { label: '已兑付', value: '1' },
+  // { label: '已兑付', value: '2' },
+];
+// 状态
+export const declareStatus = [
+  { label: '企业信息审核审核中', value: '0' },
+  { label: '企业信息审核拒绝', value: '-1' },
+  { label: '上传合同', value: '1' },
+  { label: '上传合同', value: '2' },
+  { label: '高企申报成功', value: '3' },
+];
+// 状态
+export const declareapplyStatus = [
+  { label: '待审中', value: '0' },
+  { label: '通过', value: '1' },
+  { label: '拒绝', value: '-1' },
+];
+// 研发补贴,奖励兑现
+// 状态
+export const rewardStatus = [
+  { label: '待审中', value: '0' },
+  { label: '通过', value: '1' },
+  { label: '拒绝', value: '-1' },
+];
+
+// 兑付
+// 状态
+export const cashStatus = [
+  { label: '待审中', value: '0' },
+  { label: '通过', value: '1' },
+  { label: '拒绝', value: '-1' },
+];

+ 7 - 1
src/router/index.js

@@ -41,7 +41,7 @@ const web = [
   {
     path: '/cashing/quota/detail',
     name: 'cashing_quota_detail',
-    meta: { title: '我的额度' },
+    meta: { title: '我的额度-详情' },
     component: () => import('../views/cashing/quota-detail.vue'),
   },
   {
@@ -50,6 +50,12 @@ const web = [
     meta: { title: '我的订单' },
     component: () => import('../views/cashing/order.vue'),
   },
+  {
+    path: '/cashing/order/detail',
+    name: 'cashing_order_detail',
+    meta: { title: '我的订单-详情' },
+    component: () => import('../views/cashing/order-detail.vue'),
+  },
   {
     path: '/service/unscramble',
     name: 'service_unscramble',

+ 166 - 0
src/views/cashing/order-detail.vue

@@ -0,0 +1,166 @@
+<template>
+  <div id="detail">
+    <el-row>
+      <el-col :span="24" class="main">
+        <el-col :span="24" class="top">
+          <top topType="2" @back="back"></top>
+        </el-col>
+        <el-col :span="24" class="info" :style="{ height: clientHeight + 'px' }">
+          <van-cell title="申请单位" :value="getWord(form, 'company')" />
+          <van-cell title="申请人" :value="getWord(form, 'apply_person')" />
+          <van-cell title="联系电话" :value="getWord(form, 'phone')" />
+          <van-cell title="订单金额(元)" :value="getWord(form, 'money')" />
+          <van-cell title="券抵扣金额" :value="getWord(form, 'allowance')" />
+          <van-cell title="应收金额" :value="getWord(form, 'total')" />
+          <van-cell title="最后提交时间" :value="getWord(form, 'create_time')" />
+          <van-cell title="最后审核时间" :value="getWord(form, 'end_time')" />
+          <van-cell title="审核状态" :value="getWord(form, 'status')" />
+          <van-cell title="所用创新券" :value="getWord(form, 'coupons_id')" />
+          <van-col span="24" class="btn" v-if="form.status == '通过'">
+            <van-button type="info" size="small" @click="view">查看审核意见</van-button>
+          </van-col>
+        </el-col>
+      </el-col>
+    </el-row>
+    <van-dialog v-model="show" title="审核意见" :showConfirmButton="false" :closeOnClickOverlay="true">
+      <van-col span="24" class="show">
+        <van-col span="24" class="list" v-for="(item, index) in form.record" :key="index">
+          <p>{{ index + 1 }}--{{ item.desc_time }}</p>
+          <p>
+            审核状态:<span>{{ searchStu(item.status) }}</span>
+          </p>
+          <p>
+            审核意见:<span>{{ item.desc || '暂无' }}</span>
+          </p>
+        </van-col>
+      </van-col>
+    </van-dialog>
+  </div>
+</template>
+
+<script>
+const _ = require('lodash');
+import top from '@/layout/common/top.vue';
+const { cashStatus } = require('@/plugins/couindex');
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: cashing } = createNamespacedHelpers('cashing');
+const { mapActions: coupons } = createNamespacedHelpers('coupons');
+export default {
+  name: 'detail',
+  props: {},
+  components: {
+    top,
+  },
+  data: function () {
+    return {
+      clientHeight: '',
+      form: {},
+      show: false,
+    };
+  },
+  async created() {
+    if (this.id) await this.search();
+  },
+  methods: {
+    ...cashing(['fetch']),
+    ...coupons({ couponsFetch: 'fetch' }),
+    async search() {
+      let res = await this.fetch(this.id);
+      if (this.$checkRes(res)) {
+        this.searchCoupons(res.data);
+        this.$set(this, `form`, res.data);
+      }
+    },
+    async searchCoupons(data) {
+      if (data.coupons_id) {
+        let res = await this.couponsFetch(data.coupons_id);
+        if (this.$checkRes(res)) {
+          data.coupons_id = res.data.name;
+        }
+      }
+    },
+    getWord(data, model) {
+      if (model == 'status') {
+        let status = cashStatus.find((i) => i.value == data.status);
+        if (status) data.status = status.label;
+        return _.get(data, model, '暂无');
+      } else {
+        return _.get(data, model, '暂无');
+      }
+    },
+    // 查看意见
+    view() {
+      this.show = true;
+    },
+    searchStu(i) {
+      const r = cashStatus.find((f) => f.value === i);
+      if (r) return r.label;
+    },
+    // 返回
+    back() {
+      this.$router.push({ path: '/cashing/order' });
+    },
+  },
+  mounted() {
+    let clientHeight = (document.documentElement.clientHeight || document.body.clientHeight) - 40;
+    this.$set(this, `clientHeight`, clientHeight);
+  },
+  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 {
+  .top {
+    height: 40px;
+    overflow: hidden;
+    border-bottom: 1px solid #f9f9f9;
+  }
+  .info {
+    overflow-x: hidden;
+    overflow-y: auto;
+    .btn {
+      text-align: center;
+      margin: 10px 0;
+      .van-button {
+        margin: 0 10px;
+      }
+    }
+  }
+}
+.show {
+  padding: 10px;
+  .list {
+    border-bottom: 1px solid #ccc;
+    padding: 0 0 8px 0;
+    margin: 0 0 8px 0;
+    p {
+      font-size: 14px;
+    }
+    p:nth-child(1) {
+      font-size: 16px;
+      font-weight: bold;
+      margin: 0 0 5px 0;
+    }
+  }
+}
+/deep/.van-dialog {
+  height: 400px;
+  overflow-y: auto;
+}
+</style>

+ 12 - 3
src/views/cashing/order.vue

@@ -8,7 +8,9 @@
         <el-col :span="24" class="info" :style="{ height: clientHeight + 'px' }">
           <order-list :list="list"></order-list>
         </el-col>
-        <page :limit="limit" :total="total" @search="search" />
+        <el-col :span="24" class="page">
+          <page :limit="limit" :total="total" @search="search" />
+        </el-col>
         <el-col :span="24" class="foot">
           <foot :type="1"></foot>
         </el-col>
@@ -45,12 +47,13 @@ export default {
     await this.search();
   },
   mounted() {
-    let clientHeight = (document.documentElement.clientHeight || document.body.clientHeight) - 135;
+    let clientHeight = (document.documentElement.clientHeight || document.body.clientHeight) - 130;
     this.$set(this, `clientHeight`, clientHeight);
   },
   methods: {
     ...cashing(['query']),
     async search({ skip = 0, limit = this.limit, ...info } = {}) {
+      info.user_id = this.user._id;
       let res = await this.query({ skip, limit, ...info }); //, user_id: this.user._id
       if (this.$checkRes(res)) {
         this.$set(this, `list`, res.data);
@@ -84,10 +87,16 @@ export default {
   .info {
     overflow-x: hidden;
     overflow-y: auto;
+    background: #f9f9f9;
+    padding: 5px;
   }
-  .foot {
+  .page {
     height: 40px;
     overflow: hidden;
+  }
+  .foot {
+    height: 50px;
+    overflow: hidden;
     border-top: 1px solid #f1f1f1;
   }
 }

+ 23 - 11
src/views/cashing/parts/order-list.vue

@@ -5,20 +5,23 @@
         <el-col :span="24" class="one">
           <el-col :span="24" class="list" v-for="(item, index) in list" :key="index">
             <el-col :span="24" class="name">
-              {{ item.name }}
+              订单号:<span>{{ getWord(item, 'no') }}</span>
             </el-col>
             <el-col :span="24" class="other">
-              <el-col :span="24" class="other_info textOver">
-                订单号:<span>{{ getWord(item, 'no') }}</span>
+              <el-col :span="12" class="other_info textOver">
+                订单金额:<span>{{ getWord(item, 'money') }}元</span>
               </el-col>
-              <el-col :span="24" class="other_info textOver">
-                联系电话:<span>{{ getWord(item, 'phone') }}</span>
+              <el-col :span="12" class="other_info textOver">
+                券抵扣金额:<span>{{ getWord(item, 'allowance') }}元</span>
               </el-col>
-              <el-col :span="24" class="other_info textOver">
-                应收金额:<span>{{ getWord(item, 'money') }}</span>
+              <el-col :span="12" class="other_info textOver">
+                应收金额:<span style="color: #ff0000; font-weight: bold">{{ getWord(item, 'total') }}元</span>
+              </el-col>
+              <el-col :span="12" class="other_info textOver">
+                兑付状态:<span>{{ getWord(item, 'status') }}</span>
               </el-col>
               <el-col :span="24" class="other_info textOver">
-                最后审核时间:<span>{{ getWord(item, 'end_time') }}</span>
+                最后审核时间<span>{{ getWord(item, 'end_time') }}</span>
               </el-col>
             </el-col>
             <el-col :span="24" class="btn">
@@ -33,6 +36,7 @@
 
 <script>
 const _ = require('lodash');
+const { cashStatus } = require('@/plugins/couindex');
 import { mapState, createNamespacedHelpers } from 'vuex';
 export default {
   name: 'list',
@@ -46,11 +50,16 @@ export default {
   created() {},
   methods: {
     getWord(data, model) {
-      return _.get(data, model, '暂无');
+      if (model == 'status') {
+        let status = cashStatus.find((i) => i.value == data.status);
+        if (status) data.status = status.label;
+        return _.get(data, model, '暂无');
+      } else {
+        return _.get(data, model, '暂无');
+      }
     },
     detail(data) {
-      console.log(data);
-      this.$router.push({ path: '/cashing/quota/detail', query: { id: data.id } });
+      this.$router.push({ path: '/cashing/order/detail', query: { id: data.id } });
     },
   },
   computed: {
@@ -81,6 +90,9 @@ export default {
         font-size: 16px;
         font-weight: bold;
         margin: 0 0 5px 0;
+        span {
+          color: #ff0000;
+        }
       }
       .other {
         margin: 0 0 5px 0;

+ 26 - 7
src/views/cashing/parts/list.vue

@@ -5,20 +5,26 @@
         <el-col :span="24" class="one">
           <el-col :span="24" class="list" v-for="(item, index) in list" :key="index">
             <el-col :span="24" class="name">
-              {{ item.name }}
+              {{ getWord(item, 'coupons.name') }}
             </el-col>
             <el-col :span="24" class="other">
               <el-col :span="12" class="other_info textOver">
-                券类型:<span>{{ getWord(item, 'coupons.coupons_type') }}</span>
+                券类型<span>{{ getWord(item, 'coupons.coupons_type') }}</span>
               </el-col>
               <el-col :span="12" class="other_info textOver">
-                折扣类型:<span>{{ getWord(item, 'coupons.discount_type') }}</span>
+                适用服务类型:<span>{{ getWord(item, 'coupons.use_type') }}</span>
               </el-col>
               <el-col :span="12" class="other_info textOver">
-                适用类型:<span>{{ getWord(item, 'coupons.use_type') }}</span>
+                申领金额:<span>{{ getWord(item, 'apply_money') }}元</span>
               </el-col>
               <el-col :span="12" class="other_info textOver">
-                所属分类:<span>{{ getWord(item, 'coupons.classify') }}</span>
+                实际申领金额:<span>{{ getWord(item, 'actual_money') }}元</span>
+              </el-col>
+              <el-col :span="12" class="other_info textOver">
+                审核状态:<span>{{ getWord(item, 'status') }}</span>
+              </el-col>
+              <el-col :span="12" class="other_info textOver">
+                是否使用:<span>{{ getWord(item, 'is_use') }}</span>
               </el-col>
             </el-col>
             <el-col :span="24" class="btn">
@@ -33,6 +39,7 @@
 
 <script>
 const _ = require('lodash');
+const { isuse, couponsapplyStatus } = require('@/plugins/couindex');
 import { mapState, createNamespacedHelpers } from 'vuex';
 export default {
   name: 'list',
@@ -46,10 +53,19 @@ export default {
   created() {},
   methods: {
     getWord(data, model) {
-      return _.get(data, model, '暂无');
+      if (model == 'status') {
+        let status = couponsapplyStatus.find((i) => i.value == data.status);
+        if (status) data.status = status.label;
+        return _.get(data, model, '暂无');
+      } else if (model == 'is_use') {
+        let use = isuse.find((i) => i.value == data.is_use);
+        if (use) data.is_use = use.label;
+        return _.get(data, model, '暂无');
+      } else {
+        return _.get(data, model, '暂无');
+      }
     },
     detail(data) {
-      console.log(data);
       this.$router.push({ path: '/cashing/quota/detail', query: { id: data.id } });
     },
   },
@@ -100,6 +116,9 @@ export default {
         }
       }
     }
+    .list:last-child {
+      margin: 0;
+    }
   }
 }
 </style>

+ 92 - 41
src/views/cashing/quota-detail.vue

@@ -1,24 +1,36 @@
 <template>
-  <div id="quotaDetail">
+  <div id="detail">
     <el-row>
       <el-col :span="24" class="main">
-        <el-col :span="24" class="one">
-          <el-image :src="coupons"></el-image>
+        <el-col :span="24" class="top">
+          <top topType="2" @back="back"></top>
         </el-col>
-        <el-col :span="24" class="two">
-          <van-cell title="创新券类型" :value="getWord(form, 'coupons.coupons_type')" />
-          <van-cell title="创新券名称" :value="getWord(form, 'coupons.name')" />
-          <van-cell title="折扣类型" :value="getWord(form, 'coupons.discount_type')" />
-          <van-cell title="抵扣比例" :value="getWord(form, 'coupons.scale') + '%'" v-if="form.coupons && form.coupons.discount_type == '折扣券'" />
-          <van-cell title="面额" :value="getWord(form, 'coupons.allowance') + '元'" v-if="form.coupons && form.coupons.discount_type == '定额券'" />
-          <van-cell title="适用服务类型" :value="getWord(form, 'coupons.use_type')" />
-          <van-cell title="所属分类" :value="getWord(form, 'coupons.classify')" />
-          <van-cell title="券总额度" :value="getWord(form, 'coupons.total_allowance') + '元'" />
-          <van-cell title="使用期限" :value="getWord(form, 'coupons.limit_time') + '个月'" />
-          <van-swipe-cell class="desc">
-            <p>描述:</p>
-            <p>{{ getWord(form, 'coupons.desc') || '暂无' }}</p>
-          </van-swipe-cell>
+        <el-col :span="24" class="info" :style="{ height: clientHeight + 'px' }">
+          <el-col :span="24" class="one">
+            <el-image :src="coupons"></el-image>
+          </el-col>
+          <el-col :span="24" class="two">
+            <van-cell title="申请单位" :value="getWord(form, 'company')" />
+            <van-cell title="申请人" :value="getWord(form, 'apply_person')" />
+            <van-cell title="联系电话" :value="getWord(form, 'phone')" />
+            <van-cell title="申领金额" :value="getWord(form, 'apply_money')" />
+            <van-cell title="实际申领金额" :value="getWord(form, 'actual_money')" />
+            <van-cell title="创新券类型" :value="getWord(form, 'coupons.coupons_type')" />
+            <van-cell title="创新券名称" :value="getWord(form, 'coupons.name')" />
+            <van-cell title="折扣类型" :value="getWord(form, 'coupons.discount_type')" />
+            <van-cell title="抵扣比例" :value="getWord(form, 'coupons.scale') + '%'" v-if="form.coupons && form.coupons.discount_type == '折扣券'" />
+            <van-cell title="面额" :value="getWord(form, 'coupons.allowance') + '元'" v-if="form.coupons && form.coupons.discount_type == '定额券'" />
+            <van-cell title="适用服务类型" :value="getWord(form, 'coupons.use_type')" />
+            <van-cell title="所属分类" :value="getWord(form, 'coupons.classify')" />
+            <van-cell title="券总额度" :value="getWord(form, 'coupons.total_allowance') + '元'" />
+            <van-cell title="使用期限" :value="getWord(form, 'coupons.limit_time') + '个月'" />
+            <van-cell title="是否使用" :value="getWord(form, 'is_use')" />
+            <van-cell title="审核状态" :value="getWord(form, 'status')" />
+            <van-swipe-cell class="desc">
+              <p>描述:</p>
+              <p>{{ getWord(form, 'coupons.desc') || '暂无' }}</p>
+            </van-swipe-cell>
+          </el-col>
         </el-col>
       </el-col>
     </el-row>
@@ -26,21 +38,26 @@
 </template>
 
 <script>
+import top from '@/layout/common/top.vue';
 const _ = require('lodash');
+const { isuse, couponsapplyStatus } = require('@/plugins/couindex');
 import { mapState, createNamespacedHelpers } from 'vuex';
 const { mapActions: couponsApply } = createNamespacedHelpers('couponsApply');
 export default {
-  name: 'quotaDetail',
+  name: 'index',
   props: {},
-  components: {},
+  components: {
+    top,
+  },
   data: function () {
     return {
+      clientHeight: '',
       coupons: require('@a/coupons.jpg'),
       form: {},
     };
   },
-  created() {
-    this.search();
+  async created() {
+    if (this.id) await this.search();
   },
   methods: {
     ...couponsApply(['fetch']),
@@ -51,9 +68,27 @@ export default {
       }
     },
     getWord(data, model) {
-      return _.get(data, model, '');
+      if (model == 'status') {
+        let status = couponsapplyStatus.find((i) => i.value == data.status);
+        if (status) data.status = status.label;
+        return _.get(data, model, '暂无');
+      } else if (model == 'is_use') {
+        let use = isuse.find((i) => i.value == data.is_use);
+        if (use) data.is_use = use.label;
+        return _.get(data, model, '暂无');
+      } else {
+        return _.get(data, model, '暂无');
+      }
+    },
+    // 返回
+    back() {
+      this.$router.push({ path: '/cashing/quota' });
     },
   },
+  mounted() {
+    let clientHeight = (document.documentElement.clientHeight || document.body.clientHeight) - 40;
+    this.$set(this, `clientHeight`, clientHeight);
+  },
   computed: {
     ...mapState(['user']),
     id() {
@@ -63,32 +98,48 @@ export default {
   metaInfo() {
     return { title: this.$route.meta.title };
   },
+  watch: {
+    id: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
 };
 </script>
 
 <style lang="less" scoped>
 .main {
-  .one {
-    margin: 0 0 5px 0;
-    .el-image {
-      width: 100%;
-      height: 180px;
-      /deep/.el-image__inner {
-        border-radius: 8px;
-      }
-    }
+  .top {
+    height: 40px;
+    overflow: hidden;
+    border-bottom: 1px solid #f9f9f9;
   }
-  .two {
-    .desc {
-      background-color: #fff;
-      padding: 10px 15px;
-      font-size: 14px;
-      p:nth-child(1) {
-        margin: 0 0 5px 0;
+  .info {
+    overflow-x: hidden;
+    overflow-y: auto;
+    .one {
+      margin: 0 0 5px 0;
+      .el-image {
+        width: 100%;
+        height: 180px;
+        /deep/.el-image__inner {
+          border-radius: 8px;
+        }
       }
-      p:nth-child(2) {
-        text-indent: 1rem;
-        color: #969799;
+    }
+    .two {
+      .desc {
+        background-color: #fff;
+        padding: 10px 15px;
+        font-size: 14px;
+        p:nth-child(1) {
+          margin: 0 0 5px 0;
+        }
+        p:nth-child(2) {
+          text-indent: 1rem;
+          color: #969799;
+        }
       }
     }
   }

+ 10 - 4
src/views/cashing/quota.vue

@@ -8,7 +8,9 @@
         <el-col :span="24" class="info" :style="{ height: clientHeight + 'px' }">
           <coupons-list :list="list"></coupons-list>
         </el-col>
-        <page :limit="limit" :total="total" @search="search" />
+        <el-col :span="24" class="page">
+          <page :limit="limit" :total="total" @search="search" />
+        </el-col>
         <el-col :span="24" class="foot">
           <foot :type="1"></foot>
         </el-col>
@@ -30,7 +32,7 @@ export default {
     top,
     foot,
     page,
-    couponsList: () => import('./parts/list.vue'),
+    couponsList: () => import('./parts/quota-list.vue'),
   },
   data: function () {
     return {
@@ -44,7 +46,7 @@ export default {
     this.search();
   },
   mounted() {
-    let clientHeight = (document.documentElement.clientHeight || document.body.clientHeight) - 135;
+    let clientHeight = (document.documentElement.clientHeight || document.body.clientHeight) - 130;
     this.$set(this, `clientHeight`, clientHeight);
   },
   methods: {
@@ -86,9 +88,13 @@ export default {
     background: #f9f9f9;
     padding: 5px;
   }
-  .foot {
+  .page {
     height: 40px;
     overflow: hidden;
+  }
+  .foot {
+    height: 50px;
+    overflow: hidden;
     border-top: 1px solid #f1f1f1;
   }
 }