|
|
|
|
@ -1,5 +1,11 @@
|
|
|
|
|
<template>
|
|
|
|
|
<Dialog :title="dialogTitle" v-model="dialogVisible" width="1280px" @closed="handleDialogClosed">
|
|
|
|
|
<div class="dv-repair-panel">
|
|
|
|
|
<div class="dv-repair-panel__header">
|
|
|
|
|
<div class="dv-repair-panel__title">{{ dialogTitle }}</div>
|
|
|
|
|
<el-button text @click="closeForm">
|
|
|
|
|
<Icon icon="ep:close" />
|
|
|
|
|
</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="dv-repair-dialog" v-loading="formLoading">
|
|
|
|
|
<el-form ref="formRef" :model="formData" :rules="formRules" label-width="100px">
|
|
|
|
|
<section class="dv-repair-section">
|
|
|
|
|
@ -362,15 +368,13 @@
|
|
|
|
|
-->
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<template #footer>
|
|
|
|
|
<div class="dv-repair-footer">
|
|
|
|
|
<el-button @click="dialogVisible = false">{{ t('common.cancel') }}</el-button>
|
|
|
|
|
<el-button v-if="!isDetailMode" @click="submitForm" type="primary" :disabled="formLoading">
|
|
|
|
|
{{ submitButtonText }}
|
|
|
|
|
</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</Dialog>
|
|
|
|
|
<div class="dv-repair-footer">
|
|
|
|
|
<el-button @click="closeForm">{{ t('common.cancel') }}</el-button>
|
|
|
|
|
<el-button v-if="!isDetailMode" @click="submitForm" type="primary" :disabled="formLoading">
|
|
|
|
|
{{ submitButtonText }}
|
|
|
|
|
</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
@ -436,7 +440,6 @@ const createDefaultFormData = (): DvRepairFormData => ({
|
|
|
|
|
isCode: true
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const dialogVisible = ref(false)
|
|
|
|
|
const dialogTitle = ref('')
|
|
|
|
|
const formLoading = ref(false)
|
|
|
|
|
const formType = ref<RepairFormType>('')
|
|
|
|
|
@ -793,7 +796,6 @@ let openRequestId = 0
|
|
|
|
|
|
|
|
|
|
const open = async (type: string, id?: number) => {
|
|
|
|
|
const currentOpenId = ++openRequestId
|
|
|
|
|
dialogVisible.value = true
|
|
|
|
|
dialogTitle.value = type === 'repair' ? '维修处理结果' : t('action.' + type)
|
|
|
|
|
formType.value = type as RepairFormType
|
|
|
|
|
resetForm()
|
|
|
|
|
@ -860,7 +862,7 @@ const open = async (type: string, id?: number) => {
|
|
|
|
|
|
|
|
|
|
defineExpose({ open })
|
|
|
|
|
|
|
|
|
|
const handleDialogClosed = () => {
|
|
|
|
|
const closeForm = () => {
|
|
|
|
|
openRequestId++
|
|
|
|
|
emit('closed')
|
|
|
|
|
}
|
|
|
|
|
@ -930,8 +932,8 @@ const submitForm = async () => {
|
|
|
|
|
message.success(t('common.updateSuccess'))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
dialogVisible.value = false
|
|
|
|
|
emit('success')
|
|
|
|
|
closeForm()
|
|
|
|
|
} finally {
|
|
|
|
|
formLoading.value = false
|
|
|
|
|
}
|
|
|
|
|
@ -947,9 +949,30 @@ const resetForm = () => {
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
.dv-repair-panel {
|
|
|
|
|
background: #fff;
|
|
|
|
|
border-radius: 12px;
|
|
|
|
|
box-shadow: var(--el-box-shadow-light);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.dv-repair-panel__header {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
padding: 16px 20px;
|
|
|
|
|
border-bottom: 1px solid #ebeef5;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.dv-repair-panel__title {
|
|
|
|
|
color: #1f2937;
|
|
|
|
|
font-size: 18px;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.dv-repair-dialog {
|
|
|
|
|
max-height: 72vh;
|
|
|
|
|
padding-right: 4px;
|
|
|
|
|
max-height: calc(100vh - 220px);
|
|
|
|
|
padding: 20px 20px 0;
|
|
|
|
|
padding-right: 16px;
|
|
|
|
|
overflow-y: auto;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -1015,6 +1038,8 @@ const resetForm = () => {
|
|
|
|
|
justify-content: flex-end;
|
|
|
|
|
gap: 12px;
|
|
|
|
|
width: 100%;
|
|
|
|
|
padding: 16px 20px 20px;
|
|
|
|
|
border-top: 1px solid #ebeef5;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@media (max-width: 1200px) {
|
|
|
|
|
@ -1023,4 +1048,20 @@ const resetForm = () => {
|
|
|
|
|
flex: 0 0 100%;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@media (max-width: 768px) {
|
|
|
|
|
.dv-repair-panel__header {
|
|
|
|
|
padding: 14px 16px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.dv-repair-dialog {
|
|
|
|
|
max-height: none;
|
|
|
|
|
padding: 16px 16px 0;
|
|
|
|
|
overflow-y: visible;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.dv-repair-footer {
|
|
|
|
|
padding: 16px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
|