This commit is contained in:
Your Name
2026-06-01 09:59:32 +08:00
parent ceb313b1a7
commit 1b746b46c0
6 changed files with 48 additions and 7 deletions
@@ -12,6 +12,12 @@
{{ assistantLogCellText(row, 'to') }}
</template>
</el-table-column>
<el-table-column label="继承" width="72" align="center">
<template #default="{ row }">
<el-tag v-if="Number(row.is_inherit) === 1" type="success" size="small"></el-tag>
<span v-else class="text-gray-400"></span>
</template>
</el-table-column>
<el-table-column label="快照·业务单创建人" min-width="130" show-overflow-tooltip>
<template #default="{ row }">
{{ relatedPoCreatorCell(row) }}
+12 -2
View File
@@ -456,6 +456,10 @@
/>
</el-select>
</el-form-item>
<el-form-item label="继承">
<el-checkbox v-model="assignForm.is_inherit">继承</el-checkbox>
<span class="text-gray-400 text-xs ml-2">勾选后写入指派记录</span>
</el-form-item>
<el-form-item v-if="assignMode === 'batch'" label="已选择">
<div class="text-gray-500">{{ batchAssignIds.length }} 条诊单记录</div>
</el-form-item>
@@ -1340,12 +1344,14 @@ const assignLoading = ref(false)
const assignMode = ref<'batch' | 'single'>('batch')
const currentRow = ref<any>(null)
const assignForm = ref({
assistant_id: null as number | null
assistant_id: null as number | null,
is_inherit: false
})
function resetAssignDialog() {
batchAssignIds.value = []
assignForm.value.assistant_id = null
assignForm.value.is_inherit = false
}
const handleSelectionChange = (selection: any[]) => {
@@ -1372,6 +1378,7 @@ const handleSingleAssign = (row: any) => {
batchAssignIds.value = []
// 确保类型一致,转换为数字
assignForm.value.assistant_id = Number(row.assistant_id) > 0 ? Number(row.assistant_id) : null
assignForm.value.is_inherit = false
assignDialogVisible.value = true
}
@@ -1384,6 +1391,7 @@ const handleBatchAssign = () => {
assignMode.value = 'batch'
currentRow.value = null
assignForm.value.assistant_id = null
assignForm.value.is_inherit = false
batchAssignIds.value = [...selectedIds.value]
assignDialogVisible.value = true
}
@@ -1400,7 +1408,8 @@ const handleConfirmAssign = async () => {
// 单独指派
await tcmDiagnosisAssign({
id: currentRow.value.id,
assistant_id: assignForm.value.assistant_id
assistant_id: assignForm.value.assistant_id,
is_inherit: assignForm.value.is_inherit ? 1 : 0
})
} else {
// 批量指派:使用打开弹窗时的 id 快照(避免弹窗内操作导致表格勾选被清空后提交为空)
@@ -1413,6 +1422,7 @@ const handleConfirmAssign = async () => {
await tcmDiagnosisAssign({
id,
assistant_id: assignForm.value.assistant_id!,
is_inherit: assignForm.value.is_inherit ? 1 : 0
})
}
selectedIds.value = []
+8 -2
View File
@@ -364,6 +364,10 @@
/>
</el-select>
</el-form-item>
<el-form-item label="继承">
<el-checkbox v-model="assignForm.is_inherit">继承</el-checkbox>
<span class="text-gray-400 text-xs ml-2">勾选后写入指派记录</span>
</el-form-item>
<el-form-item label="诊单信息">
<div class="dh5-form-tip">
<div>患者{{ currentRow?.patient_name }}</div>
@@ -1080,10 +1084,11 @@ const runAction = (cmd: string) => {
const assignDialogVisible = ref(false)
const assignLoading = ref(false)
const currentRow = ref<any>(null)
const assignForm = ref({ assistant_id: null as number | null })
const assignForm = ref({ assistant_id: null as number | null, is_inherit: false })
const handleSingleAssign = (row: any) => {
currentRow.value = row
assignForm.value.assistant_id = row.assistant_id ? Number(row.assistant_id) : null
assignForm.value.is_inherit = false
assignDialogVisible.value = true
}
const handleConfirmAssign = async () => {
@@ -1092,7 +1097,8 @@ const handleConfirmAssign = async () => {
try {
await tcmDiagnosisAssign({
id: currentRow.value.id,
assistant_id: assignForm.value.assistant_id
assistant_id: assignForm.value.assistant_id,
is_inherit: assignForm.value.is_inherit ? 1 : 0
})
assignDialogVisible.value = false
getLists()
+12 -3
View File
@@ -326,6 +326,10 @@
/>
</el-select>
</el-form-item>
<el-form-item label="继承">
<el-checkbox v-model="assignForm.is_inherit">继承</el-checkbox>
<span class="text-gray-400 text-xs ml-2">勾选后写入指派记录</span>
</el-form-item>
<el-form-item v-if="assignMode === 'batch'" label="已选择">
<div class="text-gray-500">{{ selectedIds.length }} 条诊单记录</div>
</el-form-item>
@@ -1078,7 +1082,8 @@ const assignLoading = ref(false)
const assignMode = ref<'batch' | 'single'>('batch')
const currentRow = ref<any>(null)
const assignForm = ref({
assistant_id: null as number | null
assistant_id: null as number | null,
is_inherit: false
})
const handleSelectionChange = (selection: any[]) => {
@@ -1091,6 +1096,7 @@ const handleSingleAssign = (row: any) => {
currentRow.value = row
// 确保类型一致,转换为数字
assignForm.value.assistant_id = Number(row.assistant_id) > 0 ? Number(row.assistant_id) : null
assignForm.value.is_inherit = false
assignDialogVisible.value = true
}
@@ -1103,6 +1109,7 @@ const handleBatchAssign = () => {
assignMode.value = 'batch'
currentRow.value = null
assignForm.value.assistant_id = null
assignForm.value.is_inherit = false
assignDialogVisible.value = true
}
@@ -1118,14 +1125,16 @@ const handleConfirmAssign = async () => {
// 单独指派
await tcmDiagnosisAssign({
id: currentRow.value.id,
assistant_id: assignForm.value.assistant_id
assistant_id: assignForm.value.assistant_id,
is_inherit: assignForm.value.is_inherit ? 1 : 0
})
} else {
// 批量指派
const promises = selectedIds.value.map(id =>
tcmDiagnosisAssign({
id,
assistant_id: assignForm.value.assistant_id
assistant_id: assignForm.value.assistant_id,
is_inherit: assignForm.value.is_inherit ? 1 : 0
})
)
await Promise.all(promises)
@@ -563,6 +563,7 @@ class DiagnosisLogic extends BaseLogic
try {
$id = (int) ($params['id'] ?? 0);
$toAssistantId = (int) ($params['assistant_id'] ?? 0);
$isInherit = (int) ($params['is_inherit'] ?? 0) === 1 && $toAssistantId > 0 ? 1 : 0;
if ($id <= 0) {
self::setError('诊单不存在');
@@ -623,6 +624,7 @@ class DiagnosisLogic extends BaseLogic
'ip' => (string) ($req->ip() ?? ''),
'related_po_creator_id' => $relatedPoCreatorId,
'related_po_create_time' => $relatedPoCreateTime,
'is_inherit' => $isInherit,
'create_time' => $now,
]);
} catch (\Throwable $e) {
@@ -696,6 +698,9 @@ class DiagnosisLogic extends BaseLogic
$r['related_po_create_time_text'] = $rpct > 0 ? date('Y-m-d H:i:s', $rpct) : '';
$r['related_po_is_cleared_assistant_creator'] =
($rcpId > 0 && $fromId > 0 && $rcpId === $fromId) ? 1 : 0;
$inherit = (int) ($r['is_inherit'] ?? 0);
$r['is_inherit'] = $inherit;
$r['is_inherit_text'] = $inherit === 1 ? '是' : '否';
}
unset($r);
@@ -0,0 +1,5 @@
-- 诊单指派日志:是否标记为「继承」指派(后台人工指派时可勾选)
-- 首次执行即可;若列已存在重复执行会报错,可忽略
ALTER TABLE `zyt_tcm_diagnosis_assign_log`
ADD COLUMN `is_inherit` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '是否继承指派:1=是,0=否' AFTER `related_po_create_time`;