guhongwei 4 anni fa
parent
commit
ccf2406bf1

+ 35 - 25
src/views/adminCenter/company/coupons/apply.vue

@@ -14,8 +14,8 @@
                 </el-form-item>
               </el-col>
               <el-col :span="12" class="text">
-                <el-form-item label="申请人" prop="apply_personal">
-                  <el-input v-model="form.apply_personal" placeholder="请输入申请人"></el-input>
+                <el-form-item label="申请人" prop="apply_person">
+                  <el-input v-model="form.apply_person" placeholder="请输入申请人"></el-input>
                 </el-form-item>
               </el-col>
               <el-col :span="12" class="text">
@@ -23,6 +23,12 @@
                   <el-input v-model="form.phone" placeholder="请输入联系电话"></el-input>
                 </el-form-item>
               </el-col>
+              <el-col :span="12" class="text">
+                <el-form-item label="申领金额" prop="apply_money">
+                  <el-input type="text" oninput="value=value.replace(/[^\d]/g,'')" v-model="form.apply_money" clearable style="width: 96%"></el-input>
+                  <span style="padding: 0 5px">元</span>
+                </el-form-item>
+              </el-col>
               <el-col :span="24" class="text">
                 <el-form-item label="法人复印件" prop="qyfr">
                   <e-upload url="/files/cysci/qyfr_file/upload" :limit="1" v-model="form.qyfr" type="text"></e-upload>
@@ -51,9 +57,9 @@
 </template>
 
 <script>
-import { mapState, createNamespacedHelpers } from 'vuex';
 const { mapActions: organization } = createNamespacedHelpers('organization');
 const { mapActions: couponsApply } = createNamespacedHelpers('couponsApply');
+import { mapState, createNamespacedHelpers } from 'vuex';
 export default {
   name: 'apply',
   props: {},
@@ -61,16 +67,37 @@ export default {
   data: function () {
     return {
       form: {},
-      rules: {},
+      rules: {
+        company: [{ required: true, message: '请输入申请单位', trigger: 'blur' }],
+        apply_person: [{ required: true, message: '请输入申请人', trigger: 'blur' }],
+        phone: [{ required: true, message: '请输入联系电话', trigger: 'blur' }],
+        apply_money: [{ required: true, message: '请输入申领金额', trigger: 'blur' }],
+      },
     };
   },
   created() {
-    if (this.user.id) this.searchOther();
+    if (this.coupons_id) this.search();
   },
   methods: {
-    ...organization(['fetch']),
+    ...organization({ orgFetch: 'fetch' }),
     ...couponsApply(['create']),
-    // 提交资料
+    // 查询信息
+    async search() {
+      let res = await this.orgFetch(this.user.id);
+      if (this.$checkRes(res)) {
+        let data = {
+          coupons_id: this.coupons_id,
+          company: res.data.name,
+          apply_person: res.data.companyperson,
+          phone: res.data.phone,
+          user_id: res.data.id,
+          qyfr: [],
+          yyzz: [],
+          qylr: [],
+        };
+        this.$set(this, `form`, data);
+      }
+    },
     onSubmit(formName) {
       this.$refs[formName].validate(async (valid) => {
         if (valid) {
@@ -92,23 +119,6 @@ export default {
     back() {
       this.$router.push({ path: '/adminCenter/company/coupons' });
     },
-    async searchOther() {
-      let res = await this.fetch(this.user.id);
-      if (this.$checkRes(res)) {
-        let data = {
-          company: res.data.name,
-          user_id: res.data.id,
-          phone: res.data.phone,
-          apply_personal: res.data.companyperson,
-          coupons_id: this.coupons_id,
-          qyfr: [],
-          yyzz: [],
-          qylr: [],
-          status: '0',
-        };
-        this.$set(this, `form`, data);
-      }
-    },
   },
   computed: {
     ...mapState(['user']),
@@ -145,7 +155,7 @@ export default {
       margin: 0 0 10px 0;
     }
     /deep/.el-form-item {
-      margin: 0;
+      margin: 0 0 10px 0;
     }
     .formBtn {
       text-align: center;

+ 41 - 7
src/views/adminCenter/company/coupons/couponsResult.vue

@@ -3,7 +3,13 @@
     <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" @view="toView"> </data-table>
+          <data-table :fields="fields" :opera="opera" :data="list" :total="total" @query="search" @view="toView">
+            <template #options="{ item }">
+              <template v-if="item.prop === 'coupons_id'">
+                <el-option v-for="(i, index) in couponsList" :key="`coupons-${index}`" :label="i.name" :value="i.id"></el-option>
+              </template>
+            </template>
+          </data-table>
         </el-col>
       </el-col>
     </el-row>
@@ -11,8 +17,9 @@
 </template>
 
 <script>
-const { applyStatus } = require('@common/dict/index');
+const { isuse, couponsapplyStatus } = require('@common/dict/couindex');
 import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: coupons } = createNamespacedHelpers('coupons');
 const { mapActions: couponsApply } = createNamespacedHelpers('couponsApply');
 export default {
   name: 'couponsResult',
@@ -29,20 +36,42 @@ export default {
         },
       ],
       fields: [
-        { label: '创新券名称', prop: 'coupons.name' },
+        {
+          label: '创新券类型',
+          prop: 'coupons_id',
+          filter: 'select',
+          format: (i) => {
+            const r = this.couponsList.find((f) => f.id === i);
+            if (r) return r.name;
+            else return '';
+          },
+        },
         { label: '申请单位', prop: 'company', filter: 'input' },
-        { label: '申请人', prop: 'apply_personal', filter: 'input' },
-        { label: '联系电话', prop: 'phone', filter: 'input' },
+        { label: '申请人', prop: 'apply_person' },
+        { label: '联系电话', prop: 'phone' },
+        { label: '申领金额', prop: 'apply_money' },
+        { label: '实际申领金额', prop: 'actual_money' },
+        { label: '使用期限', prop: 'section_time' },
+        {
+          label: '是否使用',
+          prop: 'is_use',
+          format: (i) => {
+            const r = isuse.find((f) => f.value === i);
+            if (r) return r.label;
+            else return '';
+          },
+        },
         {
-          label: '审核状态',
+          label: '状态',
           prop: 'status',
           format: (i) => {
-            const r = applyStatus.find((f) => f.value === i);
+            const r = couponsapplyStatus.find((f) => f.value === i);
             if (r) return r.label;
             else return '';
           },
         },
       ],
+      couponsList: [],
     };
   },
   created() {
@@ -50,6 +79,7 @@ export default {
   },
   methods: {
     ...couponsApply(['query']),
+    ...coupons({ couponsQuery: 'query' }),
     async search({ skip = 0, limit = 10, ...info } = {}) {
       info.user_id = this.user.id;
       const res = await this.query({ skip, limit, ...info });
@@ -57,6 +87,10 @@ export default {
         this.$set(this, `list`, res.data);
         this.$set(this, `total`, res.total);
       }
+      const arr = await this.couponsQuery();
+      if (this.$checkRes(arr)) {
+        this.$set(this, `couponsList`, arr.data);
+      }
     },
     // 查看
     toView({ data }) {

+ 191 - 0
src/views/adminCenter/company/coupons/couponsResult_info copy.vue

@@ -0,0 +1,191 @@
+<template>
+  <div id="couponsResult_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-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.coupons.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>
+                    <!-- TODO: type需要判断是成功还是失败,返回对应的值 -->
+                    <el-timeline-item v-for="(item, index) in form.record" :key="index" :timestamp="item.desc_time" placement="top" type="success">
+                      <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 { applyStatus } = require('@common/dict/index');
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: couponsApply } = createNamespacedHelpers('couponsApply');
+export default {
+  name: 'couponsResult_info',
+  props: {},
+  components: {},
+  data: function () {
+    return {
+      form: {
+        coupons: {},
+      },
+      imgList: ['jpg', 'jpeg', 'png', 'bmp', 'gif'],
+    };
+  },
+  created() {
+    if (this.id) this.search();
+  },
+  methods: {
+    ...couponsApply(['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/company/coupons/couponsResult' });
+    },
+    isImg(url) {
+      const arr = url.split('.');
+      const suffix = _.last(arr);
+      return this.imgList.includes(suffix);
+    },
+    toOpen(url) {
+      window.open(url);
+    },
+    getStatus(i) {
+      const r = applyStatus.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>

+ 17 - 1
src/views/adminCenter/company/coupons/couponsResult_info.vue

@@ -23,7 +23,7 @@
               <el-col :span="24" class="text">
                 <el-col :span="2" class="left"> 申请人</el-col>
                 <el-col :span="22" class="right">
-                  {{ form.apply_personal }}
+                  {{ form.apply_person }}
                 </el-col>
               </el-col>
               <el-col :span="24" class="text">
@@ -32,6 +32,22 @@
                   {{ form.phone }}
                 </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_money }}元 </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.actual_money }}
+                </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.section_time }}
+                </el-col>
+              </el-col>
               <el-col :span="24" class="text">
                 <el-col :span="2" class="left"> 法人复印件:</el-col>
                 <el-col :span="20" class="right">

+ 3 - 2
src/views/adminCenter/company/coupons/index.vue

@@ -28,12 +28,13 @@ export default {
         },
       ],
       fields: [
+        { label: '创新券类型', prop: 'coupons_type' },
         { label: '创新券名称', prop: 'name', filter: 'input' },
         { label: '折扣类型', prop: 'discount_type' },
         { label: '适用服务类型', prop: 'use_type' },
         { label: '所属分类', prop: 'classify' },
-        { label: '期限', prop: 'limit_time' },
-        { label: '补贴比例', prop: 'scale' },
+        { label: '时间期限', prop: 'limit_time' },
+        { label: '折扣比例', prop: 'scale' },
         { label: '面额', prop: 'allowance' },
         { label: '券总额度', prop: 'total_allowance' },
       ],

+ 46 - 12
src/views/adminCenter/coupons/apply.vue

@@ -1,9 +1,15 @@
 <template>
-  <div id="list">
+  <div id="apply">
     <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" @check="toCheck" @view="toView"> </data-table>
+          <data-table :fields="fields" :opera="opera" :data="list" :total="total" @query="search" @check="toCheck" @view="toView">
+            <template #options="{ item }">
+              <template v-if="item.prop === 'coupons_id'">
+                <el-option v-for="(i, index) in couponsList" :key="`coupons-${index}`" :label="i.name" :value="i.id"></el-option>
+              </template>
+            </template>
+          </data-table>
         </el-col>
       </el-col>
     </el-row>
@@ -11,11 +17,12 @@
 </template>
 
 <script>
-const { applyStatus } = require('@common/dict/index');
+const { isuse, couponsapplyStatus } = require('@common/dict/couindex');
 import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: coupons } = createNamespacedHelpers('coupons');
 const { mapActions: couponsApply } = createNamespacedHelpers('couponsApply');
 export default {
-  name: 'list',
+  name: 'apply',
   props: {},
   components: {},
   data: function () {
@@ -34,38 +41,65 @@ export default {
           label: '查看',
           method: 'view',
           display: (item) => {
-            return item.status == '1' || item.status == '2';
+            return item.status == '1' || item.status == '-1';
           },
         },
       ],
       fields: [
-        { label: '创新券', prop: 'coupons.name' },
-        { label: '申领企业', prop: 'company', filter: 'input' },
-        { label: '联系人', prop: 'apply_personal', filter: 'input' },
-        { label: '联系电话', prop: 'phone', filter: 'input' },
         {
-          label: '审核状态',
+          label: '创新券类型',
+          prop: 'coupons_id',
+          filter: 'select',
+          format: (i) => {
+            const r = this.couponsList.find((f) => f.id === i);
+            if (r) return r.name;
+            else return '';
+          },
+        },
+        { label: '申请单位', prop: 'company', filter: 'input' },
+        { label: '申请人', prop: 'apply_person' },
+        { label: '联系电话', prop: 'phone' },
+        { label: '申领金额', prop: 'apply_money' },
+        { label: '实际申领金额', prop: 'actual_money' },
+        { label: '使用期限', prop: 'section_time' },
+        {
+          label: '是否使用',
+          prop: 'is_use',
+          format: (i) => {
+            const r = isuse.find((f) => f.value === i);
+            if (r) return r.label;
+            else return '';
+          },
+        },
+        {
+          label: '状态',
           prop: 'status',
           format: (i) => {
-            const r = applyStatus.find((f) => f.value === i);
+            const r = couponsapplyStatus.find((f) => f.value === i);
             if (r) return r.label;
             else return '';
           },
         },
       ],
+      couponsList: [],
     };
   },
   created() {
     this.search();
   },
   methods: {
-    ...couponsApply(['query', 'update']),
+    ...couponsApply(['query']),
+    ...coupons({ couponsQuery: 'query' }),
     async search({ skip = 0, limit = 10, ...info } = {}) {
       const res = await this.query({ skip, limit, ...info });
       if (this.$checkRes(res)) {
         this.$set(this, `list`, res.data);
         this.$set(this, `total`, res.total);
       }
+      const arr = await this.couponsQuery();
+      if (this.$checkRes(arr)) {
+        this.$set(this, `couponsList`, arr.data);
+      }
     },
     // 审核
     toCheck({ data }) {

+ 58 - 32
src/views/adminCenter/coupons/apply_check.vue

@@ -7,33 +7,44 @@
             <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.coupons.name }}
-                </el-col>
+            <el-form :model="form" ref="form" :rules="rules" label-width="110px">
+              <el-col :span="12" class="text">
+                <el-form-item label="所属创新券" prop="coupons_id">
+                  <el-input v-model="form.coupons.name" placeholder="" disabled></el-input>
+                </el-form-item>
               </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 :span="12" class="text">
+                <el-form-item label="申请单位" prop="company">
+                  <el-input v-model="form.company" placeholder="" disabled></el-input>
+                </el-form-item>
               </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 :span="12" class="text">
+                <el-form-item label="申请人" prop="apply_person">
+                  <el-input v-model="form.apply_person" placeholder="" disabled></el-input>
+                </el-form-item>
               </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 :span="12" class="text">
+                <el-form-item label="联系电话" prop="phone">
+                  <el-input v-model="form.phone" placeholder="" disabled></el-input>
+                </el-form-item>
               </el-col>
-              <el-col :span="24" class="text">
-                <el-col :span="2" class="left"> 法人复印件:</el-col>
+              <el-col :span="12" class="text">
+                <el-form-item label="申领金额" prop="apply_money">
+                  <el-input v-model="form.apply_money" placeholder="" disabled></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="12" class="text">
+                <el-form-item label="实际申领金额" prop="actual_money">
+                  <el-input v-model="form.actual_money" placeholder=""></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="12" class="text">
+                <el-form-item label="使用期限" prop="section_time">
+                  <el-date-picker v-model="form.section_time" placeholder="请选择" value-format="yyyy-MM-dd" format="yyyy-MM-dd" type="date"> </el-date-picker>
+                </el-form-item>
+              </el-col>
+              <el-col :span="24" class="langtext">
+                <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)" />
@@ -41,8 +52,8 @@
                   </el-col>
                 </el-col>
               </el-col>
-              <el-col :span="24" class="text">
-                <el-col :span="2" class="left"> 企业营业执照</el-col>
+              <el-col :span="24" class="langtext">
+                <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)" />
@@ -50,8 +61,8 @@
                   </el-col>
                 </el-col>
               </el-col>
-              <el-col :span="24" class="text">
-                <el-col :span="2" class="left"> 企业利润表</el-col>
+              <el-col :span="24" class="langtext">
+                <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)" />
@@ -59,7 +70,7 @@
                   </el-col>
                 </el-col>
               </el-col>
-              <el-col :span="24" class="text">
+              <el-col :span="24" class="langtext">
                 <el-col :span="2" class="left"> 审核状态</el-col>
                 <el-col :span="22" class="right">
                   <el-radio-group v-model="form.status">
@@ -67,7 +78,7 @@
                   </el-radio-group>
                 </el-col>
               </el-col>
-              <el-col :span="24" class="text">
+              <el-col :span="24" class="langtext">
                 <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>
@@ -88,7 +99,7 @@
 <script>
 const _ = require('lodash');
 const moment = require('moment');
-const { applyStatus } = require('@common/dict/index');
+const { couponsapplyStatus } = require('@common/dict/couindex');
 import { mapState, createNamespacedHelpers } from 'vuex';
 const { mapActions: couponsApply } = createNamespacedHelpers('couponsApply');
 export default {
@@ -100,8 +111,12 @@ export default {
       form: {
         coupons: {},
       },
+      rules: {
+        actual_money: [{ required: true, message: '请输入实际申领金额', trigger: 'blur' }],
+        // section_time: [{ type: 'date', required: true, message: '请选择日期', trigger: 'change' }],
+      },
       imgList: ['jpg', 'jpeg', 'png', 'bmp', 'gif'],
-      statusList: applyStatus,
+      statusList: couponsapplyStatus,
     };
   },
   created() {
@@ -182,10 +197,21 @@ export default {
   }
   .down {
     .text {
+      padding: 10px 0;
+      border-bottom: 1px dashed #333;
+      /deep/.el-form-item {
+        margin: 0 0 10px 0;
+      }
+    }
+    .langtext {
       padding: 10px 0;
       border-bottom: 1px dashed #333;
       .left {
-        text-align: left;
+        text-align: right;
+        font-size: 14px;
+        color: #666;
+        width: 7%;
+        padding: 0 15px 0 0;
       }
       .right {
         img {

+ 17 - 1
src/views/adminCenter/coupons/apply_info.vue

@@ -23,7 +23,7 @@
               <el-col :span="24" class="text">
                 <el-col :span="2" class="left"> 申请人</el-col>
                 <el-col :span="22" class="right">
-                  {{ form.apply_personal }}
+                  {{ form.apply_person }}
                 </el-col>
               </el-col>
               <el-col :span="24" class="text">
@@ -32,6 +32,22 @@
                   {{ form.phone }}
                 </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_money }}元 </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.actual_money }}
+                </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.section_time }}
+                </el-col>
+              </el-col>
               <el-col :span="24" class="text">
                 <el-col :span="2" class="left"> 法人复印件:</el-col>
                 <el-col :span="20" class="right">

+ 101 - 88
src/views/adminCenter/coupons/detail.vue

@@ -2,79 +2,78 @@
   <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" ref="form" label-width="100px">
-              <el-col :span="12" class="text">
-                <el-form-item label="创新券名称" prop="name">
-                  <el-input v-model="form.name"></el-input>
-                </el-form-item>
-              </el-col>
-              <el-col :span="12" class="text">
-                <el-form-item label="折扣类型" prop="discount_type">
-                  <el-select v-model="form.discount_type" placeholder="">
-                    <el-option v-for="(item, index) in discounttypeList" :key="index" :label="item" :value="item"></el-option>
-                  </el-select>
-                </el-form-item>
-              </el-col>
-              <el-col :span="12" class="text">
-                <el-form-item label="适用服务类型" prop="use_type">
-                  <el-select v-model="form.use_type" placeholder="">
-                    <el-option v-for="(item, index) in usetypeList" :key="index" :label="item" :value="item"></el-option>
-                  </el-select>
-                </el-form-item>
-              </el-col>
-              <el-col :span="12" class="text">
-                <el-form-item label="所属分类" prop="classify">
-                  <el-select v-model="form.classify" placeholder="">
-                    <el-option v-for="(item, index) in classifyList" :key="index" :label="item" :value="item"></el-option>
-                  </el-select>
-                </el-form-item>
-              </el-col>
-              <el-col :span="12" class="text">
-                <el-form-item label="期限" prop="limit_time">
-                  <el-input v-model="form.limit_time" style="width: 94%"></el-input>
-                  <span style="padding: 0 5px">个月</span>
-                </el-form-item>
-              </el-col>
-              <el-col :span="12" class="text">
-                <el-form-item label="抵扣比例" prop="scale">
-                  <el-input type="text" oninput="value=value.replace(/[^\d]/g,'')" v-model="form.scale" clearable style="width: 96%"></el-input>
-                  <span style="padding: 0 5px">%</span>
-                </el-form-item>
-              </el-col>
-              <el-col :span="12" class="text">
-                <el-form-item label="面额" prop="allowance">
-                  <el-input type="text" oninput="value=value.replace(/[^\d]/g,'')" v-model="form.allowance" clearable style="width: 96%"></el-input>
-                  <span style="padding: 0 5px">元</span>
-                </el-form-item>
-              </el-col>
-              <el-col :span="12" class="text">
-                <el-form-item label="券总额度" prop="total_allowance">
-                  <el-input type="text" oninput="value=value.replace(/[^\d]/g,'')" v-model="form.total_allowance" clearable style="width: 96%"></el-input>
-                  <span style="padding: 0 5px">元</span>
-                </el-form-item>
-              </el-col>
-              <el-col :span="12" class="text unitallowance">
-                <el-form-item label="单个企业/团队最大额度" prop="unit_allowance">
-                  <el-input type="text" oninput="value=value.replace(/[^\d]/g,'')" v-model="form.unit_allowance" clearable style="width: 96%"></el-input>
-                  <span style="padding: 0 5px">元</span>
-                </el-form-item>
-              </el-col>
-              <el-col :span="24" class="text">
-                <el-form-item label="描述" prop="desc">
-                  <el-input v-model="form.desc" type="textarea" maxlength="300" :autosize="{ minRows: 4, maxRows: 6 }" show-word-limit></el-input>
-                </el-form-item>
-              </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 :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="12" class="text">
+              <el-form-item label="创新券类型" prop="coupons_type">
+                <el-select v-model="form.coupons_type" clearable filterable placeholder="">
+                  <el-option v-for="(item, index) in couponstypeList" :key="index" :label="item" :value="item"></el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="12" class="text">
+              <el-form-item label="创新券名称" prop="name">
+                <el-input v-model="form.name"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="12" class="text">
+              <el-form-item label="折扣类型" prop="discount_type">
+                <el-select v-model="form.discount_type" clearable filterable placeholder="">
+                  <el-option v-for="(item, index) in discounttypeList" :key="index" :label="item" :value="item"></el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="12" class="text" v-if="form.discount_type == '折扣券'">
+              <el-form-item label="抵扣比例" prop="scale">
+                <el-input type="text" oninput="value=value.replace(/[^\d]/g,'')" v-model="form.scale" clearable style="width: 96%"></el-input>
+                <span style="padding: 0 5px">%</span>
+              </el-form-item>
+            </el-col>
+            <el-col :span="12" class="text" v-if="form.discount_type == '定额券'">
+              <el-form-item label="面额" prop="allowance">
+                <el-input type="text" oninput="value=value.replace(/[^\d]/g,'')" v-model="form.allowance" clearable style="width: 96%"></el-input>
+                <span style="padding: 0 5px">元</span>
+              </el-form-item>
+            </el-col>
+            <el-col :span="12" class="text">
+              <el-form-item label="适用服务类型" prop="use_type">
+                <el-select v-model="form.use_type" clearable filterable placeholder="">
+                  <el-option v-for="(item, index) in usetypeList" :key="index" :label="item" :value="item"></el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="12" class="text">
+              <el-form-item label="所属分类" prop="classify">
+                <el-select v-model="form.classify" clearable filterable placeholder="">
+                  <el-option v-for="(item, index) in classifyList" :key="index" :label="item" :value="item"></el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="12" class="text">
+              <el-form-item label="券总额度" prop="total_allowance">
+                <el-input type="text" oninput="value=value.replace(/[^\d]/g,'')" v-model="form.total_allowance" clearable style="width: 96%"></el-input>
+                <span style="padding: 0 5px">元</span>
+              </el-form-item>
+            </el-col>
+            <el-col :span="12" class="text">
+              <el-form-item label="使用期限" prop="limit_time">
+                <el-input type="text" oninput="value=value.replace(/[^\d]/g,'')" v-model="form.limit_time" clearable style="width: 94%"></el-input>
+                <span style="padding: 0 5px">个月</span>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24" class="text">
+              <el-form-item label="描述" prop="desc">
+                <el-input v-model="form.desc" type="textarea" maxlength="300" :autosize="{ minRows: 4, maxRows: 6 }" show-word-limit></el-input>
+              </el-form-item>
+            </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-row>
@@ -83,7 +82,7 @@
 
 <script>
 const _ = require('lodash');
-const { discounttype, usetype, classify } = require('@common/dict/index');
+const { couponsType, discounTtype, useType, classify } = require('@common/dict/couindex');
 import { mapState, createNamespacedHelpers } from 'vuex';
 const { mapActions: coupons } = createNamespacedHelpers('coupons');
 export default {
@@ -93,30 +92,46 @@ export default {
   data: function () {
     return {
       form: {},
-      // 折扣类型
-      discounttypeList: discounttype,
-      // 适用服务类型
-      usetypeList: usetype,
-      // 所属分类
+      rules: {
+        coupons_type: [{ required: true, message: '请选择创新券类型', trigger: 'change' }],
+        name: [{ required: true, message: '请输入创新券名称', trigger: 'blur' }],
+        discount_type: [{ required: true, message: '请选择创折扣类型', trigger: 'change' }],
+        user_type: [{ required: true, message: '请选择适用服务类型', trigger: 'change' }],
+        classify: [{ required: true, message: '请选择所属分类', trigger: 'change' }],
+        limit_time: [{ required: true, message: '请输入时间期限', trigger: 'blur' }],
+        total_allowance: [{ required: true, message: '请输入券总额度', trigger: 'blur' }],
+        desc: [{ required: true, message: '请输入描述', trigger: 'blur' }],
+      },
+      // 创新券类型
+      couponstypeList: couponsType,
+      discounttypeList: discounTtype,
+      usetypeList: useType,
       classifyList: classify,
     };
   },
   created() {
-    if (this.id) this.search();
+    this.search();
   },
   methods: {
     ...coupons(['fetch', 'create', 'update']),
     async search() {
-      const res = await this.fetch(this.id);
-      if (this.$checkRes(res)) {
-        this.$set(this, `form`, res.data);
+      // 已有数据
+      if (this.id) {
+        let res = await this.fetch(this.id);
+        if (this.$checkRes(res)) {
+          this.$set(this, `form`, res.data);
+        }
+        // 暂无数据
+      } else {
+        let data = { user_id: this.user.id };
+        this.$set(this, `form`, data);
       }
     },
+    // 提交保存
     onSubmit(formName) {
       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)) {
@@ -142,6 +157,7 @@ export default {
         }
       });
     },
+    // 返回列表
     back() {
       this.$router.push({ path: '/adminCenter/coupons' });
     },
@@ -180,7 +196,7 @@ export default {
       padding: 15px 0;
     }
     /deep/.el-form-item {
-      margin: 0;
+      margin: 0 0 10px 0;
     }
     .el-select {
       width: 100%;
@@ -189,9 +205,6 @@ export default {
       text-align: center;
       padding: 10px 0;
     }
-    /deep/.unitallowance .el-form-item__label {
-      line-height: 20px;
-    }
   }
 }
 .main:hover {

+ 8 - 5
src/views/adminCenter/coupons/index.vue

@@ -15,7 +15,7 @@
 </template>
 
 <script>
-const { couponsStatus } = require('@common/dict/index');
+const { couponsStatus } = require('@common/dict/couindex');
 import { mapState, createNamespacedHelpers } from 'vuex';
 const { mapActions: coupons } = createNamespacedHelpers('coupons');
 export default {
@@ -50,16 +50,17 @@ export default {
         },
       ],
       fields: [
+        { label: '创新券类型', prop: 'coupons_type' },
         { label: '创新券名称', prop: 'name', filter: 'input' },
         { label: '折扣类型', prop: 'discount_type' },
         { label: '适用服务类型', prop: 'use_type' },
         { label: '所属分类', prop: 'classify' },
-        { label: '期限', prop: 'limit_time' },
-        { label: '补贴比例', prop: 'scale' },
+        { label: '时间期限', prop: 'limit_time' },
+        { label: '折扣比例', prop: 'scale' },
         { label: '面额', prop: 'allowance' },
         { label: '券总额度', prop: 'total_allowance' },
         {
-          label: '信息状态',
+          label: '状态',
           prop: 'status',
           format: (i) => {
             const r = couponsStatus.find((f) => f.value === i);
@@ -75,7 +76,9 @@ export default {
   },
   methods: {
     ...coupons(['query', 'update']),
+    // 查询
     async search({ skip = 0, limit = 10, ...info } = {}) {
+      info.user_id = this.user.id;
       const res = await this.query({ skip, limit, ...info });
       if (this.$checkRes(res)) {
         this.$set(this, `list`, res.data);
@@ -115,7 +118,7 @@ export default {
     return { title: this.$route.meta.title };
   },
   watch: {
-    type: {
+    test: {
       deep: true,
       immediate: true,
       handler(val) {},