Compare commits
3 Commits
cd76e8cea9
...
1d93015507
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1d93015507 | ||
|
|
a510572631 | ||
|
|
282b173fad |
44
src/api/regional/dict/diagnosis.js
Normal file
44
src/api/regional/dict/diagnosis.js
Normal file
@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询诊断列表
|
||||
export function listdiagnosis(query) {
|
||||
return request({
|
||||
url: '/transitdict/diagnosis/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询诊断详细
|
||||
export function getdiagnosis(diagnosisId) {
|
||||
return request({
|
||||
url: '/transitdict/diagnosis/' + diagnosisId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增诊断
|
||||
export function adddiagnosis(data) {
|
||||
return request({
|
||||
url: '/transitdict/diagnosis',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改诊断
|
||||
export function updatediagnosis(data) {
|
||||
return request({
|
||||
url: '/transitdict/diagnosis',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除诊断
|
||||
export function deldiagnosis(diagnosisId) {
|
||||
return request({
|
||||
url: '/transitdict/diagnosis/' + diagnosisId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
@ -1,6 +1,6 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询岗位列表
|
||||
// 查询医疗机构列表
|
||||
export function listhospital(query) {
|
||||
return request({
|
||||
url: '/transitdict/hospital/list',
|
||||
@ -9,7 +9,7 @@ export function listhospital(query) {
|
||||
})
|
||||
}
|
||||
|
||||
// 查询岗位详细
|
||||
// 查询医疗机构详细
|
||||
export function gethospital(hospitalId) {
|
||||
return request({
|
||||
url: '/transitdict/hospital/' + hospitalId,
|
||||
@ -17,7 +17,7 @@ export function gethospital(hospitalId) {
|
||||
})
|
||||
}
|
||||
|
||||
// 新增岗位
|
||||
// 新增医疗机构
|
||||
export function addhospital(data) {
|
||||
return request({
|
||||
url: '/transitdict/hospital',
|
||||
@ -26,7 +26,7 @@ export function addhospital(data) {
|
||||
})
|
||||
}
|
||||
|
||||
// 修改岗位
|
||||
// 修改医疗机构
|
||||
export function updatehospital(data) {
|
||||
return request({
|
||||
url: '/transitdict/hospital',
|
||||
@ -35,7 +35,7 @@ export function updatehospital(data) {
|
||||
})
|
||||
}
|
||||
|
||||
// 删除岗位
|
||||
// 删除医疗机构
|
||||
export function delhospital(hospitalId) {
|
||||
return request({
|
||||
url: '/transitdict/hospital/' + hospitalId,
|
||||
|
||||
44
src/api/regional/dict/itemclass.js
Normal file
44
src/api/regional/dict/itemclass.js
Normal file
@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询诊断列表
|
||||
export function listitemclass(query) {
|
||||
return request({
|
||||
url: '/transitdict/itemclass/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询诊断详细
|
||||
export function getitemclass(itemclassId) {
|
||||
return request({
|
||||
url: '/transitdict/itemclass/' + itemclassId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增诊断
|
||||
export function additemclass(data) {
|
||||
return request({
|
||||
url: '/transitdict/itemclass',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改诊断
|
||||
export function updateitemclass(data) {
|
||||
return request({
|
||||
url: '/transitdict/itemclass',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除诊断
|
||||
export function delitemclass(itemclassId) {
|
||||
return request({
|
||||
url: '/transitdict/itemclass/' + itemclassId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
44
src/api/regional/dict/regdict.js
Normal file
44
src/api/regional/dict/regdict.js
Normal file
@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询字典列表
|
||||
export function listregdict(query) {
|
||||
return request({
|
||||
url: '/transitdict/regdict/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询字典详细
|
||||
export function getregdict(regdictId) {
|
||||
return request({
|
||||
url: '/transitdict/regdict/' + regdictId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增字典
|
||||
export function addregdict(data) {
|
||||
return request({
|
||||
url: '/transitdict/regdict',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改字典
|
||||
export function updateregdict(data) {
|
||||
return request({
|
||||
url: '/transitdict/regdict',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除字典
|
||||
export function delregdict(regdictId) {
|
||||
return request({
|
||||
url: '/transitdict/regdict/' + regdictId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
@ -1,11 +0,0 @@
|
||||
<script setup lang="ts">
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
</style>
|
||||
273
src/views/regional/dict/diagnosis/index.vue
Normal file
273
src/views/regional/dict/diagnosis/index.vue
Normal file
@ -0,0 +1,273 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch">
|
||||
<el-form-item label="诊断编码" prop="diagCode">
|
||||
<el-input
|
||||
v-model="queryParams.diagCode"
|
||||
placeholder="请输入诊断编码"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="诊断名称" prop="diagName">
|
||||
<el-input
|
||||
v-model="queryParams.diagName"
|
||||
placeholder="请输入诊断名称"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="诊断状态" clearable style="width: 200px">
|
||||
<el-option
|
||||
v-for="dict in sys_normal_disable"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
@click="handleAdd"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="Edit"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="Download"
|
||||
@click="handleExport"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="diagnosisList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="诊断编号" align="center" prop="diagId" />
|
||||
<el-table-column label="诊断编码" align="center" prop="diagCode" />
|
||||
<el-table-column label="诊断名称" align="center" prop="diagName" />
|
||||
<el-table-column label="诊断排序" align="center" prop="diagSort" />
|
||||
<el-table-column label="状态" align="center" 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="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="180" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" >修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" >删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改诊断对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
<el-form ref="diagnosisRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="诊断名称" prop="diagName">
|
||||
<el-input v-model="form.diagName" placeholder="请输入诊断名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="诊断编码" prop="diagCode">
|
||||
<el-input v-model="form.diagCode" placeholder="请输入编码名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="诊断顺序" prop="diagSort">
|
||||
<el-input-number v-model="form.diagSort" controls-position="right" :min="0" />
|
||||
</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"
|
||||
:label="dict.value"
|
||||
>{{ dict.label }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</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="diagnosis">
|
||||
import { listdiagnosis, adddiagnosis, deldiagnosis, getdiagnosis, updatediagnosis } from "@/api/regional/dict/diagnosis";
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { sys_normal_disable } = proxy.useDict("sys_normal_disable");
|
||||
|
||||
const diagnosisList = 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: {
|
||||
pageNum: 1,
|
||||
pageSize: 15,
|
||||
diagCode: undefined,
|
||||
diagName: undefined,
|
||||
status: undefined
|
||||
},
|
||||
rules: {
|
||||
diagName: [{ required: true, message: "诊断名称不能为空", trigger: "blur" }],
|
||||
diagCode: [{ required: true, message: "诊断编码不能为空", trigger: "blur" }],
|
||||
diagSort: [{ required: true, message: "诊断顺序不能为空", trigger: "blur" }],
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询诊断列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
listdiagnosis(queryParams.value).then(response => {
|
||||
diagnosisList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
/** 取消按钮 */
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
/** 表单重置 */
|
||||
function reset() {
|
||||
form.value = {
|
||||
diagId: undefined,
|
||||
diagCode: undefined,
|
||||
diagName: undefined,
|
||||
diagSort: 0,
|
||||
status: "0",
|
||||
remark: undefined
|
||||
};
|
||||
proxy.resetForm("diagnosisRef");
|
||||
}
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryRef");
|
||||
handleQuery();
|
||||
}
|
||||
/** 多选框选中数据 */
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map(item => item.diagId);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset();
|
||||
open.value = true;
|
||||
title.value = "添加诊断";
|
||||
}
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset();
|
||||
const diagId = row.diagId || ids.value;
|
||||
getdiagnosis(diagId).then(response => {
|
||||
form.value = response.data;
|
||||
open.value = true;
|
||||
title.value = "修改诊断";
|
||||
});
|
||||
}
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs["diagnosisRef"].validate(valid => {
|
||||
if (valid) {
|
||||
if (form.value.diagId != undefined) {
|
||||
updatediagnosis(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
adddiagnosis(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("新增成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const diagIds = row.diagId || ids.value;
|
||||
proxy.$modal.confirm('是否确认删除诊断编号为"' + diagIds + '"的数据项?').then(function() {
|
||||
return deldiagnosis(diagIds);
|
||||
}).then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
}
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download("system/diagnosis/export", {
|
||||
...queryParams.value
|
||||
}, `diag_${new Date().getTime()}.xlsx`);
|
||||
}
|
||||
|
||||
getList();
|
||||
</script>
|
||||
@ -140,7 +140,7 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Post">
|
||||
<script setup name="hospital">
|
||||
import { listhospital, addhospital, delhospital, gethospital, updatehospital } from "@/api/regional/dict/hospital.js";
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
321
src/views/regional/dict/itemclass/index.vue
Normal file
321
src/views/regional/dict/itemclass/index.vue
Normal file
@ -0,0 +1,321 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch">
|
||||
<el-form-item label="项目类别编码" prop="itemclassCode">
|
||||
<el-input
|
||||
v-model="queryParams.itemclassCode"
|
||||
placeholder="请输入项目类别编码"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="项目类别名称" prop="itemclassName">
|
||||
<el-input
|
||||
v-model="queryParams.itemclassName"
|
||||
placeholder="请输入项目类别名称"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="有效状态" clearable style="width: 200px">
|
||||
<el-option
|
||||
v-for="dict in sys_normal_disable"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
@click="handleAdd"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="Edit"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="Download"
|
||||
@click="handleExport"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="postList" @selection-change="handleSelectionChange" :cell-style="tableCellStyle">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="序号" align="center" prop="itemclassId" />
|
||||
<el-table-column label="项目类别编码" align="center" prop="itemclassCode" />
|
||||
<el-table-column label="项目类别名称" align="center" prop="itemclassName" show-overflow-tooltip/>
|
||||
<el-table-column label="试管名称" align="center" prop="itemclassTips" show-overflow-tooltip/>
|
||||
<el-table-column label="试管颜色" align="center" prop="itemclassBkcolor" show-overflow-tooltip/>
|
||||
<el-table-column label="默认样本类型" align="center" prop="itemclassYblx" show-overflow-tooltip/>
|
||||
<el-table-column label="打印次数" align="center" prop="itemclassPrintcnt" />
|
||||
<el-table-column label="抗凝样本" width="80" align="center" prop="itemclassKn">
|
||||
<template #default="scope">
|
||||
<el-checkbox
|
||||
:checked="scope.row.itemclassKn === 1 || scope.row.itemclassKn === '1'"
|
||||
disabled
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="排序" align="center" prop="itemclassSort" />
|
||||
<el-table-column label="状态" align="center" 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="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="180" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" >修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" >删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改项目类别对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
<el-form ref="postRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="项目类别名称" prop="itemclassName">
|
||||
<el-input v-model="form.itemclassName" placeholder="请输入类别名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="项目类别编码" prop="itemclassCode">
|
||||
<el-input v-model="form.itemclassCode" placeholder="请输入类别编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="试管名称" prop="itemclassTips">
|
||||
<el-input v-model="form.itemclassUserinfo" placeholder="请输入试管名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="试管颜色" prop="itemclassBkcolor">
|
||||
<el-input-number v-model="form.itemclassBkcolor" controls-position="right" :min="0" />
|
||||
</el-form-item>
|
||||
<el-form-item label="默认样本类型" prop="itemclassYblx">
|
||||
<el-input v-model="form.itemclassYblx" placeholder="请输入默认样本类型" />
|
||||
</el-form-item>
|
||||
<el-form-item label="打印次数" prop="itemclassPrintcnt">
|
||||
<el-input-number v-model="form.itemclassPrintcnt" controls-position="right" :min="0" />
|
||||
</el-form-item>
|
||||
<el-form-item label="抗凝样本" prop="itemclassKn">
|
||||
<el-checkbox v-model="form.itemclassKn" true-label="1" false-label="0" />
|
||||
</el-form-item>
|
||||
<el-form-item label="类别顺序" prop="itemclassSort">
|
||||
<el-input-number v-model="form.itemclassSort" controls-position="right" :min="0" />
|
||||
</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"
|
||||
:label="dict.value"
|
||||
>{{ dict.label }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</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="itemclass">
|
||||
import { listitemclass, additemclass, delitemclass, getitemclass, updateitemclass } from "@/api/regional/dict/itemclass.js";
|
||||
import { classCom } from '@/utils/classCom';
|
||||
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: {
|
||||
pageNum: 1,
|
||||
pageSize: 15,
|
||||
itemclassCode: undefined,
|
||||
itemclassName: undefined,
|
||||
status: undefined
|
||||
},
|
||||
rules: {
|
||||
itemclassName: [{ required: true, message: "项目类别名称不能为空", trigger: "blur" }],
|
||||
itemclassCode: [{ required: true, message: "项目类别编码不能为空", trigger: "blur" }],
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询项目类别列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
listitemclass(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 = {
|
||||
itemclassId: undefined,
|
||||
itemclassCode: undefined,
|
||||
itemclassName: undefined,
|
||||
itemclassUserinfo: undefined,
|
||||
itemclassTips: undefined,
|
||||
itemclassBkcolor:255,
|
||||
itemclassYblx:undefined,
|
||||
itemclassPrintcnt:1,
|
||||
itemclassKn:0,
|
||||
status: "0",
|
||||
remark: undefined
|
||||
};
|
||||
proxy.resetForm("postRef");
|
||||
}
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryRef");
|
||||
handleQuery();
|
||||
}
|
||||
/** 多选框选中数据 */
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map(item => item.itemclassId);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset();
|
||||
open.value = true;
|
||||
title.value = "添加项目类别";
|
||||
}
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset();
|
||||
const itemclassId = row.itemclassId || ids.value;
|
||||
getitemclass(itemclassId).then(response => {
|
||||
form.value = response.data;
|
||||
open.value = true;
|
||||
title.value = "修改项目类别";
|
||||
});
|
||||
}
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs["postRef"].validate(valid => {
|
||||
if (valid) {
|
||||
if (form.value.itemclassId != undefined) {
|
||||
updateitemclass(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
additemclass(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("新增成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const itemclassIds = row.itemclassId || ids.value;
|
||||
proxy.$modal.confirm('是否确认删除项目类别编号为"' + itemclassIds + '"的数据项?').then(function() {
|
||||
return delitemclass(itemclassIds);
|
||||
}).then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
}
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download("transitdict/itemclass/export", {
|
||||
...queryParams.value
|
||||
}, `itemclass_${new Date().getTime()}.xlsx`);
|
||||
}
|
||||
const tableCellStyle = ({ row, column }) => {
|
||||
// 只对“项目类别”列生效
|
||||
if (column.label === '试管颜色') {
|
||||
// 1. 转换颜色(十进制→十六进制)
|
||||
const bgColor = classCom.decimalToHexColor(row.itemclassBkcolor);
|
||||
// 2. 自动计算文字颜色(确保和背景色对比度足够)
|
||||
const textColor = classCom.getContrastTextColor(bgColor);
|
||||
|
||||
return {
|
||||
backgroundColor: bgColor, // 背景色(转换后的值)
|
||||
color: textColor, // 文字色(自动适配)
|
||||
textAlign: 'center', // 文字居中
|
||||
fontWeight: '500' // 文字加粗(提升可读性)
|
||||
};
|
||||
}
|
||||
return {}; // 其他列保持默认样式
|
||||
};
|
||||
|
||||
getList();
|
||||
</script>
|
||||
281
src/views/regional/dict/regdict/index.vue
Normal file
281
src/views/regional/dict/regdict/index.vue
Normal file
@ -0,0 +1,281 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch">
|
||||
<el-form-item label="字典编码" prop="dictCode">
|
||||
<el-input
|
||||
v-model="queryParams.dictCode"
|
||||
placeholder="请输入字典编码"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="字典名称" prop="dictName">
|
||||
<el-input
|
||||
v-model="queryParams.dictName"
|
||||
placeholder="请输入字典名称"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="字典状态" clearable style="width: 200px">
|
||||
<el-option
|
||||
v-for="dict in sys_normal_disable"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
@click="handleAdd"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="Edit"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="Download"
|
||||
@click="handleExport"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="regdictList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="字典编号" align="center" prop="dictId" />
|
||||
<el-table-column label="字典编码" align="center" prop="dictCode" />
|
||||
<el-table-column label="字典名称" align="center" prop="dictName" />
|
||||
<el-table-column label="字典排序" align="center" prop="dictSort" />
|
||||
<el-table-column label="状态" align="center" 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="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="180" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" >修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" >删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改字典对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
<el-form ref="regdictRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="字典名称" prop="dictName">
|
||||
<el-input v-model="form.dictName" placeholder="请输入字典名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="字典编码" prop="dictCode">
|
||||
<el-input v-model="form.dictCode" placeholder="请输入编码名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="字典顺序" prop="dictSort">
|
||||
<el-input-number v-model="form.dictSort" controls-position="right" :min="0" />
|
||||
</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"
|
||||
:label="dict.value"
|
||||
>{{ dict.label }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</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="regdict">
|
||||
import { listregdict, addregdict, delregdict, getregdict, updateregdict } from "@/api/regional/dict/regdict.js";
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { sys_normal_disable } = proxy.useDict("sys_normal_disable");
|
||||
const route = useRoute();
|
||||
const regdictList = 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 menuname = ref("字典");
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 15,
|
||||
dictCode: undefined,
|
||||
dictName: undefined,
|
||||
dictType:undefined,
|
||||
status: undefined
|
||||
},
|
||||
rules: {
|
||||
dictName: [{ required: true, message: "字典名称不能为空", trigger: "blur" }],
|
||||
dictCode: [{ required: true, message: "字典编码不能为空", trigger: "blur" }],
|
||||
dictSort: [{ required: true, message: "字典顺序不能为空", trigger: "blur" }],
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询字典列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
listregdict(queryParams.value).then(response => {
|
||||
regdictList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
/** 取消按钮 */
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
/** 表单重置 */
|
||||
function reset() {
|
||||
form.value = {
|
||||
dictId: undefined,
|
||||
dictCode: undefined,
|
||||
dictName: undefined,
|
||||
dictType:queryParams.value.dictType,
|
||||
dictSort: 0,
|
||||
status: "0",
|
||||
remark: undefined
|
||||
};
|
||||
proxy.resetForm("regdictRef");
|
||||
}
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryRef");
|
||||
handleQuery();
|
||||
}
|
||||
/** 多选框选中数据 */
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map(item => item.dictId);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset();
|
||||
open.value = true;
|
||||
title.value = "添加字典";
|
||||
}
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset();
|
||||
const dictId = row.dictId || ids.value;
|
||||
getregdict(dictId).then(response => {
|
||||
form.value = response.data;
|
||||
open.value = true;
|
||||
title.value = "修改字典";
|
||||
});
|
||||
}
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs["regdictRef"].validate(valid => {
|
||||
if (valid) {
|
||||
|
||||
if (form.value.dictId != undefined) {
|
||||
updateregdict(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
addregdict(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("新增成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const dictIds = row.dictId || ids.value;
|
||||
proxy.$modal.confirm('是否确认删除字典编号为"' + dictIds + '"的数据项?').then(function() {
|
||||
return delregdict(dictIds);
|
||||
}).then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
}
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download("system/regdict/export", {
|
||||
...queryParams.value
|
||||
}, `dict_${new Date().getTime()}.xlsx`);
|
||||
}
|
||||
getTypes(route.query && route.query.dictType,route.query && route.query.typeName);
|
||||
/** 查询字典类型详细 */
|
||||
function getTypes(dictType,typeName) {
|
||||
queryParams.value.dictType =dictType;
|
||||
menuname.value =typeName;
|
||||
getList();
|
||||
}
|
||||
</script>
|
||||
Loading…
x
Reference in New Issue
Block a user