药品目录前台 up by dh

This commit is contained in:
duhe
2025-02-26 19:52:06 +08:00
parent def047e59b
commit 06a743d182
3 changed files with 173 additions and 141 deletions

View File

@@ -1,43 +1,42 @@
import request from '@/utils/request' import request from '@/utils/request'
import { parseStrEmpty } from "@/utils/openhis"; import { parseStrEmpty } from "@/utils/openhis";
// 查询病种目录列表 // 查询药品目录列表
export function getDiseaseList(query) { export function getMedicationList(query) {
return request({ return request({
url: '/datadictionary/disease/information-page', url: '/datadictionary/medication/information-page',
method: 'get', method: 'get',
params: query params: query
}) })
} }
// 查询病种目录详细 // 查询药品目录详细
export function getDiseaseOne(id) { export function getMedicationOne(id) {
return request({ return request({
url: '/datadictionary/disease/information-one', url: '/datadictionary/medication/information-one/' + parseStrEmpty(id),
method: 'get', method: 'get'
params: id
}) })
} }
// 新增病种目录 // 新增药品目录
export function addDisease(data) { export function addMedication(data) {
return request({ return request({
url: '/datadictionary/disease/information', url: '/datadictionary/medication/information',
method: 'post', method: 'post',
data: data data: data
}) })
} }
// 修改病种目录 // 修改药品目录
export function editDisease(data) { export function editMedication(data) {
return request({ return request({
url: '/datadictionary/disease/information', url: '/datadictionary/medication/information',
method: 'put', method: 'put',
data: data data: data
}) })
} }
// 删除病种目录 // 删除药品目录
export function delUser(userId) { export function delUser(userId) {
return request({ return request({
url: '/system/user/' + userId, url: '/system/user/' + userId,
@@ -45,10 +44,10 @@ export function delUser(userId) {
}) })
} }
// 病种目录分类查询 // 药品目录分类查询
export function getDiseaseCategory() { export function getMedicationCategory() {
return request({ return request({
url: '/datadictionary/disease/information-category', url: '/datadictionary/medication/information-init',
method: 'get' method: 'get'
}) })
} }

View File

@@ -7,15 +7,15 @@
<el-form <el-form
:model="form" :model="form"
:rules="rules" :rules="rules"
ref="diseaseRef" ref="medicationRef"
label-width="110px" label-width="110px"
label-position="left" label-position="left"
> >
<el-row :gutter="24"> <el-row :gutter="24">
<el-col :span="8"> <el-col :span="8">
<el-form-item label="编号" prop="conditionCode"> <el-form-item label="编号" prop="busNo">
<el-input <el-input
v-model="form.conditionCode" v-model="form.busNo"
placeholder="请输入编码" placeholder="请输入编码"
maxlength="30" maxlength="30"
:disabled="form.id != undefined" :disabled="form.id != undefined"
@@ -32,16 +32,20 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="拼音码(品名)" prop="name"> <el-form-item label="拼音码(品名)" prop="pyStr">
<el-input v-model="form.name" placeholder="" maxlength="30" /> <el-input
v-model="form.pyStr"
placeholder=""
maxlength="30"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="24"> <el-row :gutter="24">
<el-col :span="8"> <el-col :span="8">
<el-form-item label="规格" prop="conditionCode"> <el-form-item label="规格" prop="totalVolume">
<el-input <el-input
v-model="form.conditionCode" v-model="form.totalVolume"
placeholder="" placeholder=""
maxlength="30" maxlength="30"
/> />
@@ -53,25 +57,29 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="商品名" prop="name"> <el-form-item label="商品名" prop="merchandiseName">
<el-input v-model="form.name" placeholder="" maxlength="30" /> <el-input
v-model="form.merchandiseName"
placeholder=""
maxlength="30"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="24"> <el-row :gutter="24">
<el-col :span="8"> <el-col :span="8">
<el-form-item label="厂家/产地" prop="conditionCode"> <el-form-item label="厂家/产地" prop="manufacturerId">
<el-input <el-input
v-model="form.conditionCode" v-model="form.manufacturerId"
placeholder="" placeholder=""
maxlength="30" maxlength="30"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="包装单位" prop="name"> <el-form-item label="包装单位" prop="unitCode">
<el-input <el-input
v-model="form.name" v-model="form.unitCode"
placeholder="" placeholder=""
maxlength="30" maxlength="30"
:disabled="form.id != undefined" :disabled="form.id != undefined"
@@ -79,9 +87,9 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="最小单位" prop="name"> <el-form-item label="最小单位" prop="minUnitCode">
<el-input <el-input
v-model="form.name" v-model="form.minUnitCode"
placeholder="" placeholder=""
maxlength="30" maxlength="30"
:disabled="form.id != undefined" :disabled="form.id != undefined"
@@ -91,9 +99,9 @@
</el-row> </el-row>
<el-row :gutter="24"> <el-row :gutter="24">
<el-col :span="8"> <el-col :span="8">
<el-form-item label="拆零比" prop="conditionCode"> <el-form-item label="拆零比" prop="partPercent">
<el-input <el-input
v-model="form.conditionCode" v-model="form.partPercent"
placeholder="" placeholder=""
maxlength="30" maxlength="30"
:disabled="form.id != undefined" :disabled="form.id != undefined"
@@ -123,9 +131,9 @@
</el-row> </el-row>
<el-row :gutter="24"> <el-row :gutter="24">
<el-col :span="8"> <el-col :span="8">
<el-form-item label="批准文号" prop="conditionCode"> <el-form-item label="批准文号" prop="approvalNumber">
<el-input <el-input
v-model="form.conditionCode" v-model="form.approvalNumber"
placeholder="" placeholder=""
maxlength="30" maxlength="30"
/> />
@@ -149,13 +157,13 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="皮试判别" prop="name"> <el-form-item label="皮试判别" prop="skinTestFlag">
<el-checkbox v-model="form.status"></el-checkbox> <el-checkbox v-model="form.skinTestFlag"></el-checkbox>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="注射药品" prop="name"> <el-form-item label="注射药品" prop="injectFlag">
<el-checkbox v-model="form.status"></el-checkbox> <el-checkbox v-model="form.injectFlag"></el-checkbox>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@@ -194,9 +202,9 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="用药频次" prop="name"> <el-form-item label="用药频次" prop="rateCode">
<el-select <el-select
v-model="queryParams.status" v-model="queryParams.rateCode"
clearable clearable
:disabled="form.id != undefined" :disabled="form.id != undefined"
> >
@@ -210,15 +218,15 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="单次剂量" prop="name" inline> <el-form-item label="单次剂量" prop="dose" inline>
<el-input <el-input
v-model="form.name" v-model="form.dose"
placeholder="" placeholder=""
maxlength="30" maxlength="30"
style="width: 49%" style="width: 49%"
/> />
<el-select <el-select
v-model="queryParams.status" v-model="queryParams.doseUnitCode"
clearable clearable
style="width: 49%" style="width: 49%"
:disabled="form.id != undefined" :disabled="form.id != undefined"
@@ -235,9 +243,9 @@
</el-row> </el-row>
<el-row :gutter="24"> <el-row :gutter="24">
<el-col :span="8"> <el-col :span="8">
<el-form-item label="剂型" prop="conditionCode"> <el-form-item label="剂型" prop="doseFormCode">
<el-select <el-select
v-model="queryParams.status" v-model="queryParams.doseFormCode"
clearable clearable
:disabled="form.id != undefined" :disabled="form.id != undefined"
> >
@@ -398,9 +406,9 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="限制使用范围" prop="name"> <el-form-item label="限制使用范围" prop="restrictedScope">
<el-input <el-input
v-model="form.name" v-model="form.restrictedScope"
placeholder="" placeholder=""
maxlength="30" maxlength="30"
:disabled="form.id != undefined" :disabled="form.id != undefined"
@@ -408,9 +416,9 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label=" 限制使用标记" prop="name"> <el-form-item label="限制使用标记" prop="restrictedFlag">
<el-input <el-input
v-model="form.name" v-model="form.restrictedFlag"
placeholder="" placeholder=""
maxlength="30" maxlength="30"
:disabled="form.id != undefined" :disabled="form.id != undefined"
@@ -527,23 +535,9 @@ const { sys_normal_disable, sys_user_sex } = proxy.useDict(
"sys_user_sex" "sys_user_sex"
); );
const diseaseList = ref([]);
const open = ref(false);
const loading = ref(true);
const showSearch = ref(true);
const ids = ref([]);
const selectedData = ref([]); // 存储选择的行数据
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const title = ref(""); const title = ref("");
const dateRange = ref([]);
const deptName = ref("");
const visible = ref(false); const visible = ref(false);
const conditionDefinitionOptions = ref(undefined); const emits = defineEmits(['submit']); // 声明自定义事件
// const initPassword = ref(undefined);
// const postOptions = ref([]);
// const roleOptions = ref([]);
const data = reactive({ const data = reactive({
form: {}, form: {},
@@ -554,10 +548,11 @@ const data = reactive({
status: undefined, // 状态(包括 1预置2启用3停用 status: undefined, // 状态(包括 1预置2启用3停用
}, },
rules: { rules: {
name: [{ required: true, message: "名称不能为空", trigger: "blur" }], // busNo: [{ required: true, message: "编码不能为空", trigger: "blur" }],
conditionCode: [ // name: [{ required: true, message: "名称不能为空", trigger: "blur" }],
{ required: true, message: "编码不能为空", trigger: "blur" }, // conditionCode: [
], // { required: true, message: "编码不能为空", trigger: "blur" },
// ],
}, },
}); });
@@ -586,6 +581,40 @@ function edit() {
form.value = props.item; form.value = props.item;
visible.value = true; visible.value = true;
} }
/** 重置操作表单 */
function reset() {
form.value = {
id: undefined,
busNo: undefined, // 编码
name: undefined, // 名称
pyStr: undefined, // 拼音码(品名)
totalVolume: undefined, // 规格
merchandiseName: undefined, // 商品名称
manufacturerId: undefined, // 厂商ID
unitCode: undefined, // 包装单位
minUnitCode: undefined, // 最小单位
partPercent: undefined, // 拆零比
approvalNumber: undefined, // 批准文号
skinTestFlag: undefined, // 皮试标志
injectFlag: undefined, // 注射标志
rateCode: undefined, // 医保支付比例编码
doseCode: undefined, // 单次剂量
doseUnitCode: undefined, // 单次剂量单位
doseFormCode: undefined, // 剂型
restrictedScope: undefined, // 限制范围
restrictedFlag: undefined, // 限制标志
};
proxy.resetForm("medicationRef");
}
/** 提交按钮 */
function submitForm() {
proxy.$refs["medicationRef"].validate((valid) => {
if (valid) {
// 将表单数据发送给父组件
emits("submit", form.value);
}
});
}
defineExpose({ defineExpose({
show, show,
edit, edit,

View File

@@ -1,7 +1,7 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-row :gutter="20"> <el-row :gutter="20">
<!--疾病目录数据--> <!--药品目录-->
<el-col :span="4" :xs="24"> <el-col :span="4" :xs="24">
<!-- <div class="head-container"> <!-- <div class="head-container">
<el-input <el-input
@@ -12,21 +12,21 @@
style="margin-bottom: 20px" style="margin-bottom: 20px"
/> />
</div> --> </div> -->
<!-- <div class="head-container"> <div class="head-container">
<el-tree <el-tree
:data="conditionDefinitionOptions" :data="medicationOptions"
:props="{ label: 'label', children: 'children' }" :props="{ label: 'info', children: 'children' }"
:expand-on-click-node="false" :expand-on-click-node="false"
:filter-node-method="filterNode" :filter-node-method="filterNode"
ref="deptTreeRef" ref="medicationTreeRef"
node-key="id" node-key="id"
highlight-current highlight-current
default-expand-all default-expand-all
@node-click="handleNodeClick" @node-click="handleNodeClick"
/> />
</div> --> </div>
</el-col> </el-col>
<!--用户数据--> <!--药品目录-->
<el-col :span="20" :xs="24"> <el-col :span="20" :xs="24">
<el-form <el-form
:model="queryParams" :model="queryParams"
@@ -37,9 +37,9 @@
> >
<el-row :gutter="24"> <el-row :gutter="24">
<el-col :span="6"> <el-col :span="6">
<el-form-item label="药品" prop="diseaseName" label-width="40"> <el-form-item label="药品" prop="searchKey" label-width="40">
<el-input <el-input
v-model="queryParams.diseaseName" v-model="queryParams.searchKey"
placeholder="品名/商品名/英文品名/编码/拼音" placeholder="品名/商品名/英文品名/编码/拼音"
clearable clearable
style="width: 240px" style="width: 240px"
@@ -53,7 +53,7 @@
prop="status" prop="status"
label-width="100" label-width="100"
> >
<el-select v-model="queryParams.status" clearable> <el-select v-model="queryParams.statusEnum" clearable>
<el-option <el-option
v-for="dict in sys_normal_disable" v-for="dict in sys_normal_disable"
:key="dict.value" :key="dict.value"
@@ -70,7 +70,7 @@
label-width="100" label-width="100"
> >
<el-select <el-select
v-model="queryParams.status" v-model="queryParams.ybMatchFlag"
placeholder="用户状态" placeholder="用户状态"
clearable clearable
> >
@@ -83,7 +83,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4"> <!-- <el-col :span="4">
<el-form-item label="已发生业务" prop="status" label-width="100"> <el-form-item label="已发生业务" prop="status" label-width="100">
<el-select <el-select
v-model="queryParams.status" v-model="queryParams.status"
@@ -98,7 +98,7 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col> -->
<el-col :span="4"> <el-col :span="4">
<el-form-item label="医保等级" prop="status" label-width="80"> <el-form-item label="医保等级" prop="status" label-width="80">
<el-select <el-select
@@ -116,7 +116,6 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<!-- <el-form-item> <!-- <el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button> <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button> <el-button icon="Refresh" @click="resetQuery">重置</el-button>
@@ -189,7 +188,7 @@
<el-table <el-table
v-loading="loading" v-loading="loading"
:data="diseaseList" :data="medicationList"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
width="90%" width="90%"
> >
@@ -424,7 +423,11 @@
/> />
</el-col> </el-col>
</el-row> </el-row>
<medicine-dialog ref="medicineRef" :item="currentData" @ok="submitForm" /> <medicine-dialog
ref="medicineRef"
:item="currentData"
@submit="submitForm"
/>
<medicine-view-dialog <medicine-view-dialog
ref="medicineViewRef" ref="medicineViewRef"
:item="viewData" :item="viewData"
@@ -432,7 +435,7 @@
/> />
<!-- 添加或修改用户配置对话框 --> <!-- 添加或修改用户配置对话框 -->
<!-- <el-dialog :title="title" v-model="open" width="600px" append-to-body> <!-- <el-dialog :title="title" v-model="open" width="600px" append-to-body>
<el-form :model="form" :rules="rules" ref="diseaseRef" label-width="80px"> <el-form :model="form" :rules="rules" ref="medicationRef" label-width="80px">
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="名称" prop="name"> <el-form-item label="名称" prop="name">
@@ -478,13 +481,13 @@
</div> </div>
</template> </template>
<script setup name="Disease"> <script setup name="Medication">
import { import {
getDiseaseList, getMedicationList,
editDisease, editMedication,
addDisease, addMedication,
getDiseaseCategory, getMedicationCategory,
getDiseaseOne, getMedicationOne,
} from "./components/medicine"; } from "./components/medicine";
import medicineDialog from "./components/medicineDialog"; import medicineDialog from "./components/medicineDialog";
import medicineViewDialog from "./components/medicineViewDialog"; import medicineViewDialog from "./components/medicineViewDialog";
@@ -497,19 +500,16 @@ const { sys_normal_disable, sys_user_sex } = proxy.useDict(
"sys_user_sex" "sys_user_sex"
); );
const diseaseList = ref([]); const medicationList = ref([]);
const open = ref(false); const open = ref(false);
const loading = ref(true); const loading = ref(true);
const showSearch = ref(true); const showSearch = ref(true);
const ids = ref([]);
const selectedData = ref([]); // 存储选择的行数据 const selectedData = ref([]); // 存储选择的行数据
const single = ref(true); const single = ref(true);
const multiple = ref(true); const multiple = ref(true);
const total = ref(0); const total = ref(0);
const title = ref(""); const title = ref("");
const dateRange = ref([]); const medicationOptions = ref(undefined);
const deptName = ref("");
const conditionDefinitionOptions = ref(undefined);
// 使用 ref 定义当前药品数据 // 使用 ref 定义当前药品数据
const currentData = ref({}); const currentData = ref({});
// 使用 ref 定义当前查看药品数据 // 使用 ref 定义当前查看药品数据
@@ -523,14 +523,16 @@ const data = reactive({
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 50, pageSize: 50,
diseaseName: undefined, // 疾病名称 searchKey: undefined, // 品名/商品名/英文品名/编码/拼音
statusEnum: undefined, // 状态(包括 1预置2启用3停用
ybMatchFlag: undefined, // 是否医保匹配(包括 10
status: undefined, // 状态(包括 1预置2启用3停用 status: undefined, // 状态(包括 1预置2启用3停用
}, },
rules: { rules: {
name: [{ required: true, message: "名称不能为空", trigger: "blur" }], // name: [{ required: true, message: "名称不能为空", trigger: "blur" }],
conditionCode: [ // conditionCode: [
{ required: true, message: "编码不能为空", trigger: "blur" }, // { required: true, message: "编码不能为空", trigger: "blur" },
], // ],
}, },
}); });
@@ -546,20 +548,20 @@ const filterNode = (value, data) => {
// proxy.$refs["deptTreeRef"].filter(val); // proxy.$refs["deptTreeRef"].filter(val);
// }); // });
/** 病种目录分类查询下拉树结构 */ /** 病种目录分类查询下拉树结构 */
function getDiseaseCategoryList() { function getMedicationCategoryList() {
getDiseaseCategory().then((response) => { getMedicationCategory().then((response) => {
console.log(response, "response病种目录分类查询下拉树结构"); console.log(response, "response药品目录分类查询下拉树结构");
conditionDefinitionOptions.value = response.data; medicationOptions.value = response.data;
}); });
} }
/** 查询病种目录列表 */ /** 查询病种目录列表 */
function getList() { function getList() {
loading.value = true; loading.value = true;
getDiseaseList(queryParams.value).then((res) => { getMedicationList(queryParams.value).then((res) => {
loading.value = false; loading.value = false;
console.log(res, "res"); console.log(res, "res");
diseaseList.value = res.data.records; medicationList.value = res.data.records;
total.value = res.total; total.value = res.data.total;
}); });
} }
/** 节点单击事件 */ /** 节点单击事件 */
@@ -584,7 +586,7 @@ function handleStart() {
proxy.$modal proxy.$modal
.confirm("是否确定启用数据!") .confirm("是否确定启用数据!")
.then(function () { .then(function () {
return editDisease(data); return editMedication(data);
}) })
.then(() => { .then(() => {
getList(); getList();
@@ -602,7 +604,7 @@ function handleClose() {
proxy.$modal proxy.$modal
.confirm("是否确认停用数据!") .confirm("是否确认停用数据!")
.then(function () { .then(function () {
return editDisease(data); return editMedication(data);
}) })
.then(() => { .then(() => {
getList(); getList();
@@ -646,7 +648,7 @@ function reset() {
status: undefined, status: undefined,
statusEnum: undefined, statusEnum: undefined,
}; };
proxy.resetForm("diseaseRef"); proxy.resetForm("medicationRef");
} }
/** 取消按钮 */ /** 取消按钮 */
function cancel() { function cancel() {
@@ -669,7 +671,15 @@ function openEditMedicine(row) {
} }
/** 打开查看弹窗 */ /** 打开查看弹窗 */
function openViewMedicine(row) { function openViewMedicine(row) {
viewData.value = row; // viewData.value = row;
reset();
getMedicationOne(row.id).then((response) => {
viewData.value = response.data;
nextTick(() => {
proxy.$refs["medicineViewRef"].edit();
});
getList();
});
console.log(viewData.value, "currentData"); console.log(viewData.value, "currentData");
// 确保子组件已经接收到最新的 props // 确保子组件已经接收到最新的 props
nextTick(() => { nextTick(() => {
@@ -692,43 +702,37 @@ function handleUpdate(row) {
title.value = "病种编辑"; title.value = "病种编辑";
} }
/** 提交按钮 */ /** 提交按钮 */
function submitForm() { function submitForm(formData) {
proxy.$refs["diseaseRef"].validate((valid) => { if (formData.id != undefined) {
if (valid) { // form.value.status
if (form.value.id != undefined) { // ? (form.value.statusEnum = "3")
form.value.status // : (form.value.statusEnum = "2");
? (form.value.statusEnum = "3") // console.log(form.value, "editMedication", form.value.statusEnum);
: (form.value.statusEnum = "2"); editMedication(formData).then((response) => {
console.log(form.value, "editDisease", form.value.statusEnum);
let param = [];
param.push(form.value);
editDisease(param).then((response) => {
proxy.$modal.msgSuccess("修改成功"); proxy.$modal.msgSuccess("修改成功");
open.value = false; open.value = false;
getList(); getList();
}); });
} else { } else {
addDisease(form.value).then((response) => { addMedication(formData).then((response) => {
proxy.$modal.msgSuccess("新增成功"); proxy.$modal.msgSuccess("新增成功");
open.value = false; open.value = false;
getList(); getList();
}); });
} }
}
});
} }
/** 详细按钮操作 */ /** 详细按钮操作 */
function handleView(row) { function handleView(row) {
reset(); reset();
open.value = true; open.value = true;
getDiseaseOne(row.id).then((response) => { getMedicationOne(row.id).then((response) => {
console.log(response, "responsebbbb", row.id); console.log(response, "responsebbbb", row.id);
form.value = response.data; form.value = response.data;
// getList(); // getList();
}); });
} }
getDiseaseCategoryList(); getMedicationCategoryList();
getList(); getList();
</script> </script>
<style scoped> <style scoped>