|
|
|
@ -1,3 +1,8 @@
|
|
|
|
|
<!--
|
|
|
|
|
* @Description:
|
|
|
|
|
* @Author: lijj
|
|
|
|
|
* @Date: 2024-04-22 09:04:38
|
|
|
|
|
-->
|
|
|
|
|
<template>
|
|
|
|
|
<BasicModal
|
|
|
|
|
:use-wrapper="true"
|
|
|
|
@ -6,8 +11,7 @@
|
|
|
|
|
@register="registerModal"
|
|
|
|
|
@ok="handleSave"
|
|
|
|
|
>
|
|
|
|
|
{{ $attrs }}
|
|
|
|
|
<ds-form ref="FormDragRef" :content="content" />
|
|
|
|
|
<ds-form v-if="getVisible" ref="FormDragRef" :content="content" />
|
|
|
|
|
<!--右下角按钮-->
|
|
|
|
|
<template #footer>
|
|
|
|
|
<a-button
|
|
|
|
@ -48,17 +52,16 @@
|
|
|
|
|
// 声明Emits
|
|
|
|
|
const emit = defineEmits(['success', 'register'])
|
|
|
|
|
const isUpdate = ref(true)
|
|
|
|
|
const loading = ref(false)
|
|
|
|
|
const rowId = ref('')
|
|
|
|
|
const content = ref({})
|
|
|
|
|
var postData = {}
|
|
|
|
|
const FormDragRef = ref()
|
|
|
|
|
const { createMessage } = useMessage()
|
|
|
|
|
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
|
|
|
|
const [registerModal, { setModalProps, closeModal, getVisible }] = useModalInner(async (data) => {
|
|
|
|
|
setModalProps({ confirmLoading: false, loading: true })
|
|
|
|
|
isUpdate.value = !!data?.isUpdate
|
|
|
|
|
if (unref(isUpdate)) {
|
|
|
|
|
// setModalProps({ confirmLoading: true });
|
|
|
|
|
setModalProps({ confirmLoading: true });
|
|
|
|
|
rowId.value = data.record.id
|
|
|
|
|
const res: API.DataResult = await getCodeGoodsTypeInfo({ id: unref(rowId) })
|
|
|
|
|
if (res.succeeded) {
|
|
|
|
@ -87,37 +90,6 @@
|
|
|
|
|
setModalProps({ confirmLoading: false, loading: false })
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
// try {
|
|
|
|
|
// const values = await validate()
|
|
|
|
|
// console.log(values,111)
|
|
|
|
|
// setModalProps({ confirmLoading: true, loading: true })
|
|
|
|
|
// // TODO custom api
|
|
|
|
|
// console.log(values)
|
|
|
|
|
// // loading.value = true;
|
|
|
|
|
// const res: API.DataResult = await editCodeGoodsType(values)
|
|
|
|
|
// console.log(res)
|
|
|
|
|
// if (res.succeeded) {
|
|
|
|
|
// createMessage.success(res.message)
|
|
|
|
|
// emit('success')
|
|
|
|
|
// //刷新页面
|
|
|
|
|
// if (!exit) {
|
|
|
|
|
// if (unref(isUpdate)) {
|
|
|
|
|
// await refresh()
|
|
|
|
|
// } else {
|
|
|
|
|
// rowId.value = res.data
|
|
|
|
|
// isUpdate.value = true
|
|
|
|
|
// await refresh()
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// } else {
|
|
|
|
|
// createMessage.error(res.message)
|
|
|
|
|
// }
|
|
|
|
|
// ModalType.value = false
|
|
|
|
|
// exit && closeModal()
|
|
|
|
|
// } finally {
|
|
|
|
|
// // loading.value = false;
|
|
|
|
|
// setModalProps({ confirmLoading: false, loading: false })
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
async function refresh() {
|
|
|
|
|
const res: API.DataResult = await getCodeGoodsTypeInfo({ id: unref(rowId) })
|
|
|
|
|