2025-11-12 openHIS 发版
This commit is contained in:
@@ -33,6 +33,17 @@
|
||||
>添加新项目</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="Plus"
|
||||
:disabled="isAddDisable"
|
||||
@click="handleBacthAddItem"
|
||||
v-hasPermi="['system:user:add']"
|
||||
>批量新增项目配置</el-button
|
||||
>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-table
|
||||
@@ -41,54 +52,49 @@
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="100" align="center" />
|
||||
<el-table-column label="诊疗目录" width="150" align="center" :show-overflow-tooltip="true">
|
||||
<template #default="scope">
|
||||
<div style="display: flex; align-items: center; justify-content: center">
|
||||
<el-select
|
||||
v-model="scope.row.activityCategoryCode"
|
||||
placeholder="请选择"
|
||||
ref="dropdown"
|
||||
@change="DiagnosisTreatmentList(scope.row,scope.$index,1)"
|
||||
:class="{ 'error-border': scope.row.error }"
|
||||
clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in catagoryDicts"
|
||||
:key="dict.value"
|
||||
:label="dict.info"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="项目名称"
|
||||
label="诊疗目录"
|
||||
width="150"
|
||||
align="center"
|
||||
:show-overflow-tooltip="true"
|
||||
>
|
||||
<template #default="scope">
|
||||
<div style="display: flex; align-items: center; justify-content: center">
|
||||
<el-select
|
||||
v-model="scope.row.activityDefinitionId"
|
||||
filterable
|
||||
remote
|
||||
reserve-keyword
|
||||
placeholder="请选择"
|
||||
remote-show-suffix
|
||||
:remote-method="(query) => debouncedRemoteMethod(query, scope.row)"
|
||||
:loading="loading"
|
||||
style="width: 350px"
|
||||
:class="{ 'error-border': scope.row.error }"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in scope.row.projectList"
|
||||
:key="item.value"
|
||||
:label="item.info"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</div>
|
||||
<el-select
|
||||
v-model="scope.row.activityCategoryCode"
|
||||
placeholder="请选择"
|
||||
ref="dropdown"
|
||||
:class="{ 'error-border': scope.row.error }"
|
||||
clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in catagoryDicts"
|
||||
:key="dict.value"
|
||||
:label="dict.info"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="项目名称" align="center" :show-overflow-tooltip="true">
|
||||
<template #default="scope">
|
||||
<el-select
|
||||
v-model="scope.row.activityDefinitionId"
|
||||
filterable
|
||||
remote
|
||||
reserve-keyword
|
||||
placeholder="请选择"
|
||||
remote-show-suffix
|
||||
style="width: 400px; max-width: 500px"
|
||||
:class="{ 'error-border': scope.row.error }"
|
||||
clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in allImplementDepartmentList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
@@ -97,18 +103,15 @@
|
||||
key="startTime"
|
||||
prop="startTime"
|
||||
:show-overflow-tooltip="true"
|
||||
width="300"
|
||||
>
|
||||
<template #default="scope">
|
||||
<div style="display: flex; align-items: center; justify-content: center">
|
||||
<el-time-picker
|
||||
v-model="scope.row.startTime"
|
||||
placeholder="选择时间"
|
||||
format="HH:mm:ss"
|
||||
value-format="HH:mm:ss"
|
||||
>
|
||||
</el-time-picker>
|
||||
</div>
|
||||
<el-time-picker
|
||||
v-model="scope.row.startTime"
|
||||
placeholder="选择时间"
|
||||
format="HH:mm:ss"
|
||||
value-format="HH:mm:ss"
|
||||
>
|
||||
</el-time-picker>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
@@ -117,19 +120,16 @@
|
||||
align="center"
|
||||
key="endTime"
|
||||
prop="endTime"
|
||||
:show-overflow-tooltip="true"
|
||||
width="300"
|
||||
show-overflow-tooltip
|
||||
>
|
||||
<template #default="scope">
|
||||
<div style="display: flex; align-items: center; justify-content: center">
|
||||
<el-time-picker
|
||||
v-model="scope.row.endTime"
|
||||
placeholder="选择时间"
|
||||
format="HH:mm:ss"
|
||||
value-format="HH:mm:ss"
|
||||
>
|
||||
</el-time-picker>
|
||||
</div>
|
||||
<el-time-picker
|
||||
v-model="scope.row.endTime"
|
||||
placeholder="选择时间"
|
||||
format="HH:mm:ss"
|
||||
value-format="HH:mm:ss"
|
||||
>
|
||||
</el-time-picker>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
@@ -169,6 +169,11 @@
|
||||
/>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<BacthAddItemDialog
|
||||
v-model:dialogVisible="bacthAddItemDialogVisible"
|
||||
:organizationId="organizationId"
|
||||
@submitOk="getList"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -178,14 +183,12 @@ import {
|
||||
getImplementDepartmentList,
|
||||
getDiagnosisTreatmentList,
|
||||
getDiseaseTreatmentInit,
|
||||
getImplementDepartmentOne,
|
||||
// getDiseaseTreatmentInitLoc,
|
||||
getAllTreatmentList,
|
||||
addImplementDepartment,
|
||||
editImplementDepartment,
|
||||
deleteImplementDepartment,
|
||||
} from './components/implementDepartment';
|
||||
import { debounce } from 'lodash-es';
|
||||
import { fa } from 'element-plus/es/locales.mjs';
|
||||
import BacthAddItemDialog from './components/batchAddDialog.vue';
|
||||
const { proxy } = getCurrentInstance();
|
||||
const organization = ref([]);
|
||||
const loading = ref(true);
|
||||
@@ -194,10 +197,11 @@ const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const catagoryList = ref([]);
|
||||
const projectList = ref([]);
|
||||
const catagoryDicts = ref([]);
|
||||
const isAddDisable = ref(true);
|
||||
const organizationId = ref('');
|
||||
// 批量添加
|
||||
const bacthAddItemDialogVisible = ref(false);
|
||||
//默认传8(诊疗)
|
||||
const distributionCategoryCode = ref('8');
|
||||
const data = reactive({
|
||||
@@ -212,29 +216,15 @@ const data = reactive({
|
||||
},
|
||||
isAdding: false,
|
||||
});
|
||||
const debouncedRemoteMethod = debounce((query, row) => {
|
||||
remoteMethod(query, row);
|
||||
}, 300);
|
||||
|
||||
const { queryParams, tableRules } = toRefs(data);
|
||||
|
||||
/** 查询表格数据列表 */
|
||||
function getList() {
|
||||
let params = {
|
||||
// 科室id
|
||||
organizationId: organizationId.value,
|
||||
// 类别
|
||||
distributionCategoryCode: distributionCategoryCode.value,
|
||||
};
|
||||
getDiagnosisTreatmentList(params).then((res) => {
|
||||
console.log(res.data.records)
|
||||
queryParams.value.organizationId = organizationId.value;
|
||||
queryParams.value.distributionCategoryCode = distributionCategoryCode.value;
|
||||
loading.value = true;
|
||||
getDiagnosisTreatmentList(queryParams.value).then((res) => {
|
||||
loading.value = false;
|
||||
catagoryList.value = res.data.records
|
||||
catagoryList.value.map((k,index)=>{
|
||||
// if(k.activityCategoryCode){
|
||||
DiagnosisTreatmentList(k,index, 2)
|
||||
// }
|
||||
})
|
||||
catagoryList.value = res.data.records;
|
||||
total.value = res.data.total;
|
||||
});
|
||||
}
|
||||
@@ -243,69 +233,21 @@ const filterNode = (value, data) => {
|
||||
if (!value) return true;
|
||||
return data.name.indexOf(value) !== -1;
|
||||
};
|
||||
|
||||
//下拉诊疗目录点击事件
|
||||
function DiagnosisTreatmentList(row,index,type) {
|
||||
let params = {
|
||||
statusEnum: 2, // 状态(包括 1:预置,2:启用,3:停用)
|
||||
...row,
|
||||
categoryCode: row.activityCategoryCode,
|
||||
pageSize:100,
|
||||
}
|
||||
if(type == 1){
|
||||
catagoryList.value[index].activityDefinitionId =''
|
||||
}else if(type == 2){
|
||||
params.searchKey = row.activityDefinitionId_dictText
|
||||
}
|
||||
console.log(params,'params');
|
||||
getImplementDepartmentOne(params)
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
projectList.value = [];
|
||||
row.name = null;
|
||||
projectList.value = res.data.records.map((item) => ({ value: item.id, info: item.name }));
|
||||
|
||||
catagoryList.value[index].projectList = projectList.value
|
||||
} else {
|
||||
proxy.$modal.msgError(res.msg);
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('请求失败', error);
|
||||
});
|
||||
}
|
||||
|
||||
function remoteMethod(query, row) {
|
||||
// 所有诊疗项目列表
|
||||
const allImplementDepartmentList = ref([]);
|
||||
function getAllImplementDepartment() {
|
||||
loading.value = true;
|
||||
const params = {
|
||||
statusEnum: 2,
|
||||
activityCategoryCode: row.activityCategoryCode, // 确保已选诊疗目录
|
||||
searchKey: query, // 模糊搜索关键字
|
||||
...row,
|
||||
categoryCode: row.activityCategoryCode,
|
||||
pageSize:100,
|
||||
};
|
||||
console.log(params,row,query,'params');
|
||||
|
||||
getImplementDepartmentOne(params).then((res) => {
|
||||
getAllTreatmentList().then((res) => {
|
||||
allImplementDepartmentList.value = res.data.map((item) => ({
|
||||
value: item.activityDefinitionId,
|
||||
label: item.activityDefinitionName,
|
||||
}));
|
||||
loading.value = false;
|
||||
if (res.code === 200) {
|
||||
// 更新当前行的 projectList 数据
|
||||
row.projectList = res.data.records.map((item) => ({
|
||||
value: item.id,
|
||||
info: item.name,
|
||||
}));
|
||||
} else {
|
||||
proxy.$modal.msgError(res.msg);
|
||||
}
|
||||
});
|
||||
loading.value = false;
|
||||
|
||||
}
|
||||
|
||||
/** 选择条数 */
|
||||
function handleSelectionChange(selection) {
|
||||
// selectedData.value = selection.map((item) => ({ ...item })); // 存储选择的行数据
|
||||
ids.value = selection.map((item) => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
@@ -317,13 +259,18 @@ function handleAddItem() {
|
||||
return;
|
||||
}
|
||||
const newRow = {
|
||||
startTime:'00:00:00',
|
||||
endTime:'23:59:59'
|
||||
startTime: '00:00:00',
|
||||
endTime: '23:59:59',
|
||||
};
|
||||
catagoryList.value.push(newRow);
|
||||
total.value = organization.value.length;
|
||||
data.isAdding = true; // 设置标志位为 true,表示有未保存的
|
||||
}
|
||||
// 批量添加
|
||||
function handleBacthAddItem() {
|
||||
// 批量添加显示对话框
|
||||
bacthAddItemDialogVisible.value = true;
|
||||
}
|
||||
// 检验 编辑或 保存数据
|
||||
function handleBlur(row, index) {
|
||||
let hasError = false;
|
||||
@@ -336,8 +283,7 @@ function handleBlur(row, index) {
|
||||
if (message) {
|
||||
proxy.$message.error(message);
|
||||
} else {
|
||||
console.error(`No rule defined for field: ${field}`);
|
||||
proxy.$message.error(`No rule defined for field: ${field}`);
|
||||
proxy.$message.error(`检验未通过`);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -357,6 +303,7 @@ function openSaveImplementDepartment(row) {
|
||||
handleBlur(row);
|
||||
if (row.error) {
|
||||
hasError = true;
|
||||
return;
|
||||
}
|
||||
const startTime = params.startTime;
|
||||
const endTime = params.endTime;
|
||||
@@ -383,22 +330,22 @@ function openSaveImplementDepartment(row) {
|
||||
}
|
||||
// 删除当前所选行
|
||||
function deleteSelectedRows(row) {
|
||||
if (row.id) {
|
||||
deleteImplementDepartment({ orgLocId: row.id }).then((res) => {});
|
||||
} else {
|
||||
catagoryList.value.pop();
|
||||
}
|
||||
proxy.$modal.msgSuccess('删除成功');
|
||||
data.isAdding = false;
|
||||
getList();
|
||||
proxy.$modal.confirm('是否删除选中数据').then(() => {
|
||||
if (row.id) {
|
||||
deleteImplementDepartment({ orgLocId: row.id }).then((res) => {});
|
||||
} else {
|
||||
catagoryList.value.pop();
|
||||
}
|
||||
proxy.$modal.msgSuccess('删除成功');
|
||||
data.isAdding = false;
|
||||
getList();
|
||||
});
|
||||
}
|
||||
/** 节点单击事件 */
|
||||
function handleNodeClick(data, node) {
|
||||
catagoryList.value.map(k=>{
|
||||
if(!k.id){
|
||||
openSaveImplementDepartment(k)
|
||||
}
|
||||
})
|
||||
function handleNodeClick(res, node) {
|
||||
// 新增按钮是否 disable
|
||||
data.isAdding = false;
|
||||
|
||||
// 新增按钮是否 disable
|
||||
if (node.parent === null || node.level === 1) {
|
||||
isAddDisable.value = true;
|
||||
@@ -418,7 +365,10 @@ function handleNodeClick(data, node) {
|
||||
|
||||
/** 目录分类查询 */
|
||||
function getDiseaseTreatmentList() {
|
||||
loading.value = true;
|
||||
getDiseaseTreatmentInit().then(({ data }) => {
|
||||
loading.value = false;
|
||||
|
||||
//分类目录初始化获取
|
||||
catagoryDicts.value = data.diagnosisCategoryOptions.sort((a, b) => {
|
||||
return parseInt(a.value) - parseInt(b.value);
|
||||
@@ -431,6 +381,7 @@ function getDiseaseTreatmentList() {
|
||||
}
|
||||
// 诊疗目录分类查询下拉树结d构
|
||||
function getImplDepartList() {
|
||||
loading.value = true;
|
||||
getImplementDepartmentList().then((res) => {
|
||||
loading.value = false;
|
||||
if (res.code === 200) {
|
||||
@@ -450,8 +401,10 @@ function getImplDepartList() {
|
||||
}
|
||||
});
|
||||
}
|
||||
// 获取左侧执行科室配置目录
|
||||
getDiseaseTreatmentList();
|
||||
onMounted(() => {
|
||||
getAllImplementDepartment();
|
||||
getDiseaseTreatmentList();
|
||||
});
|
||||
</script>
|
||||
<style scoped>
|
||||
.el-form--inline .el-form-item {
|
||||
@@ -463,15 +416,4 @@ getDiseaseTreatmentList();
|
||||
.error-border {
|
||||
border: 1px solid red;
|
||||
}
|
||||
/* ::v-deep.el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content{ */
|
||||
/* background-color: #c5e1ff!important; */
|
||||
/* #d8ebff!important; */
|
||||
/* #c5e1ff!important; */
|
||||
/* #9fceff!important; */
|
||||
/* } */
|
||||
/* ::v-deep.el-tree--highlight-current{ */
|
||||
/* background-color:#f8f8f9 !important; */
|
||||
/* #ebf5ff!important; */
|
||||
/* } */
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user