|
|
|
@ -59,20 +59,20 @@
|
|
|
|
|
// 按钮loading
|
|
|
|
|
const loading = ref(false)
|
|
|
|
|
const rowId = ref('')
|
|
|
|
|
const { createMessage } = useMessage()
|
|
|
|
|
const [registerForm, { resetFields, setFieldsValue, validate, updateSchema }] =
|
|
|
|
|
useForm({
|
|
|
|
|
const { notification } = useMessage()
|
|
|
|
|
const [registerForm, { resetFields, setFieldsValue, validate, updateSchema }] = useForm({
|
|
|
|
|
labelWidth: 100,
|
|
|
|
|
schemas: formSchema,
|
|
|
|
|
showActionButtonGroup: false,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const [registerModal, { setModalProps, closeModal, updateFormField }] = useModalInner(async (data) => {
|
|
|
|
|
const [registerModal, { setModalProps, closeModal, updateFormField }] = useModalInner(
|
|
|
|
|
async (data) => {
|
|
|
|
|
resetFields()
|
|
|
|
|
setModalProps({ confirmLoading: false, loading: true })
|
|
|
|
|
isUpdate.value = !!data?.isUpdate
|
|
|
|
|
if (unref(isUpdate)) {
|
|
|
|
|
setModalProps({ confirmLoading: true });
|
|
|
|
|
setModalProps({ confirmLoading: true })
|
|
|
|
|
updateFormField(updateSchema)
|
|
|
|
|
rowId.value = data.record.id
|
|
|
|
|
const res: API.DataResult = await GetClientParamInfo({ id: unref(rowId) })
|
|
|
|
@ -84,11 +84,12 @@
|
|
|
|
|
} else {
|
|
|
|
|
setFieldsValue({
|
|
|
|
|
customerId: data.clientId,
|
|
|
|
|
customerName: data.customerName
|
|
|
|
|
customerName: data.customerName,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
setModalProps({ loading: false })
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
const getTitle = computed(() => (!unref(isUpdate) ? '新增' : '编辑'))
|
|
|
|
|
|
|
|
|
@ -100,10 +101,8 @@
|
|
|
|
|
const res: API.DataResult = await EditClientParam(values)
|
|
|
|
|
loading.value = false
|
|
|
|
|
if (res.succeeded) {
|
|
|
|
|
createMessage.success(res.message)
|
|
|
|
|
notification.success({ message: res.message, duration: 3 })
|
|
|
|
|
emit('success')
|
|
|
|
|
} else {
|
|
|
|
|
createMessage.error(res.message)
|
|
|
|
|
}
|
|
|
|
|
exit && closeModal()
|
|
|
|
|
} finally {
|
|
|
|
|