Commit f4adf3cb authored by jingnan's avatar jingnan 👀

配套需求单明细增加显示隐藏材料,隐藏时物料类型包含金属材料/工装/工具/设备的隐藏,显示时全部显示

parent 2611d0c0
......@@ -9,7 +9,7 @@
<div class="dee-table dee-table-dis-border">
<el-table
ref="outerTable"
:data="tableData"
:data="filterTableData"
align="center"
height="calc(100vh - 100px)"
:row-class-name="outerRowClassName"
......@@ -161,16 +161,40 @@ export default {
{ 'title': '版次', 'key': 'inventory.softConfPieceNo' }
],
tableData: [],
tools: [{
dialogTitle: '',
dialogVisible: false,
cmpOptions: {
typeName: 'Inventory',
layKey: 'matchApplyOccupy'
},
selectionRows: [],
currentRow: {},
reqStatusOptions: [],
hideMaterial: true
}
},
computed: {
filterTableData() {
let resData = []
if (this.hideMaterial) {
this.tableData.forEach(row => {
debugger
if (!row.extMaterial.resType2.typeCode.includes('金属材料') && !row.extMaterial.resType2.typeCode.includes('工装') && !row.extMaterial.resType2.typeCode.includes('工具') && !row.extMaterial.resType2.typeCode.includes('设备')) {
resData.push(row)
}
})
} else {
resData = this.tableData
}
return resData
},
tools() {
const data = [{
name: '占用',
icon: '/icons/c-creatBook.png',
handler: {
click: () => {
if (this.selectionRows.length !== 1) return this.$utils.showMessageWarning('必须且只能选择一条数据进行操作!')
if (this.selectionRows[0].reqStatus === 'Close' || this.selectionRows[0].reqStatus === '已关闭' || this.selectionRows[0].reqStatus === 'All' || this.selectionRows[0].reqStatus === '已出库') return this.$utils.showMessageWarning('当前物料不允许手动占用!')
this.dialogTitle = '占用'
this.dialogVisible = true
this.cmpOptions = { typeName: 'Inventory', layKey: 'matchApplyOccupy' }
this.HandleBeforeOccupy()
}
}
},
......@@ -182,19 +206,19 @@ export default {
this.handleSubmit()
}
}
}],
dialogTitle: '',
dialogVisible: false,
cmpOptions: {
typeName: 'Inventory',
layKey: 'matchApplyOccupy'
},
selectionRows: [],
currentRow: {},
reqStatusOptions: []
{
name: this.hideMaterial ? '显示材料' : '隐藏材料',
icon: '/icons/c-scan.png',
handler: {
click: () => {
this.hideMaterialFun()
}
}
}]
return data
}
},
computed: {},
watch: {},
created() {
this.getDicListByCode()
......@@ -226,6 +250,13 @@ export default {
// this.loading = false
})
},
HandleBeforeOccupy() {
if (this.selectionRows.length !== 1) return this.$utils.showMessageWarning('必须且只能选择一条数据进行操作!')
if (this.selectionRows[0].reqStatus === 'Close' || this.selectionRows[0].reqStatus === '已关闭' || this.selectionRows[0].reqStatus === 'All' || this.selectionRows[0].reqStatus === '已出库') return this.$utils.showMessageWarning('当前物料不允许手动占用!')
this.dialogTitle = '占用'
this.dialogVisible = true
this.cmpOptions = { typeName: 'Inventory', layKey: 'matchApplyOccupy' }
},
handleExpandChange(row, rows) {
const isExpend = rows.some(r => r.id === row.id) // 判断当前行展开状态
if (isExpend) {
......@@ -312,6 +343,9 @@ export default {
},
handleClose() {
this.dialogVisible = false
},
hideMaterialFun() {
this.hideMaterial = !this.hideMaterial
}
}
}
......
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