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 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)
|
||||
// 删除数据
|
||||
|
||||
@ -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()
|
||||
})
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user