优化图纸编辑功能和提交逻辑
This commit is contained in:
@ -91,6 +91,6 @@ export const view = (params: { id: string | number; projectId: string | number }
|
||||
/**
|
||||
* 编辑图纸
|
||||
*/
|
||||
export const edit = (data: TcreateReq & { projectId: number }) => {
|
||||
export const edit = (data: TcreateReq) => {
|
||||
return useDollarFetchRequest.put<IResponse<boolean>>('/prod-api/app-api/business/app/project/update', data)
|
||||
}
|
||||
|
||||
@ -99,14 +99,7 @@
|
||||
if (valid) {
|
||||
loading.value = true
|
||||
try {
|
||||
const res =
|
||||
type.value === 'add'
|
||||
? await create(form)
|
||||
: await edit({
|
||||
...form,
|
||||
id: Number(id.value),
|
||||
projectId: Number(projectId.value),
|
||||
})
|
||||
const res = type.value === 'add' ? await create(form) : await edit(form)
|
||||
if (res.code === 0) {
|
||||
// 弹窗提示
|
||||
ElMessage.success('操作成功')
|
||||
@ -148,6 +141,7 @@
|
||||
view({ id: id.value, projectId: projectId.value }).then((res) => {
|
||||
const { code, data } = res
|
||||
if (code === 0) {
|
||||
form.id = data.id
|
||||
form.isDomestic = data.isDomestic
|
||||
form.province = data.province
|
||||
form.city = data.city
|
||||
|
||||
Reference in New Issue
Block a user