feat(shipping-notice): 增强订单文档 Profile 管理功能,新增复核与草稿管理

- 添加订单复核相关模型及 API,支持复核案例的创建、更新和确认
- 实现复核草稿的管理功能,允许用户对复核内容进行编辑和保存
- 引入复核事件审计,确保复核过程的可追溯性
- 更新数据库模型以支持复核和草稿的关系管理
- 完善相关服务逻辑,确保复核与草稿的状态管理和数据一致性
- 增强文档模板的管理能力,支持更复杂的业务场景
This commit is contained in:
hugo committed 2026-07-29 09:50:25 +08:00
1 parent 61ac6403c4
commit b7307fc573
147 files changed
+15108 -1522

No files matched your search

@@ -6,7 +6,7 @@
* 逻辑:KbWorkspaceOverlays、ChatViewOverlays、各管理端页面以 v-model 控制显隐。
*/
import { computed, onBeforeUnmount, watch } from 'vue';
import { computed, onBeforeUnmount, ref, watch } from 'vue';
import { useI18n } from 'vue-i18n';
interface Props {
@@ -18,6 +18,10 @@ interface Props {
confirmLoading?: boolean;
/** danger 用于删除;primary 用于写入等非破坏性确认 */
confirmTone?: 'danger' | 'primary';
/** 可选审计原因;开启 required 后确认前必须填写。 */
reasonLabel?: string;
reasonPlaceholder?: string;
reasonRequired?: boolean;
}
const props = withDefaults(defineProps<Props>(), {
@@ -27,15 +31,20 @@ const props = withDefaults(defineProps<Props>(), {
cancelText: '',
confirmLoading: false,
confirmTone: 'danger',
reasonLabel: '',
reasonPlaceholder: '',
reasonRequired: false,
});
const emit = defineEmits<{
(e: 'update:modelValue', value: boolean): void;
(e: 'confirm'): void;
(e: 'confirm', reason: string): void;
(e: 'cancel'): void;
}>();
const { t } = useI18n();
const reason = ref('');
const reasonMissing = ref(false);
const resolvedTitle = computed(() => props.title || t('common.deleteDialog.defaultTitle'));
const resolvedMessage = computed(() => props.message || t('common.deleteDialog.defaultMessage'));
@@ -60,7 +69,12 @@ const handleCancel = () => {
* 核心逻辑:先 emit confirm 供父级执行删除,再 closeDialog,与取消行为一致,避免仅依赖父级 v-model 时弹窗残留。
*/
const handleConfirm = () => {
emit('confirm');
const resolvedReason = reason.value.trim();
if (props.reasonRequired && !resolvedReason) {
reasonMissing.value = true;
return;
}
emit('confirm', resolvedReason);
closeDialog();
};
@@ -74,6 +88,8 @@ watch(
() => props.modelValue,
(visible) => {
if (visible) {
reason.value = '';
reasonMissing.value = false;
document.addEventListener('keydown', handleEscKey);
return;
}
@@ -108,6 +124,12 @@ onBeforeUnmount(() => {
</div>
</div>
<label v-if="reasonLabel" class="mt-5 block space-y-1.5">
<span class="label-field">{{ reasonLabel }}<span v-if="reasonRequired" class="text-red-500"> *</span></span>
<textarea v-model="reason" rows="3" class="input-field w-full resize-y" :placeholder="reasonPlaceholder" @input="reasonMissing = false" />
<span v-if="reasonMissing" class="text-xs text-red-600">{{ t('common.required') }}</span>
</label>
<div class="mt-6 flex justify-end gap-2">
<button type="button" class="btn-secondary btn-sm" @click="handleCancel">
{{ resolvedCancelText }}