[add] 接口对接

This commit is contained in:
zhaomeijing
2022-05-12 14:29:41 +08:00
parent 9b3f5dcd72
commit d2148b9b31
3 changed files with 27 additions and 57 deletions
@@ -97,7 +97,7 @@ export default {
},
{
title: this.$t('areaOfResponsibility'),
dataIndex: 'dutyTerritory',
dataIndex: 'dutyTerritory_dictText',
align: 'center',
ellipsis: true
}
@@ -181,63 +181,30 @@ export default {
handleSubmit() {
if (this.selectedRowKeys.length == 0) {
this.$message.warning(this.$t('pleaseSelectData'))
} else if (this.selectedRowKeys.length > 1) {
this.$message.warning(this.$t('OnlyOneSelected'))
} else {
this.$refs.ruleForm.validate(valid => {
if (valid) {
this.flag = true
this.spinLoading = true
// 新增編輯之前 判断 标题唯一
getAction(`params/manifest/verifyTitle?projectId=${this.$route.query.id}
&title=${this.templatetitle}`, {})
.then(res => {
if (res.success) {
let postDate = {
title: this.templatetitle,
paramsTemplateId: this.rowId || this.selectedRowKeysDate[0].id,
paramsTemplatePublishVersion: this.version || this.selectedRowKeysDate[0].version,
projectId: this.projectId
}
if (this.rowId) {
//编辑
postAction(`params/manifest/edit`, postDate).then(res => {
if (res.success) {
this.newVisible = false
this.$emit('areaVisible', false)
this.$message.success(this.$t('OperationSuccessful'))
} else {
this.$message.warning(res.message)
}
}
).finally(() => {
this.flag = false
this.spinLoading = false
this.newVisible = false
})
//新增
let postDate = {
paramsInfoPublishEOList: this.selectedRowKeysDate,
paramsManifestId: this.paramsManifest.id,
projectId: this.$route.query.id
}
postAction(`params/collectManifest/add`, postDate).then(res => {
if (res.success) {
this.newVisible = false
this.$message.success(this.$t('OperationSuccessful'))
} else {
//新增
postAction(`params/manifest/add`, postDate).then(res => {
if (res.success) {
this.newVisible = false
this.$emit('areaVisible', false)
this.$message.success(this.$t('OperationSuccessful'))
} else {
this.$message.warning(res.message)
}
}
).finally(() => {
this.flag = false
this.spinLoading = false
this.newVisible = false
})
this.$message.warning(res.message)
}
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
})
).finally(() => {
this.flag = false
this.spinLoading = false
this.newVisible = false
})
} else {
return false
}