Commit 0884688d authored by 高宇's avatar 高宇

删除按钮

parent f5055d6b
...@@ -107,17 +107,30 @@ ...@@ -107,17 +107,30 @@
<!-- 检查内容--> <!-- 检查内容-->
<div class="recordOneContainer"> <div class="recordOneContainer">
<div class="inspectionStandards"> <div class="inspectionStandards">
<el-form ref="inspectJbAl2o3List" :model="inspectJbAl2o3List" :rules="rules"> <el-form ref="inspectJbAl2o3List" label-width="80" label-position="right" :model="inspectJbAl2o3List" :rules="rules">
<el-form-item label="检验标准1:" label-width="80" prop="standardOne"> <el-form-item label="检验标准1:" prop="standardOne">
<el-input <el-input
v-model="inspectJbAl2o3List.standardOne" v-model="inspectJbAl2o3List.standardOne"
class="inspectionStandardsInput" class="inspectionStandardsInput"
:maxlength="IRMAXLENGTHONE" :maxlength="IRMAXLENGTHONE"
:disabled="firstFromDisabled" :disabled="firstFromDisabled"
@blur="getInspect" @blur="getInspect"
@input="calculateStandard(1)" @input="getCalculateDifference"
/> />
</el-form-item> </el-form-item>
<el-form-item label="检验标准2:" prop="standonePlus">
<el-input
v-model="inspectJbAl2o3List.standonePlus"
class="inspectionStandardsInput"
:maxlength="IRMAXLENGTHONE"
:disabled="firstFromDisabled"
@blur="getInspect"
@input="getCalculateDifference"
/>
</el-form-item>
<el-form-item label="差异:" class="inspectionStandardLabel" prop="standoneCy">
<span>{{inspectJbAl2o3List.standoneCy}}</span>
</el-form-item>
</el-form> </el-form>
</div> </div>
<div class="recordOneTitle"> <div class="recordOneTitle">
...@@ -171,7 +184,7 @@ ...@@ -171,7 +184,7 @@
:disabled-show="false" :disabled-show="false"
/> />
</div> </div>
<div class="compareValue"> <div :class="inspectJbAl2o3List.recode1[0].differenceValue2 === '合格'? 'compareValue' : 'eorrCompareValue'">
<TextToolTip <TextToolTip
:text="inspectJbAl2o3List.recode1[0].differenceValue2" :text="inspectJbAl2o3List.recode1[0].differenceValue2"
:max-length="8" :max-length="8"
...@@ -221,7 +234,7 @@ ...@@ -221,7 +234,7 @@
:disabled-show="false" :disabled-show="false"
/> />
</div> </div>
<div class="compareValue"> <div :class="inspectJbAl2o3List.recode1[1].differenceValue2 === '合格'? 'compareValue' : 'eorrCompareValue'">
<TextToolTip <TextToolTip
:text="inspectJbAl2o3List.recode1[1].differenceValue2" :text="inspectJbAl2o3List.recode1[1].differenceValue2"
:max-length="8" :max-length="8"
...@@ -271,7 +284,7 @@ ...@@ -271,7 +284,7 @@
:disabled-show="false" :disabled-show="false"
/> />
</div> </div>
<div class="compareValue"> <div :class="inspectJbAl2o3List.recode1[2].differenceValue2 === '合格'? 'compareValue' : 'eorrCompareValue'">
<TextToolTip <TextToolTip
:text="inspectJbAl2o3List.recode1[2].differenceValue2" :text="inspectJbAl2o3List.recode1[2].differenceValue2"
:max-length="8" :max-length="8"
...@@ -321,7 +334,7 @@ ...@@ -321,7 +334,7 @@
:disabled-show="false" :disabled-show="false"
/> />
</div> </div>
<div class="compareValue"> <div :class="inspectJbAl2o3List.recode1[3].differenceValue2 === '合格'? 'compareValue' : 'eorrCompareValue'">
<TextToolTip <TextToolTip
:text="inspectJbAl2o3List.recode1[3].differenceValue2" :text="inspectJbAl2o3List.recode1[3].differenceValue2"
:max-length="8" :max-length="8"
...@@ -371,7 +384,7 @@ ...@@ -371,7 +384,7 @@
:disabled-show="false" :disabled-show="false"
/> />
</div> </div>
<div class="compareValue"> <div :class="inspectJbAl2o3List.recode1[4].differenceValue2 === '合格'? 'compareValue' : 'eorrCompareValue'">
<TextToolTip <TextToolTip
:text="inspectJbAl2o3List.recode1[4].differenceValue2" :text="inspectJbAl2o3List.recode1[4].differenceValue2"
:max-length="8" :max-length="8"
...@@ -421,7 +434,7 @@ ...@@ -421,7 +434,7 @@
:disabled-show="false" :disabled-show="false"
/> />
</div> </div>
<div class="compareValue"> <div :class="inspectJbAl2o3List.recode1[5].differenceValue2 === '合格'? 'compareValue' : 'eorrCompareValue'">
<TextToolTip <TextToolTip
:text="inspectJbAl2o3List.recode1[5].differenceValue2" :text="inspectJbAl2o3List.recode1[5].differenceValue2"
:max-length="8" :max-length="8"
...@@ -471,7 +484,7 @@ ...@@ -471,7 +484,7 @@
:disabled-show="false" :disabled-show="false"
/> />
</div> </div>
<div class="compareValue"> <div :class="inspectJbAl2o3List.recode1[6].differenceValue2 === '合格'? 'compareValue' : 'eorrCompareValue'">
<TextToolTip <TextToolTip
:text="inspectJbAl2o3List.recode1[6].differenceValue2" :text="inspectJbAl2o3List.recode1[6].differenceValue2"
:max-length="8" :max-length="8"
...@@ -521,7 +534,7 @@ ...@@ -521,7 +534,7 @@
:disabled-show="false" :disabled-show="false"
/> />
</div> </div>
<div class="compareValue"> <div :class="inspectJbAl2o3List.recode1[7].differenceValue2 === '合格'? 'compareValue' : 'eorrCompareValue'">
<TextToolTip <TextToolTip
:text="inspectJbAl2o3List.recode1[7].differenceValue2" :text="inspectJbAl2o3List.recode1[7].differenceValue2"
:max-length="8" :max-length="8"
...@@ -571,7 +584,7 @@ ...@@ -571,7 +584,7 @@
:disabled-show="false" :disabled-show="false"
/> />
</div> </div>
<div class="compareValue"> <div :class="inspectJbAl2o3List.recode1[8].differenceValue2 === '合格'? 'compareValue' : 'eorrCompareValue'">
<TextToolTip <TextToolTip
:text="inspectJbAl2o3List.recode1[8].differenceValue2" :text="inspectJbAl2o3List.recode1[8].differenceValue2"
:max-length="8" :max-length="8"
...@@ -621,7 +634,7 @@ ...@@ -621,7 +634,7 @@
:disabled-show="false" :disabled-show="false"
/> />
</div> </div>
<div class="compareValue"> <div :class="inspectJbAl2o3List.recode1[9].differenceValue2 === '合格'? 'compareValue' : 'eorrCompareValue'">
<TextToolTip <TextToolTip
:text="inspectJbAl2o3List.recode1[9].differenceValue2" :text="inspectJbAl2o3List.recode1[9].differenceValue2"
:max-length="8" :max-length="8"
...@@ -646,16 +659,29 @@ ...@@ -646,16 +659,29 @@
<div class="recordOneContainer"> <div class="recordOneContainer">
<div class="inspectionStandards"> <div class="inspectionStandards">
<el-form ref="inspectJbAl2o3List" :model="inspectJbAl2o3List" :rules="rules"> <el-form ref="inspectJbAl2o3List" :model="inspectJbAl2o3List" :rules="rules">
<el-form-item label="检验标准2:" label-width="80" prop="standardTwo"> <el-form-item label="检验标准1:" label-width="80" prop="standardTwo">
<el-input <el-input
v-model="inspectJbAl2o3List.standardTwo" v-model="inspectJbAl2o3List.standardTwo"
:maxlength="IRMAXLENGTHTWO" :maxlength="IRMAXLENGTHTWO"
:disabled="firstFromDisabled" :disabled="firstFromDisabled"
class="inspectionStandardsInput" class="inspectionStandardsInput"
@blur="getInspect" @blur="getInspect"
@input="calculateStandard(2)" @input="getCalculateDifferences"
/> />
</el-form-item> </el-form-item>
<el-form-item label="检验标准2:" label-width="80" prop="standtwoPlus">
<el-input
v-model="inspectJbAl2o3List.standtwoPlus"
:maxlength="IRMAXLENGTHTWO"
:disabled="firstFromDisabled"
class="inspectionStandardsInput"
@blur="getInspect"
@input="getCalculateDifferences"
/>
</el-form-item>
<el-form-item label="差异:" class="inspectionStandardLabel" label-width="80" prop="standtwoCy">
<span>{{inspectJbAl2o3List.standtwoCy}}</span>
</el-form-item>
</el-form> </el-form>
</div> </div>
<div class="recordOneTitle"> <div class="recordOneTitle">
...@@ -709,7 +735,7 @@ ...@@ -709,7 +735,7 @@
:disabled-show="false" :disabled-show="false"
/> />
</div> </div>
<div class="compareValue"> <div :class="inspectJbAl2o3List.recode2[0].differenceValue2 === '合格' ? 'compareValue' : 'errorCompareValue'">
<TextToolTip <TextToolTip
:text="inspectJbAl2o3List.recode2[0].differenceValue2" :text="inspectJbAl2o3List.recode2[0].differenceValue2"
:max-length="8" :max-length="8"
...@@ -759,7 +785,7 @@ ...@@ -759,7 +785,7 @@
:disabled-show="false" :disabled-show="false"
/> />
</div> </div>
<div class="compareValue"> <div :class="inspectJbAl2o3List.recode2[1].differenceValue2 === '合格' ? 'compareValue' : 'errorCompareValue'">
<TextToolTip <TextToolTip
:text="inspectJbAl2o3List.recode2[1].differenceValue2" :text="inspectJbAl2o3List.recode2[1].differenceValue2"
:max-length="8" :max-length="8"
...@@ -809,7 +835,7 @@ ...@@ -809,7 +835,7 @@
:disabled-show="false" :disabled-show="false"
/> />
</div> </div>
<div class="compareValue"> <div :class="inspectJbAl2o3List.recode2[2].differenceValue2 === '合格' ? 'compareValue' : 'errorCompareValue'">
<TextToolTip <TextToolTip
:text="inspectJbAl2o3List.recode2[2].differenceValue2" :text="inspectJbAl2o3List.recode2[2].differenceValue2"
:max-length="8" :max-length="8"
...@@ -859,7 +885,7 @@ ...@@ -859,7 +885,7 @@
:disabled-show="false" :disabled-show="false"
/> />
</div> </div>
<div class="compareValue"> <div :class="inspectJbAl2o3List.recode2[3].differenceValue2 === '合格' ? 'compareValue' : 'errorCompareValue'">
<TextToolTip <TextToolTip
:text="inspectJbAl2o3List.recode2[3].differenceValue2" :text="inspectJbAl2o3List.recode2[3].differenceValue2"
:max-length="8" :max-length="8"
...@@ -909,7 +935,7 @@ ...@@ -909,7 +935,7 @@
:disabled-show="false" :disabled-show="false"
/> />
</div> </div>
<div class="compareValue"> <div :class="inspectJbAl2o3List.recode2[4].differenceValue2 === '合格' ? 'compareValue' : 'errorCompareValue'">
<TextToolTip <TextToolTip
:text="inspectJbAl2o3List.recode2[4].differenceValue2" :text="inspectJbAl2o3List.recode2[4].differenceValue2"
:max-length="8" :max-length="8"
...@@ -959,7 +985,7 @@ ...@@ -959,7 +985,7 @@
:disabled-show="false" :disabled-show="false"
/> />
</div> </div>
<div class="compareValue"> <div :class="inspectJbAl2o3List.recode2[5].differenceValue2 === '合格' ? 'compareValue' : 'errorCompareValue'">
<TextToolTip <TextToolTip
:text="inspectJbAl2o3List.recode2[5].differenceValue2" :text="inspectJbAl2o3List.recode2[5].differenceValue2"
:max-length="8" :max-length="8"
...@@ -1009,7 +1035,7 @@ ...@@ -1009,7 +1035,7 @@
:disabled-show="false" :disabled-show="false"
/> />
</div> </div>
<div class="compareValue"> <div :class="inspectJbAl2o3List.recode2[6].differenceValue2 === '合格' ? 'compareValue' : 'errorCompareValue'">
<TextToolTip <TextToolTip
:text="inspectJbAl2o3List.recode2[6].differenceValue2" :text="inspectJbAl2o3List.recode2[6].differenceValue2"
:max-length="8" :max-length="8"
...@@ -1059,7 +1085,7 @@ ...@@ -1059,7 +1085,7 @@
:disabled-show="false" :disabled-show="false"
/> />
</div> </div>
<div class="compareValue"> <div :class="inspectJbAl2o3List.recode2[7].differenceValue2 === '合格' ? 'compareValue' : 'errorCompareValue'">
<TextToolTip <TextToolTip
:text="inspectJbAl2o3List.recode2[7].differenceValue2" :text="inspectJbAl2o3List.recode2[7].differenceValue2"
:max-length="8" :max-length="8"
...@@ -1109,7 +1135,7 @@ ...@@ -1109,7 +1135,7 @@
:disabled-show="false" :disabled-show="false"
/> />
</div> </div>
<div class="compareValue"> <div :class="inspectJbAl2o3List.recode2[8].differenceValue2 === '合格' ? 'compareValue' : 'errorCompareValue'">
<TextToolTip <TextToolTip
:text="inspectJbAl2o3List.recode2[8].differenceValue2" :text="inspectJbAl2o3List.recode2[8].differenceValue2"
:max-length="8" :max-length="8"
...@@ -1159,7 +1185,7 @@ ...@@ -1159,7 +1185,7 @@
:disabled-show="false" :disabled-show="false"
/> />
</div> </div>
<div class="compareValue"> <div :class="inspectJbAl2o3List.recode2[9].differenceValue2 === '合格' ? 'compareValue' : 'errorCompareValue'">
<TextToolTip <TextToolTip
:text="inspectJbAl2o3List.recode2[9].differenceValue2" :text="inspectJbAl2o3List.recode2[9].differenceValue2"
:max-length="8" :max-length="8"
...@@ -2352,10 +2378,21 @@ export default { ...@@ -2352,10 +2378,21 @@ export default {
{ required: true, message: '请输入检验标准', trigger: 'blur' }, { required: true, message: '请输入检验标准', trigger: 'blur' },
{ pattern: /^(0|[1-9]\d*)(\.\d{0,6})?$/, message: '请输入有效的数字', trigger: 'change' } { pattern: /^(0|[1-9]\d*)(\.\d{0,6})?$/, message: '请输入有效的数字', trigger: 'change' }
], ],
standonePlus: [
{ required: true, message: '请输入检验标准', trigger: 'blur' },
{ pattern: /^(0|[1-9]\d*)(\.\d{0,6})?$/, message: '请输入有效的数字', trigger: 'change' },
{ validator: this.validateMethod3, trigger: 'blur' }
],
standardTwo: [ standardTwo: [
{ required: true, message: '请输入检验标准', trigger: 'blur' }, { required: true, message: '请输入检验标准', trigger: 'blur' },
{ pattern: /^(0|[1-9]\d*)(\.\d{0,6})?$/, message: '请输入有效的数字', trigger: 'change' } { pattern: /^(0|[1-9]\d*)(\.\d{0,6})?$/, message: '请输入有效的数字', trigger: 'change' }
], ],
standtwoPlus: [
{ required: true, message: '请输入检验标准', trigger: 'blur' },
{ pattern: /^(0|[1-9]\d*)(\.\d{0,6})?$/, message: '请输入有效的数字', trigger: 'change' },
{ validator: this.validateMethod4, trigger: 'blur' }
],
limitOne: [ limitOne: [
{ required: true, message: '请输入检验标准', trigger: 'blur' }, { required: true, message: '请输入检验标准', trigger: 'blur' },
{ pattern: /^(0|[1-9]\d*)(\.\d{0,6})?$/, message: '请输入有效的数字', trigger: 'change' }, { pattern: /^(0|[1-9]\d*)(\.\d{0,6})?$/, message: '请输入有效的数字', trigger: 'change' },
...@@ -2487,6 +2524,10 @@ export default { ...@@ -2487,6 +2524,10 @@ export default {
wgFf: '', wgFf: '',
wgTf: '', wgTf: '',
limitData: undefined, limitData: undefined,
standonePlus: undefined,
standtwoPlus: undefined,
standoneCy: undefined,
standtwoCy: undefined,
ossIdList: [], ossIdList: [],
recode1: [], recode1: [],
recode2: [], recode2: [],
...@@ -2726,6 +2767,28 @@ export default { ...@@ -2726,6 +2767,28 @@ export default {
callback() callback()
} }
}, },
validateMethod3(rule, value, callback) {
if (value && value !== '' && this.inspectJbAl2o3List.standardOne && this.inspectJbAl2o3List.standonePlus !== '') {
if (Number(this.inspectJbAl2o3List.standardOne) < Number(this.inspectJbAl2o3List.standonePlus)) {
callback()
} else {
callback(new Error('检验标准2要大于检验标准1'))
}
} else {
callback()
}
},
validateMethod4(rule, value, callback) {
if (value && value !== '' && this.inspectJbAl2o3List.standardTwo && this.inspectJbAl2o3List.standtwoPlus !== '') {
if (Number(this.inspectJbAl2o3List.standardTwo) < Number(this.inspectJbAl2o3List.standtwoPlus)) {
callback()
} else {
callback(new Error('检验标准2要大于检验标准1'))
}
} else {
callback()
}
},
handleCyPn() { handleCyPn() {
const standard = !isNaN( const standard = !isNaN(
Number(this.inspectJbAl2o3List.wgKx) + Number(this.inspectJbAl2o3List.wgKx) +
...@@ -2799,33 +2862,35 @@ export default { ...@@ -2799,33 +2862,35 @@ export default {
}, },
/* 表单1的计算方法*/ /* 表单1的计算方法*/
handleData1Input(index) { handleData1Input(index) {
console.log('进入计算方法') // 两种情况 1.单数 2.双数
console.log('standardOne', this.inspectJbAl2o3List.standardOne) if (index%2 === 0) {
console.log('recordData', this.inspectJbAl2o3List.recode1[index].recordData) /**
if (this.inspectJbAl2o3List.standardOne !== '' && this.inspectJbAl2o3List.standardOne !== undefined) { * 1.单数情况下计算 自身与自身加1 的差值和均值
this.inspectJbAl2o3List.recode1[index].differenceValue2 = this.digitalFormat((this.inspectJbAl2o3List.recode1[index].recordData - this.inspectJbAl2o3List.standardOne).toFixed(this.LIMITNGHOURS)) *
} * **/
if (index > 0 && this.inspectJbAl2o3List.recode1[index].recordData !== '' && this.inspectJbAl2o3List.recode1[index - 1].recordData !== '') { if (this.inspectJbAl2o3List.recode1[index].recordData && this.inspectJbAl2o3List.recode1[index].recordData !== '' && this.inspectJbAl2o3List.recode1[index].recordData !== undefined && this.inspectJbAl2o3List.recode1[index + 1].recordData && this.inspectJbAl2o3List.recode1[index + 1].recordData !== '' && this.inspectJbAl2o3List.recode1[index + 1].recordData !== undefined ) {
const num1 = parseFloat(this.inspectJbAl2o3List.recode1[index - 1].recordData) const num1 = parseFloat(this.inspectJbAl2o3List.recode1[index].recordData)
const num2 = parseFloat(this.inspectJbAl2o3List.recode1[index].recordData) const num2 = parseFloat(this.inspectJbAl2o3List.recode1[index + 1].recordData)
this.inspectJbAl2o3List.recode1[index].differenceValue = this.digitalFormat(Math.abs(num1 - num2).toFixed(this.LIMITNGHOURS))
this.inspectJbAl2o3List.recode1[index].differenceValue1 = this.digitalFormat(((num1 + num2) / 2).toFixed(this.LIMITNGHOURS))
}
if (index < 9 && this.inspectJbAl2o3List.recode1[index].recordData !== '' && this.inspectJbAl2o3List.recode1[index + 1].recordData !== '') {
const num1 = parseFloat(this.inspectJbAl2o3List.recode1[index + 1].recordData)
const num2 = parseFloat(this.inspectJbAl2o3List.recode1[index].recordData)
this.inspectJbAl2o3List.recode1[index + 1].differenceValue = this.digitalFormat(Math.abs(num1 - num2).toFixed(this.LIMITNGHOURS)) 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)) this.inspectJbAl2o3List.recode1[index + 1].differenceValue1 = this.digitalFormat(((num1 + num2) / 2).toFixed(this.LIMITNGHOURS))
} else {
this.inspectJbAl2o3List.recode1[index + 1].differenceValue = ''
this.inspectJbAl2o3List.recode1[index + 1].differenceValue1 = ''
} }
if (index < 9 && this.inspectJbAl2o3List.recode1[index].recordData === '') { } else {
/**
* 1.单数情况下计算 自身与自身减一 的差值和均值
*
* **/
if (this.inspectJbAl2o3List.recode1[index].recordData && this.inspectJbAl2o3List.recode1[index].recordData !== '' && this.inspectJbAl2o3List.recode1[index-1].recordData !== undefined && this.inspectJbAl2o3List.recode1[index -1].recordData && this.inspectJbAl2o3List.recode1[index -1].recordData !== '' && this.inspectJbAl2o3List.recode1[index - 1].recordData !== undefined ) {
const num1 = parseFloat(this.inspectJbAl2o3List.recode1[index].recordData)
const num2 = parseFloat(this.inspectJbAl2o3List.recode1[index - 1].recordData)
this.inspectJbAl2o3List.recode1[index].differenceValue = this.digitalFormat(Math.abs(num1 - num2).toFixed(this.LIMITNGHOURS))
this.inspectJbAl2o3List.recode1[index].differenceValue1 = this.digitalFormat(((num1 + num2) / 2).toFixed(this.LIMITNGHOURS))
} else {
this.inspectJbAl2o3List.recode1[index].differenceValue = '' this.inspectJbAl2o3List.recode1[index].differenceValue = ''
this.inspectJbAl2o3List.recode1[index + 1].differenceValue = ''
this.inspectJbAl2o3List.recode1[index].differenceValue1 = '' this.inspectJbAl2o3List.recode1[index].differenceValue1 = ''
this.inspectJbAl2o3List.recode1[index + 1].differenceValue1 = ''
this.inspectJbAl2o3List.recode1[index].differenceValue2 = ''
} }
if (index >= 9 && this.inspectJbAl2o3List.recode1[index].recordData === '') {
this.inspectJbAl2o3List.recode1[index].differenceValue2 = ''
} }
if (index < this.inspectJbAl2o3List.recode1.length) { if (index < this.inspectJbAl2o3List.recode1.length) {
if (this.inspectJbAl2o3List.recode1[index].recordData === '') { if (this.inspectJbAl2o3List.recode1[index].recordData === '') {
...@@ -2836,8 +2901,25 @@ export default { ...@@ -2836,8 +2901,25 @@ export default {
this.calculate(this.removeEmptyValues(this.SumList), 1) this.calculate(this.removeEmptyValues(this.SumList), 1)
} }
this.calculateStandardTagOne(index,this.inspectJbAl2o3List.standardOne,this.inspectJbAl2o3List.standonePlus)
// console.log('11111', this.SumList) // console.log('11111', this.SumList)
}, },
/**
* @description: 判断是否计算 差异与平均
* @author: gaoyu
* @param: index 索引
* @return:
**/
compute(index) {
var result = false
console.log('index',index%2)
if (index%2 === 1) {
result = true
}
return result
},
// 去除数组中的空值 // 去除数组中的空值
removeEmptyValues(arr, sys) { removeEmptyValues(arr, sys) {
return arr.filter(value => value !== undefined && value !== null && value !== '') return arr.filter(value => value !== undefined && value !== null && value !== '')
...@@ -2905,30 +2987,35 @@ export default { ...@@ -2905,30 +2987,35 @@ export default {
/* 表单2的计算方法*/ /* 表单2的计算方法*/
handleData2Input(index) { handleData2Input(index) {
if (this.inspectJbAl2o3List.standardTwo !== '' && this.inspectJbAl2o3List.standardTwo !== undefined) { // 两种情况 1.单数 2.双数
this.inspectJbAl2o3List.recode2[index].differenceValue2 = this.digitalFormat((this.inspectJbAl2o3List.recode2[index].recordData - this.inspectJbAl2o3List.standardTwo).toFixed(this.LIMITNGHOURS)) if (index%2 === 0) {
} /**
if (index > 0 && this.inspectJbAl2o3List.recode2[index].recordData !== '' && this.inspectJbAl2o3List.recode2[index - 1].recordData !== '') { * 1.单数情况下计算 自身与自身加1 的差值和均值
const num1 = parseFloat(this.inspectJbAl2o3List.recode2[index - 1].recordData) *
const num2 = parseFloat(this.inspectJbAl2o3List.recode2[index].recordData) * **/
this.inspectJbAl2o3List.recode2[index].differenceValue = this.digitalFormat(Math.abs(num1 - num2).toFixed(this.LIMITNGHOURS)) 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 ) {
this.inspectJbAl2o3List.recode2[index].differenceValue1 = this.digitalFormat(((num1 + num2) / 2).toFixed(this.LIMITNGHOURS)) const num1 = parseFloat(this.inspectJbAl2o3List.recode2[index].recordData)
} const num2 = parseFloat(this.inspectJbAl2o3List.recode2[index + 1].recordData)
if (index < 9 && this.inspectJbAl2o3List.recode2[index].recordData !== '' && this.inspectJbAl2o3List.recode2[index + 1].recordData !== '') {
const num1 = parseFloat(this.inspectJbAl2o3List.recode2[index + 1].recordData)
const num2 = parseFloat(this.inspectJbAl2o3List.recode2[index].recordData)
this.inspectJbAl2o3List.recode2[index + 1].differenceValue = this.digitalFormat(Math.abs(num1 - num2).toFixed(this.LIMITNGHOURS)) 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)) this.inspectJbAl2o3List.recode2[index + 1].differenceValue1 = this.digitalFormat(((num1 + num2) / 2).toFixed(this.LIMITNGHOURS))
} else {
this.inspectJbAl2o3List.recode2[index + 1].differenceValue = ''
this.inspectJbAl2o3List.recode2[index + 1].differenceValue1 = ''
} }
if (index < 9 && this.inspectJbAl2o3List.recode2[index].recordData === '') { } else {
/**
* 1.单数情况下计算 自身与自身减一 的差值和均值
*
* **/
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)
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))
} else {
this.inspectJbAl2o3List.recode2[index].differenceValue = '' this.inspectJbAl2o3List.recode2[index].differenceValue = ''
this.inspectJbAl2o3List.recode2[index + 1].differenceValue = ''
this.inspectJbAl2o3List.recode2[index].differenceValue1 = '' this.inspectJbAl2o3List.recode2[index].differenceValue1 = ''
this.inspectJbAl2o3List.recode2[index + 1].differenceValue1 = ''
this.inspectJbAl2o3List.recode2[index].differenceValue2 = ''
} }
if (index >= 9 && this.inspectJbAl2o3List.recode2[index].recordData === '') {
this.inspectJbAl2o3List.recode2[index].differenceValue2 = ''
} }
if (index < this.inspectJbAl2o3List.recode2.length) { if (index < this.inspectJbAl2o3List.recode2.length) {
if (this.inspectJbAl2o3List.recode2[index].recordData === '') { if (this.inspectJbAl2o3List.recode2[index].recordData === '') {
...@@ -2939,6 +3026,40 @@ export default { ...@@ -2939,6 +3026,40 @@ export default {
this.calculate(this.removeEmptyValues(this.SumList1), 2) this.calculate(this.removeEmptyValues(this.SumList1), 2)
} }
this.calculateStandardTagTwo(index,this.inspectJbAl2o3List.standardTwo,this.inspectJbAl2o3List.standtwoPlus)
},
calculateStandardTagOne(index,standardOne,standardTwo) {
if (standardOne && standardOne !== null && standardTwo && standardTwo !== null) {
const limitOne = parseFloat(standardOne)
const limitTwo = parseFloat(standardTwo)
const recordData = this.inspectJbAl2o3List.recode1[index].recordData
if (recordData !== '') {
const num = parseFloat(recordData)
if (num >= limitOne && num <= limitTwo) {
this.inspectJbAl2o3List.recode1[index].differenceValue2 = '合格'
} else {
this.inspectJbAl2o3List.recode1[index].differenceValue2 = '不合格'
}
}
}
},
calculateStandardTagTwo(index,standardOne,standardTwo) {
if (standardOne && standardOne !== null && standardTwo && standardTwo !== null) {
const limitOne = parseFloat(standardOne)
const limitTwo = parseFloat(standardTwo)
const recordData = this.inspectJbAl2o3List.recode2[index].recordData
if (recordData !== '') {
const num = parseFloat(recordData)
if (num >= limitOne && num <= limitTwo) {
this.inspectJbAl2o3List.recode2[index].differenceValue2 = '合格'
} else {
this.inspectJbAl2o3List.recode2[index].differenceValue2 = '不合格'
}
}
}
}, },
/* 表单3的计算方法*/ /* 表单3的计算方法*/
...@@ -2985,6 +3106,33 @@ export default { ...@@ -2985,6 +3106,33 @@ export default {
this.limitDifference = '' this.limitDifference = ''
} }
}, },
// 计算标签一的校验标准1 和 检验标准2 之间的差值
getCalculateDifference() {
if (this.inspectJbAl2o3List.standardOne && this.inspectJbAl2o3List.standardOne !== '' && this.inspectJbAl2o3List.standonePlus && this.inspectJbAl2o3List.standonePlus != '' ) {
const limitOne = parseFloat(this.inspectJbAl2o3List.standardOne )
const limitTwo = parseFloat(this.inspectJbAl2o3List.standonePlus)
this.inspectJbAl2o3List.standoneCy = Math.abs(limitOne - limitTwo)
} else {
this.inspectJbAl2o3List.standoneCy = ''
}
for (var i=0; i<10; i++) {
this.calculateStandardTagOne(i,this.inspectJbAl2o3List.standardOne,this.inspectJbAl2o3List.standonePlus)
}
},
// 计算标签一的校验标准1 和 检验标准2 之间的差值
getCalculateDifferences() {
if (this.inspectJbAl2o3List.standardTwo && this.inspectJbAl2o3List.standardTwo !== '' && this.inspectJbAl2o3List.standtwoPlus && this.inspectJbAl2o3List.standtwoPlus != '' ) {
const limitOne = parseFloat(this.inspectJbAl2o3List.standardTwo )
const limitTwo = parseFloat(this.inspectJbAl2o3List.standtwoPlus)
this.inspectJbAl2o3List.standtwoCy = Math.abs(limitOne - limitTwo)
} else {
this.inspectJbAl2o3List.standtwoPlus = ''
}
for (var i=0; i<10; i++) {
this.calculateStandardTagTwo(i,this.inspectJbAl2o3List.standardTwo,this.inspectJbAl2o3List.standtwoPlus)
}
},
// 获取单号 // 获取单号
getJcCode() { getJcCode() {
...@@ -3083,6 +3231,10 @@ export default { ...@@ -3083,6 +3231,10 @@ export default {
this.inspectJbAl2o3List.standardOneData = response.data.standardOneData this.inspectJbAl2o3List.standardOneData = response.data.standardOneData
this.inspectJbAl2o3List.standardTwoData = response.data.standardTwoData this.inspectJbAl2o3List.standardTwoData = response.data.standardTwoData
// this.inspectJbAl2o3List.recordData = response.data.recordData // this.inspectJbAl2o3List.recordData = response.data.recordData
this.inspectJbAl2o3List.standonePlus = response.data.standonePlus
this.inspectJbAl2o3List.standtwoPlus = response.data.standtwoPlus
this.inspectJbAl2o3List.standoneCy = response.data.standoneCy
this.inspectJbAl2o3List.standtwoCy = response.data.standtwoCy
this.inspectJbAl2o3List.inspector = response.data.inspector this.inspectJbAl2o3List.inspector = response.data.inspector
this.inspectJbAl2o3List.firstHdN = response.data.firstHdN this.inspectJbAl2o3List.firstHdN = response.data.firstHdN
this.inspectJbAl2o3List.firstHdPn = response.data.firstHdPn this.inspectJbAl2o3List.firstHdPn = response.data.firstHdPn
...@@ -4144,11 +4296,16 @@ export default { ...@@ -4144,11 +4296,16 @@ export default {
height: auto; height: auto;
background: rgba(0, 87, 255, 0.05); background: rgba(0, 87, 255, 0.05);
border-radius: 4px; border-radius: 4px;
.inspectionStandardLabel{
::v-deep .el-form-item__label{
width: 86px;
}
}
.inspectionStandards { .inspectionStandards {
width: 88%; width: 88%;
margin-left: 6%; margin-left: 6%;
padding-top: 20px; padding-top: 20px;
.inspectDifferent{ .inspectDifferent{
font-size: 14px; font-size: 14px;
font-family: Microsoft YaHei, Microsoft YaHei-400; font-family: Microsoft YaHei, Microsoft YaHei-400;
...@@ -4286,7 +4443,18 @@ export default { ...@@ -4286,7 +4443,18 @@ export default {
font-family: Microsoft YaHei, Microsoft YaHei-400; font-family: Microsoft YaHei, Microsoft YaHei-400;
font-weight: 400; font-weight: 400;
padding-left: 8%; padding-left: 8%;
color: #606266; color: #0057ff;
display: flex;
justify-content: center;
align-items: center;
}
.eorrCompareValue {
width: 25%;
font-size: 14px;
font-family: Microsoft YaHei, Microsoft YaHei-400;
font-weight: 400;
padding-left: 8%;
color: red;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
...@@ -4370,12 +4538,23 @@ export default { ...@@ -4370,12 +4538,23 @@ export default {
font-family: Microsoft YaHei, Microsoft YaHei-400; font-family: Microsoft YaHei, Microsoft YaHei-400;
font-weight: 400; font-weight: 400;
padding-left: 8%; padding-left: 8%;
color: #606266; color: #0057ff;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
.eorrCompareValue {
width: 25%;
font-size: 14px;
font-family: Microsoft YaHei, Microsoft YaHei-400;
font-weight: 400;
padding-left: 8%;
color: red;
display: flex;
justify-content: center;
align-items: center;
}
} }
} }
...@@ -4677,6 +4856,11 @@ export default { ...@@ -4677,6 +4856,11 @@ export default {
height: 40px; height: 40px;
margin-left: 6%; margin-left: 6%;
padding-top: 20px; padding-top: 20px;
.inspectionStandardLabel{
::v-deep .el-form-item__label{
width: 86px;
}
}
.inspectionStandardsInput { .inspectionStandardsInput {
width: 50%; width: 50%;
...@@ -4801,7 +4985,18 @@ export default { ...@@ -4801,7 +4985,18 @@ export default {
font-family: Microsoft YaHei, Microsoft YaHei-400; font-family: Microsoft YaHei, Microsoft YaHei-400;
font-weight: 400; font-weight: 400;
padding-left: 8%; padding-left: 8%;
color: #606266; color: #0057ff;
display: flex;
justify-content: center;
align-items: center;
}
.errorCompareValue {
width: 25%;
font-size: 14px;
font-family: Microsoft YaHei, Microsoft YaHei-400;
font-weight: 400;
padding-left: 8%;
color: red;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
...@@ -4887,11 +5082,21 @@ export default { ...@@ -4887,11 +5082,21 @@ export default {
font-family: Microsoft YaHei, Microsoft YaHei-400; font-family: Microsoft YaHei, Microsoft YaHei-400;
font-weight: 400; font-weight: 400;
padding-left: 8%; padding-left: 8%;
color: #606266; color: #0057ff;
display: flex;
justify-content: center;
align-items: center;
}
.errorCompareValue {
width: 25%;
font-size: 14px;
font-family: Microsoft YaHei, Microsoft YaHei-400;
font-weight: 400;
padding-left: 8%;
color: red;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
} }
......
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