添加业主

This commit is contained in:
Leo_Ding 2025-09-03 16:10:29 +08:00
parent bd5916b97e
commit 16fb5d9cdf
2 changed files with 8 additions and 16 deletions

View File

@ -8,6 +8,7 @@ export const getProjectList = (params) => request.basic.get('/api/v1/customers',
export const getItem = (id) => request.basic.get(`/api/v1/customers/${id}`)
// 添加条目
export const createProject = (params) => request.basic.post('/api/v1/customers', params)
export const createHomer = (params) => request.basic.post('/api/v1/customers/up_lv', params)
// 更新role
export const updateItem = (id, params) => request.basic.put(`/api/v1/customers/${id}`, params)
// 删除数据

View File

@ -40,7 +40,7 @@ import { ref, onBeforeMount } from 'vue'
import { config } from '@/config'
import apis from '@/apis'
import { useForm, useModal, useSpining } from '@/hooks'
import { message,Modal } 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'
@ -115,29 +115,20 @@ function handleOk() {
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
}
const result = await apis.customer.createHomer(params)
console.log(result)
hideLoading()
if (config('http.code.success') === result?.success) {
hideModal()
emit('ok')
// emit('ok')
}
} catch (error) {
console.log(error)
message.error({ content: error.detail })
// console.log(error)
// message.error({ content: error.detail })
hideLoading()
}
})
.catch((e) => {
hideLoading()
})
}
})