提交编辑接口
This commit is contained in:
parent
5685943ff9
commit
0f7d76a462
|
|
@ -16,6 +16,10 @@ export const getDetailApi = (id: any) => {
|
||||||
export const equipmentAddApi = (data: any) => {
|
export const equipmentAddApi = (data: any) => {
|
||||||
return post('/material-mall/dev', data)
|
return post('/material-mall/dev', data)
|
||||||
}
|
}
|
||||||
|
// 编辑装备
|
||||||
|
export const equipmentEditApi = (data: any) => {
|
||||||
|
return post('/material-mall/dev/edit', data)
|
||||||
|
}
|
||||||
|
|
||||||
// 保存草稿
|
// 保存草稿
|
||||||
export const insertDraftApi = (data: any) => {
|
export const insertDraftApi = (data: any) => {
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ import {
|
||||||
getEquipmentListApi, //列表
|
getEquipmentListApi, //列表
|
||||||
getDetailApi, //详情
|
getDetailApi, //详情
|
||||||
equipmentAddApi, //新增
|
equipmentAddApi, //新增
|
||||||
|
equipmentEditApi, //编辑
|
||||||
insertDraftApi, //草稿(编辑)
|
insertDraftApi, //草稿(编辑)
|
||||||
removeDeviceApi, //删除
|
removeDeviceApi, //删除
|
||||||
updateUpDownApi, //上下架
|
updateUpDownApi, //上下架
|
||||||
|
|
@ -474,16 +475,28 @@ const submitBtn = () => {
|
||||||
insurancePdf: insurancePdf.value, //合格证
|
insurancePdf: insurancePdf.value, //合格证
|
||||||
examinationPdf: examinationPdf.value, //检测证明
|
examinationPdf: examinationPdf.value, //检测证明
|
||||||
}
|
}
|
||||||
const res: any = await equipmentAddApi(param)
|
if(equipmentDeploymentParams.value.maId&&equipmentDeploymentParams.value.maId!=""){
|
||||||
if (res.code === 200) {
|
const res: any = await equipmentEditApi(param)
|
||||||
ElMessage({
|
if (res.code === 200) {
|
||||||
type: 'success',
|
ElMessage({
|
||||||
message: '保存成功',
|
type: 'success',
|
||||||
})
|
message: '保存成功',
|
||||||
dialogFormVisibleSettlein.value = false
|
})
|
||||||
// ruleFormRef.value.resetField()
|
dialogFormVisibleSettlein.value = false
|
||||||
getList()
|
getList()
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
const res: any = await equipmentAddApi(param)
|
||||||
|
if (res.code === 200) {
|
||||||
|
ElMessage({
|
||||||
|
type: 'success',
|
||||||
|
message: '保存成功',
|
||||||
|
})
|
||||||
|
dialogFormVisibleSettlein.value = false
|
||||||
|
getList()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue