Browse Source

取消SearchTable父子关联默认选中

linshi20240813
wangyufei 3 months ago
parent
commit
e490c37a0b
  1. 6
      src/components/BasicForm/src/BasicForm.vue
  2. 11
      src/components/SearchTable/src/SearchTable.vue
  3. 2
      src/views/wms/moveManage/inventorymove/inventorymoveRecordMainNew/index.vue

6
src/components/BasicForm/src/BasicForm.vue

@ -134,6 +134,7 @@
<SearchTable
ref="searchTableRef"
:showSearchTableQueryFields="showSearchTableQueryFields"
:isCheckStrictly="isCheckStrictly"
@searchTableSuccess="searchTableSuccess"
>
<template v-for="name in Object.keys($slots)" :key="name" #[name]="{ selections }">
@ -340,6 +341,11 @@ const props = defineProps({
type: Boolean,
required: false,
default: false
},
// true ; false
isCheckStrictly:{
type:Boolean,
default:false
}
})

11
src/components/SearchTable/src/SearchTable.vue

@ -59,6 +59,11 @@ const props = defineProps({
required: false,
default: []
},
// true ; false
isCheckStrictly:{
type:Boolean,
default:false
}
})
const { t } = useI18n() //
const message = useMessage() //
@ -285,11 +290,17 @@ const submitForm = async () => {
}
}
const rowClick = (row: any, column: any, event: Event) => {
const selected = searchTableRef.value?.elTableRef
?.getSelectionRows()
.some((item) => item.id === row.id)
if (!selected) {
searchTableRef.value?.elTableRef?.toggleRowSelection(row, true)
if(props.isCheckStrictly&&row.children){//
row.children.forEach(item => {
searchTableRef.value?.elTableRef?.toggleRowSelection(item, false)
});
}
} else {
//
searchTableRef.value?.elTableRef?.toggleRowSelection(row, false)

2
src/views/wms/moveManage/inventorymove/inventorymoveRecordMainNew/index.vue

@ -40,9 +40,11 @@
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<!-- isCheckStrictly 取消主子关联 -->
<BasicForm
ref="formRef"
:isOpenSearchTable="true"
:isCheckStrictly="true"
fieldTableColumn="itemCode"
@success="getList"
:rules="InventorymoveRequestMainRules"

Loading…
Cancel
Save