generated from Leo_Ding/web-template
添加业主
This commit is contained in:
parent
bd5916b97e
commit
16fb5d9cdf
@ -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)
|
||||||
// 删除数据
|
// 删除数据
|
||||||
|
|||||||
@ -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()
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user