Browse Source

更新重写企业信息页面

wuhongyuq 5 years ago
parent
commit
8f998a99a8

+ 20 - 20
src/layout/companyidentify/detailInfo.vue

@@ -4,7 +4,7 @@
       <el-col :span="24" class="form">
         <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="140px" class="demo-ruleForm">
           <el-form-item label="营业执照图片:">
-            <el-image :src="ruleForm.logo"></el-image>
+            <el-image :src="ruleForm.business_license"></el-image>
           </el-form-item>
           <el-form-item label="企业名称:">
             <span>{{ ruleForm.company_name }}</span>
@@ -36,7 +36,7 @@
           <el-form-item label="企业所属类型:">
             <span>{{ ruleForm.belong_type }}</span>
           </el-form-item>
-          // 所属各级行业
+          <!-- // 所属各级行业 -->
           <el-form-item label="企业所属地:">
             <span>{{ ruleForm.belong_addr }}</span>
           </el-form-item>
@@ -69,8 +69,8 @@
           </el-form-item>
           <span v-if="ruleForm.status === '0'">
             <el-form-item>
-              <el-button type="primary" @click="submitForm('ruleForm')">审核通过</el-button>
-              <el-button type="danger" @click="resetForm('ruleForm')">审核拒绝</el-button>
+              <el-button type="primary" @click="submitForm('ruleForm')">认证通过</el-button>
+              <el-button type="danger" @click="resetForm('ruleForm')">认证失败</el-button>
             </el-form-item>
           </span>
         </el-form>
@@ -92,25 +92,25 @@ export default {
   created() {},
   computed: {},
   methods: {
-    submitForm() {
+    submitForm(ruleForm) {
       this.$emit('submitForm', { data: this.ruleForm });
     },
-    resetForm() {
-      this.$emit('resetForm');
-    },
-    uploadSuccess({ type, data }) {
-      if (type !== 'logo') {
-        let arr = _.get(this.ruleForm, type);
-        if (arr !== undefined) {
-          this.ruleForm[type].push({ name: data.name, uri: data.uri });
-        } else {
-          let newArr = [{ name: data.name, uri: data.uri }];
-          this.$set(this.ruleForm, `${type}`, newArr);
-        }
-      } else {
-        this.$set(this.ruleForm, `${type}`, data.uri);
-      }
+    resetForm(ruleForm) {
+      this.$emit('resetForm', { data: this.ruleForm });
     },
+    // uploadSuccess({ type, data }) {
+    //   if (type !== 'logo') {
+    //     let arr = _.get(this.ruleForm, type);
+    //     if (arr !== undefined) {
+    //       this.ruleForm[type].push({ name: data.name, uri: data.uri });
+    //     } else {
+    //       let newArr = [{ name: data.name, uri: data.uri }];
+    //       this.$set(this.ruleForm, `${type}`, newArr);
+    //     }
+    //   } else {
+    //     this.$set(this.ruleForm, `${type}`, data.uri);
+    //   }
+    // },
   },
 };
 </script>

+ 10 - 6
src/layout/companyidentify/newsInfo.vue

@@ -4,18 +4,21 @@
       <el-col :span="24">
         <el-table ref="debtTable" :data="debtTable" style="width: 100%" border>
           <el-table-column type="index" label="序号" width="50" align="center"> </el-table-column>
-          <el-table-column property="name" label="企业名称" align="center"> </el-table-column>
-          <el-table-column property="date" label="日期" align="center"> </el-table-column>
+          <el-table-column property="company_name" label="企业名称" align="center"> </el-table-column>
+          <el-table-column property="establish_date" label="成立日期" align="center"> </el-table-column>
+          <el-table-column property="type" label="类型" align="center"> </el-table-column>
           <el-table-column label="状态" align="center">
             <template slot-scope="scope">
-              <span style="margin-left: 10px">{{ scope.row.status === '0' ? '审核中' : scope.row.status === '1' ? '审核通过' : '审核拒绝' }}</span>
+              <span style="margin-left: 10px">{{ scope.row.status === '0' ? '认证中' : scope.row.status === '1' ? '认证通过' : '认证失败' }}</span>
             </template>
           </el-table-column>
           <el-table-column fixed="right" label="操作" align="center">
             <template slot-scope="scope">
-              <el-button @click="$router.push({ path: '/companyidentify/detail', query: { id: scope.$index } })" type="text"
+              <!-- <el-button @click="$router.push({ path: '/companyidentify/detail', query: { id: scope.$index } })" type="text"
                 ><i class="el-icon-view"></i
-              ></el-button>
+              ></el-button> -->
+
+              <el-button @click="handleClick(scope.row)" type="text"><i class="el-icon-view"></i></el-button>
             </template>
           </el-table-column>
         </el-table>
@@ -40,7 +43,8 @@ export default {
   },
   methods: {
     handleClick(id) {
-      this.$emit('handleClick', id);
+      let newid = id.id;
+      this.$emit('handleClick', newid);
     },
   },
 };

+ 5 - 4
src/layout/companyup/detailInfo.vue

@@ -15,7 +15,7 @@
           <el-form-item label="实际经营地址:">
             <span>{{ ruleForm.business_addr }}</span>
           </el-form-item>
-          /* 四级联动行业 */
+          <!-- /* 四级联动行业 */ -->
           <el-form-item label="融资联系人:">
             <span>{{ ruleForm.contacts }}</span>
           </el-form-item>
@@ -48,6 +48,7 @@ export default {
   name: 'detailInfo',
   props: {
     ruleForm: null,
+    rules: null,
   },
   components: {},
   data: () => ({}),
@@ -55,10 +56,10 @@ export default {
   computed: {},
   methods: {
     submitForm(ruleForm) {
-      this.$emit('submitForm', { data: this.form });
+      this.$emit('submitForm', { data: this.ruleForm });
     },
-    resetForm() {
-      this.$emit('resetForm');
+    resetForm(ruleForm) {
+      this.$emit('resetForm', { data: this.ruleForm });
     },
   },
 };

+ 63 - 17
src/layout/companyup/newsInfo.vue

@@ -2,21 +2,60 @@
   <div id="newsInfo">
     <el-row>
       <el-col :span="24">
-        <el-table ref="debtTable" :data="debtTable" style="width: 100%" border>
-          <el-table-column type="index" label="序号" width="50" align="center"> </el-table-column>
-          <el-table-column property="name" label="企业名称" align="center"> </el-table-column>
-          <el-table-column label="状态" align="center">
-            <template slot-scope="scope">
-              <span style="margin-left: 10px">{{ scope.row.status === '0' ? '审核中' : scope.row.status === '1' ? '审核通过' : '审核拒绝' }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column property="date" label="日期" align="center"> </el-table-column>
-          <el-table-column fixed="right" label="操作" align="center">
-            <template slot-scope="scope">
-              <el-button @click="handleClick(scope.row)" type="text"><i class="el-icon-view"></i></el-button>
-            </template>
-          </el-table-column>
-        </el-table>
+        <template>
+          <el-tabs v-model="activeName" @tab-click="handleClicks">
+            <el-tab-pane label="审核中" name="first">
+              <el-table ref="debtTable" :data="debtTable" style="width: 100%" border>
+                <el-table-column type="index" label="序号" width="50" align="center"> </el-table-column>
+                <el-table-column property="company_name" label="企业名称" align="center"> </el-table-column>
+                <el-table-column label="状态" align="center">
+                  <template slot-scope="scope">
+                    <span style="margin-left: 10px">{{ scope.row.status === '0' ? '审核中' : scope.row.status === '1' ? '审核通过' : '审核拒绝' }}</span>
+                  </template>
+                </el-table-column>
+                <el-table-column property="registered_addr" label="工商注册地址" align="center"> </el-table-column>
+                <el-table-column fixed="right" label="操作" align="center">
+                  <template slot-scope="scope">
+                    <el-button @click="handleClick(scope.row)" type="text"><i class="el-icon-view"></i></el-button>
+                  </template>
+                </el-table-column>
+              </el-table>
+            </el-tab-pane>
+            <el-tab-pane label="审核通过" name="second">
+              <el-table ref="debtTable" :data="debtTable" style="width: 100%" border>
+                <el-table-column type="index" label="序号" width="50" align="center"> </el-table-column>
+                <el-table-column property="company_name" label="企业名称" align="center"> </el-table-column>
+                <el-table-column label="状态" align="center">
+                  <template slot-scope="scope">
+                    <span style="margin-left: 10px">{{ scope.row.status === '0' ? '审核中' : scope.row.status === '1' ? '审核通过' : '审核拒绝' }}</span>
+                  </template>
+                </el-table-column>
+                <el-table-column property="registered_addr" label="工商注册地址" align="center"> </el-table-column>
+                <el-table-column fixed="right" label="操作" align="center">
+                  <template slot-scope="scope">
+                    <el-button @click="handleClick(scope.row)" type="text"><i class="el-icon-view"></i></el-button>
+                  </template>
+                </el-table-column>
+              </el-table>
+            </el-tab-pane>
+            <el-tab-pane label="审核拒绝" name="third">
+              <el-table ref="debtTable" :data="debtTable" style="width: 100%" border>
+                <el-table-column type="index" label="序号" width="50" align="center"> </el-table-column>
+                <el-table-column property="company_name" label="企业名称" align="center"> </el-table-column>
+                <el-table-column label="状态" align="center">
+                  <template slot-scope="scope">
+                    <span style="margin-left: 10px">{{ scope.row.status === '0' ? '审核中' : scope.row.status === '1' ? '审核通过' : '审核拒绝' }}</span>
+                  </template>
+                </el-table-column>
+                <el-table-column property="registered_addr" label="工商注册地址" align="center"> </el-table-column>
+                <el-table-column fixed="right" label="操作" align="center">
+                  <template slot-scope="scope">
+                    <el-button @click="handleClick(scope.row)" type="text"><i class="el-icon-view"></i></el-button>
+                  </template>
+                </el-table-column> </el-table
+            ></el-tab-pane>
+          </el-tabs>
+        </template>
       </el-col>
     </el-row>
   </div>
@@ -29,7 +68,9 @@ export default {
     debtTable: null,
   },
   components: {},
-  data: () => ({}),
+  data: () => ({
+    activeName: 'first',
+  }),
   created() {},
   computed: {
     status() {
@@ -37,8 +78,13 @@ export default {
     },
   },
   methods: {
+    handleClicks(tab, event) {
+      console.log(tab, event);
+    },
     handleClick(id) {
-      this.$emit('handleClick', id);
+      let newid = id.id;
+
+      this.$emit('handleClick', newid);
     },
   },
 };

+ 1 - 11
src/layout/layout-part/menus.vue

@@ -32,17 +32,7 @@
           <el-menu-item index="/otheruser/index">其他用户</el-menu-item>
         </el-menu-item-group>
       </el-submenu>
-      <el-submenu index="4">
-        <template v-slot:title>
-          <i class="el-icon-s-grid"></i>
-          <span>企业信息管理</span>
-        </template>
-        <el-menu-item-group>
-          <el-menu-item index="/companyup/index/0">待审核</el-menu-item>
-          <el-menu-item index="/companyup/index/1">审核通过</el-menu-item>
-          <el-menu-item index="/companyup/index/2">审核拒绝</el-menu-item>
-        </el-menu-item-group>
-      </el-submenu>
+      <el-menu-item index="/companyup/index"> <i class="el-icon-s-grid"></i>企业信息管理</el-menu-item>
       <el-submenu index="5">
         <template v-slot:title>
           <i class="el-icon-s-grid"></i>

+ 1 - 1
src/router/index.js

@@ -45,7 +45,7 @@ const routes = [
   },
   // 企业信息管理-列表
   {
-    path: '/companyup/index/:status',
+    path: '/companyup/index',
     component: () => import('../views/companyup/index.vue'),
   },
   // 企业信息管理-详情

+ 38 - 0
src/store/companyidentify.js

@@ -0,0 +1,38 @@
+import Vue from 'vue';
+import Vuex from 'vuex';
+import _ from 'lodash';
+Vue.use(Vuex);
+const api = {
+  otheruserInfo: `/api/financial/companyidentify`,
+};
+const state = () => ({});
+const mutations = {};
+
+const actions = {
+  async query({ commit }, { skip = 0, limit, ...info } = {}) {
+    const res = await this.$axios.$get(`${api.otheruserInfo}`, { skip, limit, ...info });
+    return res;
+  },
+  async create({ commit }, payload) {
+    const res = await this.$axios.$post(`${api.otheruserInfo}`, payload);
+    return res;
+  },
+  async fetch({ commit }, payload) {
+    const res = await this.$axios.$get(`${api.otheruserInfo}/${payload}`);
+    return res;
+  },
+  async update({ commit }, { id, ...data }) {
+    const res = await this.$axios.$post(`${api.otheruserInfo}/update/${id}`, data);
+    return res;
+  },
+  async delete({ commit }, payload) {
+    const res = await this.$axios.$delete(`${api.otheruserInfo}/${payload}`);
+    return res;
+  },
+};
+export default {
+  namespaced: true,
+  state,
+  mutations,
+  actions,
+};

+ 38 - 0
src/store/companyup.js

@@ -0,0 +1,38 @@
+import Vue from 'vue';
+import Vuex from 'vuex';
+import _ from 'lodash';
+Vue.use(Vuex);
+const api = {
+  otheruserInfo: `/api/financial/companyup`,
+};
+const state = () => ({});
+const mutations = {};
+
+const actions = {
+  async query({ commit }, { skip = 0, limit, ...info } = {}) {
+    const res = await this.$axios.$get(`${api.otheruserInfo}`, { skip, limit, ...info });
+    return res;
+  },
+  async create({ commit }, payload) {
+    const res = await this.$axios.$post(`${api.otheruserInfo}`, payload);
+    return res;
+  },
+  async fetch({ commit }, payload) {
+    const res = await this.$axios.$get(`${api.otheruserInfo}/${payload}`);
+    return res;
+  },
+  async update({ commit }, { id, ...data }) {
+    const res = await this.$axios.$post(`${api.otheruserInfo}/update/${id}`, data);
+    return res;
+  },
+  async delete({ commit }, payload) {
+    const res = await this.$axios.$delete(`${api.otheruserInfo}/${payload}`);
+    return res;
+  },
+};
+export default {
+  namespaced: true,
+  state,
+  mutations,
+  actions,
+};

+ 4 - 0
src/store/index.js

@@ -1,12 +1,16 @@
 import Vue from 'vue';
 import Vuex from 'vuex';
 import otheruser from './otheruser';
+import companyup from './companyup';
+import companyidentify from './companyidentify';
 
 Vue.use(Vuex);
 
 export default new Vuex.Store({
   modules: {
     otheruser,
+    companyup,
+    companyidentify,
   },
   state: {},
   mutations: {},

+ 53 - 33
src/views/companyidentify/detail.vue

@@ -22,6 +22,8 @@
 import topInfo from '@/layout/common/topInfo.vue';
 import detailTop from '@/layout/common/detailTop.vue';
 import detailInfo from '@/layout/companyidentify/detailInfo.vue';
+import { createNamespacedHelpers } from 'vuex';
+const { mapActions } = createNamespacedHelpers('companyidentify');
 
 export default {
   name: 'detail',
@@ -35,45 +37,63 @@ export default {
     display: 'none',
     topTitle: '企业认证信息审核',
     ruleForm: {
-      business_license: '营业执照图片',
-      company_name: '企业名称',
-      establish_date: '成立日期',
-      due_date: '营业到期日期',
-      type: '企业类型',
-      code: '统一社会信用代码',
-      registered_capital: '注册资本',
-      total_assets: '资产总额',
-      taking: '营业收入',
-      number: '从业人员数量',
-      belong_type: '企业所属类型',
-      profession_one: '所属一级行业',
-      profession_two: '所属二级行业',
-      profession_three: '所属三级行业',
-      profession_four: '所属四级行业',
-      belong_addr: '企业所属地',
-      business_addr: '经营地址',
-      registered_addr: '注册地址',
-      business_scope: '经营范围',
-      introduction: '企业简介',
-      card_front: '身份证正面图',
-      card_back: '身份证背面图',
-      representative: '法定代表人',
-      representative_id: '法人证件号',
-      representative_phone: '法人手机号',
-      status: '0',
+      // business_license: '营业执照图片',
+      // company_name: '企业名称',
+      // establish_date: '成立日期',
+      // due_date: '营业到期日期',
+      // type: '企业类型',
+      // code: '统一社会信用代码',
+      // registered_capital: '注册资本',
+      // total_assets: '资产总额',
+      // taking: '营业收入',
+      // number: '从业人员数量',
+      // belong_type: '企业所属类型',
+      // profession_one: '所属一级行业',
+      // profession_two: '所属二级行业',
+      // profession_three: '所属三级行业',
+      // profession_four: '所属四级行业',
+      // belong_addr: '企业所属地',
+      // business_addr: '经营地址',
+      // registered_addr: '注册地址',
+      // business_scope: '经营范围',
+      // introduction: '企业简介',
+      // card_front: '身份证正面图',
+      // card_back: '身份证背面图',
+      // representative: '法定代表人',
+      // representative_id: '法人证件号',
+      // representative_phone: '法人手机号',
+      // status: '0',
     },
   }),
-  created() {},
-  computed: {},
+  created() {
+    this.search();
+  },
+  computed: {
+    id() {
+      return this.$route.query.id;
+    },
+  },
   methods: {
+    ...mapActions(['query', 'delete', 'fetch', 'update']),
+    async search() {
+      const res = await this.fetch(this.id);
+      console.log(res);
+      this.$set(this, `ruleForm`, res.data);
+    },
+
     // 提交
-    submitForm(form) {
-      console.log(form);
-      this.resetForm();
+    submitForm(ruleForm) {
+      this.ruleForm.status = 1;
+      console.log(this.ruleForm);
+      let res = this.update(this.ruleForm);
     },
     // 取消
-    resetForm() {
-      this.$router.push({ path: '/companyidentify/index' });
+    resetForm(ruleForm) {
+      this.ruleForm.status = 2;
+      console.log(this.ruleForm);
+      let res = this.update(this.ruleForm);
+
+      // this.$router.push({ path: '/companyup/index' });
     },
     // 返回
     goBack() {

+ 20 - 10
src/views/companyidentify/index.vue

@@ -18,6 +18,9 @@
 import topInfo from '@/layout/common/topInfo.vue';
 import searchInfo from '@/layout/common/searchInfo.vue';
 import newsInfo from '@/layout/companyidentify/newsInfo.vue';
+import { createNamespacedHelpers } from 'vuex';
+const { mapActions } = createNamespacedHelpers('companyidentify');
+
 export default {
   name: 'index',
   props: {},
@@ -29,19 +32,26 @@ export default {
   data: () => ({
     topTitle: '企业认证',
     display: 'none',
-    debtTable: [
-      {
-        name: '测试公司',
-        status: '0',
-        date: '2020-12-12',
-      },
-    ],
+    debtTable: [],
   }),
-  created() {},
+  created() {
+    this.search();
+  },
   computed: {},
+
   methods: {
-    handleClick(id) {
-      this.$router.push({ path: '/companyidentify/detail', query: { id: id } });
+    ...mapActions(['query', 'delete']),
+    async search({ skip = 0, limit = 10, ...info } = {}) {
+      const res = await this.query({ skip, limit, ...info });
+
+      var arr = res.data.filter(item => item.status === this.status);
+
+      this.$set(this, `debtTable`, arr);
+    },
+    handleClick(newid) {
+      console.log(newid);
+
+      this.$router.push({ path: '/companyidentify/detail', query: { id: newid } });
     },
   },
 };

+ 30 - 24
src/views/companyup/detail.vue

@@ -10,7 +10,7 @@
             <detailTop @goBack="goBack"></detailTop>
           </el-col>
           <el-col :span="24" class="info">
-            <detailInfo :ruleForm="ruleForm" @submitForm="submitForm" @resetForm="resetForm"></detailInfo>
+            <detailInfo :ruleForm="ruleForm" :rules="rules" @submitForm="submitForm" @resetForm="resetForm"></detailInfo>
           </el-col>
         </el-col>
       </el-col>
@@ -22,6 +22,8 @@
 import topInfo from '@/layout/common/topInfo.vue';
 import detailTop from '@/layout/common/detailTop.vue';
 import detailInfo from '@/layout/companyup/detailInfo.vue';
+import { createNamespacedHelpers } from 'vuex';
+const { mapActions } = createNamespacedHelpers('companyup');
 export default {
   name: 'detail',
   props: {},
@@ -31,36 +33,40 @@ export default {
     detailInfo, //提交
   },
   data: () => ({
+    rules: {},
     display: 'none',
     topTitle: '企业信息审核',
-    ruleForm: {
-      company_name: '企业名称',
-      introduction: '企业简介',
-      registered_addr: '工商注册地址',
-      business_addr: '实际经营地址',
-      profession_one: '所属一级行业',
-      profession_two: '所属二级行业',
-      profession_three: '所属三级行业',
-      profession_four: '所属四级行业',
-      contacts: '融资联系人',
-      contact_number: '联系人手机',
-      contact_position: '联系人职位',
-      contact_email: '联系人邮箱',
-      telephone: '固定电话',
-      status: '0',
-    },
+    ruleForm: {},
   }),
-  created() {},
-  computed: {},
+  created() {
+    this.search();
+  },
+  computed: {
+    id() {
+      return this.$route.query.id;
+    },
+  },
   methods: {
+    ...mapActions(['query', 'delete', 'fetch', 'update']),
+    async search() {
+      const res = await this.fetch(this.id);
+      console.log(res);
+      this.$set(this, `ruleForm`, res.data);
+    },
+
     // 提交
-    submitForm(form) {
-      console.log(form);
-      this.resetForm();
+    submitForm(ruleForm) {
+      this.ruleForm.status = 1;
+      console.log(this.ruleForm);
+      let res = this.update(this.ruleForm);
     },
     // 取消
-    resetForm() {
-      this.$router.push({ path: '/companyup/index' });
+    resetForm(ruleForm) {
+      this.ruleForm.status = 2;
+      console.log(this.ruleForm);
+      let res = this.update(this.ruleForm);
+
+      // this.$router.push({ path: '/companyup/index' });
     },
     // 返回
     goBack() {

+ 14 - 10
src/views/companyup/index.vue

@@ -18,6 +18,8 @@
 import topInfo from '@/layout/common/topInfo.vue';
 import searchInfo from '@/layout/common/searchInfo.vue';
 import newsInfo from '@/layout/companyup/newsInfo.vue';
+import { createNamespacedHelpers } from 'vuex';
+const { mapActions } = createNamespacedHelpers('companyup');
 
 export default {
   name: 'index',
@@ -30,20 +32,22 @@ export default {
   data: () => ({
     topTitle: '企业信息',
     display: 'none',
-    debtTable: [
-      {
-        name: '测试公司',
-        status: '0',
-        date: '2020-12-12',
-      },
-    ],
+    debtTable: [],
   }),
-  created() {},
+  created() {
+    this.search();
+  },
   computed: {},
   methods: {
+    ...mapActions(['query', 'delete']),
+    async search({ skip = 0, limit = 10, ...info } = {}) {
+      const res = await this.query({ skip, limit, ...info });
+      this.$set(this, `debtTable`, res.data);
+    },
+
     // 修改
-    handleClick(id) {
-      this.$router.push({ path: '/companyup/detail', query: { id: id } });
+    handleClick(newid) {
+      this.$router.push({ path: '/companyup/detail', query: { id: newid } });
     },
   },
 };