Showing
4 changed files
with
45 additions
and
38 deletions
| ... | @@ -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="1" 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> | ... | ... |
| ... | @@ -34,8 +34,8 @@ | ... | @@ -34,8 +34,8 @@ |
| 34 | params: { handle: 'add', fltNo: 'new', fltDate: ' ', status: null, routeStatus: '' }, | 34 | params: { handle: 'add', fltNo: 'new', fltDate: ' ', status: null, routeStatus: '' }, |
| 35 | }) | 35 | }) |
| 36 | ">添加</el-button> | 36 | ">添加</el-button> |
| 37 | - <el-switch style="margin-left: 10px;" v-model="queryParams.querySpecifyData" inactive-text="日期查询" active-value="1" inactive-value="2" active-color="#13ce66" | 37 | + <el-switch style="margin-left: 10px;" v-model="queryParams.querySpecifyData" inactive-text="日期查询" active-value="1" |
| 38 | - inactive-color="#909399" @change="switchChange"></el-switch> | 38 | + inactive-value="2" active-color="#13ce66" inactive-color="#909399" @change="switchChange"></el-switch> |
| 39 | </div> | 39 | </div> |
| 40 | </el-form> | 40 | </el-form> |
| 41 | <Tables ref="newTables" ductName="FlightAlloc" :data="flyList" :headerData="tableHeaders['flightAlloc']" :order="true" | 41 | <Tables ref="newTables" ductName="FlightAlloc" :data="flyList" :headerData="tableHeaders['flightAlloc']" :order="true" |
| ... | @@ -152,7 +152,7 @@ export default { | ... | @@ -152,7 +152,7 @@ export default { |
| 152 | fltDate: fltDate != null ? fltDate : ' ', | 152 | fltDate: fltDate != null ? fltDate : ' ', |
| 153 | route: ' ', | 153 | route: ' ', |
| 154 | routeStatus: 'FlightAllocConfig', | 154 | routeStatus: 'FlightAllocConfig', |
| 155 | - status: status, | 155 | + status: status == '3' ? '3' : ' ', |
| 156 | createStatus: 1 | 156 | createStatus: 1 |
| 157 | } | 157 | } |
| 158 | this.$router.push({ | 158 | this.$router.push({ | ... | ... |
This diff is collapsed. Click to expand it.
| ... | @@ -47,8 +47,7 @@ | ... | @@ -47,8 +47,7 @@ |
| 47 | </el-form-item> | 47 | </el-form-item> |
| 48 | </el-col> | 48 | </el-col> |
| 49 | </el-row> | 49 | </el-row> |
| 50 | - <el-button class="mt10" type="primary" icon="el-icon-search" size="mini" :loading="loading" | 50 | + <el-button class="mt10" type="primary" icon="el-icon-search" size="mini" :loading="loading" @click="handleQuery">搜索 |
| 51 | - @click="handleQuery">搜索 | ||
| 52 | </el-button> | 51 | </el-button> |
| 53 | <el-button class="mt10" icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> | 52 | <el-button class="mt10" icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> |
| 54 | <el-button class="mt10" type="primary" icon="el-icon-plus" size="mini" @click="handleAdd" | 53 | <el-button class="mt10" type="primary" icon="el-icon-plus" size="mini" @click="handleAdd" |
| ... | @@ -81,8 +80,8 @@ | ... | @@ -81,8 +80,8 @@ |
| 81 | <Tables ref="flightInfoTable" ductName="FlightInformation" :data="findAllFltDatList" :headerData="tableHeader" | 80 | <Tables ref="flightInfoTable" ductName="FlightInformation" :data="findAllFltDatList" :headerData="tableHeader" |
| 82 | :order="true" :selection="true" :totalCount="total" :loading="loading" :limitSize="queryParams.limitSize" | 81 | :order="true" :selection="true" :totalCount="total" :loading="loading" :limitSize="queryParams.limitSize" |
| 83 | :page="queryParams.pageNum" :shiftKey="shiftKey" :height="tableHeight" :pageSizes="[20, 30, 40, 50, 100]" | 82 | :page="queryParams.pageNum" :shiftKey="shiftKey" :height="tableHeight" :pageSizes="[20, 30, 40, 50, 100]" |
| 84 | - @tableSelect="tableSelect" @tableSelectAll="tableSelectAll" @currentChange="currentChange" | 83 | + @tableSelect="tableSelect" @tableSelectAll="tableSelectAll" @currentChange="currentChange" @sortChange="sortChange" |
| 85 | - @sortChange="sortChange" @sizeChange="sizeChange"> | 84 | + @sizeChange="sizeChange"> |
| 86 | <template slot="optionColumn"> | 85 | <template slot="optionColumn"> |
| 87 | <el-table-column v-if="findAllFltDatList.length > 0" label="操作" align="center" | 86 | <el-table-column v-if="findAllFltDatList.length > 0" label="操作" align="center" |
| 88 | class-name="small-padding fixed-width" :fixed="tableHeader.length > 10 ? 'right' : false" width="160"> | 87 | class-name="small-padding fixed-width" :fixed="tableHeader.length > 10 ? 'right' : false" width="160"> |
| ... | @@ -116,8 +115,8 @@ | ... | @@ -116,8 +115,8 @@ |
| 116 | <el-row> | 115 | <el-row> |
| 117 | <el-col :span="12"> | 116 | <el-col :span="12"> |
| 118 | <el-form-item label="航班日期" prop="fltDate"> | 117 | <el-form-item label="航班日期" prop="fltDate"> |
| 119 | - <el-date-picker class="wid80" :disabled="formdisabled.fltDate" clearable size="small" | 118 | + <el-date-picker class="wid80" :disabled="formdisabled.fltDate" clearable size="small" v-model="form.fltDate" |
| 120 | - v-model="form.fltDate" type="date" value-format="yyyy-MM-dd" placeholder="选择航班日期"> | 119 | + type="date" value-format="yyyy-MM-dd" placeholder="选择航班日期"> |
| 121 | </el-date-picker> | 120 | </el-date-picker> |
| 122 | </el-form-item> | 121 | </el-form-item> |
| 123 | </el-col> | 122 | </el-col> |
| ... | @@ -143,15 +142,15 @@ | ... | @@ -143,15 +142,15 @@ |
| 143 | </el-tooltip> | 142 | </el-tooltip> |
| 144 | </div> | 143 | </div> |
| 145 | </template> | 144 | </template> |
| 146 | - <el-select v-if="routeMultiple" ref="routeSelect" class="wid80" v-model="form.route" :disabled="formdisabled.route" | 145 | + <el-select v-if="routeMultiple" ref="routeSelect" class="wid80" v-model="form.route" |
| 147 | - placeholder="请选择航线" no-data-text="未查询到航线" @change="routeChange" :loading="routeLoading" | 146 | + :disabled="formdisabled.route" placeholder="请选择航线" no-data-text="未查询到航线" @change="routeChange" |
| 148 | - :multiple='true' :key="routeMultiple"> | 147 | + :loading="routeLoading" :multiple='true' :key="routeMultiple"> |
| 149 | <el-option v-for="item in routeList" :key="item.id" :label="item.route" :value="item.route"> | 148 | <el-option v-for="item in routeList" :key="item.id" :label="item.route" :value="item.route"> |
| 150 | </el-option> | 149 | </el-option> |
| 151 | </el-select> | 150 | </el-select> |
| 152 | - <el-select v-if="routeMultiple == false" ref="routeSelect" class="wid80" v-model="form.route" :disabled="formdisabled.route" | 151 | + <el-select v-if="routeMultiple == false" ref="routeSelect" class="wid80" v-model="form.route" |
| 153 | - placeholder="请选择航线" no-data-text="未查询到航线" @change="routeChange" :loading="routeLoading" | 152 | + :disabled="formdisabled.route" placeholder="请选择航线" no-data-text="未查询到航线" @change="routeChange" |
| 154 | - :multiple='false' :key="routeMultiple"> | 153 | + :loading="routeLoading" :multiple='false' :key="routeMultiple"> |
| 155 | <el-option v-for="item in routeList" :key="item.id" :label="item.route" :value="item.route"> | 154 | <el-option v-for="item in routeList" :key="item.id" :label="item.route" :value="item.route"> |
| 156 | </el-option> | 155 | </el-option> |
| 157 | </el-select> | 156 | </el-select> |
| ... | @@ -188,8 +187,8 @@ | ... | @@ -188,8 +187,8 @@ |
| 188 | <el-row> | 187 | <el-row> |
| 189 | <el-col :span="12"> | 188 | <el-col :span="12"> |
| 190 | <el-form-item label="额外增重百分比" prop="extraWeightPercent"> | 189 | <el-form-item label="额外增重百分比" prop="extraWeightPercent"> |
| 191 | - <el-input-number class="wid80" @change="LowHighAvailable" :precision="0" placeholder="请输入额外增重百分比" | 190 | + <el-input-number class="wid80" @change="LowHighAvailable" :min="0" :precision="0" placeholder="请输入额外增重百分比" |
| 192 | - v-model="form.extraWeightPercent"></el-input-number> | 191 | + v-model="form.extraWeightPercent" v-input-filter></el-input-number> |
| 193 | </el-form-item> | 192 | </el-form-item> |
| 194 | </el-col> | 193 | </el-col> |
| 195 | <el-col :span="12"> | 194 | <el-col :span="12"> |
| ... | @@ -359,7 +358,7 @@ export default { | ... | @@ -359,7 +358,7 @@ export default { |
| 359 | route: [ | 358 | route: [ |
| 360 | { | 359 | { |
| 361 | required: true, | 360 | required: true, |
| 362 | - message: "航班路线不能为空呀", | 361 | + message: "航班路线不能为空", |
| 363 | trigger: "change", | 362 | trigger: "change", |
| 364 | }, | 363 | }, |
| 365 | // { | 364 | // { |
| ... | @@ -617,7 +616,7 @@ export default { | ... | @@ -617,7 +616,7 @@ export default { |
| 617 | this.routeLoading = false | 616 | this.routeLoading = false |
| 618 | if (res.code === 200) { | 617 | if (res.code === 200) { |
| 619 | this.routeList = res.data.list | 618 | this.routeList = res.data.list |
| 620 | - if(res.data.list.length == 0){ | 619 | + if (res.data.list.length == 0) { |
| 621 | this.form.route = ""; | 620 | this.form.route = ""; |
| 622 | this.msgError("该航班没有设置航线"); | 621 | this.msgError("该航班没有设置航线"); |
| 623 | } | 622 | } |
| ... | @@ -628,7 +627,7 @@ export default { | ... | @@ -628,7 +627,7 @@ export default { |
| 628 | this.routeLoading = false | 627 | this.routeLoading = false |
| 629 | console.log(err) | 628 | console.log(err) |
| 630 | }) | 629 | }) |
| 631 | - }else{ | 630 | + } else { |
| 632 | this.form.route = ""; | 631 | this.form.route = ""; |
| 633 | this.routeList = []; | 632 | this.routeList = []; |
| 634 | } | 633 | } |
| ... | @@ -639,15 +638,12 @@ export default { | ... | @@ -639,15 +638,12 @@ export default { |
| 639 | if (item.id == val) { | 638 | if (item.id == val) { |
| 640 | if (item.chineseName.indexOf('White') >= 0) { | 639 | if (item.chineseName.indexOf('White') >= 0) { |
| 641 | this.routeMultiple = false | 640 | this.routeMultiple = false |
| 642 | - // this.rules.route[0].type = 'string' | ||
| 643 | this.form.route = '' | 641 | this.form.route = '' |
| 644 | - // this.rules.route[0].required = true; | ||
| 645 | } else if (item.chineseName.indexOf('Purple') >= 0) { | 642 | } else if (item.chineseName.indexOf('Purple') >= 0) { |
| 646 | this.routeMultiple = true | 643 | this.routeMultiple = true |
| 647 | - // this.rules.route[0].type = 'array' | ||
| 648 | this.form.route = [] | 644 | this.form.route = [] |
| 649 | - // this.rules.route[0].required = true; | ||
| 650 | } | 645 | } |
| 646 | + this.validateFieldForm() | ||
| 651 | } | 647 | } |
| 652 | }) | 648 | }) |
| 653 | // this.$refs.routeSelect.$forceUpdate() | 649 | // this.$refs.routeSelect.$forceUpdate() |
| ... | @@ -730,7 +726,7 @@ export default { | ... | @@ -730,7 +726,7 @@ export default { |
| 730 | this.formdisabled.typeId = false; | 726 | this.formdisabled.typeId = false; |
| 731 | //原始重量 | 727 | //原始重量 |
| 732 | this.formdisabled.originalWeight = false; | 728 | this.formdisabled.originalWeight = false; |
| 733 | - this.$nextTick(()=>{ | 729 | + this.$nextTick(() => { |
| 734 | this.$refs.form.clearValidate() | 730 | this.$refs.form.clearValidate() |
| 735 | }) | 731 | }) |
| 736 | }, | 732 | }, |
| ... | @@ -899,11 +895,11 @@ export default { | ... | @@ -899,11 +895,11 @@ export default { |
| 899 | }) | 895 | }) |
| 900 | }, | 896 | }, |
| 901 | // 航班状态 | 897 | // 航班状态 |
| 902 | - flightState(multipleSelection, statusName){ | 898 | + flightState(multipleSelection, statusName) { |
| 903 | - let flightState = multipleSelection.some(item=>item.statusName == statusName); | 899 | + let flightState = multipleSelection.some(item => item.statusName == statusName); |
| 904 | - if(flightState){ | 900 | + if (flightState) { |
| 905 | this.msgError(`勾选的航班,航班状态为${statusName},不可操作该按钮`); | 901 | this.msgError(`勾选的航班,航班状态为${statusName},不可操作该按钮`); |
| 906 | - }else{ | 902 | + } else { |
| 907 | flightState = false | 903 | flightState = false |
| 908 | } | 904 | } |
| 909 | return flightState | 905 | return flightState |
| ... | @@ -915,7 +911,7 @@ export default { | ... | @@ -915,7 +911,7 @@ export default { |
| 915 | fIds.push(item.id) | 911 | fIds.push(item.id) |
| 916 | }); | 912 | }); |
| 917 | // 航班状态 | 913 | // 航班状态 |
| 918 | - if(this.flightState(this.ids, "已删除")) return | 914 | + if (this.flightState(this.ids, "已删除")) return |
| 919 | this.$confirm("是否确认删除所选数据?", "警告", { | 915 | this.$confirm("是否确认删除所选数据?", "警告", { |
| 920 | confirmButtonText: "确定", | 916 | confirmButtonText: "确定", |
| 921 | cancelButtonText: "取消", | 917 | cancelButtonText: "取消", |
| ... | @@ -946,6 +942,7 @@ export default { | ... | @@ -946,6 +942,7 @@ export default { |
| 946 | }, | 942 | }, |
| 947 | /** 提交按钮 */ | 943 | /** 提交按钮 */ |
| 948 | submitForm: function () { | 944 | submitForm: function () { |
| 945 | + this.validateFieldForm() | ||
| 949 | this.$refs["form"].validate((valid) => { | 946 | this.$refs["form"].validate((valid) => { |
| 950 | if (valid) { | 947 | if (valid) { |
| 951 | let formdata = JSON.parse(JSON.stringify(this.form)); | 948 | let formdata = JSON.parse(JSON.stringify(this.form)); |
| ... | @@ -1023,7 +1020,7 @@ export default { | ... | @@ -1023,7 +1020,7 @@ export default { |
| 1023 | //批量开启/关闭航班 | 1020 | //批量开启/关闭航班 |
| 1024 | handleFlightStatus(status) { | 1021 | handleFlightStatus(status) { |
| 1025 | // 航班状态 | 1022 | // 航班状态 |
| 1026 | - if(this.flightState(this.ids, "已删除")) return | 1023 | + if (this.flightState(this.ids, "已删除")) return |
| 1027 | let handle = status == "flightStatus80" ? "关闭" : "开启"; | 1024 | let handle = status == "flightStatus80" ? "关闭" : "开启"; |
| 1028 | let data = { | 1025 | let data = { |
| 1029 | updateIds: [], | 1026 | updateIds: [], |
| ... | @@ -1054,7 +1051,7 @@ export default { | ... | @@ -1054,7 +1051,7 @@ export default { |
| 1054 | //自动推送开关 | 1051 | //自动推送开关 |
| 1055 | autoPushBatch(status) { | 1052 | autoPushBatch(status) { |
| 1056 | // 航班状态 | 1053 | // 航班状态 |
| 1057 | - if(this.flightState(this.ids, "已删除")) return | 1054 | + if (this.flightState(this.ids, "已删除")) return |
| 1058 | let msg = status == "open" ? "开启" : "关闭"; | 1055 | let msg = status == "open" ? "开启" : "关闭"; |
| 1059 | let data = { | 1056 | let data = { |
| 1060 | updateIds: [], | 1057 | updateIds: [], |
| ... | @@ -1093,7 +1090,7 @@ export default { | ... | @@ -1093,7 +1090,7 @@ export default { |
| 1093 | //白名单配舱开关 | 1090 | //白名单配舱开关 |
| 1094 | whiteListSwitchStatus(val) { | 1091 | whiteListSwitchStatus(val) { |
| 1095 | // 航班状态 | 1092 | // 航班状态 |
| 1096 | - if(this.flightState(this.ids, "已删除")) return | 1093 | + if (this.flightState(this.ids, "已删除")) return |
| 1097 | let obj = { | 1094 | let obj = { |
| 1098 | updateIds: [] | 1095 | updateIds: [] |
| 1099 | } | 1096 | } |
| ... | @@ -1115,7 +1112,7 @@ export default { | ... | @@ -1115,7 +1112,7 @@ export default { |
| 1115 | //黑名单配舱开关 | 1112 | //黑名单配舱开关 |
| 1116 | BlackListSwitchStatus(val) { | 1113 | BlackListSwitchStatus(val) { |
| 1117 | // 航班状态 | 1114 | // 航班状态 |
| 1118 | - if(this.flightState(this.ids, "已删除")) return | 1115 | + if (this.flightState(this.ids, "已删除")) return |
| 1119 | let obj = { | 1116 | let obj = { |
| 1120 | updateIds: [] | 1117 | updateIds: [] |
| 1121 | } | 1118 | } |
| ... | @@ -1134,12 +1131,22 @@ export default { | ... | @@ -1134,12 +1131,22 @@ export default { |
| 1134 | console.log(err) | 1131 | console.log(err) |
| 1135 | }) | 1132 | }) |
| 1136 | }, | 1133 | }, |
| 1134 | + // 对部分表单字段进行校验的方法 | ||
| 1135 | + validateFieldForm(){ | ||
| 1136 | + this.$refs.form.validateField(['route'], (flag) => {}) | ||
| 1137 | + if(this.form.route.length){ | ||
| 1138 | + this.$nextTick(()=>{ | ||
| 1139 | + this.$refs.form.clearValidate() | ||
| 1140 | + }) | ||
| 1141 | + } | ||
| 1142 | + }, | ||
| 1137 | //航线修改 | 1143 | //航线修改 |
| 1138 | routeChange(val) { | 1144 | routeChange(val) { |
| 1145 | + this.validateFieldForm() | ||
| 1139 | if(val.length){ | 1146 | if(val.length){ |
| 1140 | - this.rules.route[0].required = false; | 1147 | + this.$nextTick(()=>{ |
| 1141 | - }else{ | 1148 | + this.$refs.form.clearValidate() |
| 1142 | - // this.rules.route[0].required = true; | 1149 | + }) |
| 1143 | } | 1150 | } |
| 1144 | this.$forceUpdate() | 1151 | this.$forceUpdate() |
| 1145 | }, | 1152 | }, | ... | ... |
-
Please register or login to post a comment