Commit 9725dfbe authored by 高宇's avatar 高宇

精度丢失

parent e343f6c8
......@@ -2320,17 +2320,17 @@ export default {
rejectLoading: false,
ThirdFromRules: {
wgKx: [{ pattern: /^(0|[1-9]\d*)(\.\d{0,4})?$/, message: '请输入有效的数字', trigger: 'change' }],
wgLlw: [{ pattern: /^(0|[1-9]\d*)(\.\d{0,6})?$/, message: '请输入有效的数字', trigger: 'change' }],
wgWlw: [{ pattern: /^(0|[1-9]\d*)(\.\d{0,6})?$/, message: '请输入有效的数字', trigger: 'change' }],
wgJbwq: [{ pattern: /^(0|[1-9]\d*)(\.\d{0,6})?$/, message: '请输入有效的数字', trigger: 'change' }],
wgZk: [{ pattern: /^(0|[1-9]\d*)(\.\d{0,6})?$/, message: '请输入有效的数字', trigger: 'change' }],
wgSh: [{ pattern: /^(0|[1-9]\d*)(\.\d{0,6})?$/, message: '请输入有效的数字', trigger: 'change' }],
wgBm: [{ pattern: /^(0|[1-9]\d*)(\.\d{0,6})?$/, message: '请输入有效的数字', trigger: 'change' }],
wgTc: [{ pattern: /^(0|[1-9]\d*)(\.\d{0,6})?$/, message: '请输入有效的数字', trigger: 'change' }],
wgQg: [{ pattern: /^(0|[1-9]\d*)(\.\d{0,6})?$/, message: '请输入有效的数字', trigger: 'change' }],
wgCq: [{ pattern: /^(0|[1-9]\d*)(\.\d{0,6})?$/, message: '请输入有效的数字', trigger: 'change' }],
wgFf: [{ pattern: /^(0|[1-9]\d*)(\.\d{0,6})?$/, message: '请输入有效的数字', trigger: 'change' }],
wgTf: [{ pattern: /^(0|[1-9]\d*)(\.\d{0,6})?$/, message: '请输入有效的数字', trigger: 'change' }]
wgLlw: [{ pattern: /^(0|[1-9]\d*)(\.\d{0,4})?$/, message: '请输入有效的数字', trigger: 'change' }],
wgWlw: [{ pattern: /^(0|[1-9]\d*)(\.\d{0,4})?$/, message: '请输入有效的数字', trigger: 'change' }],
wgJbwq: [{ pattern: /^(0|[1-9]\d*)(\.\d{0,4})?$/, message: '请输入有效的数字', trigger: 'change' }],
wgZk: [{ pattern: /^(0|[1-9]\d*)(\.\d{0,4})?$/, message: '请输入有效的数字', trigger: 'change' }],
wgSh: [{ pattern: /^(0|[1-9]\d*)(\.\d{0,4})?$/, message: '请输入有效的数字', trigger: 'change' }],
wgBm: [{ pattern: /^(0|[1-9]\d*)(\.\d{0,4})?$/, message: '请输入有效的数字', trigger: 'change' }],
wgTc: [{ pattern: /^(0|[1-9]\d*)(\.\d{0,4})?$/, message: '请输入有效的数字', trigger: 'change' }],
wgQg: [{ pattern: /^(0|[1-9]\d*)(\.\d{0,4})?$/, message: '请输入有效的数字', trigger: 'change' }],
wgCq: [{ pattern: /^(0|[1-9]\d*)(\.\d{0,4})?$/, message: '请输入有效的数字', trigger: 'change' }],
wgFf: [{ pattern: /^(0|[1-9]\d*)(\.\d{0,4})?$/, message: '请输入有效的数字', trigger: 'change' }],
wgTf: [{ pattern: /^(0|[1-9]\d*)(\.\d{0,4})?$/, message: '请输入有效的数字', trigger: 'change' }]
},
// 第一部分限制表单账单
IRMAXLENGTHONE: 11,
......@@ -2391,39 +2391,39 @@ export default {
}],
standardOne: [
{ required: true, message: '请输入检验标准', trigger: 'blur' },
{ pattern: /^(0|[1-9]\d*)(\.\d{0,6})?$/, message: '请输入有效的数字', trigger: 'change' }
{ pattern: /^(0|[1-9]\d*)(\.\d{0,4})?$/, message: '请输入有效的数字', trigger: 'change' }
],
standonePlus: [
{ required: true, message: '请输入检验标准', trigger: 'blur' },
{ pattern: /^(0|[1-9]\d*)(\.\d{0,6})?$/, message: '请输入有效的数字', trigger: 'change' },
{ pattern: /^(0|[1-9]\d*)(\.\d{0,4})?$/, message: '请输入有效的数字', trigger: 'change' },
{ validator: this.validateMethod3, trigger: 'blur' }
],
standoneCy: [ { required: true, message: '请输入差异', trigger: 'blur' },
{ pattern: /^(0|[1-9]\d*)(\.\d{0,6})?$/, message: '请输入有效的数字', trigger: 'change' }],
{ pattern: /^(0|[1-9]\d*)(\.\d{0,4})?$/, message: '请输入有效的数字', trigger: 'change' }],
standtwoCy: [{ required: true, message: '请输入差异', trigger: 'blur' },
{ pattern: /^(0|[1-9]\d*)(\.\d{0,6})?$/, message: '请输入有效的数字', trigger: 'change' }],
{ pattern: /^(0|[1-9]\d*)(\.\d{0,4})?$/, message: '请输入有效的数字', trigger: 'change' }],
standardTwo: [
{ required: true, message: '请输入检验标准', trigger: 'blur' },
{ pattern: /^(0|[1-9]\d*)(\.\d{0,6})?$/, message: '请输入有效的数字', trigger: 'change' }
{ pattern: /^(0|[1-9]\d*)(\.\d{0,4})?$/, message: '请输入有效的数字', trigger: 'change' }
],
standtwoPlus: [
{ required: true, message: '请输入检验标准', trigger: 'blur' },
{ pattern: /^(0|[1-9]\d*)(\.\d{0,6})?$/, message: '请输入有效的数字', trigger: 'change' },
{ pattern: /^(0|[1-9]\d*)(\.\d{0,4})?$/, message: '请输入有效的数字', trigger: 'change' },
{ validator: this.validateMethod4, trigger: 'blur' }
],
limitOne: [
{ required: true, message: '请输入检验标准', trigger: 'blur' },
{ pattern: /^(0|[1-9]\d*)(\.\d{0,6})?$/, message: '请输入有效的数字', trigger: 'change' },
{ pattern: /^(0|[1-9]\d*)(\.\d{0,4})?$/, message: '请输入有效的数字', trigger: 'change' },
{ validator: this.validateMethod1, trigger: 'blur' }
],
limitTwo: [
{ required: true, message: '请输入检验标准', trigger: 'blur' },
{ pattern: /^(0|[1-9]\d*)(\.\d{0,6})?$/, message: '请输入有效的数字', trigger: 'change' },
{ pattern: /^(0|[1-9]\d*)(\.\d{0,4})?$/, message: '请输入有效的数字', trigger: 'change' },
{ validator: this.validateMethod2, trigger: 'blur' }
],
limitThree: [
{ required: true, message: '请输入检验标准', trigger: 'blur' },
{ pattern: /^(0|[1-9]\d*)(\.\d{0,6})?$/, message: '请输入有效的数字', trigger: 'change' }
{ pattern: /^(0|[1-9]\d*)(\.\d{0,4})?$/, message: '请输入有效的数字', trigger: 'change' }
],
recordData: [
{ required: true, message: '请输入检验数据', trigger: 'blur' }
......@@ -3089,7 +3089,7 @@ export default {
const limitOne = parseFloat(this.inspectJbAl2o3List.limitOne)
const limitTwo = parseFloat(this.inspectJbAl2o3List.limitTwo)
const recordData3 = this.inspectJbAl2o3List.recode3[index].recordData
this.inspectJbAl2o3List.limitThree = Math.abs(limitOne - limitTwo)
// this.inspectJbAl2o3List.limitThree = Math.abs(limitOne - limitTwo)
if (recordData3 !== '') {
const num = parseFloat(recordData3)
if (num >= limitOne && num <= limitTwo) {
......@@ -3099,9 +3099,9 @@ export default {
}
}
}
if (this.inspectJbAl2o3List.limitOne === '' || this.inspectJbAl2o3List.limitTwo === '') {
this.inspectJbAl2o3List.limitThree = ''
}
// if (this.inspectJbAl2o3List.limitOne === '' || this.inspectJbAl2o3List.limitTwo === '') {
// this.inspectJbAl2o3List.limitThree = ''
// }
if (this.inspectJbAl2o3List.recode3[index].recordData === '' || this.inspectJbAl2o3List.limitOne === '' || this.inspectJbAl2o3List.limitTwo === '') {
this.inspectJbAl2o3List.recode3[index].differenceValue = ''
}
......@@ -3119,12 +3119,12 @@ export default {
for (let i = 0; i < 15; i++) {
this.handleData3Input(i)
}
if (this.inspectJbAl2o3List.limitOne && this.inspectJbAl2o3List.limitOne !== '' && this.inspectJbAl2o3List.limitOne !== undefined && this.inspectJbAl2o3List.limitTwo &&this.inspectJbAl2o3List.limitTwo !== '' &&this.inspectJbAl2o3List.limitTwo !== undefined) {
const limitOne = parseFloat(this.inspectJbAl2o3List.limitOne)
const limitTwo = parseFloat(this.inspectJbAl2o3List.limitTwo)
this.inspectJbAl2o3List.limitThree = Math.abs(limitOne - limitTwo)
if (this.inspectJbAl2o3List.limitOne && this.inspectJbAl2o3List.limitOne !== '' && this.inspectJbAl2o3List.limitOne !== undefined && this.inspectJbAl2o3List.limitTwo && this.inspectJbAl2o3List.limitTwo !== '' && this.inspectJbAl2o3List.limitTwo !== undefined) {
const limitOne = Math.floor(Number(this.inspectJbAl2o3List.limitOne) * 10000); // 将浮点数转换为整数并保留整数部分
const limitTwo = Math.floor(Number(this.inspectJbAl2o3List.limitTwo) * 10000);
this.inspectJbAl2o3List.limitThree = Math.abs(limitOne - limitTwo) / 10000; // 将结果转换回浮点数
} else {
this.inspectJbAl2o3List.limitThree = ''
this.inspectJbAl2o3List.limitThree = '';
}
},
// 计算标签一的校验标准1 和 检验标准2 之间的差值
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment