|
@@ -421,6 +421,16 @@ const linksSampleModal = ref(false)
|
|
|
const linkSample = () => {
|
|
|
linksSampleModal.value = true
|
|
|
tableSampleCheckedKeys.value = []
|
|
|
+ console.log(basicInfoData.value.trialSampleInfo.id, 'basicInfoData')
|
|
|
+ const selectedId = basicInfoData.value.trialSampleInfo.id
|
|
|
+
|
|
|
+ const selectedRow = linksSampleTableData.value.find(row => row.id === selectedId)
|
|
|
+ nextTick(() => {
|
|
|
+ if (selectedRow) {
|
|
|
+ tableSampleRef.value?.toggleRowSelection(selectedRow, true)
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
|
|
|
}
|
|
|
|
|
@@ -459,14 +469,13 @@ const getLinksSampleData = async () => {
|
|
|
linksSampleTableLoading.value = false
|
|
|
if (!error && code === 200) {
|
|
|
linksSampleTableData.value = getArrValue(data)
|
|
|
- linksSampleTableData.value.forEach((iten) => {
|
|
|
- if (iten.isRelation === 1) {
|
|
|
- nextTick(() => {
|
|
|
- tableSampleRef.value?.toggleRowSelection(iten, true)
|
|
|
- })
|
|
|
-
|
|
|
- }
|
|
|
- })
|
|
|
+ const selectedId = basicInfoData.value.trialSampleInfo.id
|
|
|
+ const selectedRow = linksSampleTableData.value.find(row => row.id === selectedId)
|
|
|
+ nextTick(() => {
|
|
|
+ if (selectedRow) {
|
|
|
+ tableSampleRef.value?.toggleRowSelection(selectedRow, true)
|
|
|
+ }
|
|
|
+ })
|
|
|
//searchForm.value.total = data.total || 0
|
|
|
} else {
|
|
|
linksSampleTableData.value = []
|
|
@@ -476,6 +485,8 @@ const getLinksSampleData = async () => {
|
|
|
//关闭关联取样
|
|
|
const linksSampleModalClose = () => {
|
|
|
linksSampleModal.value = false
|
|
|
+ linksSampleTableData.value = []
|
|
|
+ tableSampleRef.value?.clearSelection()
|
|
|
}
|
|
|
const linksSampleModalSave = () => {
|
|
|
linksSampleModal.value = false
|