1730532197@qq.com

lwj

...@@ -34,4 +34,14 @@ export function saveOrUpdate(data) { ...@@ -34,4 +34,14 @@ export function saveOrUpdate(data) {
34 data: data 34 data: data
35 35
36 }) 36 })
37 -}
...\ No newline at end of file ...\ No newline at end of file
37 +}
38 +
39 +//新增前查询航班信息
40 +export function findFltCommonConf(data) {
41 + return request({
42 + url: '/FlightPreserveController/findFltCommonConf',
43 + method: 'post',
44 + data: data
45 +
46 + })
47 +}
......
...@@ -132,37 +132,37 @@ ...@@ -132,37 +132,37 @@
132 <el-row> 132 <el-row>
133 <el-col :span="12"> 133 <el-col :span="12">
134 <el-form-item label="航班号" prop="fltNo"> 134 <el-form-item label="航班号" prop="fltNo">
135 - <el-input style="width:93%;" v-model="form.fltNo" placeholder="请输入航班号" /> 135 + <el-input @blur="blurfltNo" :disabled="formdisabled.fltNo" style="width:93%;" v-model="form.fltNo" placeholder="请输入航班号" />
136 </el-form-item> 136 </el-form-item>
137 </el-col> 137 </el-col>
138 <!-- <el-col :span="1"> &#12288;</el-col> --> 138 <!-- <el-col :span="1"> &#12288;</el-col> -->
139 <el-col :span="12"> 139 <el-col :span="12">
140 <el-form-item label="航班日期" prop="fltDate"> 140 <el-form-item label="航班日期" prop="fltDate">
141 141
142 - <el-date-picker clearable size="small" v-model="form.fltDate" 142 + <el-date-picker :disabled="formdisabled.fltDate" clearable size="small" v-model="form.fltDate" type="date"
143 - type="date" value-format="yyyy-MM-dd" placeholder="选择航班日期"> 143 + value-format="yyyy-MM-dd" placeholder="选择航班日期">
144 </el-date-picker> 144 </el-date-picker>
145 </el-form-item> 145 </el-form-item>
146 </el-col> 146 </el-col>
147 </el-row> 147 </el-row>
148 148
149 - <el-col :span="12"> 149 + <el-col :span="12">
150 - <el-form-item label="航班路线" prop="route"> 150 + <el-form-item label="航班路线" prop="route">
151 - <el-input style="width:93%" v-model="form.route" placeholder="请输入航班路线" /> 151 + <el-input :disabled="formdisabled.route" style="width:93%" v-model="form.route" placeholder="请输入航班路线" />
152 - </el-form-item> 152 + </el-form-item>
153 - </el-col> 153 + </el-col>
154 <el-row> 154 <el-row>
155 <el-col :span="12"> 155 <el-col :span="12">
156 <el-form-item label="航班种类" prop="kindId"> 156 <el-form-item label="航班种类" prop="kindId">
157 - <el-select v-model="form.kindId" placeholder="请选择航班种类"> 157 + <el-select :disabled="formdisabled.kindId" v-model="form.kindId" placeholder="请选择航班种类">
158 <el-option v-for="item in flightKindlist" :key="item.id" :label="item.chineseName" :value="item.id"> 158 <el-option v-for="item in flightKindlist" :key="item.id" :label="item.chineseName" :value="item.id">
159 </el-option> 159 </el-option>
160 </el-select> 160 </el-select>
161 </el-form-item> 161 </el-form-item>
162 </el-col> 162 </el-col>
163 <el-col :span="12"> 163 <el-col :span="12">
164 - <el-form-item label="航班类型" prop="startDate"> 164 + <el-form-item label="航班类型" prop="typeId">
165 - <el-select v-model="form.typeId" placeholder="请选择航班类型"> 165 + <el-select :disabled="formdisabled.typeId" v-model="form.typeId" placeholder="请选择航班类型">
166 <el-option v-for="item in flightTypelist" :key="item.id" :label="item.chineseName" :value="item.id"> 166 <el-option v-for="item in flightTypelist" :key="item.id" :label="item.chineseName" :value="item.id">
167 </el-option> 167 </el-option>
168 </el-select> 168 </el-select>
...@@ -178,7 +178,7 @@ ...@@ -178,7 +178,7 @@
178 </el-col> 178 </el-col>
179 <el-col :span="12"> 179 <el-col :span="12">
180 <el-form-item label="原始重量(T)" prop="originalWeight"> 180 <el-form-item label="原始重量(T)" prop="originalWeight">
181 - <el-input placeholder="请输入原始重量(T)" style="width:93%" min="0" 181 + <el-input :disabled="formdisabled.originalWeight" placeholder="请输入原始重量(T)" style="width:93%" min="0"
182 oninput="value=value.indexOf('.') > -1?value.slice(0, value.indexOf('.') + 3):value" type="number" 182 oninput="value=value.indexOf('.') > -1?value.slice(0, value.indexOf('.') + 3):value" type="number"
183 v-model="form.originalWeight"></el-input> 183 v-model="form.originalWeight"></el-input>
184 </el-form-item> 184 </el-form-item>
...@@ -236,7 +236,7 @@ ...@@ -236,7 +236,7 @@
236 236
237 </el-form> 237 </el-form>
238 <div slot="footer" class="dialog-footer"> 238 <div slot="footer" class="dialog-footer">
239 - <el-button type="primary" @click="submitForm">确 定</el-button> 239 + <el-button type="primary" :disabled="form.alloctedWeight>0 ? true:false" @click="submitForm">确 定</el-button>
240 <el-button @click="cancel">取 消</el-button> 240 <el-button @click="cancel">取 消</el-button>
241 </div> 241 </div>
242 </el-dialog> 242 </el-dialog>
...@@ -247,13 +247,30 @@ ...@@ -247,13 +247,30 @@
247 findFltConditionDataApi, 247 findFltConditionDataApi,
248 findAllFltDataApi, 248 findAllFltDataApi,
249 findFltById, 249 findFltById,
250 - saveOrUpdate 250 + saveOrUpdate,
251 + findFltCommonConf
251 252
252 } from "@/api/findAllFltData"; 253 } from "@/api/findAllFltData";
253 export default { 254 export default {
254 name: "findAllFltData", 255 name: "findAllFltData",
255 data() { 256 data() {
256 return { 257 return {
258 + //form属性禁用状态
259 + formdisabled: {
260 + //航班号
261 + fltNo: false,
262 + //航班日期
263 + fltDate: false,
264 + //航班路线
265 + route: false,
266 + //航班种类
267 + kindId: false,
268 + //航班类型
269 + typeId: false,
270 + //原始重量
271 + originalWeight: false
272 + },
273 +
257 //航班种类 274 //航班种类
258 flightKindlist: [], 275 flightKindlist: [],
259 //航班状态 276 //航班状态
...@@ -339,6 +356,51 @@ ...@@ -339,6 +356,51 @@
339 this.findAllFltData(); 356 this.findAllFltData();
340 }, 357 },
341 methods: { 358 methods: {
359 + //输入航班号后
360 + blurfltNo(){
361 + if(this.form.fltNo!=null&&this.form.fltNo!=undefined &&this.form.fltNo!=""){
362 + this.form.fltNo=this.form.fltNo.toUpperCase();
363 + findFltCommonConf(this.form).then(response => {
364 + if (response.code == 200) {
365 + //额外增重百分比:根据已存在的相同航班号对应的最新值进行设置,如果无相同航班号,按照默认设置为0,不可编辑
366 + if(response.data.extraWeightPercent!=null&&response.data.extraWeightPercent!=undefined){
367 + this.form.extraWeightPercent=response.data.extraWeightPercent;
368 + }else{
369 + this.form.extraWeightPercent=response.data.extraWeightPercent=0;
370 + }
371 + //是否开启高低价:根据已存在的相同航班号对应的最新值进行设置,如果无相同航班号,按照默认设置‘是否开启高低价’ 为是,不可编辑
372 + if(response.data.highLowPriceFlg!=null&&response.data.highLowPriceFlg!=undefined){
373 + this.form.highLowPriceFlg=response.data.highLowPriceFlg=== 1 ? true : false;
374 + }else{
375 + this.form.highLowPriceFlg=response.data.highLowPriceFlg=1;
376 + }
377 + //是否预审:根据已存在的相同航班号对应的最新值进行设置,如果无相同航班号,按照默认设置‘是否预审’ 为否,不可编辑;
378 + if(response.data.isNeedRequired!=null&&response.data.isNeedRequired!=undefined){
379 + this.form.isNeedRequired=response.data.isNeedRequired=== 1 ? true : false;
380 + }else{
381 + this.form.isNeedRequired=response.data.isNeedRequired=1;
382 + }
383 + //高/低价百分比:根据已存在的相同航班号对应的最新值进行设置,如果无相同航班号,按照默认设置‘高价百分比’60%,‘低价百分比’40%,不可编辑
384 + if(response.data.highPriceWeightPercent!=null&&response.data.highPriceWeightPercent!=undefined){
385 + this.form.highPriceWeightPercent=response.data.highPriceWeightPercent;
386 + }else{
387 + this.form.highPriceWeightPercent=response.data.highPriceWeightPercent=60;
388 + }
389 + if(response.data.lowPriceWeightPercent!=null&&response.data.lowPriceWeightPercent!=undefined){
390 + this.form.lowPriceWeightPercent=response.data.lowPriceWeightPercent;
391 + }else{
392 + this.form.lowPriceWeightPercent=response.data.lowPriceWeightPercent=40;
393 + }
394 + } else {
395 + this.msgError(response.msg);
396 + }
397 +
398 + });
399 +
400 + }
401 +
402 +
403 + },
342 // 是否一票一件 404 // 是否一票一件
343 ticketToPieceFormat(row) { 405 ticketToPieceFormat(row) {
344 if (row.ticketToPiece === 1) { 406 if (row.ticketToPiece === 1) {
...@@ -375,6 +437,7 @@ ...@@ -375,6 +437,7 @@
375 findFltConditionData() { 437 findFltConditionData() {
376 findFltConditionDataApi().then(response => { 438 findFltConditionDataApi().then(response => {
377 if (response.code == 200) { 439 if (response.code == 200) {
440 + // debugger
378 //航班种类 441 //航班种类
379 this.flightKindlist = response.data.flightKind; 442 this.flightKindlist = response.data.flightKind;
380 //航班类型 443 //航班类型
...@@ -424,26 +487,61 @@ ...@@ -424,26 +487,61 @@
424 }, 487 },
425 /** 新增按钮操作 */ 488 /** 新增按钮操作 */
426 handleAdd() { 489 handleAdd() {
427 - this.reset(); 490 + this.reset();
428 this.open = true; 491 this.open = true;
429 this.title = "添加航班信息"; 492 this.title = "添加航班信息";
430 this.form.id = -1; 493 this.form.id = -1;
431 - this.form.statusId=this.flightStatuslist[0].id; 494 + this.form.statusId = this.flightStatuslist[0].id;
495 + this.form.alloctedWeight = 0;
496 + //航班号
497 + this.formdisabled.fltNo = false;
498 + //航班日期
499 + this.formdisabled.fltDate = false;
500 + //航班路线
501 + this.formdisabled.route = false;
502 + //航班种类
503 + this.formdisabled.kindId = false;
504 + //航班类型
505 + this.formdisabled.typeId = false;
506 + //原始重量
507 + this.formdisabled.originalWeight = false;
432 }, 508 },
433 /** 修改按钮操作 */ 509 /** 修改按钮操作 */
434 handleUpdate(row) { 510 handleUpdate(row) {
435 - this.reset(); 511 + this.reset();
436 this.open = true; 512 this.open = true;
437 this.title = "修改航班信息"; 513 this.title = "修改航班信息";
514 + //航班号
515 + this.formdisabled.fltNo = true;
516 + //航班日期
517 + this.formdisabled.fltDate = true;
438 //根据ID查item 518 //根据ID查item
439 -
440 findFltById(row).then(response => { 519 findFltById(row).then(response => {
441 if (response.code == 200) { 520 if (response.code == 200) {
442 - this.form = response.data; 521 + this.form = response.data;
443 - //是否开启高地价 522 + //是否开启高地价
444 - this.form.highLowPriceFlg =this.form.highLowPriceFlg===1?true:false; 523 + this.form.highLowPriceFlg = this.form.highLowPriceFlg === 1 ? true : false;
445 - //是否预审 524 + //是否预审
446 - this.form.isNeedRequired =this.form.isNeedRequired===1?true:false; 525 + this.form.isNeedRequired = this.form.isNeedRequired === 1 ? true : false;
526 + if (this.form.alloctedWeight > 0) {
527 + //航班路线
528 + this.formdisabled.route = true;
529 + //航班种类
530 + this.formdisabled.kindId = true;
531 + //航班类型
532 + this.formdisabled.typeId = true;
533 + //原始重量
534 + this.formdisabled.originalWeight = true;
535 + }else{
536 + //航班路线
537 + this.formdisabled.route = false;
538 + //航班种类
539 + this.formdisabled.kindId = false;
540 + //航班类型
541 + this.formdisabled.typeId = false;
542 + //原始重量
543 + this.formdisabled.originalWeight = false;
544 + }
447 } else { 545 } else {
448 this.msgError(response.msg); 546 this.msgError(response.msg);
449 } 547 }
...@@ -488,11 +586,12 @@ ...@@ -488,11 +586,12 @@
488 submitForm: function() { 586 submitForm: function() {
489 this.$refs["form"].validate(valid => { 587 this.$refs["form"].validate(valid => {
490 if (valid) { 588 if (valid) {
491 - let formdata=JSON.parse(JSON.stringify(this.form)); 589 + //debugger
492 - //是否开启高地价 590 + let formdata = JSON.parse(JSON.stringify(this.form));
493 - formdata.highLowPriceFlg =formdata.highLowPriceFlg?1:0; 591 + //是否开启高地价
494 - //是否预审 592 + formdata.highLowPriceFlg = formdata.highLowPriceFlg ? 1 : 0;
495 - formdata.isNeedRequired =formdata.isNeedRequired?1:0; 593 + //是否预审
594 + formdata.isNeedRequired = formdata.isNeedRequired ? 1 : 0;
496 //处理数据 595 //处理数据
497 saveOrUpdate(formdata).then(response => { 596 saveOrUpdate(formdata).then(response => {
498 if (response.code === 200) { 597 if (response.code === 200) {
...@@ -515,7 +614,7 @@ ...@@ -515,7 +614,7 @@
515 // 取消按钮 614 // 取消按钮
516 cancel() { 615 cancel() {
517 this.open = false; 616 this.open = false;
518 - this.reset(); 617 + this.reset();
519 }, 618 },
520 619
521 /** 重置按钮操作 */ 620 /** 重置按钮操作 */
......