yuansh 2 years ago
parent
commit
aba763d373
1 changed files with 30 additions and 29 deletions
  1. 30 29
      src/views/oa/modules/IncidentTicketModal.vue

+ 30 - 29
src/views/oa/modules/IncidentTicketModal.vue

@@ -550,17 +550,18 @@
         })
       },
       handleOk(){
-        var begin = this.accessory2.indexOf('http://220.191.168.86:18087/jeecg-boot/sys/common/static/')
-        if(this.accessory2.length!==0&&this.accessory2){
-          if(begin==0){
-            this.formState.accessory2 = [{"type":"file","name":this.accessory2,"status":"done","uid":1673507319016,"url":this.accessory2}]
+        
+          if(this.accessory2.length!==0&&this.accessory2){
+            var begin = this.accessory2.toString().indexOf('http://220.191.168.86:18087/jeecg-boot/sys/common/static/')
+            if(begin == -1){
+               this.formState.accessory2 = [{"type":"file","name":this.accessory2,"status":"done","uid":1673507319016,"url":"http://220.191.168.86:18087/jeecg-boot/sys/common/static/"+this.accessory2}]
+            }else{
+               this.formState.accessory2 = [{"type":"file","name":this.accessory2,"status":"done","uid":1673507319016,"url":this.accessory2}]
+            } 
           }else{
-            this.formState.accessory2 = [{"type":"file","name":this.accessory2,"status":"done","uid":1673507319016,"url":"http://220.191.168.86:18087/jeecg-boot/sys/common/static/"+this.accessory2}]
-          } 
-        }else{
-         this.formState.accessory2=[]
-        }
-         
+           this.formState.accessory2=[]
+          }
+        
           this.formState.accessory2 = JSON.stringify(this.formState.accessory2)
           var addData = 'yes'
           this.incidentTicketChildrenTable.dataSource.every(item=>{
@@ -581,25 +582,25 @@
             }
             return true
           })
-      this.$refs.form.validate(valid => {
-        if (valid) { 
-          if(addData=='yes'){
-            var obj = this.formState
-            obj.createTime = ''
-            obj.incidentTicketChildrenList =  this.incidentTicketChildrenTable.dataSource
-            obj.invoicingDate = moment(this.formState.invoicingDate).add (1,'days')
-                putAction('/oa/incidentTicket/edit', obj).then((res) => {
-                   if(res.success){
-                      this.$message.success('编辑成功')
-                      this.handleCancel()
-                      this.$emit('close')
-                   }else{
-                       this.$message.warning(res.message)
-                     }
-                 })
-          } 
-        }
-      })
+          // this.$refs.form.validate(valid => {
+          //   if (valid) { 
+          //     if(addData=='yes'){
+          //       var obj = this.formState
+          //       obj.createTime = ''
+          //       obj.incidentTicketChildrenList =  this.incidentTicketChildrenTable.dataSource
+          //       obj.invoicingDate = moment(this.formState.invoicingDate).add (1,'days')
+          //           putAction('/oa/incidentTicket/edit', obj).then((res) => {
+          //              if(res.success){
+          //                 this.$message.success('编辑成功')
+          //                 this.handleCancel()
+          //                 this.$emit('close')
+          //              }else{
+          //                  this.$message.warning(res.message)
+          //                }
+          //            })
+          //     } 
+          //   }
+          // })
       },
       // 改变账套号
       handleChange(record,index){