添加业主

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 getItem = (id) => request.basic.get(`/api/v1/customers/${id}`)
// 添加条目 // 添加条目
export const createProject = (params) => request.basic.post('/api/v1/customers', params) 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 // 更新role
export const updateItem = (id, params) => request.basic.put(`/api/v1/customers/${id}`, params) 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 { 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,Modal } 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'
@ -115,29 +115,20 @@ function handleOk() {
const params = { const params = {
...values ...values
} }
let result = null const result = await apis.customer.createHomer(params)
switch (modal.value.type) { console.log(result)
case 'create':
result = await apis.customer.createCustomer(params).catch((error) => {
console.log(error)
throw new Error(error)
})
break
}
hideLoading() hideLoading()
if (config('http.code.success') === result?.success) { if (config('http.code.success') === result?.success) {
hideModal() hideModal()
emit('ok') // emit('ok')
} }
} catch (error) { } catch (error) {
console.log(error) // console.log(error)
message.error({ content: error.detail }) // message.error({ content: error.detail })
hideLoading() hideLoading()
} }
}) })
.catch((e) => {
hideLoading()
})
} }
}) })