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

View File

@@ -7,15 +7,15 @@
<el-form
:model="form"
:rules="rules"
ref="diseaseRef"
ref="medicationRef"
label-width="110px"
label-position="left"
>
<el-row :gutter="24">
<el-col :span="8">
<el-form-item label="编号" prop="conditionCode">
<el-form-item label="编号" prop="busNo">
<el-input
v-model="form.conditionCode"
v-model="form.busNo"
placeholder="请输入编码"
maxlength="30"
:disabled="form.id != undefined"
@@ -32,16 +32,20 @@
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="拼音码(品名)" prop="name">
<el-input v-model="form.name" placeholder="" maxlength="30" />
<el-form-item label="拼音码(品名)" prop="pyStr">
<el-input
v-model="form.pyStr"
placeholder=""
maxlength="30"
/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :span="8">
<el-form-item label="规格" prop="conditionCode">
<el-form-item label="规格" prop="totalVolume">
<el-input
v-model="form.conditionCode"
v-model="form.totalVolume"
placeholder=""
maxlength="30"
/>
@@ -53,25 +57,29 @@
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="商品名" prop="name">
<el-input v-model="form.name" placeholder="" maxlength="30" />
<el-form-item label="商品名" prop="merchandiseName">
<el-input
v-model="form.merchandiseName"
placeholder=""
maxlength="30"
/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :span="8">
<el-form-item label="厂家/产地" prop="conditionCode">
<el-form-item label="厂家/产地" prop="manufacturerId">
<el-input
v-model="form.conditionCode"
v-model="form.manufacturerId"
placeholder=""
maxlength="30"
/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="包装单位" prop="name">
<el-form-item label="包装单位" prop="unitCode">
<el-input
v-model="form.name"
v-model="form.unitCode"
placeholder=""
maxlength="30"
:disabled="form.id != undefined"
@@ -79,9 +87,9 @@
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="最小单位" prop="name">
<el-form-item label="最小单位" prop="minUnitCode">
<el-input
v-model="form.name"
v-model="form.minUnitCode"
placeholder=""
maxlength="30"
:disabled="form.id != undefined"
@@ -91,9 +99,9 @@
</el-row>
<el-row :gutter="24">
<el-col :span="8">
<el-form-item label="拆零比" prop="conditionCode">
<el-form-item label="拆零比" prop="partPercent">
<el-input
v-model="form.conditionCode"
v-model="form.partPercent"
placeholder=""
maxlength="30"
:disabled="form.id != undefined"
@@ -123,9 +131,9 @@
</el-row>
<el-row :gutter="24">
<el-col :span="8">
<el-form-item label="批准文号" prop="conditionCode">
<el-form-item label="批准文号" prop="approvalNumber">
<el-input
v-model="form.conditionCode"
v-model="form.approvalNumber"
placeholder=""
maxlength="30"
/>
@@ -149,13 +157,13 @@
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="皮试判别" prop="name">
<el-checkbox v-model="form.status"></el-checkbox>
<el-form-item label="皮试判别" prop="skinTestFlag">
<el-checkbox v-model="form.skinTestFlag"></el-checkbox>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="注射药品" prop="name">
<el-checkbox v-model="form.status"></el-checkbox>
<el-form-item label="注射药品" prop="injectFlag">
<el-checkbox v-model="form.injectFlag"></el-checkbox>
</el-form-item>
</el-col>
</el-row>
@@ -194,9 +202,9 @@
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="用药频次" prop="name">
<el-form-item label="用药频次" prop="rateCode">
<el-select
v-model="queryParams.status"
v-model="queryParams.rateCode"
clearable
:disabled="form.id != undefined"
>
@@ -210,15 +218,15 @@
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="单次剂量" prop="name" inline>
<el-form-item label="单次剂量" prop="dose" inline>
<el-input
v-model="form.name"
v-model="form.dose"
placeholder=""
maxlength="30"
style="width: 49%"
/>
<el-select
v-model="queryParams.status"
v-model="queryParams.doseUnitCode"
clearable
style="width: 49%"
:disabled="form.id != undefined"
@@ -235,9 +243,9 @@
</el-row>
<el-row :gutter="24">
<el-col :span="8">
<el-form-item label="剂型" prop="conditionCode">
<el-form-item label="剂型" prop="doseFormCode">
<el-select
v-model="queryParams.status"
v-model="queryParams.doseFormCode"
clearable
:disabled="form.id != undefined"
>
@@ -398,9 +406,9 @@
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="限制使用范围" prop="name">
<el-form-item label="限制使用范围" prop="restrictedScope">
<el-input
v-model="form.name"
v-model="form.restrictedScope"
placeholder=""
maxlength="30"
:disabled="form.id != undefined"
@@ -408,9 +416,9 @@
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label=" 限制使用标记" prop="name">
<el-form-item label="限制使用标记" prop="restrictedFlag">
<el-input
v-model="form.name"
v-model="form.restrictedFlag"
placeholder=""
maxlength="30"
:disabled="form.id != undefined"
@@ -527,23 +535,9 @@ const { sys_normal_disable, sys_user_sex } = proxy.useDict(
"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 dateRange = ref([]);
const deptName = ref("");
const visible = ref(false);
const conditionDefinitionOptions = ref(undefined);
// const initPassword = ref(undefined);
// const postOptions = ref([]);
// const roleOptions = ref([]);
const emits = defineEmits(['submit']); // 声明自定义事件
const data = reactive({
form: {},
@@ -554,10 +548,11 @@ const data = reactive({
status: undefined, // 状态(包括 1预置2启用3停用
},
rules: {
name: [{ required: true, message: "名称不能为空", trigger: "blur" }],
conditionCode: [
{ required: true, message: "编码不能为空", trigger: "blur" },
],
// busNo: [{ required: true, message: "编码不能为空", trigger: "blur" }],
// name: [{ required: true, message: "名称不能为空", trigger: "blur" }],
// conditionCode: [
// { required: true, message: "编码不能为空", trigger: "blur" },
// ],
},
});
@@ -586,6 +581,40 @@ function edit() {
form.value = props.item;
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({
show,
edit,

View File

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