bugfix
This commit is contained in:
@ -3,26 +3,21 @@ import request from "@/utils/request";
|
|||||||
// 实验室专家列表
|
// 实验室专家列表
|
||||||
export const expertList = (params) => {
|
export const expertList = (params) => {
|
||||||
return request({
|
return request({
|
||||||
url: `/app/laboratory/expertList`,
|
url: `/app/laboratory/expertList`, method: "GET", params,
|
||||||
method: "GET",
|
|
||||||
params,
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// 实验室取消专家绑定
|
// 实验室取消专家绑定
|
||||||
export const deleteBindExpert = (expertId) => {
|
export const deleteBindExpert = (expertId) => {
|
||||||
return request({
|
return request({
|
||||||
url: `/app/laboratory/deleteBindExpert/${expertId}`,
|
url: `/app/laboratory/deleteBindExpert/${expertId}`, method: "PUT",
|
||||||
method: "PUT",
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// 实验室新增专利
|
// 实验室新增专利
|
||||||
export const insertLabPatent = (data) => {
|
export const insertLabPatent = (data) => {
|
||||||
return request({
|
return request({
|
||||||
url: `/app/laboratory/patent`,
|
url: `/app/laboratory/patent`, method: "POST", data,
|
||||||
method: "POST",
|
|
||||||
data,
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -33,15 +28,36 @@ export const insertLabPatent = (data) => {
|
|||||||
*/
|
*/
|
||||||
export const updateLabPatent = (data) => {
|
export const updateLabPatent = (data) => {
|
||||||
return request({
|
return request({
|
||||||
url: `/app/laboratory/patent`,
|
url: `/app/laboratory/patent`, method: "PUT", data,
|
||||||
method: "PUT",
|
|
||||||
data,
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
export const deleteLabPatentByIds = (ids) => {
|
export const deleteLabPatentByIds = (ids) => {
|
||||||
return request({
|
return request({
|
||||||
url: `/app/laboratory/deletePatents/${ids}`,
|
url: `/app/laboratory/deletePatents/${ids}`, method: "DELETE",
|
||||||
method: "DELETE",
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 实验室专利列表
|
||||||
|
* @param params
|
||||||
|
* @return {*}
|
||||||
|
*/
|
||||||
|
export const selectNotBindLaboratory = (params) => {
|
||||||
|
return request({
|
||||||
|
url: `/app/laboratory/selectNotBindLaboratory`, method: "GET", params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 实验室专家绑定
|
||||||
|
* @param expertId
|
||||||
|
* @return {*}
|
||||||
|
*/
|
||||||
|
export const bindExpert = (expertId) => {
|
||||||
|
return request({
|
||||||
|
url: `/app/laboratory/bindExpert/${expertId}`, method: "GET",
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
@ -31,25 +31,89 @@
|
|||||||
</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 icon="plus" size="small" type="primary">新增</el-button>-->
|
<el-button icon="plus" size="small" type="primary" @click="handleAddBind">关联专家</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-table v-loading="loading" :data="dataList">
|
<el-dialog v-model="showExpertDialog" title="关联专家">
|
||||||
<el-table-column label="数据编号" prop="id" />
|
<el-form
|
||||||
|
ref="notBindExpertQueryRef"
|
||||||
|
:inline="true"
|
||||||
|
:model="notBindExpertQueryParams"
|
||||||
|
@submit.prevent
|
||||||
|
>
|
||||||
|
<el-form-item label="专家名称" prop="name">
|
||||||
|
<el-input
|
||||||
|
v-model="notBindExpertQueryParams.name"
|
||||||
|
clearable
|
||||||
|
placeholder="请输入专家名称"
|
||||||
|
size="small"
|
||||||
|
style="width: 240px"
|
||||||
|
@keyup.enter="getNotBindExpertList"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button
|
||||||
|
icon="Search"
|
||||||
|
size="small"
|
||||||
|
type="primary"
|
||||||
|
@click="getNotBindExpertList"
|
||||||
|
>搜索
|
||||||
|
</el-button>
|
||||||
|
<el-button icon="Refresh" size="small" @click="resetNotBindExpertQuery"
|
||||||
|
>重置
|
||||||
|
</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<el-table :data="notBindExpertList">
|
||||||
|
<el-table-column label="数据编号" prop="id"/>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
:show-overflow-tooltip="true"
|
:show-overflow-tooltip="true"
|
||||||
label="专家名称"
|
label="专家名称"
|
||||||
prop="title"
|
prop="name"
|
||||||
/>
|
/>
|
||||||
<el-table-column label="联系电话" prop="mobile" />
|
<el-table-column label="联系电话" prop="mobile"/>
|
||||||
<el-table-column label="研究领域" prop="industryStr" />
|
<el-table-column label="研究领域" prop="industryStr"/>
|
||||||
|
<!-- <el-table-column label="申请(专利权)人" prop="applyName"/>-->
|
||||||
|
<el-table-column align="center" label="入驻时间" prop="workTime">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<span>{{ dayjs(row.workTime).format("YYYY-MM-DD") }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<!-- 操作-->
|
||||||
|
<el-table-column align="center" label="操作">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<el-button
|
||||||
|
icon="plus"
|
||||||
|
size="small"
|
||||||
|
type="text"
|
||||||
|
@click="submitBind(row.id)"
|
||||||
|
>关联
|
||||||
|
</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"/>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
<!-- 表格数据 -->
|
||||||
|
<el-table v-loading="loading" :data="dataList">
|
||||||
|
<el-table-column label="数据编号" prop="id"/>
|
||||||
|
<el-table-column
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
label="专家名称"
|
||||||
|
prop="name"
|
||||||
|
/>
|
||||||
|
<el-table-column label="联系电话" prop="mobile"/>
|
||||||
|
<el-table-column label="研究领域" prop="industryStr"/>
|
||||||
<!-- <el-table-column label="申请(专利权)人" prop="applyName"/>-->
|
<!-- <el-table-column label="申请(专利权)人" prop="applyName"/>-->
|
||||||
<el-table-column align="center" label="入驻时间" prop="workTime">
|
<el-table-column align="center" label="入驻时间" prop="workTime">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
@ -79,6 +143,12 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<template #footer>
|
||||||
|
<div class="dialog-footer">
|
||||||
|
<!-- <el-button type="primary" @click="submitForm">确 定</el-button>-->
|
||||||
|
<el-button>取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<pagination
|
<pagination
|
||||||
@ -92,13 +162,13 @@
|
|||||||
<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="专家姓名" prop="title">
|
<el-form-item label="专家姓名" prop="title">
|
||||||
<el-input v-model="form.title" placeholder="请输入专家姓名" />
|
<el-input v-model="form.title" placeholder="请输入专家姓名"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="性别" prop="gender">
|
<el-form-item label="性别" prop="gender">
|
||||||
<el-input v-model="form.gender" placeholder="请输入性别" />
|
<el-input v-model="form.gender" placeholder="请输入性别"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="单位" prop="unit">
|
<el-form-item label="单位" prop="unit">
|
||||||
<el-input v-model="form.unit" placeholder="单位" />
|
<el-input v-model="form.unit" placeholder="单位"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="研究方向" prop="researchDirection">
|
<el-form-item label="研究方向" prop="researchDirection">
|
||||||
<InputBoxAdd
|
<InputBoxAdd
|
||||||
@ -122,13 +192,13 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { labPatentList } from "@/api/admin/laboratory/patent";
|
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
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 { deleteBindExpert, expertList } from "@/api/admin/laboratory/expert";
|
import {bindExpert, deleteBindExpert, expertList, selectNotBindLaboratory} from "@/api/admin/laboratory/expert";
|
||||||
|
import Pagination from "@/components/Pagination/index.vue";
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
@ -140,6 +210,8 @@ const total = ref(0);
|
|||||||
const title = ref("");
|
const title = ref("");
|
||||||
const expertRef = ref();
|
const expertRef = ref();
|
||||||
const researchDirectionFormRef = ref();
|
const researchDirectionFormRef = ref();
|
||||||
|
|
||||||
|
|
||||||
const data = reactive({
|
const data = reactive({
|
||||||
queryParams: {
|
queryParams: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
@ -150,7 +222,7 @@ const data = reactive({
|
|||||||
rules: {},
|
rules: {},
|
||||||
});
|
});
|
||||||
|
|
||||||
const { queryParams, form, rules } = toRefs(data);
|
const {queryParams, form, rules} = toRefs(data);
|
||||||
|
|
||||||
const queryRef = ref();
|
const queryRef = ref();
|
||||||
|
|
||||||
@ -215,11 +287,63 @@ function cancel() {
|
|||||||
reset();
|
reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleAdd = () => {
|
|
||||||
reset();
|
// 是否显示关联专家dialog
|
||||||
title.value = "添加专家";
|
const showExpertDialog = ref(false);
|
||||||
open.value = true;
|
// 未绑定专家列表
|
||||||
|
const notBindExpertList = ref([]);
|
||||||
|
// 未绑定专家总数
|
||||||
|
const notBindExpertTotal = ref(0);
|
||||||
|
const notBindExpertQueryParams = reactive({
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
name: undefined,
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
const notBindExpertQueryRef = ref();
|
||||||
|
const getNotBindExpertList = () => {
|
||||||
|
selectNotBindLaboratory(notBindExpertQueryParams).then((resp) => {
|
||||||
|
notBindExpertList.value = resp.rows;
|
||||||
|
notBindExpertTotal.value = resp.total;
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleAddBind = () => {
|
||||||
|
getNotBindExpertList()
|
||||||
|
showExpertDialog.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重置未绑定专家查询条件
|
||||||
|
*/
|
||||||
|
const resetNotBindExpertQuery = () => {
|
||||||
|
notBindExpertQueryParams.pageNum = 1;
|
||||||
|
notBindExpertQueryParams.pageSize = 10;
|
||||||
|
notBindExpertQueryParams.name = undefined;
|
||||||
|
notBindExpertQueryRef.value.resetFields();
|
||||||
|
getNotBindExpertList();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联专家
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
|
const submitBind = (id) => {
|
||||||
|
ElMessageBox.confirm("是否确认关联该专家?")
|
||||||
|
.then(function () {
|
||||||
|
return bindExpert(id);
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
getNotBindExpertList();
|
||||||
|
ElMessage.success("关联成功");
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.log(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
const handleUpdate = () => {
|
const handleUpdate = () => {
|
||||||
reset();
|
reset();
|
||||||
title.value = "编辑专家";
|
title.value = "编辑专家";
|
||||||
@ -249,5 +373,6 @@ function submitForm() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
getList();
|
getList();
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user