Commit cb99fae1 authored by Hagsn3's avatar Hagsn3

修改代码

parent ce61be0a
<template>
<div class="CheckBobyList" id="nbprint">
<div id="nbprint" class="CheckBobyList">
<!-- 检查表主体-->
<div class="checkList">
<!-- 检查表第一部分 -->
......@@ -23,8 +23,8 @@
v-model="inspectInfoList.jcCj"
:disabled="firstFromDisabled"
class="normalSelect"
@change="handleJcCjChange"
placeholder="请选择厂家"
@change="handleJcCjChange"
>
<el-option
v-for="item in manufacturer"
......@@ -61,7 +61,7 @@
<el-form-item>
<div class="scanAndPrint">
<el-button class="scanCodeTop" type="primary" @click="scanCodes"><div class="scanTest">扫码</div></el-button>
<el-button class="printCodeTop" type="primary" v-print="printOption"><div class="printTest">打印</div></el-button>
<el-button v-print="printOption" class="printCodeTop" type="primary"><div class="printTest">打印</div></el-button>
</div>
</el-form-item>
<el-form-item label="rank:" prop="jcRank">
......@@ -1478,256 +1478,256 @@
/>
</div>
</div>
<div class="Content">
<div class="oneDiv">
<div class="number">26</div>
<div class="recordData">
<el-form-item
:ref="'recode2.'+10+'.recordData'"
:prop="'recode2.'+10+'.recordData'"
:rules="[{required: !disableInput, validator: numTypeTwo, trigger: 'blur'}]"
>
<el-input
ref="input26"
v-model="inspectJbAl2o3List.recode2[10].recordData"
:maxlength="IRMAXLENGTHTWO"
:disabled="firstFromDisabled || disableInput"
@input="handleData2Input(10)"
@keyup.enter.native="handelTab(26,$event)"
/>
</el-form-item>
</div>
<div class="emptyButton">
<i
v-show="!(firstFromDisabled)"
class="el-icon-circle-close"
style="color: #5cbce5"
@click="clearInspectionFormTwo(10)"
/>
</div>
</div>
<div :class="inspectJbAl2o3List.recode2[10].differenceValue3 === '合格' ? 'Value' : 'errValue'">
<TextToolTip
:text="inspectJbAl2o3List.recode2[10].differenceValue3"
:max-length="8"
:disabled-show="false"
/>
</div>
<div class="averageValue">
<TextToolTip
:text="inspectJbAl2o3List.recode2[10].differenceValue1"
:max-length="8"
:disabled-show="false"
/>
</div>
<div :class="inspectJbAl2o3List.recode2[10].differenceValue2 === '合格' ? 'compareValue' : 'errorCompareValue'">
<TextToolTip
:text="inspectJbAl2o3List.recode2[10].differenceValue2"
:max-length="8"
:disabled-show="false"
/>
</div>
</div>
<div class="Content">
<div class="oneDiv">
<div class="number">27</div>
<div class="recordData">
<el-form-item
:ref="'recode2.'+11+'.recordData'"
:prop="'recode2.'+11+'.recordData'"
:rules="[{required: !disableInput, validator: numTypeTwo, trigger: 'blur'}]"
>
<el-input
ref="input27"
v-model="inspectJbAl2o3List.recode2[11].recordData"
:maxlength="IRMAXLENGTHTWO"
:disabled="firstFromDisabled || disableInput"
@input="handleData2Input(11)"
@keyup.enter.native="handelTab(27,$event)"
/>
</el-form-item>
</div>
<div class="emptyButton">
<i
v-show="!(firstFromDisabled)"
class="el-icon-circle-close"
style="color: #5cbce5"
@click="clearInspectionFormTwo(11)"
/>
</div>
</div>
<div :class="inspectJbAl2o3List.recode2[11].differenceValue3 === '合格' ? 'Value' : 'errValue'">
<TextToolTip
:text="inspectJbAl2o3List.recode2[11].differenceValue3"
:max-length="8"
:disabled-show="false"
/>
</div>
<div class="averageValue">
<TextToolTip
:text="inspectJbAl2o3List.recode2[11].differenceValue1"
:max-length="8"
:disabled-show="false"
/>
</div>
<div :class="inspectJbAl2o3List.recode2[11].differenceValue2 === '合格' ? 'compareValue' : 'errorCompareValue'">
<TextToolTip
:text="inspectJbAl2o3List.recode2[11].differenceValue2"
:max-length="8"
:disabled-show="false"
/>
</div>
</div>
<div class="Content">
<div class="oneDiv">
<div class="number">28</div>
<div class="recordData">
<el-form-item
:ref="'recode2.'+12+'.recordData'"
:prop="'recode2.'+12+'.recordData'"
:rules="[{required: !disableInput, validator: numTypeTwo, trigger: 'blur'}]"
>
<el-input
ref="input28"
v-model="inspectJbAl2o3List.recode2[12].recordData"
:maxlength="IRMAXLENGTHTWO"
:disabled="firstFromDisabled || disableInput"
@input="handleData2Input(12)"
@keyup.enter.native="handelTab(28,$event)"
/>
</el-form-item>
</div>
<div class="emptyButton">
<i
v-show="!(firstFromDisabled)"
class="el-icon-circle-close"
style="color: #5cbce5"
@click="clearInspectionFormTwo(12)"
/>
</div>
</div>
<div :class="inspectJbAl2o3List.recode2[12].differenceValue3 === '合格' ? 'Value' : 'errValue'">
<TextToolTip
:text="inspectJbAl2o3List.recode2[12].differenceValue3"
:max-length="8"
:disabled-show="false"
/>
</div>
<div class="averageValue">
<TextToolTip
:text="inspectJbAl2o3List.recode2[12].differenceValue1"
:max-length="8"
:disabled-show="false"
/>
</div>
<div :class="inspectJbAl2o3List.recode2[12].differenceValue2 === '合格' ? 'compareValue' : 'errorCompareValue'">
<TextToolTip
:text="inspectJbAl2o3List.recode2[12].differenceValue2"
:max-length="8"
:disabled-show="false"
/>
</div>
</div>
<div class="Content">
<div class="oneDiv">
<div class="number">29</div>
<div class="recordData">
<el-form-item
:ref="'recode2.'+13+'.recordData'"
:prop="'recode2.'+13+'.recordData'"
:rules="[{required: !disableInput, validator: numTypeTwo, trigger: 'blur'}]"
>
<el-input
ref="input29"
v-model="inspectJbAl2o3List.recode2[13].recordData"
:maxlength="IRMAXLENGTHTWO"
:disabled="firstFromDisabled || disableInput"
@input="handleData2Input(13)"
@keyup.enter.native="handelTab(29,$event)"
/>
</el-form-item>
</div>
<div class="emptyButton">
<i
v-show="!(firstFromDisabled)"
class="el-icon-circle-close"
style="color: #5cbce5"
@click="clearInspectionFormTwo(13)"
/>
</div>
</div>
<div :class="inspectJbAl2o3List.recode2[13].differenceValue3 === '合格' ? 'Value' : 'errValue'">
<TextToolTip
:text="inspectJbAl2o3List.recode2[13].differenceValue3"
:max-length="8"
:disabled-show="false"
/>
</div>
<div class="averageValue">
<TextToolTip
:text="inspectJbAl2o3List.recode2[13].differenceValue1"
:max-length="8"
:disabled-show="false"
/>
</div>
<div :class="inspectJbAl2o3List.recode2[13].differenceValue2 === '合格' ? 'compareValue' : 'errorCompareValue'">
<TextToolTip
:text="inspectJbAl2o3List.recode2[13].differenceValue2"
:max-length="8"
:disabled-show="false"
/>
</div>
</div>
<div class="Content">
<div class="oneDiv">
<div class="number">30</div>
<div class="recordData">
<el-form-item
:ref="'recode2.'+14+'.recordData'"
:prop="'recode2.'+14+'.recordData'"
:rules="[{required: !disableInput, validator: numTypeTwo, trigger: 'blur'}]"
>
<el-input
ref="input30"
v-model="inspectJbAl2o3List.recode2[14].recordData"
:maxlength="IRMAXLENGTHTWO"
:disabled="firstFromDisabled || disableInput"
@input="handleData2Input(14)"
@keyup.enter.native="handelTab(30,$event)"
/>
</el-form-item>
</div>
<div class="emptyButton">
<i
v-show="!(firstFromDisabled)"
class="el-icon-circle-close"
style="color: #5cbce5"
@click="clearInspectionFormTwo(14)"
/>
</div>
</div>
<div :class="inspectJbAl2o3List.recode2[14].differenceValue3 === '合格' ? 'Value' : 'errValue'">
<TextToolTip
:text="inspectJbAl2o3List.recode2[14].differenceValue3"
:max-length="8"
:disabled-show="false"
/>
</div>
<div class="averageValue">
<TextToolTip
:text="inspectJbAl2o3List.recode2[14].differenceValue1"
:max-length="8"
:disabled-show="false"
/>
</div>
<div :class="inspectJbAl2o3List.recode2[14].differenceValue2 === '合格' ? 'compareValue' : 'errorCompareValue'">
<TextToolTip
:text="inspectJbAl2o3List.recode2[14].differenceValue2"
:max-length="8"
:disabled-show="false"
/>
</div>
</div>
<!-- <div class="Content">-->
<!-- <div class="oneDiv">-->
<!-- <div class="number">26</div>-->
<!-- <div class="recordData">-->
<!-- <el-form-item-->
<!-- :ref="'recode2.'+10+'.recordData'"-->
<!-- :prop="'recode2.'+10+'.recordData'"-->
<!-- :rules="[{required: !disableInput, validator: numTypeTwo, trigger: 'blur'}]"-->
<!-- >-->
<!-- <el-input-->
<!-- ref="input26"-->
<!-- v-model="inspectJbAl2o3List.recode2[10].recordData"-->
<!-- :maxlength="IRMAXLENGTHTWO"-->
<!-- :disabled="firstFromDisabled || disableInput"-->
<!-- @input="handleData2Input(10)"-->
<!-- @keyup.enter.native="handelTab(26,$event)"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- </div>-->
<!-- <div class="emptyButton">-->
<!-- <i-->
<!-- v-show="!(firstFromDisabled)"-->
<!-- class="el-icon-circle-close"-->
<!-- style="color: #5cbce5"-->
<!-- @click="clearInspectionFormTwo(10)"-->
<!-- />-->
<!-- </div>-->
<!-- </div>-->
<!-- <div :class="inspectJbAl2o3List.recode2[10].differenceValue3 === '合格' ? 'Value' : 'errValue'">-->
<!-- <TextToolTip-->
<!-- :text="inspectJbAl2o3List.recode2[10].differenceValue3"-->
<!-- :max-length="8"-->
<!-- :disabled-show="false"-->
<!-- />-->
<!-- </div>-->
<!-- <div class="averageValue">-->
<!-- <TextToolTip-->
<!-- :text="inspectJbAl2o3List.recode2[10].differenceValue1"-->
<!-- :max-length="8"-->
<!-- :disabled-show="false"-->
<!-- />-->
<!-- </div>-->
<!-- <div :class="inspectJbAl2o3List.recode2[10].differenceValue2 === '合格' ? 'compareValue' : 'errorCompareValue'">-->
<!-- <TextToolTip-->
<!-- :text="inspectJbAl2o3List.recode2[10].differenceValue2"-->
<!-- :max-length="8"-->
<!-- :disabled-show="false"-->
<!-- />-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="Content">-->
<!-- <div class="oneDiv">-->
<!-- <div class="number">27</div>-->
<!-- <div class="recordData">-->
<!-- <el-form-item-->
<!-- :ref="'recode2.'+11+'.recordData'"-->
<!-- :prop="'recode2.'+11+'.recordData'"-->
<!-- :rules="[{required: !disableInput, validator: numTypeTwo, trigger: 'blur'}]"-->
<!-- >-->
<!-- <el-input-->
<!-- ref="input27"-->
<!-- v-model="inspectJbAl2o3List.recode2[11].recordData"-->
<!-- :maxlength="IRMAXLENGTHTWO"-->
<!-- :disabled="firstFromDisabled || disableInput"-->
<!-- @input="handleData2Input(11)"-->
<!-- @keyup.enter.native="handelTab(27,$event)"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- </div>-->
<!-- <div class="emptyButton">-->
<!-- <i-->
<!-- v-show="!(firstFromDisabled)"-->
<!-- class="el-icon-circle-close"-->
<!-- style="color: #5cbce5"-->
<!-- @click="clearInspectionFormTwo(11)"-->
<!-- />-->
<!-- </div>-->
<!-- </div>-->
<!-- <div :class="inspectJbAl2o3List.recode2[11].differenceValue3 === '合格' ? 'Value' : 'errValue'">-->
<!-- <TextToolTip-->
<!-- :text="inspectJbAl2o3List.recode2[11].differenceValue3"-->
<!-- :max-length="8"-->
<!-- :disabled-show="false"-->
<!-- />-->
<!-- </div>-->
<!-- <div class="averageValue">-->
<!-- <TextToolTip-->
<!-- :text="inspectJbAl2o3List.recode2[11].differenceValue1"-->
<!-- :max-length="8"-->
<!-- :disabled-show="false"-->
<!-- />-->
<!-- </div>-->
<!-- <div :class="inspectJbAl2o3List.recode2[11].differenceValue2 === '合格' ? 'compareValue' : 'errorCompareValue'">-->
<!-- <TextToolTip-->
<!-- :text="inspectJbAl2o3List.recode2[11].differenceValue2"-->
<!-- :max-length="8"-->
<!-- :disabled-show="false"-->
<!-- />-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="Content">-->
<!-- <div class="oneDiv">-->
<!-- <div class="number">28</div>-->
<!-- <div class="recordData">-->
<!-- <el-form-item-->
<!-- :ref="'recode2.'+12+'.recordData'"-->
<!-- :prop="'recode2.'+12+'.recordData'"-->
<!-- :rules="[{required: !disableInput, validator: numTypeTwo, trigger: 'blur'}]"-->
<!-- >-->
<!-- <el-input-->
<!-- ref="input28"-->
<!-- v-model="inspectJbAl2o3List.recode2[12].recordData"-->
<!-- :maxlength="IRMAXLENGTHTWO"-->
<!-- :disabled="firstFromDisabled || disableInput"-->
<!-- @input="handleData2Input(12)"-->
<!-- @keyup.enter.native="handelTab(28,$event)"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- </div>-->
<!-- <div class="emptyButton">-->
<!-- <i-->
<!-- v-show="!(firstFromDisabled)"-->
<!-- class="el-icon-circle-close"-->
<!-- style="color: #5cbce5"-->
<!-- @click="clearInspectionFormTwo(12)"-->
<!-- />-->
<!-- </div>-->
<!-- </div>-->
<!-- <div :class="inspectJbAl2o3List.recode2[12].differenceValue3 === '合格' ? 'Value' : 'errValue'">-->
<!-- <TextToolTip-->
<!-- :text="inspectJbAl2o3List.recode2[12].differenceValue3"-->
<!-- :max-length="8"-->
<!-- :disabled-show="false"-->
<!-- />-->
<!-- </div>-->
<!-- <div class="averageValue">-->
<!-- <TextToolTip-->
<!-- :text="inspectJbAl2o3List.recode2[12].differenceValue1"-->
<!-- :max-length="8"-->
<!-- :disabled-show="false"-->
<!-- />-->
<!-- </div>-->
<!-- <div :class="inspectJbAl2o3List.recode2[12].differenceValue2 === '合格' ? 'compareValue' : 'errorCompareValue'">-->
<!-- <TextToolTip-->
<!-- :text="inspectJbAl2o3List.recode2[12].differenceValue2"-->
<!-- :max-length="8"-->
<!-- :disabled-show="false"-->
<!-- />-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="Content">-->
<!-- <div class="oneDiv">-->
<!-- <div class="number">29</div>-->
<!-- <div class="recordData">-->
<!-- <el-form-item-->
<!-- :ref="'recode2.'+13+'.recordData'"-->
<!-- :prop="'recode2.'+13+'.recordData'"-->
<!-- :rules="[{required: !disableInput, validator: numTypeTwo, trigger: 'blur'}]"-->
<!-- >-->
<!-- <el-input-->
<!-- ref="input29"-->
<!-- v-model="inspectJbAl2o3List.recode2[13].recordData"-->
<!-- :maxlength="IRMAXLENGTHTWO"-->
<!-- :disabled="firstFromDisabled || disableInput"-->
<!-- @input="handleData2Input(13)"-->
<!-- @keyup.enter.native="handelTab(29,$event)"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- </div>-->
<!-- <div class="emptyButton">-->
<!-- <i-->
<!-- v-show="!(firstFromDisabled)"-->
<!-- class="el-icon-circle-close"-->
<!-- style="color: #5cbce5"-->
<!-- @click="clearInspectionFormTwo(13)"-->
<!-- />-->
<!-- </div>-->
<!-- </div>-->
<!-- <div :class="inspectJbAl2o3List.recode2[13].differenceValue3 === '合格' ? 'Value' : 'errValue'">-->
<!-- <TextToolTip-->
<!-- :text="inspectJbAl2o3List.recode2[13].differenceValue3"-->
<!-- :max-length="8"-->
<!-- :disabled-show="false"-->
<!-- />-->
<!-- </div>-->
<!-- <div class="averageValue">-->
<!-- <TextToolTip-->
<!-- :text="inspectJbAl2o3List.recode2[13].differenceValue1"-->
<!-- :max-length="8"-->
<!-- :disabled-show="false"-->
<!-- />-->
<!-- </div>-->
<!-- <div :class="inspectJbAl2o3List.recode2[13].differenceValue2 === '合格' ? 'compareValue' : 'errorCompareValue'">-->
<!-- <TextToolTip-->
<!-- :text="inspectJbAl2o3List.recode2[13].differenceValue2"-->
<!-- :max-length="8"-->
<!-- :disabled-show="false"-->
<!-- />-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="Content">-->
<!-- <div class="oneDiv">-->
<!-- <div class="number">30</div>-->
<!-- <div class="recordData">-->
<!-- <el-form-item-->
<!-- :ref="'recode2.'+14+'.recordData'"-->
<!-- :prop="'recode2.'+14+'.recordData'"-->
<!-- :rules="[{required: !disableInput, validator: numTypeTwo, trigger: 'blur'}]"-->
<!-- >-->
<!-- <el-input-->
<!-- ref="input30"-->
<!-- v-model="inspectJbAl2o3List.recode2[14].recordData"-->
<!-- :maxlength="IRMAXLENGTHTWO"-->
<!-- :disabled="firstFromDisabled || disableInput"-->
<!-- @input="handleData2Input(14)"-->
<!-- @keyup.enter.native="handelTab(30,$event)"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- </div>-->
<!-- <div class="emptyButton">-->
<!-- <i-->
<!-- v-show="!(firstFromDisabled)"-->
<!-- class="el-icon-circle-close"-->
<!-- style="color: #5cbce5"-->
<!-- @click="clearInspectionFormTwo(14)"-->
<!-- />-->
<!-- </div>-->
<!-- </div>-->
<!-- <div :class="inspectJbAl2o3List.recode2[14].differenceValue3 === '合格' ? 'Value' : 'errValue'">-->
<!-- <TextToolTip-->
<!-- :text="inspectJbAl2o3List.recode2[14].differenceValue3"-->
<!-- :max-length="8"-->
<!-- :disabled-show="false"-->
<!-- />-->
<!-- </div>-->
<!-- <div class="averageValue">-->
<!-- <TextToolTip-->
<!-- :text="inspectJbAl2o3List.recode2[14].differenceValue1"-->
<!-- :max-length="8"-->
<!-- :disabled-show="false"-->
<!-- />-->
<!-- </div>-->
<!-- <div :class="inspectJbAl2o3List.recode2[14].differenceValue2 === '合格' ? 'compareValue' : 'errorCompareValue'">-->
<!-- <TextToolTip-->
<!-- :text="inspectJbAl2o3List.recode2[14].differenceValue2"-->
<!-- :max-length="8"-->
<!-- :disabled-show="false"-->
<!-- />-->
<!-- </div>-->
<!-- </div>-->
</el-form>
</div>
</div>
......@@ -2934,11 +2934,11 @@ export default {
{ required: true, message: '请输入检验标准', trigger: 'blur' },
{ pattern: /^(0|[1-9]\d*)(\.\d{0,4})?$/, message: '请输入有效的数字', trigger: 'change' }
],
standtwoPx:[
standtwoPx: [
{ required: true, message: '请输入px', trigger: 'blur' },
{ pattern: /^(0|[1-9]\d*)(\.\d{0,4})?$/, message: '请输入有效的数字', trigger: 'change' }
],
standonePx:[
standonePx: [
{ required: true, message: '请输入PX:', trigger: 'blur' },
{ pattern: /^(0|[1-9]\d*)(\.\d{0,4})?$/, message: '请输入有效的数字', trigger: 'change' }
],
......@@ -3227,12 +3227,12 @@ export default {
methods: {
// 当px发生变化
handleCompare() {
for (var i=0;i<15;i++) {
for (var i = 0; i < 15; i++) {
this.handleData1Input(i)
}
},
handleCompareTwo() {
for (var i=0;i<15;i++) {
for (var i = 0; i < 10; i++) {
this.handleData2Input(i)
}
},
......@@ -3243,16 +3243,16 @@ export default {
console.log('选中第一个厂家')
this.disableInput = true
for (var i = 10; i < 15; i++) {
this.inspectJbAl2o3List.recode1[i].recordData = '';
this.inspectJbAl2o3List.recode1[i].differenceValue = '';
this.inspectJbAl2o3List.recode1[i].differenceValue1 = '';
this.inspectJbAl2o3List.recode1[i].differenceValue2 = '';
this.inspectJbAl2o3List.recode2[i].recordData = '';
this.inspectJbAl2o3List.recode2[i].differenceValue = '';
this.inspectJbAl2o3List.recode2[i].differenceValue1 = '';
this.inspectJbAl2o3List.recode2[i].differenceValue2 = '';
this.$refs.inspectJbAl2o3ListOne.validateField(`recode1.${i}.recordData`);
this.$refs.inspectJbAl2o3ListTwo.validateField(`recode2.${i}.recordData`);
this.inspectJbAl2o3List.recode1[i].recordData = ''
this.inspectJbAl2o3List.recode1[i].differenceValue = ''
this.inspectJbAl2o3List.recode1[i].differenceValue1 = ''
this.inspectJbAl2o3List.recode1[i].differenceValue2 = ''
// this.inspectJbAl2o3List.recode2[i].recordData = '';
// this.inspectJbAl2o3List.recode2[i].differenceValue = '';
// this.inspectJbAl2o3List.recode2[i].differenceValue1 = '';
// this.inspectJbAl2o3List.recode2[i].differenceValue2 = '';
this.$refs.inspectJbAl2o3ListOne.validateField(`recode1.${i}.recordData`)
// this.$refs.inspectJbAl2o3ListTwo.validateField(`recode2.${i}.recordData`);
}
} else {
console.log('选择其他厂家')
......@@ -3265,29 +3265,28 @@ export default {
return
}
if (that.disableInput) {
if ((i>=1 && i<10) || (i>=16 && i< 25)) {
if ((i >= 1 && i < 10) || (i >= 16 && i < 25)) {
that.$nextTick(() => {
e.target.blur()
const index = i + 1
that.$refs['input' + index].focus()
})
}
if ((i===10)) {
if ((i === 10)) {
that.$nextTick(() => {
e.target.blur()
const index = i + 6
that.$refs['input' + index].focus()
})
}
if ( i=== 25) {
if (i === 25) {
that.$nextTick(() => {
e.target.blur()
that.$refs['inspect1'].focus()
})
}
} else {
if (i < 30) {
if (i < 25) {
that.$nextTick(() => {
e.target.blur()
const index = i + 1
......@@ -3300,7 +3299,6 @@ export default {
})
}
}
},
tagTwohandelTab(i, e) {
const that = this
......@@ -3491,8 +3489,8 @@ export default {
this.inspectJbAl2o3List.recode1[index + 1].differenceValue = this.digitalFormat(Math.abs(num1 - num2).toFixed(this.LIMITNGHOURS))
this.inspectJbAl2o3List.recode1[index + 1].differenceValue1 = this.digitalFormat(((num1 + num2) / 2).toFixed(this.LIMITNGHOURS))
if (this.inspectJbAl2o3List.standonePx && this.inspectJbAl2o3List.standonePx != '') {
console.log('差值',Math.abs(this.inspectJbAl2o3List.recode1[index + 1].differenceValue ))
if (Math.abs(this.inspectJbAl2o3List.recode1[index + 1].differenceValue )> this.inspectJbAl2o3List.standonePx) {
console.log('差值', Math.abs(this.inspectJbAl2o3List.recode1[index + 1].differenceValue))
if (Math.abs(this.inspectJbAl2o3List.recode1[index + 1].differenceValue) > this.inspectJbAl2o3List.standonePx) {
this.inspectJbAl2o3List.recode1[index + 1].differenceValue3 = '不合格'
} else {
this.inspectJbAl2o3List.recode1[index + 1].differenceValue3 = '合格'
......@@ -3626,6 +3624,7 @@ export default {
handleData2Input(index) {
// 两种情况 1.单数 2.双数
if (index % 2 === 0) {
console.log('index', index)
/**
* 1.单数情况下计算 自身与自身加1 的差值和均值
*
......@@ -3633,9 +3632,13 @@ export default {
if (this.inspectJbAl2o3List.recode2[index].recordData && this.inspectJbAl2o3List.recode2[index].recordData !== '' && this.inspectJbAl2o3List.recode2[index].recordData !== undefined && this.inspectJbAl2o3List.recode2[index + 1].recordData && this.inspectJbAl2o3List.recode2[index + 1].recordData !== '' && this.inspectJbAl2o3List.recode2[index + 1].recordData !== undefined) {
const num1 = parseFloat(this.inspectJbAl2o3List.recode2[index].recordData)
const num2 = parseFloat(this.inspectJbAl2o3List.recode2[index + 1].recordData)
console.log('num1', num1)
console.log('num2', num2)
this.inspectJbAl2o3List.recode2[index + 1].differenceValue = this.digitalFormat(Math.abs(num1 - num2).toFixed(this.LIMITNGHOURS))
this.inspectJbAl2o3List.recode2[index + 1].differenceValue1 = this.digitalFormat(((num1 + num2) / 2).toFixed(this.LIMITNGHOURS))
if (this.inspectJbAl2o3List.standtwoPx && this.inspectJbAl2o3List.standtwoPx !== '') {
console.log('this.inspectJbAl2o3List.recode2[index + 1].differenceValue', this.inspectJbAl2o3List.recode2[index + 1].differenceValue)
console.log('this.inspectJbAl2o3List.standtwoPx', this.inspectJbAl2o3List.standtwoPx)
if (this.inspectJbAl2o3List.recode2[index + 1].differenceValue > this.inspectJbAl2o3List.standtwoPx) {
this.inspectJbAl2o3List.recode2[index + 1].differenceValue3 = '不合格'
} else {
......@@ -3657,10 +3660,14 @@ export default {
if (this.inspectJbAl2o3List.recode2[index].recordData && this.inspectJbAl2o3List.recode2[index].recordData !== '' && this.inspectJbAl2o3List.recode2[index - 1].recordData !== undefined && this.inspectJbAl2o3List.recode2[index - 1].recordData && this.inspectJbAl2o3List.recode2[index - 1].recordData !== '' && this.inspectJbAl2o3List.recode2[index - 1].recordData !== undefined) {
const num1 = parseFloat(this.inspectJbAl2o3List.recode2[index].recordData)
const num2 = parseFloat(this.inspectJbAl2o3List.recode2[index - 1].recordData)
console.log('num11', num1)
console.log('num21', num2)
this.inspectJbAl2o3List.recode2[index].differenceValue = this.digitalFormat(Math.abs(num1 - num2).toFixed(this.LIMITNGHOURS))
this.inspectJbAl2o3List.recode2[index].differenceValue1 = this.digitalFormat(((num1 + num2) / 2).toFixed(this.LIMITNGHOURS))
console.log('this.inspectJbAl2o3List.recode2[index + 1].differenceValue1', this.inspectJbAl2o3List.recode2[index + 1].differenceValue)
console.log('this.inspectJbAl2o3List.standtwoPx1', this.inspectJbAl2o3List.standtwoPx)
if (this.inspectJbAl2o3List.standtwoPx && this.inspectJbAl2o3List.standtwoPx !== '') {
if (this.inspectJbAl2o3List.recode2[index].differenceValue > this.inspectJbAl2o3List.standtwoPx) {
if (Math.abs(this.inspectJbAl2o3List.recode2[index].differenceValue) > this.inspectJbAl2o3List.standtwoPx) {
this.inspectJbAl2o3List.recode2[index].differenceValue3 = '不合格'
} else {
this.inspectJbAl2o3List.recode2[index].differenceValue3 = '合格'
......@@ -3776,48 +3783,48 @@ export default {
reserve(value) {
let s = '0'
if (value.lastIndexOf('.') === -1) {
s = value + '.00';
console.log('s', s);
s = value + '.00'
console.log('s', s)
} else {
// 如果字符串中包含句点,则对字符串进行处理以保留两位小数并进行四舍五入
let decimalIndex = value.lastIndexOf('.');
let integerValue = value.substring(0, decimalIndex); // 获取小数点前的整数部分
let decimalValue = value.substring(decimalIndex); // 获取小数点及其后面的部分
console.log('integerValue',integerValue)
console.log('decimalValue',decimalValue)
const decimalIndex = value.lastIndexOf('.')
const integerValue = value.substring(0, decimalIndex) // 获取小数点前的整数部分
const decimalValue = value.substring(decimalIndex) // 获取小数点及其后面的部分
console.log('integerValue', integerValue)
console.log('decimalValue', decimalValue)
// 如果小数部分为1位小数添加一个0
if (decimalValue.length === 1) {
s = value + '0'
}
if (decimalValue.length === 3) {
// 如果小数部分长度小于等于3,说明已经有两位小数或没有小数
s = value; // 不需要进行四舍五入,保留原始值
s = value // 不需要进行四舍五入,保留原始值
} else {
// 否则,对小数部分进行四舍五入
let roundedDecimal = parseFloat(decimalValue).toFixed(2);
console.log('roundedDecimal',roundedDecimal)
console.log('integerValue', integerValue + parseFloat(roundedDecimal)); // 这里需要将 roundedDecimal 转换成数字
s = Number(integerValue) + parseFloat(roundedDecimal); // 将整数部分和四舍五入后的小数部分拼接起来
const roundedDecimal = parseFloat(decimalValue).toFixed(2)
console.log('roundedDecimal', roundedDecimal)
console.log('integerValue', integerValue + parseFloat(roundedDecimal)) // 这里需要将 roundedDecimal 转换成数字
s = Number(integerValue) + parseFloat(roundedDecimal) // 将整数部分和四舍五入后的小数部分拼接起来
}
}
return String(s)
},
// 对于整数添加两位小数
reserve1(value) {
let s = '0';
let s = '0'
// 将 value 转换为字符串类型
value = value.toString();
value = value.toString()
if (value.lastIndexOf('.') == -1) {
s = value + '.00';
console.log('s', s);
s = value + '.00'
console.log('s', s)
} else {
s = value;
s = value
}
return s;
return s
},
// 计算标签一的校验标准1 和 检验标准2 之间的差值
getCalculateDifferences() {
for (var i = 0; i < 15; i++) {
for (var i = 0; i < 10; i++) {
this.calculateStandardTagTwo(i, this.inspectJbAl2o3List.standardTwo, this.inspectJbAl2o3List.standtwoPlus, this.inspectJbAl2o3List.standtwoCy)
}
},
......@@ -3923,7 +3930,7 @@ export default {
if (response.data.standardTwo) {
this.inspectJbAl2o3List.standardTwo = this.reserve1(String(response.data.standardTwo))
}
this.inspectJbAl2o3List.standonePx = response.data.standonePx
this.inspectJbAl2o3List.standonePx = response.data.standonePx
this.inspectJbAl2o3List.standtwoPx = response.data.standtwoPx
this.inspectJbAl2o3List.standardOneData = response.data.standardOneData
this.inspectJbAl2o3List.standardTwoData = response.data.standardTwoData
......@@ -3972,7 +3979,7 @@ export default {
this.getRecordThreeList(this.inspectJbAl2o3List.limitData.split(','))
}
// this.handleJcCjChange(this.inspectInfoList.jcCj)
console.log('this.inspectInfoList.jcCj',this.inspectInfoList.jcCj)
console.log('this.inspectInfoList.jcCj', this.inspectInfoList.jcCj)
if (this.inspectInfoList.jcCj === this.manufacturer[0].value) {
this.disableInput = true
} else {
......@@ -3992,17 +3999,17 @@ export default {
getRecordList(list1) {
for (let i = 0; i < list1.length; i++) {
this.inspectJbAl2o3List.recode1[i].recordData = list1[i]
if (i<list1.length - 1 ) {
if (i < list1.length - 1) {
this.handleData1Input(i)
}
}
},
// 数组2
getRecordTwoList(list1) {
console.log('list1',list1)
console.log('list1', list1)
for (let i = 0; i < list1.length; i++) {
this.inspectJbAl2o3List.recode2[i].recordData = list1[i]
if(i< list1.length-1) {
if (i < list1.length - 1) {
this.handleData2Input(i)
}
}
......
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