[update] 联调企标收藏

This commit is contained in:
lideqin
2023-09-18 16:27:21 +08:00
parent 7048725ae4
commit ae01a27733
3 changed files with 31 additions and 11 deletions
@@ -161,6 +161,7 @@ import {
shiftStandard,
initChange,
collectStandard,
cancelCollectStandard,
shareStandard,
deleteTreeNode
} from '@api/enterpriseStandardLibraryApi'
@@ -415,15 +416,31 @@ export default {
},
// 收藏
handleCollection (record) {
const params = {}
params.id = record.id
collectStandard(params).then(res => {
if (res.success) {
this.$message.success(res.message)
} else {
this.$message.warning(res.message)
}
})
if (record.collectionFlag) {
const params = {}
params.id = record.id
// 说明已收藏,调取消收藏接口
cancelCollectStandard(params).then(res => {
if (res.success) {
this.$message.success(res.message)
this.loadData()
} else {
this.$message.warning(res.message)
}
})
} else {
const params = {}
params.standardId = record.id
params.standardNumber = record.standard_no
collectStandard(params).then(res => {
if (res.success) {
this.$message.success(res.message)
this.loadData()
} else {
this.$message.warning(res.message)
}
})
}
},
// 分享
handleShare (record) {