This commit is contained in:
Leo_Ding 2025-09-02 19:35:22 +08:00
parent a71957bfe8
commit bd5916b97e
2 changed files with 40 additions and 33 deletions

View File

@ -22,8 +22,7 @@
<a-col :span="24"> <a-col :span="24">
<a-form-item :label="'添加原因'" name="reason"> <a-form-item :label="'添加原因'" name="reason">
<a-textarea v-model:value="formData.reason" placeholder="输入原因" <a-textarea v-model:value="formData.reason" placeholder="输入原因" auto-size />
auto-size />
</a-form-item> </a-form-item>
</a-col> </a-col>
@ -41,7 +40,7 @@ import { ref, onBeforeMount } from 'vue'
import { config } from '@/config' import { config } from '@/config'
import apis from '@/apis' import apis from '@/apis'
import { useForm, useModal, useSpining } from '@/hooks' import { useForm, useModal, useSpining } from '@/hooks'
import { message } from 'ant-design-vue' import { message,Modal } from 'ant-design-vue'
import { useI18n } from 'vue-i18n' import { useI18n } from 'vue-i18n'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import GxUpload from '@/components/GxUpload/index.vue' import GxUpload from '@/components/GxUpload/index.vue'
@ -105,35 +104,43 @@ const uploadSuccess = (data) => {
* 确定 * 确定
*/ */
function handleOk() { function handleOk() {
formRef.value.validateFields().then(async (values) => { Modal.confirm({
try { title: '即将添加业主,是否继续',
showLoading() content: t('button.confirm'),
const params = { okText: t('button.confirm'),
...values onOk: () => {
} formRef.value.validateFields().then(async (values) => {
let result = null try {
switch (modal.value.type) { showLoading()
case 'create': const params = {
result = await apis.customer.createCustomer(params).catch((error) => { ...values
console.log(error) }
throw new Error(error) let result = null
}) switch (modal.value.type) {
break case 'create':
} result = await apis.customer.createCustomer(params).catch((error) => {
hideLoading() console.log(error)
if (config('http.code.success') === result?.success) { throw new Error(error)
hideModal() })
emit('ok') break
} }
} catch (error) { hideLoading()
console.log(error) if (config('http.code.success') === result?.success) {
message.error({ content: error.detail }) hideModal()
hideLoading() emit('ok')
}
} catch (error) {
console.log(error)
message.error({ content: error.detail })
hideLoading()
}
})
.catch((e) => {
hideLoading()
})
} }
}) })
.catch((e) => {
hideLoading()
})
} }

View File

@ -39,13 +39,13 @@
<a-col flex="auto"> <a-col flex="auto">
<a-card type="flex"> <a-card type="flex">
<x-action-bar class="mb-8-2"> <x-action-bar class="mb-8-2">
<a-button type="primary" @click="$refs.editDialogRef.handleCreate()"> <!-- <a-button type="primary" @click="$refs.editDialogRef.handleCreate()">
<template #icon> <template #icon>
<plus-outlined></plus-outlined> <plus-outlined></plus-outlined>
</template> </template>
新增客户 新增客户
</a-button> </a-button> -->
<a-button type="primary" @click="$refs.homerDialogRef.handleCreate()" style="margin-left: 10px;"> <a-button type="primary" @click="$refs.homerDialogRef.handleCreate()" >
<template #icon> <template #icon>
<plus-outlined></plus-outlined> <plus-outlined></plus-outlined>
</template> </template>