2025-03-21 10:15:35 +08:00
|
|
|
<template>
|
2026-01-20 11:12:49 +08:00
|
|
|
|
|
|
|
|
<a-drawer :title="title" :width="width" v-model:visible="visible" :closable="true"
|
|
|
|
|
:footer-style="{ textAlign: 'right' }" :bodyStyle="{ padding: '14px' }" @close="handleCancel">
|
|
|
|
|
<ConfigSuppliersInfoForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></ConfigSuppliersInfoForm>
|
|
|
|
|
<template #footer>
|
|
|
|
|
<a-button type="primary" style="margin-right: 8px" @click="handleCancel">关闭</a-button>
|
|
|
|
|
<a-button type="primary" @click="handleOk" v-if="!disableSubmit">确认</a-button>
|
|
|
|
|
</template>
|
|
|
|
|
</a-drawer>
|
2025-03-21 10:15:35 +08:00
|
|
|
</template>
|
2026-01-20 11:12:49 +08:00
|
|
|
|
2025-03-21 10:15:35 +08:00
|
|
|
<script lang="ts" setup>
|
2026-01-20 11:12:49 +08:00
|
|
|
import { ref, nextTick, defineExpose } from 'vue';
|
|
|
|
|
import ConfigSuppliersInfoForm from './ConfigSuppliersInfoForm.vue'
|
|
|
|
|
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
|
|
|
|
|
|
|
|
|
|
const title = ref<string>('');
|
|
|
|
|
const width = ref<string>('800');
|
|
|
|
|
const visible = ref<boolean>(false);
|
|
|
|
|
const disableSubmit = ref<boolean>(false);
|
|
|
|
|
const registerForm = ref();
|
|
|
|
|
const emit = defineEmits(['register', 'success']);
|
2025-03-21 10:15:35 +08:00
|
|
|
|
2026-01-20 11:12:49 +08:00
|
|
|
/**
|
|
|
|
|
* 新增
|
|
|
|
|
*/
|
|
|
|
|
function add() {
|
|
|
|
|
title.value = '新增';
|
|
|
|
|
visible.value = true;
|
|
|
|
|
nextTick(() => {
|
|
|
|
|
registerForm.value.add();
|
2025-03-21 10:15:35 +08:00
|
|
|
});
|
2026-01-20 11:12:49 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 编辑
|
|
|
|
|
* @param record
|
|
|
|
|
*/
|
|
|
|
|
function edit(record) {
|
|
|
|
|
title.value = disableSubmit.value ? '详情' : '编辑';
|
|
|
|
|
visible.value = true;
|
|
|
|
|
nextTick(() => {
|
|
|
|
|
registerForm.value.edit(record);
|
2025-03-21 10:15:35 +08:00
|
|
|
});
|
2026-01-20 11:12:49 +08:00
|
|
|
}
|
2025-03-21 10:15:35 +08:00
|
|
|
|
2026-01-20 11:12:49 +08:00
|
|
|
/**
|
|
|
|
|
* 确定按钮点击事件
|
|
|
|
|
*/
|
|
|
|
|
function handleOk() {
|
|
|
|
|
registerForm.value.submitForm();
|
|
|
|
|
}
|
2025-10-31 16:35:32 +08:00
|
|
|
|
2026-01-20 11:12:49 +08:00
|
|
|
/**
|
|
|
|
|
* form保存回调事件
|
|
|
|
|
*/
|
|
|
|
|
function submitCallback() {
|
|
|
|
|
console.log("🚀 ~ submitCallback ~ submitCallback:")
|
|
|
|
|
handleCancel();
|
|
|
|
|
emit('success');
|
2025-10-31 16:35:32 +08:00
|
|
|
}
|
|
|
|
|
|
2026-01-20 11:12:49 +08:00
|
|
|
/**
|
|
|
|
|
* 取消按钮回调事件
|
|
|
|
|
*/
|
|
|
|
|
function handleCancel() {
|
|
|
|
|
visible.value = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
defineExpose({
|
|
|
|
|
add,
|
|
|
|
|
edit,
|
|
|
|
|
disableSubmit,
|
|
|
|
|
});
|
|
|
|
|
</script>
|
2025-10-31 16:35:32 +08:00
|
|
|
|
2026-01-20 11:12:49 +08:00
|
|
|
<style lang="less">
|
|
|
|
|
/**隐藏样式-modal确定按钮 */
|
|
|
|
|
.jee-hidden {
|
|
|
|
|
display: none !important;
|
2025-10-31 16:35:32 +08:00
|
|
|
}
|
|
|
|
|
</style>
|
2026-01-20 11:12:49 +08:00
|
|
|
<style lang="less" scoped></style>
|