业务订单已发货后不能再修改服用天数

- 已发货判定:履约状态已发货/已签收/已完成,或已填快递单号,或药房回传已发货(洛阳 SHIPPED/COMPLETED、甘草 20/30)
- 已发货后「修改服用参数」与订单编辑中的主方/辅方开立天数、订单服用天数不可修改(服务端拦截);次数、袋数仍可改;
  订单未单独设置天数时以处方开立天数为准,不会误判为修改
- 订单详情返回 days_locked,详情抽屉、订单列表(含 H5)编辑时禁用天数输入并提示
- 重新构建管理后台

Co-Authored-By: Claude Opus 5 <[EMAIL]>
This commit is contained in:
Your Name
2026-11-30 14:04:17 +08:00
co-authored by Claude Opus 5
parent b675822377
commit 18a0989c00
388 changed files with 438 additions and 355 deletions
@@ -964,6 +964,14 @@
:rules="patchUsageRules"
label-width="108px"
>
<el-alert
v-if="daysLocked"
type="info"
:closable="false"
show-icon
class="mb-3"
title="订单已发货,服用天数不可修改;次数、袋数仍可修改。"
/>
<div v-if="detailHasAuxHerbs" class="text-xs font-medium text-gray-500 mb-3">主方</div>
<el-form-item
v-if="detailPrescription?.prescription_type === '浓缩水丸'"
@@ -988,6 +996,7 @@
<div class="flex items-center gap-1 w-full">
<el-input-number
v-model="patchUsageForm.usage_days"
:disabled="daysLocked"
:min="1"
:max="999"
:step="1"
@@ -1022,6 +1031,7 @@
<div class="flex items-center gap-1 w-full">
<el-input-number
v-model="patchUsageForm.aux_usage_days"
:disabled="daysLocked"
:min="1"
:max="999"
:step="1"
@@ -1037,6 +1047,7 @@
<div class="flex items-center gap-1 w-full">
<el-input-number
v-model="patchUsageForm.medication_days"
:disabled="daysLocked"
:min="1"
:max="999"
:step="1"
@@ -1353,7 +1364,9 @@ const detailLinkedAppointmentChannelText = computed(() => {
const detailRxHerbs = computed(() => normalizeSlipHerbs(detailPrescription.value?.herbs))
const detailHasAuxHerbs = computed(() => prescriptionHasAuxFormula(detailPrescription.value as any))
const detailHasAuxHerbs = computed(() => prescriptionHasAuxFormula(detailPrescription.value as any))
/** 已发货的订单服用天数锁定(服务端 days_locked,同样拦截保存) */
const daysLocked = computed(() => detailData.value?.days_locked === true)
/** 详情:辅方用法(aux_usage JSON 经规范化后的对象,与处方类型一致) */
const detailAuxUsage = computed(() => {
@@ -990,6 +990,7 @@
<div class="flex items-center gap-1 w-full">
<el-input-number
v-model="editForm.medication_days"
:disabled="editDaysLocked"
:min="1"
:max="999"
:step="1"
@@ -3543,6 +3544,9 @@ async function goEditOrderNextStep() {
}
}
/** 已发货订单服用天数锁定(来自订单详情 days_locked,服务端同样拦截) */
const editDaysLocked = ref(false)
async function openEdit(row: {
id: number
creator_id?: number
@@ -3616,7 +3620,8 @@ async function openEdit(row: {
editForm.shipping_address = d.shipping_address || ''
editForm.is_follow_up = d.is_follow_up ? 1 : 0
editForm.medication_days = d.medication_days > 0 ? d.medication_days : undefined
editForm.medication_days = d.medication_days > 0 ? d.medication_days : undefined
editDaysLocked.value = d.days_locked === true
editForm.dose_count = d.dose_count > 0 ? d.dose_count : 1
editForm.dose_unit = d.dose_unit || '剂'
editForm.prev_staff = d.prev_staff || ''
@@ -1570,6 +1570,7 @@
<div class="flex items-center gap-1 w-full">
<el-input-number
v-model="editForm.medication_days"
:disabled="editDaysLocked"
:min="1"
:max="999"
:step="1"
@@ -2323,6 +2324,7 @@
<div class="flex items-center gap-1 w-full">
<el-input-number
v-model="patchUsageForm.usage_days"
:disabled="patchUsageDaysLocked"
:min="1"
:max="999"
:step="1"
@@ -2357,6 +2359,7 @@
<div class="flex items-center gap-1 w-full">
<el-input-number
v-model="patchUsageForm.aux_usage_days"
:disabled="patchUsageDaysLocked"
:min="1"
:max="999"
:step="1"
@@ -2372,6 +2375,7 @@
<div class="flex items-center gap-1 w-full">
<el-input-number
v-model="patchUsageForm.medication_days"
:disabled="patchUsageDaysLocked"
:min="1"
:max="999"
:step="1"
@@ -3784,7 +3788,9 @@ const detailLinkedAppointmentResolvedFromTag = computed(() => {
const detailRxHerbs = computed(() => normalizeSlipHerbs(detailPrescription.value?.herbs))
const detailHasAuxHerbs = computed(() => prescriptionHasAuxFormula(detailPrescription.value as any))
const detailHasAuxHerbs = computed(() => prescriptionHasAuxFormula(detailPrescription.value as any))
/** 已发货订单服用天数锁定(服务端 days_locked,同样拦截保存) */
const patchUsageDaysLocked = computed(() => detailData.value?.days_locked === true)
const detailAuxUsage = computed(() => {
const rx = detailPrescription.value as any
@@ -4520,6 +4526,9 @@ async function goEditOrderNextStep() {
}
}
/** 已发货订单服用天数锁定(来自订单详情 days_locked,服务端同样拦截) */
const editDaysLocked = ref(false)
async function openEdit(row: {
id: number
creator_id?: number
@@ -4593,7 +4602,8 @@ async function openEdit(row: {
editForm.shipping_address = d.shipping_address || ''
editForm.is_follow_up = d.is_follow_up ? 1 : 0
editForm.medication_days = d.medication_days > 0 ? d.medication_days : undefined
editForm.medication_days = d.medication_days > 0 ? d.medication_days : undefined
editDaysLocked.value = d.days_locked === true
editForm.dose_count = d.dose_count > 0 ? d.dose_count : 1
editForm.dose_unit = d.dose_unit || '剂'
editForm.prev_staff = d.prev_staff || ''