解决合并冲突
This commit is contained in:
@@ -74,7 +74,12 @@
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="目录分类" prop="categoryCode">
|
||||
<el-select v-model="form.categoryCode" clearable filterable :disabled="false">
|
||||
<el-select
|
||||
v-model="form.categoryCode"
|
||||
clearable
|
||||
filterable
|
||||
:disabled="form.isEditInfoDisable === 1"
|
||||
>
|
||||
<el-option
|
||||
v-for="category in activity_category_code"
|
||||
:key="category.value"
|
||||
@@ -96,18 +101,6 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="8">
|
||||
<el-form-item label="状态" prop="statusEnum">
|
||||
<el-select v-model="form.statusEnum" clearable>
|
||||
<el-option
|
||||
v-for="status in statusFlagOptions"
|
||||
:key="status.value"
|
||||
:label="status.info"
|
||||
:value="status.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
</el-row>
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="8">
|
||||
@@ -136,6 +129,7 @@
|
||||
clearable
|
||||
filterable
|
||||
style="width: 240px"
|
||||
:disabled="form.isEditInfoDisable === 1"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in med_chrgitm_type"
|
||||
@@ -164,7 +158,7 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="所需标本" prop="specimenCode">
|
||||
<el-select v-model="form.specimenCode" clearable filterable>
|
||||
@@ -181,7 +175,13 @@
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="医保等级" prop="chrgitmLv">
|
||||
<el-select v-model="form.chrgitmLv" placeholder="" clearable filterable>
|
||||
<el-select
|
||||
v-model="form.chrgitmLv"
|
||||
placeholder=""
|
||||
clearable
|
||||
filterable
|
||||
:disabled="form.isEditInfoDisable === 1"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in chrgitm_lv"
|
||||
:key="item.value"
|
||||
@@ -191,18 +191,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="8">
|
||||
<el-form-item label="执行科室" prop="ruleId">
|
||||
<el-select v-model="form.ruleId" placeholder="" clearable>
|
||||
<el-option
|
||||
v-for="item in exeOrganizations"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="使用单位" prop="permittedUnitCode">
|
||||
<el-select v-model="form.permittedUnitCode" clearable filterable>
|
||||
@@ -217,7 +206,12 @@
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="财务类型" prop="itemTypeCode">
|
||||
<el-select v-model="form.itemTypeCode" clearable filterable>
|
||||
<el-select
|
||||
v-model="form.itemTypeCode"
|
||||
clearable
|
||||
filterable
|
||||
:disabled="form.isEditInfoDisable === 1"
|
||||
>
|
||||
<el-option
|
||||
v-for="category in fin_type_code"
|
||||
:key="category.value"
|
||||
@@ -229,22 +223,13 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="24">
|
||||
<!-- <el-col :span="8">
|
||||
<el-form-item label="购入价" prop="purchasePrice">
|
||||
<el-input
|
||||
v-model="form.purchasePrice"
|
||||
placeholder=""
|
||||
:disabled="form.id != undefined"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
<el-col :span="8">
|
||||
<el-form-item label="零售价" prop="retailPrice">
|
||||
<el-input
|
||||
v-model="form.retailPrice"
|
||||
placeholder=""
|
||||
:disabled="false"
|
||||
@input="updatePrices"
|
||||
:disabled="form.isEditInfoDisable === 1"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -268,14 +253,34 @@
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="诊疗子项">
|
||||
<el-select v-model="item.adviceDefinitionId" placeholder="诊疗子项" filterable>
|
||||
<el-option
|
||||
v-for="item in diagnosisTreatmentList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
<div v-if="form.isEditInfoDisable === 0" style="position: relative">
|
||||
<PopoverList @search="handleSearch" :width="1000" :modelValue="item.name">
|
||||
<template #popover-content="{}">
|
||||
<medicineList
|
||||
@selectRow="(row) => selectRow(row, index)"
|
||||
:searchKey="medicineSearchKey"
|
||||
:shouldLoadData="isFirstOpen"
|
||||
:preloadedData="diagnosisTreatmentList"
|
||||
/>
|
||||
</template>
|
||||
</PopoverList>
|
||||
<!-- 清空按钮 -->
|
||||
<el-button
|
||||
v-if="item.name && item.name !== ''"
|
||||
type="text"
|
||||
icon="Delete"
|
||||
size="small"
|
||||
@click.stop="clearItem(index)"
|
||||
style="
|
||||
position: absolute;
|
||||
right: 3px;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
color: #909399;
|
||||
"
|
||||
/>
|
||||
</el-select>
|
||||
</div>
|
||||
<span v-else>{{ item.name || '' }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
@@ -285,11 +290,22 @@
|
||||
controls-position="right"
|
||||
:min="1"
|
||||
:max="999"
|
||||
@change="calculateTotalPrice"
|
||||
:disabled="form.isEditInfoDisable === 1"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" style="display: flex; align-items: center; padding-bottom: 15px">
|
||||
<el-button @click="addItem" circle type="priamry" size="small" plain icon="Plus" />
|
||||
<!-- <div style="margin-right: 20px; font-weight: bold; color: #333">
|
||||
小计: ¥{{
|
||||
item.retailPrice && item.childrenRequestNum
|
||||
? (parseFloat(item.retailPrice) * parseInt(item.childrenRequestNum)).toFixed(
|
||||
2
|
||||
)
|
||||
: '0.00'
|
||||
}}
|
||||
</div> -->
|
||||
<el-button @click="addItem" circle type="primary" size="small" plain icon="Plus" />
|
||||
<el-button
|
||||
@click="removeItem(index)"
|
||||
circle
|
||||
@@ -313,6 +329,11 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" style="display: flex; align-items: center; justify-content: flex-start">
|
||||
<div style="font-size: 18px; font-weight: bold; color: #276ef1">
|
||||
总价: ¥{{ totalPrice }}
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer v-if="title != '查看'">
|
||||
@@ -334,7 +355,10 @@ import {
|
||||
bodyTreeSelect,
|
||||
locationTreeSelect,
|
||||
} from './diagnosistreatment';
|
||||
|
||||
import PopoverList from '@/components/OpenHis/popoverList/index.vue';
|
||||
import medicineList from './medicineList.vue';
|
||||
import MedicineList from '../components/medicineList.vue';
|
||||
import { getCurrentInstance, nextTick, watch } from 'vue';
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { unit_code, med_chrgitm_type, fin_type_code, activity_category_code, chrgitm_lv } =
|
||||
proxy.useDict(
|
||||
@@ -348,7 +372,6 @@ const { unit_code, med_chrgitm_type, fin_type_code, activity_category_code, chrg
|
||||
const title = ref('');
|
||||
const visible = ref(false);
|
||||
const emits = defineEmits(['submit']); // 声明自定义事件
|
||||
const categoryCode = ref('');
|
||||
const deptOptions = ref(undefined); // 部门树选项
|
||||
const bodyOptions = ref(undefined); // 身体部位树选项
|
||||
const locationOptions = ref(undefined); // 地点树选项
|
||||
@@ -363,26 +386,16 @@ const data = reactive({
|
||||
rules: {
|
||||
busNo: [{ required: true, message: "编码不能为空", trigger: "blur" }],
|
||||
name: [{ required: true, message: '名称不能为空', trigger: 'blur' }],
|
||||
// statusEnum: [{ required: true, message: "状态不能为空", trigger: "blur" }],
|
||||
categoryCode: [{ required: true, message: '诊疗目录不能为空', trigger: 'blur' }],
|
||||
// typeEnum: [{ required: true, message: '器材种类不能为空', trigger: 'blur' }],
|
||||
permittedUnitCode: [{ required: true, message: '使用单位不能为空', trigger: 'blur' }],
|
||||
// ybFlag: [{ required: true, message: "医保标记不能为空", trigger: "blur" }],
|
||||
// ybMatchFlag: [
|
||||
// { required: true, message: "医保对码标记不能为空", trigger: "blur" },
|
||||
// ],
|
||||
// purchasePrice: [
|
||||
// { required: true, message: "购入价不能为空", trigger: "blur" },
|
||||
// ],
|
||||
retailPrice: [{ required: true, message: '零售价不能为空', trigger: 'blur' }],
|
||||
// maximumRetailPrice: [{ required: true, message: '最高零售价不能为空', trigger: 'blur' }],
|
||||
ybType: [{ required: true, message: '医保类型不能为空', trigger: 'blur' }],
|
||||
chrgitmLv: [{ required: true, message: '医保等级不能为空', trigger: 'blur' }],
|
||||
itemTypeCode: [{ required: true, message: '财务类型不能为空', trigger: 'blur' }],
|
||||
},
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
const { form, rules } = toRefs(data);
|
||||
|
||||
const props = defineProps({
|
||||
item: {
|
||||
@@ -416,17 +429,45 @@ const props = defineProps({
|
||||
});
|
||||
|
||||
// 表单数组,初始一条记录
|
||||
const treatmentItems = ref([{ adviceDefinitionId: '', childrenRequestNum: 1 }]);
|
||||
const treatmentItems = ref([
|
||||
{ adviceDefinitionId: '', childrenRequestNum: 1, name: '', retailPrice: 0 },
|
||||
]);
|
||||
const medicineSearchKey = ref('');
|
||||
const isFirstOpen = ref(true); // 标记是否首次打开弹窗
|
||||
const totalPrice = ref('0.00'); // 总价
|
||||
|
||||
// 计算总价
|
||||
function calculateTotalPrice() {
|
||||
try {
|
||||
let sum = 0;
|
||||
treatmentItems.value.forEach((item) => {
|
||||
if (item.adviceDefinitionId && item.retailPrice && item.childrenRequestNum) {
|
||||
const price = parseFloat(item.retailPrice) || 0;
|
||||
const count = parseInt(item.childrenRequestNum) || 0;
|
||||
sum += price * count;
|
||||
}
|
||||
});
|
||||
totalPrice.value = sum.toFixed(2);
|
||||
} catch (error) {
|
||||
totalPrice.value = '0.00';
|
||||
proxy.$modal.msgWarning('价格计算过程中遇到错误,请检查输入数据');
|
||||
}
|
||||
}
|
||||
|
||||
// 添加表单项
|
||||
function addItem() {
|
||||
treatmentItems.value.push({ adviceDefinitionId: '', childrenRequestNum: 1 });
|
||||
treatmentItems.value.push({ adviceDefinitionId: '', childrenRequestNum: 1, retailPrice: 0 });
|
||||
// 使用nextTick确保DOM更新后再计算
|
||||
nextTick(() => {
|
||||
calculateTotalPrice();
|
||||
});
|
||||
}
|
||||
|
||||
// 删除表单项
|
||||
function removeItem(index) {
|
||||
if (treatmentItems.value.length > 1) {
|
||||
treatmentItems.value.splice(index, 1);
|
||||
calculateTotalPrice();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -438,9 +479,10 @@ function handleImportYb() {
|
||||
function show() {
|
||||
reset();
|
||||
getLocationTree();
|
||||
getItemList();
|
||||
getBodyTree();
|
||||
getDeptTree();
|
||||
getItemList();
|
||||
|
||||
title.value = '';
|
||||
title.value = props.title;
|
||||
diagnosisCategoryOptions.value = props.diagnosisCategoryOptions;
|
||||
@@ -457,9 +499,6 @@ function setValue(row) {
|
||||
ybNo: formatValue(row.medicalCatalogCode), // 医保编码
|
||||
busNo: formatValue(row.medicalCatalogCode), // 项目编码使用医保编码
|
||||
categoryCode: props.currentCategoryEnum,
|
||||
// chrgitmLv: formatValue(
|
||||
// row.insuranceClass == '甲' ? '1' : row.insuranceClass == '乙' ? '2' : '3'
|
||||
// ), // 医保等级
|
||||
};
|
||||
}
|
||||
|
||||
@@ -467,16 +506,24 @@ function setValue(row) {
|
||||
function edit() {
|
||||
reset();
|
||||
getLocationTree();
|
||||
getItemList();
|
||||
getBodyTree();
|
||||
getDeptTree();
|
||||
getItemList();
|
||||
title.value = '';
|
||||
title.value = props.title;
|
||||
form.value = props.item;
|
||||
form.value.chrgitmLv = form.value.chrgitmLv ? form.value.chrgitmLv.toString() : undefined;
|
||||
treatmentItems.value = props.item.childrenJson
|
||||
? JSON.parse(props.item.childrenJson)
|
||||
: [{ adviceDefinitionId: '', childrenRequestNum: 1 }];
|
||||
|
||||
// 处理子项数据,确保包含retailPrice字段
|
||||
if (props.item.childrenJson) {
|
||||
const parsedItems = JSON.parse(props.item.childrenJson);
|
||||
treatmentItems.value = parsedItems.map((item) => ({
|
||||
...item,
|
||||
retailPrice: item.retailPrice || 0,
|
||||
}));
|
||||
} else {
|
||||
treatmentItems.value = [{ adviceDefinitionId: '', childrenRequestNum: 1, retailPrice: 0 }];
|
||||
}
|
||||
form.value.permittedUnitCode = form.value.permittedUnitCode
|
||||
? form.value.permittedUnitCode.toString()
|
||||
: undefined;
|
||||
@@ -485,6 +532,11 @@ function edit() {
|
||||
exeOrganizations.value = props.exeOrganizations;
|
||||
typeEnumOptions.value = props.typeEnumOptions;
|
||||
visible.value = true;
|
||||
|
||||
// 编辑时计算初始总价
|
||||
nextTick(() => {
|
||||
calculateTotalPrice();
|
||||
});
|
||||
}
|
||||
/** 重置操作表单 */
|
||||
function reset() {
|
||||
@@ -514,7 +566,8 @@ function reset() {
|
||||
descriptionText: undefined, // 说明
|
||||
chrgitmLv: undefined, //医保等级
|
||||
};
|
||||
treatmentItems.value = [{ adviceDefinitionId: '', childrenRequestNum: 1 }];
|
||||
treatmentItems.value = [{ adviceDefinitionId: '', childrenRequestNum: 1, retailPrice: 0 }];
|
||||
totalPrice.value = '0.00';
|
||||
proxy.resetForm('diagnosisTreatmentRef');
|
||||
}
|
||||
|
||||
@@ -552,51 +605,74 @@ function submitForm() {
|
||||
/** 查询部门下拉树结构 */
|
||||
function getDeptTree() {
|
||||
deptTreeSelect().then((response) => {
|
||||
console.log(response, 'response查询部门下拉树结构');
|
||||
deptOptions.value = response.data.records;
|
||||
});
|
||||
}
|
||||
/** 查询身体部位拉树结构 */
|
||||
function getBodyTree() {
|
||||
bodyTreeSelect().then((response) => {
|
||||
console.log(response, 'response查询身体部位下拉树结构');
|
||||
bodyOptions.value = response.data.records;
|
||||
});
|
||||
}
|
||||
/** 查询地点下拉树结构 */
|
||||
function getLocationTree() {
|
||||
locationTreeSelect({ formList: '8,4,10' }).then((response) => {
|
||||
console.log(response, 'response查询部门下拉树结构');
|
||||
locationOptions.value = response.data.records;
|
||||
});
|
||||
}
|
||||
|
||||
// 获取诊疗子项列表,只筛出无子项的数据
|
||||
function getItemList() {
|
||||
getDiagnosisTreatmentList({ statusEnum: 2, pageSize: 1000, pageNo: 1 }).then((response) => {
|
||||
diagnosisTreatmentList.value = response.data.records.filter((item) => {
|
||||
return item.childrenJson == null;
|
||||
});
|
||||
});
|
||||
}
|
||||
/** 取消按钮 */
|
||||
function cancel() {
|
||||
visible.value = false;
|
||||
reset();
|
||||
}
|
||||
|
||||
// 获取诊疗子项列表,只筛出无子项的数据
|
||||
function getItemList() {
|
||||
getDiagnosisTreatmentList({ statusEnum: 2, pageSize: 1000, pageNo: 1 }).then((res) => {
|
||||
diagnosisTreatmentList.value = res.data.records.filter((item) => {
|
||||
return item.childrenJson == null;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function formatValue(str) {
|
||||
if (str === null || str === undefined || str === '' || str === 'null') {
|
||||
return undefined;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
function handleSearch(value) {
|
||||
medicineSearchKey.value = value;
|
||||
}
|
||||
|
||||
function selectRow(row, index) {
|
||||
treatmentItems.value[index].name = row.name;
|
||||
treatmentItems.value[index].adviceDefinitionId = row.id;
|
||||
treatmentItems.value[index].retailPrice = row.retailPrice || 0;
|
||||
calculateTotalPrice();
|
||||
}
|
||||
|
||||
// 清空诊疗子项
|
||||
function clearItem(index) {
|
||||
treatmentItems.value[index].name = '';
|
||||
treatmentItems.value[index].adviceDefinitionId = '';
|
||||
treatmentItems.value[index].retailPrice = 0;
|
||||
calculateTotalPrice();
|
||||
}
|
||||
// 在这里可以根据购入价来更新零售价
|
||||
function updatePrices(value) {
|
||||
form.value.maximumRetailPrice = form.value.retailPrice;
|
||||
}
|
||||
|
||||
// 监听treatmentItems变化,实时更新总价
|
||||
watch(
|
||||
() => treatmentItems.value,
|
||||
() => {
|
||||
calculateTotalPrice();
|
||||
},
|
||||
{ deep: true }
|
||||
);
|
||||
|
||||
defineExpose({
|
||||
show,
|
||||
edit,
|
||||
|
||||
@@ -1,99 +1,106 @@
|
||||
import request from '@/utils/request'
|
||||
import request from '@/utils/request';
|
||||
|
||||
// 查询诊疗目录列表
|
||||
export function getDiagnosisTreatmentList(query) {
|
||||
return request({
|
||||
export function getDiagnosisTreatmentList (query) {
|
||||
return request ({
|
||||
url: '/data-dictionary/diagnosis-treatment/information-page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
|
||||
// 查询诊疗目录详细
|
||||
export function getDiagnosisTreatmentOne(id) {
|
||||
return request({
|
||||
export function getDiagnosisTreatmentOne (id) {
|
||||
return request ({
|
||||
url: '/data-dictionary/diagnosis-treatment/information-one/',
|
||||
method: 'get',
|
||||
params: { id } // 确保参数正确传递
|
||||
})
|
||||
params: {id}, // 确保参数正确传递
|
||||
});
|
||||
}
|
||||
// 查询诊疗目录详细
|
||||
export function validateActivityEdit (activityId) {
|
||||
return request ({
|
||||
url: '/data-dictionary/diagnosis-treatment/validate-edit',
|
||||
method: 'get',
|
||||
params: {activityId}, // 确保参数正确传递
|
||||
});
|
||||
}
|
||||
|
||||
// 新增诊疗目录
|
||||
export function addDiagnosisTreatment(data) {
|
||||
return request({
|
||||
export function addDiagnosisTreatment (data) {
|
||||
return request ({
|
||||
url: '/data-dictionary/diagnosis-treatment/information',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
|
||||
// 修改诊疗目录
|
||||
export function editDiagnosisTreatment(data) {
|
||||
return request({
|
||||
export function editDiagnosisTreatment (data) {
|
||||
return request ({
|
||||
url: '/data-dictionary/diagnosis-treatment/information',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
|
||||
// 诊疗目录分类查询
|
||||
export function getDiseaseTreatmentInit() {
|
||||
return request({
|
||||
export function getDiseaseTreatmentInit () {
|
||||
return request ({
|
||||
url: '/data-dictionary/diagnosis-treatment/init',
|
||||
method: 'get'
|
||||
})
|
||||
method: 'get',
|
||||
});
|
||||
}
|
||||
|
||||
// 停用诊疗目录
|
||||
export function stopDiseaseTreatment(ids) {
|
||||
console.log(ids)
|
||||
return request({
|
||||
export function stopDiseaseTreatment (ids) {
|
||||
console.log (ids);
|
||||
return request ({
|
||||
url: '/data-dictionary/diagnosis-treatment/information-stop',
|
||||
method: 'put',
|
||||
data: ids
|
||||
})
|
||||
data: ids,
|
||||
});
|
||||
}
|
||||
|
||||
// 启用诊疗目录
|
||||
export function startDiseaseTreatment(ids) {
|
||||
console.log(ids)
|
||||
return request({
|
||||
export function startDiseaseTreatment (ids) {
|
||||
console.log (ids);
|
||||
return request ({
|
||||
url: '/data-dictionary/diagnosis-treatment/information-start',
|
||||
method: 'put',
|
||||
data: ids
|
||||
})
|
||||
data: ids,
|
||||
});
|
||||
}
|
||||
|
||||
// 查询部门树形数据
|
||||
export function deptTreeSelect(queryParams) {
|
||||
return request({
|
||||
export function deptTreeSelect (queryParams) {
|
||||
return request ({
|
||||
url: '/base-data-manage/organization/organization',
|
||||
method: 'get',
|
||||
param: queryParams
|
||||
})
|
||||
param: queryParams,
|
||||
});
|
||||
}
|
||||
// 查询身体部位树形数据
|
||||
export function bodyTreeSelect(queryParams) {
|
||||
return request({
|
||||
export function bodyTreeSelect (queryParams) {
|
||||
return request ({
|
||||
url: '/base-data-manage/body-structure/body',
|
||||
method: 'get',
|
||||
params: queryParams
|
||||
})
|
||||
params: queryParams,
|
||||
});
|
||||
}
|
||||
// 查询地点树形数据
|
||||
export function locationTreeSelect(queryParams) {
|
||||
return request({
|
||||
export function locationTreeSelect (queryParams) {
|
||||
return request ({
|
||||
url: '/base-data-manage/location/location-page-tree',
|
||||
method: 'get',
|
||||
params: queryParams
|
||||
})
|
||||
params: queryParams,
|
||||
});
|
||||
}
|
||||
|
||||
// 获取医用耗材目录
|
||||
export function getYbDiagnosisTreatmentList(queryParams) {
|
||||
return request({
|
||||
export function getYbDiagnosisTreatmentList (queryParams) {
|
||||
return request ({
|
||||
url: '/catalog/page',
|
||||
method: 'get',
|
||||
params: queryParams
|
||||
})
|
||||
params: queryParams,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -0,0 +1,114 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-table ref="medicineRef" height="300" :data="filteredList" @cell-click="clickRow">
|
||||
<el-table-column label="项目名称" align="center" prop="name" width="300" />
|
||||
<el-table-column label="零售价" align="center" prop="retailPrice" />
|
||||
<el-table-column label="最高零售价" align="center" prop="maximumRetailPrice" />
|
||||
</el-table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { getDiagnosisTreatmentList } from './diagnosistreatment';
|
||||
import { ref, watch } from 'vue';
|
||||
|
||||
const props = defineProps({
|
||||
itemType: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
searchKey: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
shouldLoadData: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
// 新增:从父组件接收预加载的数据
|
||||
preloadedData: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
});
|
||||
const emit = defineEmits(['selectRow']);
|
||||
|
||||
const diagnosisTreatmentList = ref([]); // 原始数据列表
|
||||
const filteredList = ref([]); // 过滤后的数据列表
|
||||
const hasLoaded = ref(false); // 标记是否已加载数据
|
||||
|
||||
// 获取诊疗项目列表
|
||||
function getList() {
|
||||
if (hasLoaded.value) return; // 如果已经加载过数据,则不再重复请求
|
||||
|
||||
// 优先使用父组件传递的数据
|
||||
if (props.preloadedData && props.preloadedData.length > 0) {
|
||||
diagnosisTreatmentList.value = props.preloadedData;
|
||||
filterList(); // 初始化过滤
|
||||
hasLoaded.value = true;
|
||||
return;
|
||||
}
|
||||
|
||||
// 如果父组件没有传递数据或数据为空,则自己请求
|
||||
getDiagnosisTreatmentList({ statusEnum: 2, pageSize: 1000, pageNo: 1 })
|
||||
.then((res) => {
|
||||
diagnosisTreatmentList.value =
|
||||
res.data?.records?.filter((item) => item.childrenJson == null) || [];
|
||||
filterList(); // 初始化过滤
|
||||
hasLoaded.value = true; // 标记为已加载
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error('获取诊疗项目数据失败:', err);
|
||||
});
|
||||
}
|
||||
|
||||
// 监听shouldLoadData属性变化,仅在首次为true时加载数据
|
||||
watch(
|
||||
() => props.shouldLoadData,
|
||||
(newValue) => {
|
||||
if (newValue && !hasLoaded.value) {
|
||||
getList();
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
|
||||
// 监听preloadedData变化,当父组件数据更新时同步更新列表
|
||||
watch(
|
||||
() => props.preloadedData,
|
||||
(newData) => {
|
||||
if (newData && newData.length > 0) {
|
||||
diagnosisTreatmentList.value = newData;
|
||||
filterList(); // 更新过滤
|
||||
hasLoaded.value = true;
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
|
||||
// 监听搜索关键词变化,实时过滤数据
|
||||
watch(
|
||||
() => props.searchKey,
|
||||
() => {
|
||||
filterList();
|
||||
}
|
||||
);
|
||||
|
||||
// 根据搜索关键词过滤列表
|
||||
function filterList() {
|
||||
if (!props.searchKey || props.searchKey.trim() === '') {
|
||||
filteredList.value = diagnosisTreatmentList.value;
|
||||
} else {
|
||||
const searchTerm = props.searchKey.toLowerCase().trim();
|
||||
filteredList.value = diagnosisTreatmentList.value.filter(
|
||||
(item) => item.name && item.name.toLowerCase().includes(searchTerm)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function clickRow(row) {
|
||||
emit('selectRow', row);
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
||||
@@ -28,7 +28,6 @@
|
||||
label-width="68px"
|
||||
>
|
||||
<el-row :gutter="24">
|
||||
<!-- <el-col :span="5"> -->
|
||||
<el-form-item label="项目名" prop="searchKey" label-width="55">
|
||||
<el-input
|
||||
v-model="queryParams.searchKey"
|
||||
@@ -38,8 +37,7 @@
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- </el-col> -->
|
||||
<!-- <el-col :span="5"> -->
|
||||
|
||||
<el-form-item label="状态" prop="statusEnum" label-width="80">
|
||||
<el-select v-model="queryParams.statusEnum" clearable>
|
||||
<el-option
|
||||
@@ -50,8 +48,6 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- </el-col> -->
|
||||
<!-- <el-col :span="5"> -->
|
||||
<el-form-item label="医保是否对码" prop="ybMatchFlag" label-width="120">
|
||||
<el-select v-model="queryParams.ybMatchFlag" placeholder="" clearable>
|
||||
<el-option
|
||||
@@ -62,24 +58,7 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- </el-col> -->
|
||||
<!-- <el-col :span="4">
|
||||
<el-form-item label="执行科室" prop="ruleId" label-width="100">
|
||||
<el-select
|
||||
v-model="queryParams.ruleId"
|
||||
placeholder=""
|
||||
clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in exeOrganizations"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
<!-- <el-col :span="4"> -->
|
||||
|
||||
<el-form-item label="类型" prop="typeEnum" label-width="100">
|
||||
<el-select v-model="queryParams.typeEnum" placeholder="" clearable>
|
||||
<el-option
|
||||
@@ -116,9 +95,9 @@
|
||||
>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="1.5">
|
||||
<el-button type="info" plain icon="Upload" @click="handleImport">导入</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="info" plain icon="Upload" @click="handleImport">导入</el-button>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Search" @click="getList">查询</el-button>
|
||||
@@ -148,7 +127,7 @@
|
||||
key="busNo"
|
||||
prop="busNo"
|
||||
:show-overflow-tooltip="true"
|
||||
width="150"
|
||||
width="200"
|
||||
/>
|
||||
<el-table-column
|
||||
label="项目名称"
|
||||
@@ -156,22 +135,9 @@
|
||||
key="name"
|
||||
prop="name"
|
||||
:show-overflow-tooltip="true"
|
||||
width="150"
|
||||
/>
|
||||
<el-table-column
|
||||
label="拼音"
|
||||
align="center"
|
||||
key="pyStr"
|
||||
prop="pyStr"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="五笔码"
|
||||
align="center"
|
||||
key="wbStr"
|
||||
prop="wbStr"
|
||||
:show-overflow-tooltip="true"
|
||||
width="200"
|
||||
/>
|
||||
|
||||
<el-table-column
|
||||
label="目录类别"
|
||||
align="center"
|
||||
@@ -180,94 +146,6 @@
|
||||
:show-overflow-tooltip="true"
|
||||
width="100"
|
||||
/>
|
||||
<el-table-column
|
||||
label="业务类型"
|
||||
align="center"
|
||||
key="typeEnum_enumText"
|
||||
prop="typeEnum_enumText"
|
||||
:show-overflow-tooltip="true"
|
||||
width="90"
|
||||
/>
|
||||
<el-table-column
|
||||
label="使用单位"
|
||||
align="center"
|
||||
key="permittedUnitCode_dictText"
|
||||
prop="permittedUnitCode_dictText"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="医保标记"
|
||||
align="center"
|
||||
key="ybFlag_enumText"
|
||||
prop="ybFlag_enumText"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="医保编码"
|
||||
align="center"
|
||||
key="ybNo"
|
||||
prop="ybNo"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="医保对码标记"
|
||||
align="center"
|
||||
key="ybMatchFlag_enumText"
|
||||
prop="ybMatchFlag_enumText"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="状态"
|
||||
align="center"
|
||||
key="statusEnum_enumText"
|
||||
prop="statusEnum_enumText"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="归属科室"
|
||||
align="center"
|
||||
key="orgId_dictText"
|
||||
prop="orgId_dictText"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="所在位置"
|
||||
align="center"
|
||||
key="locationId_dictText"
|
||||
prop="locationId_dictText"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="身体部位"
|
||||
align="center"
|
||||
key="bodySiteCode_dictText"
|
||||
prop="bodySiteCode_dictText"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="所需标本"
|
||||
align="center"
|
||||
key="specimenCode_dictText"
|
||||
prop="specimenCode_dictText"
|
||||
:show-overflow-tooltip="true"
|
||||
width="100"
|
||||
/>
|
||||
<el-table-column
|
||||
label="财务类别"
|
||||
align="center"
|
||||
key="itemTypeCode_dictText"
|
||||
prop="itemTypeCode_dictText"
|
||||
:show-overflow-tooltip="true"
|
||||
width="100"
|
||||
/>
|
||||
<el-table-column
|
||||
label="医保类别"
|
||||
align="center"
|
||||
key="ybType_dictText"
|
||||
prop="ybType_dictText"
|
||||
:show-overflow-tooltip="true"
|
||||
width="100"
|
||||
/>
|
||||
<el-table-column
|
||||
label="售价"
|
||||
align="center"
|
||||
@@ -277,20 +155,34 @@
|
||||
width="100"
|
||||
/>
|
||||
<el-table-column
|
||||
label="说明"
|
||||
label="财务类别"
|
||||
align="center"
|
||||
key="descriptionText"
|
||||
prop="descriptionText"
|
||||
key="itemTypeCode_dictText"
|
||||
prop="itemTypeCode_dictText"
|
||||
:show-overflow-tooltip="true"
|
||||
width="100"
|
||||
/>
|
||||
<el-table-column
|
||||
label="使用单位"
|
||||
align="center"
|
||||
key="permittedUnitCode_dictText"
|
||||
prop="permittedUnitCode_dictText"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<!-- <el-table-column
|
||||
label="执行科室"
|
||||
<el-table-column
|
||||
label="医保编码"
|
||||
align="center"
|
||||
key="ruleId"
|
||||
prop="ruleId"
|
||||
key="ybNo"
|
||||
prop="ybNo"
|
||||
:show-overflow-tooltip="true"
|
||||
width="90"
|
||||
/> -->
|
||||
/>
|
||||
<el-table-column
|
||||
label="状态"
|
||||
align="center"
|
||||
key="statusEnum_enumText"
|
||||
prop="statusEnum_enumText"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
align="center"
|
||||
@@ -345,16 +237,30 @@
|
||||
|
||||
<!-- 诊疗目录导入对话框 -->
|
||||
<el-dialog :title="upload.title" v-model="upload.open" width="400px" append-to-body>
|
||||
<el-upload ref="uploadRef" :limit="1" accept=".xlsx, .xls" :headers="upload.headers"
|
||||
:action="upload.url + '?updateSupport=' + upload.updateSupport" :disabled="upload.isUploading"
|
||||
:on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
|
||||
<el-upload
|
||||
ref="uploadRef"
|
||||
:limit="1"
|
||||
accept=".xlsx, .xls"
|
||||
:headers="upload.headers"
|
||||
:action="upload.url + '?updateSupport=' + upload.updateSupport"
|
||||
:disabled="upload.isUploading"
|
||||
:on-progress="handleFileUploadProgress"
|
||||
:on-success="handleFileSuccess"
|
||||
:auto-upload="false"
|
||||
drag
|
||||
>
|
||||
<el-icon class="el-icon--upload"><upload-filled /></el-icon>
|
||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||
<template #tip>
|
||||
<div class="el-upload__tip text-center">
|
||||
<span>仅允许导入xls、xlsx格式文件。</span>
|
||||
<el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline"
|
||||
@click="importTemplate">下载模板</el-link>
|
||||
<el-link
|
||||
type="primary"
|
||||
:underline="false"
|
||||
style="font-size: 12px; vertical-align: baseline"
|
||||
@click="importTemplate"
|
||||
>下载模板</el-link
|
||||
>
|
||||
</div>
|
||||
</template>
|
||||
</el-upload>
|
||||
@@ -369,13 +275,14 @@
|
||||
</template>
|
||||
|
||||
<script setup name="DiagnosisTreatment">
|
||||
import { getToken } from "@/utils/auth";
|
||||
import { getToken } from '@/utils/auth';
|
||||
import {
|
||||
getDiagnosisTreatmentList,
|
||||
stopDiseaseTreatment,
|
||||
startDiseaseTreatment,
|
||||
getDiseaseTreatmentInit,
|
||||
getDiagnosisTreatmentOne,
|
||||
validateActivityEdit,
|
||||
} from './components/diagnosistreatment';
|
||||
import diagnosisTreatmentDialog from './components/diagnosisTreatmentDialog';
|
||||
import DiagTreYbDialog from './components/diagTreYbDialog';
|
||||
@@ -407,18 +314,17 @@ const upload = reactive({
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
title: '',
|
||||
// 是否禁用上传
|
||||
isUploading: false,
|
||||
// 是否更新已经存在的数据
|
||||
updateSupport: 0,
|
||||
// 设置上传的请求头部
|
||||
headers: { Authorization: "Bearer " + getToken() },
|
||||
headers: { Authorization: 'Bearer ' + getToken() },
|
||||
// 上传的地址
|
||||
url: import.meta.env.VITE_APP_BASE_API + "/data-dictionary/diagnosis-treatment/import-data"
|
||||
url: import.meta.env.VITE_APP_BASE_API + '/data-dictionary/diagnosis-treatment/import-data',
|
||||
});
|
||||
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
@@ -445,7 +351,6 @@ const filterNode = (value, data) => {
|
||||
/** 诊断目录分类查询下拉树结构 */
|
||||
function getDiseaseTreatmentList() {
|
||||
getDiseaseTreatmentInit().then((response) => {
|
||||
console.log(response, 'response诊疗目录分类查询下拉树结构');
|
||||
diagnosisCategoryOptions.value = response.data.diagnosisCategoryOptions.sort((a, b) => {
|
||||
return parseInt(a.value) - parseInt(b.value);
|
||||
});
|
||||
@@ -458,18 +363,15 @@ function getDiseaseTreatmentList() {
|
||||
}
|
||||
/** 查询诊断目录列表 */
|
||||
function getList() {
|
||||
console.log(queryParams.value, 'queryParams***********************');
|
||||
loading.value = true;
|
||||
getDiagnosisTreatmentList(queryParams.value).then((res) => {
|
||||
loading.value = false;
|
||||
diagnosisTreatmentList.value = res.data.records;
|
||||
console.log(diagnosisTreatmentList, 'res.data');
|
||||
total.value = res.data.total;
|
||||
});
|
||||
}
|
||||
/** 节点单击事件 */
|
||||
function handleNodeClick(data) {
|
||||
console.log(data, '节点单击事件');
|
||||
queryParams.value.categoryCode = data.value;
|
||||
currentCategoryEnum.value = data.value;
|
||||
handleQuery();
|
||||
@@ -477,7 +379,6 @@ function handleNodeClick(data) {
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNo = 1;
|
||||
console.log(queryParams, 'queryParams搜索');
|
||||
getList();
|
||||
}
|
||||
|
||||
@@ -528,7 +429,11 @@ function handleImport() {
|
||||
}
|
||||
/** 下载模板操作 */
|
||||
function importTemplate() {
|
||||
proxy.download('/data-dictionary/diagnosis-treatment/import-template', {}, `diagnosis_treatment_template_${new Date().getTime()}.xlsx`);
|
||||
proxy.download(
|
||||
'/data-dictionary/diagnosis-treatment/import-template',
|
||||
{},
|
||||
`diagnosis_treatment_template_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
}
|
||||
/**文件上传中处理 */
|
||||
const handleFileUploadProgress = (event, file, fileList) => {
|
||||
@@ -541,8 +446,8 @@ const handleFileSuccess = (response, file, fileList) => {
|
||||
proxy.$refs['uploadRef'].handleRemove(file);
|
||||
proxy.$alert(
|
||||
"<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
|
||||
response.msg +
|
||||
'</div>',
|
||||
response.msg +
|
||||
'</div>',
|
||||
'导入结果',
|
||||
{ dangerouslyUseHTMLString: true }
|
||||
);
|
||||
@@ -555,7 +460,6 @@ function submitFileForm() {
|
||||
|
||||
/** 选择条数 */
|
||||
function handleSelectionChange(selection) {
|
||||
console.log(selection, 'selection');
|
||||
// selectedData.value = selection.map((item) => ({ ...item })); // 存储选择的行数据
|
||||
ids.value = selection.map((item) => item.id);
|
||||
single.value = selection.length != 1;
|
||||
@@ -564,22 +468,28 @@ function handleSelectionChange(selection) {
|
||||
|
||||
/** 打开新增弹窗 */
|
||||
function openAddDiagnosisTreatment() {
|
||||
// if (currentCategoryEnum.value) {
|
||||
console.log('打开新增弹窗');
|
||||
title.value = '新增';
|
||||
nextTick(() => {
|
||||
proxy.$refs.diagnosisTreatmentRef.show();
|
||||
});
|
||||
// } else {
|
||||
// proxy.$modal.msgError("请先选择目录分类!");
|
||||
// }
|
||||
}
|
||||
const isEditInfoDisable = ref(0);
|
||||
/** 打开编辑弹窗 */
|
||||
function openEditDiagnosisTreatment(row) {
|
||||
validateActivityEdit(row.id).then((res) => {
|
||||
// res.data == 1 医生开过该诊疗项目,不可编辑
|
||||
isEditInfoDisable.value = res.data;
|
||||
getDiagnosisTreatmentInfo(row);
|
||||
});
|
||||
}
|
||||
// 根据诊疗id 查询诊疗信息
|
||||
function getDiagnosisTreatmentInfo(row) {
|
||||
getDiagnosisTreatmentOne(row.id).then((response) => {
|
||||
console.log(response, 'response88888');
|
||||
|
||||
currentData.value = response.data;
|
||||
currentData.value = {
|
||||
...response.data,
|
||||
// 禁用编辑
|
||||
isEditInfoDisable: isEditInfoDisable.value,
|
||||
};
|
||||
currentData.value.ybFlag == 1
|
||||
? (currentData.value.ybFlag = true)
|
||||
: (currentData.value.ybFlag = false);
|
||||
|
||||
Reference in New Issue
Block a user