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

View File

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

View File

@ -209,16 +209,16 @@
@submit.prevent
>
<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"
>
<el-input
v-model="notBindExpertQueryParams.name"
v-model="notBindExpertQueryParams.laboratoryName"
clearable
:placeholder="
t('admin.form.placeholder', {
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({
pageNum: 1,
pageSize: 10,
name: undefined,
laboratoryName: undefined,
});
const data = reactive({
@ -529,7 +529,7 @@ const handleAddBind = () => {
const resetNotBindExpertQuery = () => {
notBindExpertQueryParams.pageNum = 1;
notBindExpertQueryParams.pageSize = 10;
notBindExpertQueryParams.name = undefined;
notBindExpertQueryParams.laboratoryName = undefined;
notBindExpertQueryRef.value.resetFields();
getNotBindExpertList();
};

View File

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