|
@@ -1,32 +1,414 @@
|
|
<template>
|
|
<template>
|
|
<div id="index">
|
|
<div id="index">
|
|
<el-row>
|
|
<el-row>
|
|
- <el-col :span="24">
|
|
|
|
- <p>index</p>
|
|
|
|
|
|
+ <el-col :span="24" class="main">
|
|
|
|
+ <breadcrumb :breadcrumbTitle="this.$route.meta.title"></breadcrumb>
|
|
|
|
+ <el-col :span="24" class="container info">
|
|
|
|
+ <el-col :span="24" class="list">
|
|
|
|
+ <el-tabs v-model="activeName">
|
|
|
|
+ <el-tab-pane label="个人用户" name="first">
|
|
|
|
+ <data-table :fields="fields" :opera="opera" :data="onelist" :total="onetotal" @edit="toEdit" @delete="toDelete" @query="search"></data-table>
|
|
|
|
+ </el-tab-pane>
|
|
|
|
+ <el-tab-pane label="机构用户" name="second">
|
|
|
|
+ <data-table :fields="fields" :opera="opera" :data="twolist" :total="twototal" @edit="toEdit" @delete="toDelete" @query="search"></data-table>
|
|
|
|
+ </el-tab-pane>
|
|
|
|
+ <el-tab-pane label="专家用户" name="third">
|
|
|
|
+ <data-table :fields="fields" :opera="opera" :data="thrlist" :total="thrtotal" @edit="toEdit" @delete="toDelete" @query="search"></data-table>
|
|
|
|
+ </el-tab-pane>
|
|
|
|
+ </el-tabs>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-col>
|
|
</el-col>
|
|
</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
|
|
+ <el-dialog :visible.sync="dialog" title="增加菜单" @close="toClose" :destroy-on-close="true" width="50%">
|
|
|
|
+ <el-form ref="form" :model="form" label-width="100px">
|
|
|
|
+ <el-form-item label="用户状态" v-if="form.role !== '1'">
|
|
|
|
+ <el-radio-group v-model="form.status">
|
|
|
|
+ <el-radio label="0" disabled>已注册</el-radio>
|
|
|
|
+ <el-radio label="1">审核成功</el-radio>
|
|
|
|
+ <el-radio label="2">审核未通过</el-radio>
|
|
|
|
+ </el-radio-group>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="用户名称" prop="name">
|
|
|
|
+ <el-input v-model="form.name" placeholder="请输入用户名称"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="手机号" prop="phone">
|
|
|
|
+ <el-input v-model="form.phone" placeholder="请输入手机号" :minlength="11" :maxlength="11"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="用户类别" prop="role">
|
|
|
|
+ <el-radio-group v-model="form.role">
|
|
|
|
+ <el-radio label="4">个人</el-radio>
|
|
|
|
+ <el-radio label="5">机构管理员</el-radio>
|
|
|
|
+ <el-radio label="6">专家</el-radio>
|
|
|
|
+ </el-radio-group>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <span v-if="form.role == '4' || form.role == '5'">
|
|
|
|
+ <el-form-item label="电子邮箱" prop="email">
|
|
|
|
+ <el-input v-model="form.email" placeholder="请输入电子邮箱"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="联系地址" prop="addr">
|
|
|
|
+ <el-input v-model="form.addr" placeholder="请输入联系地址"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="办公电话" prop="office_phone">
|
|
|
|
+ <el-input v-model="form.office_phone" placeholder="请输入办公电话"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="所属行业" prop="profession">
|
|
|
|
+ <el-input v-model="form.profession" placeholder="请输入所属行业"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </span>
|
|
|
|
+ <span v-if="form.role == '5'">
|
|
|
|
+ <el-form-item label="注册类型">
|
|
|
|
+ <el-input v-model="form.companytype" placeholder="请输入注册类型"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="注册时间">
|
|
|
|
+ <el-date-picker v-model="form.companydate" placeholder="请选择" value-format="yyyy-MM-dd" format="yyyy-MM-dd" type="date"> </el-date-picker>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="统一社会信用代码">
|
|
|
|
+ <el-input v-model="form.institution_code" placeholder="请输入统一社会信用代码"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="注册资金">
|
|
|
|
+ <el-input v-model="form.companycapital" placeholder="请输入注册资金"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="企业法人">
|
|
|
|
+ <el-input v-model="form.companyperson" placeholder="请输入企业法人"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="上年度企业总收入">
|
|
|
|
+ <el-input v-model="form.sndqyzsr" placeholder="请输入上年度企业总收入"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="上年度研发费用">
|
|
|
|
+ <el-input v-model="form.sndyffy" placeholder="请输入上年度研发费用"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="企业总人数">
|
|
|
|
+ <el-input v-model="form.companytotal" placeholder="请输入企业总人数"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="企业简介">
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="form.companybrief"
|
|
|
|
+ type="textarea"
|
|
|
|
+ maxlength="300"
|
|
|
|
+ show-word-limit
|
|
|
|
+ :autosize="{ minRows: 4, maxRows: 5 }"
|
|
|
|
+ placeholder="请输入企业简介"
|
|
|
|
+ ></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="主要产品">
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="form.mainproduct"
|
|
|
|
+ type="textarea"
|
|
|
|
+ maxlength="300"
|
|
|
|
+ show-word-limit
|
|
|
|
+ :autosize="{ minRows: 4, maxRows: 5 }"
|
|
|
|
+ placeholder="请输入主要产品"
|
|
|
|
+ ></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="企业资质/荣誉">
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="form.qualifications"
|
|
|
|
+ type="textarea"
|
|
|
|
+ maxlength="300"
|
|
|
|
+ show-word-limit
|
|
|
|
+ :autosize="{ minRows: 4, maxRows: 5 }"
|
|
|
|
+ placeholder="请输入企业资质/荣誉"
|
|
|
|
+ ></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </span>
|
|
|
|
+ <span v-else-if="form.role == '6'">
|
|
|
|
+ <el-form-item label="头像">
|
|
|
|
+ <upload :limit="1" :data="form.expertimage" type="expertimage" :url="'/files/imgpath/upload'" @upload="uploadSuccess"></upload>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="最高学历">
|
|
|
|
+ <el-input v-model="form.education" placeholder="请输入最高学历"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="毕业院校">
|
|
|
|
+ <el-input v-model="form.school" placeholder="请输入毕业院校"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="出生日期">
|
|
|
|
+ <el-date-picker v-model="form.birthDate" type="date" placeholder="选择日期" value-format="yyyy-MM-dd"> </el-date-picker>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="QQ/微信">
|
|
|
|
+ <el-input v-model="form.qqwx" placeholder="请输入QQ/微信"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="电子邮箱">
|
|
|
|
+ <el-input v-model="form.email" placeholder="请输入电子邮箱"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="工作单位">
|
|
|
|
+ <el-input v-model="form.company" placeholder="请输入工作单位"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="职务职称">
|
|
|
|
+ <el-input v-model="form.zwzc" placeholder="请输入职务职称"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="擅长领域">
|
|
|
|
+ <el-input v-model="form.expertise" placeholder="请输入擅长领域"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="工作经历">
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="form.workexperience"
|
|
|
|
+ type="textarea"
|
|
|
|
+ maxlength="300"
|
|
|
|
+ show-word-limit
|
|
|
|
+ :autosize="{ minRows: 2, maxRows: 5 }"
|
|
|
|
+ placeholder="请输入工作经历"
|
|
|
|
+ ></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="科研综述">
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="form.scientific"
|
|
|
|
+ type="textarea"
|
|
|
|
+ maxlength="300"
|
|
|
|
+ show-word-limit
|
|
|
|
+ :autosize="{ minRows: 2, maxRows: 5 }"
|
|
|
|
+ placeholder="请输入科研综述"
|
|
|
|
+ ></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="承担项目">
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="form.undertakingproject"
|
|
|
|
+ type="textarea"
|
|
|
|
+ maxlength="300"
|
|
|
|
+ show-word-limit
|
|
|
|
+ :autosize="{ minRows: 2, maxRows: 5 }"
|
|
|
|
+ placeholder="请输入承担项目"
|
|
|
|
+ ></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="科技奖励">
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="form.scienceaward"
|
|
|
|
+ type="textarea"
|
|
|
|
+ maxlength="300"
|
|
|
|
+ show-word-limit
|
|
|
|
+ :autosize="{ minRows: 2, maxRows: 5 }"
|
|
|
|
+ placeholder="请输入科技奖励"
|
|
|
|
+ ></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="社会任职">
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="form.social"
|
|
|
|
+ type="textarea"
|
|
|
|
+ maxlength="300"
|
|
|
|
+ show-word-limit
|
|
|
|
+ :autosize="{ minRows: 2, maxRows: 5 }"
|
|
|
|
+ placeholder="请输入社会任职"
|
|
|
|
+ ></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </span>
|
|
|
|
+ <el-form-item>
|
|
|
|
+ <el-button @click="toClose">返回</el-button>
|
|
|
|
+ <el-button type="primary" @click="handleSave()">提交</el-button>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-form>
|
|
|
|
+ </el-dialog>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+import upload from '@/components/frame/uploadone.vue';
|
|
|
|
+import breadcrumb from '@c/common/breadcrumb.vue';
|
|
|
|
+import dataTable from '@/components/frame/filter-page-table.vue';
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
|
+const { mapActions: marketuser } = createNamespacedHelpers('marketuser');
|
|
|
|
+const { mapActions: authUser } = createNamespacedHelpers('authUser');
|
|
|
|
+const { mapActions: exportuser } = createNamespacedHelpers('exportuser');
|
|
export default {
|
|
export default {
|
|
metaInfo() {
|
|
metaInfo() {
|
|
return { title: this.$route.meta.title };
|
|
return { title: this.$route.meta.title };
|
|
},
|
|
},
|
|
name: 'index',
|
|
name: 'index',
|
|
props: {},
|
|
props: {},
|
|
- components: {},
|
|
|
|
|
|
+ components: {
|
|
|
|
+ breadcrumb,
|
|
|
|
+ dataTable,
|
|
|
|
+ upload,
|
|
|
|
+ },
|
|
data: function() {
|
|
data: function() {
|
|
- return {};
|
|
|
|
|
|
+ return {
|
|
|
|
+ activeName: 'first',
|
|
|
|
+ opera: [
|
|
|
|
+ {
|
|
|
|
+ label: '修改',
|
|
|
|
+ icon: 'el-icon-edit',
|
|
|
|
+ method: 'edit',
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label: '删除',
|
|
|
|
+ icon: 'el-icon-delete',
|
|
|
|
+ method: 'delete',
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ fields: [
|
|
|
|
+ { label: '姓名', prop: 'name' },
|
|
|
|
+ { label: '手机号', prop: 'phone' },
|
|
|
|
+ {
|
|
|
|
+ label: '用户类别',
|
|
|
|
+ prop: 'role',
|
|
|
|
+ format: item => {
|
|
|
|
+ return item === '4' ? '个人用户' : item === '5' ? '机构用户' : '专家用户';
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label: '状态',
|
|
|
|
+ prop: 'status',
|
|
|
|
+ format: item => {
|
|
|
|
+ return item === '0' ? '待审核' : item === '1' ? '审核通过' : '审核拒绝';
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ // 个人用户
|
|
|
|
+ onelist: [],
|
|
|
|
+ onetotal: 0,
|
|
|
|
+ // 机构用户
|
|
|
|
+ twolist: [],
|
|
|
|
+ twototal: 0,
|
|
|
|
+ // 专家用户
|
|
|
|
+ thrlist: [],
|
|
|
|
+ thrtotal: 0,
|
|
|
|
+ // 增加菜单
|
|
|
|
+ dialog: false,
|
|
|
|
+ form: {},
|
|
|
|
+ editData: {},
|
|
|
|
+ };
|
|
|
|
+ },
|
|
|
|
+ created() {
|
|
|
|
+ this.search();
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ ...authUser({ authdelete: 'delete', authquery: 'query' }),
|
|
|
|
+ ...marketuser(['fetch', 'create', 'query', 'update', 'delete']),
|
|
|
|
+ ...exportuser({ exportuserQuery: 'query', exportuserFetch: 'fetch', exportuserCreate: 'create', exportuserUpdate: 'update', exportuserDelete: 'delete' }),
|
|
|
|
+ // 查询列表
|
|
|
|
+ async search({ skip = 0, limit = 10, pid = '', ...info } = {}) {
|
|
|
|
+ if (this.user.code == 'JLCJGLY') {
|
|
|
|
+ let res = await this.query({ skip, limit, role: '4', ...info });
|
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
|
+ this.$set(this, `onelist`, res.data);
|
|
|
|
+ this.$set(this, `onetotal`, res.total);
|
|
|
|
+ }
|
|
|
|
+ res = await this.query({ skip, limit, role: '5', ...info });
|
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
|
+ this.$set(this, `twolist`, res.data);
|
|
|
|
+ this.$set(this, `twototal`, res.total);
|
|
|
|
+ }
|
|
|
|
+ res = await this.exportuserQuery({ skip, limit, ...info });
|
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
|
+ this.$set(this, `thrlist`, res.data);
|
|
|
|
+ this.$set(this, `thrtotal`, res.total);
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ let res = await this.query({ skip, limit, role: '4', pid, code: this.user.code, ...info });
|
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
|
+ this.$set(this, `onelist`, res.data);
|
|
|
|
+ this.$set(this, `onetotal`, res.total);
|
|
|
|
+ }
|
|
|
|
+ res = await this.query({ skip, limit, role: '5', pid, code: this.user.code, ...info });
|
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
|
+ this.$set(this, `twolist`, res.data);
|
|
|
|
+ this.$set(this, `twototal`, res.total);
|
|
|
|
+ }
|
|
|
|
+ res = await this.exportuserQuery({ skip, limit, pid, code: this.user.code, ...info });
|
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
|
+ this.$set(this, `thrlist`, res.data);
|
|
|
|
+ this.$set(this, `thrtotal`, res.total);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ // 修改
|
|
|
|
+ async toEdit({ data }) {
|
|
|
|
+ console.log(data);
|
|
|
|
+ if (data.role == '4' || data.role == '5') {
|
|
|
|
+ let res = await this.fetch(data.id);
|
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
|
+ this.$set(this, `form`, res.data);
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ let res = await this.exportuserFetch(data.id);
|
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
|
+ this.$set(this, `form`, res.data);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ this.$set(this, `editData`, data);
|
|
|
|
+ this.dialog = true;
|
|
|
|
+ },
|
|
|
|
+ // 删除
|
|
|
|
+ async toDelete({ data }) {
|
|
|
|
+ this.$confirm('您确定要删除此信息吗?', '提示', {
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
+ type: 'warning',
|
|
|
|
+ })
|
|
|
|
+ .then(async () => {
|
|
|
|
+ if (data.role == '4' || data.role == '5') {
|
|
|
|
+ let res = await this.delete(data.uid);
|
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
|
+ res = await this.authdelete(data.id);
|
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '删除信息成功',
|
|
|
|
+ type: 'success',
|
|
|
|
+ });
|
|
|
|
+ this.search();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ let res = await this.exportuserDelete(data.uid);
|
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
|
+ res = await this.authdelete(data.id);
|
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '删除信息成功',
|
|
|
|
+ type: 'success',
|
|
|
|
+ });
|
|
|
|
+ this.search();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ .catch(() => {});
|
|
|
|
+ },
|
|
|
|
+ // 增加菜单
|
|
|
|
+ // 保存
|
|
|
|
+ async handleSave() {
|
|
|
|
+ let data = this.form;
|
|
|
|
+ if (data.role == '4' || data.role == '5') {
|
|
|
|
+ // data.id = this.editData.uid;
|
|
|
|
+ console.log(data);
|
|
|
|
+ let res = await this.update(data);
|
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '审核信息成功',
|
|
|
|
+ type: 'success',
|
|
|
|
+ });
|
|
|
|
+ this.toClose();
|
|
|
|
+ }
|
|
|
|
+ } else if (data.role == '6') {
|
|
|
|
+ // data.id = this.editData.uid;
|
|
|
|
+ let res = await this.exportuserUpdate(data);
|
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '审核信息成功',
|
|
|
|
+ type: 'success',
|
|
|
|
+ });
|
|
|
|
+ this.toClose();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ // 取消增加
|
|
|
|
+ toClose() {
|
|
|
|
+ this.form = {};
|
|
|
|
+ this.dialog = false;
|
|
|
|
+ },
|
|
},
|
|
},
|
|
- created() {},
|
|
|
|
- methods: {},
|
|
|
|
computed: {
|
|
computed: {
|
|
...mapState(['user']),
|
|
...mapState(['user']),
|
|
},
|
|
},
|
|
- watch: {},
|
|
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
|
|
|
|
-<style lang="less" scoped></style>
|
|
|
|
|
|
+<style lang="less" scoped>
|
|
|
|
+.main {
|
|
|
|
+ .info {
|
|
|
|
+ .top {
|
|
|
|
+ text-align: right;
|
|
|
|
+ margin: 15px 0;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+</style>
|