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