|
|
@@ -486,26 +486,7 @@
|
|
|
})
|
|
|
|
|
|
// if(!id){
|
|
|
- createSuperviseTask({ reportContent, attachmentUrls, projectId })
|
|
|
- .then((res) => {
|
|
|
- if (res && Number(res.code) === 200) {
|
|
|
- this.$message.success('提交成功')
|
|
|
- this.isReport = false
|
|
|
- this.reportForm = { content: '', uploadUrl: [] }
|
|
|
- this.currentTask = null
|
|
|
- this.generateTableData()
|
|
|
- } else {
|
|
|
- this.$message.error((res && res.message) || '提交失败')
|
|
|
- }
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- this.$message.error('提交失败')
|
|
|
- })
|
|
|
- .finally(() => {
|
|
|
- loading && loading.close && loading.close()
|
|
|
- })
|
|
|
- // }else{
|
|
|
- // updateSuperviseTask({ id, reportContent, attachmentUrls, projectId })
|
|
|
+ // createSuperviseTask({ reportContent, attachmentUrls, projectId })
|
|
|
// .then((res) => {
|
|
|
// if (res && Number(res.code) === 200) {
|
|
|
// this.$message.success('提交成功')
|
|
|
@@ -523,6 +504,25 @@
|
|
|
// .finally(() => {
|
|
|
// loading && loading.close && loading.close()
|
|
|
// })
|
|
|
+ // // }else{
|
|
|
+ updateSuperviseTask({ id, reportContent, attachmentUrls, projectId })
|
|
|
+ .then((res) => {
|
|
|
+ if (res && Number(res.code) === 200) {
|
|
|
+ this.$message.success('提交成功')
|
|
|
+ this.isReport = false
|
|
|
+ this.reportForm = { content: '', uploadUrl: [] }
|
|
|
+ this.currentTask = null
|
|
|
+ this.generateTableData()
|
|
|
+ } else {
|
|
|
+ this.$message.error((res && res.message) || '提交失败')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.$message.error('提交失败')
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ loading && loading.close && loading.close()
|
|
|
+ })
|
|
|
// }
|
|
|
},
|
|
|
handleCancel() {
|