qinhouyu il y a 1 an
Parent
commit
b7fed5c1e5

+ 8 - 14
src/views/zdsz/engineeringDangerous/index.vue

@@ -594,13 +594,10 @@ export default {
         if (valid) {
           this.buttonLoading = true;
           if (this.form.id != null) {
-            this.form.pics = []
-            for (let i = 0; i < this.$refs.obsFileUpload.fileList.length; i++) {
-              console.log(this.$refs.obsFileUpload.fileList[i])
-              this.form.pics.push({
-                'fileName': this.$refs.obsFileUpload.fileList[i].name,
-                'picUrl': this.$refs.obsFileUpload.fileList[i].url
-              })
+            this.form.files = this.$refs.obsFileUpload.fileList;
+            if (this.form.files.length === 0) {
+              this.$message.warning('必须上传附件!')
+              return
             }
 
             updateEngineeringDangerous(this.form).then(response => {
@@ -611,13 +608,10 @@ export default {
               this.buttonLoading = false;
             });
           } else {
-            this.form.pics = []
-            for (let i = 0; i < this.$refs.obsFileUpload.fileList.length; i++) {
-              console.log(this.$refs.obsFileUpload.fileList[i])
-              this.form.pics.push({
-                'fileName': this.$refs.obsFileUpload.fileList[i].name,
-                'picUrl': this.$refs.obsFileUpload.fileList[i].url
-              })
+            this.form.files = this.$refs.obsFileUpload.fileList;
+            if (this.form.files.length === 0) {
+              this.$message.warning('必须上传附件!')
+              return
             }
             addEngineeringDangerous(this.form).then(response => {
               this.$modal.msgSuccess("新增成功");

+ 1 - 1
src/views/zdsz/engineeringInfrastructure/index.vue

@@ -867,7 +867,7 @@ export default {
             putEngineeringInfrastructure(param).then(res => {
               if (res.code == 200) {
                 this.$message({
-                  message: '添加成功',
+                  message: '修改成功',
                   type: 'success'
                 });
                 this.open = false