lizhenhao 2 lat temu
rodzic
commit
9ab8feaa13
1 zmienionych plików z 45 dodań i 39 usunięć
  1. 45 39
      src/views/modules/notify/NotifyForm.vue

+ 45 - 39
src/views/modules/notify/NotifyForm.vue

@@ -436,59 +436,65 @@
       },
       // 表单提交
       doSubmit () {
-        this.$refs['inputForm'].validate((valid) => {
-          if (valid) {
-            this.loading = true
-            if (this.$refs.uploadComponent.checkProgress()) {
-              this.loading = false
-              return
-            }
-            if (this.commonJS.isEmpty(this.inputForm.pluginNotifyOfficesDTOList) && this.commonJS.isEmpty(this.inputForm.pluginNotifyUserDTOList)) {
-              this.$message.error('通告范围(部门或成员),至少填写一项')
-              this.loading = false
-              throw new Error('通告范围(部门或成员),至少填写一项')
-            }
-            this.inputForm.workAttachmentDtoList = this.$refs.uploadComponent.getDataList()
-            if (this.commonJS.isNotEmpty(this.inputForm.dates)) {
-              this.inputForm.beginDate = this.inputForm.dates[0]
-              this.inputForm.endDate = this.inputForm.dates[1]
-              if (this.commonJS.isNotEmpty(this.inputForm.beginDate) && this.commonJS.isNotEmpty(this.inputForm.endDate)) {
-                if (this.inputForm.beginDate === this.inputForm.endDate) {
+        this.$confirm(`修改后会重新发起通告,确定修改数据吗?`, '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          this.$refs['inputForm'].validate((valid) => {
+            if (valid) {
+              this.loading = true
+              if (this.$refs.uploadComponent.checkProgress()) {
+                this.loading = false
+                return
+              }
+              if (this.commonJS.isEmpty(this.inputForm.pluginNotifyOfficesDTOList) && this.commonJS.isEmpty(this.inputForm.pluginNotifyUserDTOList)) {
+                this.$message.error('通告范围(部门或成员),至少填写一项')
+                this.loading = false
+                throw new Error('通告范围(部门或成员),至少填写一项')
+              }
+              this.inputForm.workAttachmentDtoList = this.$refs.uploadComponent.getDataList()
+              if (this.commonJS.isNotEmpty(this.inputForm.dates)) {
+                this.inputForm.beginDate = this.inputForm.dates[0]
+                this.inputForm.endDate = this.inputForm.dates[1]
+                if (this.commonJS.isNotEmpty(this.inputForm.beginDate) && this.commonJS.isNotEmpty(this.inputForm.endDate)) {
+                  if (this.inputForm.beginDate === this.inputForm.endDate) {
+                    if (this.inputForm.notifyType === '0') {
+                      this.$message.error('通告起止时间不可以相同')
+                      this.loading = false
+                      throw new Error('通告起止时间不可以相同')
+                    }
+                  }
+                } else {
                   if (this.inputForm.notifyType === '0') {
-                    this.$message.error('通告起止时间不可以相同')
+                    this.$message.error('请填写通告时间')
                     this.loading = false
-                    throw new Error('通告起止时间不可以相同')
+                    throw new Error('请填写通告时间')
                   }
                 }
               } else {
+                this.inputForm.beginDate = ''
+                this.inputForm.endDate = ''
                 if (this.inputForm.notifyType === '0') {
                   this.$message.error('请填写通告时间')
                   this.loading = false
                   throw new Error('请填写通告时间')
                 }
               }
-            } else {
-              this.inputForm.beginDate = ''
-              this.inputForm.endDate = ''
-              if (this.inputForm.notifyType === '0') {
-                this.$message.error('请填写通告时间')
+              if (this.commonJS.isEmpty(this.inputForm.content)) {
+                this.$message.error('请填写内容')
                 this.loading = false
-                throw new Error('请填写通告时间')
+                throw new Error('请填写内容')
               }
+              this.getEditorFilesDTOList()
+              this.notifyService.saveForm(this.inputForm).then(({data}) => {
+                this.loading = false
+                this.close()
+              }).catch(() => {
+                this.loading = false
+              })
             }
-            if (this.commonJS.isEmpty(this.inputForm.content)) {
-              this.$message.error('请填写内容')
-              this.loading = false
-              throw new Error('请填写内容')
-            }
-            this.getEditorFilesDTOList()
-            this.notifyService.saveForm(this.inputForm).then(({data}) => {
-              this.loading = false
-              this.close()
-            }).catch(() => {
-              this.loading = false
-            })
-          }
+          })
         })
       },
       close () {