Compare commits

...

2 Commits

Author SHA1 Message Date
周炼
37ae1f526e Merge branch 'dev' of http://10.10.11.66:3000/mes/nalinv-ui into dev 2024-11-26 17:40:34 +08:00
周炼
bd874cae46 feat:不良代码逻辑回填 2024-11-26 17:40:24 +08:00

View File

@ -243,7 +243,8 @@
<template slot-scope="scope">
<el-input v-if="scope.row.showNcCode" v-model="scope.row.ncCode" placeholder="请输入不良代码"
:disabled="state === 'view'">
<i slot="suffix" class="el-input__icon el-icon-copy-document" @click.stop="showDialog(scope.row)"></i>
<i slot="suffix" class="el-input__icon el-icon-copy-document"
@click.stop="showDialog(scope.row)"></i>
</el-input>
</template>
</el-table-column>
@ -328,6 +329,7 @@ export default {
data() {
return {
selectRow:{},
qms,
headers: {
Authorization: 'Bearer ' + store.getters.access_token,
@ -510,6 +512,23 @@ export default {
row.inspecResultSid = null
me.getNcList(row)
},
// 找到父节点
_findParent(tree, node) {
for (let i = 0; i < tree.length; i++) {
if (tree[i].inspecResultList && tree[i].inspecResultList.length) {
if (tree[i].inspecResultList.includes(node)) {
return tree[i];
}
const parent = me._findParent(tree[i].inspecResultList, node);
if (parent) {
return parent;
}
}
}
return null;
},
//查看图片
showPhotos(row) {
let me = this
@ -546,11 +565,19 @@ export default {
item: me.ncCodeForm.item
}
showLoading()
let ncCode = []
const parent = me._findParent(me.qcTable, me.selectRow)
const index = parent.inspecResultList.findIndex(child => child.handle === me.selectRow.handle)
me.inspecNcList.forEach(item => {
ncCode.push(item.ncCode)
})
me.selectRow.ncCode=ncCode.join(',')
saveNc(param).then((res) => {
hideLoading()
if (res.status === 200) {
me.$message.success('保存成功')
me.ncCodeFormClose()
me.$set(parent.inspecResultList, index, me.selectRow)
} else {
me.$message.error(res.data.message)
}
@ -581,10 +608,10 @@ export default {
resData.forEach(element => {
me.inspecNcList.forEach(element2 => {
if (element.ncBasisBo === element2.ncBasisBo) {
let index =me.inspecNcList.indexOf(element2)
me.inspecNcList.splice(index, 1,element)
}
})
let index = me.inspecNcList.indexOf(element2)
me.inspecNcList.splice(index, 1, element)
}
})
});
} else {
me.inspecNcList = []
@ -606,6 +633,7 @@ export default {
me.ncCodeDialogVisible = true
me.ncCodeList = []
me.inspecNcList = []
me.selectRow =row
me.getNcList(row)
},
async getNcList(row) {
@ -803,9 +831,9 @@ export default {
console.log(e)
console.log('Switch changed:', event, row);
if (e) {
return 'ok-cell'
return 'ok-cell'
} else {
return 'ng-cell'
return 'ng-cell'
}
},
// 数字输入限制