|
@@ -106,10 +106,15 @@ const columns = computed<EpTableColumn<TableDataType>[]>(() => {
|
|
|
]
|
|
|
})
|
|
|
|
|
|
+let currentDataType: TableDataType['stage'] = 'SAMPLE_A'
|
|
|
+
|
|
|
/** 刷新按钮 */
|
|
|
function onSearch() {
|
|
|
const { diffShow, ...params } = model || {}
|
|
|
- getTrainingMonitor(params)
|
|
|
+ const dataType = model.markStage
|
|
|
+ getTrainingMonitor(params).then(() => {
|
|
|
+ currentDataType = dataType
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
/** 通过/不通过 */
|
|
@@ -117,20 +122,13 @@ const onAssessPass = async (pass: boolean) => {
|
|
|
if (!hasSelected.value) {
|
|
|
return ElMessage.warning('未勾选考核人员')
|
|
|
}
|
|
|
- const selectedData = selectedList.reduce((serialize, data) => {
|
|
|
- serialize[data.stage] ??= []
|
|
|
- serialize[data.stage].push(data)
|
|
|
- return serialize
|
|
|
- }, {} as Record<string, TableDataType[]>)
|
|
|
-
|
|
|
- const fetchList = Object.entries(selectedData).map(([stage, selected]) => {
|
|
|
- const forceGroupMarkerIds = selected.map((d) => d.forceGroupMarkerId)
|
|
|
- const markerIds = selected.map((d) => d.markerId)
|
|
|
- return stage === 'FORCE'
|
|
|
- ? putAssessMonitorPass({ forceGroupMarkerIds, pass })
|
|
|
- : putSampleMonitorPass({ markerIds, markStage: stage as SamplePaperType, pass })
|
|
|
- })
|
|
|
- await Promise.allSettled(fetchList)
|
|
|
+ if (currentDataType === 'FORCE') {
|
|
|
+ const forceGroupMarkerIds: number[] = selectedList.map((d) => d.forceGroupMarkerId)
|
|
|
+ await putAssessMonitorPass({ forceGroupMarkerIds, pass })
|
|
|
+ } else {
|
|
|
+ const markerIds = selectedList.map((d) => d.markerId)
|
|
|
+ await putSampleMonitorPass({ markerIds, markStage: currentDataType, pass })
|
|
|
+ }
|
|
|
onSearch()
|
|
|
}
|
|
|
|