Elements-SY

modify

...@@ -225,59 +225,64 @@ export const inputBlurValidate = { ...@@ -225,59 +225,64 @@ export const inputBlurValidate = {
225 }, 225 },
226 // 报价值【申报价值可以为空为0】 226 // 报价值【申报价值可以为空为0】
227 validateCustomVal(value, customVal) { 227 validateCustomVal(value, customVal) {
228 + // 先判断输入的值是否符合符合规则,再判断申报价值区间
228 let coin = { 229 let coin = {
229 minCNYCustomVal: "minCNYCustomVal", 230 minCNYCustomVal: "minCNYCustomVal",
230 maxCNYCustomVal: "minCNYCustomVal", 231 maxCNYCustomVal: "minCNYCustomVal",
231 minSUDCustomVal: "minSUDCustomVal", 232 minSUDCustomVal: "minSUDCustomVal",
232 maxSUDCustomVal: "minSUDCustomVal", 233 maxSUDCustomVal: "minSUDCustomVal",
233 }; 234 };
235 + // 区间范围
234 let currency = { 236 let currency = {
235 minCNYCustomVal: 2000, 237 minCNYCustomVal: 2000,
236 maxCNYCustomVal: 2000, 238 maxCNYCustomVal: 2000,
237 minSUDCustomVal: 600, 239 minSUDCustomVal: 600,
238 maxSUDCustomVal: 600, 240 maxSUDCustomVal: 600,
239 }; 241 };
240 - let markCoin = false;
241 if (value.length) { 242 if (value.length) {
242 this[customVal] = Number(value); 243 this[customVal] = Number(value);
244 + if (/^(0|[1-9]\d*)(.\d{1,2})?$/.test(this[customVal])) {
243 // 其中一个有值的情况下人民币 245 // 其中一个有值的情况下人民币
244 - if (customVal == "minCNYCustomVal" || customVal == "maxCNYCustomVal") { 246 + if (
247 + customVal == "minCNYCustomVal" ||
248 + customVal == "maxCNYCustomVal"
249 + ) {
250 + // 如果人民币两个都有值的情况下
245 if (this.minCNYCustomVal && this.maxCNYCustomVal) { 251 if (this.minCNYCustomVal && this.maxCNYCustomVal) {
252 + // 判断右区间是否大于左区间
253 + if (Number(this.maxCNYCustomVal) < Number(this.minCNYCustomVal)) {
254 + this.$refs[coin[customVal]].innerHTML =
255 + "最小申报价值不得大于最大申报价值";
246 this.validateForm = false; 256 this.validateForm = false;
247 - markCoin =
248 - Number(this.maxCNYCustomVal) < Number(this.minCNYCustomVal);
249 } else { 257 } else {
258 + this.$refs[coin[customVal]].innerHTML = "";
250 this.validateForm = true; 259 this.validateForm = true;
260 + }
261 + } else {
251 this.$refs[coin[customVal]].innerHTML = ""; 262 this.$refs[coin[customVal]].innerHTML = "";
263 + this.validateForm = true;
252 } 264 }
253 } 265 }
254 - // 都有值的情况下美元 266 + // 其中一个有值的情况下美元
255 - else { 267 + if (
268 + customVal == "minSUDCustomVal" ||
269 + customVal == "maxSUDCustomVal"
270 + ) {
271 + // 如果美元两个都有值的情况下
256 if (this.minSUDCustomVal && this.maxSUDCustomVal) { 272 if (this.minSUDCustomVal && this.maxSUDCustomVal) {
273 + // 判断右区间是否大于左区间
274 + if (Number(this.maxSUDCustomVal) < Number(this.minSUDCustomVal)) {
275 + this.$refs[coin[customVal]].innerHTML =
276 + "最小申报价值不得大于最大申报价值";
257 this.validateForm = false; 277 this.validateForm = false;
258 - markCoin = 278 + } else {
259 - Number(this.maxSUDCustomVal) < Number(this.minSUDCustomVal); 279 + this.$refs[coin[customVal]].innerHTML = "";
260 - } 280 + this.validateForm = true;
261 } 281 }
262 - if (/^(0|[1-9]\d*)(.\d{1,2})?$/.test(this[customVal])) { 282 + } else {
263 - if (this[customVal] >= 0) { 283 + this.validateForm = true;
264 - if (markCoin) {
265 - this.validateForm = false;
266 this.$refs[coin[customVal]].innerHTML = ""; 284 this.$refs[coin[customVal]].innerHTML = "";
267 - this.$refs[coin[customVal]].innerHTML =
268 - "最小申报价值不得大于最大申报价值";
269 } 285 }
270 - // 判断申报价值不得大于上限
271 - // else if (this[customVal] > currency[customVal]) {
272 - // this.validateForm = false;
273 - // this.$refs[coin[customVal]].innerHTML = "";
274 - // this.$refs[
275 - // coin[customVal]
276 - // ].innerHTML = `最大申报值不得大于${currency[customVal]}`;
277 - // } else {
278 - // this.validateForm = true;
279 - // this.$refs[coin[customVal]].innerHTML = "";
280 - // }
281 } 286 }
282 } else { 287 } else {
283 this.validateForm = false; 288 this.validateForm = false;
......
...@@ -1001,6 +1001,9 @@ export default { ...@@ -1001,6 +1001,9 @@ export default {
1001 //总重量更新 1001 //总重量更新
1002 // formdata.totalWeight = this.Weightall() 1002 // formdata.totalWeight = this.Weightall()
1003 formdata.route = this.form.route.toString().replace(/,/g, ';') 1003 formdata.route = this.form.route.toString().replace(/,/g, ';')
1004 + if(this.form.extraWeightPercent == undefined || this.form.extraWeightPercent == null){
1005 + formdata.extraWeightPercent = 0
1006 + }
1004 //处理数据 1007 //处理数据
1005 saveOrUpdate(formdata).then((response) => { 1008 saveOrUpdate(formdata).then((response) => {
1006 if (response.code === 200) { 1009 if (response.code === 200) {
......
...@@ -520,7 +520,8 @@ export default { ...@@ -520,7 +520,8 @@ export default {
520 const { code, data, msg } = res; 520 const { code, data, msg } = res;
521 if (code == 200) { 521 if (code == 200) {
522 data.list.flightRankDtoList.map((item) => { 522 data.list.flightRankDtoList.map((item) => {
523 - if (name == "view") { // 跳转页面传过来的字段值等于view展示查看 523 + if (name == "view") {
524 + // 跳转页面传过来的字段值等于view展示查看
524 item.edit = true; 525 item.edit = true;
525 } else { 526 } else {
526 item.edit = false; 527 item.edit = false;
...@@ -535,7 +536,8 @@ export default { ...@@ -535,7 +536,8 @@ export default {
535 // ET86配舱航班顺位列表 536 // ET86配舱航班顺位列表
536 this.tableData = data.list.flightRankDtoList; 537 this.tableData = data.list.flightRankDtoList;
537 Object.keys(data.list.fltRuleDto).map((key) => { 538 Object.keys(data.list.fltRuleDto).map((key) => {
538 - if (key == "multiHs") { // N为单品名,Y为多品名 539 + if (key == "multiHs") {
540 + // N为单品名,Y为多品名
539 if (data.list.fltRuleDto[key] == "N") { 541 if (data.list.fltRuleDto[key] == "N") {
540 data.list.fltRuleDto[key] = true; 542 data.list.fltRuleDto[key] = true;
541 } else { 543 } else {
...@@ -696,6 +698,7 @@ export default { ...@@ -696,6 +698,7 @@ export default {
696 // 表单提交 698 // 表单提交
697 submitForm(formName) { 699 submitForm(formName) {
698 this.$refs[formName].validate((valid) => { 700 this.$refs[formName].validate((valid) => {
701 + console.log(this.queryForm, valid);
699 if (valid) { 702 if (valid) {
700 // 爆仓是否继续配舱 703 // 爆仓是否继续配舱
701 const newtTableData = JSON.parse(JSON.stringify(this.tableData)); 704 const newtTableData = JSON.parse(JSON.stringify(this.tableData));
......