opt:优化子卷包装界面样式
This commit is contained in:
@@ -155,6 +155,8 @@ export default {
|
||||
previousSelection: [],
|
||||
// 存储搜索后的选中状态
|
||||
currentSelection: [],
|
||||
// 上面表格选中的
|
||||
upSelection: [],
|
||||
// 取消选中
|
||||
cancelSelection: [],
|
||||
multipleSelection: [],
|
||||
@@ -200,7 +202,9 @@ export default {
|
||||
methods: {
|
||||
handleSearch() {
|
||||
debugger
|
||||
this.multipleSelection = this.multipleSelection.filter(i => { return this.$refs.dis_table.selection.includes(i) })
|
||||
this.multipleSelection = this.multipleSelection.filter(i => {
|
||||
return this.$refs.dis_table.selection.includes(i)
|
||||
})
|
||||
this.currentSelection = [...this.$refs.dis_table.selection]
|
||||
},
|
||||
handleSelectionChange(selection) {
|
||||
@@ -256,17 +260,16 @@ export default {
|
||||
this.clearSearch1()
|
||||
},
|
||||
table2RowStyle({ row }) {
|
||||
// if(this.cancelSelection.includes(row))
|
||||
// {
|
||||
// return {background: 'white'}; // 修改颜色
|
||||
// }
|
||||
if (this.currentSelection.includes(row)) {
|
||||
return { background: 'orange' } // 修改颜色
|
||||
if (row.box_group !== '0') {
|
||||
return { background: 'orange' } // 修改颜色
|
||||
}
|
||||
}
|
||||
if (this.multipleSelection.includes(row)) {
|
||||
return { background: 'orange' } // 修改颜色
|
||||
if (row.box_group !== '0') {
|
||||
return { background: 'orange' } // 修改颜色
|
||||
}
|
||||
}
|
||||
return {}
|
||||
},
|
||||
getMultipleSelection(multipleSelection) {
|
||||
return multipleSelection.reduce((acc, item) => {
|
||||
@@ -295,10 +298,11 @@ export default {
|
||||
},
|
||||
// 表格1的行点击事件
|
||||
handleRowClick(scope) {
|
||||
debugger
|
||||
const table2 = this.$refs.dis_table
|
||||
const table2Data = Array.from(this.openParam)
|
||||
const groupValue = scope.box_group === 0 ? scope.container_name : scope.box_group
|
||||
const selectedRows = table2Data.filter(row => row.box_group === groupValue && row.box_group !== null && row.box_group !== 0)
|
||||
const groupValue = scope.box_group === '0' ? scope.container_name : scope.box_group
|
||||
const selectedRows = table2Data.filter(row => (row.container_name == groupValue) || (row.box_group === groupValue && row.box_group !== null && row.box_group !== '0'))
|
||||
table2.clearSelection()
|
||||
selectedRows.forEach(row => table2.toggleRowSelection(row))
|
||||
},
|
||||
@@ -325,19 +329,17 @@ export default {
|
||||
tableRowClassName({ row, rowIndex }) {
|
||||
row.index = rowIndex
|
||||
},
|
||||
tableChanged(row) {
|
||||
async tableChanged(row) {
|
||||
debugger
|
||||
this.form.tableMater = this.currentSelection
|
||||
this.form.checked = row.material_code
|
||||
this.form.sale_order_name = this.sale_order_name
|
||||
crudPackagerelation.updateEntityList(this.form).then(res => {
|
||||
crudSubpackagerelation.queryContainerization({ 'sale_order_name': this.sale_order_name }).then(res => {
|
||||
this.openParam = res.content
|
||||
this.clearSelection()
|
||||
})
|
||||
this.form.tableMater = []
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
})
|
||||
await crudPackagerelation.updateEntityList(this.form)
|
||||
const res = crudSubpackagerelation.queryContainerization({ 'sale_order_name': this.sale_order_name })
|
||||
this.openParam = res.content
|
||||
this.clearSelection()
|
||||
this.form.tableMater = []
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.$emit('childEvent')
|
||||
},
|
||||
divStruct() {
|
||||
|
||||
Reference in New Issue
Block a user