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