Commit 42b9f15b authored by 高宇's avatar 高宇

数组中输入框必填校验

parent 1bfe58b9
......@@ -5,13 +5,13 @@
:disabled="disabledShow || text === undefined || text === null || (text.length <= maxLength)"
placement="top"
>
<span v-if="text === undefined || text === null || text.length <= maxLength">
<span style="cursor: pointer" v-if="text === undefined || text === null || text.length <= maxLength">
{{ text || '' }}
</span>
<span v-else>
<span style="cursor: pointer" v-else>
{{ text.substring(0, maxLength) + '...' }}
</span>
<div style="" slot="content">
<div style="cursor: pointer" slot="content">
{{ text || '' }}
</div>
</el-tooltip>
......
......@@ -147,17 +147,17 @@
{{ scope.row.jcRank || '-' }}
</template>
</el-table-column>
<el-table-column label="抽样" prop="jcFacadeCy" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.jcFacadeCy || '-' }}
</template>
</el-table-column>
<el-table-column label="不合格" prop="jcFacadeBl" :show-overflow-tooltip="true" width="70%">
<template slot-scope="scope">
{{ scope.row.jcFacadeBl || '-' }}
</template>
</el-table-column>
<el-table-column label="检查结果" prop="jcResult" :show-overflow-tooltip="true" width="70%">
<!-- <el-table-column label="抽样" prop="jcFacadeCy" :show-overflow-tooltip="true">-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.jcFacadeCy || '-' }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="不合格" prop="jcFacadeBl" :show-overflow-tooltip="true">-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.jcFacadeBl || '-' }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="检查结果" prop="jcResult" :show-overflow-tooltip="true" >
<template slot-scope="scope">
<span v-if="scope.row.jcResult=='1'">OK</span>
<span v-else-if="scope.row.jcResult=='2'">NO</span>
......@@ -185,7 +185,7 @@
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="操作" class-name="small-padding fixed-width" width="120px">
<el-table-column label="操作" class-name="small-padding fixed-width" width="100px">
<template slot-scope="scope">
<el-button
v-show="scope.row.approveStatus=='1'&&loginId!=scope.row.updateBy"
......
......@@ -136,7 +136,7 @@
(controlsForm.controls == '3' && controlsForm.approveStatus === '1') ||
(controlsForm.controls ==='3'&&controlsForm.approveStatus === '9' ))"
class="el-icon-circle-close"
style="color: #5cbce5; height: 42px"
style="color: #5cbce5; height: 30px"
@click="clearForm(index)"
/>
......@@ -316,7 +316,7 @@
<el-form-item :ref="'recode3.'+index+'.recordData'" :prop="'recode3.'+index+'.recordData'" :rules="[{required: true, validator: numType, trigger: 'blur'}]">
<el-input
v-model="item.recordData"
:maxlength="7"
:maxlength="IRMAXLENGTHTHREE"
:disabled="controlsForm.controls ==='1'&& controlsForm.approveStatus ==='1'
|| (controlsForm.controls == '3' &&controlsForm.approveStatus === '1') || (controlsForm.controls ==='3'&&controlsForm.approveStatus === '9' )"
@input="handleData3Input(index)"
......@@ -339,9 +339,14 @@
</el-form>
</div>
<div class="recordThreeBottom">
<div class="recordThreeBottomMax">最大值 : {{ calculationFormThird.Maximum }}</div>
<div class="recordThreeBottomMini">最小值 : {{ calculationFormThird.Minimum }}</div>
<div class="recordThreeBottomAverage">平均值: {{ calculationFormThird.Average }}</div>
<div class="recordThreeBottomMax">最大值 :
<TextToolTip :text="calculationFormThird.Maximum" :max-length="8" :disabled-show="false" /></div>
<div class="recordThreeBottomMini">最小值 :
<TextToolTip :text="calculationFormThird.Maximum" :max-length="8" :disabled-show="false" />
</div>
<div class="recordThreeBottomAverage">平均值:
<TextToolTip :text="calculationFormThird.Average" :max-length="8" :disabled-show="false" />
</div>
</div>
</div>
</div>
......@@ -783,8 +788,8 @@
<!-- <el-button class="buttoon" type="primary" @click="back">返回</el-button>-->
<!-- </div>-->
<div v-if="(controlsForm.controls ==='1'&& controlsForm.approveStatus ==='1')" class="submitButton">
<el-button class="buttoon" type="primary" @click="approve">同意</el-button>
<el-button class="buttoon" type="primary" @click="reject">驳回</el-button>
<el-button class="buttoonSave" type="primary" @click="approve">同意</el-button>
<el-button class="buttoonCommit" type="primary" @click="reject">驳回</el-button>
</div>
</div>
</div>
......@@ -884,11 +889,11 @@ export default {
// url: 'http://49.232.167.247:20010/eduServer/123/20240306/1790EB2DF6A84945B7E09EF4CACE2DF5.jpg',
// srcList: ['http://49.232.167.247:20010/eduServer/123/20240306/1790EB2DF6A84945B7E09EF4CACE2DF5.jpg']
// },
{
businessId: 3,
url: 'http://49.232.167.247:20010/eduServer/123/20240306/1790EB2DF6A84945B7E09EF4CACE2DF5.jpg',
srcList: ['http://49.232.167.247:20010/eduServer/123/20240306/1790EB2DF6A84945B7E09EF4CACE2DF5.jpg']
}
// {
// businessId: 3,
// url: 'http://49.232.167.247:20010/eduServer/123/20240306/1790EB2DF6A84945B7E09EF4CACE2DF5.jpg',
// srcList: ['http://49.232.167.247:20010/eduServer/123/20240306/1790EB2DF6A84945B7E09EF4CACE2DF5.jpg']
// }
// {
// businessId: 2,
// url: require('@/assets/image/cadTwo.png'),
......@@ -1168,11 +1173,11 @@ export default {
this.handleData1Input(index)
},
clearInspectionFormTwo(index) {
this.inspectJbAl2o3List.recode2[index].inspectJbAl2o3List.recordData = ''
this.inspectJbAl2o3List.recode2[index].recordData = ''
this.handleData2Input(index)
},
clearInspectionFormThree(index) {
this.inspectJbAl2o3List.recode3[index].inspectJbAl2o3List.recordData = ''
this.inspectJbAl2o3List.recode3[index].recordData = ''
this.handleData3Input(index)
},
// 去掉多余的0
......@@ -1190,26 +1195,27 @@ export default {
if (this.inspectJbAl2o3List.standardOne !== '' && this.inspectJbAl2o3List.standardOne !== undefined) {
this.inspectJbAl2o3List.recode1[index].differenceValue2 = this.digitalFormat((this.inspectJbAl2o3List.recode1[index].recordData - this.inspectJbAl2o3List.standardOne).toFixed(this.LIMITNGHOURS))
}
console.log('index',index)
if (index > 0 && this.inspectJbAl2o3List.recode1[index].recordData !== '' && this.inspectJbAl2o3List.recode1[index - 1].recordData !== '') {
const num1 = parseFloat(this.recode1[index - 1].recordData)
const num2 = parseFloat(this.recode1[index].recordData)
const num1 = parseFloat(this.inspectJbAl2o3List.recode1[index - 1].recordData)
const num2 = parseFloat(this.inspectJbAl2o3List.recode1[index].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.recode1[index].recordData !== '' && this.recode1[index + 1].recordData !== '') {
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].differenceValue1 = this.digitalFormat(((num1 + num2) / 2).toFixed(this.LIMITNGHOURS))
}
if (index < 9 && this.recode1[index].recordData === '') {
if (index < 9 && this.inspectJbAl2o3List.recode1[index].recordData === '') {
this.inspectJbAl2o3List.recode1[index].differenceValue = ''
this.inspectJbAl2o3List.recode1[index + 1].differenceValue = ''
this.inspectJbAl2o3List.recode1[index].differenceValue1 = ''
this.inspectJbAl2o3List.recode1[index + 1].differenceValue1 = ''
this.inspectJbAl2o3List.recode1[index].differenceValue2 = ''
}
if (index >= 9 && this.recode1[index].recordData === '') {
if (index >= 9 && this.inspectJbAl2o3List.recode1[index].recordData === '') {
this.inspectJbAl2o3List.recode1[index].differenceValue2 = ''
}
if (index < this.inspectJbAl2o3List.recode1.length) {
......@@ -1221,7 +1227,7 @@ export default {
this.calculate(this.removeEmptyValues(this.SumList), 1)
}
console.log('11111', this.SumList)
// console.log('11111', this.SumList)
},
// 去除数组中的空值
removeEmptyValues(arr, sys) {
......@@ -1240,11 +1246,9 @@ export default {
min = Math.min(...arr) // 计算最小值
sum = arr.reduce((acc, cur) => acc + cur, 0) // 计算总和
average = sum / arr.length // 计算平均值
if (average.toString().length > 7) {
stingAverage = average.toString().substr(0, 7)
} else {
stingAverage = average.toString().substr(0, average.toString().length - 1)
}
stingAverage = average.toString()
max = max.toString()
min = min.toString()
}
if (sys === 1) {
this.digitalFormat(this.calculationForm.Maximum = max)
......@@ -1957,7 +1961,6 @@ export default {
this.inspectJbAl2o3List.limitData = this.getStringByArray(this.inspectJbAl2o3List.recode3)
this.inspectInfoList.approveStatus = '0'
// const businessId = this.$route.query.businessId
this.getJcCode()
const ossIdList = this.getOssIdList()
const obj = {
incomeInspectInfo: this.inspectInfoList,
......@@ -1992,7 +1995,6 @@ export default {
this.inspectJbAl2o3List.limitData = this.getStringByArray(this.inspectJbAl2o3List.recode3)
this.inspectInfoList.approveStatus = '1'
const ossIdList = this.getOssIdList()
this.getJcCode()
var obj = {
incomeInspectInfo: this.inspectInfoList,
incomeInspectJbAl2o3: this.inspectJbAl2o3List,
......@@ -2006,6 +2008,11 @@ export default {
this.resetInspectInfo()
this.resetinspectJbAl2o3List()
this.resetRecord()
getJcCode().then(response => {
if (response.code === 200) {
this.inspectInfoList.jcCode = response.data
}
})
this.controlsForm.approveStatus = '1'
this.controlsForm.controls = '2'
}
......@@ -2739,13 +2746,14 @@ export default {
.oneContent {
display: flex;
margin-top: 16px;
padding-bottom: 16px;
//padding-bottom: 16px;
//margin-left: 10%;
.twoDiv {
display: flex;
width: 60%;
.number {
height: 30px;
width: 9px;
font-size: 14px;
font-family: Microsoft YaHei, Microsoft YaHei-400;
......@@ -2761,6 +2769,7 @@ export default {
margin-left: 3%;
.el-icon-circle-close {
height: 30px;
cursor: pointer;
display: flex;
align-items: center;
......@@ -3070,13 +3079,14 @@ export default {
.oneContent {
display: flex;
margin-top: 16px;
padding-bottom: 16px;
//padding-bottom: 16px;
.oneDiv {
width: 25%;
display: flex;
.number {
height: 30px;
width: 9px;
font-size: 14px;
font-family: Microsoft YaHei, Microsoft YaHei-400;
......@@ -3092,6 +3102,7 @@ export default {
margin-left: 11%;
.el-icon-circle-close {
height: 30px;
display: flex;
align-items: center;
margin-left: 10px;
......
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