diff --git a/web-admin/src/views/crm/contract/components/ContractFormDialog.vue b/web-admin/src/views/crm/contract/components/ContractFormDialog.vue
index 14f94f048..403a38b26 100644
--- a/web-admin/src/views/crm/contract/components/ContractFormDialog.vue
+++ b/web-admin/src/views/crm/contract/components/ContractFormDialog.vue
@@ -1,13 +1,20 @@
@@ -20,9 +27,10 @@
ref="formRef"
:model="form"
:rules="rules"
- label-position="right"
- label-width="120px"
+ :label-position="isPageVariant ? 'top' : 'right'"
+ :label-width="isPageVariant ? undefined : '120px'"
class="crm-dialog-form"
+ :class="{ 'crm-dialog-form--page': isPageVariant }"
:disabled="formLoading"
>
@@ -946,18 +954,29 @@ type ExtendedContractProductForm = ContractProductForm & {
priceTiers?: PriceTierRow[]
}
-const props = defineProps<{
- visible: boolean
- editId: string | null
- /** 复制来源合同(列表选中行,含 products) */
- copySource?: ContractVO | null
-}>()
+const props = withDefaults(
+ defineProps<{
+ visible: boolean
+ editId: string | null
+ /** 复制来源合同(列表选中行,含 products) */
+ copySource?: ContractVO | null
+ /** dialog=桌面弹窗;page=小程序 WebView 全屏页 */
+ variant?: 'dialog' | 'page'
+ }>(),
+ {
+ copySource: null,
+ variant: 'dialog'
+ }
+)
const emit = defineEmits<{
'update:visible': [value: boolean]
success: []
+ 'loading-change': [loading: boolean]
}>()
+const isPageVariant = computed(() => props.variant === 'page')
+
const dialogVisible = computed({
get: () => props.visible,
set: (val) => emit('update:visible', val)
@@ -1098,12 +1117,18 @@ watch(
(visible) => {
if (visible && (props.editId || props.copySource)) {
formLoading.value = true
+ emit('loading-change', true)
} else if (!visible) {
formLoading.value = false
+ emit('loading-change', false)
}
}
)
+watch(formLoading, (loading) => {
+ if (props.visible) emit('loading-change', loading)
+})
+
// 组件引用
const formRef = ref()
const approvalDialogRef = ref()
@@ -1368,7 +1393,7 @@ const handleOpened = async () => {
resetForm()
const isEdit = !!props.editId
const isCopy = !!props.copySource
- if (isEdit || isCopy) {
+ if (isEdit || isCopy || isPageVariant.value) {
formLoading.value = true
}
try {
@@ -3024,6 +3049,32 @@ const loadSupplierList = async () => {
flex-direction: column;
}
+ &.contract-form-dialog--page {
+ :deep(.el-dialog__wrapper) {
+ top: 0 !important;
+ height: 100% !important;
+ }
+
+ :deep(.el-dialog) {
+ max-height: 100%;
+ border-radius: 0;
+ box-shadow: none;
+ }
+
+ :deep(.el-dialog__header) {
+ display: none;
+ }
+
+ :deep(.el-dialog__body) {
+ padding: 8px 12px 16px;
+ }
+
+ :deep(.el-dialog__footer) {
+ padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
+ border-top: 1px solid #e2e8f0;
+ }
+ }
+
:deep(.dialog-footer) {
display: flex;
justify-content: center;
@@ -3053,6 +3104,22 @@ const loadSupplierList = async () => {
padding: 0 4px;
}
+.crm-dialog-form--page {
+ .contract-basic-info {
+ grid-template-columns: 1fr;
+ }
+
+ :deep(.el-row) {
+ display: flex;
+ flex-direction: column;
+ }
+
+ :deep(.el-col) {
+ width: 100% !important;
+ max-width: 100% !important;
+ }
+}
+
.contract-basic-info {
display: grid;
grid-template-columns: repeat(4, minmax(0, 1fr));
diff --git a/web-admin/src/views/m/crm/contract/form.vue b/web-admin/src/views/m/crm/contract/form.vue
index 51fc3291b..b9e4eecd2 100644
--- a/web-admin/src/views/m/crm/contract/form.vue
+++ b/web-admin/src/views/m/crm/contract/form.vue
@@ -2,16 +2,159 @@
+
+
+
+
+
{{ loadingCopy.title }}
+
{{ loadingCopy.desc }}
+
+
+ {{ bootError }}
+
+
+
+