Elements-SY

modify

...@@ -183,7 +183,6 @@ export default { ...@@ -183,7 +183,6 @@ export default {
183 183
184 methods: { 184 methods: {
185 getTrCurrentHeight: debounce(function () { 185 getTrCurrentHeight: debounce(function () {
186 -
187 this.$nextTick(() => { 186 this.$nextTick(() => {
188 // const trEl = 187 // const trEl =
189 // this.$refs.tableRef.$refs.bodyWrapper.children[0].children[1] 188 // this.$refs.tableRef.$refs.bodyWrapper.children[0].children[1]
...@@ -194,7 +193,6 @@ export default { ...@@ -194,7 +193,6 @@ export default {
194 // } 193 // }
195 }); 194 });
196 }, 800), 195 }, 800),
197 -
198 // 给表头列添加className 196 // 给表头列添加className
199 headerCellClassName({ row, column, rowIndex, columnIndex }) { 197 headerCellClassName({ row, column, rowIndex, columnIndex }) {
200 if (columnIndex !== 0) { 198 if (columnIndex !== 0) {
...@@ -255,6 +253,10 @@ export default { ...@@ -255,6 +253,10 @@ export default {
255 sort: this.attrs.isDragSort, 253 sort: this.attrs.isDragSort,
256 animation: 100, 254 animation: 100,
257 delay: 0, 255 delay: 0,
256 + onStart(evt) {
257 + // console.log("onStart:", evt);
258 + evt.oldIndex;
259 + },
258 onEnd({ newIndex, oldIndex }) { 260 onEnd({ newIndex, oldIndex }) {
259 // console.log("onEnd:", newIndex, oldIndex); 261 // console.log("onEnd:", newIndex, oldIndex);
260 const currRow = _this.tableData.splice(oldIndex, 1)[0]; 262 const currRow = _this.tableData.splice(oldIndex, 1)[0];
......
...@@ -122,162 +122,218 @@ export const inputBlurValidate = { ...@@ -122,162 +122,218 @@ export const inputBlurValidate = {
122 // 人民币最小申报价值 122 // 人民币最小申报价值
123 inputCNYBlurMin({ target }, customVal) { 123 inputCNYBlurMin({ target }, customVal) {
124 // 申报价值最小值和最大值都为空的情况下 124 // 申报价值最小值和最大值都为空的情况下
125 - if (this.queryForm.minCustomVal == "" && this.queryForm.maxCustomVal == "") { 125 + if (
126 + this.queryForm.minCustomVal == "" &&
127 + this.queryForm.maxCustomVal == ""
128 + ) {
126 this.validateForm = true; 129 this.validateForm = true;
127 this.$refs.minCNYCustomVal.innerHTML = ""; 130 this.$refs.minCNYCustomVal.innerHTML = "";
128 } 131 }
129 // 鼠标聚焦最小申报价值,最小申报价值无值的情况下去校验最大申报价值 132 // 鼠标聚焦最小申报价值,最小申报价值无值的情况下去校验最大申报价值
130 if (target.value == "" && this.queryForm.maxCustomVal) { 133 if (target.value == "" && this.queryForm.maxCustomVal) {
131 - if (/^(0|[1-9]\d*)(.\d{1,2})?$/.test(Number(this.queryForm.maxCustomVal))) { 134 + if (
135 + /^(0|[1-9]\d*)(.\d{1,2})?$/.test(Number(this.queryForm.maxCustomVal))
136 + ) {
132 this.validateForm = true; 137 this.validateForm = true;
133 this.$refs.minCNYCustomVal.innerHTML = ""; 138 this.$refs.minCNYCustomVal.innerHTML = "";
134 } 139 }
135 } 140 }
136 // 最小申报价值有值的情况下 141 // 最小申报价值有值的情况下
137 if (target.value && Number(target.value) >= 0) { 142 if (target.value && Number(target.value) >= 0) {
138 - if (/^(0|[1-9]\d*)(.\d{1,2})?$/.test(Number(this.queryForm.maxCustomVal))) { 143 + if (/^(0|[1-9]\d*)(.\d{1,2})?$/.test(Number(target.value))) {
144 + if (this.queryForm.maxCustomVal) {
145 + if (
146 + Number(this.queryForm.maxCustomVal) <
147 + Number(this.queryForm.minCustomVal)
148 + ) {
149 + this.validateForm = false;
150 + this.$refs.minCNYCustomVal.innerHTML =
151 + "最小申报价值不得大于最大申报价值";
152 + } else if (
153 + /^(0|[1-9]\d*)(.\d{1,2})?$/.test(
154 + Number(this.queryForm.maxCustomVal)
155 + )
156 + ) {
139 this.validateForm = true; 157 this.validateForm = true;
140 this.$refs.minCNYCustomVal.innerHTML = ""; 158 this.$refs.minCNYCustomVal.innerHTML = "";
141 } else { 159 } else {
142 this.validateForm = false; 160 this.validateForm = false;
143 - this.$refs.minCNYCustomVal.innerHTML = "请输入有效申报价值,小数保留2位"; 161 + this.$refs.minCNYCustomVal.innerHTML =
162 + "请输入有效申报价值,小数保留2位";
144 } 163 }
145 - if (/^(0|[1-9]\d*)(.\d{1,2})?$/.test(Number(target.value))) { 164 + } else {
146 this.validateForm = true; 165 this.validateForm = true;
147 this.$refs.minCNYCustomVal.innerHTML = ""; 166 this.$refs.minCNYCustomVal.innerHTML = "";
148 - } else {
149 - this.validateForm = false;
150 - this.$refs.minCNYCustomVal.innerHTML = "请输入有效申报价值,小数保留2位";
151 - }
152 } 167 }
153 - // 申报价值最小值和最大值都不为空的情况下 168 + } else {
154 - if (this.queryForm.minCustomVal && this.queryForm.maxCustomVal) {
155 - if (Number(this.queryForm.maxCustomVal) < Number(this.queryForm.minCustomVal)) {
156 this.validateForm = false; 169 this.validateForm = false;
157 - this.$refs.minCNYCustomVal.innerHTML = "最小申报价值不得大于最大申报价值"; 170 + this.$refs.minCNYCustomVal.innerHTML =
171 + "请输入有效申报价值,小数保留2位";
158 } 172 }
159 } 173 }
160 }, 174 },
161 // 人民币最大申报价值 175 // 人民币最大申报价值
162 inputCNYBlurMax({ target }, customVal) { 176 inputCNYBlurMax({ target }, customVal) {
163 // 申报价值最小值和最大值都为空的情况下 177 // 申报价值最小值和最大值都为空的情况下
164 - if (this.queryForm.minCustomVal == "" && this.queryForm.maxCustomVal == "") { 178 + if (
179 + this.queryForm.minCustomVal == "" &&
180 + this.queryForm.maxCustomVal == ""
181 + ) {
165 this.validateForm = true; 182 this.validateForm = true;
166 this.$refs.minCNYCustomVal.innerHTML = ""; 183 this.$refs.minCNYCustomVal.innerHTML = "";
167 } 184 }
168 // 鼠标聚焦最大申报价值,最大申报价值无值的情况下去校验最小申报价值 185 // 鼠标聚焦最大申报价值,最大申报价值无值的情况下去校验最小申报价值
169 if (target.value == "" && this.queryForm.minCustomVal) { 186 if (target.value == "" && this.queryForm.minCustomVal) {
170 - if (/^(0|[1-9]\d*)(.\d{1,2})?$/.test(Number(this.queryForm.minCustomVal))) { 187 + if (
188 + /^(0|[1-9]\d*)(.\d{1,2})?$/.test(Number(this.queryForm.minCustomVal))
189 + ) {
171 this.validateForm = true; 190 this.validateForm = true;
172 this.$refs.minCNYCustomVal.innerHTML = ""; 191 this.$refs.minCNYCustomVal.innerHTML = "";
173 } else { 192 } else {
174 this.validateForm = false; 193 this.validateForm = false;
175 - this.$refs.minCNYCustomVal.innerHTML = "请输入有效申报价值,小数保留2位"; 194 + this.$refs.minCNYCustomVal.innerHTML =
195 + "请输入有效申报价值,小数保留2位";
176 } 196 }
177 } 197 }
178 // 最大申报价值有值的情况下 198 // 最大申报价值有值的情况下
179 if (target.value && Number(target.value) >= 0) { 199 if (target.value && Number(target.value) >= 0) {
180 - if (/^(0|[1-9]\d*)(.\d{1,2})?$/.test(Number(this.queryForm.minCustomVal))) {
181 - this.validateForm = true;
182 - this.$refs.minCNYCustomVal.innerHTML = "";
183 - } else {
184 - this.validateForm = false;
185 - this.$refs.minCNYCustomVal.innerHTML = "请输入有效申报价值,小数保留2位";
186 - }
187 if (/^(0|[1-9]\d*)(.\d{1,2})?$/.test(Number(target.value))) { 200 if (/^(0|[1-9]\d*)(.\d{1,2})?$/.test(Number(target.value))) {
201 + if (this.queryForm.minCustomVal) {
202 + if (
203 + Number(this.queryForm.maxCustomVal) <
204 + Number(this.queryForm.minCustomVal)
205 + ) {
206 + this.validateForm = false;
207 + this.$refs.minCNYCustomVal.innerHTML =
208 + "最小申报价值不得大于最大申报价值";
209 + } else if (
210 + /^(0|[1-9]\d*)(.\d{1,2})?$/.test(
211 + Number(this.queryForm.minCustomVal)
212 + )
213 + ) {
188 this.validateForm = true; 214 this.validateForm = true;
189 this.$refs.minCNYCustomVal.innerHTML = ""; 215 this.$refs.minCNYCustomVal.innerHTML = "";
190 } else { 216 } else {
191 this.validateForm = false; 217 this.validateForm = false;
192 - this.$refs.minCNYCustomVal.innerHTML = "请输入有效申报价值,小数保留2位"; 218 + this.$refs.minCNYCustomVal.innerHTML =
219 + "请输入有效申报价值,小数保留2位";
193 } 220 }
194 } 221 }
195 - // 申报价值最小值和最大值都不为空的情况下 222 + } else {
196 - if (this.queryForm.minCustomVal && this.queryForm.maxCustomVal) {
197 - if (Number(this.queryForm.maxCustomVal) < Number(this.queryForm.minCustomVal)) {
198 this.validateForm = false; 223 this.validateForm = false;
199 - this.$refs.minCNYCustomVal.innerHTML = "最小申报价值不得大于最大申报价值"; 224 + this.$refs.minCNYCustomVal.innerHTML =
225 + "请输入有效申报价值,小数保留2位";
200 } 226 }
201 } 227 }
202 }, 228 },
203 // 美元最小申报价值 229 // 美元最小申报价值
204 inputSUDBlurMin({ target }, customVal) { 230 inputSUDBlurMin({ target }, customVal) {
205 // 申报价值最小值和最大值都为空的情况下 231 // 申报价值最小值和最大值都为空的情况下
206 - if (this.queryForm.minUsdCustomVal == "" && this.queryForm.maxUsdCustomVal == "") { 232 + if (
233 + this.queryForm.minUsdCustomVal == "" &&
234 + this.queryForm.maxUsdCustomVal == ""
235 + ) {
207 this.validateForm = true; 236 this.validateForm = true;
208 this.$refs.minSUDCustomVal.innerHTML = ""; 237 this.$refs.minSUDCustomVal.innerHTML = "";
209 } 238 }
210 // 鼠标聚焦最小申报价值,最小申报价值无值的情况下去校验最大申报价值 239 // 鼠标聚焦最小申报价值,最小申报价值无值的情况下去校验最大申报价值
211 if (target.value == "" && this.queryForm.maxUsdCustomVal) { 240 if (target.value == "" && this.queryForm.maxUsdCustomVal) {
212 - if (/^(0|[1-9]\d*)(.\d{1,2})?$/.test(Number(this.queryForm.maxUsdCustomVal))) { 241 + if (
242 + /^(0|[1-9]\d*)(.\d{1,2})?$/.test(
243 + Number(this.queryForm.maxUsdCustomVal)
244 + )
245 + ) {
213 this.validateForm = true; 246 this.validateForm = true;
214 this.$refs.minSUDCustomVal.innerHTML = ""; 247 this.$refs.minSUDCustomVal.innerHTML = "";
215 } 248 }
216 } 249 }
217 // 最小申报价值有值的情况下 250 // 最小申报价值有值的情况下
218 if (target.value && Number(target.value) >= 0) { 251 if (target.value && Number(target.value) >= 0) {
219 - if (/^(0|[1-9]\d*)(.\d{1,2})?$/.test(Number(this.queryForm.maxUsdCustomVal))) { 252 + if (/^(0|[1-9]\d*)(.\d{1,2})?$/.test(Number(target.value))) {
253 + if (this.queryForm.maxUsdCustomVal) {
254 + if (
255 + Number(this.queryForm.maxUsdCustomVal) <
256 + Number(this.queryForm.minUsdCustomVal)
257 + ) {
258 + this.validateForm = false;
259 + this.$refs.minSUDCustomVal.innerHTML =
260 + "最小申报价值不得大于最大申报价值";
261 + } else if (
262 + /^(0|[1-9]\d*)(.\d{1,2})?$/.test(
263 + Number(this.queryForm.maxUsdCustomVal)
264 + )
265 + ) {
220 this.validateForm = true; 266 this.validateForm = true;
221 this.$refs.minSUDCustomVal.innerHTML = ""; 267 this.$refs.minSUDCustomVal.innerHTML = "";
222 } else { 268 } else {
223 this.validateForm = false; 269 this.validateForm = false;
224 - this.$refs.minSUDCustomVal.innerHTML = "请输入有效申报价值,小数保留2位"; 270 + this.$refs.minSUDCustomVal.innerHTML =
271 + "请输入有效申报价值,小数保留2位";
225 } 272 }
226 - if (/^(0|[1-9]\d*)(.\d{1,2})?$/.test(Number(target.value))) { 273 + } else {
227 this.validateForm = true; 274 this.validateForm = true;
228 this.$refs.minSUDCustomVal.innerHTML = ""; 275 this.$refs.minSUDCustomVal.innerHTML = "";
229 - } else {
230 - this.validateForm = false;
231 - this.$refs.minSUDCustomVal.innerHTML = "请输入有效申报价值,小数保留2位";
232 - }
233 } 276 }
234 - // 申报价值最小值和最大值都不为空的情况下 277 + } else {
235 - if (this.queryForm.minUsdCustomVal && this.queryForm.maxUsdCustomVal) {
236 - if (Number(this.queryForm.maxUsdCustomVal) < Number(this.queryForm.minUsdCustomVal)) {
237 this.validateForm = false; 278 this.validateForm = false;
238 - this.$refs.minSUDCustomVal.innerHTML = "最小申报价值不得大于最大申报价值"; 279 + this.$refs.minSUDCustomVal.innerHTML =
280 + "请输入有效申报价值,小数保留2位";
239 } 281 }
240 } 282 }
241 }, 283 },
242 // 美元最大申报价值 284 // 美元最大申报价值
243 inputSUDBlurMax({ target }, customVal) { 285 inputSUDBlurMax({ target }, customVal) {
244 // 申报价值最小值和最大值都为空的情况下 286 // 申报价值最小值和最大值都为空的情况下
245 - if (this.queryForm.minUsdCustomVal == "" && this.queryForm.maxUsdCustomVal == "") { 287 + if (
288 + this.queryForm.minUsdCustomVal == "" &&
289 + this.queryForm.maxUsdCustomVal == ""
290 + ) {
246 this.validateForm = true; 291 this.validateForm = true;
247 this.$refs.minSUDCustomVal.innerHTML = ""; 292 this.$refs.minSUDCustomVal.innerHTML = "";
248 } 293 }
249 // 鼠标聚焦最大申报价值,最大申报价值无值的情况下去校验最小申报价值 294 // 鼠标聚焦最大申报价值,最大申报价值无值的情况下去校验最小申报价值
250 if (target.value == "" && this.queryForm.minUsdCustomVal) { 295 if (target.value == "" && this.queryForm.minUsdCustomVal) {
251 - if (/^(0|[1-9]\d*)(.\d{1,2})?$/.test(Number(this.queryForm.minUsdCustomVal))) { 296 + if (
297 + /^(0|[1-9]\d*)(.\d{1,2})?$/.test(
298 + Number(this.queryForm.minUsdCustomVal)
299 + )
300 + ) {
252 this.validateForm = true; 301 this.validateForm = true;
253 this.$refs.minSUDCustomVal.innerHTML = ""; 302 this.$refs.minSUDCustomVal.innerHTML = "";
254 } else { 303 } else {
255 this.validateForm = false; 304 this.validateForm = false;
256 - this.$refs.minSUDCustomVal.innerHTML = "请输入有效申报价值,小数保留2位"; 305 + this.$refs.minSUDCustomVal.innerHTML =
306 + "请输入有效申报价值,小数保留2位";
257 } 307 }
258 } 308 }
259 // 最大申报价值有值的情况下 309 // 最大申报价值有值的情况下
260 if (target.value && Number(target.value) >= 0) { 310 if (target.value && Number(target.value) >= 0) {
261 - if (/^(0|[1-9]\d*)(.\d{1,2})?$/.test(Number(this.queryForm.minUsdCustomVal))) {
262 - this.validateForm = true;
263 - this.$refs.minSUDCustomVal.innerHTML = "";
264 - } else {
265 - this.validateForm = false;
266 - this.$refs.minSUDCustomVal.innerHTML = "请输入有效申报价值,小数保留2位";
267 - }
268 if (/^(0|[1-9]\d*)(.\d{1,2})?$/.test(Number(target.value))) { 311 if (/^(0|[1-9]\d*)(.\d{1,2})?$/.test(Number(target.value))) {
312 + if (this.queryForm.minUsdCustomVal) {
313 + if (
314 + Number(this.queryForm.maxUsdCustomVal) <
315 + Number(this.queryForm.minUsdCustomVal)
316 + ) {
317 + this.validateForm = false;
318 + this.$refs.minSUDCustomVal.innerHTML =
319 + "最小申报价值不得大于最大申报价值";
320 + } else if (
321 + /^(0|[1-9]\d*)(.\d{1,2})?$/.test(
322 + Number(this.queryForm.minUsdCustomVal)
323 + )
324 + ) {
269 this.validateForm = true; 325 this.validateForm = true;
270 this.$refs.minSUDCustomVal.innerHTML = ""; 326 this.$refs.minSUDCustomVal.innerHTML = "";
271 } else { 327 } else {
272 this.validateForm = false; 328 this.validateForm = false;
273 - this.$refs.minSUDCustomVal.innerHTML = "请输入有效申报价值,小数保留2位"; 329 + this.$refs.minSUDCustomVal.innerHTML =
330 + "请输入有效申报价值,小数保留2位";
274 } 331 }
275 } 332 }
276 - // 申报价值最小值和最大值都不为空的情况下 333 + } else {
277 - if (this.queryForm.minUsdCustomVal && this.queryForm.maxUsdCustomVal) {
278 - if (Number(this.queryForm.maxUsdCustomVal) < Number(this.queryForm.minUsdCustomVal)) {
279 this.validateForm = false; 334 this.validateForm = false;
280 - this.$refs.minSUDCustomVal.innerHTML = "最小申报价值不得大于最大申报价值"; 335 + this.$refs.minSUDCustomVal.innerHTML =
336 + "请输入有效申报价值,小数保留2位";
281 } 337 }
282 } 338 }
283 }, 339 },
......
...@@ -11,10 +11,10 @@ ...@@ -11,10 +11,10 @@
11 formWidth="auto" 11 formWidth="auto"
12 @blur="blurEvent" 12 @blur="blurEvent"
13 > 13 >
14 - <yl-draggable 14 + <route-draggable
15 :routeList="routeList" 15 :routeList="routeList"
16 :dragOptions="dragOptions" 16 :dragOptions="dragOptions"
17 - ></yl-draggable> 17 + ></route-draggable>
18 </yl-form> 18 </yl-form>
19 </el-col> 19 </el-col>
20 </el-row> 20 </el-row>
...@@ -49,8 +49,8 @@ ...@@ -49,8 +49,8 @@
49 </template> 49 </template>
50 <script> 50 <script>
51 import YlForm from "@/components/YlForm"; 51 import YlForm from "@/components/YlForm";
52 -import RouteInfo from "../components/routeInfo"; 52 +import RouteInfo from "../components/RouteInfo";
53 -import YlDraggable from "@/components/YlDraggable"; 53 +import RouteDraggable from "../components/RouteDraggable";
54 import { formConfig, routeRuleForm, validateForm } from "./formConfig"; 54 import { formConfig, routeRuleForm, validateForm } from "./formConfig";
55 import { 55 import {
56 updateOrAddFlight, // 新增/修改航线规则设置 56 updateOrAddFlight, // 新增/修改航线规则设置
...@@ -64,7 +64,7 @@ export default { ...@@ -64,7 +64,7 @@ export default {
64 components: { 64 components: {
65 YlForm, 65 YlForm,
66 RouteInfo, 66 RouteInfo,
67 - YlDraggable, 67 + RouteDraggable,
68 }, 68 },
69 mixins: [indexMixins], 69 mixins: [indexMixins],
70 data() { 70 data() {
...@@ -105,7 +105,7 @@ export default { ...@@ -105,7 +105,7 @@ export default {
105 dataStatus: this.$route.query.dataStatus || "", // add 、edit、view 105 dataStatus: this.$route.query.dataStatus || "", // add 、edit、view
106 flightKindName: this.$route.query.flightKindName || "", // 航班种类White Tail 、Purple Tail 106 flightKindName: this.$route.query.flightKindName || "", // 航班种类White Tail 、Purple Tail
107 pageName: this.$route.query.pageName || "", // 107 pageName: this.$route.query.pageName || "", //
108 - id: this.$route.query.id, 108 + id: this.$route.query.id || "",
109 }; 109 };
110 // 指定隐藏或显示From表单域 110 // 指定隐藏或显示From表单域
111 this.hiddenFormItem(parmas); 111 this.hiddenFormItem(parmas);
......
...@@ -405,8 +405,8 @@ export default { ...@@ -405,8 +405,8 @@ export default {
405 if (this.$route.query.flightKindName == "Purple Tail") { 405 if (this.$route.query.flightKindName == "Purple Tail") {
406 this.showFlightKind(dateDataLists); 406 this.showFlightKind(dateDataLists);
407 } 407 }
408 - } 408 + } else {
409 - if (dateConfigFlag == false) { 409 + // 当前航线有缺省的航线配置
410 // 航班航线有规则配置的 410 // 航班航线有规则配置的
411 const dateListHas = mergeDateRouteInfo.filter( 411 const dateListHas = mergeDateRouteInfo.filter(
412 (item) => item.config == true 412 (item) => item.config == true
......
1 +import YlElInputNumber from "./src/input-number";
2 +
3 +/* istanbul ignore next */
4 +YlElInputNumber.install = function (Vue) {
5 + Vue.component(YlElInputNumber.name, YlElInputNumber);
6 +};
7 +
8 +export default YlElInputNumber;
1 +<template>
2 + <div
3 + @dragstart.prevent
4 + :class="[
5 + 'el-input-number',
6 + inputNumberSize ? 'el-input-number--' + inputNumberSize : '',
7 + { 'is-disabled': inputNumberDisabled },
8 + { 'is-without-controls': !controls },
9 + { 'is-controls-right': controlsAtRight }
10 + ]">
11 + <span
12 + class="el-input-number__decrease"
13 + role="button"
14 + v-if="controls"
15 + @click="decrease"
16 + :class="{'is-disabled': minDisabled}"
17 + @keydown.enter="decrease">
18 + <i :class="`el-icon-${controlsAtRight ? 'arrow-down' : 'minus'}`"></i>
19 + </span>
20 + <span
21 + class="el-input-number__increase"
22 + role="button"
23 + v-if="controls"
24 + @click="increase"
25 + :class="{'is-disabled': maxDisabled}"
26 + @keydown.enter="increase">
27 + <i :class="`el-icon-${controlsAtRight ? 'arrow-up' : 'plus'}`"></i>
28 + </span>
29 + <el-input
30 + ref="input"
31 + :value="displayValue"
32 + :placeholder="placeholder"
33 + :disabled="inputNumberDisabled"
34 + :size="inputNumberSize"
35 + :max="max"
36 + :min="min"
37 + :name="name"
38 + :label="label"
39 + @keydown.up.native.prevent="increase"
40 + @keydown.down.native.prevent="decrease"
41 + @blur="handleBlur"
42 + @focus="handleFocus"
43 + @input="handleInput"
44 + @change="handleInputChange">
45 + </el-input>
46 + </div>
47 +</template>
48 +<script>
49 + import ElInput from 'element-ui/packages/input';
50 + import Focus from 'element-ui/src/mixins/focus';
51 + import RepeatClick from 'element-ui/src/directives/repeat-click';
52 +
53 + export default {
54 + name: 'YlElInputNumber',
55 + mixins: [Focus('input')],
56 + inject: {
57 + elForm: {
58 + default: ''
59 + },
60 + elFormItem: {
61 + default: ''
62 + }
63 + },
64 + directives: {
65 + repeatClick: RepeatClick
66 + },
67 + components: {
68 + ElInput
69 + },
70 + props: {
71 + step: {
72 + type: Number,
73 + default: 1
74 + },
75 + stepStrictly: {
76 + type: Boolean,
77 + default: false
78 + },
79 + max: {
80 + type: Number,
81 + default: Infinity
82 + },
83 + min: {
84 + type: Number,
85 + default: -Infinity
86 + },
87 + value: {},
88 + disabled: Boolean,
89 + size: String,
90 + controls: {
91 + type: Boolean,
92 + default: true
93 + },
94 + controlsPosition: {
95 + type: String,
96 + default: ''
97 + },
98 + name: String,
99 + label: String,
100 + placeholder: String,
101 + precision: {
102 + type: Number,
103 + validator(val) {
104 + return val >= 0 && val === parseInt(val, 10);
105 + }
106 + }
107 + },
108 + data() {
109 + return {
110 + currentValue: 0,
111 + userInput: null
112 + };
113 + },
114 + watch: {
115 + value: {
116 + immediate: true,
117 + handler(value) {
118 + let newVal = value === undefined ? value : Number(value);
119 + if (newVal !== undefined) {
120 + if (isNaN(newVal)) {
121 + return;
122 + }
123 +
124 + if (this.stepStrictly) {
125 + const stepPrecision = this.getPrecision(this.step);
126 + const precisionFactor = Math.pow(10, stepPrecision);
127 + newVal = Math.round(newVal / this.step) * precisionFactor * this.step / precisionFactor;
128 + }
129 +
130 + if (this.precision !== undefined) {
131 + newVal = this.toPrecision(newVal, this.precision);
132 + }
133 + }
134 + if (newVal >= this.max) newVal = this.max;
135 + if (newVal <= this.min) newVal = this.min;
136 + this.currentValue = newVal;
137 + this.userInput = null;
138 + this.$emit('input', newVal);
139 + }
140 + }
141 + },
142 + computed: {
143 + minDisabled() {
144 + return this._decrease(this.value, this.step) < this.min;
145 + },
146 + maxDisabled() {
147 + return this._increase(this.value, this.step) > this.max;
148 + },
149 + numPrecision() {
150 + const { value, step, getPrecision, precision } = this;
151 + const stepPrecision = getPrecision(step);
152 + if (precision !== undefined) {
153 + if (stepPrecision > precision) {
154 + console.warn('[Element Warn][InputNumber]precision should not be less than the decimal places of step');
155 + }
156 + return precision;
157 + } else {
158 + return Math.max(getPrecision(value), stepPrecision);
159 + }
160 + },
161 + controlsAtRight() {
162 + return this.controls && this.controlsPosition === 'right';
163 + },
164 + _elFormItemSize() {
165 + return (this.elFormItem || {}).elFormItemSize;
166 + },
167 + inputNumberSize() {
168 + return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
169 + },
170 + inputNumberDisabled() {
171 + return this.disabled || !!(this.elForm || {}).disabled;
172 + },
173 + displayValue() {
174 + if (this.userInput !== null) {
175 + return this.userInput;
176 + }
177 +
178 + let currentValue = this.currentValue;
179 +
180 + if (typeof currentValue === 'number') {
181 + if (this.stepStrictly) {
182 + const stepPrecision = this.getPrecision(this.step);
183 + const precisionFactor = Math.pow(10, stepPrecision);
184 + currentValue = Math.round(currentValue / this.step) * precisionFactor * this.step / precisionFactor;
185 + }
186 +
187 + if (this.precision !== undefined) {
188 + currentValue = currentValue.toFixed(this.precision);
189 + }
190 + }
191 +
192 + return currentValue;
193 + }
194 + },
195 + methods: {
196 + toPrecision(num, precision) {
197 + if (precision === undefined) precision = this.numPrecision;
198 + return parseFloat(Math.round(num * Math.pow(10, precision)) / Math.pow(10, precision));
199 + },
200 + getPrecision(value) {
201 + if (value === undefined) return 0;
202 + const valueString = value.toString();
203 + const dotPosition = valueString.indexOf('.');
204 + let precision = 0;
205 + if (dotPosition !== -1) {
206 + precision = valueString.length - dotPosition - 1;
207 + }
208 + return precision;
209 + },
210 + _increase(val, step) {
211 + if (typeof val !== 'number' && val !== undefined) return this.currentValue;
212 +
213 + const precisionFactor = Math.pow(10, this.numPrecision);
214 + // Solve the accuracy problem of JS decimal calculation by converting the value to integer.
215 + return this.toPrecision((precisionFactor * val + precisionFactor * step) / precisionFactor);
216 + },
217 + _decrease(val, step) {
218 + if (typeof val !== 'number' && val !== undefined) return this.currentValue;
219 +
220 + const precisionFactor = Math.pow(10, this.numPrecision);
221 +
222 + return this.toPrecision((precisionFactor * val - precisionFactor * step) / precisionFactor);
223 + },
224 + increase() {
225 + if (this.inputNumberDisabled || this.maxDisabled) return;
226 + const value = this.value || 0;
227 + const newVal = this._increase(value, this.step);
228 + this.setCurrentValue(newVal);
229 + },
230 + decrease() {
231 + if (this.inputNumberDisabled || this.minDisabled) return;
232 + const value = this.value || 0;
233 + const newVal = this._decrease(value, this.step);
234 + this.setCurrentValue(newVal);
235 + },
236 + handleBlur(event) {
237 + this.$emit('blur', event);
238 + },
239 + handleFocus(event) {
240 + this.$emit('focus', event);
241 + },
242 + setCurrentValue(newVal) {
243 + const oldVal = this.currentValue;
244 + if (typeof newVal === 'number' && this.precision !== undefined) {
245 + newVal = this.toPrecision(newVal, this.precision);
246 + }
247 + if (newVal >= this.max) newVal = this.max;
248 + if (newVal <= this.min) newVal = this.min;
249 + if (oldVal === newVal) return;
250 + this.userInput = null;
251 + this.$emit('input', newVal);
252 + this.$emit('change', newVal, oldVal);
253 + this.currentValue = newVal;
254 + },
255 + handleInput(value) {
256 + this.userInput = value;
257 + },
258 + handleInputChange(value) {
259 + const newVal = value === '' ? undefined : Number(value);
260 + if (!isNaN(newVal) || value === '') {
261 + this.setCurrentValue(newVal);
262 + }
263 + this.userInput = null;
264 + },
265 + select() {
266 + this.$refs.input.select();
267 + }
268 + },
269 + mounted() {
270 + let innerInput = this.$refs.input.$refs.input;
271 + innerInput.setAttribute('role', 'spinbutton');
272 + innerInput.setAttribute('aria-valuemax', this.max);
273 + innerInput.setAttribute('aria-valuemin', this.min);
274 + innerInput.setAttribute('aria-valuenow', this.currentValue);
275 + innerInput.setAttribute('aria-disabled', this.inputNumberDisabled);
276 + },
277 + updated() {
278 + if (!this.$refs || !this.$refs.input) return;
279 + const innerInput = this.$refs.input.$refs.input;
280 + innerInput.setAttribute('aria-valuenow', this.currentValue);
281 + }
282 + };
283 +</script>
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
23 </el-col> 23 </el-col>
24 </el-row> 24 </el-row>
25 <yl-table 25 <yl-table
26 + ref="ylTable"
26 emptyText="请添加配舱航班" 27 emptyText="请添加配舱航班"
27 :attrs="tableAttr" 28 :attrs="tableAttr"
28 :loadingTable="tableAttr.loadingTable" 29 :loadingTable="tableAttr.loadingTable"
...@@ -63,27 +64,17 @@ ...@@ -63,27 +64,17 @@
63 align="center" 64 align="center"
64 > 65 >
65 <template slot-scope="scope"> 66 <template slot-scope="scope">
66 - <el-input-number 67 + <yl-el-input-number
67 v-model="scope.row.calculateDay" 68 v-model="scope.row.calculateDay"
68 :disabled="scope.row.edit" 69 :disabled="scope.row.edit"
69 :precision="0" 70 :precision="0"
71 + :controls="true"
70 v-input-filter 72 v-input-filter
71 clearable 73 clearable
72 placeholder="" 74 placeholder=""
73 size="small" 75 size="small"
74 style="width: 100%" 76 style="width: 100%"
75 /> 77 />
76 - <!-- <el-input
77 - type="text"
78 - v-model="scope.row.calculateDay"
79 - :disabled="scope.row.edit"
80 - min="-7"
81 - max="7"
82 - v-input-filter
83 - clearable
84 - placeholder=""
85 - size="small"
86 - /> -->
87 </template> 78 </template>
88 </el-table-column> 79 </el-table-column>
89 <el-table-column 80 <el-table-column
...@@ -431,6 +422,7 @@ ...@@ -431,6 +422,7 @@
431 <script> 422 <script>
432 import YlForm from "@/components/YlForm"; 423 import YlForm from "@/components/YlForm";
433 import YlTable from "@/components/YlTable"; 424 import YlTable from "@/components/YlTable";
425 +import YlElInputNumber from "../components/input-number"
434 import { inputBlurValidate } from "@/utils/mixins"; 426 import { inputBlurValidate } from "@/utils/mixins";
435 import { tableAttr } from "./tableConfig"; 427 import { tableAttr } from "./tableConfig";
436 import { 428 import {
...@@ -448,6 +440,7 @@ export default { ...@@ -448,6 +440,7 @@ export default {
448 components: { 440 components: {
449 YlForm, 441 YlForm,
450 YlTable, 442 YlTable,
443 + YlElInputNumber
451 }, 444 },
452 mixins: [indexMixins, inputBlurValidate], 445 mixins: [indexMixins, inputBlurValidate],
453 data() { 446 data() {
...@@ -752,7 +745,7 @@ export default { ...@@ -752,7 +745,7 @@ export default {
752 // 表单提交 745 // 表单提交
753 submitForm(formName) { 746 submitForm(formName) {
754 this.$refs[formName].validate((valid) => { 747 this.$refs[formName].validate((valid) => {
755 - if (valid) { 748 + if (valid && this.validateForm) {
756 this.tableData.map((item, i) => { 749 this.tableData.map((item, i) => {
757 item.priority = ++i; 750 item.priority = ++i;
758 }); 751 });
...@@ -793,6 +786,7 @@ export default { ...@@ -793,6 +786,7 @@ export default {
793 flightRankDtoList: tableData, // ET86配舱航班顺位 786 flightRankDtoList: tableData, // ET86配舱航班顺位
794 fltRuleDto: this.queryForm, 787 fltRuleDto: this.queryForm,
795 }; 788 };
789 + let queryParmas = JSON.parse(JSON.stringify(parmas));
796 // 筛选重复的航班 790 // 筛选重复的航班
797 let repeat = tableData.filter( 791 let repeat = tableData.filter(
798 (item) => 792 (item) =>
...@@ -808,17 +802,17 @@ export default { ...@@ -808,17 +802,17 @@ export default {
808 this.msgError("ET86配舱航班顺位中存在重复设置"); 802 this.msgError("ET86配舱航班顺位中存在重复设置");
809 return; 803 return;
810 } 804 }
811 - parmas.fltRuleDto.multiHs = this.queryForm.multiHs ? "N" : "Y"; // N为单品名,Y为多品名 805 + queryParmas.fltRuleDto.multiHs = this.queryForm.multiHs ? "N" : "Y"; // N为单品名,Y为多品名
812 if (this.validateForm && this.$route.query.name == "add") { 806 if (this.validateForm && this.$route.query.name == "add") {
813 - this.postAdd(parmas); // 新增 807 + this.postAdd(queryParmas); // 新增
814 } else { 808 } else {
815 if (this.validateForm) { 809 if (this.validateForm) {
816 - parmas.flightRankDtoList.map((item) => { 810 + queryParmas.flightRankDtoList.map((item) => {
817 if (item.hasOwnProperty("routeList")) { 811 if (item.hasOwnProperty("routeList")) {
818 delete item.routeList; 812 delete item.routeList;
819 } 813 }
820 }); 814 });
821 - this.postUpdate(parmas); // 修改 815 + this.postUpdate(queryParmas); // 修改
822 } 816 }
823 } 817 }
824 } else { 818 } else {
......
...@@ -129,20 +129,20 @@ export default { ...@@ -129,20 +129,20 @@ export default {
129 }; 129 };
130 // ursa包含 130 // ursa包含
131 if (ursaMark && ursaInfo.repeat) { 131 if (ursaMark && ursaInfo.repeat) {
132 - this.ursaError = "填写的Ursa已重复"; 132 + this.ursaError = "填写的URSA已重复";
133 } 133 }
134 if (ursaMark && !ursaInfo.inUrsa) { 134 if (ursaMark && !ursaInfo.inUrsa) {
135 - this.ursaError = "Ursa包含之间用分号分隔,例:P2_;P3_;P_"; 135 + this.ursaError = "URSA包含之间用分号分隔,例:P2_;P3_;P_";
136 } 136 }
137 if (ursaMark && !ursaInfo.repeat && ursaInfo.inUrsa) { 137 if (ursaMark && !ursaInfo.repeat && ursaInfo.inUrsa) {
138 this.ursaError = ""; 138 this.ursaError = "";
139 } 139 }
140 // ursa不包含; 140 // ursa不包含;
141 if (!ursaMark && ursaInfo.repeat) { 141 if (!ursaMark && ursaInfo.repeat) {
142 - this.notUrsaError = "填写的Ursa已重复"; 142 + this.notUrsaError = "填写的URSA已重复";
143 } 143 }
144 if (!ursaMark && !ursaInfo.inUrsa) { 144 if (!ursaMark && !ursaInfo.inUrsa) {
145 - this.notUrsaError = "Ursa不包含之间用分号分隔,例:P2;P3;P"; 145 + this.notUrsaError = "URSA不包含之间用分号分隔,例:P2;P3;P";
146 } 146 }
147 if (!ursaMark && !ursaInfo.repeat && ursaInfo.inUrsa) { 147 if (!ursaMark && !ursaInfo.repeat && ursaInfo.inUrsa) {
148 this.notUrsaError = ""; 148 this.notUrsaError = "";
......