Elements-SY

Merge branch 'et86-black' into et86

...@@ -183,18 +183,16 @@ export default { ...@@ -183,18 +183,16 @@ 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]
190 - // .children[0]; 189 + // .children[0];
191 - // console.log(trEl) 190 + // console.log(trEl)
192 - // if (trEl) { 191 + // if (trEl) {
193 - // this.trHeight = trEl.clientHeight; 192 + // this.trHeight = trEl.clientHeight;
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];
......
...@@ -531,6 +531,7 @@ export function filterRepeat(arr, key) { ...@@ -531,6 +531,7 @@ export function filterRepeat(arr, key) {
531 } 531 }
532 /** 532 /**
533 * Array Json 533 * Array Json
534 + * @author SunYu
534 * @param {Array} arr 535 * @param {Array} arr
535 * @param {string} key 536 * @param {string} key
536 * @param {string} time 537 * @param {string} time
......
...@@ -37,33 +37,30 @@ export const inputBlurValidate = { ...@@ -37,33 +37,30 @@ export const inputBlurValidate = {
37 } 37 }
38 // 最小重量有值的情况下 38 // 最小重量有值的情况下
39 if (target.value && Number(target.value) >= 0) { 39 if (target.value && Number(target.value) >= 0) {
40 - if (
41 - /^(0|[1-9]\d*)(.\d{1,5})?$/.test(Number(this.queryForm.maxWeight))
42 - ) {
43 - this.validateForm = true;
44 - this.$refs.minWeight.innerHTML = "";
45 - } else {
46 - this.validateForm = false;
47 - this.$refs.minWeight.innerHTML = "请输入有效重量,小数保留5位";
48 - // this.msgError("请输入有效重量,小数保留5位");
49 - }
50 if (/^(0|[1-9]\d*)(.\d{1,5})?$/.test(Number(target.value))) { 40 if (/^(0|[1-9]\d*)(.\d{1,5})?$/.test(Number(target.value))) {
51 - this.validateForm = true; 41 + if (this.queryForm.maxWeight) {
52 - this.$refs.minWeight.innerHTML = ""; 42 + if (
43 + Number(this.queryForm.maxWeight) <
44 + Number(this.queryForm.minWeight)
45 + ) {
46 + this.validateForm = false;
47 + this.$refs.minWeight.innerHTML = "最小重量不得大于最大重量";
48 + } else if (
49 + /^(0|[1-9]\d*)(.\d{1,5})?$/.test(Number(this.queryForm.maxWeight))
50 + ) {
51 + this.validateForm = true;
52 + this.$refs.minWeight.innerHTML = "";
53 + } else {
54 + this.validateForm = false;
55 + this.$refs.minWeight.innerHTML = "请输入有效重量,小数保留5位";
56 + }
57 + } else {
58 + this.validateForm = true;
59 + this.$refs.minWeight.innerHTML = "";
60 + }
53 } else { 61 } else {
54 this.validateForm = false; 62 this.validateForm = false;
55 this.$refs.minWeight.innerHTML = "请输入有效重量,小数保留5位"; 63 this.$refs.minWeight.innerHTML = "请输入有效重量,小数保留5位";
56 - // this.msgError("请输入有效重量,小数保留5位");
57 - }
58 - }
59 - // 重量最小值和最大值都不为空的情况下
60 - if (this.queryForm.minWeight && this.queryForm.maxWeight) {
61 - if (
62 - Number(this.queryForm.maxWeight) < Number(this.queryForm.minWeight)
63 - ) {
64 - this.validateForm = false;
65 - this.$refs.minWeight.innerHTML = "最小重量不得大于最大重量";
66 - // this.msgError("最小重量不得大于最大重量");
67 } 64 }
68 } 65 }
69 }, 66 },
...@@ -87,197 +84,249 @@ export const inputBlurValidate = { ...@@ -87,197 +84,249 @@ export const inputBlurValidate = {
87 // this.msgError("请输入有效重量,小数保留5位"); 84 // this.msgError("请输入有效重量,小数保留5位");
88 } 85 }
89 } 86 }
90 - // 最大重量有值的情况下
91 if (target.value && Number(target.value) >= 0) { 87 if (target.value && Number(target.value) >= 0) {
92 - if (
93 - /^(0|[1-9]\d*)(.\d{1,5})?$/.test(Number(this.queryForm.minWeight))
94 - ) {
95 - this.validateForm = true;
96 - this.$refs.minWeight.innerHTML = "";
97 - } else {
98 - this.validateForm = false;
99 - this.$refs.minWeight.innerHTML = "请输入有效重量,小数保留5位";
100 - // this.msgError("请输入有效重量,小数保留5位");
101 - }
102 if (/^(0|[1-9]\d*)(.\d{1,5})?$/.test(Number(target.value))) { 88 if (/^(0|[1-9]\d*)(.\d{1,5})?$/.test(Number(target.value))) {
103 - this.validateForm = true; 89 + if (this.queryForm.minWeight) {
104 - this.$refs.minWeight.innerHTML = ""; 90 + if (
91 + Number(this.queryForm.maxWeight) <
92 + Number(this.queryForm.minWeight)
93 + ) {
94 + this.validateForm = false;
95 + this.$refs.minWeight.innerHTML = "最小重量不得大于最大重量";
96 + } else if (
97 + /^(0|[1-9]\d*)(.\d{1,5})?$/.test(Number(this.queryForm.minWeight))
98 + ) {
99 + this.validateForm = true;
100 + this.$refs.minWeight.innerHTML = "";
101 + } else {
102 + this.validateForm = false;
103 + this.$refs.minWeight.innerHTML = "请输入有效重量,小数保留5位";
104 + }
105 + } else {
106 + this.validateForm = true;
107 + this.$refs.minWeight.innerHTML = "";
108 + }
105 } else { 109 } else {
106 this.validateForm = false; 110 this.validateForm = false;
107 this.$refs.minWeight.innerHTML = "请输入有效重量,小数保留5位"; 111 this.$refs.minWeight.innerHTML = "请输入有效重量,小数保留5位";
108 - // this.msgError("请输入有效重量,小数保留5位");
109 - }
110 - }
111 - // 重量最小值和最大值都不为空的情况下
112 - if (this.queryForm.minWeight && this.queryForm.maxWeight) {
113 - if (
114 - Number(this.queryForm.maxWeight) < Number(this.queryForm.minWeight)
115 - ) {
116 - this.validateForm = false;
117 - this.$refs.minWeight.innerHTML = "最小重量不得大于最大重量";
118 - // this.msgError("最小重量不得大于最大重量");
119 } 112 }
120 } 113 }
121 }, 114 },
122 // 人民币最小申报价值 115 // 人民币最小申报价值
123 inputCNYBlurMin({ target }, customVal) { 116 inputCNYBlurMin({ target }, customVal) {
124 // 申报价值最小值和最大值都为空的情况下 117 // 申报价值最小值和最大值都为空的情况下
125 - if (this.queryForm.minCustomVal == "" && this.queryForm.maxCustomVal == "") { 118 + if (
119 + this.queryForm.minCustomVal == "" &&
120 + this.queryForm.maxCustomVal == ""
121 + ) {
126 this.validateForm = true; 122 this.validateForm = true;
127 this.$refs.minCNYCustomVal.innerHTML = ""; 123 this.$refs.minCNYCustomVal.innerHTML = "";
128 } 124 }
129 // 鼠标聚焦最小申报价值,最小申报价值无值的情况下去校验最大申报价值 125 // 鼠标聚焦最小申报价值,最小申报价值无值的情况下去校验最大申报价值
130 if (target.value == "" && this.queryForm.maxCustomVal) { 126 if (target.value == "" && this.queryForm.maxCustomVal) {
131 - if (/^(0|[1-9]\d*)(.\d{1,2})?$/.test(Number(this.queryForm.maxCustomVal))) { 127 + if (
128 + /^(0|[1-9]\d*)(.\d{1,2})?$/.test(Number(this.queryForm.maxCustomVal))
129 + ) {
132 this.validateForm = true; 130 this.validateForm = true;
133 this.$refs.minCNYCustomVal.innerHTML = ""; 131 this.$refs.minCNYCustomVal.innerHTML = "";
134 } 132 }
135 } 133 }
136 // 最小申报价值有值的情况下 134 // 最小申报价值有值的情况下
137 if (target.value && Number(target.value) >= 0) { 135 if (target.value && Number(target.value) >= 0) {
138 - if (/^(0|[1-9]\d*)(.\d{1,2})?$/.test(Number(this.queryForm.maxCustomVal))) {
139 - this.validateForm = true;
140 - this.$refs.minCNYCustomVal.innerHTML = "";
141 - } else {
142 - this.validateForm = false;
143 - this.$refs.minCNYCustomVal.innerHTML = "请输入有效申报价值,小数保留2位";
144 - }
145 if (/^(0|[1-9]\d*)(.\d{1,2})?$/.test(Number(target.value))) { 136 if (/^(0|[1-9]\d*)(.\d{1,2})?$/.test(Number(target.value))) {
146 - this.validateForm = true; 137 + if (this.queryForm.maxCustomVal) {
147 - this.$refs.minCNYCustomVal.innerHTML = ""; 138 + if (
139 + Number(this.queryForm.maxCustomVal) <
140 + Number(this.queryForm.minCustomVal)
141 + ) {
142 + this.validateForm = false;
143 + this.$refs.minCNYCustomVal.innerHTML =
144 + "最小申报价值不得大于最大申报价值";
145 + } else if (
146 + /^(0|[1-9]\d*)(.\d{1,2})?$/.test(
147 + Number(this.queryForm.maxCustomVal)
148 + )
149 + ) {
150 + this.validateForm = true;
151 + this.$refs.minCNYCustomVal.innerHTML = "";
152 + } else {
153 + this.validateForm = false;
154 + this.$refs.minCNYCustomVal.innerHTML =
155 + "请输入有效申报价值,小数保留2位";
156 + }
157 + } else {
158 + this.validateForm = true;
159 + this.$refs.minCNYCustomVal.innerHTML = "";
160 + }
148 } else { 161 } else {
149 this.validateForm = false; 162 this.validateForm = false;
150 - this.$refs.minCNYCustomVal.innerHTML = "请输入有效申报价值,小数保留2位"; 163 + this.$refs.minCNYCustomVal.innerHTML =
151 - } 164 + "请输入有效申报价值,小数保留2位";
152 - }
153 - // 申报价值最小值和最大值都不为空的情况下
154 - if (this.queryForm.minCustomVal && this.queryForm.maxCustomVal) {
155 - if (Number(this.queryForm.maxCustomVal) < Number(this.queryForm.minCustomVal)) {
156 - this.validateForm = false;
157 - this.$refs.minCNYCustomVal.innerHTML = "最小申报价值不得大于最大申报价值";
158 } 165 }
159 } 166 }
160 }, 167 },
161 // 人民币最大申报价值 168 // 人民币最大申报价值
162 inputCNYBlurMax({ target }, customVal) { 169 inputCNYBlurMax({ target }, customVal) {
163 // 申报价值最小值和最大值都为空的情况下 170 // 申报价值最小值和最大值都为空的情况下
164 - if (this.queryForm.minCustomVal == "" && this.queryForm.maxCustomVal == "") { 171 + if (
172 + this.queryForm.minCustomVal == "" &&
173 + this.queryForm.maxCustomVal == ""
174 + ) {
165 this.validateForm = true; 175 this.validateForm = true;
166 this.$refs.minCNYCustomVal.innerHTML = ""; 176 this.$refs.minCNYCustomVal.innerHTML = "";
167 } 177 }
168 // 鼠标聚焦最大申报价值,最大申报价值无值的情况下去校验最小申报价值 178 // 鼠标聚焦最大申报价值,最大申报价值无值的情况下去校验最小申报价值
169 if (target.value == "" && this.queryForm.minCustomVal) { 179 if (target.value == "" && this.queryForm.minCustomVal) {
170 - if (/^(0|[1-9]\d*)(.\d{1,2})?$/.test(Number(this.queryForm.minCustomVal))) { 180 + if (
181 + /^(0|[1-9]\d*)(.\d{1,2})?$/.test(Number(this.queryForm.minCustomVal))
182 + ) {
171 this.validateForm = true; 183 this.validateForm = true;
172 this.$refs.minCNYCustomVal.innerHTML = ""; 184 this.$refs.minCNYCustomVal.innerHTML = "";
173 } else { 185 } else {
174 this.validateForm = false; 186 this.validateForm = false;
175 - this.$refs.minCNYCustomVal.innerHTML = "请输入有效申报价值,小数保留2位"; 187 + this.$refs.minCNYCustomVal.innerHTML =
188 + "请输入有效申报价值,小数保留2位";
176 } 189 }
177 } 190 }
178 // 最大申报价值有值的情况下 191 // 最大申报价值有值的情况下
179 if (target.value && Number(target.value) >= 0) { 192 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))) { 193 if (/^(0|[1-9]\d*)(.\d{1,2})?$/.test(Number(target.value))) {
188 - this.validateForm = true; 194 + if (this.queryForm.minCustomVal) {
189 - this.$refs.minCNYCustomVal.innerHTML = ""; 195 + if (
196 + Number(this.queryForm.maxCustomVal) <
197 + Number(this.queryForm.minCustomVal)
198 + ) {
199 + this.validateForm = false;
200 + this.$refs.minCNYCustomVal.innerHTML =
201 + "最小申报价值不得大于最大申报价值";
202 + } else if (
203 + /^(0|[1-9]\d*)(.\d{1,2})?$/.test(
204 + Number(this.queryForm.minCustomVal)
205 + )
206 + ) {
207 + this.validateForm = true;
208 + this.$refs.minCNYCustomVal.innerHTML = "";
209 + } else {
210 + this.validateForm = false;
211 + this.$refs.minCNYCustomVal.innerHTML =
212 + "请输入有效申报价值,小数保留2位";
213 + }
214 + }
190 } else { 215 } else {
191 this.validateForm = false; 216 this.validateForm = false;
192 - this.$refs.minCNYCustomVal.innerHTML = "请输入有效申报价值,小数保留2位"; 217 + this.$refs.minCNYCustomVal.innerHTML =
193 - } 218 + "请输入有效申报价值,小数保留2位";
194 - }
195 - // 申报价值最小值和最大值都不为空的情况下
196 - if (this.queryForm.minCustomVal && this.queryForm.maxCustomVal) {
197 - if (Number(this.queryForm.maxCustomVal) < Number(this.queryForm.minCustomVal)) {
198 - this.validateForm = false;
199 - this.$refs.minCNYCustomVal.innerHTML = "最小申报价值不得大于最大申报价值";
200 } 219 }
201 } 220 }
202 }, 221 },
203 // 美元最小申报价值 222 // 美元最小申报价值
204 inputSUDBlurMin({ target }, customVal) { 223 inputSUDBlurMin({ target }, customVal) {
205 // 申报价值最小值和最大值都为空的情况下 224 // 申报价值最小值和最大值都为空的情况下
206 - if (this.queryForm.minUsdCustomVal == "" && this.queryForm.maxUsdCustomVal == "") { 225 + if (
226 + this.queryForm.minUsdCustomVal == "" &&
227 + this.queryForm.maxUsdCustomVal == ""
228 + ) {
207 this.validateForm = true; 229 this.validateForm = true;
208 this.$refs.minSUDCustomVal.innerHTML = ""; 230 this.$refs.minSUDCustomVal.innerHTML = "";
209 } 231 }
210 // 鼠标聚焦最小申报价值,最小申报价值无值的情况下去校验最大申报价值 232 // 鼠标聚焦最小申报价值,最小申报价值无值的情况下去校验最大申报价值
211 if (target.value == "" && this.queryForm.maxUsdCustomVal) { 233 if (target.value == "" && this.queryForm.maxUsdCustomVal) {
212 - if (/^(0|[1-9]\d*)(.\d{1,2})?$/.test(Number(this.queryForm.maxUsdCustomVal))) { 234 + if (
235 + /^(0|[1-9]\d*)(.\d{1,2})?$/.test(
236 + Number(this.queryForm.maxUsdCustomVal)
237 + )
238 + ) {
213 this.validateForm = true; 239 this.validateForm = true;
214 this.$refs.minSUDCustomVal.innerHTML = ""; 240 this.$refs.minSUDCustomVal.innerHTML = "";
215 } 241 }
216 } 242 }
217 // 最小申报价值有值的情况下 243 // 最小申报价值有值的情况下
218 if (target.value && Number(target.value) >= 0) { 244 if (target.value && Number(target.value) >= 0) {
219 - if (/^(0|[1-9]\d*)(.\d{1,2})?$/.test(Number(this.queryForm.maxUsdCustomVal))) {
220 - this.validateForm = true;
221 - this.$refs.minSUDCustomVal.innerHTML = "";
222 - } else {
223 - this.validateForm = false;
224 - this.$refs.minSUDCustomVal.innerHTML = "请输入有效申报价值,小数保留2位";
225 - }
226 if (/^(0|[1-9]\d*)(.\d{1,2})?$/.test(Number(target.value))) { 245 if (/^(0|[1-9]\d*)(.\d{1,2})?$/.test(Number(target.value))) {
227 - this.validateForm = true; 246 + if (this.queryForm.maxUsdCustomVal) {
228 - this.$refs.minSUDCustomVal.innerHTML = ""; 247 + if (
248 + Number(this.queryForm.maxUsdCustomVal) <
249 + Number(this.queryForm.minUsdCustomVal)
250 + ) {
251 + this.validateForm = false;
252 + this.$refs.minSUDCustomVal.innerHTML =
253 + "最小申报价值不得大于最大申报价值";
254 + } else if (
255 + /^(0|[1-9]\d*)(.\d{1,2})?$/.test(
256 + Number(this.queryForm.maxUsdCustomVal)
257 + )
258 + ) {
259 + this.validateForm = true;
260 + this.$refs.minSUDCustomVal.innerHTML = "";
261 + } else {
262 + this.validateForm = false;
263 + this.$refs.minSUDCustomVal.innerHTML =
264 + "请输入有效申报价值,小数保留2位";
265 + }
266 + } else {
267 + this.validateForm = true;
268 + this.$refs.minSUDCustomVal.innerHTML = "";
269 + }
229 } else { 270 } else {
230 this.validateForm = false; 271 this.validateForm = false;
231 - this.$refs.minSUDCustomVal.innerHTML = "请输入有效申报价值,小数保留2位"; 272 + this.$refs.minSUDCustomVal.innerHTML =
232 - } 273 + "请输入有效申报价值,小数保留2位";
233 - }
234 - // 申报价值最小值和最大值都不为空的情况下
235 - if (this.queryForm.minUsdCustomVal && this.queryForm.maxUsdCustomVal) {
236 - if (Number(this.queryForm.maxUsdCustomVal) < Number(this.queryForm.minUsdCustomVal)) {
237 - this.validateForm = false;
238 - this.$refs.minSUDCustomVal.innerHTML = "最小申报价值不得大于最大申报价值";
239 } 274 }
240 } 275 }
241 }, 276 },
242 // 美元最大申报价值 277 // 美元最大申报价值
243 inputSUDBlurMax({ target }, customVal) { 278 inputSUDBlurMax({ target }, customVal) {
244 // 申报价值最小值和最大值都为空的情况下 279 // 申报价值最小值和最大值都为空的情况下
245 - if (this.queryForm.minUsdCustomVal == "" && this.queryForm.maxUsdCustomVal == "") { 280 + if (
281 + this.queryForm.minUsdCustomVal == "" &&
282 + this.queryForm.maxUsdCustomVal == ""
283 + ) {
246 this.validateForm = true; 284 this.validateForm = true;
247 this.$refs.minSUDCustomVal.innerHTML = ""; 285 this.$refs.minSUDCustomVal.innerHTML = "";
248 } 286 }
249 // 鼠标聚焦最大申报价值,最大申报价值无值的情况下去校验最小申报价值 287 // 鼠标聚焦最大申报价值,最大申报价值无值的情况下去校验最小申报价值
250 if (target.value == "" && this.queryForm.minUsdCustomVal) { 288 if (target.value == "" && this.queryForm.minUsdCustomVal) {
251 - if (/^(0|[1-9]\d*)(.\d{1,2})?$/.test(Number(this.queryForm.minUsdCustomVal))) { 289 + if (
290 + /^(0|[1-9]\d*)(.\d{1,2})?$/.test(
291 + Number(this.queryForm.minUsdCustomVal)
292 + )
293 + ) {
252 this.validateForm = true; 294 this.validateForm = true;
253 this.$refs.minSUDCustomVal.innerHTML = ""; 295 this.$refs.minSUDCustomVal.innerHTML = "";
254 } else { 296 } else {
255 this.validateForm = false; 297 this.validateForm = false;
256 - this.$refs.minSUDCustomVal.innerHTML = "请输入有效申报价值,小数保留2位"; 298 + this.$refs.minSUDCustomVal.innerHTML =
299 + "请输入有效申报价值,小数保留2位";
257 } 300 }
258 } 301 }
259 // 最大申报价值有值的情况下 302 // 最大申报价值有值的情况下
260 if (target.value && Number(target.value) >= 0) { 303 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))) { 304 if (/^(0|[1-9]\d*)(.\d{1,2})?$/.test(Number(target.value))) {
269 - this.validateForm = true; 305 + if (this.queryForm.minUsdCustomVal) {
270 - this.$refs.minSUDCustomVal.innerHTML = ""; 306 + if (
307 + Number(this.queryForm.maxUsdCustomVal) <
308 + Number(this.queryForm.minUsdCustomVal)
309 + ) {
310 + this.validateForm = false;
311 + this.$refs.minSUDCustomVal.innerHTML =
312 + "最小申报价值不得大于最大申报价值";
313 + } else if (
314 + /^(0|[1-9]\d*)(.\d{1,2})?$/.test(
315 + Number(this.queryForm.minUsdCustomVal)
316 + )
317 + ) {
318 + this.validateForm = true;
319 + this.$refs.minSUDCustomVal.innerHTML = "";
320 + } else {
321 + this.validateForm = false;
322 + this.$refs.minSUDCustomVal.innerHTML =
323 + "请输入有效申报价值,小数保留2位";
324 + }
325 + }
271 } else { 326 } else {
272 this.validateForm = false; 327 this.validateForm = false;
273 - this.$refs.minSUDCustomVal.innerHTML = "请输入有效申报价值,小数保留2位"; 328 + this.$refs.minSUDCustomVal.innerHTML =
274 - } 329 + "请输入有效申报价值,小数保留2位";
275 - }
276 - // 申报价值最小值和最大值都不为空的情况下
277 - if (this.queryForm.minUsdCustomVal && this.queryForm.maxUsdCustomVal) {
278 - if (Number(this.queryForm.maxUsdCustomVal) < Number(this.queryForm.minUsdCustomVal)) {
279 - this.validateForm = false;
280 - this.$refs.minSUDCustomVal.innerHTML = "最小申报价值不得大于最大申报价值";
281 } 330 }
282 } 331 }
283 }, 332 },
......
...@@ -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 +YlElInputNumber.install = function (Vue) {
4 + Vue.component(YlElInputNumber.name, YlElInputNumber);
5 +};
6 +// 该组件是基于Element UI InputNumber 计数器
7 +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 + export default {
50 + name: 'YlElInputNumber',
51 + inject: {
52 + elForm: {
53 + default: ''
54 + },
55 + elFormItem: {
56 + default: ''
57 + }
58 + },
59 + props: {
60 + step: {
61 + type: Number,
62 + default: 1
63 + },
64 + stepStrictly: {
65 + type: Boolean,
66 + default: false
67 + },
68 + max: {
69 + type: Number,
70 + default: Infinity
71 + },
72 + min: {
73 + type: Number,
74 + default: -Infinity
75 + },
76 + value: {},
77 + disabled: Boolean,
78 + size: String,
79 + controls: {
80 + type: Boolean,
81 + default: true
82 + },
83 + controlsPosition: {
84 + type: String,
85 + default: ''
86 + },
87 + name: String,
88 + label: String,
89 + placeholder: String,
90 + precision: {
91 + type: Number,
92 + validator(val) {
93 + return val >= 0 && val === parseInt(val, 10);
94 + }
95 + }
96 + },
97 + data() {
98 + return {
99 + currentValue: 0,
100 + userInput: null
101 + };
102 + },
103 + watch: {
104 + value: {
105 + immediate: true,
106 + handler(value) {
107 + let newVal = value === undefined ? value : Number(value);
108 + if (newVal !== undefined) {
109 + if (isNaN(newVal)) {
110 + return;
111 + }
112 + if (this.stepStrictly) {
113 + const stepPrecision = this.getPrecision(this.step);
114 + const precisionFactor = Math.pow(10, stepPrecision);
115 + newVal = Math.round(newVal / this.step) * precisionFactor * this.step / precisionFactor;
116 + }
117 + if (this.precision !== undefined) {
118 + newVal = this.toPrecision(newVal, this.precision);
119 + }
120 + }
121 + if (newVal >= this.max) newVal = this.max;
122 + if (newVal <= this.min) newVal = this.min;
123 + this.currentValue = newVal;
124 + this.userInput = null;
125 + this.$emit('input', newVal);
126 + }
127 + }
128 + },
129 + computed: {
130 + minDisabled() {
131 + return this._decrease(this.value, this.step) < this.min;
132 + },
133 + maxDisabled() {
134 + return this._increase(this.value, this.step) > this.max;
135 + },
136 + numPrecision() {
137 + const { value, step, getPrecision, precision } = this;
138 + const stepPrecision = getPrecision(step);
139 + if (precision !== undefined) {
140 + if (stepPrecision > precision) {
141 + console.warn('[Element Warn][InputNumber]precision should not be less than the decimal places of step');
142 + }
143 + return precision;
144 + } else {
145 + return Math.max(getPrecision(value), stepPrecision);
146 + }
147 + },
148 + controlsAtRight() {
149 + return this.controls && this.controlsPosition === 'right';
150 + },
151 + _elFormItemSize() {
152 + return (this.elFormItem || {}).elFormItemSize;
153 + },
154 + inputNumberSize() {
155 + return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
156 + },
157 + inputNumberDisabled() {
158 + return this.disabled || !!(this.elForm || {}).disabled;
159 + },
160 + displayValue() {
161 + if (this.userInput !== null) {
162 + return this.userInput;
163 + }
164 + let currentValue = this.currentValue;
165 + if (typeof currentValue === 'number') {
166 + if (this.stepStrictly) {
167 + const stepPrecision = this.getPrecision(this.step);
168 + const precisionFactor = Math.pow(10, stepPrecision);
169 + currentValue = Math.round(currentValue / this.step) * precisionFactor * this.step / precisionFactor;
170 + }
171 +
172 + if (this.precision !== undefined) {
173 + currentValue = currentValue.toFixed(this.precision);
174 + }
175 + }
176 + return currentValue;
177 + }
178 + },
179 + methods: {
180 + toPrecision(num, precision) {
181 + if (precision === undefined) precision = this.numPrecision;
182 + return parseFloat(Math.round(num * Math.pow(10, precision)) / Math.pow(10, precision));
183 + },
184 + getPrecision(value) {
185 + if (value === undefined) return 0;
186 + const valueString = value.toString();
187 + const dotPosition = valueString.indexOf('.');
188 + let precision = 0;
189 + if (dotPosition !== -1) {
190 + precision = valueString.length - dotPosition - 1;
191 + }
192 + return precision;
193 + },
194 + _increase(val, step) {
195 + if (typeof val !== 'number' && val !== undefined) return this.currentValue;
196 + const precisionFactor = Math.pow(10, this.numPrecision);
197 + return this.toPrecision((precisionFactor * val + precisionFactor * step) / precisionFactor);
198 + },
199 + _decrease(val, step) {
200 + if (typeof val !== 'number' && val !== undefined) return this.currentValue;
201 + const precisionFactor = Math.pow(10, this.numPrecision);
202 + return this.toPrecision((precisionFactor * val - precisionFactor * step) / precisionFactor);
203 + },
204 + increase() {
205 + if (this.inputNumberDisabled || this.maxDisabled) return;
206 + const value = this.value || 0;
207 + const newVal = this._increase(value, this.step);
208 + this.setCurrentValue(newVal);
209 + },
210 + decrease() {
211 + if (this.inputNumberDisabled || this.minDisabled) return;
212 + const value = this.value || 0;
213 + const newVal = this._decrease(value, this.step);
214 + this.setCurrentValue(newVal);
215 + },
216 + handleBlur(event) {
217 + this.$emit('blur', event);
218 + },
219 + handleFocus(event) {
220 + this.$emit('focus', event);
221 + },
222 + setCurrentValue(newVal) {
223 + const oldVal = this.currentValue;
224 + if (typeof newVal === 'number' && this.precision !== undefined) {
225 + newVal = this.toPrecision(newVal, this.precision);
226 + }
227 + if (newVal >= this.max) newVal = this.max;
228 + if (newVal <= this.min) newVal = this.min;
229 + if (oldVal === newVal) return;
230 + this.userInput = null;
231 + this.$emit('input', newVal);
232 + this.$emit('change', newVal, oldVal);
233 + this.currentValue = newVal;
234 + },
235 + handleInput(value) {
236 + this.userInput = value;
237 + },
238 + handleInputChange(value) {
239 + const newVal = value === '' ? undefined : Number(value);
240 + if (!isNaN(newVal) || value === '') {
241 + this.setCurrentValue(newVal);
242 + }
243 + this.userInput = null;
244 + },
245 + select() {
246 + this.$refs.input.select();
247 + }
248 + },
249 + mounted() {
250 + let innerInput = this.$refs.input.$refs.input;
251 + innerInput.setAttribute('role', 'spinbutton');
252 + innerInput.setAttribute('aria-valuemax', this.max);
253 + innerInput.setAttribute('aria-valuemin', this.min);
254 + innerInput.setAttribute('aria-valuenow', this.currentValue);
255 + innerInput.setAttribute('aria-disabled', this.inputNumberDisabled);
256 + },
257 + updated() {
258 + if (!this.$refs || !this.$refs.input) return;
259 + const innerInput = this.$refs.input.$refs.input;
260 + innerInput.setAttribute('aria-valuenow', this.currentValue);
261 + }
262 + };
263 +</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 = "";
......