Files
his/openhis-ui-vue3/src/views/basicmanage/implementDepartment/components/batchAddDialog.vue
zhaoyun 3e7d27ee61 fix(#591): 请修复 Bug #591:【住院医生站-临床医嘱】长期医嘱点击停嘱未弹出时间录入弹窗
根因:
- Bug #请修复 Bug #591 存在的问题

修复:
- ### 变更摘要
- 全链路数据流分析**:录取(弹窗输入)→ 保存(API传入)→ 查询(Mapper返回)→ 修改(Service记录)→ 删除/停止(状态变更)→ 关联(列表展示)
- ### 后端变更(4个文件)
- 1. `AdviceBatchOpParam.java`** — 停嘱参数添加 `stopTime` 字段
- 新增 `@JsonFormat Date stopTime`,支持前端传入停嘱时间
- 2. `RequestBaseDto.java`** — 查询DTO添加 `stopUserName`、`stopTime` 字段
- 新增 `String stopUserName`(停嘱医生姓名)
- 新增 `Date stopTime`(停嘱时间)
- 3. `AdviceManageAppServiceImpl.java`** — 停嘱Service增强
- 优先使用前端传入的 `stopTime`,兜底用当前时间
- 通过 `SecurityUtils.getNickName()` 获取当前操作用户昵称,记录到 `updateBy`
- 药品和诊疗两个更新入口均已同步修改
- 4. `AdviceManageAppMapper.xml`** — 三个UNION ALL子查询添加字段
- 药品子查询:`T1.effective_dose_end AS stop_time` + `T1.update_by AS stop_user_name`
- 耗材子查询:`NULL AS stop_time` + `'' AS stop_user_name`
- 诊疗子查询:`T1.occurrence_end_time AS stop_time` + `T1.update_by AS stop_user_name`
- ### 前端变更(1个文件)
- `order/index.vue`**:
- 1. **停嘱时间弹窗** — 点击「停嘱」后弹出 `el-dialog`,内含 `el-date-picker`(datetime类型,默认当前时间),确定后才调用API
- 2. **表格列** — 在「皮试」列后面、「诊断」列前面新增两列:
- 「停嘱医生」`prop="stopUserName"`,宽度120px
- 「停嘱时间」`prop="stopTime"`,宽度170px
- 3. **`handleStopAdvice`** — 保留原有校验(未保存/未签发/已停止检查),校验通过后弹出时间选择弹窗而非直接调API
- 4. **`confirmStopAdvice`** — 新增确认函数,将 `stopTime` 拼入请求参数后调用 `stopAdvice` API
- ### 验证结果
-  前端 Lint 检查通过(仅1个预存的 `vue/no-dupe-keys` 警告)
-  后端 Maven 编译通过(BUILD SUCCESS)
2026-05-29 00:39:28 +08:00

211 lines
5.4 KiB
Vue
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<div class="LaboratoryTests-container">
<el-dialog
title="批量导入项目"
:model-value="props.dialogVisible"
width="842"
append-to-body
destroy-on-close
:draggable="true"
@update:model-value="(val) => emit('update:dialogVisible', val)"
>
<el-row :gutter="10">
<el-col :span="24">
<el-form
ref="formEl"
:rules="rules"
:model="form"
label-width="100px"
>
<el-form-item
label="项目类型"
prop="clinicalType"
>
<el-select
v-model="form.clinicalType"
placeholder="请选择"
filterable
clearable
style="width: 200px"
@change="getList()"
>
<el-option
v-for="item in categoryCodeList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-form>
</el-col>
</el-row>
<el-row
:gutter="30"
style="margin-top: 30px"
>
<el-col :span="24">
<el-transfer
v-model="transferValue"
:data="applicationList"
filter-placeholder="项目代码/名称"
filterable
:titles="['未选择', '已选择']"
style="width: 100%"
/>
</el-col>
</el-row>
<template #footer>
<div class="dialog-footer">
<el-button @click="onCancel">
取消
</el-button>
<el-button
type="primary"
@click="onConfirm"
>
确认
</el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup name="LaboratoryTests">
import {getCurrentInstance, onMounted, reactive, ref} from 'vue';
import {addImplementDepartment, editImplementDepartment, getApplicationList,} from './implementDepartment.js';
const { proxy } = getCurrentInstance();
// 属性
const props = defineProps({
// 弹框显示信息
dialogVisible: {
type: Boolean,
default: false,
},
// 选择科室
organizationId: {
type: String,
default: '',
},
});
const emit = defineEmits(['update:dialogVisible', 'confirm', 'cancel', 'submitOk']);
// 申请项目列表
const applicationListAll = ref();
// 获取所有申请项目
const applicationList = ref();
// 申请项目列表
const transferValue = ref([]);
// 项目类型
const formEl = ref();
const form = reactive({ clinicalType: '23' });
// 加载中
const loading = ref(false);
// 弹窗显隐由父组件控制,通过 v-model 事件同步
// 项目类型
const categoryCodeList = ref([
{ label: '治疗', value: '21' },
{ label: '检验', value: '22' },
{ label: '检查', value: '23' },
{ label: '手术', value: '24' },
]);
// 规则校验
const rules = ref({
clinicalType: [{ required: true, message: '请选择项目类型', trigger: 'change' }],
});
const getList = () => {
if (!form.clinicalType) {
return;
}
loading.value = true;
getApplicationList({
pageSize: 10000,
pageNum: 1,
// 项目类型 枚举类中
categoryCode: form.clinicalType,
adviceTypes: '3', //1 药品 2耗材 3诊疗
}).then((res) => {
if (res.code === 200) {
loading.value = false;
applicationListAll.value = res.data.records;
applicationList.value = res.data.records.map((item) => {
return {
label: item.adviceName + item.adviceDefinitionId,
key: item.adviceDefinitionId,
};
});
} else {
proxy.$message.error(res.message);
applicationList.value = [];
}
});
};
function onCancel() {
emit('cancel');
emit('update:dialogVisible', false);
}
// 批量添加
async function onConfirm() {
if (!formEl.value) return;
formEl.value.validate(async (valid) => {
if (!valid) return;
if (!transferValue.value || transferValue.value.length === 0) {
proxy.$message.error('请选择至少一个项目');
return;
}
const requests = (transferValue.value || []).map((defId) => {
const params = {
// 诊疗定义id
activityDefinitionId: defId,
// 科室ID
organizationId: props.organizationId,
// 诊疗类型
activityCategoryCode: form.clinicalType,
// 开始时间
startTime: '00:00:00',
// 结束时间
endTime: '23:59:59',
/*
方法类别DistributionCategoryCodeEnum 枚举
desription: 8代表诊疗
*/
distributionCategoryCode: '8',
};
return handleSave(params);
});
await Promise.all(requests);
emit('submitOk');
emit('update:dialogVisible', false);
transferValue.value = [];
});
}
// 保存
async function handleSave(params) {
if (params.id) {
return editImplementDepartment(params).then((res) => {
proxy.$modal.msgSuccess('保存成功!');
return res;
});
} else {
delete params.id;
return addImplementDepartment(params).then((res) => {
proxy.$modal.msgSuccess('保存成功!');
return res;
});
}
}
onMounted(() => {
getList();
});
</script>
<style lang="scss" scoped>
:deep(.el-transfer-panel) {
width: 300px;
}
</style>