bugfix
This commit is contained in:
@ -2,28 +2,23 @@ import request from "@/utils/request";
|
||||
|
||||
// 实验室专家列表
|
||||
export const expertList = (params) => {
|
||||
return request({
|
||||
url: `/app/laboratory/expertList`,
|
||||
method: "GET",
|
||||
params,
|
||||
});
|
||||
return request({
|
||||
url: `/app/laboratory/expertList`, method: "GET", params,
|
||||
});
|
||||
};
|
||||
|
||||
// 实验室取消专家绑定
|
||||
export const deleteBindExpert = (expertId) => {
|
||||
return request({
|
||||
url: `/app/laboratory/deleteBindExpert/${expertId}`,
|
||||
method: "PUT",
|
||||
});
|
||||
return request({
|
||||
url: `/app/laboratory/deleteBindExpert/${expertId}`, method: "PUT",
|
||||
});
|
||||
};
|
||||
|
||||
// 实验室新增专利
|
||||
export const insertLabPatent = (data) => {
|
||||
return request({
|
||||
url: `/app/laboratory/patent`,
|
||||
method: "POST",
|
||||
data,
|
||||
});
|
||||
return request({
|
||||
url: `/app/laboratory/patent`, method: "POST", data,
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
@ -32,16 +27,37 @@ export const insertLabPatent = (data) => {
|
||||
* @return {*}
|
||||
*/
|
||||
export const updateLabPatent = (data) => {
|
||||
return request({
|
||||
url: `/app/laboratory/patent`,
|
||||
method: "PUT",
|
||||
data,
|
||||
});
|
||||
return request({
|
||||
url: `/app/laboratory/patent`, method: "PUT", data,
|
||||
});
|
||||
};
|
||||
|
||||
export const deleteLabPatentByIds = (ids) => {
|
||||
return request({
|
||||
url: `/app/laboratory/deletePatents/${ids}`,
|
||||
method: "DELETE",
|
||||
});
|
||||
return request({
|
||||
url: `/app/laboratory/deletePatents/${ids}`, 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",
|
||||
|
||||
});
|
||||
}
|
@ -1,55 +1,119 @@
|
||||
<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="成果名称" prop="title">
|
||||
<el-input
|
||||
v-model="queryParams.title"
|
||||
clearable
|
||||
placeholder="请输入专利名称"
|
||||
size="small"
|
||||
style="width: 240px"
|
||||
@keyup.enter="handleQuery"
|
||||
v-model="queryParams.title"
|
||||
clearable
|
||||
placeholder="请输入专利名称"
|
||||
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"
|
||||
>搜索
|
||||
</el-button>
|
||||
<el-button 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 icon="plus" size="small" type="primary">新增</el-button>-->
|
||||
<!-- </el-col>-->
|
||||
<el-col :span="1.5">
|
||||
<el-button icon="plus" size="small" type="primary" @click="handleAddBind">关联专家</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="关联专家">
|
||||
<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
|
||||
: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 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 label="数据编号" prop="id"/>
|
||||
<el-table-column
|
||||
:show-overflow-tooltip="true"
|
||||
label="专家名称"
|
||||
prop="title"
|
||||
:show-overflow-tooltip="true"
|
||||
label="专家名称"
|
||||
prop="name"
|
||||
/>
|
||||
<el-table-column label="联系电话" prop="mobile" />
|
||||
<el-table-column label="研究领域" prop="industryStr" />
|
||||
<el-table-column label="联系电话" prop="mobile"/>
|
||||
<el-table-column label="研究领域" prop="industryStr"/>
|
||||
<!-- <el-table-column label="申请(专利权)人" prop="applyName"/>-->
|
||||
<el-table-column align="center" label="入驻时间" prop="workTime">
|
||||
<template #default="{ row }">
|
||||
@ -57,9 +121,9 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
class-name="small-padding fixed-width"
|
||||
label="操作"
|
||||
align="center"
|
||||
class-name="small-padding fixed-width"
|
||||
label="操作"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<!-- <el-button-->
|
||||
@ -71,43 +135,49 @@
|
||||
<!-- </el-button-->
|
||||
<!-- >-->
|
||||
<el-button
|
||||
icon="Delete"
|
||||
size="small"
|
||||
type="text"
|
||||
@click="handleDeleteBind(row.id)"
|
||||
>取消关联
|
||||
icon="Delete"
|
||||
size="small"
|
||||
type="text"
|
||||
@click="handleDeleteBind(row.id)"
|
||||
>取消关联
|
||||
</el-button>
|
||||
</template>
|
||||
</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>
|
||||
|
||||
<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="专家姓名" prop="title">
|
||||
<el-input v-model="form.title" placeholder="请输入专家姓名" />
|
||||
<el-input v-model="form.title" placeholder="请输入专家姓名"/>
|
||||
</el-form-item>
|
||||
<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 label="单位" prop="unit">
|
||||
<el-input v-model="form.unit" placeholder="单位" />
|
||||
<el-input v-model="form.unit" placeholder="单位"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="研究方向" prop="researchDirection">
|
||||
<InputBoxAdd
|
||||
ref="researchDirectionFormRef"
|
||||
v-model="form"
|
||||
:labelWidth="100"
|
||||
fieldKey="researchs"
|
||||
placeholder="研究方向"
|
||||
title="研究方向"
|
||||
ref="researchDirectionFormRef"
|
||||
v-model="form"
|
||||
:labelWidth="100"
|
||||
fieldKey="researchs"
|
||||
placeholder="研究方向"
|
||||
title="研究方向"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@ -122,13 +192,13 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { labPatentList } from "@/api/admin/laboratory/patent";
|
||||
import dayjs from "dayjs";
|
||||
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 { 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();
|
||||
|
||||
@ -140,6 +210,8 @@ const total = ref(0);
|
||||
const title = ref("");
|
||||
const expertRef = ref();
|
||||
const researchDirectionFormRef = ref();
|
||||
|
||||
|
||||
const data = reactive({
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
@ -150,7 +222,7 @@ const data = reactive({
|
||||
rules: {},
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
const {queryParams, form, rules} = toRefs(data);
|
||||
|
||||
const queryRef = ref();
|
||||
|
||||
@ -158,14 +230,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;
|
||||
});
|
||||
};
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
@ -183,16 +255,16 @@ function resetQuery() {
|
||||
/** 删除按钮操作 */
|
||||
function handleDeleteBind(id) {
|
||||
ElMessageBox.confirm(`是否确认取消关联数据编号为"${id}"的专家?`)
|
||||
.then(function () {
|
||||
return deleteBindExpert(id);
|
||||
})
|
||||
.then(() => {
|
||||
getList();
|
||||
ElMessage.success("取消关联成功");
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
.then(function () {
|
||||
return deleteBindExpert(id);
|
||||
})
|
||||
.then(() => {
|
||||
getList();
|
||||
ElMessage.success("取消关联成功");
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
}
|
||||
|
||||
/** 重置新增的表单以及其他数据 */
|
||||
@ -215,11 +287,63 @@ function cancel() {
|
||||
reset();
|
||||
}
|
||||
|
||||
const handleAdd = () => {
|
||||
reset();
|
||||
title.value = "添加专家";
|
||||
open.value = true;
|
||||
|
||||
// 是否显示关联专家dialog
|
||||
const showExpertDialog = ref(false);
|
||||
// 未绑定专家列表
|
||||
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 = () => {
|
||||
reset();
|
||||
title.value = "编辑专家";
|
||||
@ -249,5 +373,6 @@ function submitForm() {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
getList();
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user