This commit is contained in:
quantulr
2024-03-11 17:20:00 +08:00
parent ce7f7e4b8b
commit 1c3bfc1610
4 changed files with 185 additions and 180 deletions

View File

@ -1,126 +1,126 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form <el-form
v-show="showSearch" v-show="showSearch"
ref="queryRef" ref="queryRef"
:inline="true" :inline="true"
:model="queryParams" :model="queryParams"
@submit.prevent @submit.prevent
> >
<el-form-item <el-form-item
:label="t('admin.form.name', { type: t('admin.common.expert') })" :label="t('admin.form.name', { type: t('admin.common.expert') })"
prop="title" prop="name"
> >
<el-input <el-input
v-model="queryParams.title" v-model="queryParams.name"
clearable clearable
:placeholder=" :placeholder="
t('admin.form.placeholder', { t('admin.form.placeholder', {
type: t('admin.form.name', { type: t('admin.form.name', {
type: t('admin.common.expert'), type: t('admin.common.expert'),
}), }),
}) })
" "
size="small" size="small"
style="width: 240px" style="width: 240px"
@keyup.enter="handleQuery" @keyup.enter="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button <el-button
icon="Search" icon="Search"
size="small" size="small"
type="primary" type="primary"
@click="handleQuery" @click="handleQuery"
><!--搜索--> ><!--搜索-->
{{ t("common.search") }} {{ t("common.search") }}
</el-button> </el-button>
<el-button icon="Refresh" size="small" @click="resetQuery" <el-button icon="Refresh" size="small" @click="resetQuery"
>{{ t("admin.common.reset") }} >{{ t("admin.common.reset") }}
</el-button> </el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
icon="plus" icon="plus"
size="small" size="small"
type="primary" type="primary"
@click="handleAddBind" @click="handleAddBind"
>{{ t("admin.table.relatedExperts") }} >{{ t("admin.table.relatedExperts") }}
</el-button> </el-button>
</el-col> </el-col>
<right-toolbar <right-toolbar
v-model:showSearch="showSearch" v-model:showSearch="showSearch"
@queryTable="getList" @queryTable="getList"
></right-toolbar> ></right-toolbar>
</el-row> </el-row>
<!-- 关联未被关联的专家 --> <!-- 关联未被关联的专家 -->
<el-dialog <el-dialog
v-model="showExpertDialog" v-model="showExpertDialog"
:title="t('admin.table.relatedExperts')" :title="t('admin.table.relatedExperts')"
@close="resetQuery" @close="resetNotBindExpertQuery"
> >
<el-form <el-form
ref="notBindExpertQueryRef" ref="notBindExpertQueryRef"
:inline="true" :inline="true"
:model="notBindExpertQueryParams" :model="notBindExpertQueryParams"
@submit.prevent @submit.prevent
> >
<el-form-item <el-form-item
:label="t('admin.form.name', { type: t('admin.common.expert') })" :label="t('admin.form.name', { type: t('admin.common.expert') })"
prop="name" prop="expertName"
> >
<el-input <el-input
v-model="notBindExpertQueryParams.name" v-model="notBindExpertQueryParams.expertName"
clearable clearable
:placeholder=" :placeholder="
t('admin.form.placeholder', { t('admin.form.placeholder', {
type: t('admin.form.name', { type: t('admin.form.name', {
type: t('admin.common.expert'), type: t('admin.common.expert'),
}), }),
}) })
" "
size="small" size="small"
style="width: 240px" style="width: 240px"
@keyup.enter="getNotBindExpertList" @keyup.enter="getNotBindExpertList"
/> />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button <el-button
icon="Search" icon="Search"
size="small" size="small"
type="primary" type="primary"
@click="getNotBindExpertList" @click="getNotBindExpertList"
><!--搜索--> ><!--搜索-->
{{ t("common.search") }} {{ t("common.search") }}
</el-button> </el-button>
<el-button <el-button
icon="Refresh" icon="Refresh"
size="small" size="small"
@click="resetNotBindExpertQuery" @click="resetNotBindExpertQuery"
>{{ t("admin.common.reset") }} >{{ t("admin.common.reset") }}
</el-button> </el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table :data="notBindExpertList"> <el-table :data="notBindExpertList">
<el-table-column :label="t('admin.common.dataNumber')" prop="id" /> <el-table-column :label="t('admin.common.dataNumber')" prop="id"/>
<el-table-column <el-table-column
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
:label="t('admin.form.name', { type: t('admin.common.expert') })" :label="t('admin.form.name', { type: t('admin.common.expert') })"
prop="name" prop="name"
/> />
<el-table-column :label="t('webContact.phone')" prop="mobile" /> <el-table-column :label="t('webContact.phone')" prop="mobile"/>
<el-table-column <el-table-column
:label="t('admin.table.researchIndustry')" :label="t('admin.table.researchIndustry')"
prop="industryStr" prop="industryStr"
/> />
<!-- <el-table-column label="申请(专利权)人" prop="applyName"/>--> <!-- <el-table-column label="申请(专利权)人" prop="applyName"/>-->
<el-table-column <el-table-column
align="center" align="center"
:label="t('admin.table.enterTime')" :label="t('admin.table.enterTime')"
prop="workTime" prop="workTime"
> >
<template #default="{ row }"> <template #default="{ row }">
<span>{{ dayjs(row.workTime).format("YYYY-MM-DD") }}</span> <span>{{ dayjs(row.workTime).format("YYYY-MM-DD") }}</span>
@ -130,51 +130,51 @@
<el-table-column align="center" :label="t('admin.common.operation')"> <el-table-column align="center" :label="t('admin.common.operation')">
<template #default="{ row }"> <template #default="{ row }">
<el-button <el-button
icon="plus" icon="plus"
size="small" size="small"
type="text" type="text"
@click="submitBind(row.id)" @click="submitBind(row.id)"
><!--关联-->{{ t("admin.table.relation") }} ><!--关联-->{{ t("admin.table.relation") }}
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination
v-show="notBindExpertTotal > 0" v-show="notBindExpertTotal > 0"
v-model:limit="notBindExpertQueryParams.pageSize" v-model:limit="notBindExpertQueryParams.pageSize"
v-model:page="notBindExpertQueryParams.pageNum" v-model:page="notBindExpertQueryParams.pageNum"
:total="notBindExpertTotal" :total="notBindExpertTotal"
@pagination="getNotBindExpertList" @pagination="getNotBindExpertList"
/> />
</el-dialog> </el-dialog>
<!-- 表格数据 --> <!-- 表格数据 -->
<el-table v-loading="loading" :data="dataList"> <el-table v-loading="loading" :data="dataList">
<el-table-column :label="t('admin.common.dataNumber')" prop="id" /> <el-table-column :label="t('admin.common.dataNumber')" prop="id"/>
<el-table-column <el-table-column
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
:label="t('admin.form.name', { type: t('admin.common.expert') })" :label="t('admin.form.name', { type: t('admin.common.expert') })"
prop="name" prop="name"
/> />
<el-table-column :label="t('webContact.phone')" prop="mobile" /> <el-table-column :label="t('webContact.phone')" prop="mobile"/>
<el-table-column <el-table-column
:label="t('admin.table.researchIndustry')" :label="t('admin.table.researchIndustry')"
prop="industryStr" prop="industryStr"
/> />
<!-- <el-table-column label="申请(专利权)人" prop="applyName"/>--> <!-- <el-table-column label="申请(专利权)人" prop="applyName"/>-->
<el-table-column <el-table-column
align="center" align="center"
:label="t('admin.table.enterTime')" :label="t('admin.table.enterTime')"
prop="workTime" prop="workTime"
> >
<template #default="{ row }"> <template #default="{ row }">
<span>{{ dayjs(row.workTime).format("YYYY-MM-DD") }}</span> <span>{{ dayjs(row.workTime).format("YYYY-MM-DD") }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
align="center" align="center"
class-name="small-padding fixed-width" class-name="small-padding fixed-width"
:label="t('admin.common.operation')" :label="t('admin.common.operation')"
> >
<template #default="{ row }"> <template #default="{ row }">
<!-- <el-button--> <!-- <el-button-->
@ -186,11 +186,11 @@
<!-- </el-button--> <!-- </el-button-->
<!-- >--> <!-- >-->
<el-button <el-button
icon="Delete" icon="Delete"
size="small" size="small"
type="text" type="text"
@click="handleDeleteBind(row.id)" @click="handleDeleteBind(row.id)"
><!--取消关联--> ><!--取消关联-->
{{ t("admin.table.cancelRelation") }} {{ t("admin.table.cancelRelation") }}
</el-button> </el-button>
</template> </template>
@ -204,27 +204,27 @@
</el-table> </el-table>
<pagination <pagination
v-show="total > 0" v-show="total > 0"
v-model:limit="queryParams.pageSize" v-model:limit="queryParams.pageSize"
v-model:page="queryParams.pageNum" v-model:page="queryParams.pageNum"
:total="total" :total="total"
@pagination="getList" @pagination="getList"
/> />
<!-- 添加或修改数据配置对话框 --> <!-- 添加或修改数据配置对话框 -->
<el-dialog v-model="open" :title="title" append-to-body width="800px"> <el-dialog v-model="open" :title="title" append-to-body width="800px">
<el-form ref="expertRef" :model="form" :rules="rules" label-width="100px"> <el-form ref="expertRef" :model="form" :rules="rules" label-width="100px">
<el-form-item :label="t('admin.form.expertName')" prop="title"> <el-form-item :label="t('admin.form.expertName')" prop="title">
<el-input <el-input
v-model="form.title" v-model="form.title"
:placeholder=" :placeholder="
t('admin.form.placeholder', { type: t('admin.form.expertName') }) t('admin.form.placeholder', { type: t('admin.form.expertName') })
" "
/> />
</el-form-item> </el-form-item>
<el-form-item :label="t('input.gender')" prop="gender"> <el-form-item :label="t('input.gender')" prop="gender">
<el-input <el-input
v-model="form.gender" v-model="form.gender"
:placeholder=" :placeholder="
t('admin.form.placeholder', { t('admin.form.placeholder', {
type: t('input.gender'), type: t('input.gender'),
}) })
@ -233,30 +233,30 @@
</el-form-item> </el-form-item>
<el-form-item :label="t('webContact.unit')" prop="unit"> <el-form-item :label="t('webContact.unit')" prop="unit">
<el-input <el-input
v-model="form.unit" v-model="form.unit"
:placeholder=" :placeholder="
t('admin.form.placeholder', { type: t('webContact.unit') }) t('admin.form.placeholder', { type: t('webContact.unit') })
" "
/> />
</el-form-item> </el-form-item>
<el-form-item <el-form-item
:label="t('admin.form.researchDirection')" :label="t('admin.form.researchDirection')"
prop="researchDirection" prop="researchDirection"
> >
<InputBoxAdd <InputBoxAdd
ref="researchDirectionFormRef" ref="researchDirectionFormRef"
v-model="form" v-model="form"
:labelWidth="100" :labelWidth="100"
fieldKey="researchs" fieldKey="researchs"
:placeholder="t('admin.form.researchDirection')" :placeholder="t('admin.form.researchDirection')"
:title="t('admin.form.researchDirection')" :title="t('admin.form.researchDirection')"
/> />
</el-form-item> </el-form-item>
</el-form> </el-form>
<template #footer> <template #footer>
<div class="dialog-footer"> <div class="dialog-footer">
<el-button type="primary" @click="submitForm" <el-button type="primary" @click="submitForm"
>{{ t("common.confirm") }} >{{ t("common.confirm") }}
</el-button> </el-button>
<el-button @click="cancel">{{ t("common.cancel") }}</el-button> <el-button @click="cancel">{{ t("common.cancel") }}</el-button>
</div> </div>
@ -266,9 +266,9 @@
</template> </template>
<script setup> <script setup>
import { ElMessage, ElMessageBox } from "element-plus"; import {ElMessage, ElMessageBox} from "element-plus";
import { useRouter } from "vue-router"; import {useRouter} from "vue-router";
import { reactive, ref, toRefs } from "vue"; import {reactive, ref, toRefs} from "vue";
import InputBoxAdd from "@/views/components/InputBoxAdd/index.vue"; import InputBoxAdd from "@/views/components/InputBoxAdd/index.vue";
import { import {
bindExpert, bindExpert,
@ -277,12 +277,12 @@ import {
selectNotBindLaboratory, selectNotBindLaboratory,
} from "@/api/admin/laboratory/expert"; } from "@/api/admin/laboratory/expert";
import Pagination from "@/components/Pagination/index.vue"; import Pagination from "@/components/Pagination/index.vue";
import { useI18n } from "vue-i18n"; import {useI18n} from "vue-i18n";
import dayjs from "dayjs"; import dayjs from "dayjs";
import modal from "@/plugins/modal"; import modal from "@/plugins/modal";
const router = useRouter(); const router = useRouter();
const { t } = useI18n(); const {t} = useI18n();
const dataList = ref([]); const dataList = ref([]);
const open = ref(false); const open = ref(false);
const loading = ref(true); const loading = ref(true);
@ -296,13 +296,13 @@ const data = reactive({
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
inventor: undefined, name: undefined,
}, },
form: {}, form: {},
rules: {}, rules: {},
}); });
const { queryParams, form, rules } = toRefs(data); const {queryParams, form, rules} = toRefs(data);
const queryRef = ref(); const queryRef = ref();
@ -310,14 +310,14 @@ const queryRef = ref();
const getList = async () => { const getList = async () => {
loading.value = true; loading.value = true;
expertList(queryParams.value) expertList(queryParams.value)
.then((resp) => { .then((resp) => {
dataList.value = resp.rows; dataList.value = resp.rows;
total.value = resp.total; total.value = resp.total;
loading.value = false; loading.value = false;
}) })
.catch(() => { .catch(() => {
loading.value = false; loading.value = false;
}); });
}; };
/** 搜索按钮操作 */ /** 搜索按钮操作 */
@ -329,33 +329,38 @@ const handleQuery = () => {
/** 重置按钮操作 */ /** 重置按钮操作 */
function resetQuery() { function resetQuery() {
queryRef.value.resetFields(); queryRef.value.resetFields();
queryParams.value = {
pageNum: 1,
pageSize: 10,
name: undefined,
}
handleQuery(); handleQuery();
} }
/** 删除按钮操作 */ /** 删除按钮操作 */
function handleDeleteBind(id) { function handleDeleteBind(id) {
modal modal
.confirm( .confirm(
t("admin.common.confirmAction", { t("admin.common.confirmAction", {
action: t("admin.table.cancelRelation"), action: t("admin.table.cancelRelation"),
type: t("admin.common.expert"), type: t("admin.common.expert"),
number: id, number: id,
})
)
.then(function () {
return deleteBindExpert(id);
}) })
) .then(() => {
.then(function () { getList();
return deleteBindExpert(id); ElMessage.success(
}) t("admin.common.success", {
.then(() => { action: t("admin.table.cancelRelation"),
getList(); })
ElMessage.success( );
t("admin.common.success", { })
action: t("admin.table.cancelRelation"), .catch((err) => {
}) console.log(err);
); });
})
.catch((err) => {
console.log(err);
});
} }
/** 重置新增的表单以及其他数据 */ /** 重置新增的表单以及其他数据 */
@ -387,7 +392,7 @@ const notBindExpertTotal = ref(0);
const notBindExpertQueryParams = reactive({ const notBindExpertQueryParams = reactive({
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
name: undefined, expertName: undefined,
}); });
const notBindExpertQueryRef = ref(); const notBindExpertQueryRef = ref();
@ -410,7 +415,7 @@ const handleAddBind = () => {
const resetNotBindExpertQuery = () => { const resetNotBindExpertQuery = () => {
notBindExpertQueryParams.pageNum = 1; notBindExpertQueryParams.pageNum = 1;
notBindExpertQueryParams.pageSize = 10; notBindExpertQueryParams.pageSize = 10;
notBindExpertQueryParams.name = undefined; notBindExpertQueryParams.expertName = undefined;
notBindExpertQueryRef.value.resetFields(); notBindExpertQueryRef.value.resetFields();
getNotBindExpertList(); getNotBindExpertList();
}; };
@ -421,29 +426,29 @@ const resetNotBindExpertQuery = () => {
*/ */
const submitBind = (id) => { const submitBind = (id) => {
modal modal
.confirm( .confirm(
/*"是否确认关联该专家?"*/ /*"是否确认关联该专家?"*/
t("admin.common.confirmAction", { t("admin.common.confirmAction", {
action: t("admin.table.relation"), action: t("admin.table.relation"),
type: t("admin.common.expert"), type: t("admin.common.expert"),
number: id, number: id,
})
)
.then(function () {
return bindExpert(id);
}) })
) .then(() => {
.then(function () { getNotBindExpertList();
return bindExpert(id); ElMessage.success(
}) /*"关联成功"*/
.then(() => { t("admin.common.success", {
getNotBindExpertList(); action: t("admin.table.relation"),
ElMessage.success( })
/*"关联成功"*/ );
t("admin.common.success", { })
action: t("admin.table.relation"), .catch((err) => {
}) console.log(err);
); });
})
.catch((err) => {
console.log(err);
});
}; };
const handleUpdate = () => { const handleUpdate = () => {

View File

@ -9,10 +9,10 @@
> >
<el-form-item <el-form-item
:label="t('admin.form.name', { type: t('admin.common.achievement') })" :label="t('admin.form.name', { type: t('admin.common.achievement') })"
prop="title" prop="name"
> >
<el-input <el-input
v-model="queryParams.title" v-model="queryParams.name"
clearable clearable
:placeholder=" :placeholder="
t('admin.form.placeholder', { type: t('admin.common.patent') }) t('admin.form.placeholder', { type: t('admin.common.patent') })
@ -52,7 +52,7 @@
<el-dialog <el-dialog
v-model="showExpertDialog" v-model="showExpertDialog"
:title="t('admin.table.relatedExperts')" :title="t('admin.table.relatedExperts')"
@close="resetQuery" @close="resetNotBindExpertQuery"
> >
<el-form <el-form
ref="notBindExpertQueryRef" ref="notBindExpertQueryRef"
@ -62,10 +62,10 @@
> >
<el-form-item <el-form-item
:label="t('admin.form.name', { type: t('admin.common.expert') })" :label="t('admin.form.name', { type: t('admin.common.expert') })"
prop="name" prop="expertName"
> >
<el-input <el-input
v-model="notBindExpertQueryParams.name" v-model="notBindExpertQueryParams.expertName"
clearable clearable
:placeholder=" :placeholder="
t('admin.form.placeholder', { t('admin.form.placeholder', {
@ -284,7 +284,7 @@ const notBindExpertTotal = ref(0);
const notBindExpertQueryParams = reactive({ const notBindExpertQueryParams = reactive({
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
name: undefined, expertName: undefined,
}); });
const data = reactive({ const data = reactive({
queryParams: { queryParams: {
@ -427,7 +427,7 @@ const handleAddBind = () => {
const resetNotBindExpertQuery = () => { const resetNotBindExpertQuery = () => {
notBindExpertQueryParams.pageNum = 1; notBindExpertQueryParams.pageNum = 1;
notBindExpertQueryParams.pageSize = 10; notBindExpertQueryParams.pageSize = 10;
notBindExpertQueryParams.name = undefined; notBindExpertQueryParams.expertName = undefined;
notBindExpertQueryRef.value.resetFields(); notBindExpertQueryRef.value.resetFields();
getNotBindExpertList(); getNotBindExpertList();
}; };

View File

@ -209,16 +209,16 @@
@submit.prevent @submit.prevent
> >
<el-form-item <el-form-item
:label="t('admin.form.name', { type: t('admin.common.expert') })" :label="t('admin.form.name', { type: t('admin.common.lab') })"
prop="name" prop="name"
> >
<el-input <el-input
v-model="notBindExpertQueryParams.name" v-model="notBindExpertQueryParams.laboratoryName"
clearable clearable
:placeholder=" :placeholder="
t('admin.form.placeholder', { t('admin.form.placeholder', {
type: t('admin.form.name', { type: t('admin.form.name', {
type: t('admin.common.expert'), type: t('admin.common.lab'),
}), }),
}) })
" "
@ -331,7 +331,7 @@ const notBindExpertTotal = ref(0);
const notBindExpertQueryParams = reactive({ const notBindExpertQueryParams = reactive({
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
name: undefined, laboratoryName: undefined,
}); });
const data = reactive({ const data = reactive({
@ -529,7 +529,7 @@ const handleAddBind = () => {
const resetNotBindExpertQuery = () => { const resetNotBindExpertQuery = () => {
notBindExpertQueryParams.pageNum = 1; notBindExpertQueryParams.pageNum = 1;
notBindExpertQueryParams.pageSize = 10; notBindExpertQueryParams.pageSize = 10;
notBindExpertQueryParams.name = undefined; notBindExpertQueryParams.laboratoryName = undefined;
notBindExpertQueryRef.value.resetFields(); notBindExpertQueryRef.value.resetFields();
getNotBindExpertList(); getNotBindExpertList();
}; };

View File

@ -51,7 +51,7 @@
</div> </div>
<div class="line"> <div class="line">
{{ t("webSearch.researchInstitute") }} {{ t("webSearch.researchInstitute") }}
<span>{{ data.organization }}</span> <span>{{ data.researchName }}</span>
</div> </div>
<!-- <div <!-- <div
v-if="data.patent_title" v-if="data.patent_title"