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