Elements-SY

Merge branch 'et86-black' into test

...@@ -319,3 +319,28 @@ body { ...@@ -319,3 +319,28 @@ body {
319 .btn-mb-4 { 319 .btn-mb-4 {
320 margin-bottom: 4px; 320 margin-bottom: 4px;
321 } 321 }
322 +
323 +textarea::-webkit-input-placeholder {
324 + /* WebKit browsers */
325 + color: #C0C4CC !important;
326 + font-size: 13px !important;
327 + font-family: 'Helvetica Neue',Helvetica,'PingFang SC','Hiragino Sans GB','Microsoft YaHei',SimSun,sans-serif;
328 + }
329 + textarea:-moz-placeholder {
330 + /* Mozilla Firefox 4 to 18 */
331 + color: #c0c4cc !important;
332 + font-size: 13px !important;
333 + font-family: 'Helvetica Neue',Helvetica,'PingFang SC','Hiragino Sans GB','Microsoft YaHei',SimSun,sans-serif;
334 + }
335 + textarea::-moz-placeholder {
336 + /* Mozilla Firefox 19+ */
337 + color: #c0c4cc !important;
338 + font-size: 13px !important;
339 + font-family: 'Helvetica Neue',Helvetica,'PingFang SC','Hiragino Sans GB','Microsoft YaHei',SimSun,sans-serif;
340 + }
341 + textarea::-ms-input-placeholder {
342 + /* Internet Explorer 10+ */
343 + color: #c0c4cc !important;
344 + font-size: 13px !important;
345 + font-family: 'Helvetica Neue',Helvetica,'PingFang SC','Hiragino Sans GB','Microsoft YaHei',SimSun,sans-serif;
346 + }
......
...@@ -79,14 +79,22 @@ service.interceptors.response.use(res => { ...@@ -79,14 +79,22 @@ 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 && code !== 202 && code != 203 && code != 603 && code != 402) { 82 + } else if (
83 + code !== 200 &&
84 + code !== 201 &&
85 + code !== 202 &&
86 + code != 203 &&
87 + code != 300 &&
88 + code != 402 &&
89 + code != 603
90 + ) {
83 Message({ 91 Message({
84 message: msg, 92 message: msg,
85 - type: 'error' 93 + type: "error",
86 - }) 94 + });
87 - return Promise.reject('error') 95 + return Promise.reject("error");
88 } else { 96 } else {
89 - return res.data 97 + return res.data;
90 } 98 }
91 }, 99 },
92 error => { 100 error => {
......
...@@ -136,7 +136,7 @@ ...@@ -136,7 +136,7 @@
136 </el-col> 136 </el-col>
137 <el-col :span="6"> 137 <el-col :span="6">
138 <el-form-item label="运单号"> 138 <el-form-item label="运单号">
139 - <el-input class="formItem" type="textarea" :rows="4" placeholder="请输入运单号(回车分割)" :maxlength="12000" 139 + <el-input class="formItem" type="textarea" :rows="4" placeholder="请输入运单号(回车分割)" :maxlength="12000"
140 v-model="formData.waybillNo" clearable></el-input> 140 v-model="formData.waybillNo" clearable></el-input>
141 </el-form-item> 141 </el-form-item>
142 </el-col> 142 </el-col>
......
...@@ -71,7 +71,8 @@ ...@@ -71,7 +71,8 @@
71 <el-button type="primary" v-if="val.status === '3'" size="mini" 71 <el-button type="primary" v-if="val.status === '3'" size="mini"
72 icon="el-icon-video-pause" @click="changeStatus(idx)"> 72 icon="el-icon-video-pause" @click="changeStatus(idx)">
73 启 用</el-button> 73 启 用</el-button>
74 - <el-button v-if="val.id" type="danger" size="mini" icon="el-icon-delete" @click="del(idx)"> 74 + <el-button v-if="val.id" type="danger" size="mini" icon="el-icon-delete"
75 + @click="del(idx)">
75 删 除</el-button> 76 删 除</el-button>
76 <div v-if="(routeSatus.indexOf('flightInformationMaintenance') >= 0)" 77 <div v-if="(routeSatus.indexOf('flightInformationMaintenance') >= 0)"
77 style="display: inline-block;"> 78 style="display: inline-block;">
...@@ -80,7 +81,7 @@ ...@@ -80,7 +81,7 @@
80 <div v-else-if="(routeSatus.indexOf('FlightAllocConfig') >= 0)" 81 <div v-else-if="(routeSatus.indexOf('FlightAllocConfig') >= 0)"
81 style="display: inline-block;"> 82 style="display: inline-block;">
82 <span 83 <span
83 - v-if="infoForm.fltDate != null && infoForm.fltDate != '' && infoForm.fltDate != ' '">日期级别规则</span><span 84 + v-if="val.id && val.ruleDate != null && val.ruleDate != '' && val.ruleDate != ' '">日期级别规则</span><span
84 v-else>普通规则</span> 85 v-else>普通规则</span>
85 </div> 86 </div>
86 <el-divider></el-divider> 87 <el-divider></el-divider>
...@@ -148,9 +149,7 @@ ...@@ -148,9 +149,7 @@
148 <el-col :span="10"> 149 <el-col :span="10">
149 <el-input class="numberInput" v-model.trim="val.minNumOfPieces" 150 <el-input class="numberInput" v-model.trim="val.minNumOfPieces"
150 oninput="value=value.replace(/[^\d\.\-]/g,'')" @change="change" 151 oninput="value=value.replace(/[^\d\.\-]/g,'')" @change="change"
151 - @input="change($event)" 152 + @input="change($event)" @blur="inputBlurMinPieces($event)">
152 - @blur="inputBlurMinPieces($event)"
153 - >
154 </el-input> 153 </el-input>
155 <span ref="minNumOfPieces" class="el-form-item__error"></span> 154 <span ref="minNumOfPieces" class="el-form-item__error"></span>
156 </el-col> 155 </el-col>
...@@ -158,9 +157,7 @@ ...@@ -158,9 +157,7 @@
158 <el-col :span="10"> 157 <el-col :span="10">
159 <el-input class="numberInput" v-model.trim="val.maxNumOfPieces" 158 <el-input class="numberInput" v-model.trim="val.maxNumOfPieces"
160 oninput="value=value.replace(/[^\d\.\-]/g,'')" @change="change" 159 oninput="value=value.replace(/[^\d\.\-]/g,'')" @change="change"
161 - @input="change($event)" 160 + @input="change($event)" @blur="inputBlurMaxPieces($event)">
162 - @blur="inputBlurMaxPieces($event)"
163 - >
164 </el-input> 161 </el-input>
165 </el-col> 162 </el-col>
166 </el-form-item> 163 </el-form-item>
...@@ -170,9 +167,7 @@ ...@@ -170,9 +167,7 @@
170 <el-col :span="10"> 167 <el-col :span="10">
171 <el-input class="numberInput" v-model.trim="val.minWeight" 168 <el-input class="numberInput" v-model.trim="val.minWeight"
172 oninput="value=value.replace(/[^\d\.\-]/g,'')" @change="change" 169 oninput="value=value.replace(/[^\d\.\-]/g,'')" @change="change"
173 - @input="change($event)" 170 + @input="change($event)" @blur="inputBlurMinWeight($event)">
174 - @blur="inputBlurMinWeight($event)"
175 - >
176 </el-input> 171 </el-input>
177 <span ref="minWeight" class="el-form-item__error"></span> 172 <span ref="minWeight" class="el-form-item__error"></span>
178 </el-col> 173 </el-col>
...@@ -180,9 +175,7 @@ ...@@ -180,9 +175,7 @@
180 <el-col :span="10"> 175 <el-col :span="10">
181 <el-input class="numberInput" v-model.trim="val.maxWeight" 176 <el-input class="numberInput" v-model.trim="val.maxWeight"
182 oninput="value=value.replace(/[^\d\.\-]/g,'')" @change="change" 177 oninput="value=value.replace(/[^\d\.\-]/g,'')" @change="change"
183 - @input="change($event)" 178 + @input="change($event)" @blur="inputBlurMaxWeight($event)">
184 - @blur="inputBlurMaxWeight($event)"
185 - >
186 </el-input> 179 </el-input>
187 </el-col> 180 </el-col>
188 </el-form-item> 181 </el-form-item>
...@@ -324,13 +317,15 @@ ...@@ -324,13 +317,15 @@
324 <el-button type="primary" v-if="val.status === '3'" size="mini" icon="el-icon-video-pause" 317 <el-button type="primary" v-if="val.status === '3'" size="mini" icon="el-icon-video-pause"
325 @click="changeStatus(idx)"> 318 @click="changeStatus(idx)">
326 启 用</el-button> 319 启 用</el-button>
327 - <el-button v-if="val.id" type="danger" size="mini" icon="el-icon-delete" style="margin-right:10px" @click="del(idx)"> 320 + <el-button v-if="val.id" type="danger" size="mini" icon="el-icon-delete" style="margin-right:10px"
321 + @click="del(idx)">
328 删 除</el-button> 322 删 除</el-button>
329 <div v-if="routeSatus.indexOf('flightInformationMaintenance') >= 0" style="display: inline-block;"> 323 <div v-if="routeSatus.indexOf('flightInformationMaintenance') >= 0" style="display: inline-block;">
330 <span v-if="val.id">日期级别规则</span><span v-else>普通规则</span> 324 <span v-if="val.id">日期级别规则</span><span v-else>普通规则</span>
331 </div> 325 </div>
332 <div v-else-if="(routeSatus.indexOf('FlightAllocConfig') >= 0)" style="display: inline-block;"> 326 <div v-else-if="(routeSatus.indexOf('FlightAllocConfig') >= 0)" style="display: inline-block;">
333 - <span v-if="infoForm.fltDate != null && infoForm.fltDate != '' && infoForm.fltDate != ' '">日期级别规则</span><span 327 + <span
328 + v-if="infoForm.fltDate != null && infoForm.fltDate != '' && infoForm.fltDate != ' '">日期级别规则</span><span
334 v-else>普通规则</span> 329 v-else>普通规则</span>
335 </div> 330 </div>
336 <el-divider></el-divider> 331 <el-divider></el-divider>
...@@ -396,9 +391,7 @@ ...@@ -396,9 +391,7 @@
396 <el-col :span="10"> 391 <el-col :span="10">
397 <el-input class="numberInput" v-model.trim="val.minNumOfPieces" 392 <el-input class="numberInput" v-model.trim="val.minNumOfPieces"
398 oninput="value=value.replace(/[^\d\.\-]/g,'')" @change="change" 393 oninput="value=value.replace(/[^\d\.\-]/g,'')" @change="change"
399 - @input="change($event)" 394 + @input="change($event)" @blur="inputBlurMinPieces($event)">
400 - @blur="inputBlurMinPieces($event)"
401 - >
402 </el-input> 395 </el-input>
403 <span ref="minNumOfPieces" class="el-form-item__error"></span> 396 <span ref="minNumOfPieces" class="el-form-item__error"></span>
404 </el-col> 397 </el-col>
...@@ -406,9 +399,7 @@ ...@@ -406,9 +399,7 @@
406 <el-col :span="10"> 399 <el-col :span="10">
407 <el-input class="numberInput" v-model.trim="val.maxNumOfPieces" 400 <el-input class="numberInput" v-model.trim="val.maxNumOfPieces"
408 oninput="value=value.replace(/[^\d\.\-]/g,'')" @change="change" 401 oninput="value=value.replace(/[^\d\.\-]/g,'')" @change="change"
409 - @input="change($event)" 402 + @input="change($event)" @blur="inputBlurMaxPieces($event)">
410 - @blur="inputBlurMaxPieces($event)"
411 - >
412 </el-input> 403 </el-input>
413 </el-col> 404 </el-col>
414 </el-form-item> 405 </el-form-item>
...@@ -418,9 +409,7 @@ ...@@ -418,9 +409,7 @@
418 <el-col :span="10"> 409 <el-col :span="10">
419 <el-input class="numberInput" v-model.trim="val.minWeight" 410 <el-input class="numberInput" v-model.trim="val.minWeight"
420 oninput="value=value.replace(/[^\d\.\-]/g,'')" @change="change" 411 oninput="value=value.replace(/[^\d\.\-]/g,'')" @change="change"
421 - @input="change($event)" 412 + @input="change($event)" @blur="inputBlurMinWeight($event)">
422 - @blur="inputBlurMinWeight($event)"
423 - >
424 </el-input> 413 </el-input>
425 <span ref="minWeight" class="el-form-item__error"></span> 414 <span ref="minWeight" class="el-form-item__error"></span>
426 </el-col> 415 </el-col>
...@@ -428,9 +417,7 @@ ...@@ -428,9 +417,7 @@
428 <el-col :span="10"> 417 <el-col :span="10">
429 <el-input class="numberInput" v-model.trim="val.maxWeight" 418 <el-input class="numberInput" v-model.trim="val.maxWeight"
430 oninput="value=value.replace(/[^\d\.\-]/g,'')" @change="change" 419 oninput="value=value.replace(/[^\d\.\-]/g,'')" @change="change"
431 - @input="change($event)" 420 + @input="change($event)" @blur="inputBlurMaxWeight($event)">
432 - @blur="inputBlurMaxWeight($event)"
433 - >
434 </el-input> 421 </el-input>
435 </el-col> 422 </el-col>
436 </el-form-item> 423 </el-form-item>
...@@ -739,7 +726,7 @@ export default { ...@@ -739,7 +726,7 @@ export default {
739 flightRouteListStr: val.flightRouteListStr, 726 flightRouteListStr: val.flightRouteListStr,
740 status: val.status ? val.status : '' 727 status: val.status ? val.status : ''
741 } 728 }
742 - if(this.$route.params.handle == "updated"){ 729 + if (this.$route.params.handle == "updated") {
743 delete obj.flightRoute 730 delete obj.flightRoute
744 } 731 }
745 // 修改时 & 详情时 732 // 修改时 & 详情时
...@@ -761,7 +748,7 @@ export default { ...@@ -761,7 +748,7 @@ export default {
761 }) 748 })
762 } else { 749 } else {
763 //航班类型为Purple Tail则显示所有航线维度 750 //航班类型为Purple Tail则显示所有航线维度
764 - this.routeList.forEach(route => { 751 + this.routeList.forEach((route, sub) => {
765 let routeStatus = 1 752 let routeStatus = 1
766 res.data.list.forEach(item => { 753 res.data.list.forEach(item => {
767 if (route.route === item.flightRoute) { 754 if (route.route === item.flightRoute) {
...@@ -778,21 +765,118 @@ export default { ...@@ -778,21 +765,118 @@ export default {
778 flightRoute: route.route, 765 flightRoute: route.route,
779 routePriority: route.routePriority, 766 routePriority: route.routePriority,
780 }) 767 })
768 + this.newRoute(sub)
781 } 769 }
782 }) 770 })
783 } 771 }
784 } else { 772 } else {
785 - //航线为空,对应航班或航班+日期下的全部维度(需补全未创建维度) 773 + //航班配舱编辑
774 + if (this.routeSatus == 'FlightAllocConfig') {
775 + let infoRouteList = []
776 + res.data.list.forEach(dateItem => {
777 + this.infoForm.list.push(
778 + this.dataHandle(dateItem)
779 + )
780 + infoRouteList.push(dateItem.flightRoute)
781 + })
782 + //判断是否有日期,看是否需要查询无日期维度
783 + if (obj.flightDate != null && obj.flightDate != '' && obj.flightDate != ' ') {
784 + findDestinationFltRuleByFlightNo({
785 + purposeOfFlightNo: this.infoForm.fltNo,
786 + fltDate: '',
787 + flightRoute: this.infoForm.route,
788 + flightRouteListStr: this.$route.params.route,
789 + status: this.$route.params.status
790 + }).then(resData => {
791 + if (resData.data.list.length > 0) {
792 + this.routeList.forEach((route, sub) => {
793 + if (!infoRouteList.includes(route.route)) {
794 + let routeStatus = 1
795 + resData.data.list.forEach(item => {
796 + if (item.flightRoute == route.route) {
797 + item.id = undefined
798 + item.status = undefined
799 + routeStatus = 2
800 + this.infoForm.list.push(
801 + this.dataHandle(item)
802 + )
803 + }
804 + })
805 + if (routeStatus == 1) {
806 + // 否则插入占位基础数据
807 + this.infoForm.list.push({
808 + purposeOfFlightNo: this.infoForm.fltNo,
809 + ruleDate: this.infoForm.fltDate,
810 + flightRoute: route.route,
811 + routePriority: route.routePriority,
812 + })
813 + this.newRoute(sub)
814 + }
815 + }
816 + })
817 + }
818 + else {
819 + this.routeList.forEach((route) => {
820 + this.infoForm.list.push({
821 + purposeOfFlightNo: this.infoForm.fltNo,
822 + ruleDate: this.infoForm.fltDate,
823 + flightRoute: route.route,
824 + routePriority: route.routePriority,
825 + })
826 + })
827 + }
828 + }).catch(err => {
829 + this.isEmpty = true
830 + console.log(err)
831 + })
832 + } else {
833 + this.routeList.forEach((route, sub) => {
834 + if (!infoRouteList.includes(route.route)) {
835 + this.infoForm.list.push({
836 + purposeOfFlightNo: this.infoForm.fltNo,
837 + ruleDate: this.infoForm.fltDate,
838 + flightRoute: route.route,
839 + routePriority: route.routePriority,
840 + })
841 + }
842 + })
843 + }
844 + } else {
845 + //航班维护跳转编辑
846 + let params = {
847 + purposeOfFlightNo: this.infoForm.fltNo,
848 + flightRoute: this.infoForm.route,
849 + flightRouteListStr: this.$route.params.route,
850 + status: this.$route.params.status
851 + }
852 + findDestinationFltRuleByFlightNo(params).then(response => {
853 + // 航线为空,对应航班或航班+日期下的全部维度(需补全未创建维度)
786 this.routeList.forEach((route, sub) => { 854 this.routeList.forEach((route, sub) => {
787 let routeStatus = 1 855 let routeStatus = 1
788 res.data.list.forEach(item => { 856 res.data.list.forEach(item => {
789 if (route.route === item.flightRoute) { 857 if (route.route === item.flightRoute) {
790 //航线对应插入数据 858 //航线对应插入数据
791 routeStatus = 2 859 routeStatus = 2
860 + // item.id = undefined
861 + // item.status = undefined
792 this.infoForm.list.push(this.dataHandle(item)) 862 this.infoForm.list.push(this.dataHandle(item))
793 } 863 }
794 }) 864 })
795 if (routeStatus == 1) { 865 if (routeStatus == 1) {
866 + //日期下无维度的,查询是否存在无日期维度,有则占位展示,无则使用新增占位
867 + response.data.list.forEach(item => {
868 + if (route.route === item.flightRoute) {
869 + item.id = undefined
870 + item.status = undefined
871 + item.flightRoute = this.infoForm.route
872 + this.routeList.forEach(route => {
873 + if (route.route === this.infoForm.route) {
874 + item.routePriority = route.routePriority
875 + }
876 + })
877 + this.infoForm.list.push(this.dataHandle(item))
878 + }
879 + })
796 //否则插入占位基础数据 880 //否则插入占位基础数据
797 this.infoForm.list.push({ 881 this.infoForm.list.push({
798 purposeOfFlightNo: this.infoForm.fltNo, 882 purposeOfFlightNo: this.infoForm.fltNo,
...@@ -803,6 +887,8 @@ export default { ...@@ -803,6 +887,8 @@ export default {
803 this.newRoute(sub) 887 this.newRoute(sub)
804 } 888 }
805 }) 889 })
890 + })
891 + }
806 } 892 }
807 } 893 }
808 else { 894 else {
...@@ -814,7 +900,7 @@ export default { ...@@ -814,7 +900,7 @@ export default {
814 flightRouteListStr: this.$route.params.route, 900 flightRouteListStr: this.$route.params.route,
815 status: this.$route.params.status 901 status: this.$route.params.status
816 } 902 }
817 - if(this.$route.params.handle == "updated"){ 903 + if (this.$route.params.handle == "updated") {
818 delete params.flightRoute 904 delete params.flightRoute
819 } 905 }
820 //航线不为空,获取该航线下无日期通用维度设置 906 //航线不为空,获取该航线下无日期通用维度设置
...@@ -950,11 +1036,15 @@ export default { ...@@ -950,11 +1036,15 @@ export default {
950 //航班类型Purple Tail展示全部航线维度 1036 //航班类型Purple Tail展示全部航线维度
951 findDestinationFltRuleByFlightNo(query).then(result => { 1037 findDestinationFltRuleByFlightNo(query).then(result => {
952 const { code, data } = result; 1038 const { code, data } = result;
953 - if(code == 200){ 1039 + if (code == 200) {
954 - this.routeList = data.routeList; 1040 + let newRoute = JSON.parse(JSON.stringify(this.routeList.concat(data.routeList)))
955 - let routesStatus = 1 1041 + const resRoute = newRoute.filter((item, index, self) => {
956 - if(data.routeList.length){ 1042 + return self.findIndex(t => JSON.stringify(t) === JSON.stringify(item)) === index;
1043 + });
1044 + this.routeList = Array.from(new Set(resRoute));
1045 + if (data.routeList.length) {
957 this.routeList.forEach(route => { 1046 this.routeList.forEach(route => {
1047 + let routesStatus = 1
958 data.list.forEach(item => { 1048 data.list.forEach(item => {
959 if (route.route === item.flightRoute) { 1049 if (route.route === item.flightRoute) {
960 routesStatus = 2 1050 routesStatus = 2
...@@ -973,6 +1063,7 @@ export default { ...@@ -973,6 +1063,7 @@ export default {
973 routePriority: route.routePriority, 1063 routePriority: route.routePriority,
974 }) 1064 })
975 } 1065 }
1066 +
976 }) 1067 })
977 } 1068 }
978 } 1069 }
......
...@@ -437,6 +437,7 @@ export default { ...@@ -437,6 +437,7 @@ export default {
437 cancel() { 437 cancel() {
438 this.open = false; 438 this.open = false;
439 this.findSourceFlightRules(); 439 this.findSourceFlightRules();
440 + this.$refs.form.clearValidate();
440 //this.reset(); 441 //this.reset();
441 }, 442 },
442 /** 重置按钮操作 */ 443 /** 重置按钮操作 */
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
45 <el-form ref="addForm" :model="newPre" label-width="auto" label-position="left" size="small" :rules="rules" 45 <el-form ref="addForm" :model="newPre" label-width="auto" label-position="left" size="small" :rules="rules"
46 @submit.native.prevent> 46 @submit.native.prevent>
47 <el-form-item label="航班号" prop="addFlitNo"> 47 <el-form-item label="航班号" prop="addFlitNo">
48 - <el-input type="textarea" v-model="fltNo" :rows="7" maxlength="255" show-word-limit placeholder="请输入航班号,用;分隔"> 48 + <el-input type="textarea" v-model="newPre.addFlitNo" :rows="7" maxlength="255" show-word-limit placeholder="请输入航班号,用;分隔">
49 </el-input> 49 </el-input>
50 </el-form-item> 50 </el-form-item>
51 </el-form> 51 </el-form>
...@@ -89,7 +89,7 @@ export default { ...@@ -89,7 +89,7 @@ export default {
89 addFlitNo: '', 89 addFlitNo: '',
90 },//新增航班 90 },//新增航班
91 rules: { 91 rules: {
92 - fltNo: [ 92 + addFlitNo: [
93 { 93 {
94 required: true, 94 required: true,
95 message: "航班号不能为空", 95 message: "航班号不能为空",
...@@ -199,6 +199,7 @@ export default { ...@@ -199,6 +199,7 @@ export default {
199 close() { 199 close() {
200 this.dialogVisible = false 200 this.dialogVisible = false
201 this.newPre.addFlitNo = '' 201 this.newPre.addFlitNo = ''
202 + this.$refs.addForm.clearValidate()
202 }, 203 },
203 //翻页 204 //翻页
204 currentChange(val) { 205 currentChange(val) {
......
...@@ -180,8 +180,8 @@ ...@@ -180,8 +180,8 @@
180 </el-col> 180 </el-col>
181 <el-col :span="12"> 181 <el-col :span="12">
182 <el-form-item label="原始重量(KG)" prop="originalWeight"> 182 <el-form-item label="原始重量(KG)" prop="originalWeight">
183 - <el-input-number class="wid80" @change="LowHighAvailable" :precision="0" placeholder="请输入原始重量(KG)" 183 + <el-input-number class="wid80" @change="LowHighAvailable" :min="0" :precision="0" placeholder="请输入原始重量(KG)"
184 - v-model="form.originalWeight"></el-input-number> 184 + v-model="form.originalWeight" v-input-filter></el-input-number>
185 </el-form-item> 185 </el-form-item>
186 </el-col> 186 </el-col>
187 </el-row> 187 </el-row>
...@@ -359,7 +359,7 @@ export default { ...@@ -359,7 +359,7 @@ export default {
359 route: [ 359 route: [
360 { 360 {
361 required: true, 361 required: true,
362 - message: "航班路线不能为空", 362 + message: "航班路线不能为空",
363 trigger: "change", 363 trigger: "change",
364 }, 364 },
365 // { 365 // {
...@@ -482,6 +482,29 @@ export default { ...@@ -482,6 +482,29 @@ export default {
482 shiftKey: false, 482 shiftKey: false,
483 }; 483 };
484 }, 484 },
485 + directives: {
486 + // 处理加减天数
487 + "input-filter": {
488 + bind: function (el, binding, { context }) {
489 + el.handler = function (event) {
490 + if (event.data == "E" || event.data == "e") {
491 + // 无理数时
492 + event.target.value = "";
493 + }
494 + if (event.target.value) {
495 + if (Number(event.target.value) < 0) {
496 + event.target.value = "";
497 + }
498 + event.target.dispatchEvent(new Event("input"));
499 + }
500 + };
501 + el.addEventListener("input", el.handler);
502 + },
503 + unbind: function (el) {
504 + el.removeEventListener("input", el.handler);
505 + },
506 + },
507 + },
485 created() { 508 created() {
486 //查询条件数据源 509 //查询条件数据源
487 this.queryParams.fltDateStart = this.nowDate() 510 this.queryParams.fltDateStart = this.nowDate()
...@@ -615,11 +638,15 @@ export default { ...@@ -615,11 +638,15 @@ export default {
615 this.selectOption.flightKindlist.forEach(item => { 638 this.selectOption.flightKindlist.forEach(item => {
616 if (item.id == val) { 639 if (item.id == val) {
617 if (item.chineseName.indexOf('White') >= 0) { 640 if (item.chineseName.indexOf('White') >= 0) {
618 - this.form.route = ''
619 this.routeMultiple = false 641 this.routeMultiple = false
642 + // this.rules.route[0].type = 'string'
643 + this.form.route = ''
644 + // this.rules.route[0].required = true;
620 } else if (item.chineseName.indexOf('Purple') >= 0) { 645 } else if (item.chineseName.indexOf('Purple') >= 0) {
621 - this.form.route = []
622 this.routeMultiple = true 646 this.routeMultiple = true
647 + // this.rules.route[0].type = 'array'
648 + this.form.route = []
649 + // this.rules.route[0].required = true;
623 } 650 }
624 } 651 }
625 }) 652 })
...@@ -1109,6 +1136,11 @@ export default { ...@@ -1109,6 +1136,11 @@ export default {
1109 }, 1136 },
1110 //航线修改 1137 //航线修改
1111 routeChange(val) { 1138 routeChange(val) {
1139 + if(val.length){
1140 + this.rules.route[0].required = false;
1141 + }else{
1142 + // this.rules.route[0].required = true;
1143 + }
1112 this.$forceUpdate() 1144 this.$forceUpdate()
1113 }, 1145 },
1114 //多选框选中数据 1146 //多选框选中数据
......
...@@ -501,7 +501,7 @@ export default { ...@@ -501,7 +501,7 @@ export default {
501 directives: { 501 directives: {
502 // 处理加减天数 502 // 处理加减天数
503 "input-filter": { 503 "input-filter": {
504 - bind: function (el, binding) { 504 + bind: function (el, binding, { context }) {
505 el.handler = function (event) { 505 el.handler = function (event) {
506 if (event.data == "E" || event.data == "e") { 506 if (event.data == "E" || event.data == "e") {
507 // 无理数时 507 // 无理数时
...@@ -510,10 +510,10 @@ export default { ...@@ -510,10 +510,10 @@ export default {
510 if (event.target.value) { 510 if (event.target.value) {
511 if (Number(event.target.value) < -7) { 511 if (Number(event.target.value) < -7) {
512 event.target.value = ""; 512 event.target.value = "";
513 - this.msgError("加减天数最小不能低于7天"); 513 + context.msgError("加减天数最小不能低于7天");
514 } else if (Number(event.target.value) > 7) { 514 } else if (Number(event.target.value) > 7) {
515 event.target.value = ""; 515 event.target.value = "";
516 - this.msgError("加减天数最小不能大于7天"); 516 + context.msgError("加减天数最小不能大于7天");
517 } else if (/[\.]/.test(Number(event.target.value))) { 517 } else if (/[\.]/.test(Number(event.target.value))) {
518 // 浮点数时 518 // 浮点数时
519 event.target.value = ""; 519 event.target.value = "";
......