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-form-item :label="'添加原因'" name="reason">
<a-textarea v-model:value="formData.reason" placeholder="输入原因"
auto-size />
<a-textarea v-model:value="formData.reason" placeholder="输入原因" auto-size />
</a-form-item>
</a-col>
@ -41,7 +40,7 @@ import { ref, onBeforeMount } from 'vue'
import { config } from '@/config'
import apis from '@/apis'
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 dayjs from 'dayjs'
import GxUpload from '@/components/GxUpload/index.vue'
@ -105,35 +104,43 @@ const uploadSuccess = (data) => {
* 确定
*/
function handleOk() {
formRef.value.validateFields().then(async (values) => {
try {
showLoading()
const params = {
...values
}
let result = null
switch (modal.value.type) {
case 'create':
result = await apis.customer.createCustomer(params).catch((error) => {
console.log(error)
throw new Error(error)
})
break
}
hideLoading()
if (config('http.code.success') === result?.success) {
hideModal()
emit('ok')
}
} catch (error) {
console.log(error)
message.error({ content: error.detail })
hideLoading()
Modal.confirm({
title: '即将添加业主,是否继续',
content: t('button.confirm'),
okText: t('button.confirm'),
onOk: () => {
formRef.value.validateFields().then(async (values) => {
try {
showLoading()
const params = {
...values
}
let result = null
switch (modal.value.type) {
case 'create':
result = await apis.customer.createCustomer(params).catch((error) => {
console.log(error)
throw new Error(error)
})
break
}
hideLoading()
if (config('http.code.success') === result?.success) {
hideModal()
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-card type="flex">
<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>
<plus-outlined></plus-outlined>
</template>
新增客户
</a-button>
<a-button type="primary" @click="$refs.homerDialogRef.handleCreate()" style="margin-left: 10px;">
</a-button> -->
<a-button type="primary" @click="$refs.homerDialogRef.handleCreate()" >
<template #icon>
<plus-outlined></plus-outlined>
</template>