research update
This commit is contained in:
19
Caddyfile
Normal file
19
Caddyfile
Normal file
@ -0,0 +1,19 @@
|
||||
#{
|
||||
# http_port 4163
|
||||
# https_port 4173
|
||||
#}
|
||||
|
||||
:4173 {
|
||||
handle_path /api/* {
|
||||
reverse_proxy 192.168.0.201:1618
|
||||
}
|
||||
handle {
|
||||
root * "/Volumes/iMac Doc/WebstormProjects/cas_cloud_admin/dist"
|
||||
file_server
|
||||
try_files {path} /
|
||||
}
|
||||
}
|
||||
|
||||
#localhost:4173 {
|
||||
# redir https://192.168.0.200:4173{uri}
|
||||
#}
|
@ -1,50 +1,55 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 科研机构信息
|
||||
export function researchList(data) {
|
||||
return request({
|
||||
url: '/admin/v1/manage/research',
|
||||
method: 'post',
|
||||
data,
|
||||
})
|
||||
|
||||
// 科研机构列表
|
||||
export function researchList(params) {
|
||||
return request({
|
||||
url: '/business/casResearch/list',
|
||||
method: 'GET',
|
||||
params,
|
||||
})
|
||||
}
|
||||
|
||||
// 科研机构筛选信息
|
||||
export function researchSelect(data) {
|
||||
return request({
|
||||
url: '/admin/v1/manage/research/select',
|
||||
method: 'post',
|
||||
data,
|
||||
})
|
||||
return request({
|
||||
url: '/admin/v1/manage/research/select',
|
||||
method: 'post',
|
||||
data,
|
||||
})
|
||||
}
|
||||
|
||||
// 科研机构信息添加
|
||||
export function researchAdd(data) {
|
||||
return request({
|
||||
url: '/admin/v1/manage/research/add',
|
||||
method: 'post',
|
||||
data,
|
||||
})
|
||||
return request({
|
||||
url: '/business/casResearch',
|
||||
method: 'post',
|
||||
data,
|
||||
})
|
||||
}
|
||||
|
||||
// 科研机构信息修改
|
||||
export function researchEdit(data) {
|
||||
return request({
|
||||
url: '/admin/v1/manage/research/edit',
|
||||
method: 'post',
|
||||
data,
|
||||
})
|
||||
return request({
|
||||
url: '/business/casResearch',
|
||||
method: 'PUT',
|
||||
data,
|
||||
})
|
||||
}
|
||||
|
||||
// 科研机构详细信息
|
||||
export function researchDetail(data) {
|
||||
return request({
|
||||
url: '/admin/v1/manage/research/detail',
|
||||
method: 'post',
|
||||
data,
|
||||
})
|
||||
export function researchDetail(id) {
|
||||
return request({
|
||||
url: `/business/casResearch/${id}`,
|
||||
method: 'GET',
|
||||
})
|
||||
}
|
||||
// 科研机构审核操作
|
||||
export function researchExamine(data) {
|
||||
return request({
|
||||
url: '/admin/v1/manage/research/examine',
|
||||
method: 'post',
|
||||
data,
|
||||
})
|
||||
|
||||
// 科研机构详细信息
|
||||
export function researchDelete(ids) {
|
||||
return request({
|
||||
url: `/business/casResearch/${ids}`,
|
||||
method: 'DELETE',
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -134,14 +134,13 @@ const handleInputChange = debounce((value) => {
|
||||
watchEffect(() => {
|
||||
if (showPopOver.value) return;
|
||||
if (modelValue.value) {
|
||||
console.log(modelValue.value)
|
||||
optionLabelWhenNotShowPop.value =
|
||||
options.value.find((el) => el[props.prop.value] === modelValue.value)?.[
|
||||
props.prop.label
|
||||
] ??
|
||||
(echoLabel.value.length ? echoLabel.value : null) ??
|
||||
props.defaultLabel ??
|
||||
"...";
|
||||
props.defaultLabel ??
|
||||
"...";
|
||||
} else {
|
||||
optionLabelWhenNotShowPop.value = "";
|
||||
placeholderWhenNotShowPop.value = props.placeholder;
|
||||
|
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<el-badge
|
||||
v-if="!item.hidden"
|
||||
:hidden="
|
||||
v-if="!item.hidden"
|
||||
:hidden="
|
||||
![
|
||||
`/approval/list`,
|
||||
`/approval/dataList/approval`,
|
||||
@ -9,76 +9,77 @@
|
||||
`/auditing/demand`,
|
||||
`/auditing/serviceDemand`,
|
||||
`/auditing/Enterpriseproducts`,
|
||||
`/approval/data-list/laboratory`
|
||||
].includes(basePath)
|
||||
"
|
||||
:value="getCount(basePath)"
|
||||
class="count-badge"
|
||||
:value="getCount(basePath)"
|
||||
class="count-badge"
|
||||
>
|
||||
<div>
|
||||
<template
|
||||
v-if="
|
||||
v-if="
|
||||
hasOneShowingChild(item.children, item) &&
|
||||
(!onlyOneChild.children || onlyOneChild.noShowingChildren) &&
|
||||
!item.alwaysShow
|
||||
"
|
||||
>
|
||||
<app-link
|
||||
v-if="onlyOneChild.meta"
|
||||
:to="resolvePath(onlyOneChild.path, onlyOneChild.query)"
|
||||
v-if="onlyOneChild.meta"
|
||||
:to="resolvePath(onlyOneChild.path, onlyOneChild.query)"
|
||||
>
|
||||
<el-menu-item
|
||||
:style="{
|
||||
:class="{ 'submenu-title-noDropdown': !isNest }"
|
||||
:index="resolvePath(onlyOneChild.path)"
|
||||
:style="{
|
||||
paddingRight: '0px',
|
||||
}"
|
||||
:index="resolvePath(onlyOneChild.path)"
|
||||
:class="{ 'submenu-title-noDropdown': !isNest }"
|
||||
>
|
||||
<svg-icon
|
||||
:icon-class="
|
||||
:icon-class="
|
||||
onlyOneChild.meta.icon || (item.meta && item.meta.icon)
|
||||
"
|
||||
/>
|
||||
<template #title
|
||||
><span
|
||||
class="menu-title"
|
||||
><span
|
||||
:title="hasTitle(onlyOneChild.meta.title)"
|
||||
>{{
|
||||
["/auditing/serviceDemand"].includes(basePath)
|
||||
class="menu-title"
|
||||
>{{
|
||||
["/auditing/serviceDemand"].includes(basePath)
|
||||
? `${onlyOneChild.meta.title} (${userStore.serviceDemandTotal})`
|
||||
: ["/auditing/achievement"].includes(basePath)
|
||||
? `${onlyOneChild.meta.title} (${userStore.achievementTotal})`
|
||||
: ["/auditing/demand"].includes(basePath)
|
||||
? `${onlyOneChild.meta.title} (${userStore.technologyTotal})`
|
||||
: ["/auditing/Enterpriseproducts"].includes(basePath)
|
||||
? `${onlyOneChild.meta.title} (${userStore.productTotal})`
|
||||
: onlyOneChild.meta.title
|
||||
}}</span
|
||||
></template
|
||||
? `${onlyOneChild.meta.title} (${userStore.achievementTotal})`
|
||||
: ["/auditing/demand"].includes(basePath)
|
||||
? `${onlyOneChild.meta.title} (${userStore.technologyTotal})`
|
||||
: ["/auditing/Enterpriseproducts"].includes(basePath)
|
||||
? `${onlyOneChild.meta.title} (${userStore.productTotal})`
|
||||
: onlyOneChild.meta.title
|
||||
}}</span
|
||||
></template
|
||||
>
|
||||
</el-menu-item>
|
||||
</app-link>
|
||||
</template>
|
||||
|
||||
<el-sub-menu
|
||||
v-else
|
||||
ref="subMenu"
|
||||
:index="resolvePath(item.path)"
|
||||
popper-append-to-body
|
||||
v-else
|
||||
ref="subMenu"
|
||||
:index="resolvePath(item.path)"
|
||||
popper-append-to-body
|
||||
>
|
||||
<template v-if="item.meta" #title>
|
||||
<svg-icon :icon-class="item.meta && item.meta.icon" />
|
||||
<span class="menu-title" :title="hasTitle(item.meta.title)">{{
|
||||
item.meta.title
|
||||
}}</span>
|
||||
<svg-icon :icon-class="item.meta && item.meta.icon"/>
|
||||
<span :title="hasTitle(item.meta.title)" class="menu-title">{{
|
||||
item.meta.title
|
||||
}}</span>
|
||||
</template>
|
||||
|
||||
<sidebar-item
|
||||
v-for="child in item.children"
|
||||
:key="child.path"
|
||||
:is-nest="true"
|
||||
:item="child"
|
||||
:base-path="resolvePath(child.path)"
|
||||
class="nest-menu"
|
||||
v-for="child in item.children"
|
||||
:key="child.path"
|
||||
:base-path="resolvePath(child.path)"
|
||||
:is-nest="true"
|
||||
:item="child"
|
||||
class="nest-menu"
|
||||
/>
|
||||
</el-sub-menu>
|
||||
</div>
|
||||
@ -86,9 +87,9 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { isExternal } from "@/utils/validate";
|
||||
import {isExternal} from "@/utils/validate";
|
||||
import AppLink from "./Link";
|
||||
import { getNormalPath } from "@/utils/ruoyi";
|
||||
import {getNormalPath} from "@/utils/ruoyi";
|
||||
import useUserStore from "@/store/modules/user";
|
||||
|
||||
const props = defineProps({
|
||||
@ -124,6 +125,8 @@ const getCount = (basePath) => {
|
||||
return userStore.unApprovedProduct;
|
||||
} else if (props.basePath == "/auditing/serviceDemand") {
|
||||
return userStore.unApprovedService;
|
||||
} else if (props.basePath === '/approval/data-list/laboratory') {
|
||||
return userStore.unApprovedLab
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
@ -150,7 +153,7 @@ function hasOneShowingChild(children = [], parent) {
|
||||
|
||||
// Show parent if there are no child router to display
|
||||
if (showingChildren.length === 0) {
|
||||
onlyOneChild.value = { ...parent, path: "", noShowingChildren: true };
|
||||
onlyOneChild.value = {...parent, path: "", noShowingChildren: true};
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -185,6 +188,7 @@ function hasTitle(title) {
|
||||
<style lang="scss">
|
||||
.count-badge {
|
||||
width: 100%;
|
||||
|
||||
.el-badge__content {
|
||||
// margin-right: 20px;
|
||||
top: 8px !important;
|
||||
|
@ -1,168 +1,176 @@
|
||||
import { login, logout, getInfo } from "@/api/login";
|
||||
import { getToken, setToken, removeToken } from "@/utils/auth";
|
||||
import {getInfo, login, logout} from "@/api/login";
|
||||
import {getToken, removeToken, setToken} from "@/utils/auth";
|
||||
import defAva from "@/assets/images/profile.jpg";
|
||||
import md5 from "js-md5";
|
||||
import { companyList } from "@/api/dataList/enterprise";
|
||||
import { expertList } from "@/api/expert/expert";
|
||||
import { listCasDemand } from "../../api/dataApproval/enterpriseServiceDemand";
|
||||
import { expertAchievementList } from "../../api/dataApproval/achivement";
|
||||
import { businessList } from "../../api/Businessneeds";
|
||||
import { enterpriseProductApprovalList } from "../../api/dataApproval/enterpriseProduct";
|
||||
import {
|
||||
getUnApprovalCount,
|
||||
resetUnApprovalCount,
|
||||
} from "../../api/dataApproval/count";
|
||||
import {companyList} from "@/api/dataList/enterprise";
|
||||
import {expertList} from "@/api/expert/expert";
|
||||
import {listCasDemand} from "../../api/dataApproval/enterpriseServiceDemand";
|
||||
import {expertAchievementList} from "../../api/dataApproval/achivement";
|
||||
import {businessList} from "../../api/Businessneeds";
|
||||
import {enterpriseProductApprovalList} from "../../api/dataApproval/enterpriseProduct";
|
||||
import {getUnApprovalCount, resetUnApprovalCount,} from "../../api/dataApproval/count";
|
||||
import {casLaboratoryList} from "@/api/dataList/laboratory";
|
||||
|
||||
const useUserStore = defineStore("user", {
|
||||
state: () => ({
|
||||
token: getToken(),
|
||||
name: "",
|
||||
avatar: "",
|
||||
roles: [],
|
||||
permissions: [],
|
||||
unApprovedBusiness: 0,
|
||||
unApprovedExpert: 0,
|
||||
unApprovedAchivement: 0,
|
||||
unApprovedTechnology: 0,
|
||||
unApprovedService: 0,
|
||||
unApprovedProduct: 0,
|
||||
serviceDemandTotal: 0,
|
||||
achievementTotal: 0,
|
||||
technologyTotal: 0,
|
||||
productTotal: 0,
|
||||
}),
|
||||
actions: {
|
||||
// 登录
|
||||
login(userInfo) {
|
||||
const username = userInfo.username.trim();
|
||||
const password = md5(userInfo.password);
|
||||
const code = userInfo.code;
|
||||
const uuid = userInfo.uuid;
|
||||
return new Promise((resolve, reject) => {
|
||||
login(username, password, code, uuid)
|
||||
.then((res) => {
|
||||
setToken(res.token);
|
||||
this.token = res.token;
|
||||
resolve();
|
||||
})
|
||||
.catch((error) => {
|
||||
reject(error);
|
||||
});
|
||||
});
|
||||
},
|
||||
// 获取用户信息
|
||||
getInfo() {
|
||||
return new Promise((resolve, reject) => {
|
||||
getInfo()
|
||||
.then((res) => {
|
||||
const user = res.user;
|
||||
const avatar =
|
||||
user.avatar == "" || user.avatar == null
|
||||
? defAva
|
||||
: import.meta.env.VITE_APP_BASE_API + user.avatar;
|
||||
state: () => ({
|
||||
token: getToken(),
|
||||
name: "",
|
||||
avatar: "",
|
||||
roles: [],
|
||||
permissions: [],
|
||||
unApprovedBusiness: 0,
|
||||
unApprovedExpert: 0,
|
||||
unApprovedAchivement: 0,
|
||||
unApprovedTechnology: 0,
|
||||
unApprovedService: 0,
|
||||
unApprovedProduct: 0,
|
||||
unApprovedLab: 0,
|
||||
serviceDemandTotal: 0,
|
||||
achievementTotal: 0,
|
||||
technologyTotal: 0,
|
||||
productTotal: 0,
|
||||
}),
|
||||
actions: {
|
||||
// 登录
|
||||
login(userInfo) {
|
||||
const username = userInfo.username.trim();
|
||||
const password = md5(userInfo.password);
|
||||
const code = userInfo.code;
|
||||
const uuid = userInfo.uuid;
|
||||
return new Promise((resolve, reject) => {
|
||||
login(username, password, code, uuid)
|
||||
.then((res) => {
|
||||
setToken(res.token);
|
||||
this.token = res.token;
|
||||
resolve();
|
||||
})
|
||||
.catch((error) => {
|
||||
reject(error);
|
||||
});
|
||||
});
|
||||
},
|
||||
// 获取用户信息
|
||||
getInfo() {
|
||||
return new Promise((resolve, reject) => {
|
||||
getInfo()
|
||||
.then((res) => {
|
||||
const user = res.user;
|
||||
const avatar =
|
||||
user.avatar == "" || user.avatar == null
|
||||
? defAva
|
||||
: import.meta.env.VITE_APP_BASE_API + user.avatar;
|
||||
|
||||
if (res.roles && res.roles.length > 0) {
|
||||
// 验证返回的roles是否是一个非空数组
|
||||
this.roles = res.roles;
|
||||
this.permissions = res.permissions;
|
||||
} else {
|
||||
this.roles = ["ROLE_DEFAULT"];
|
||||
}
|
||||
this.name = user.userName;
|
||||
this.avatar = avatar;
|
||||
resolve(res);
|
||||
// return res;
|
||||
})
|
||||
.catch((error) => {
|
||||
reject(error);
|
||||
});
|
||||
});
|
||||
},
|
||||
if (res.roles && res.roles.length > 0) {
|
||||
// 验证返回的roles是否是一个非空数组
|
||||
this.roles = res.roles;
|
||||
this.permissions = res.permissions;
|
||||
} else {
|
||||
this.roles = ["ROLE_DEFAULT"];
|
||||
}
|
||||
this.name = user.userName;
|
||||
this.avatar = avatar;
|
||||
resolve(res);
|
||||
// return res;
|
||||
})
|
||||
.catch((error) => {
|
||||
reject(error);
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
async getApprovalCount() {
|
||||
this.getUnApprovedBusiness();
|
||||
this.getUnApprovedExpert();
|
||||
this.getUnApprovedAchivement();
|
||||
this.getUnApprovedTechnology();
|
||||
this.getUnApprovedService();
|
||||
this.getUnApprovedProduct();
|
||||
this.getServiceDemandTotal();
|
||||
this.getAchievementTotal();
|
||||
this.getProductTotal();
|
||||
this.getTechnologyTotal();
|
||||
},
|
||||
async getApprovalCount() {
|
||||
this.getUnApprovedBusiness();
|
||||
this.getUnApprovedExpert();
|
||||
this.getUnApprovedAchivement();
|
||||
this.getUnApprovedTechnology();
|
||||
this.getUnApprovedService();
|
||||
this.getUnApprovedProduct();
|
||||
this.getServiceDemandTotal();
|
||||
this.getAchievementTotal();
|
||||
this.getProductTotal();
|
||||
this.getTechnologyTotal();
|
||||
this.getUnApprovedLab()
|
||||
},
|
||||
|
||||
async resetUnApproval(name, field) {
|
||||
await resetUnApprovalCount(name);
|
||||
this[field] = 0;
|
||||
},
|
||||
async resetUnApproval(name, field) {
|
||||
await resetUnApprovalCount(name);
|
||||
this[field] = 0;
|
||||
},
|
||||
|
||||
async getUnApprovedBusiness() {
|
||||
const resp = await companyList({
|
||||
examineStatus: 0,
|
||||
pageSize: 1,
|
||||
pageNum: 10,
|
||||
});
|
||||
this.unApprovedBusiness = resp.total;
|
||||
},
|
||||
async getUnApprovedExpert() {
|
||||
const resp = await expertList({
|
||||
examineStatus: 0,
|
||||
pageSize: 1,
|
||||
pageNum: 10,
|
||||
});
|
||||
this.unApprovedExpert = resp.total;
|
||||
},
|
||||
async getUnApprovedAchivement() {
|
||||
const resp = await getUnApprovalCount("achievement");
|
||||
this.unApprovedAchivement = resp.data ?? 0;
|
||||
},
|
||||
async getUnApprovedTechnology() {
|
||||
const resp = await getUnApprovalCount("technology");
|
||||
this.unApprovedTechnology = resp.data ?? 0;
|
||||
},
|
||||
async getUnApprovedService() {
|
||||
const resp = await getUnApprovalCount("service");
|
||||
this.unApprovedService = resp.data ?? 0;
|
||||
},
|
||||
async getUnApprovedProduct() {
|
||||
const resp = await getUnApprovalCount("product");
|
||||
this.unApprovedProduct = resp.data ?? 0;
|
||||
},
|
||||
async getUnApprovedBusiness() {
|
||||
const resp = await companyList({
|
||||
examineStatus: 0,
|
||||
pageSize: 1,
|
||||
pageNum: 10,
|
||||
});
|
||||
this.unApprovedBusiness = resp.total;
|
||||
},
|
||||
async getUnApprovedExpert() {
|
||||
const resp = await expertList({
|
||||
examineStatus: 0,
|
||||
pageSize: 1,
|
||||
pageNum: 10,
|
||||
});
|
||||
this.unApprovedExpert = resp.total;
|
||||
},
|
||||
async getUnApprovedAchivement() {
|
||||
const resp = await getUnApprovalCount("achievement");
|
||||
this.unApprovedAchivement = resp.data ?? 0;
|
||||
},
|
||||
async getUnApprovedTechnology() {
|
||||
const resp = await getUnApprovalCount("technology");
|
||||
this.unApprovedTechnology = resp.data ?? 0;
|
||||
},
|
||||
async getUnApprovedService() {
|
||||
const resp = await getUnApprovalCount("service");
|
||||
this.unApprovedService = resp.data ?? 0;
|
||||
},
|
||||
async getUnApprovedProduct() {
|
||||
const resp = await getUnApprovalCount("product");
|
||||
this.unApprovedProduct = resp.data ?? 0;
|
||||
},
|
||||
|
||||
async getServiceDemandTotal() {
|
||||
const resp = await listCasDemand();
|
||||
this.serviceDemandTotal = resp.total;
|
||||
async getServiceDemandTotal() {
|
||||
const resp = await listCasDemand();
|
||||
this.serviceDemandTotal = resp.total;
|
||||
},
|
||||
async getAchievementTotal() {
|
||||
const resp = await expertAchievementList();
|
||||
this.achievementTotal = resp.total;
|
||||
},
|
||||
async getTechnologyTotal() {
|
||||
const resp = await businessList();
|
||||
this.technologyTotal = resp.total;
|
||||
},
|
||||
async getProductTotal() {
|
||||
const resp = await enterpriseProductApprovalList();
|
||||
this.productTotal = resp.total;
|
||||
},
|
||||
async getUnApprovedLab() {
|
||||
const resp = await casLaboratoryList({
|
||||
examineStatus: 0,
|
||||
pageSize: 1,
|
||||
pageNum: 10,
|
||||
});
|
||||
this.unApprovedBusiness = resp.total;
|
||||
},
|
||||
// 退出系统
|
||||
logOut() {
|
||||
return new Promise((resolve, reject) => {
|
||||
logout(this.token)
|
||||
.then(() => {
|
||||
this.token = "";
|
||||
this.roles = [];
|
||||
this.permissions = [];
|
||||
removeToken();
|
||||
resolve();
|
||||
})
|
||||
.catch((error) => {
|
||||
reject(error);
|
||||
});
|
||||
});
|
||||
},
|
||||
},
|
||||
async getAchievementTotal() {
|
||||
const resp = await expertAchievementList();
|
||||
this.achievementTotal = resp.total;
|
||||
},
|
||||
async getTechnologyTotal() {
|
||||
const resp = await businessList();
|
||||
this.technologyTotal = resp.total;
|
||||
},
|
||||
async getProductTotal() {
|
||||
const resp = await enterpriseProductApprovalList();
|
||||
this.productTotal = resp.total;
|
||||
},
|
||||
// 退出系统
|
||||
logOut() {
|
||||
return new Promise((resolve, reject) => {
|
||||
logout(this.token)
|
||||
.then(() => {
|
||||
this.token = "";
|
||||
this.roles = [];
|
||||
this.permissions = [];
|
||||
removeToken();
|
||||
resolve();
|
||||
})
|
||||
.catch((error) => {
|
||||
reject(error);
|
||||
});
|
||||
});
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
export default useUserStore;
|
||||
|
@ -1,105 +0,0 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div style="width: 50%">
|
||||
<expert-form
|
||||
ref="expertFormRef"
|
||||
v-model="form"
|
||||
:formType="formType"
|
||||
:isAdd="false"
|
||||
:labelWidth="140"
|
||||
:showTitle="true"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div :style="{ marginLeft: 140 + 'px' }">
|
||||
<el-button @click="submitForm('2')">审核拒绝</el-button>
|
||||
<el-button type="primary" @click="submitForm('1')">通过审核</el-button>
|
||||
<!-- <el-button type="primary" @click="submitForm('0')">cancel审核</el-button> -->
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script name="EnterpriseAdd" setup>
|
||||
import ExpertForm from "@/views/components/ExpertForm/index.vue";
|
||||
import tab from "@/plugins/tab";
|
||||
import {companyDetail, companyEdit,} from "@/api/dataList/enterprise";
|
||||
import {reactive, toRefs} from "vue";
|
||||
import {useRoute, useRouter} from "vue-router";
|
||||
import {ElMessage} from "element-plus";
|
||||
import useUserStore from "@/store/modules/user";
|
||||
|
||||
// const testCount = () => {
|
||||
// useUserStore().unApprovedBusinessPlus();
|
||||
// };
|
||||
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const formType = ref(2);
|
||||
const expertFormRef = ref(null);
|
||||
const data = reactive({
|
||||
form: {
|
||||
image: undefined,
|
||||
name: undefined,
|
||||
tenantId: undefined,
|
||||
province: undefined, // 省code
|
||||
city: undefined, // 市code
|
||||
district: undefined, // 区code
|
||||
address: undefined, // 详细地址
|
||||
product: undefined,
|
||||
kind: undefined,
|
||||
code: undefined,
|
||||
inviterCode: undefined,
|
||||
url: undefined,
|
||||
industrys: [],
|
||||
keywords: [],
|
||||
directions: [],
|
||||
introduce: undefined,
|
||||
license: undefined,
|
||||
examineStatus: "",
|
||||
},
|
||||
});
|
||||
|
||||
const {form} = toRefs(data);
|
||||
const cancel = () => {
|
||||
router.back();
|
||||
tab.closeOpenPage();
|
||||
};
|
||||
|
||||
const submitForm = async (state) => {
|
||||
await companyEdit({id: form.value.id, examineStatus: state});
|
||||
useUserStore().getUnApprovedBusiness();
|
||||
cancel();
|
||||
ElMessage.success("已审核");
|
||||
};
|
||||
|
||||
const getDetailById = async () => {
|
||||
if (route.query.id) {
|
||||
const {data} = await companyDetail(route.query.id);
|
||||
form.value = data;
|
||||
}
|
||||
};
|
||||
getDetailById();
|
||||
</script>
|
||||
|
||||
<!-- <script>
|
||||
export default {
|
||||
components: {
|
||||
ExpertForm,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// formType: 2,
|
||||
// labelWidth: 140,
|
||||
};
|
||||
},
|
||||
methods: {},
|
||||
created() {
|
||||
const { id } = this.$route.query;
|
||||
if (id) {
|
||||
companyDetail({ id }).then((res) => {
|
||||
form.value = res.data;
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
</script> -->
|
@ -1,225 +0,0 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 顶部搜索区域 -->
|
||||
<el-form :model="queryData" :inline="true">
|
||||
<el-form-item label="企业名称">
|
||||
<el-input
|
||||
style="width: 150px"
|
||||
v-model="queryData.name"
|
||||
placeholder="请输入关键字"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="审核状态">
|
||||
<el-select
|
||||
style="width: 100px"
|
||||
v-model="queryData.examineStatus"
|
||||
class="m-2"
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option label="已审核" :value="1" />
|
||||
<el-option label="已拒绝" :value="2" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="企业类型">
|
||||
<el-select
|
||||
style="width: 100px"
|
||||
v-model="queryData.kind"
|
||||
class="m-2"
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option :value="101" label="上市企业" />
|
||||
<el-option :value="102" label="优质企业" />
|
||||
<el-option :value="103" label="普通企业" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="站点">
|
||||
<site-options
|
||||
v-model="queryData.tenantId"
|
||||
:site-list="siteList"
|
||||
style="width: 160px"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
|
||||
<el-form-item style="float: right">
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="search"
|
||||
size="default"
|
||||
@click="handleQuery"
|
||||
>搜索</el-button
|
||||
>
|
||||
<el-button icon="refresh" size="default" @click="resetQuery"
|
||||
>重置</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<!--表格区域-->
|
||||
<el-table :data="dataList" style="width: 100%" border>
|
||||
<el-table-column prop="name" label="企业名称" align="center" />
|
||||
<!-- <el-table-column prop="code" label="统一社会信用代码" align="center" /> -->
|
||||
<el-table-column label="所属领域" align="center">
|
||||
<template #default="{ row }">
|
||||
<div>{{ row.industrys[row.industrys.length - 1] }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column prop="" label="站点" align="center">
|
||||
<template #default="{ row }">
|
||||
{{ siteList.find((el) => el.id === row.tenantId)?.name ?? "无" }}
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column prop="address" label="所在地" align="center" />
|
||||
<el-table-column prop="examineStatus" label="审核状态" align="center">
|
||||
<template #default="{ row }">
|
||||
{{ examineStatusDict[row.examineStatus] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="kind" label="企业类型" align="center">
|
||||
<template #default="{ row }">
|
||||
<div>
|
||||
{{ enterpriseOptions.find((e) => row.kind == e.key).value }}
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="createdAt" label="申请时间" align="center" />
|
||||
<el-table-column prop="" label="操作" width="200px" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-button size="small" type="text" @click="handleDetail(row.id)"
|
||||
>审核</el-button
|
||||
>
|
||||
<el-button size="small" type="text" @click="delList(row.id)"
|
||||
>删除</el-button
|
||||
>
|
||||
<el-button size="small" type="text" @click="setType(row)"
|
||||
>设置企业类型</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- 分页器 -->
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryData.pageNum"
|
||||
v-model:limit="queryData.page_size"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 设置企业类型弹框 -->
|
||||
<el-dialog title="设置企业类型" v-model="isShow">
|
||||
<el-row type="flex" justify="center" style="height: 100px">
|
||||
<el-radio-group v-model="setTypeRow.kind">
|
||||
<el-radio
|
||||
v-for="{ key, value } in enterpriseOptions"
|
||||
:key="key"
|
||||
:label="key"
|
||||
>{{ value }}</el-radio
|
||||
>
|
||||
<!-- <el-radio label="101">上市企业</el-radio> -->
|
||||
<!-- <el-radio label="102">优质企业</el-radio> -->
|
||||
<!-- <el-radio label="103">普通企业</el-radio> -->
|
||||
</el-radio-group>
|
||||
</el-row>
|
||||
<el-row type="flex" justify="end">
|
||||
<el-button type="" @click="isShow = false">取消</el-button>
|
||||
<el-button type="primary" @click="btnType">确认</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import SiteOptions from "@/views/components/SiteOptions";
|
||||
import { enterpriseList, editType, delItem } from "@/api/dataList/list";
|
||||
import { tenantSelect } from "@/api/subPlatform/tenant";
|
||||
import { enterpriseOptions } from "@/utils/parameter";
|
||||
import { reactive, ref } from "vue";
|
||||
import { ElMessageBox } from "element-plus";
|
||||
import { cloneDeep } from "lodash";
|
||||
import { useRouter } from "vue-router";
|
||||
import useUserStore from "@/store/modules/user";
|
||||
|
||||
const data = reactive({
|
||||
queryData: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
examineStatus: "",
|
||||
},
|
||||
setTypeRow: {},
|
||||
});
|
||||
const router = useRouter();
|
||||
const total = ref(0);
|
||||
const dataList = ref([]);
|
||||
const { queryData, setTypeRow } = toRefs(data);
|
||||
// const siteList = ref([]);
|
||||
const isShow = ref(false);
|
||||
const radioList = ref("");
|
||||
const examineStatusDict = {
|
||||
0: "审核中",
|
||||
1: "已通过",
|
||||
2: "已拒绝",
|
||||
};
|
||||
// 临时id
|
||||
const id = ref("");
|
||||
// 获取企业列表
|
||||
const getList = async () => {
|
||||
const res = await enterpriseList(queryData.value);
|
||||
dataList.value = res.rows;
|
||||
total.value = res.total;
|
||||
};
|
||||
// // 获取站点列表
|
||||
// const getSiteList = async () => {
|
||||
// const resp = await tenantSelect();
|
||||
// siteList.value = resp.rows;
|
||||
// };
|
||||
// 搜索查询
|
||||
const handleQuery = () => {
|
||||
getList(queryData.value);
|
||||
};
|
||||
// 重置按钮
|
||||
const resetQuery = () => {
|
||||
queryData.value = {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
examineStatus: "",
|
||||
};
|
||||
getList();
|
||||
};
|
||||
// 企业类型弹框
|
||||
const setType = (row) => {
|
||||
// radioList.value = row.kind;
|
||||
isShow.value = true;
|
||||
// id.value = row.id;
|
||||
setTypeRow.value = cloneDeep(row);
|
||||
};
|
||||
// 发送修改类型请求
|
||||
|
||||
const btnType = async () => {
|
||||
await editType({ id: setTypeRow.value.id, kind: setTypeRow.value.kind });
|
||||
getList();
|
||||
isShow.value = false;
|
||||
};
|
||||
// 删除按钮
|
||||
const delList = async (id) => {
|
||||
ElMessageBox.confirm(`是否确认删除编号为${id}的数据项?`)
|
||||
.then(async () => {
|
||||
await delItem(id);
|
||||
getList();
|
||||
ElMessage.success("删除成功");
|
||||
})
|
||||
.catch(() => {});
|
||||
getList();
|
||||
};
|
||||
// 跳转详情页
|
||||
const handleDetail = (id) => {
|
||||
router.push({
|
||||
path: "/approval/dataList/add",
|
||||
query: { id },
|
||||
});
|
||||
};
|
||||
getList();
|
||||
// getSiteList();
|
||||
useUserStore().getUnApprovedBusiness();
|
||||
</script>
|
||||
<style></style>
|
@ -244,21 +244,16 @@ export default {
|
||||
font-weight: 700;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
::v-deep .el-upload--picture-card {
|
||||
:deep(.el-upload--picture-card) {
|
||||
width: 100%;
|
||||
}
|
||||
::v-deep .hide {
|
||||
:deep(.hide) {
|
||||
height: 148px;
|
||||
}
|
||||
::v-deep .el-upload-list--picture-card .el-upload-list__item {
|
||||
:deep(.el-upload-list--picture-card .el-upload-list__item) {
|
||||
width: 100%;
|
||||
}
|
||||
// 上传图片框限制
|
||||
// ::v-deep .el-upload--picture-card {
|
||||
// width: 120px;
|
||||
// height: 120px;
|
||||
// line-height: 120px;
|
||||
// }
|
||||
|
||||
.el-select,
|
||||
.el-date-editor {
|
||||
display: block;
|
||||
|
@ -152,8 +152,17 @@
|
||||
<!-- </el-col>-->
|
||||
<el-col :span="12">
|
||||
<el-form-item label="所属实验室:">
|
||||
<infinite-select v-model="modelValue.laboratoryId" :prop="{label:'name',value:'id',}" :query="{page:'pageNum',size:'pageSize',searchKey:'name'}"
|
||||
:remote-method="loadLabOptions"
|
||||
<infinite-select v-model="modelValue.laboratoryId" :prop="{label:'name',value:'id',}"
|
||||
:query="{page:'pageNum',size:'pageSize',searchKey:'name'}"
|
||||
:remote-method="loadLabOptions" :default-label="modelValue.laboratoryName"
|
||||
class="infinite-select" prefix-icon="pointer"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="所属研究机构:">
|
||||
<infinite-select v-model="modelValue.researchId" :default-label="modelValue.researchName"
|
||||
:prop="{label:'name',value:'id',}"
|
||||
:query="{page:'pageNum',size:'pageSize',searchKey:'name'}" :remote-method="loadResearchOptions"
|
||||
class="infinite-select" prefix-icon="pointer"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -175,16 +184,16 @@
|
||||
</el-row>
|
||||
|
||||
<el-row v-if="formType == 1">
|
||||
<el-col :span="12">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="毕业院校:" prop="school">
|
||||
<el-input v-model="modelValue.school"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="所属研究机构:" prop="organization">
|
||||
<el-input v-model="modelValue.organization"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="12">-->
|
||||
<!-- <el-form-item label="所属研究机构:" prop="organization">-->
|
||||
<!-- <el-input v-model="modelValue.organization"></el-input>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
</el-row>
|
||||
|
||||
<el-row v-if="formType == 1">
|
||||
@ -344,6 +353,7 @@ import WangEditor from "@/components/WangEditor/index.vue";
|
||||
import FieldOptions from "@/views/components/FieldOptions";
|
||||
import {casLaboratoryList} from "@/api/dataList/laboratory";
|
||||
import InfiniteSelect from '@/components/InfiniteSelect'
|
||||
import {researchList} from "@/api/dataList/research";
|
||||
|
||||
|
||||
const props = defineProps({
|
||||
@ -482,6 +492,7 @@ const getSiteList = async () => {
|
||||
};
|
||||
|
||||
const loadLabOptions = (query) => casLaboratoryList({...query, examineStatus: "1"}).then(resp => resp.rows)
|
||||
const loadResearchOptions = (query) => researchList({...query, examineStatus: "1"}).then(resp => resp.rows)
|
||||
getSiteList();
|
||||
defineExpose({
|
||||
validateForm,
|
||||
|
@ -1,28 +1,27 @@
|
||||
<template>
|
||||
<el-form
|
||||
:disabled="!isAdd"
|
||||
ref="form"
|
||||
:model="value"
|
||||
:rules="rules"
|
||||
:label-width="labelWidth + 'px'"
|
||||
ref="form"
|
||||
:label-width="labelWidth + 'px'"
|
||||
:model="modelValue"
|
||||
:rules="rules"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="所属领域:" required>
|
||||
<el-row type="flex" justify="space-between">
|
||||
<el-form-item label="所属领域:">
|
||||
<el-row justify="space-between" type="flex">
|
||||
<el-col :span="7">
|
||||
<el-form-item prop="industrys">
|
||||
<el-select
|
||||
v-model="value.industrys[0]"
|
||||
value-key="id"
|
||||
placeholder="请选择"
|
||||
@change="levelIChange"
|
||||
v-model="modelValue.industrys[0]"
|
||||
placeholder="请选择"
|
||||
value-key="id"
|
||||
@change="levelIChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in levelI"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
v-for="item in levelI"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
@ -30,31 +29,31 @@
|
||||
</el-col>
|
||||
<el-col :span="7">
|
||||
<el-select
|
||||
v-model="value.industrys[1]"
|
||||
value-key="id"
|
||||
placeholder="请选择"
|
||||
@change="levelIIChange"
|
||||
v-model="modelValue.industrys[1]"
|
||||
placeholder="请选择"
|
||||
value-key="id"
|
||||
@change="levelIIChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in levelII"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
v-for="item in levelII"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="7">
|
||||
<el-select
|
||||
v-model="value.industrys[2]"
|
||||
value-key="id"
|
||||
placeholder="请选择"
|
||||
v-model="modelValue.industrys[2]"
|
||||
placeholder="请选择"
|
||||
value-key="id"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in levelIII"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
v-for="item in levelIII"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
@ -65,91 +64,77 @@
|
||||
</el-row>
|
||||
</el-form>
|
||||
</template>
|
||||
<script>
|
||||
import { industry } from "@/api/config";
|
||||
export default {
|
||||
props: {
|
||||
value: Object,
|
||||
isAdd: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
labelWidth: {
|
||||
type: Number,
|
||||
default: 120,
|
||||
},
|
||||
|
||||
<script setup>
|
||||
import {listSysIndustry} from "@/api/platform/industry";
|
||||
// import { watch } from "fs";
|
||||
import {reactive, toRefs, watch} from "vue";
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: Object,
|
||||
labelWidth: {
|
||||
type: Number,
|
||||
default: 120,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
levelI: [], // I级数据
|
||||
levelII: [], // II级数据
|
||||
levelIII: [], // III级数据
|
||||
rules: {
|
||||
industrys: [
|
||||
{
|
||||
type: "array",
|
||||
required: true,
|
||||
message: "请选择",
|
||||
trigger: "change",
|
||||
},
|
||||
],
|
||||
});
|
||||
const {modelValue, labelWidth} = toRefs(props);
|
||||
const data = reactive({
|
||||
rules: {
|
||||
industrys: [
|
||||
{
|
||||
type: "array",
|
||||
required: true,
|
||||
message: "请选择",
|
||||
trigger: "change",
|
||||
},
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
value(newOld) {
|
||||
const data = Object.assign({}, newOld);
|
||||
let key = [];
|
||||
for (let i = 0; i < data.industrys.length; i++) {
|
||||
key.push(data.industrys[i].key);
|
||||
}
|
||||
if (key.length > 0) {
|
||||
this.levelIChange(key[0]);
|
||||
}
|
||||
if (key.length > 1) {
|
||||
this.levelIIChange(key[1]);
|
||||
}
|
||||
newOld.industrys = key;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
getFieldByParent(id) {
|
||||
return new Promise((resolve, reject) => {
|
||||
industry({ parent_id: id })
|
||||
.then(({ code, msg, data }) => {
|
||||
if (code == 200) {
|
||||
resolve(data);
|
||||
} else {
|
||||
this.$modal.msgError(msg);
|
||||
reject({ msg, code });
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
reject(error);
|
||||
});
|
||||
});
|
||||
},
|
||||
async levelIChange(id) {
|
||||
this.value.industrys[1] = "";
|
||||
this.value.industrys[2] = "";
|
||||
this.levelII = await this.getFieldByParent(id);
|
||||
},
|
||||
async levelIIChange(id) {
|
||||
this.value.industrys[2] = "";
|
||||
this.levelIII = await this.getFieldByParent(id);
|
||||
},
|
||||
submitForm() {
|
||||
let flag = false;
|
||||
this.$refs["form"].validate((valid) => {
|
||||
flag = valid;
|
||||
});
|
||||
return flag;
|
||||
},
|
||||
},
|
||||
created() {
|
||||
industry().then((res) => {
|
||||
this.levelI = res.data;
|
||||
});
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
const {rules} = toRefs(data);
|
||||
const levelI = ref([]);
|
||||
const levelII = ref([]);
|
||||
const levelIII = ref([]);
|
||||
|
||||
// 获取领域树形列表
|
||||
const getIndustryTreeData = async () => {
|
||||
const {data} = await listSysIndustry();
|
||||
levelI.value = data;
|
||||
};
|
||||
</script>
|
||||
|
||||
const levelIChange = async (item) => {
|
||||
delete modelValue.value.industrys[1];
|
||||
delete modelValue.value.industrys[2];
|
||||
// levelII.value = levelI.value.find((el) => {
|
||||
// return el.id === item;
|
||||
// }).children;
|
||||
};
|
||||
|
||||
const levelIIChange = async (item) => {
|
||||
delete modelValue.value.industrys[2];
|
||||
// levelIII.value = levelII.value.find((el) => el.id === item).children;
|
||||
};
|
||||
getIndustryTreeData().then(() => {
|
||||
watch(
|
||||
() => modelValue.value.industrys[0],
|
||||
(val) => {
|
||||
levelII.value =
|
||||
levelI.value.find((el) => {
|
||||
return el.id == val;
|
||||
})?.children ?? [];
|
||||
},
|
||||
{immediate: true}
|
||||
);
|
||||
watch(
|
||||
() => modelValue.value.industrys[1],
|
||||
(val) => {
|
||||
levelIII.value =
|
||||
levelII.value.find((el) => {
|
||||
return el.id == val;
|
||||
})?.children ?? [];
|
||||
},
|
||||
{immediate: true}
|
||||
);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
@ -357,12 +357,7 @@ export default {
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
// 上传图片框限制
|
||||
// ::v-deep .el-upload--picture-card {
|
||||
// width: 120px;
|
||||
// height: 120px;
|
||||
// line-height: 120px;
|
||||
// }
|
||||
|
||||
.el-select,
|
||||
.el-date-editor {
|
||||
display: block;
|
||||
|
@ -210,12 +210,7 @@ export default {
|
||||
font-weight: 700;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
// 上传图片框限制
|
||||
// ::v-deep .el-upload--picture-card {
|
||||
// width: 120px;
|
||||
// height: 120px;
|
||||
// line-height: 120px;
|
||||
// }
|
||||
|
||||
.el-select,
|
||||
.el-date-editor {
|
||||
display: block;
|
||||
|
@ -1,15 +1,15 @@
|
||||
<template>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="modelValue"
|
||||
:rules="rules"
|
||||
:label-width="labelWidth + 'px'"
|
||||
ref="formRef"
|
||||
:label-width="labelWidth + 'px'"
|
||||
:model="modelValue"
|
||||
:rules="rules"
|
||||
>
|
||||
<div class="form_title" v-if="showTitle">基本信息</div>
|
||||
<div v-if="showTitle" class="form_title">基本信息</div>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="机构logo" prop="image">
|
||||
<ImageUpload v-model="modelValue.image" :fileSize="2" :limit="1" />
|
||||
<ImageUpload v-model="modelValue.image" :fileSize="2" :limit="1"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -25,29 +25,20 @@
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="组织机构代码:" prop="code">
|
||||
<el-row type="flex" justify="space-between">
|
||||
<el-col :span="20">
|
||||
<el-input v-model="modelValue.code" :disabled="!isAdd"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-button type="primary" @click="" :disabled="!isAdd"
|
||||
>查找</el-button
|
||||
>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-input v-model="modelValue.code" :disabled="!isAdd"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="所属站点:" prop="tenant_id">
|
||||
<SiteOptions :size="''" :limitWidth="false" v-model="modelValue" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!-- <el-row>-->
|
||||
<!-- <el-col :span="24">-->
|
||||
<!-- <el-form-item label="所属站点:" prop="tenantId">-->
|
||||
<!-- <SiteOptions v-model="modelValue.tenantId" :limitWidth="false" :site-list="siteList"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- </el-row>-->
|
||||
|
||||
<CityOptions v-model="modelValue" :labelWidth="labelWidth" ref="cityForm" />
|
||||
<CityOptions ref="cityForm" v-model="modelValue" :labelWidth="labelWidth"/>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
@ -57,29 +48,27 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<FieldSingle
|
||||
v-model="modelValue"
|
||||
:isAdd="isAdd"
|
||||
:labelWidth="labelWidth"
|
||||
ref="fieldForm"
|
||||
/>
|
||||
<field-options
|
||||
ref="fieldForm"
|
||||
v-model="modelValue"
|
||||
:isAdd="isAdd" :labelWidth="labelWidth"/>
|
||||
|
||||
<InputBoxAdd
|
||||
:labelWidth="labelWidth"
|
||||
v-model="modelValue"
|
||||
title="研究方向"
|
||||
placeholder="请输入研究方向"
|
||||
fieldKey="researchs"
|
||||
ref="directionsForm"
|
||||
ref="directionsForm"
|
||||
v-model="modelValue"
|
||||
:labelWidth="labelWidth"
|
||||
fieldKey="researchs"
|
||||
placeholder="请输入研究方向"
|
||||
title="研究方向"
|
||||
/>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="营业执照:" prop="license">
|
||||
<ImageUpload
|
||||
v-model="modelValue.license"
|
||||
:isShowTip="false"
|
||||
:limit="1"
|
||||
v-model="modelValue.license"
|
||||
:isShowTip="false"
|
||||
:limit="1"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -89,28 +78,25 @@
|
||||
<el-col :span="24">
|
||||
<el-form-item label="机构简介" prop="introduce">
|
||||
<WangEditor
|
||||
v-model="modelValue.introduce"
|
||||
:minHeight="150"
|
||||
v-model="modelValue.introduce"
|
||||
minHeight="350px"
|
||||
></WangEditor>
|
||||
<!-- <Editor
|
||||
v-model="value.introduce"
|
||||
:minHeight="150"
|
||||
ref="introduceRef"
|
||||
@click.native="handleEditAble"
|
||||
/> -->
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script setup name="ResearchForm">
|
||||
<script name="ResearchForm" setup>
|
||||
import CityOptions from "@/views/components/CityOptions";
|
||||
import FieldSingle from "@/views/components/FieldSingle";
|
||||
import InputBoxAdd from "@/views/components/InputBoxAdd";
|
||||
// import { researchSelect } from "@/api/dataList/research";
|
||||
// import { laboratorySelect } from "@/api/dataList/laboratory";
|
||||
import { reactive, ref, toRefs } from "vue";
|
||||
import SiteOptions from "@/views/components/SiteOptions"
|
||||
import FieldOptions from "@/views/components/FieldOptions";
|
||||
import {onMounted, reactive, ref, toRefs} from "vue";
|
||||
import {tenantSelect} from "@/api/subPlatform/tenant";
|
||||
|
||||
const siteList = ref([])
|
||||
const props = defineProps({
|
||||
modelValue: Object,
|
||||
isAdd: {
|
||||
@ -126,22 +112,22 @@ const props = defineProps({
|
||||
default: 120,
|
||||
},
|
||||
});
|
||||
const { modelValue, isAdd, showTitle, labelWidth } = toRefs(props);
|
||||
const {modelValue, isAdd, showTitle, labelWidth} = toRefs(props);
|
||||
const data = reactive({
|
||||
rules: {
|
||||
product: [{ required: true, message: "请输入", trigger: "blur" }],
|
||||
name: [{ required: true, message: "请输入", trigger: "blur" }],
|
||||
kind: [{ required: true, message: "请选择", trigger: "change" }],
|
||||
code: [{ required: true, message: "请输入", trigger: "blur" }],
|
||||
product: [{required: true, message: "请输入", trigger: "blur"}],
|
||||
name: [{required: true, message: "请输入", trigger: "blur"}],
|
||||
kind: [{required: true, message: "请选择", trigger: "change"}],
|
||||
code: [{required: true, message: "请输入", trigger: "blur"}],
|
||||
mobile: [
|
||||
{ required: true, message: "请输入", trigger: "blur" },
|
||||
{required: true, message: "请输入", trigger: "blur"},
|
||||
{
|
||||
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
|
||||
pattern: /^1[3-9]\d{9}$/,
|
||||
message: "请输入正确的手机号码",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
research_id: [{ required: true, message: "请选择", trigger: "change" }],
|
||||
research_id: [{required: true, message: "请选择", trigger: "change"}],
|
||||
tenant_id: [
|
||||
{
|
||||
required: true,
|
||||
@ -149,11 +135,11 @@ const data = reactive({
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
],
|
||||
school: [{ required: true, message: "请输入", trigger: "blur" }],
|
||||
education: [{ required: true, message: "请选择", trigger: "change" }],
|
||||
major: [{ required: true, message: "请输入", trigger: "blur" }],
|
||||
job: [{ required: true, message: "请输入", trigger: "blur" }],
|
||||
title: [{ required: true, message: "请输入", trigger: "blur" }],
|
||||
school: [{required: true, message: "请输入", trigger: "blur"}],
|
||||
education: [{required: true, message: "请选择", trigger: "change"}],
|
||||
major: [{required: true, message: "请输入", trigger: "blur"}],
|
||||
job: [{required: true, message: "请输入", trigger: "blur"}],
|
||||
title: [{required: true, message: "请输入", trigger: "blur"}],
|
||||
work_at: [
|
||||
{
|
||||
required: true,
|
||||
@ -168,15 +154,21 @@ const data = reactive({
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
],
|
||||
introduce: [{ required: true, message: "请输入", trigger: "blur" }],
|
||||
introduce: [{required: true, message: "请输入", trigger: "blur"}],
|
||||
},
|
||||
});
|
||||
const researchOptions = ref([]);
|
||||
const options = ref([
|
||||
// { value: "", label: "" }
|
||||
]);
|
||||
const {rules} = toRefs(data)
|
||||
const options = ref([]);
|
||||
|
||||
// 获取站点列表
|
||||
const getSiteList = async () => {
|
||||
const resp = await tenantSelect();
|
||||
siteList.value = resp.rows;
|
||||
};
|
||||
|
||||
|
||||
const formRef = ref();
|
||||
|
||||
const validateForm = async () => {
|
||||
try {
|
||||
return await formRef.value.validate();
|
||||
@ -187,67 +179,19 @@ const validateForm = async () => {
|
||||
defineExpose({
|
||||
validateForm,
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
formRef.value?.resetFields()
|
||||
getSiteList();
|
||||
})
|
||||
</script>
|
||||
<!-- <script>
|
||||
import CityOptions from "@/views/components/CityOptions";
|
||||
import FieldSingle from "@/views/components/FieldSingle";
|
||||
import InputBoxAdd from "@/views/components/InputBoxAdd";
|
||||
import { researchSelect } from "@/api/dataList/research";
|
||||
import { laboratorySelect } from "@/api/dataList/laboratory";
|
||||
import { reactive, toRefs } from "vue";
|
||||
export default {
|
||||
components: {
|
||||
CityOptions,
|
||||
FieldSingle,
|
||||
InputBoxAdd,
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.introduceRef.Quill.enable(false);
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
// 富文本聚焦
|
||||
handleEditAble() {
|
||||
this.$refs.introduceRef.Quill.enable(true);
|
||||
this.$refs.introduceRef.Quill.focus();
|
||||
},
|
||||
setLaboratory(e) {
|
||||
laboratorySelect({ research_id: e }).then((res) => {
|
||||
console.log(res);
|
||||
});
|
||||
},
|
||||
submitForm() {
|
||||
let flag = false;
|
||||
this.$refs["form"].validate((valid) => {
|
||||
const cityForm = this.$refs.cityForm.submitForm();
|
||||
const fieldForm = this.$refs.fieldForm.submitForm();
|
||||
if (valid && cityForm && fieldForm) {
|
||||
flag = !flag;
|
||||
}
|
||||
});
|
||||
return flag;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script> -->
|
||||
<style lang="scss" scoped>
|
||||
.form_title {
|
||||
font-weight: 700;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
// 上传图片框限制
|
||||
// ::v-deep .el-upload--picture-card {
|
||||
// width: 120px;
|
||||
// height: 120px;
|
||||
// line-height: 120px;
|
||||
// }
|
||||
|
||||
.el-select,
|
||||
.el-date-editor {
|
||||
display: block;
|
||||
|
@ -377,12 +377,7 @@ const submitForm = async (status) => {
|
||||
font-weight: 700;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
// 上传图片框限制
|
||||
// ::v-deep .el-upload--picture-card {
|
||||
// width: 120px;
|
||||
// height: 120px;
|
||||
// line-height: 120px;
|
||||
// }
|
||||
|
||||
.el-select,
|
||||
.el-date-editor {
|
||||
display: block;
|
||||
|
162
src/views/dataList/agent/index.vue
Normal file
162
src/views/dataList/agent/index.vue
Normal file
@ -0,0 +1,162 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form
|
||||
ref="queryFormRef"
|
||||
:inline="true"
|
||||
:model="queryParams"
|
||||
label-width="85px"
|
||||
>
|
||||
<el-form-item label="实验室名称" prop="name">
|
||||
<el-input
|
||||
v-model="queryParams.name"
|
||||
clearable
|
||||
placeholder="请输入实验室名称"
|
||||
size="small"
|
||||
style="width: 240px"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="isSuper" label="所属站点" prop="tenant_id">
|
||||
<SiteOptions v-model="queryParams"/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button
|
||||
icon="el-icon-search"
|
||||
size="small"
|
||||
type="primary"
|
||||
@click="handleQuery"
|
||||
>搜索
|
||||
</el-button
|
||||
>
|
||||
<el-button icon="el-icon-refresh" size="small" @click="resetQuery"
|
||||
>重置
|
||||
</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<!-- <el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="small"
|
||||
@click="handleAdd"
|
||||
>新增</el-button
|
||||
>
|
||||
</el-col>
|
||||
<right-toolbar
|
||||
:showSearch.sync="showSearch"
|
||||
@queryTable="getList"
|
||||
></right-toolbar>
|
||||
</el-row> -->
|
||||
|
||||
<el-table v-loading="loading" :data="dataList">
|
||||
<el-table-column align="center" label="数据编号" prop="id"/>
|
||||
<el-table-column align="center" label="实验室名称" prop="name"/>
|
||||
<el-table-column align="center" label="研究机构" prop="research_name"/>
|
||||
<!-- <el-table-column label="研究方向" align="center" prop="code" />
|
||||
<el-table-column
|
||||
label="所属领域"
|
||||
align="center"
|
||||
prop="industrys"
|
||||
show-overflow-tooltip
|
||||
>
|
||||
<template #default="{row}">
|
||||
<div>{{ row.industrys[row.industrys.length - 1] }}</div>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column align="center" label="站点" prop="area"/>
|
||||
<el-table-column align="center" label="所在地" prop="address"/>
|
||||
<el-table-column align="center" label="申请时间" prop="created_at">
|
||||
<template #default="{row}">
|
||||
<span>{{ parseTime(row.created_at) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作">
|
||||
<template #default="{row}">
|
||||
<el-button
|
||||
icon="el-icon-edit"
|
||||
size="small"
|
||||
type="text"
|
||||
@click="handleDetail(row.id)"
|
||||
>修改
|
||||
</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
v-model:page="queryParams.pageNum"
|
||||
:total="total"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
// 遮罩层
|
||||
import {reactive, ref, toRefs} from "vue";
|
||||
import {useRouter} from "vue-router";
|
||||
|
||||
/* TODO: is_super: this.$store.getters.is_super, */
|
||||
|
||||
const router = useRouter()
|
||||
const showSearch = ref(true)
|
||||
const loading = ref(true)
|
||||
const total = ref(0) /*总条数*/
|
||||
const dataList = ref(null) /*实验室表格数据*/
|
||||
const queryFormRef = ref()
|
||||
const isSuper = ref(false)
|
||||
const data = reactive({
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
name: undefined,
|
||||
},
|
||||
})
|
||||
|
||||
const {queryParams} = toRefs(data)
|
||||
|
||||
|
||||
/*查询实验室列表*/
|
||||
const getList = () => {
|
||||
loading.value = true;
|
||||
agentList(queryParams.value).then((response) => {
|
||||
dataList.value = response.data.data;
|
||||
total.value = response.data.count;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.page_num = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
/* 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
// dateRange.value = [];
|
||||
queryFormRef.value?.resetFields()
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
const handleAdd = () => {
|
||||
router.push({
|
||||
path: "/dataList/agentAdd",
|
||||
});
|
||||
}
|
||||
const handleDetail = (id) => {
|
||||
router.push({
|
||||
path: "/dataList/agentAdd",
|
||||
query: {id},
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
@ -1,20 +1,20 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form
|
||||
v-show="showSearch"
|
||||
:model="queryParams"
|
||||
ref="queryFormRef"
|
||||
:inline="true"
|
||||
label-width="68px"
|
||||
v-show="showSearch"
|
||||
ref="queryFormRef"
|
||||
:inline="true"
|
||||
:model="queryParams"
|
||||
label-width="68px"
|
||||
>
|
||||
<el-form-item label="企业名称" prop="name">
|
||||
<el-input
|
||||
v-model="queryParams.name"
|
||||
placeholder="请输入企业名称"
|
||||
clearable
|
||||
size="default"
|
||||
style="width: 240px"
|
||||
@keyup.enter.native="handleQuery"
|
||||
v-model="queryParams.name"
|
||||
clearable
|
||||
placeholder="请输入企业名称"
|
||||
size="default"
|
||||
style="width: 240px"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="所属站点" prop="tenantId">
|
||||
@ -23,14 +23,16 @@
|
||||
|
||||
<el-form-item>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="search"
|
||||
size="default"
|
||||
@click="handleQuery"
|
||||
>搜索</el-button
|
||||
icon="search"
|
||||
size="default"
|
||||
type="primary"
|
||||
@click="handleQuery"
|
||||
>搜索
|
||||
</el-button
|
||||
>
|
||||
<el-button icon="refresh" size="default" @click="resetQuery"
|
||||
>重置</el-button
|
||||
>重置
|
||||
</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@ -38,59 +40,63 @@
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="plus"
|
||||
size="default"
|
||||
@click="handleAdd"
|
||||
>新增</el-button
|
||||
icon="plus"
|
||||
plain
|
||||
size="default"
|
||||
type="primary"
|
||||
@click="handleAdd"
|
||||
>新增
|
||||
</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="info"
|
||||
plain
|
||||
icon="upload"
|
||||
size="default"
|
||||
@click="handleImport"
|
||||
>导入</el-button
|
||||
icon="upload"
|
||||
plain
|
||||
size="default"
|
||||
type="info"
|
||||
@click="handleImport"
|
||||
>导入
|
||||
</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="download"
|
||||
size="default"
|
||||
@click="handleExport"
|
||||
>导出</el-button
|
||||
icon="download"
|
||||
plain
|
||||
size="default"
|
||||
type="warning"
|
||||
@click="handleExport"
|
||||
>导出
|
||||
</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
:disabled="!ids.length"
|
||||
type="danger"
|
||||
icon="delete"
|
||||
@click="handleDelete()"
|
||||
>批量删除</el-button
|
||||
:disabled="!ids.length"
|
||||
icon="delete"
|
||||
type="danger"
|
||||
@click="handleDelete()"
|
||||
>批量删除
|
||||
</el-button
|
||||
>
|
||||
</el-col>
|
||||
<right-toolbar
|
||||
:showSearch.sync="showSearch"
|
||||
@queryTable="getList"
|
||||
:showSearch.sync="showSearch"
|
||||
@queryTable="getList"
|
||||
></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="dataList"
|
||||
@selection-change="handleSelectionChange"
|
||||
v-loading="loading"
|
||||
:data="dataList"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="数据编号" align="center" prop="id" />
|
||||
<el-table-column label="企业名称" align="center" prop="name" />
|
||||
<el-table-column type="selection" width="55"/>
|
||||
<el-table-column align="center" label="数据编号" prop="id"/>
|
||||
<el-table-column align="center" label="企业名称" prop="name"/>
|
||||
<!-- <el-table-column label="统一社会信用代码" align="center" prop="code" /> -->
|
||||
<el-table-column label="所属领域" align="center" show-overflow-tooltip>
|
||||
<el-table-column align="center" label="所属领域" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<div>{{ row.industrys[row.industrys.length - 1] }}</div>
|
||||
</template>
|
||||
@ -100,88 +106,95 @@
|
||||
{{ siteList.find((el) => el.id === row.tenantId)?.name ?? "无" }}
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="所在地" align="center" prop="address" />
|
||||
<el-table-column label="企业类型" align="center" prop="kind">
|
||||
<el-table-column align="center" label="所在地" prop="address"/>
|
||||
<el-table-column align="center" label="企业类型" prop="kind">
|
||||
<template #default="{ row }">
|
||||
<div>
|
||||
{{ enterpriseOptions.find((e) => row.kind == e.key).value }}
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="申请时间" align="center">
|
||||
<el-table-column align="center" label="申请时间">
|
||||
<template #default="{ row }">
|
||||
<span>{{ row.createdAt }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center">
|
||||
<el-table-column align="center" label="操作">
|
||||
<template #default="{ row }">
|
||||
<el-button
|
||||
size="small"
|
||||
type="text"
|
||||
icon="edit"
|
||||
@click="handleDetail(row.id)"
|
||||
>修改</el-button
|
||||
icon="edit"
|
||||
size="small"
|
||||
type="text"
|
||||
@click="handleDetail(row.id)"
|
||||
>修改
|
||||
</el-button
|
||||
>
|
||||
<el-button
|
||||
size="small"
|
||||
type="text"
|
||||
icon="delete"
|
||||
@click="handleDelete(row.id)"
|
||||
>删除</el-button
|
||||
icon="delete"
|
||||
size="small"
|
||||
type="text"
|
||||
@click="handleDelete(row.id)"
|
||||
>删除
|
||||
</el-button
|
||||
>
|
||||
<el-button
|
||||
size="small"
|
||||
type="text"
|
||||
icon="edit"
|
||||
@click="openAssignAccount(row.id)"
|
||||
>分配账号</el-button
|
||||
icon="edit"
|
||||
size="small"
|
||||
type="text"
|
||||
@click="openAssignAccount(row.id)"
|
||||
>分配账号
|
||||
</el-button
|
||||
>
|
||||
<el-button
|
||||
size="small"
|
||||
type="text"
|
||||
icon="edit"
|
||||
@click="openResetPassword(row.id)"
|
||||
>重置密码</el-button
|
||||
icon="edit"
|
||||
size="small"
|
||||
type="text"
|
||||
@click="openResetPassword(row.id)"
|
||||
>重置密码
|
||||
</el-button
|
||||
>
|
||||
<el-button
|
||||
size="small"
|
||||
type="text"
|
||||
icon="edit"
|
||||
@click="handleOpenVip(row.id)"
|
||||
>开通会员</el-button
|
||||
icon="edit"
|
||||
size="small"
|
||||
type="text"
|
||||
@click="handleOpenVip(row.id)"
|
||||
>开通会员
|
||||
</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
v-show="total > 0"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
v-model:page="queryParams.pageNum"
|
||||
:total="total"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 用户导入对话框 -->
|
||||
<el-dialog
|
||||
:title="upload.title"
|
||||
v-model="upload.open"
|
||||
width="400px"
|
||||
append-to-body
|
||||
v-model="upload.open"
|
||||
:title="upload.title"
|
||||
append-to-body
|
||||
width="400px"
|
||||
>
|
||||
<el-upload
|
||||
ref="uploadRef"
|
||||
:limit="1"
|
||||
accept=".xlsx, .xls"
|
||||
:headers="upload.headers"
|
||||
:action="upload.url"
|
||||
:disabled="upload.isUploading"
|
||||
:on-progress="handleFileUploadProgress"
|
||||
:on-success="handleFileSuccess"
|
||||
:auto-upload="false"
|
||||
drag
|
||||
ref="uploadRef"
|
||||
:action="upload.url"
|
||||
:auto-upload="false"
|
||||
:disabled="upload.isUploading"
|
||||
:headers="upload.headers"
|
||||
:limit="1"
|
||||
:on-progress="handleFileUploadProgress"
|
||||
:on-success="handleFileSuccess"
|
||||
accept=".xlsx, .xls"
|
||||
drag
|
||||
>
|
||||
<el-icon class="el-icon--upload"><upload-filled /></el-icon>
|
||||
<el-icon class="el-icon--upload">
|
||||
<upload-filled/>
|
||||
</el-icon>
|
||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||
<template #tip>
|
||||
<div class="el-upload__tip text-center">
|
||||
@ -210,31 +223,32 @@
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog
|
||||
title="分配账号"
|
||||
v-model="showAssignAccount"
|
||||
width="400px"
|
||||
append-to-body
|
||||
v-model="showAssignAccount"
|
||||
append-to-body
|
||||
title="分配账号"
|
||||
width="400px"
|
||||
>
|
||||
<el-form
|
||||
:model="assignAccountForm"
|
||||
:rules="assignAccoutRules"
|
||||
label-width="80px"
|
||||
ref="assignAccountFormRef"
|
||||
ref="assignAccountFormRef"
|
||||
:model="assignAccountForm"
|
||||
:rules="assignAccoutRules"
|
||||
label-width="80px"
|
||||
>
|
||||
<el-form-item label="用户名" prop="username">
|
||||
<el-input v-model="assignAccountForm.username"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="密码" prop="password">
|
||||
<el-input
|
||||
v-model="assignAccountForm.password"
|
||||
show-password
|
||||
v-model="assignAccountForm.password"
|
||||
show-password
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitAssignAccount"
|
||||
>确 定</el-button
|
||||
>确 定
|
||||
</el-button
|
||||
>
|
||||
<el-button @click="closeAssignAccount">取 消</el-button>
|
||||
</div>
|
||||
@ -242,28 +256,29 @@
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog
|
||||
title="重置密码"
|
||||
v-model="showResetPassword"
|
||||
width="400px"
|
||||
append-to-body
|
||||
v-model="showResetPassword"
|
||||
append-to-body
|
||||
title="重置密码"
|
||||
width="400px"
|
||||
>
|
||||
<el-form
|
||||
:model="resetPasswordForm"
|
||||
:rules="assignAccoutRules"
|
||||
label-width="80px"
|
||||
ref="resetPasswordFormRef"
|
||||
ref="resetPasswordFormRef"
|
||||
:model="resetPasswordForm"
|
||||
:rules="assignAccoutRules"
|
||||
label-width="80px"
|
||||
>
|
||||
<el-form-item label="密码" prop="password">
|
||||
<el-input
|
||||
v-model="resetPasswordForm.password"
|
||||
show-password
|
||||
v-model="resetPasswordForm.password"
|
||||
show-password
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitResetPassword"
|
||||
>确 定</el-button
|
||||
>确 定
|
||||
</el-button
|
||||
>
|
||||
<el-button @click="closeResetPassword">取 消</el-button>
|
||||
</div>
|
||||
@ -271,16 +286,16 @@
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog
|
||||
:title="vipForm.id ? `修改会员` : `开通会员`"
|
||||
v-model="showOpenVip"
|
||||
width="400px"
|
||||
append-to-body
|
||||
v-model="showOpenVip"
|
||||
:title="vipForm.id ? `修改会员` : `开通会员`"
|
||||
append-to-body
|
||||
width="400px"
|
||||
>
|
||||
<el-form
|
||||
:model="vipForm"
|
||||
:rules="assignAccoutRules"
|
||||
label-width="80px"
|
||||
ref="vipFormRef"
|
||||
ref="vipFormRef"
|
||||
:model="vipForm"
|
||||
:rules="assignAccoutRules"
|
||||
label-width="80px"
|
||||
>
|
||||
<el-form-item label="会员类型" prop="vipType">
|
||||
<el-radio-group v-model="vipForm.vipType">
|
||||
@ -290,25 +305,26 @@
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="vipForm.vipType != '0'"
|
||||
label="到期时间"
|
||||
prop="expireTime"
|
||||
v-if="vipForm.vipType != '0'"
|
||||
label="到期时间"
|
||||
prop="expireTime"
|
||||
>
|
||||
<el-date-picker
|
||||
v-model="vipForm.expireTime"
|
||||
type="datetime"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
placeholder="选择到期时间"
|
||||
v-model="vipForm.expireTime"
|
||||
placeholder="选择到期时间"
|
||||
type="datetime"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="submitVip"
|
||||
:disabled="vipForm.vipType == 0"
|
||||
>确 定</el-button
|
||||
:disabled="vipForm.vipType == 0"
|
||||
type="primary"
|
||||
@click="submitVip"
|
||||
>确 定
|
||||
</el-button
|
||||
>
|
||||
<el-button @click="closeVip">取 消</el-button>
|
||||
</div>
|
||||
@ -317,31 +333,29 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Enterprise">
|
||||
<script name="Enterprise" setup>
|
||||
import {
|
||||
companyList,
|
||||
companyExport,
|
||||
companyDelete,
|
||||
allocateAccount,
|
||||
companyDelete,
|
||||
companyList,
|
||||
getAccount,
|
||||
restPassword,
|
||||
openCasVip,
|
||||
getCasVip,
|
||||
openCasVip,
|
||||
restPassword,
|
||||
updateCasVip,
|
||||
} from "@/api/dataList/enterprise";
|
||||
import md5 from "js-md5";
|
||||
import { getToken } from "@/utils/auth";
|
||||
import {getToken} from "@/utils/auth";
|
||||
// import SiteOptions from "@/views/components/SiteOptions";
|
||||
// import axios from "axios";
|
||||
// import { download } from "@/utils/request";
|
||||
// import dayjs from "dayjs";
|
||||
import { tansParams, blobValidate } from "@/utils/ruoyi";
|
||||
import { saveAs } from "file-saver";
|
||||
import { tenantSelect } from "@/api/subPlatform/tenant";
|
||||
import { reactive, ref, toRefs } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import { enterpriseOptions } from "@/utils/parameter";
|
||||
import { ElLoading, ElMessage, ElMessageBox } from "element-plus";
|
||||
import {blobValidate} from "@/utils/ruoyi";
|
||||
import {saveAs} from "file-saver";
|
||||
import {reactive, ref, toRefs} from "vue";
|
||||
import {useRouter} from "vue-router";
|
||||
import {enterpriseOptions} from "@/utils/parameter";
|
||||
import {ElLoading, ElMessage, ElMessageBox} from "element-plus";
|
||||
import request from "@/utils/request";
|
||||
import dayjs from "dayjs";
|
||||
|
||||
@ -350,9 +364,9 @@ const data = reactive({
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
examine_status: 2,
|
||||
// examine_status: 2,
|
||||
name: undefined,
|
||||
tenantId: undefined,
|
||||
// tenantId: undefined,
|
||||
},
|
||||
});
|
||||
|
||||
@ -367,12 +381,12 @@ const upload = reactive({
|
||||
// 是否更新已经存在的用户数据
|
||||
// updateSupport: 0,
|
||||
// 设置上传的请求头部
|
||||
headers: { Authorization: "Bearer " + getToken() },
|
||||
headers: {Authorization: "Bearer " + getToken()},
|
||||
// 上传的地址
|
||||
url: import.meta.env.VITE_APP_BASE_API + "/business/enterprise/importData",
|
||||
});
|
||||
|
||||
const { queryParams } = toRefs(data);
|
||||
const {queryParams} = toRefs(data);
|
||||
const showSearch = ref(true);
|
||||
// const siteList = ref([]);
|
||||
const loading = ref(true);
|
||||
@ -404,11 +418,11 @@ const handleQuery = () => {
|
||||
};
|
||||
|
||||
const assignAccoutRules = {
|
||||
username: [{ required: true, message: "请输入用户名", trigger: "blur" }],
|
||||
password: [{ required: true, message: "请输入密码", trigger: "blur" }],
|
||||
vipType: [{ required: true, message: "请选择会员类型", trigger: "change" }],
|
||||
username: [{required: true, message: "请输入用户名", trigger: "blur"}],
|
||||
password: [{required: true, message: "请输入密码", trigger: "blur"}],
|
||||
vipType: [{required: true, message: "请选择会员类型", trigger: "change"}],
|
||||
expireTime: [
|
||||
{ required: true, message: "请选择到期时间", trigger: "change" },
|
||||
{required: true, message: "请选择到期时间", trigger: "change"},
|
||||
],
|
||||
};
|
||||
const showAssignAccount = ref(false);
|
||||
@ -425,7 +439,7 @@ const showResetPassword = ref(false);
|
||||
|
||||
const openAssignAccount = async (id) => {
|
||||
resetForm();
|
||||
const { have, data } = await getAccount(id);
|
||||
const {have, data} = await getAccount(id);
|
||||
if (have) {
|
||||
ElMessageBox.alert(`已经存在账号:${data}`, "账号已经存在");
|
||||
} else {
|
||||
@ -436,9 +450,9 @@ const openAssignAccount = async (id) => {
|
||||
|
||||
const openResetPassword = async (id) => {
|
||||
resetForm();
|
||||
const { have } = await getAccount(id);
|
||||
const {have, userId} = await getAccount(id);
|
||||
if (have) {
|
||||
resetPasswordForm.id = id;
|
||||
resetPasswordForm.id = userId;
|
||||
showResetPassword.value = true;
|
||||
} else {
|
||||
ElMessageBox.alert(`尚未分配账号,请先分配账号`, "尚未分配账号");
|
||||
@ -484,15 +498,15 @@ const submitResetPassword = async () => {
|
||||
//TODO:
|
||||
/** 开通vip操作 */
|
||||
const vipData = reactive({
|
||||
vipForm: { userType: "1" },
|
||||
vipForm: {userType: "1"},
|
||||
});
|
||||
const { vipForm } = toRefs(vipData);
|
||||
const {vipForm} = toRefs(vipData);
|
||||
const showOpenVip = ref(false);
|
||||
const vipFormRef = ref();
|
||||
|
||||
const handleOpenVip = async (id) => {
|
||||
resetVipForm();
|
||||
const { have, userId } = await getAccount(id);
|
||||
const {have, userId} = await getAccount(id);
|
||||
if (have) {
|
||||
const resp = await getCasVip(userId);
|
||||
if (resp.have) {
|
||||
@ -521,7 +535,7 @@ const submitVip = async () => {
|
||||
};
|
||||
|
||||
const resetVipForm = () => {
|
||||
vipForm.value = { userType: "1" };
|
||||
vipForm.value = {userType: "1"};
|
||||
if (vipFormRef.value) {
|
||||
vipFormRef.value.resetFields();
|
||||
}
|
||||
@ -547,23 +561,26 @@ const handleAdd = () => {
|
||||
const handleDetail = (id) => {
|
||||
router.push({
|
||||
path: "/dataList/enterprise/add",
|
||||
query: { id },
|
||||
query: {id},
|
||||
});
|
||||
};
|
||||
const uploadRef = ref(null);
|
||||
|
||||
/** 导入按钮操作 */
|
||||
function handleImport() {
|
||||
upload.title = "用户导入";
|
||||
upload.open = true;
|
||||
}
|
||||
|
||||
/** 下载模板操作 */
|
||||
function importTemplate() {
|
||||
proxy.download(
|
||||
"system/user/importTemplate",
|
||||
{},
|
||||
`user_template_${new Date().getTime()}.xlsx`
|
||||
"system/user/importTemplate",
|
||||
{},
|
||||
`user_template_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
}
|
||||
|
||||
/**文件上传中处理 */
|
||||
const handleFileUploadProgress = (event, file, fileList) => {
|
||||
upload.isUploading = true;
|
||||
@ -574,11 +591,11 @@ const handleFileSuccess = (response, file, fileList) => {
|
||||
upload.isUploading = false;
|
||||
uploadRef.value.handleRemove(file);
|
||||
ElMessageBox.alert(
|
||||
"<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
|
||||
"<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
|
||||
response.msg +
|
||||
"</div>",
|
||||
"导入结果",
|
||||
{ dangerouslyUseHTMLString: true }
|
||||
"导入结果",
|
||||
{dangerouslyUseHTMLString: true}
|
||||
);
|
||||
getList();
|
||||
};
|
||||
@ -587,15 +604,17 @@ const handleFileSuccess = (response, file, fileList) => {
|
||||
function submitFileForm() {
|
||||
uploadRef.value.submit();
|
||||
}
|
||||
|
||||
const handleDelete = async (id) => {
|
||||
const delIds = id || ids.value.join(",");
|
||||
ElMessageBox.confirm(`是否确认删除编号为${delIds}的数据项?`)
|
||||
.then(async () => {
|
||||
await companyDelete(delIds);
|
||||
getList();
|
||||
ElMessage.success("删除成功");
|
||||
})
|
||||
.catch(() => {});
|
||||
.then(async () => {
|
||||
await companyDelete(delIds);
|
||||
getList();
|
||||
ElMessage.success("删除成功");
|
||||
})
|
||||
.catch(() => {
|
||||
});
|
||||
};
|
||||
|
||||
let downloadLoadingInstance;
|
||||
@ -605,41 +624,41 @@ const download = (url, filename) => {
|
||||
background: "rgba(0, 0, 0, 0.7)",
|
||||
});
|
||||
return request
|
||||
.get(url, {
|
||||
// transformRequest: [
|
||||
// (params) => {
|
||||
// return tansParams(params);
|
||||
// },
|
||||
// ],
|
||||
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
||||
responseType: "blob",
|
||||
})
|
||||
.then(async (data) => {
|
||||
const isLogin = await blobValidate(data);
|
||||
if (isLogin) {
|
||||
const blob = new Blob([data]);
|
||||
saveAs(blob, filename);
|
||||
} else {
|
||||
const resText = await data.text();
|
||||
const rspObj = JSON.parse(resText);
|
||||
const errMsg =
|
||||
errorCode[rspObj.code] || rspObj.msg || errorCode["default"];
|
||||
ElMessage.error(errMsg);
|
||||
}
|
||||
downloadLoadingInstance.close();
|
||||
})
|
||||
.catch((r) => {
|
||||
console.error(r);
|
||||
ElMessage.error("下载文件出现错误,请联系管理员!");
|
||||
downloadLoadingInstance.close();
|
||||
});
|
||||
.get(url, {
|
||||
// transformRequest: [
|
||||
// (params) => {
|
||||
// return tansParams(params);
|
||||
// },
|
||||
// ],
|
||||
headers: {"Content-Type": "application/x-www-form-urlencoded"},
|
||||
responseType: "blob",
|
||||
})
|
||||
.then(async (data) => {
|
||||
const isLogin = await blobValidate(data);
|
||||
if (isLogin) {
|
||||
const blob = new Blob([data]);
|
||||
saveAs(blob, filename);
|
||||
} else {
|
||||
const resText = await data.text();
|
||||
const rspObj = JSON.parse(resText);
|
||||
const errMsg =
|
||||
errorCode[rspObj.code] || rspObj.msg || errorCode["default"];
|
||||
ElMessage.error(errMsg);
|
||||
}
|
||||
downloadLoadingInstance.close();
|
||||
})
|
||||
.catch((r) => {
|
||||
console.error(r);
|
||||
ElMessage.error("下载文件出现错误,请联系管理员!");
|
||||
downloadLoadingInstance.close();
|
||||
});
|
||||
};
|
||||
|
||||
const handleExport = () => {
|
||||
ElMessageBox.confirm(`是否确认企业列表?`).then(() => {
|
||||
download(
|
||||
`/business/enterprise/export`,
|
||||
`企业信息(${dayjs().format("YYYYMMDDHHmmss")}).xlsx`
|
||||
`/business/enterprise/export`,
|
||||
`企业信息(${dayjs().format("YYYYMMDDHHmmss")}).xlsx`
|
||||
);
|
||||
});
|
||||
};
|
||||
|
@ -88,6 +88,8 @@
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column align="center" label="所在地" prop="address"/>
|
||||
<el-table-column align="center" label="所属研究机构" prop="researchName"/>
|
||||
<el-table-column align="center" label="所属实验室" prop="laboratoryName"/>
|
||||
<el-table-column align="center" label="操作">
|
||||
<template #default="{ row }">
|
||||
<el-button
|
||||
@ -336,9 +338,9 @@ const openAssignAccount = async (id) => {
|
||||
|
||||
const openResetPassword = async (id) => {
|
||||
resetForm();
|
||||
const {have} = await getAccount(id);
|
||||
const {have, userId} = await getAccount(id);
|
||||
if (have) {
|
||||
resetPasswordForm.id = id;
|
||||
resetPasswordForm.id = userId;
|
||||
showResetPassword.value = true;
|
||||
} else {
|
||||
ElMessageBox.alert(`尚未分配账号,请先分配账号`, "尚未分配账号");
|
||||
|
@ -369,9 +369,9 @@ const openAssignAccount = async (id) => {
|
||||
|
||||
const openResetPassword = async (id) => {
|
||||
resetForm();
|
||||
const {have} = await getAccount(id);
|
||||
const {have,userId} = await getAccount(id);
|
||||
if (have) {
|
||||
resetPasswordForm.id = id;
|
||||
resetPasswordForm.id = userId;
|
||||
showResetPassword.value = true;
|
||||
} else {
|
||||
ElMessageBox.alert(`尚未分配账号,请先分配账号`, "尚未分配账号");
|
||||
|
@ -1,13 +1,7 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div style="width: 50%">
|
||||
<!-- <ExpertForm-->
|
||||
<!-- ref="expertFormRef"-->
|
||||
<!-- v-model="form"-->
|
||||
<!-- :formType="formType"-->
|
||||
<!-- :labelWidth="140"-->
|
||||
<!-- :showTitle="true"-->
|
||||
<!-- />-->
|
||||
|
||||
<research-form ref="researchFormRef" v-model="form"
|
||||
:labelWidth="140"
|
||||
:showTitle="true"></research-form>
|
||||
@ -17,18 +11,18 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script name="EnterpriseAdd" setup>
|
||||
<script name="ResearchAdd" setup>
|
||||
import ResearchForm from '@/views/components/ResearchForm'
|
||||
import tab from "@/plugins/tab";
|
||||
import {companyAdd, companyDetail, companyEdit,} from "@/api/dataList/enterprise";
|
||||
import {reactive, ref, toRefs} from "vue";
|
||||
import {useRoute, useRouter} from "vue-router";
|
||||
import {onBeforeRouteLeave, useRoute, useRouter} from "vue-router";
|
||||
import {ElMessage} from "element-plus";
|
||||
import {researchAdd, researchDetail, researchEdit} from "@/api/dataList/research";
|
||||
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const formType = ref(2);
|
||||
const expertFormRef = ref(null);
|
||||
const researchFormRef = ref();
|
||||
const data = reactive({
|
||||
form: {
|
||||
image: undefined,
|
||||
@ -60,14 +54,14 @@ const cancel = () => {
|
||||
|
||||
|
||||
const submitForm = async () => {
|
||||
const valid = await expertFormRef.value.validateForm();
|
||||
const valid = await researchFormRef.value?.validateForm();
|
||||
if (valid) {
|
||||
if (form.value.id != undefined) {
|
||||
await companyEdit(form.value);
|
||||
if (form.value.id) {
|
||||
await researchEdit(form.value);
|
||||
cancel();
|
||||
ElMessage.success("修改成功");
|
||||
} else {
|
||||
await companyAdd(form.value);
|
||||
await researchAdd(form.value);
|
||||
cancel();
|
||||
ElMessage.success("新增成功");
|
||||
}
|
||||
@ -78,32 +72,22 @@ const submitForm = async () => {
|
||||
|
||||
const getDetailById = async () => {
|
||||
if (route.query.id) {
|
||||
const {data} = await companyDetail(route.query.id);
|
||||
const {data} = await researchDetail(route.query.id);
|
||||
form.value = data;
|
||||
|
||||
form.value.industrys = data.industry?.split(",")?.map(item => parseInt(item)) ?? []
|
||||
form.value.researchs = data.research?.split(",") ?? []
|
||||
}
|
||||
};
|
||||
getDetailById();
|
||||
if (route.query.id) {
|
||||
console.log(route.query.id)
|
||||
const obj = Object.assign({}, route, {title: "修改研究机构"})
|
||||
tab.updatePage(obj);
|
||||
} else {
|
||||
const obj = Object.assign({}, route, {title: "添加研究机构"})
|
||||
tab.updatePage(obj);
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<!-- <script>
|
||||
export default {
|
||||
components: {
|
||||
ExpertForm,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// formType: 2,
|
||||
// labelWidth: 140,
|
||||
};
|
||||
},
|
||||
methods: {},
|
||||
created() {
|
||||
const { id } = this.$route.query;
|
||||
if (id) {
|
||||
companyDetail({ id }).then((res) => {
|
||||
form.value = res.data;
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
</script> -->
|
||||
|
@ -49,28 +49,28 @@
|
||||
</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
icon="upload"
|
||||
plain
|
||||
size="default"
|
||||
type="info"
|
||||
@click="handleImport"
|
||||
>导入
|
||||
</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
icon="download"
|
||||
plain
|
||||
size="default"
|
||||
type="warning"
|
||||
@click="handleExport"
|
||||
>导出
|
||||
</el-button
|
||||
>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">-->
|
||||
<!-- <el-button-->
|
||||
<!-- icon="upload"-->
|
||||
<!-- plain-->
|
||||
<!-- size="default"-->
|
||||
<!-- type="info"-->
|
||||
<!-- @click="handleImport"-->
|
||||
<!-- >导入-->
|
||||
<!-- </el-button-->
|
||||
<!-- >-->
|
||||
<!-- </el-col>-->
|
||||
<!-- <el-col :span="1.5">-->
|
||||
<!-- <el-button-->
|
||||
<!-- icon="download"-->
|
||||
<!-- plain-->
|
||||
<!-- size="default"-->
|
||||
<!-- type="warning"-->
|
||||
<!-- @click="handleExport"-->
|
||||
<!-- >导出-->
|
||||
<!-- </el-button-->
|
||||
<!-- >-->
|
||||
<!-- </el-col>-->
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
:disabled="!ids.length"
|
||||
@ -93,30 +93,19 @@
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55"/>
|
||||
<el-table-column align="center" label="数据编号" prop="id"/>
|
||||
<el-table-column align="center" label="企业名称" prop="name"/>
|
||||
<!-- <el-table-column label="统一社会信用代码" align="center" prop="code" /> -->
|
||||
<el-table-column align="center" label="所属领域" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<div>{{ row.industrys[row.industrys.length - 1] }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="机构名称" prop="name"/>
|
||||
<el-table-column align="center" label="统一社会信用代码" prop="code"/>
|
||||
<el-table-column align="center" label="主要研究方向" prop="research"/>
|
||||
|
||||
<!-- <el-table-column label="站点" align="center">
|
||||
<template #default="{ row }">
|
||||
{{ siteList.find((el) => el.id === row.tenantId)?.name ?? "无" }}
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column align="center" label="所在地" prop="address"/>
|
||||
<el-table-column align="center" label="企业类型" prop="kind">
|
||||
<template #default="{ row }">
|
||||
<div>
|
||||
{{ enterpriseOptions.find((e) => row.kind == e.key).value }}
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="申请时间">
|
||||
<template #default="{ row }">
|
||||
<span>{{ row.createdAt }}</span>
|
||||
<span>{{ row.createTime }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作">
|
||||
@ -153,14 +142,6 @@
|
||||
>重置密码
|
||||
</el-button
|
||||
>
|
||||
<el-button
|
||||
icon="edit"
|
||||
size="small"
|
||||
type="text"
|
||||
@click="handleOpenVip(row.id)"
|
||||
>开通会员
|
||||
</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -337,7 +318,6 @@
|
||||
import {
|
||||
allocateAccount,
|
||||
companyDelete,
|
||||
companyList,
|
||||
getAccount,
|
||||
getCasVip,
|
||||
openCasVip,
|
||||
@ -354,19 +334,19 @@ import {blobValidate} from "@/utils/ruoyi";
|
||||
import {saveAs} from "file-saver";
|
||||
import {reactive, ref, toRefs} from "vue";
|
||||
import {useRouter} from "vue-router";
|
||||
import {enterpriseOptions} from "@/utils/parameter";
|
||||
import {ElLoading, ElMessage, ElMessageBox} from "element-plus";
|
||||
import request from "@/utils/request";
|
||||
import dayjs from "dayjs";
|
||||
import {researchList} from "@/api/dataList/research";
|
||||
|
||||
const router = useRouter();
|
||||
const data = reactive({
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
examine_status: 2,
|
||||
// examine_status: 2,
|
||||
name: undefined,
|
||||
tenantId: undefined,
|
||||
// tenantId: undefined,
|
||||
},
|
||||
});
|
||||
|
||||
@ -398,10 +378,10 @@ const handleSelectionChange = (selection) => {
|
||||
ids.value = selection.map((el) => el.id);
|
||||
};
|
||||
|
||||
/** 查询企业列表 */
|
||||
/** 研究机构列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
const resp = await companyList(queryParams.value);
|
||||
const resp = await researchList(queryParams.value);
|
||||
dataList.value = resp.rows;
|
||||
total.value = resp.total;
|
||||
loading.value = false;
|
||||
@ -450,9 +430,9 @@ const openAssignAccount = async (id) => {
|
||||
|
||||
const openResetPassword = async (id) => {
|
||||
resetForm();
|
||||
const {have} = await getAccount(id);
|
||||
const {have, userId} = await getAccount(id);
|
||||
if (have) {
|
||||
resetPasswordForm.id = id;
|
||||
resetPasswordForm.id = userId;
|
||||
showResetPassword.value = true;
|
||||
} else {
|
||||
ElMessageBox.alert(`尚未分配账号,请先分配账号`, "尚未分配账号");
|
||||
@ -504,23 +484,7 @@ const {vipForm} = toRefs(vipData);
|
||||
const showOpenVip = ref(false);
|
||||
const vipFormRef = ref();
|
||||
|
||||
const handleOpenVip = async (id) => {
|
||||
resetVipForm();
|
||||
const {have, userId} = await getAccount(id);
|
||||
if (have) {
|
||||
const resp = await getCasVip(userId);
|
||||
if (resp.have) {
|
||||
vipForm.value = resp.data;
|
||||
showOpenVip.value = true;
|
||||
} else {
|
||||
vipForm.value.userId = userId;
|
||||
vipForm.value.vipType = "0";
|
||||
showOpenVip.value = true;
|
||||
}
|
||||
} else {
|
||||
ElMessageBox.alert(`尚未分配账号,请先分配账号`, "尚未分配账号");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
const submitVip = async () => {
|
||||
await vipFormRef.value.validate();
|
||||
@ -664,4 +628,6 @@ const handleExport = () => {
|
||||
};
|
||||
getList();
|
||||
// getSiteList();
|
||||
|
||||
</script>
|
||||
|
||||
|
@ -1,100 +0,0 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div style="width: 50%">
|
||||
<ExpertForm
|
||||
ref="expertFormRef"
|
||||
v-model="form"
|
||||
:formType="formType"
|
||||
:isAdd="false"
|
||||
:labelWidth="140"
|
||||
:showTitle="true"
|
||||
/>
|
||||
</div>
|
||||
<div :style="{ marginLeft: labelWidth + 'px' }">
|
||||
<el-button @click="submitForm('2')">审核拒绝</el-button>
|
||||
<el-button type="primary" @click="submitForm('1')">通过审核</el-button>
|
||||
<!-- <el-button type="primary" @click="submitForm('0')">test审核</el-button> -->
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script name="EnterpriseAdd" setup>
|
||||
import ExpertForm from "@/views/components/ExpertForm";
|
||||
import tab from "@/plugins/tab";
|
||||
import {companyDetail, companyEdit} from "@/api/expert/expert";
|
||||
import {reactive, toRefs} from "vue";
|
||||
import {useRoute, useRouter} from "vue-router";
|
||||
import {ElMessage} from "element-plus";
|
||||
import useUserStore from "@/store/modules/user";
|
||||
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const formType = ref(1);
|
||||
const expertFormRef = ref(null);
|
||||
const labelWidth = ref(140);
|
||||
const data = reactive({
|
||||
form: {
|
||||
image: undefined,
|
||||
name: undefined,
|
||||
tenantId: undefined,
|
||||
province: undefined, // 省code
|
||||
city: undefined, // 市code
|
||||
district: undefined, // 区code
|
||||
address: undefined, // 详细地址
|
||||
product: undefined,
|
||||
kind: undefined,
|
||||
code: undefined,
|
||||
inviterCode: undefined,
|
||||
url: undefined,
|
||||
industrys: [],
|
||||
keywords: [],
|
||||
directions: [],
|
||||
introduce: undefined,
|
||||
license: undefined,
|
||||
},
|
||||
});
|
||||
const {form} = toRefs(data);
|
||||
const cancel = () => {
|
||||
router.back();
|
||||
tab.closeOpenPage();
|
||||
};
|
||||
const submitForm = async (state) => {
|
||||
await companyEdit({id: form.value.id, examineStatus: state});
|
||||
useUserStore().getUnApprovedExpert();
|
||||
cancel();
|
||||
ElMessage.success("已审核");
|
||||
};
|
||||
|
||||
const getDetailById = async () => {
|
||||
if (route.query.id) {
|
||||
const {data} = await companyDetail(route.query.id);
|
||||
form.value = data;
|
||||
form.value.keywords = data.keyword ? data.keyword.split(",") : [];
|
||||
form.value.district = data.area;
|
||||
}
|
||||
};
|
||||
getDetailById();
|
||||
</script>
|
||||
|
||||
<!-- <script>
|
||||
export default {
|
||||
components: {
|
||||
ExpertForm,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// formType: 2,
|
||||
// labelWidth: 140,
|
||||
};
|
||||
},
|
||||
methods: {},
|
||||
created() {
|
||||
const { id } = this.$route.query;
|
||||
if (id) {
|
||||
companyDetail({ id }).then((res) => {
|
||||
form.value = res.data;
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
</script> -->
|
@ -1,153 +0,0 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 顶部搜索区域 -->
|
||||
<el-form :model="queryData" :inline="true">
|
||||
<el-form-item label="专家姓名">
|
||||
<el-input
|
||||
style="width: 150px"
|
||||
v-model="queryData.name"
|
||||
placeholder="请输入关键字"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="审核状态">
|
||||
<el-select
|
||||
style="width: 100px"
|
||||
v-model="queryData.examineStatus"
|
||||
class="m-2"
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option label="待审核" :value="0" />
|
||||
<el-option label="已审核" :value="1" />
|
||||
<el-option label="已拒绝" :value="2" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="站点">
|
||||
<SiteOptions
|
||||
v-model="queryData.tenantId"
|
||||
:site-list="siteList"
|
||||
style="width: 160px"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
|
||||
<el-form-item style="float: right">
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="search"
|
||||
size="default"
|
||||
@click="handleQuery"
|
||||
>搜索</el-button
|
||||
>
|
||||
<el-button icon="refresh" size="default" @click="resetQuery"
|
||||
>重置</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<!--表格区域-->
|
||||
<el-table :data="dataList" style="width: 100%">
|
||||
<el-table-column prop="name" label="专家姓名" align="center" />
|
||||
<el-table-column label="研究领域" align="center">
|
||||
<template #default="{ row }">
|
||||
<div>{{ row.industryStr }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="education" label="学历" align="center" />
|
||||
<el-table-column show-overflow-tooltip label="个人备注" align="center">
|
||||
<template #default="{ row }">
|
||||
<div v-html="row.introduce"></div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="school" label="毕业院校" align="center" />
|
||||
<el-table-column prop="post" label="职务" align="center" />
|
||||
<!-- <el-table-column label="站点" align="center">
|
||||
<template #default="{ row }">
|
||||
{{ siteList.find((el) => el.id === row.tenantId)?.name ?? "无" }}
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column prop="address" label="所在地" align="center" />
|
||||
<el-table-column prop="examineStatus" label="审核状态" align="center">
|
||||
<template #default="{ row }">
|
||||
{{ examineStatusDict[row.examineStatus] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="createTime" label="申请时间" align="center" />
|
||||
<el-table-column prop="" label="操作" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-button size="small" type="text" @click="btnAudit(row.id)"
|
||||
>审核</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- 分页器 -->
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryData.pageNum"
|
||||
v-model:limit="queryData.page_size"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import SiteOptions from "@/views/components/SiteOptions";
|
||||
import { tenantSelect } from "@/api/subPlatform/tenant";
|
||||
import { expertList } from "@/api/expert/expert";
|
||||
import { useRouter } from "vue-router";
|
||||
import useUserStore from "@/store/modules/user";
|
||||
const router = useRouter();
|
||||
const data = reactive({
|
||||
queryData: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
examineStatus: "",
|
||||
},
|
||||
});
|
||||
const total = ref(0);
|
||||
const dataList = ref([]);
|
||||
// const siteList = ref([]);
|
||||
const { queryData } = toRefs(data);
|
||||
const examineStatusDict = {
|
||||
0: "审核中",
|
||||
1: "已通过",
|
||||
2: "已拒绝",
|
||||
};
|
||||
// 获取专家列表
|
||||
const getList = async () => {
|
||||
const res = await expertList(queryData.value);
|
||||
dataList.value = res.rows;
|
||||
total.value = res.total;
|
||||
};
|
||||
// 获取站点列表
|
||||
// const getSiteList = async () => {
|
||||
// const resp = await tenantSelect();
|
||||
// siteList.value = resp.rows;
|
||||
// };
|
||||
// 搜索查询
|
||||
const handleQuery = () => {
|
||||
getList(queryData.value);
|
||||
};
|
||||
// 重置按钮
|
||||
const resetQuery = () => {
|
||||
queryData.value = {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
examineStatus: "",
|
||||
};
|
||||
getList();
|
||||
};
|
||||
// 审核按钮
|
||||
const btnAudit = (id) => {
|
||||
router.push({
|
||||
path: "/approval/dataList/expert",
|
||||
query: { id },
|
||||
});
|
||||
};
|
||||
getList();
|
||||
|
||||
useUserStore().getUnApprovedExpert();
|
||||
// getSiteList();
|
||||
</script>
|
||||
<style></style>
|
@ -356,7 +356,7 @@ import { changeUserStatus, listUser, resetUserPwd, delUser, getUser, updateUser,
|
||||
const router = useRouter();
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { sys_normal_disable, sys_user_sex } = proxy.useDict("sys_normal_disable", "sys_user_sex");
|
||||
|
||||
import md5 from 'js-md5'
|
||||
const userList = ref([]);
|
||||
const open = ref(false);
|
||||
const loading = ref(true);
|
||||
@ -513,7 +513,7 @@ function handleResetPwd(row) {
|
||||
inputPattern: /^.{5,20}$/,
|
||||
inputErrorMessage: "用户密码长度必须介于 5 和 20 之间",
|
||||
}).then(({ value }) => {
|
||||
resetUserPwd(row.userId, value).then(response => {
|
||||
resetUserPwd(row.userId, md5(value)).then(response => {
|
||||
proxy.$modal.msgSuccess("修改成功,新密码是:" + value);
|
||||
});
|
||||
}).catch(() => {});
|
||||
|
@ -2,42 +2,42 @@
|
||||
<div class="app-container">
|
||||
<div style="width: 50%">
|
||||
<expert-form
|
||||
:isAdd="false"
|
||||
v-model="form"
|
||||
:showTitle="true"
|
||||
:formType="formType"
|
||||
:labelWidth="140"
|
||||
ref="expertFormRef"
|
||||
ref="expertFormRef"
|
||||
v-model="form"
|
||||
:formType="formType"
|
||||
:isAdd="false"
|
||||
:labelWidth="140"
|
||||
:showTitle="true"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div :style="{ marginLeft: 140 + 'px' }">
|
||||
<el-button @click="submitForm('2')">审核拒绝</el-button>
|
||||
<el-button type="primary" @click="submitForm('1')">通过审核</el-button>
|
||||
<!-- <el-button type="primary" @click="testCount">通过审核</el-button> -->
|
||||
<!-- <el-button type="primary" @click="submitForm('0')">cancel审核</el-button> -->
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="EnterpriseAdd">
|
||||
<script name="EnterpriseAdd" setup>
|
||||
import ExpertForm from "@/views/components/ExpertForm/index.vue";
|
||||
import tab from "@/plugins/tab";
|
||||
import {
|
||||
companyAdd,
|
||||
companyDetail,
|
||||
companyEdit,
|
||||
} from "@/api/dataList/enterprise";
|
||||
import { reactive, toRefs } from "vue";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
import { ElMessage } from "element-plus";
|
||||
import {companyDetail, companyEdit,} from "@/api/dataList/enterprise";
|
||||
import {reactive, ref, toRefs} from "vue";
|
||||
import {useRoute, useRouter} from "vue-router";
|
||||
import {ElMessage} from "element-plus";
|
||||
import useUserStore from "@/store/modules/user";
|
||||
|
||||
// const testCount = () => {
|
||||
// useUserStore().unApprovedBusinessPlus();
|
||||
// };
|
||||
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const formType = ref(2);
|
||||
const expertFormRef = ref(null);
|
||||
const data = reactive({
|
||||
form: {
|
||||
form: {/*
|
||||
image: undefined,
|
||||
name: undefined,
|
||||
tenantId: undefined,
|
||||
@ -55,64 +55,29 @@ const data = reactive({
|
||||
directions: [],
|
||||
introduce: undefined,
|
||||
license: undefined,
|
||||
examineStatus: "",
|
||||
examineStatus: "",*/
|
||||
},
|
||||
});
|
||||
|
||||
const { form } = toRefs(data);
|
||||
const {form} = toRefs(data);
|
||||
const cancel = () => {
|
||||
router.back();
|
||||
tab.closeOpenPage();
|
||||
};
|
||||
|
||||
const submitForm = async (state) => {
|
||||
const valid = await expertFormRef.value.validateForm();
|
||||
if (valid) {
|
||||
if (form.value.id != undefined) {
|
||||
form.value.examineStatus = state;
|
||||
await companyEdit(form.value);
|
||||
useUserStore().getApprovalCount();
|
||||
cancel();
|
||||
ElMessage.success("修改成功");
|
||||
} else {
|
||||
await companyAdd(form.value);
|
||||
useUserStore().getApprovalCount();
|
||||
cancel();
|
||||
ElMessage.success("新增成功");
|
||||
}
|
||||
} else {
|
||||
console.log("校验未通过");
|
||||
}
|
||||
await companyEdit({id: form.value.id, examineStatus: state});
|
||||
useUserStore().getUnApprovedBusiness();
|
||||
cancel();
|
||||
ElMessage.success("已审核");
|
||||
};
|
||||
|
||||
const getDetailById = async () => {
|
||||
if (route.query.id) {
|
||||
const { data } = await companyDetail(route.query.id);
|
||||
const {data} = await companyDetail(route.query.id);
|
||||
form.value = data;
|
||||
}
|
||||
};
|
||||
getDetailById();
|
||||
</script>
|
||||
|
||||
<!-- <script>
|
||||
export default {
|
||||
components: {
|
||||
ExpertForm,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// formType: 2,
|
||||
// labelWidth: 140,
|
||||
};
|
||||
},
|
||||
methods: {},
|
||||
created() {
|
||||
const { id } = this.$route.query;
|
||||
if (id) {
|
||||
companyDetail({ id }).then((res) => {
|
||||
form.value = res.data;
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
</script> -->
|
||||
|
@ -32,13 +32,13 @@
|
||||
<el-option :value="103" label="普通企业" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="站点">
|
||||
<SiteOptions
|
||||
<!-- <el-form-item label="站点">
|
||||
<site-options
|
||||
v-model="queryData.tenantId"
|
||||
:site-list="siteList"
|
||||
style="width: 160px"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
|
||||
<el-form-item style="float: right">
|
||||
<el-button
|
||||
@ -63,11 +63,11 @@
|
||||
<div>{{ row.industrys[row.industrys.length - 1] }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="" label="站点" align="center">
|
||||
<!-- <el-table-column prop="" label="站点" align="center">
|
||||
<template #default="{ row }">
|
||||
{{ siteList.find((el) => el.id === row.tenantId)?.name ?? "无" }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column> -->
|
||||
<el-table-column prop="address" label="所在地" align="center" />
|
||||
<el-table-column prop="examineStatus" label="审核状态" align="center">
|
||||
<template #default="{ row }">
|
||||
@ -109,7 +109,7 @@
|
||||
<!-- 设置企业类型弹框 -->
|
||||
<el-dialog title="设置企业类型" v-model="isShow">
|
||||
<el-row type="flex" justify="center" style="height: 100px">
|
||||
<el-radio-group v-model="radioList">
|
||||
<el-radio-group v-model="setTypeRow.kind">
|
||||
<el-radio
|
||||
v-for="{ key, value } in enterpriseOptions"
|
||||
:key="key"
|
||||
@ -136,19 +136,23 @@ import { tenantSelect } from "@/api/subPlatform/tenant";
|
||||
import { enterpriseOptions } from "@/utils/parameter";
|
||||
import { reactive, ref } from "vue";
|
||||
import { ElMessageBox } from "element-plus";
|
||||
import { cloneDeep } from "lodash";
|
||||
import { useRouter } from "vue-router";
|
||||
import useUserStore from "@/store/modules/user";
|
||||
|
||||
const data = reactive({
|
||||
queryData: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
examineStatus: "",
|
||||
},
|
||||
setTypeRow: {},
|
||||
});
|
||||
const router = useRouter();
|
||||
const total = ref(0);
|
||||
const dataList = ref([]);
|
||||
const { queryData } = toRefs(data);
|
||||
const siteList = ref([]);
|
||||
const { queryData, setTypeRow } = toRefs(data);
|
||||
// const siteList = ref([]);
|
||||
const isShow = ref(false);
|
||||
const radioList = ref("");
|
||||
const examineStatusDict = {
|
||||
@ -164,11 +168,11 @@ const getList = async () => {
|
||||
dataList.value = res.rows;
|
||||
total.value = res.total;
|
||||
};
|
||||
// 获取站点列表
|
||||
const getSiteList = async () => {
|
||||
const resp = await tenantSelect();
|
||||
siteList.value = resp.rows;
|
||||
};
|
||||
// // 获取站点列表
|
||||
// const getSiteList = async () => {
|
||||
// const resp = await tenantSelect();
|
||||
// siteList.value = resp.rows;
|
||||
// };
|
||||
// 搜索查询
|
||||
const handleQuery = () => {
|
||||
getList(queryData.value);
|
||||
@ -184,16 +188,15 @@ const resetQuery = () => {
|
||||
};
|
||||
// 企业类型弹框
|
||||
const setType = (row) => {
|
||||
radioList.value = row.kind;
|
||||
// radioList.value = row.kind;
|
||||
isShow.value = true;
|
||||
id.value = row.id;
|
||||
// id.value = row.id;
|
||||
setTypeRow.value = cloneDeep(row);
|
||||
};
|
||||
// 发送修改类型请求
|
||||
|
||||
const btnType = async () => {
|
||||
await editType({
|
||||
kind: radioList.value,
|
||||
id: id.value,
|
||||
});
|
||||
await editType({ id: setTypeRow.value.id, kind: setTypeRow.value.kind });
|
||||
getList();
|
||||
isShow.value = false;
|
||||
};
|
||||
@ -216,6 +219,7 @@ const handleDetail = (id) => {
|
||||
});
|
||||
};
|
||||
getList();
|
||||
getSiteList();
|
||||
// getSiteList();
|
||||
useUserStore().getUnApprovedBusiness();
|
||||
</script>
|
||||
<style></style>
|
||||
|
@ -2,108 +2,62 @@
|
||||
<div class="app-container">
|
||||
<div style="width: 50%">
|
||||
<ExpertForm
|
||||
:isAdd="false"
|
||||
v-model="form"
|
||||
:showTitle="true"
|
||||
:formType="formType"
|
||||
:labelWidth="140"
|
||||
ref="expertFormRef"
|
||||
ref="expertFormRef"
|
||||
v-model="form"
|
||||
:formType="formType"
|
||||
:isAdd="false"
|
||||
:labelWidth="140"
|
||||
:showTitle="true"
|
||||
/>
|
||||
</div>
|
||||
<div :style="{ marginLeft: labelWidth + 'px' }">
|
||||
<el-button @click="submitForm('2')">审核拒绝</el-button>
|
||||
<el-button type="primary" @click="submitForm('1')">通过审核</el-button>
|
||||
<!-- <el-button type="primary" @click="submitForm('0')">test审核</el-button> -->
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="EnterpriseAdd">
|
||||
import ExpertForm from "@/views/components/ExpertForm";
|
||||
<script name="EnterpriseAdd" setup>
|
||||
import ExpertForm from "@/views/components/ExpertForm/index.vue";
|
||||
import tab from "@/plugins/tab";
|
||||
import { companyAdd, companyDetail, companyEdit } from "@/api/expert/expert";
|
||||
import { reactive, toRefs } from "vue";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
import { ElMessage } from "element-plus";
|
||||
import {companyDetail, companyEdit} from "@/api/expert/expert";
|
||||
import {reactive, ref, toRefs} from "vue";
|
||||
import {useRoute, useRouter} from "vue-router";
|
||||
import {ElMessage} from "element-plus";
|
||||
import useUserStore from "@/store/modules/user";
|
||||
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const formType = ref(1);
|
||||
const expertFormRef = ref(null);
|
||||
const labelWidth = ref(140);
|
||||
const data = reactive({
|
||||
form: {
|
||||
image: undefined,
|
||||
name: undefined,
|
||||
tenantId: undefined,
|
||||
province: undefined, // 省code
|
||||
city: undefined, // 市code
|
||||
district: undefined, // 区code
|
||||
address: undefined, // 详细地址
|
||||
product: undefined,
|
||||
kind: undefined,
|
||||
code: undefined,
|
||||
inviterCode: undefined,
|
||||
url: undefined,
|
||||
industrys: [],
|
||||
keywords: [],
|
||||
directions: [],
|
||||
introduce: undefined,
|
||||
license: undefined,
|
||||
},
|
||||
form: {},
|
||||
});
|
||||
const { form } = toRefs(data);
|
||||
const {form} = toRefs(data);
|
||||
const cancel = () => {
|
||||
router.back();
|
||||
tab.closeOpenPage();
|
||||
tab.closeOpenPage(
|
||||
{
|
||||
path:"/approval/dataList/approval"
|
||||
}
|
||||
);
|
||||
};
|
||||
const submitForm = async (state) => {
|
||||
const valid = await expertFormRef.value.validateForm();
|
||||
if (valid) {
|
||||
if (form.value.id != undefined) {
|
||||
form.value.examineStatus = state;
|
||||
await companyEdit(form.value);
|
||||
cancel();
|
||||
ElMessage.success("修改成功");
|
||||
} else {
|
||||
await companyAdd(form.value);
|
||||
useUserStore().getApprovalCount();
|
||||
cancel();
|
||||
ElMessage.success("新增成功");
|
||||
}
|
||||
} else {
|
||||
console.log("校验未通过");
|
||||
}
|
||||
await companyEdit({id: form.value.id, examineStatus: state});
|
||||
useUserStore().getUnApprovedExpert();
|
||||
cancel();
|
||||
ElMessage.success("已审核");
|
||||
};
|
||||
|
||||
const getDetailById = async () => {
|
||||
if (route.query.id) {
|
||||
const { data } = await companyDetail(route.query.id);
|
||||
const {data} = await companyDetail(route.query.id);
|
||||
form.value = data;
|
||||
form.value.keywords = data.keyword?.split(",") ?? [];
|
||||
form.value.researchs = data.research?.split(",") ?? []
|
||||
form.value.district = data.area;
|
||||
}
|
||||
};
|
||||
getDetailById();
|
||||
</script>
|
||||
|
||||
<!-- <script>
|
||||
export default {
|
||||
components: {
|
||||
ExpertForm,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// formType: 2,
|
||||
// labelWidth: 140,
|
||||
};
|
||||
},
|
||||
methods: {},
|
||||
created() {
|
||||
const { id } = this.$route.query;
|
||||
if (id) {
|
||||
companyDetail({ id }).then((res) => {
|
||||
form.value = res.data;
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
</script> -->
|
||||
|
@ -16,17 +16,18 @@
|
||||
class="m-2"
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option label="待审核" :value="0" />
|
||||
<el-option label="已审核" :value="1" />
|
||||
<el-option label="已拒绝" :value="2" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="站点">
|
||||
<!-- <el-form-item label="站点">
|
||||
<SiteOptions
|
||||
v-model="queryData.tenantId"
|
||||
:site-list="siteList"
|
||||
style="width: 160px"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
|
||||
<el-form-item style="float: right">
|
||||
<el-button
|
||||
@ -43,7 +44,7 @@
|
||||
</el-form>
|
||||
|
||||
<!--表格区域-->
|
||||
<el-table :data="dataList" style="width: 100%">
|
||||
<el-table :data="dataList" style="width: 100%" border>
|
||||
<el-table-column prop="name" label="专家姓名" align="center" />
|
||||
<el-table-column label="研究领域" align="center">
|
||||
<template #default="{ row }">
|
||||
@ -51,19 +52,18 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="education" label="学历" align="center" />
|
||||
<!-- prop="introduce" -->
|
||||
<!-- <el-table-column show-overflow-tooltip label="个人备注" align="center">
|
||||
<el-table-column show-overflow-tooltip label="个人备注" align="center">
|
||||
<template #default="{ row }">
|
||||
<div v-html="row.introduce"></div>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
</el-table-column>
|
||||
<el-table-column prop="school" label="毕业院校" align="center" />
|
||||
<el-table-column prop="post" label="职务" align="center" />
|
||||
<el-table-column label="站点" align="center">
|
||||
<!-- <el-table-column label="站点" align="center">
|
||||
<template #default="{ row }">
|
||||
{{ siteList.find((el) => el.id === row.tenantId)?.name ?? "无" }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column> -->
|
||||
<el-table-column prop="address" label="所在地" align="center" />
|
||||
<el-table-column prop="examineStatus" label="审核状态" align="center">
|
||||
<template #default="{ row }">
|
||||
@ -92,11 +92,11 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import SiteOptions from "@/views/components/SiteOptions";
|
||||
import SiteOptions from "@/views/components/SiteOptions/index.vue";
|
||||
import { tenantSelect } from "@/api/subPlatform/tenant";
|
||||
import { expertList } from "@/api/expert/expert";
|
||||
import { useRouter } from "vue-router";
|
||||
import {reactive, ref, toRefs} from "vue";
|
||||
import useUserStore from "@/store/modules/user";
|
||||
const router = useRouter();
|
||||
const data = reactive({
|
||||
queryData: {
|
||||
@ -107,7 +107,7 @@ const data = reactive({
|
||||
});
|
||||
const total = ref(0);
|
||||
const dataList = ref([]);
|
||||
const siteList = ref([]);
|
||||
// const siteList = ref([]);
|
||||
const { queryData } = toRefs(data);
|
||||
const examineStatusDict = {
|
||||
0: "审核中",
|
||||
@ -121,14 +121,15 @@ const getList = async () => {
|
||||
total.value = res.total;
|
||||
};
|
||||
// 获取站点列表
|
||||
const getSiteList = async () => {
|
||||
const resp = await tenantSelect();
|
||||
siteList.value = resp.rows;
|
||||
};
|
||||
// const getSiteList = async () => {
|
||||
// const resp = await tenantSelect();
|
||||
// siteList.value = resp.rows;
|
||||
// };
|
||||
// 搜索查询
|
||||
const handleQuery = () => {
|
||||
getList(queryData.value);
|
||||
};
|
||||
|
||||
// 重置按钮
|
||||
const resetQuery = () => {
|
||||
queryData.value = {
|
||||
@ -146,6 +147,8 @@ const btnAudit = (id) => {
|
||||
});
|
||||
};
|
||||
getList();
|
||||
getSiteList();
|
||||
|
||||
useUserStore().getUnApprovedExpert();
|
||||
// getSiteList();
|
||||
</script>
|
||||
<style></style>
|
||||
|
@ -51,8 +51,9 @@ const data = reactive({
|
||||
});
|
||||
const {form} = toRefs(data);
|
||||
const cancel = () => {
|
||||
router.back();
|
||||
tab.closeOpenPage();
|
||||
tab.closeOpenPage({
|
||||
path: "/approval/data-list/laboratory"
|
||||
});
|
||||
};
|
||||
const submitForm = async (state) => {
|
||||
form.value.examineStatus = state;
|
||||
@ -61,55 +62,16 @@ const submitForm = async (state) => {
|
||||
examineStatus: state
|
||||
});
|
||||
cancel()
|
||||
|
||||
// const valid = await expertFormRef.value.validateForm();
|
||||
// if (valid) {
|
||||
// if (form.value.id !== undefined) {
|
||||
// form.value.examineStatus = state;
|
||||
// await casLaboratoryUpdate(form.value);
|
||||
// cancel();
|
||||
// ElMessage.success("修改成功");
|
||||
// }/* else {
|
||||
// await companyAdd(form.value);
|
||||
// useUserStore().getApprovalCount();
|
||||
// cancel();
|
||||
// ElMessage.success("新增成功");
|
||||
// }*/
|
||||
// } else {
|
||||
// console.log("校验未通过");
|
||||
// }
|
||||
};
|
||||
|
||||
const getDetailById = async () => {
|
||||
if (route.query.id) {
|
||||
const {data} = await casLaboratoryDetail(route.query.id);
|
||||
form.value = data;
|
||||
form.value.researchDirection = data.researchDirection?.split(",")
|
||||
form.value.district = data.area;
|
||||
form.value.researchs = data.researchDirection?.split(",") ?? []
|
||||
form.value.keywords = data.keyword?.split(",") ?? []
|
||||
form.value.member = data.member?.split(",") ?? ""
|
||||
}
|
||||
};
|
||||
getDetailById();
|
||||
</script>
|
||||
|
||||
<!-- <script>
|
||||
export default {
|
||||
components: {
|
||||
ExpertForm,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// formType: 2,
|
||||
// labelWidth: 140,
|
||||
};
|
||||
},
|
||||
methods: {},
|
||||
created() {
|
||||
const { id } = this.$route.query;
|
||||
if (id) {
|
||||
companyDetail({ id }).then((res) => {
|
||||
form.value = res.data;
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
</script> -->
|
||||
</script>
|
@ -38,7 +38,7 @@
|
||||
</el-form>
|
||||
|
||||
<!--表格区域-->
|
||||
<el-table :data="dataList" style="width: 100%">
|
||||
<el-table :data="dataList" style="width: 100%" border>
|
||||
<el-table-column type="selection" width="55"/>
|
||||
<el-table-column align="center" label="数据编号" prop="id"/>
|
||||
<el-table-column align="center" label="实验室全称" prop="name"/>
|
||||
@ -121,7 +121,7 @@ const examineStatusDict = {
|
||||
1: "已通过",
|
||||
2: "已拒绝",
|
||||
};
|
||||
// 获取专家列表
|
||||
// 获取列表
|
||||
const getList = async () => {
|
||||
const res = await casLaboratoryList(queryData.value);
|
||||
dataList.value = res.rows;
|
||||
|
72
src/views/userAuditList/research/approval.vue
Normal file
72
src/views/userAuditList/research/approval.vue
Normal file
@ -0,0 +1,72 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div style="width: 50%">
|
||||
<research-form
|
||||
ref="researchFormRef"
|
||||
v-model="form"
|
||||
:isAdd="false"
|
||||
:labelWidth="140"
|
||||
:showTitle="true"
|
||||
/>
|
||||
</div>
|
||||
<div :style="{ marginLeft: labelWidth + 'px' }">
|
||||
<el-button @click="submitForm('2')">审核拒绝</el-button>
|
||||
<el-button type="primary" @click="submitForm('1')">通过审核</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script name="EnterpriseAdd" setup>
|
||||
import ResearchForm from '@/views/components/ResearchForm'
|
||||
import tab from "@/plugins/tab";
|
||||
import {reactive, ref, toRefs} from "vue";
|
||||
import {useRoute, useRouter} from "vue-router";
|
||||
import {researchDetail, researchEdit} from "@/api/dataList/research";
|
||||
import {ElMessage} from "element-plus";
|
||||
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const formType = ref(1);
|
||||
const researchFormRef = ref(null);
|
||||
const labelWidth = ref(140);
|
||||
const data = reactive({
|
||||
form: {
|
||||
industrys: [],
|
||||
},
|
||||
});
|
||||
const {form} = toRefs(data);
|
||||
|
||||
/**
|
||||
* 返回列表页
|
||||
*/
|
||||
const cancel = () => {
|
||||
tab.closeOpenPage({
|
||||
path: "/approval/research"
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 提交审核结果
|
||||
* @param state
|
||||
* @return {Promise<void>}
|
||||
*/
|
||||
const submitForm = async (state) => {
|
||||
form.value.examineStatus = state;
|
||||
await researchEdit({
|
||||
id: form.value.id,
|
||||
examineStatus: state
|
||||
});
|
||||
ElMessage.success("审核成功")
|
||||
cancel()
|
||||
};
|
||||
|
||||
const getDetailById = async () => {
|
||||
if (route.query.id) {
|
||||
const {data} = await researchDetail(route.query.id);
|
||||
form.value = data;
|
||||
form.value.industrys = data.industry?.split(",")?.map(el => parseInt(el)) ?? [];
|
||||
form.value.researchs = data.research?.split(",") ?? [];
|
||||
}
|
||||
};
|
||||
getDetailById();
|
||||
</script>
|
552
src/views/userAuditList/research/index.vue
Normal file
552
src/views/userAuditList/research/index.vue
Normal file
@ -0,0 +1,552 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form
|
||||
v-show="showSearch"
|
||||
ref="queryFormRef"
|
||||
:inline="true"
|
||||
:model="queryParams"
|
||||
label-width="68px"
|
||||
>
|
||||
<el-form-item label="企业名称" prop="name">
|
||||
<el-input
|
||||
v-model="queryParams.name"
|
||||
clearable
|
||||
placeholder="请输入企业名称"
|
||||
size="default"
|
||||
style="width: 240px"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="所属站点" prop="tenantId">
|
||||
<SiteOptions v-model="queryParams.tenantId" :site-list="siteList" />
|
||||
</el-form-item> -->
|
||||
<!-- <el-table-column align="center" label="审核状态" prop="examineStatus">-->
|
||||
<!-- <template #default="{ row }">-->
|
||||
<!-- {{ examineStatusDict[row.examineStatus] }}-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<el-form-item>
|
||||
<el-button
|
||||
icon="search"
|
||||
size="default"
|
||||
type="primary"
|
||||
@click="handleQuery"
|
||||
>搜索
|
||||
</el-button
|
||||
>
|
||||
<el-button icon="refresh" size="default" @click="resetQuery"
|
||||
>重置
|
||||
</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row v-if="false" :gutter="10" class="mb8">
|
||||
<right-toolbar
|
||||
:showSearch.sync="showSearch"
|
||||
@queryTable="getList"
|
||||
></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="dataList"
|
||||
border
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55"/>
|
||||
<el-table-column align="center" label="机构名称" prop="name"/>
|
||||
<el-table-column align="center" label="统一社会信用代码" prop="code"/>
|
||||
<el-table-column align="center" label="主要研究方向" prop="research"/>
|
||||
|
||||
<!-- <el-table-column label="站点" align="center">
|
||||
<template #default="{ row }">
|
||||
{{ siteList.find((el) => el.id === row.tenantId)?.name ?? "无" }}
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column align="center" label="所在地" prop="address"/>
|
||||
<el-table-column align="center" label="申请时间">
|
||||
<template #default="{ row }">
|
||||
<span>{{ row.createTime }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="审核状态" prop="examineStatus">
|
||||
<template #default="{ row }">
|
||||
{{ examineStatusDict[row.examineStatus] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作">
|
||||
<template #default="{ row }">
|
||||
<el-button
|
||||
icon="edit"
|
||||
size="small"
|
||||
type="text"
|
||||
@click="handleApproval(row.id)"
|
||||
>审核
|
||||
</el-button
|
||||
>
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
v-model:page="queryParams.pageNum"
|
||||
:total="total"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 用户导入对话框 -->
|
||||
<el-dialog
|
||||
v-model="upload.open"
|
||||
:title="upload.title"
|
||||
append-to-body
|
||||
width="400px"
|
||||
>
|
||||
<el-upload
|
||||
ref="uploadRef"
|
||||
:action="upload.url"
|
||||
:auto-upload="false"
|
||||
:disabled="upload.isUploading"
|
||||
:headers="upload.headers"
|
||||
:limit="1"
|
||||
:on-progress="handleFileUploadProgress"
|
||||
:on-success="handleFileSuccess"
|
||||
accept=".xlsx, .xls"
|
||||
drag
|
||||
>
|
||||
<el-icon class="el-icon--upload">
|
||||
<upload-filled/>
|
||||
</el-icon>
|
||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||
<template #tip>
|
||||
<div class="el-upload__tip text-center">
|
||||
<!-- <div class="el-upload__tip">
|
||||
<el-checkbox
|
||||
v-model="upload.updateSupport"
|
||||
/>是否更新已经存在的用户数据
|
||||
</div> -->
|
||||
<span>仅允许导入xls、xlsx格式文件。</span>
|
||||
<!-- <el-link
|
||||
type="primary"
|
||||
:underline="false"
|
||||
style="font-size: 12px; vertical-align: baseline"
|
||||
@click="importTemplate"
|
||||
>下载模板</el-link
|
||||
> -->
|
||||
</div>
|
||||
</template>
|
||||
</el-upload>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitFileForm">确 定</el-button>
|
||||
<el-button @click="upload.open = false">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog
|
||||
v-model="showAssignAccount"
|
||||
append-to-body
|
||||
title="分配账号"
|
||||
width="400px"
|
||||
>
|
||||
<el-form
|
||||
ref="assignAccountFormRef"
|
||||
:model="assignAccountForm"
|
||||
:rules="assignAccoutRules"
|
||||
label-width="80px"
|
||||
>
|
||||
<el-form-item label="用户名" prop="username">
|
||||
<el-input v-model="assignAccountForm.username"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="密码" prop="password">
|
||||
<el-input
|
||||
v-model="assignAccountForm.password"
|
||||
show-password
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitAssignAccount"
|
||||
>确 定
|
||||
</el-button
|
||||
>
|
||||
<el-button @click="closeAssignAccount">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog
|
||||
v-model="showResetPassword"
|
||||
append-to-body
|
||||
title="重置密码"
|
||||
width="400px"
|
||||
>
|
||||
<el-form
|
||||
ref="resetPasswordFormRef"
|
||||
:model="resetPasswordForm"
|
||||
:rules="assignAccoutRules"
|
||||
label-width="80px"
|
||||
>
|
||||
<el-form-item label="密码" prop="password">
|
||||
<el-input
|
||||
v-model="resetPasswordForm.password"
|
||||
show-password
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitResetPassword"
|
||||
>确 定
|
||||
</el-button
|
||||
>
|
||||
<el-button @click="closeResetPassword">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script name="Enterprise" setup>
|
||||
import {
|
||||
allocateAccount,
|
||||
getAccount,
|
||||
getCasVip,
|
||||
openCasVip,
|
||||
restPassword,
|
||||
updateCasVip,
|
||||
} from "@/api/dataList/enterprise";
|
||||
import md5 from "js-md5";
|
||||
import {getToken} from "@/utils/auth";
|
||||
// import SiteOptions from "@/views/components/SiteOptions";
|
||||
// import axios from "axios";
|
||||
// import { download } from "@/utils/request";
|
||||
// import dayjs from "dayjs";
|
||||
import {blobValidate} from "@/utils/ruoyi";
|
||||
import {saveAs} from "file-saver";
|
||||
import {reactive, ref, toRefs} from "vue";
|
||||
import {useRouter} from "vue-router";
|
||||
import {ElLoading, ElMessage, ElMessageBox} from "element-plus";
|
||||
import request from "@/utils/request";
|
||||
import dayjs from "dayjs";
|
||||
import {researchDelete, researchList} from "@/api/dataList/research";
|
||||
|
||||
const router = useRouter();
|
||||
const data = reactive({
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
// examine_status: 2,
|
||||
name: undefined,
|
||||
// tenantId: undefined,
|
||||
},
|
||||
});
|
||||
|
||||
const examineStatusDict = {
|
||||
0: "审核中",
|
||||
1: "已通过",
|
||||
2: "已拒绝",
|
||||
};
|
||||
|
||||
/*** 用户导入参数 */
|
||||
const upload = reactive({
|
||||
// 是否显示弹出层(用户导入)
|
||||
open: false,
|
||||
// 弹出层标题(用户导入)
|
||||
title: "",
|
||||
// 是否禁用上传
|
||||
isUploading: false,
|
||||
// 是否更新已经存在的用户数据
|
||||
// updateSupport: 0,
|
||||
// 设置上传的请求头部
|
||||
headers: {Authorization: "Bearer " + getToken()},
|
||||
// 上传的地址
|
||||
url: import.meta.env.VITE_APP_BASE_API + "/business/enterprise/importData",
|
||||
});
|
||||
|
||||
const {queryParams} = toRefs(data);
|
||||
const showSearch = ref(true);
|
||||
// const siteList = ref([]);
|
||||
const loading = ref(true);
|
||||
const total = ref(0);
|
||||
const dataList = ref([]);
|
||||
|
||||
const ids = ref([]);
|
||||
const handleSelectionChange = (selection) => {
|
||||
ids.value = selection.map((el) => el.id);
|
||||
};
|
||||
|
||||
/** 研究机构列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
const resp = await researchList(queryParams.value);
|
||||
dataList.value = resp.rows;
|
||||
total.value = resp.total;
|
||||
loading.value = false;
|
||||
};
|
||||
// 获取站点列表
|
||||
// const getSiteList = async () => {
|
||||
// const resp = await tenantSelect();
|
||||
// siteList.value = resp.rows;
|
||||
// };
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
};
|
||||
|
||||
const assignAccoutRules = {
|
||||
username: [{required: true, message: "请输入用户名", trigger: "blur"}],
|
||||
password: [{required: true, message: "请输入密码", trigger: "blur"}],
|
||||
vipType: [{required: true, message: "请选择会员类型", trigger: "change"}],
|
||||
expireTime: [
|
||||
{required: true, message: "请选择到期时间", trigger: "change"},
|
||||
],
|
||||
};
|
||||
const showAssignAccount = ref(false);
|
||||
const assignAccountForm = reactive({
|
||||
username: undefined,
|
||||
password: undefined,
|
||||
});
|
||||
const assignAccountFormRef = ref();
|
||||
const resetPasswordForm = reactive({
|
||||
password: undefined,
|
||||
});
|
||||
const resetPasswordFormRef = ref();
|
||||
const showResetPassword = ref(false);
|
||||
|
||||
const openAssignAccount = async (id) => {
|
||||
resetForm();
|
||||
const {have, data} = await getAccount(id);
|
||||
if (have) {
|
||||
ElMessageBox.alert(`已经存在账号:${data}`, "账号已经存在");
|
||||
} else {
|
||||
assignAccountForm.id = id;
|
||||
showAssignAccount.value = true;
|
||||
}
|
||||
};
|
||||
|
||||
const openResetPassword = async (id) => {
|
||||
resetForm();
|
||||
const {have, userId} = await getAccount(id);
|
||||
if (have) {
|
||||
resetPasswordForm.id = userId;
|
||||
showResetPassword.value = true;
|
||||
} else {
|
||||
ElMessageBox.alert(`尚未分配账号,请先分配账号`, "尚未分配账号");
|
||||
}
|
||||
};
|
||||
const resetForm = () => {
|
||||
if (resetPasswordFormRef.value) {
|
||||
resetPasswordFormRef.value.resetFields();
|
||||
}
|
||||
if (assignAccountFormRef.value) {
|
||||
assignAccountFormRef.value.resetFields();
|
||||
}
|
||||
resetPasswordForm.password = undefined;
|
||||
assignAccountForm.username = undefined;
|
||||
assignAccountForm.password = undefined;
|
||||
};
|
||||
const closeResetPassword = () => {
|
||||
resetForm();
|
||||
showResetPassword.value = false;
|
||||
};
|
||||
const closeAssignAccount = () => {
|
||||
resetForm();
|
||||
showAssignAccount.value = false;
|
||||
};
|
||||
|
||||
const submitAssignAccount = async () => {
|
||||
await assignAccountFormRef.value.validate();
|
||||
await allocateAccount({
|
||||
...assignAccountForm,
|
||||
password: md5(assignAccountForm.password),
|
||||
});
|
||||
ElMessage.success("账号分配成功");
|
||||
showAssignAccount.value = false;
|
||||
};
|
||||
|
||||
const submitResetPassword = async () => {
|
||||
await resetPasswordFormRef.value.validate();
|
||||
await restPassword(resetPasswordForm.id, md5(resetPasswordForm.password));
|
||||
ElMessage.success("密码重置成功");
|
||||
showResetPassword.value = false;
|
||||
};
|
||||
|
||||
//TODO:
|
||||
/** 开通vip操作 */
|
||||
const vipData = reactive({
|
||||
vipForm: {userType: "1"},
|
||||
});
|
||||
const {vipForm} = toRefs(vipData);
|
||||
const showOpenVip = ref(false);
|
||||
const vipFormRef = ref();
|
||||
|
||||
const handleOpenVip = async (id) => {
|
||||
resetVipForm();
|
||||
const {have, userId} = await getAccount(id);
|
||||
if (have) {
|
||||
const resp = await getCasVip(userId);
|
||||
if (resp.have) {
|
||||
vipForm.value = resp.data;
|
||||
showOpenVip.value = true;
|
||||
} else {
|
||||
vipForm.value.userId = userId;
|
||||
vipForm.value.vipType = "0";
|
||||
showOpenVip.value = true;
|
||||
}
|
||||
} else {
|
||||
ElMessageBox.alert(`尚未分配账号,请先分配账号`, "尚未分配账号");
|
||||
}
|
||||
};
|
||||
|
||||
const submitVip = async () => {
|
||||
await vipFormRef.value.validate();
|
||||
if (vipForm.value.id) {
|
||||
await updateCasVip(vipForm.value);
|
||||
ElMessage.success("会员修改成功");
|
||||
} else {
|
||||
await openCasVip(vipForm.value);
|
||||
ElMessage.success("会员开通成功");
|
||||
}
|
||||
showOpenVip.value = false;
|
||||
};
|
||||
|
||||
const resetVipForm = () => {
|
||||
vipForm.value = {userType: "1"};
|
||||
if (vipFormRef.value) {
|
||||
vipFormRef.value.resetFields();
|
||||
}
|
||||
};
|
||||
|
||||
const closeVip = () => {
|
||||
resetVipForm();
|
||||
showOpenVip.value = false;
|
||||
};
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
// dateRange.value = [];
|
||||
if (queryFormRef.value) {
|
||||
queryFormRef.value.resetFields();
|
||||
}
|
||||
handleQuery();
|
||||
};
|
||||
const handleAdd = () => {
|
||||
router.push({
|
||||
path: "/dataList/research-institutions/edit",
|
||||
});
|
||||
};
|
||||
const handleApproval = (id) => {
|
||||
router.push({
|
||||
path: "/approval/research/approval",
|
||||
query: {id},
|
||||
});
|
||||
};
|
||||
const uploadRef = ref(null);
|
||||
|
||||
/** 导入按钮操作 */
|
||||
function handleImport() {
|
||||
upload.title = "用户导入";
|
||||
upload.open = true;
|
||||
}
|
||||
|
||||
/** 下载模板操作 */
|
||||
function importTemplate() {
|
||||
proxy.download(
|
||||
"system/user/importTemplate",
|
||||
{},
|
||||
`user_template_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
}
|
||||
|
||||
/**文件上传中处理 */
|
||||
const handleFileUploadProgress = (event, file, fileList) => {
|
||||
upload.isUploading = true;
|
||||
};
|
||||
/** 文件上传成功处理 */
|
||||
const handleFileSuccess = (response, file, fileList) => {
|
||||
upload.open = false;
|
||||
upload.isUploading = false;
|
||||
uploadRef.value.handleRemove(file);
|
||||
ElMessageBox.alert(
|
||||
"<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
|
||||
response.msg +
|
||||
"</div>",
|
||||
"导入结果",
|
||||
{dangerouslyUseHTMLString: true}
|
||||
);
|
||||
getList();
|
||||
};
|
||||
|
||||
/** 提交上传文件 */
|
||||
function submitFileForm() {
|
||||
uploadRef.value.submit();
|
||||
}
|
||||
|
||||
const handleDelete = async (id) => {
|
||||
const delIds = id || ids.value.join(",");
|
||||
ElMessageBox.confirm(`是否确认删除编号为${delIds}的数据项?`)
|
||||
.then(async () => {
|
||||
await researchDelete(delIds);
|
||||
getList();
|
||||
ElMessage.success("删除成功");
|
||||
})
|
||||
.catch(() => {
|
||||
});
|
||||
};
|
||||
|
||||
let downloadLoadingInstance;
|
||||
const download = (url, filename) => {
|
||||
downloadLoadingInstance = ElLoading.service({
|
||||
text: "正在下载数据,请稍候",
|
||||
background: "rgba(0, 0, 0, 0.7)",
|
||||
});
|
||||
return request
|
||||
.get(url, {
|
||||
// transformRequest: [
|
||||
// (params) => {
|
||||
// return tansParams(params);
|
||||
// },
|
||||
// ],
|
||||
headers: {"Content-Type": "application/x-www-form-urlencoded"},
|
||||
responseType: "blob",
|
||||
})
|
||||
.then(async (data) => {
|
||||
const isLogin = await blobValidate(data);
|
||||
if (isLogin) {
|
||||
const blob = new Blob([data]);
|
||||
saveAs(blob, filename);
|
||||
} else {
|
||||
const resText = await data.text();
|
||||
const rspObj = JSON.parse(resText);
|
||||
const errMsg =
|
||||
errorCode[rspObj.code] || rspObj.msg || errorCode["default"];
|
||||
ElMessage.error(errMsg);
|
||||
}
|
||||
downloadLoadingInstance.close();
|
||||
})
|
||||
.catch((r) => {
|
||||
console.error(r);
|
||||
ElMessage.error("下载文件出现错误,请联系管理员!");
|
||||
downloadLoadingInstance.close();
|
||||
});
|
||||
};
|
||||
|
||||
const handleExport = () => {
|
||||
ElMessageBox.confirm(`是否确认企业列表?`).then(() => {
|
||||
download(
|
||||
`/business/enterprise/export`,
|
||||
`企业信息(${dayjs().format("YYYYMMDDHHmmss")}).xlsx`
|
||||
);
|
||||
});
|
||||
};
|
||||
getList();
|
||||
// getSiteList();
|
||||
</script>
|
Reference in New Issue
Block a user