This commit is contained in:
2023-06-07 10:44:31 +08:00
parent dd86abca9a
commit a76aa5eddb
21 changed files with 2417 additions and 981 deletions

View File

@ -0,0 +1,41 @@
<template>
<div class="app-container">
<el-card shadow="always" style="width: 55%; margin: 0 auto">
<agent-form ref="agentFormRef" v-model="form" is-add/>
<div :style="{ marginLeft: labelWidth + 'px' }">
<el-button @click="$router.go(-1)">取消</el-button>
<el-button type="primary" @click="submitForm">提交</el-button>
</div>
</el-card>
</div>
</template>
<script setup>
import AgentForm from '@/views/components/AgentForm'
import {reactive, ref, toRefs} from "vue";
const props = defineProps({
labelWidth: {
type: Number,
default: 120
}
})
const data = reactive({
form: {
industrys: [],
id_image: {}
}
})
const {form} = toRefs(data)
const agentFormRef = ref()
const submitForm = async () => {
if (!agentFormRef.value) return
const valid = await agentFormRef.value.validateForm()
if (valid) {
// TODO: submit laboratory
}
}
</script>
<style lang="scss" scoped>
</style>

View File

@ -15,10 +15,11 @@
</div>
</template>
<script setup>
import { insertCasExpert } from "@/api/identity/index";
import { insertCasExpert } from "@/api/identity";
import ExpertForm from "@/views/components/ExpertForm";
import { ElMessage } from "element-plus";
import { useRouter } from "vue-router";
import {reactive, ref} from "vue";
const router = useRouter();
const labelWidth = 140;

View File

@ -1,49 +1,52 @@
<template>
<div class="app-container" v-if="identityList.length">
<div v-if="identityList.length" class="app-container">
<el-row>
<el-col :span="2">
<el-button size="small" :icon="ArrowLeftBold" round @click="backToHome"
>返回</el-button
></el-col
<el-button :icon="ArrowLeftBold" plain round size="small" type="primary" @click="backToHome"
>返回
</el-button
>
</el-col
>
<el-col :span="22">
<el-alert
title="温馨提示:如是企业请入驻企业后台,专家请入驻专家后台,并完善资料"
type="warning"
:style="{
:style="{
marginBottom: `10px`,
}"
show-icon
title="温馨提示:如是企业请入驻企业后台,专家请入驻专家后台,并完善资料"
type="warning"
></el-alert>
</el-col>
</el-row>
<el-card shadow="always">
<el-row :gutter="20" justify="center">
<!-- v-show="item.id <= 2"-->
<el-col
:span="4"
v-for="item in identityList.slice(0, 5)"
v-show="item.id <= 2"
:key="item.id"
@click="handleStatus(item)"
v-for="item in identityList"
:key="item.id"
:span="4"
@click="handleStatus(item)"
>
<el-card style="text-align: center; height: 100%">
<el-image
style="height: 100px"
src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"
fit="cover"
fit="cover"
src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"
style="height: 100px"
></el-image>
<h3>{{ `${item.title}入驻` }}</h3>
<p v-if="item.status == 0">审核中</p>
<div v-else-if="item.status == 2">
<p v-if="item.status === '0'">审核中</p>
<div v-else-if="item.status === '2'">
<p class="text-danger">审核拒绝</p>
<p
class="text-navy"
style="cursor: pointer"
@click.stop="reason(item)"
class="text-navy"
style="cursor: pointer"
@click.stop="reason(item)"
>
查看拒绝原因
</p>
</div>
<div v-else-if="item.status == 4">
<div v-else-if="item.status === '4'">
<el-link type="primary">申请</el-link>
</div>
</el-card>
@ -53,20 +56,21 @@
<el-card class="mt20" shadow="always">
<el-row :gutter="20" justify="center">
<!-- v-show="item.id <= 2"-->
<el-col
:span="4"
v-for="item in identityList.slice(0, 5)"
v-show="item.id <= 2"
:key="item.id"
v-for="item in identityList"
:key="item.id"
:span="4"
>
<el-card style="text-align: center; height: 100%">
<el-image
style="height: 100px"
src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"
fit="cover"
fit="cover"
src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"
style="height: 100px"
></el-image>
<h3>{{ `${item.title}后台` }}</h3>
<p v-if="item.status == 1">
<p v-if="item.status === '1'">
<!-- <p> -->
<el-link type="primary" @click="handlePage(item)">进入</el-link>
</p>
@ -78,12 +82,14 @@
</template>
<script setup>
// import store from "@/store";
import { identity, settled, identitySwitch } from "@/api/identity/index";
import { useRouter } from "vue-router";
import {identity} from "@/api/identity";
import {useRouter} from "vue-router";
import usePermissionStore from "@/store/modules/permission";
import useUserStore from "@/store/modules/user";
import { ElMessageBox } from "element-plus";
import { ArrowLeftBold } from "@element-plus/icons-vue";
import {ElMessageBox} from "element-plus";
import {ArrowLeftBold} from "@element-plus/icons-vue";
import {onMounted, ref} from "vue";
const router = useRouter();
const permissionStore = usePermissionStore();
@ -92,8 +98,8 @@ const identityList = ref([]);
const identityDict = {
1: "企业",
2: "专家",
3: "研究机构",
4: "实验室",
3: "实验室",
4: "研究机构",
5: "科技经纪人",
// 6: "企业后台",
// 7: "专家后台",
@ -103,85 +109,74 @@ const identityDict = {
};
onMounted(() => {
identity().then((res) => {
// console.log(res.data);
res.data.forEach((item) => {
identityList.value.push({
id: item.roleId,
title: identityDict[item.roleId],
status: item.status,
});
});
// settled().then((ret) => {
// for (const key in res.data) {
// const obj = { id: key, title: res.data[key], status: -1, remark: "" };
// if (ret.data.examine_identity[key] !== undefined) {
// obj.status = ret.data.examine_identity[key].status;
// obj.remark = ret.data.examine_identity[key].remark;
// }
// if ((ret.data.identity & key) > 0) {
// obj.status = 1;
// }
// identityList.value.push(obj);
// }
// });
identityList.value = res.data.map(item => ({
id: item.roleId,
title: identityDict[item.roleId],
status: item.status,
})).slice(0, 5)
});
});
function reason(item) {
alert("拒绝原因:\n" + item.remark);
}
function noClicking() {
return identityList.value.some(
(item) => item.status == 0 || item.status == 1
(item) => item.status === "0" || item.status === "1"
);
}
const backToHome = () => {
router.push({
path: "/",
});
};
// item.status -1>未入驻 0>审核中 1>通过 2拒绝
function handleStatus(item) {
// console.log(item);
if (noClicking()) return ElMessageBox.alert("一个账号只能申请一个身份");
if (item.status === "4" || item.status === "2") {
if (item.id == 1) {
if (item.id === 1) {
// 企业
router.push({ path: "/identity/enterprise" });
} else if (item.id == 2) {
router.push({path: "/identity/enterprise"});
} else if (item.id === 2) {
// 专家
router.push({ path: "/identity/expert" });
} else if (item.id == 3) {
// 研究机构
router.push({ path: "/identity/research" });
} else if (item.id == 4) {
router.push({path: "/identity/expert"});
} else if (item.id === 3) {
// 实验室
router.push({ path: "/identity/laboratory" });
} else if (item.id == 5) {
router.push({path: "/identity/laboratory"});
} else if (item.id === 4) {
// 研究机构
router.push({path: "/identity/research"});
} else if (item.id === 5) {
// 科技经纪人
router.push({ path: "/identity/agent" });
router.push({path: "/identity/agent"});
}
} else if (item.status === 1) {
alert("您已入驻,请进入后台");
} else {
}
}
const handlePage = async (item) => {
let routeData = "";
if (item.id == 1) {
if (item.id === 1) {
// 企业
routeData = router.resolve({ path: "/admin" });
} else if (item.id == 2) {
routeData = router.resolve({path: "/admin"});
} else if (item.id === 2) {
// 专家
routeData = router.resolve({ path: "/admin" });
} else if (item.id == 3) {
routeData = router.resolve({path: "/admin"});
} else if (item.id === 3) {
// 研究机构
routeData = router.resolve({ path: "/admin" });
} else if (item.id == 4) {
routeData = router.resolve({path: "/admin"});
} else if (item.id === 4) {
// 实验室
routeData = router.resolve({ path: "/admin" });
} else if (item.id == 5) {
routeData = router.resolve({path: "/admin"});
} else if (item.id === 5) {
// 科技经纪人
routeData = router.resolve({ path: "/five" });
routeData = router.resolve({path: "/five"});
}
// return window.open(routeData.href, "_blank");
// TODO ...... 切换身份待处理

View File

@ -0,0 +1,50 @@
<template>
<div class="app-container">
<el-card shadow="always" style="width: 55%; margin: 0 auto">
<laboratory-form ref="laboratoryFormRef" v-model="form" is-add/>
<div :style="{ marginLeft: labelWidth + 'px' }">
<el-button @click="$router.go(-1)">取消</el-button>
<el-button type="primary" @click="submitForm">提交</el-button>
</div>
</el-card>
</div>
</template>
<script setup>
import {insertLaboratory} from '@/api/identity'
import LaboratoryForm from '@/views/components/LaboratoryForm'
import {reactive, ref, toRefs} from "vue";
import {ElMessage} from "element-plus";
import {useRouter} from "vue-router";
const props = defineProps({
labelWidth: {
type: Number,
default: 120
}
})
const router = useRouter()
const data = reactive({
form: {researchs: []}
})
const {form} = toRefs(data)
const laboratoryFormRef = ref()
const submitForm = async () => {
if (!laboratoryFormRef.value) return
const valid = await laboratoryFormRef.value.validateForm()
if (valid) {
try {
form.value.researchDirection = form.value.researchs?.join(",") ?? null
await insertLaboratory(form.value)
router.go(-1);
ElMessage.success("实验室入驻成功")
} catch (e) {
console.error(e)
ElMessage.error("入驻失败")
}
}
}
</script>
<style lang="scss" scoped>
</style>

View File

@ -0,0 +1,40 @@
<template>
<div class="app-container">
<el-card shadow="always" style="width: 55%; margin: 0 auto">
<research-form ref="researchFormRef" v-model="form" is-add/>
<div :style="{ marginLeft: labelWidth + 'px' }">
<el-button @click="$router.go(-1)">取消</el-button>
<el-button type="primary" @click="submitForm">提交</el-button>
</div>
</el-card>
</div>
</template>
<script setup>
import ResearchForm from '@/views/components/ResearchForm'
import {reactive, ref, toRefs} from "vue";
const props = defineProps({
labelWidth: {
type: Number,
default: 120
}
})
const data = reactive({
form: {
industrys: [],
}
})
const {form} = toRefs(data)
const researchFormRef = ref()
const submitForm = async () => {
if (!researchFormRef.value) return
const valid = await researchFormRef.value.validateForm()
if (valid) {
// TODO: submit laboratory
}
}
</script>
<style lang="scss" scoped>
</style>