Commit 26d33ab4 authored by 罗林杰's avatar 罗林杰

修改bug

parent 0a2545e6
......@@ -210,6 +210,12 @@ export default {
this.tableRemarks = JSON.parse(JSON.stringify(newValue))
},
deep: true
},
tableRemarks: {
handler(newValue, oldValue) {
this.$emit('tableRemarks', this.tableRemarks)
},
deep: true
}
},
created() {
......@@ -240,7 +246,7 @@ export default {
if (result[i] !== lowerBound) {
allInRange = 'NG'
}
} else if (upperBound === undefined && lowerBound === ''){
} else if (upperBound === undefined && lowerBound === '') {
// remarks没填值
allInRange = 'OK'
} else {
......@@ -264,7 +270,7 @@ export default {
} else {
// 修改时 不跟新增写一样的 是因为这样可以避免无限循环
// 判断是否是最后一行 如果是最后一行 value返回的是输入的值
if (rowData[0] === this.tableData[this.tableData.length - 1][0]){
if (rowData[0] === this.tableData[this.tableData.length - 1][0]) {
const params = {
rowData: rowData,
value: rowData[rowData.length - 1]
......
......@@ -210,6 +210,12 @@ export default {
this.tableRemarks = JSON.parse(JSON.stringify(newValue))
},
deep: true
},
tableRemarks: {
handler(newValue, oldValue) {
this.$emit('tableRemarks', this.tableRemarks)
},
deep: true
}
},
created() {
......
......@@ -131,6 +131,8 @@ export default {
ocrArray: {
handler(newValue, oldValue) {
if (this.updateFlag === true) {
// 修改时初始化
this.allInRange = 'OK'
this.tableData = Array.from({ length: newValue.length }, () => [])
// 修改
// 循环this.tableData i代表第几行
......@@ -204,6 +206,12 @@ export default {
this.tableRemarks = JSON.parse(JSON.stringify(newValue))
},
deep: true
},
tableRemarks: {
handler(newValue, oldValue) {
this.$emit('tableRemarks', this.tableRemarks)
},
deep: true
}
},
created() {
......@@ -216,11 +224,14 @@ export default {
methods: {
handleInput() {
this.allInRange = 'OK'
if (this.updateFlag === true) {
this.updateFlag = false
}
},
// 初始化时 整个表格的数据校验
dataVerify(rowData, columnData, column, index) {
// 判断该列是否需要校验
if (column.label === '毛刺' || column.label === 'ITEM') {
if (column.label === 'ITEM') {
return false
}
// 数据为空
......@@ -238,7 +249,9 @@ export default {
// 当前列的数据不在第四行和第五行指定的范围内
return false
} else {
if (this.updateFlag === false) {
this.allInRange = 'NG'
}
return true
}
} else {
......@@ -251,31 +264,29 @@ export default {
const upperBound = this.tableRemarks[index][1] // 上限
const lowerBound = this.tableRemarks[index][0]// 下限
// 检查 columnData 是否为数字
if (Number(column.property) + 1 === Number(this.tableHeader.length)) {
this.$emit('updateTableData', this.allInRange)
} else {
if (isNaN(Number(columnData))) {
if (this.updateFlag === false) {
this.allInRange = 'NG'
if (Number(column.property) + 2 === Number(this.tableHeader.length)) {
this.$emit('updateTableData', this.allInRange)
}
return true // 如果 columnData 不是数字,直接返回 true
} else {
if (upperBound !== '' && upperBound !== '') {
if (Number(columnData) < Number(lowerBound) || Number(columnData) > Number(upperBound)) {
if (this.updateFlag === false) {
this.allInRange = 'NG'
if (Number(column.property) + 2 === this.tableHeader.length) {
this.$emit('updateTableData', this.allInRange)
}
// 不在范围之间
return true
} else {
if (Number(column.property) + 2 === this.tableHeader.length) {
// 在范围内
this.$emit('updateTableData', this.allInRange)
}
return false
}
}
}
}
}
},
// 获取OCR模版配置
getDictOcrTemplate1() {
......
......@@ -131,9 +131,9 @@ export default {
ocrArray: {
handler(newValue, oldValue) {
if (this.updateFlag === true) {
// 修改时初始化
this.allInRange = 'OK'
this.tableData = Array.from({ length: newValue.length }, () => [])
console.log('111111111',this.tableData)
console.log('2222222',newValue)
// 修改
// 循环this.tableData i代表第几行
for (let i = 0; i < newValue.length; i++) {
......@@ -144,7 +144,6 @@ export default {
// this.tableData[i][this.fixedColumnCount + j] = newValue[i][j];
}
}
console.log('33333333333',this.tableData)
this.tableHeader = JSON.parse(JSON.stringify(this.returnTableHeader))
this.tableHeaderLength = this.tableHeader.length
// 找出列表表头为1的索引号
......@@ -207,6 +206,12 @@ export default {
this.tableRemarks = JSON.parse(JSON.stringify(newValue))
},
deep: true
},
tableRemarks: {
handler(newValue, oldValue) {
this.$emit('tableRemarks', this.tableRemarks)
},
deep: true
}
},
created() {
......@@ -219,11 +224,14 @@ export default {
methods: {
handleInput() {
this.allInRange = 'OK'
if (this.updateFlag === true) {
this.updateFlag = false
}
},
// 初始化时 整个表格的数据校验
dataVerify(rowData, columnData, column, index) {
// 判断该列是否需要校验
if (column.label === '毛刺' || column.label === 'ITEM') {
if (column.label === 'ITEM') {
return false
}
// 数据为空
......@@ -241,7 +249,9 @@ export default {
// 当前列的数据不在第四行和第五行指定的范围内
return false
} else {
if (this.updateFlag === false) {
this.allInRange = 'NG'
}
return true
}
} else {
......@@ -254,31 +264,29 @@ export default {
const upperBound = this.tableRemarks[index][1] // 上限
const lowerBound = this.tableRemarks[index][0]// 下限
// 检查 columnData 是否为数字
if (Number(column.property) + 1 === Number(this.tableHeader.length)) {
this.$emit('updateTableData', this.allInRange)
} else {
if (isNaN(Number(columnData))) {
if (this.updateFlag === false) {
this.allInRange = 'NG'
if (Number(column.property) + 2 === Number(this.tableHeader.length)) {
this.$emit('updateTableData', this.allInRange)
}
return true // 如果 columnData 不是数字,直接返回 true
} else {
if (upperBound !== '' && upperBound !== '') {
if (Number(columnData) < Number(lowerBound) || Number(columnData) > Number(upperBound)) {
if (this.updateFlag === false) {
this.allInRange = 'NG'
if (Number(column.property) + 2 === this.tableHeader.length) {
this.$emit('updateTableData', this.allInRange)
}
// 不在范围之间
return true
} else {
if (Number(column.property) + 2 === this.tableHeader.length) {
// 在范围内
this.$emit('updateTableData', this.allInRange)
}
return false
}
}
}
}
}
},
// 获取OCR模版配置
getDictOcrTemplate1() {
......
......@@ -532,7 +532,7 @@ export default {
getAfterUpdateDataB(value) {
this.tableData1 = value
},
// 获取组件传递过来的备注数据
// 获取组件传递过来的备注数据
getTableRemarks(value) {
this.tableRemarks = value
},
......@@ -646,6 +646,7 @@ export default {
lot: this.form.lot,
chJson: JSON.stringify(data)
}
console.log('修改保存:---', params)
updateOcrData(params).then(res => {
if (res.code === 200) {
this.$message.success('保存成功')
......
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