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

数组中输入框必填校验

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