Elements-SY

Merge branch 'et86-black' into et86

...@@ -33,6 +33,9 @@ export const inputBlurValidate = { ...@@ -33,6 +33,9 @@ export const inputBlurValidate = {
33 ) { 33 ) {
34 this.validateForm = true; 34 this.validateForm = true;
35 this.$refs.minWeight.innerHTML = ""; 35 this.$refs.minWeight.innerHTML = "";
36 + } else {
37 + this.validateForm = false;
38 + this.$refs.minWeight.innerHTML = "请输入有效重量,小数保留5位";
36 } 39 }
37 } 40 }
38 // 最小重量有值的情况下 41 // 最小重量有值的情况下
...@@ -62,6 +65,15 @@ export const inputBlurValidate = { ...@@ -62,6 +65,15 @@ export const inputBlurValidate = {
62 this.validateForm = false; 65 this.validateForm = false;
63 this.$refs.minWeight.innerHTML = "请输入有效重量,小数保留5位"; 66 this.$refs.minWeight.innerHTML = "请输入有效重量,小数保留5位";
64 } 67 }
68 + } else {
69 + if (target.value && isNaN(target.value)) {
70 + this.validateForm = false;
71 + this.$refs.minWeight.innerHTML = "请输入有效重量,小数保留5位";
72 + }
73 + if (Number(target.value) < 0) {
74 + this.validateForm = false;
75 + this.$refs.minWeight.innerHTML = "请输入有效重量,小数保留5位";
76 + }
65 } 77 }
66 }, 78 },
67 // 最大重量失焦事件 79 // 最大重量失焦事件
...@@ -110,8 +122,31 @@ export const inputBlurValidate = { ...@@ -110,8 +122,31 @@ export const inputBlurValidate = {
110 this.validateForm = false; 122 this.validateForm = false;
111 this.$refs.minWeight.innerHTML = "请输入有效重量,小数保留5位"; 123 this.$refs.minWeight.innerHTML = "请输入有效重量,小数保留5位";
112 } 124 }
125 + } else {
126 + if (target.value && isNaN(target.value)) {
127 + this.validateForm = false;
128 + this.$refs.minWeight.innerHTML = "请输入有效重量,小数保留5位";
129 + }
130 + if (Number(target.value) < 0) {
131 + this.validateForm = false;
132 + this.$refs.minWeight.innerHTML = "请输入有效重量,小数保留5位";
133 + }
113 } 134 }
114 }, 135 },
136 + validateNumber(number) {
137 + // 首先检查是否为合法数字
138 + if (isNaN(number)) {
139 + return "请输入有效数字";
140 + }
141 +
142 + // 然后检查是否大于0
143 + if (number <= 0) {
144 + return "请输入大于0的数字";
145 + }
146 +
147 + // 如果通过了以上两个条件,则表示数字合法
148 + return "数字合法";
149 + },
115 // 人民币最小申报价值 150 // 人民币最小申报价值
116 inputCNYBlurMin({ target }, customVal) { 151 inputCNYBlurMin({ target }, customVal) {
117 // 申报价值最小值和最大值都为空的情况下 152 // 申报价值最小值和最大值都为空的情况下
...@@ -163,6 +198,17 @@ export const inputBlurValidate = { ...@@ -163,6 +198,17 @@ export const inputBlurValidate = {
163 this.$refs.minCNYCustomVal.innerHTML = 198 this.$refs.minCNYCustomVal.innerHTML =
164 "请输入有效申报价值,小数保留2位"; 199 "请输入有效申报价值,小数保留2位";
165 } 200 }
201 + } else {
202 + if (target.value && isNaN(target.value)) {
203 + this.validateForm = false;
204 + this.$refs.minCNYCustomVal.innerHTML =
205 + "请输入有效申报价值,小数保留2位";
206 + }
207 + if (Number(target.value) < 0) {
208 + this.validateForm = false;
209 + this.$refs.minCNYCustomVal.innerHTML =
210 + "请输入有效申报价值,小数保留2位";
211 + }
166 } 212 }
167 }, 213 },
168 // 人民币最大申报价值 214 // 人民币最大申报价值
...@@ -217,6 +263,17 @@ export const inputBlurValidate = { ...@@ -217,6 +263,17 @@ export const inputBlurValidate = {
217 this.$refs.minCNYCustomVal.innerHTML = 263 this.$refs.minCNYCustomVal.innerHTML =
218 "请输入有效申报价值,小数保留2位"; 264 "请输入有效申报价值,小数保留2位";
219 } 265 }
266 + } else {
267 + if (target.value && isNaN(target.value)) {
268 + this.validateForm = false;
269 + this.$refs.minCNYCustomVal.innerHTML =
270 + "请输入有效申报价值,小数保留2位";
271 + }
272 + if (Number(target.value) < 0) {
273 + this.validateForm = false;
274 + this.$refs.minCNYCustomVal.innerHTML =
275 + "请输入有效申报价值,小数保留2位";
276 + }
220 } 277 }
221 }, 278 },
222 // 美元最小申报价值 279 // 美元最小申报价值
...@@ -272,6 +329,17 @@ export const inputBlurValidate = { ...@@ -272,6 +329,17 @@ export const inputBlurValidate = {
272 this.$refs.minSUDCustomVal.innerHTML = 329 this.$refs.minSUDCustomVal.innerHTML =
273 "请输入有效申报价值,小数保留2位"; 330 "请输入有效申报价值,小数保留2位";
274 } 331 }
332 + } else {
333 + if (target.value && isNaN(target.value)) {
334 + this.validateForm = false;
335 + this.$refs.minSUDCustomVal.innerHTML =
336 + "请输入有效申报价值,小数保留2位";
337 + }
338 + if (Number(target.value) < 0) {
339 + this.validateForm = false;
340 + this.$refs.minSUDCustomVal.innerHTML =
341 + "请输入有效申报价值,小数保留2位";
342 + }
275 } 343 }
276 }, 344 },
277 // 美元最大申报价值 345 // 美元最大申报价值
...@@ -328,6 +396,17 @@ export const inputBlurValidate = { ...@@ -328,6 +396,17 @@ export const inputBlurValidate = {
328 this.$refs.minSUDCustomVal.innerHTML = 396 this.$refs.minSUDCustomVal.innerHTML =
329 "请输入有效申报价值,小数保留2位"; 397 "请输入有效申报价值,小数保留2位";
330 } 398 }
399 + } else {
400 + if (target.value && isNaN(target.value)) {
401 + this.validateForm = false;
402 + this.$refs.minSUDCustomVal.innerHTML =
403 + "请输入有效申报价值,小数保留2位";
404 + }
405 + if (Number(target.value) < 0) {
406 + this.validateForm = false;
407 + this.$refs.minSUDCustomVal.innerHTML =
408 + "请输入有效申报价值,小数保留2位";
409 + }
331 } 410 }
332 }, 411 },
333 // 校验件数方法 【件数可以为空但件数不得为0】只能输入正整数 412 // 校验件数方法 【件数可以为空但件数不得为0】只能输入正整数
......
...@@ -139,7 +139,7 @@ ...@@ -139,7 +139,7 @@
139 type="textarea" 139 type="textarea"
140 v-model="item.includeUrsa" 140 v-model="item.includeUrsa"
141 :rows="4" 141 :rows="4"
142 - placeholder="URSA之间用分号分隔,例:F1_;F2_;F3_;P_" 142 + placeholder="URSA之间用分号分隔,例:F1_;F2_;F3_"
143 > 143 >
144 </el-input> 144 </el-input>
145 </el-form-item> 145 </el-form-item>
...@@ -151,7 +151,7 @@ ...@@ -151,7 +151,7 @@
151 type="textarea" 151 type="textarea"
152 v-model="item.notIncludeUrsa" 152 v-model="item.notIncludeUrsa"
153 :rows="4" 153 :rows="4"
154 - placeholder="URSA之间用分号分隔,例:F1;F2;F3;P" 154 + placeholder="URSA之间用分号分隔,例:F1;F2;F3"
155 > 155 >
156 </el-input> 156 </el-input>
157 </el-form-item> 157 </el-form-item>
......
...@@ -164,7 +164,6 @@ export default { ...@@ -164,7 +164,6 @@ export default {
164 // 保存 【新增/修改航线规则设置】 164 // 保存 【新增/修改航线规则设置】
165 saveSubmit(item, index) { 165 saveSubmit(item, index) {
166 item.flightRoute = item.route || item.flightRoute; 166 item.flightRoute = item.route || item.flightRoute;
167 - item.ruleDate = item.ruleDate || this.queryForm.flightDate;
168 let parmas = JSON.parse(JSON.stringify(item)); 167 let parmas = JSON.parse(JSON.stringify(item));
169 this.returnString(parmas, "cargoType"); 168 this.returnString(parmas, "cargoType");
170 this.returnString(parmas, "typeOfGoods"); 169 this.returnString(parmas, "typeOfGoods");
...@@ -204,6 +203,7 @@ export default { ...@@ -204,6 +203,7 @@ export default {
204 let validate = validateForm.some((key) => parmas[key]); 203 let validate = validateForm.some((key) => parmas[key]);
205 if (validate) { 204 if (validate) {
206 this.loading = true; 205 this.loading = true;
206 + parmas.ruleDate = item.ruleDate || this.queryForm.flightDate;
207 updateOrAddFlight(parmas) 207 updateOrAddFlight(parmas)
208 .then((res) => { 208 .then((res) => {
209 const { code, msg, data } = res; 209 const { code, msg, data } = res;
......
...@@ -225,7 +225,7 @@ ...@@ -225,7 +225,7 @@
225 maxlength="1000" 225 maxlength="1000"
226 show-word-limit 226 show-word-limit
227 :rows="4" 227 :rows="4"
228 - placeholder="URSA之间用分号分隔,例:F1_;F2_;F3_;P_" 228 + placeholder="URSA之间用分号分隔,例:P_;W_;A_"
229 :disabled="!getRouter" 229 :disabled="!getRouter"
230 @blur="includeUrsa" 230 @blur="includeUrsa"
231 ></el-input> 231 ></el-input>
...@@ -254,7 +254,7 @@ ...@@ -254,7 +254,7 @@
254 maxlength="1000" 254 maxlength="1000"
255 show-word-limit 255 show-word-limit
256 :rows="4" 256 :rows="4"
257 - placeholder="URSA之间用分号分隔,例:F1;F2;F3;P" 257 + placeholder="URSA之间用分号分隔,例:F1;F2;F3"
258 :disabled="!getRouter" 258 :disabled="!getRouter"
259 @blur="notIncludeUrsa" 259 @blur="notIncludeUrsa"
260 ></el-input> 260 ></el-input>
...@@ -307,7 +307,7 @@ ...@@ -307,7 +307,7 @@
307 <el-col :span="10"> 307 <el-col :span="10">
308 <el-input 308 <el-input
309 v-model.trim="queryForm.minNumOfPieces" 309 v-model.trim="queryForm.minNumOfPieces"
310 - placeholder="最件数" 310 + placeholder="最件数"
311 @blur="inputBlurMinPieces($event)" 311 @blur="inputBlurMinPieces($event)"
312 :disabled="!getRouter" 312 :disabled="!getRouter"
313 ></el-input> 313 ></el-input>
...@@ -317,7 +317,7 @@ ...@@ -317,7 +317,7 @@
317 <el-col :span="10"> 317 <el-col :span="10">
318 <el-input 318 <el-input
319 v-model.trim="queryForm.maxNumOfPieces" 319 v-model.trim="queryForm.maxNumOfPieces"
320 - placeholder="最件数" 320 + placeholder="最件数"
321 @blur="inputBlurMaxPieces($event)" 321 @blur="inputBlurMaxPieces($event)"
322 :disabled="!getRouter" 322 :disabled="!getRouter"
323 ></el-input> 323 ></el-input>
...@@ -422,7 +422,7 @@ ...@@ -422,7 +422,7 @@
422 <script> 422 <script>
423 import YlForm from "@/components/YlForm"; 423 import YlForm from "@/components/YlForm";
424 import YlTable from "@/components/YlTable"; 424 import YlTable from "@/components/YlTable";
425 -import YlElInputNumber from "../components/input-number" 425 +import YlElInputNumber from "../components/input-number";
426 import { inputBlurValidate } from "@/utils/mixins"; 426 import { inputBlurValidate } from "@/utils/mixins";
427 import { tableAttr } from "./tableConfig"; 427 import { tableAttr } from "./tableConfig";
428 import { 428 import {
...@@ -440,7 +440,7 @@ export default { ...@@ -440,7 +440,7 @@ export default {
440 components: { 440 components: {
441 YlForm, 441 YlForm,
442 YlTable, 442 YlTable,
443 - YlElInputNumber 443 + YlElInputNumber,
444 }, 444 },
445 mixins: [indexMixins, inputBlurValidate], 445 mixins: [indexMixins, inputBlurValidate],
446 data() { 446 data() {
...@@ -486,11 +486,9 @@ export default { ...@@ -486,11 +486,9 @@ export default {
486 computed: { 486 computed: {
487 // 获取路由参数 487 // 获取路由参数
488 getRouter() { 488 getRouter() {
489 - if (this.$route.query.name == "add") { 489 + if (this.$route.query.name == "add" || this.$route.query.name == "edit") {
490 return "保存"; 490 return "保存";
491 - } else if (this.$route.query.name == "edit") { 491 + }else {
492 - return "修改";
493 - } else {
494 return false; 492 return false;
495 } 493 }
496 }, 494 },
...@@ -646,6 +644,7 @@ export default { ...@@ -646,6 +644,7 @@ export default {
646 this.tableData[this.currentIndex].flightRoute = ""; 644 this.tableData[this.currentIndex].flightRoute = "";
647 } 645 }
648 } 646 }
647 + this.tableData[this.currentIndex].flightRoute = "";
649 }) 648 })
650 .catch(() => {}); 649 .catch(() => {});
651 }, 650 },
......
...@@ -132,7 +132,7 @@ export default { ...@@ -132,7 +132,7 @@ export default {
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包含之间用分号分隔,例:P_;W_;A_";
136 } 136 }
137 if (ursaMark && !ursaInfo.repeat && ursaInfo.inUrsa) { 137 if (ursaMark && !ursaInfo.repeat && ursaInfo.inUrsa) {
138 this.ursaError = ""; 138 this.ursaError = "";
...@@ -142,7 +142,7 @@ export default { ...@@ -142,7 +142,7 @@ export default {
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不包含之间用分号分隔,例:F1;F2;F3";
146 } 146 }
147 if (!ursaMark && !ursaInfo.repeat && ursaInfo.inUrsa) { 147 if (!ursaMark && !ursaInfo.repeat && ursaInfo.inUrsa) {
148 this.notUrsaError = ""; 148 this.notUrsaError = "";
......