对接科室管理
This commit is contained in:
parent
af6e5a2ef0
commit
b5c48e74a0
44
src/api/system/section.js
Normal file
44
src/api/system/section.js
Normal file
|
@ -0,0 +1,44 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询列表
|
||||
export function getSysSectionPage(query) {
|
||||
return request({
|
||||
url: '/admin/sysSection/getSysSectionPage',
|
||||
method: 'post',
|
||||
data: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询详细
|
||||
export function getSysSection(sectionId) {
|
||||
return request({
|
||||
url: '/admin/sysSection/getSysSection/' + sectionId,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增
|
||||
export function addSysSection(data) {
|
||||
return request({
|
||||
url: '/admin/sysSection/addSysSection',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改
|
||||
export function updateSysSection(data) {
|
||||
return request({
|
||||
url: '/admin/sysSection/updateSysSection',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除
|
||||
export function deleteSysSection(sectionId) {
|
||||
return request({
|
||||
url: '/admin/sysSection/deleteSysSection/' + sectionId,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
325
src/views/system/section/index.vue
Normal file
325
src/views/system/section/index.vue
Normal file
|
@ -0,0 +1,325 @@
|
|||
<template>
|
||||
<div class="app-page-container">
|
||||
<breadcrumb id="breadcrumb-container" class="breadcrumb-container" />
|
||||
<div class="app-container clearBoth">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch">
|
||||
<el-row class="myRow">
|
||||
<el-col :span="20">
|
||||
<el-form-item label="科室名称" prop="keyword">
|
||||
<el-input v-model="queryParams.keyword" placeholder="请输入科室名称" clearable style="width: 200px"
|
||||
@keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4" style="text-align: right;">
|
||||
<el-button type="primary" class="seachBtn" @click="handleQuery">查询</el-button>
|
||||
<el-button class="resetBtn" @click="resetQuery">重置</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<!-- <el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd"
|
||||
v-hasPermi="['system:section:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate"
|
||||
v-hasPermi="['system:section:edit']">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete"
|
||||
v-hasPermi="['system:section:remove']">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport"
|
||||
v-hasPermi="['system:section:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row> -->
|
||||
<div class="borderLine"></div>
|
||||
<el-table v-loading="loading" height="calc(100% - 162px)" :data="postList">
|
||||
<el-table-column label="编号" align="center" width="60" prop="sectionId" />
|
||||
<el-table-column label="科室名称" align="left" min-width="150" prop="sectionName" />
|
||||
<el-table-column label="状态" align="center" width="80" prop="status">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="sys_normal_disable" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="210">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="150" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['system:section:edit']">修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['system:section:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageIndex"
|
||||
v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
</div>
|
||||
<!-- 添加或修改科室对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="800px" append-to-body>
|
||||
<el-form ref="postRef" :model="form" :rules="rules" label-width="120px">
|
||||
<el-form-item label="科室名称" prop="sectionName">
|
||||
<el-input v-model="form.sectionName" placeholder="请输入科室名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio v-for="dict in sys_normal_disable" :key="dict.value" :value="dict.value">{{ dict.label
|
||||
}}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Post">
|
||||
import { getSysSectionPage, addSysSection, deleteSysSection, getSysSection, updateSysSection } from "@/api/system/section"
|
||||
import Breadcrumb from '@/components/Breadcrumb'
|
||||
|
||||
const { proxy } = getCurrentInstance()
|
||||
const { sys_normal_disable } = proxy.useDict("sys_normal_disable")
|
||||
|
||||
const postList = ref([])
|
||||
const open = ref(false)
|
||||
const loading = ref(true)
|
||||
const showSearch = ref(true)
|
||||
const ids = ref([])
|
||||
const single = ref(true)
|
||||
const multiple = ref(true)
|
||||
const total = ref(0)
|
||||
const title = ref("")
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
keyword: undefined,
|
||||
},
|
||||
rules: {
|
||||
sectionName: [{ required: true, message: "科室名称不能为空", trigger: "blur" }],
|
||||
}
|
||||
})
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data)
|
||||
|
||||
/** 查询岗位列表 */
|
||||
function getList() {
|
||||
loading.value = true
|
||||
getSysSectionPage(queryParams.value).then(response => {
|
||||
postList.value = response.rows
|
||||
total.value = response.total
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
/** 取消按钮 */
|
||||
function cancel() {
|
||||
open.value = false
|
||||
reset()
|
||||
}
|
||||
|
||||
/** 表单重置 */
|
||||
function reset() {
|
||||
form.value = {
|
||||
sectionId: undefined,
|
||||
sectionName: undefined,
|
||||
status: "0"
|
||||
}
|
||||
proxy.resetForm("postRef")
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageIndex = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryRef")
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset()
|
||||
open.value = true
|
||||
title.value = "添加科室"
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset()
|
||||
const sectionId = row.sectionId
|
||||
getSysSection(sectionId).then(response => {
|
||||
form.value = response.data
|
||||
open.value = true
|
||||
title.value = "修改科室"
|
||||
})
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs["postRef"].validate(valid => {
|
||||
if (valid) {
|
||||
if (form.value.sectionId != undefined) {
|
||||
updateSysSection(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("修改成功")
|
||||
open.value = false
|
||||
getList()
|
||||
})
|
||||
} else {
|
||||
addSysSection(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("新增成功")
|
||||
open.value = false
|
||||
getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const sectionId = row.sectionId
|
||||
proxy.$modal.confirm('是否确认删除编号为"' + postIds + '"的数据项?').then(function () {
|
||||
return deleteSysSection(sectionId)
|
||||
}).then(() => {
|
||||
getList()
|
||||
proxy.$modal.msgSuccess("删除成功")
|
||||
}).catch(() => { })
|
||||
}
|
||||
|
||||
getList()
|
||||
</script>
|
||||
<style lang='scss'>
|
||||
.app-page-container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow-y: auto;
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
|
||||
.clearBoth {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.myRow {
|
||||
margin-left: 0 !important;
|
||||
margin-right: 0 !important;
|
||||
}
|
||||
|
||||
.el-form--inline .el-form-item {
|
||||
display: inline-flex;
|
||||
margin-right: 26px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.el-form-item__label {
|
||||
font-family: Microsoft YaHei;
|
||||
font-weight: 400;
|
||||
font-size: 18px;
|
||||
color: #000000;
|
||||
min-width: 34px;
|
||||
}
|
||||
|
||||
.el-input__inner {
|
||||
font-family: Microsoft YaHei;
|
||||
font-weight: 400;
|
||||
font-size: 18px;
|
||||
text-align: left;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
.el-select__wrapper {
|
||||
font-weight: 400;
|
||||
font-size: 18px;
|
||||
text-align: left;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
.el-date-editor .el-range-input {
|
||||
font-family: Arial;
|
||||
font-weight: 400;
|
||||
font-size: 18px;
|
||||
text-align: right;
|
||||
color: #000000;
|
||||
width: 46%;
|
||||
}
|
||||
|
||||
.el-date-editor .el-range__icon svg {
|
||||
width: 18px;
|
||||
height: 16px;
|
||||
}
|
||||
|
||||
.el-date-editor .el-range__icon {
|
||||
font-size: 16px;
|
||||
// margin-left: 12px;
|
||||
margin-right: 12px;
|
||||
}
|
||||
|
||||
.el-range-editor.el-input__wrapper {
|
||||
padding: 0 0 0 7px;
|
||||
}
|
||||
|
||||
.el-select__wrapper {
|
||||
font-weight: 400;
|
||||
font-size: 18px;
|
||||
text-align: left;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
.foladText {
|
||||
font-family: Microsoft YaHei;
|
||||
font-weight: 400;
|
||||
font-size: 16px;
|
||||
text-align: left;
|
||||
color: #0090FF 100%;
|
||||
padding: 10px 0 !important;
|
||||
}
|
||||
|
||||
.el-radio__label {
|
||||
font-weight: 400;
|
||||
font-size: 18px;
|
||||
text-align: left;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
.el-checkbox__label {
|
||||
font-weight: 400;
|
||||
font-size: 18px;
|
||||
text-align: left;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
.el-textarea__inner {
|
||||
font-weight: 400;
|
||||
font-size: 18px;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
.el-text.is-truncated {
|
||||
display: inline-block;
|
||||
max-width: 100%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
font-size: 18px;
|
||||
color: #000000;
|
||||
}
|
||||
</style>
|
Loading…
Reference in New Issue
Block a user