|
|
|
|
@ -1,13 +1,18 @@
|
|
|
|
|
<template>
|
|
|
|
|
<Dialog :title="dialogTitle" v-model="dialogVisible" width="920px">
|
|
|
|
|
<el-form
|
|
|
|
|
ref="formRef"
|
|
|
|
|
:model="formData"
|
|
|
|
|
:rules="formRules"
|
|
|
|
|
label-width="110px"
|
|
|
|
|
v-loading="formLoading || fileUploading"
|
|
|
|
|
element-loading-text="资料上传中,请稍候"
|
|
|
|
|
>
|
|
|
|
|
<div class="device-ledger-panel">
|
|
|
|
|
<div class="device-ledger-panel__header">
|
|
|
|
|
<div class="device-ledger-panel__title">{{ dialogTitle }}</div>
|
|
|
|
|
<el-button text @click="closeForm">
|
|
|
|
|
<Icon icon="ep:close" />
|
|
|
|
|
</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="device-ledger-dialog" v-loading="formLoading || fileUploading" element-loading-text="资料上传中,请稍候">
|
|
|
|
|
<el-form
|
|
|
|
|
ref="formRef"
|
|
|
|
|
:model="formData"
|
|
|
|
|
:rules="formRules"
|
|
|
|
|
label-width="110px"
|
|
|
|
|
>
|
|
|
|
|
<el-row :gutter="16">
|
|
|
|
|
<!-- <el-col :span="24">
|
|
|
|
|
<el-form-item label="资产编号" prop="id">
|
|
|
|
|
@ -238,12 +243,13 @@
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
</el-form>
|
|
|
|
|
<template #footer>
|
|
|
|
|
</el-form>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="device-ledger-footer">
|
|
|
|
|
<el-button @click="closeForm">{{ t('common.cancel') }}</el-button>
|
|
|
|
|
<el-button @click="submitForm" type="primary" :disabled="formLoading || fileUploading">{{ t('common.ok') }}</el-button>
|
|
|
|
|
<el-button @click="dialogVisible = false">{{ t('common.cancel') }}</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</Dialog>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<el-dialog v-model="criticalComponentDialogVisible" :title="t('EquipmentManagement.EquipmentLedger.gjTitle')" width="1200px" class="device-ledger-transfer-dialog"
|
|
|
|
|
append-to-body>
|
|
|
|
|
@ -395,7 +401,6 @@ const total = ref(0)
|
|
|
|
|
const bjTotal = ref(0)
|
|
|
|
|
const selectedIds = ref<number[]>([])
|
|
|
|
|
const bjSelectedIds = ref<number[]>([])
|
|
|
|
|
const dialogVisible = ref(false) // 弹窗的是否展示
|
|
|
|
|
const dialogTitle = ref('') // 弹窗的标题
|
|
|
|
|
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
|
|
|
|
const fileUploading = ref(false)
|
|
|
|
|
@ -744,7 +749,6 @@ const ensureOptionsLoaded = async () => {
|
|
|
|
|
|
|
|
|
|
/** 打开弹窗 */
|
|
|
|
|
const open = async (type: string, id?: number, defaultDeviceTypeId?: number, defaultDeviceLineId?: number) => {
|
|
|
|
|
dialogVisible.value = true
|
|
|
|
|
dialogTitle.value = t('action.' + type)
|
|
|
|
|
formType.value = type
|
|
|
|
|
resetForm()
|
|
|
|
|
@ -992,7 +996,7 @@ const bjToggleSelection = () => {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 提交表单 */
|
|
|
|
|
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
|
|
|
|
const emit = defineEmits(['success', 'closed']) // 定义 success 和 closed 事件
|
|
|
|
|
const submitForm = async () => {
|
|
|
|
|
if (fileUploading.value) {
|
|
|
|
|
message.warning('资料上传中,请等待上传完成后再提交')
|
|
|
|
|
@ -1027,7 +1031,7 @@ const submitForm = async () => {
|
|
|
|
|
await DeviceLedgerApi.updateDeviceLedger(data)
|
|
|
|
|
message.success(t('common.updateSuccess'))
|
|
|
|
|
}
|
|
|
|
|
dialogVisible.value = false
|
|
|
|
|
closeForm()
|
|
|
|
|
// 发送操作成功的事件
|
|
|
|
|
emit('success')
|
|
|
|
|
} finally {
|
|
|
|
|
@ -1108,6 +1112,10 @@ const setBJDefaultSelections = () => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const closeForm = () => {
|
|
|
|
|
emit('closed')
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 重置表单 */
|
|
|
|
|
const resetForm = () => {
|
|
|
|
|
fileUploading.value = false
|
|
|
|
|
@ -1183,4 +1191,56 @@ const resetForm = () => {
|
|
|
|
|
.no-select-all :deep(.el-table__header-wrapper .el-checkbox) {
|
|
|
|
|
display: none;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.device-ledger-panel {
|
|
|
|
|
background: #fff;
|
|
|
|
|
border-radius: 12px;
|
|
|
|
|
box-shadow: var(--el-box-shadow-light);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.device-ledger-panel__header {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
padding: 16px 20px;
|
|
|
|
|
border-bottom: 1px solid #ebeef5;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.device-ledger-panel__title {
|
|
|
|
|
color: #1f2937;
|
|
|
|
|
font-size: 18px;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.device-ledger-dialog {
|
|
|
|
|
max-height: calc(100vh - 220px);
|
|
|
|
|
padding: 20px 20px 0;
|
|
|
|
|
padding-right: 16px;
|
|
|
|
|
overflow-y: auto;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.device-ledger-footer {
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: flex-end;
|
|
|
|
|
gap: 12px;
|
|
|
|
|
width: 100%;
|
|
|
|
|
padding: 16px 20px 20px;
|
|
|
|
|
border-top: 1px solid #ebeef5;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@media (max-width: 768px) {
|
|
|
|
|
.device-ledger-panel__header {
|
|
|
|
|
padding: 14px 16px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.device-ledger-dialog {
|
|
|
|
|
max-height: none;
|
|
|
|
|
padding: 16px 16px 0;
|
|
|
|
|
overflow-y: visible;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.device-ledger-footer {
|
|
|
|
|
padding: 16px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
|