Showing
2 changed files
with
24 additions
and
12 deletions
| ... | @@ -79,7 +79,7 @@ service.interceptors.response.use(res => { | ... | @@ -79,7 +79,7 @@ service.interceptors.response.use(res => { |
| 79 | type: 'error' | 79 | type: 'error' |
| 80 | }) | 80 | }) |
| 81 | return Promise.reject(new Error(msg)) | 81 | return Promise.reject(new Error(msg)) |
| 82 | - } else if (code !== 200 && code !== 201) { | 82 | + } else if (code !== 200 && code !== 201 && code != 202) { |
| 83 | Message({ | 83 | Message({ |
| 84 | message: msg, | 84 | message: msg, |
| 85 | type: 'error' | 85 | type: 'error' | ... | ... |
| ... | @@ -67,6 +67,7 @@ | ... | @@ -67,6 +67,7 @@ |
| 67 | 67 | ||
| 68 | <script> | 68 | <script> |
| 69 | import { allocationFlight } from "@/api/cargoSelect"; | 69 | import { allocationFlight } from "@/api/cargoSelect"; |
| 70 | +import { MessageBox } from 'element-ui' | ||
| 70 | export default { | 71 | export default { |
| 71 | props: { | 72 | props: { |
| 72 | dialogVisible: { | 73 | dialogVisible: { |
| ... | @@ -129,6 +130,14 @@ export default { | ... | @@ -129,6 +130,14 @@ export default { |
| 129 | }; | 130 | }; |
| 130 | }, | 131 | }, |
| 131 | methods: { | 132 | methods: { |
| 133 | + cleaerForm(){ | ||
| 134 | + this.formData={ | ||
| 135 | + ids:[], | ||
| 136 | + fltNo: undefined, | ||
| 137 | + fltDate:undefined, | ||
| 138 | + overweight:false | ||
| 139 | + } | ||
| 140 | + }, | ||
| 132 | //确定配舱 | 141 | //确定配舱 |
| 133 | submit() { | 142 | submit() { |
| 134 | let arr = []; | 143 | let arr = []; |
| ... | @@ -138,25 +147,25 @@ export default { | ... | @@ -138,25 +147,25 @@ export default { |
| 138 | this.formData.ids = arr; | 147 | this.formData.ids = arr; |
| 139 | if(this.formData.fltNo && this.formData.fltDate){ | 148 | if(this.formData.fltNo && this.formData.fltDate){ |
| 140 | allocationFlight(this.formData).then(res=>{//code 200 配舱成功 601 重量已满需要确认 其余code直接输出msg | 149 | allocationFlight(this.formData).then(res=>{//code 200 配舱成功 601 重量已满需要确认 其余code直接输出msg |
| 141 | - if(code === 200){ | 150 | + if(res.code === 200){ |
| 142 | this.$message({ | 151 | this.$message({ |
| 143 | message: "货物配舱成功", | 152 | message: "货物配舱成功", |
| 144 | type: "success", | 153 | type: "success", |
| 145 | }); | 154 | }); |
| 146 | - }else if(code === 601){ | 155 | + }else if(res.code === 202){ |
| 147 | - this.$confirm('航班配重已满,是否继续配舱?', '提示', { | 156 | + MessageBox.confirm('航班配重已满,是否继续配舱?', '提示', { |
| 148 | - confirmButtonText: '确定', | 157 | + confirmButtonText: '确定', |
| 149 | - cancelButtonText: '取消', | 158 | + cancelButtonText: '取消', |
| 150 | - type: 'warning' | 159 | + type: 'warning' |
| 151 | - }).then(() => { | 160 | + } |
| 161 | + ).then(() => { | ||
| 152 | this.formData.overweight = true;//确定继续overweight变为true再次请求接口 | 162 | this.formData.overweight = true;//确定继续overweight变为true再次请求接口 |
| 153 | allocationFlight(this.formData).then(res=>{ | 163 | allocationFlight(this.formData).then(res=>{ |
| 154 | - if(code === 200){ | 164 | + if(res.code === 200){ |
| 155 | this.$message({ | 165 | this.$message({ |
| 156 | message: "货物配舱成功", | 166 | message: "货物配舱成功", |
| 157 | type: "success", | 167 | type: "success", |
| 158 | }); | 168 | }); |
| 159 | - this.$emit("dialogBeforeClose", {close:false,reload:false}); | ||
| 160 | }else{ | 169 | }else{ |
| 161 | this.$message({ | 170 | this.$message({ |
| 162 | message: res.msg, | 171 | message: res.msg, |
| ... | @@ -164,11 +173,14 @@ export default { | ... | @@ -164,11 +173,14 @@ export default { |
| 164 | }); | 173 | }); |
| 165 | } | 174 | } |
| 166 | }) | 175 | }) |
| 176 | + this.cleaerForm() | ||
| 177 | + this.$emit("dialogBeforeClose", {close:false,reload:true}); | ||
| 167 | }).catch(() => {//取消 取消当前配舱 | 178 | }).catch(() => {//取消 取消当前配舱 |
| 168 | this.$message({ | 179 | this.$message({ |
| 169 | message: "配舱已取消", | 180 | message: "配舱已取消", |
| 170 | type: "success", | 181 | type: "success", |
| 171 | - }); | 182 | + }); |
| 183 | + this.cleaerForm() | ||
| 172 | this.$emit("dialogBeforeClose", {close:false,reload:false}); | 184 | this.$emit("dialogBeforeClose", {close:false,reload:false}); |
| 173 | }); | 185 | }); |
| 174 | }else{ | 186 | }else{ |
| ... | @@ -177,7 +189,6 @@ export default { | ... | @@ -177,7 +189,6 @@ export default { |
| 177 | type: "warning", | 189 | type: "warning", |
| 178 | }); | 190 | }); |
| 179 | } | 191 | } |
| 180 | - this.$emit("dialogBeforeClose", {close:false,reload:true}); | ||
| 181 | }) | 192 | }) |
| 182 | }else{ | 193 | }else{ |
| 183 | this.$message({ | 194 | this.$message({ |
| ... | @@ -187,6 +198,7 @@ export default { | ... | @@ -187,6 +198,7 @@ export default { |
| 187 | } | 198 | } |
| 188 | }, | 199 | }, |
| 189 | dialogBeforeClose() { | 200 | dialogBeforeClose() { |
| 201 | + this.cleaerForm() | ||
| 190 | this.$emit("dialogBeforeClose", {close:false,reload:false}); | 202 | this.$emit("dialogBeforeClose", {close:false,reload:false}); |
| 191 | }, | 203 | }, |
| 192 | }, | 204 | }, | ... | ... |
-
Please register or login to post a comment