| | |
| | | <template slot-scope="scope"> |
| | | <div v-if="!scope.row.children"> |
| | | <!-- :disabled="scope.row.deviceId == null || (dataForm.id!=null&&(resultVal!=null && resultVal!=''))" --> |
| | | <!-- @blur.stop="changeState(scope.row)" --> |
| | | <!-- @input="$nextTick(()=>{checkTestValues(scope.row)})" --> |
| | | <!-- @blur.capture.native="changeState(scope.row)" --> |
| | | <el-tooltip :disabled="scope.row.deviceId != null" class="item" effect="dark" content="请先选择设备!" placement="top-start"> |
| | | <el-autocomplete clearable |
| | | cache="false" |
| | | ref="testValueInput" |
| | | @input="$nextTick(()=>{checkTestValues(scope.row)})" |
| | | @blur="$nextTick(()=>{changeState(scope.row)})" |
| | | @blur="checkTestValues(scope.row,'blur',$event)" |
| | | @select="checkTestValues(scope.row,'select',$event)" |
| | | v-model="scope.row.testValueList[index]" |
| | | :fetch-suggestions="querySearch" |
| | | placeholder="请输入或选择检测值" > |
| | |
| | | <el-table-column prop="note" label="检验描述" width="160" > |
| | | <template slot-scope="scope"> |
| | | <div v-if="!scope.row.children"> |
| | | <el-input @blur="changeState(scope.row)" :disabled="scope.row.deviceId == null || (dataForm.id!=null&&(resultVal!=null && resultVal!=''))" v-model="scope.row.note" placeholder="检验描述"></el-input> |
| | | <el-input @blur="checkTestValues(scope.row,'blur',$event)" :disabled="scope.row.deviceId == null || (dataForm.id!=null&&(resultVal!=null && resultVal!=''))" v-model="scope.row.note" placeholder="检验描述"></el-input> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | import rawMaterialPartDialog from '@/views/common/rawMaterial-part' |
| | | import { getStore } from '@/util/store' |
| | | import qrCodeApp from '@/views/common/qrCodeApp' |
| | | import testValueSelect from './testValue-select' |
| | | export default { |
| | | components:{ |
| | | rawMaterialPartDialog, |
| | | qrCodeApp, |
| | | testValueSelect |
| | | }, |
| | | computed:{}, |
| | | data(){ |
| | |
| | | }], |
| | | dataRule: { |
| | | code:[{ required: true, message: '请扫描选择零件', trigger: 'blur' }], |
| | | createTime: [{ required: true, message: '请选择报检日期', trigger: 'change' }] |
| | | createTime: [{ required: true, message: '请选择报检日期', trigger: 'blur' }] |
| | | }, |
| | | deviceList: [], |
| | | } |
| | |
| | | console.log(e,e.target.tabIndex); |
| | | console.log(e.target.value); |
| | | }, |
| | | checkTestValues(row){ |
| | | if(row){ |
| | | checkTestValues(row,currentOption,event){ |
| | | if(row){ |
| | | let isTrue = true |
| | | for(var i=0;i<row.testValueList.length;i++){ |
| | | let val = row.testValueList[i] |
| | | if(val != '' && val != null){ |
| | | if(!['是','否'].includes(val)){ |
| | | let reg = /(^-?[0-9]{1,6}$)|(^-?[0-9]{1,6}[\.]{1}[0-9]{1,3}$)/ |
| | | if(!reg.test(val)){ |
| | | row.testValueList[i] = null |
| | | this.$message.error("请输入6位数字或选择是否") |
| | | isTrue = false |
| | | } |
| | | } |
| | | if(currentOption==='blur'){ |
| | | let targetVal = event.target.value |
| | | if( (targetVal && ['是','否'].includes(targetVal)) || !targetVal){ |
| | | isTrue = false |
| | | }else{ |
| | | for(var i=0;i<row.testValueList.length;i++){ |
| | | let val = row.testValueList[i] |
| | | if(val != '' && val != null){ |
| | | if(!['是','否'].includes(val)){ |
| | | let reg = /(^-?[0-9]{1,6}$)|(^-?[0-9]{1,6}[\.]{1}[0-9]{1,3}$)/ |
| | | if(!reg.test(val)){ |
| | | row.testValueList[i] = '' |
| | | event.target.value = '' |
| | | this.$message.error("请输入6位数字或选择是否") |
| | | isTrue = false |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if(!isTrue){ |
| | | return |
| | | } |
| | | |
| | | this.changeState(row) |
| | | } |
| | | }, |
| | | changeState(row) { |
| | | console.log("更新--》",row.testValueList[0]); |
| | | return |
| | | this.$nextTick(()=>{ |
| | | if (row.rpId != null && row.rpId != '') { |
| | | let val = row.testValueList.join(",") |