阅片排序

main
wangxiaoshuang 2025-06-13 11:17:28 +08:00
parent c865608313
commit ccdfe9d83e
2 changed files with 43 additions and 4 deletions

View File

@ -480,3 +480,11 @@ export function resetReadingRestTime() {
method: 'post'
})
}
// 设置随机排序
export function setRandomTaskOrder(data) {
return request({
url: `/VisitTask/setRandomTaskOrder`,
method: 'post',
data
})
}

View File

@ -70,7 +70,8 @@
{{ $t('common:button:export') }}
</el-button>
<!-- 随机排序 -->
<el-button type="primary" @click="randomOrder">
<el-button type="primary" @click="randomOrder"
:disabled="!searchData.TrialReadingCriterionId || !searchData.DoctorUserId">
{{ $t('trials:readingTracking:button:order') }}
</el-button>
</el-form-item>
@ -187,7 +188,7 @@
sortable="custom" show-overflow-tooltip>
<template slot-scope="scope">
<el-input-number v-model="scope.row.RandomOrder"
@change="(value) => handleChange(scope.row, value)" :min="0"
@change="(value) => handleChange(scope.row, value)" :min="1"
style="width: 150px;"></el-input-number>
</template>
</el-table-column>
@ -204,6 +205,7 @@ import {
getTrialCriterionList,
getReadingTaskList,
getDoctorUserSelectList,
setRandomTaskOrder
} from '@/api/trials/reading'
import { getReadingTaskList_Export } from '@/api/export'
import BaseContainer from '@/components/BaseContainer'
@ -275,7 +277,22 @@ export default {
//
async handleChange(row, value) {
try {
console.log(row, value)
if (!this.searchData.DoctorUserId || !this.searchData.TrialReadingCriterionId) return false
let data = {
TrialId: this.$route.query.trialId,
TrialReadingCriterionId: this.searchData.TrialReadingCriterionId,
DoctorUserId: this.searchData.DoctorUserId,
IsAutoSet: false,
SetList: [
{ Id: row.Id, RandomOrder: value }
]
}
this.loading = true;
let res = await setRandomTaskOrder(data)
this.loading = false
if (res.IsSuccess) {
this.getList()
}
} catch (err) {
console.log(err)
this.loading = false
@ -284,7 +301,20 @@ export default {
//
async randomOrder() {
try {
if (!this.searchData.DoctorUserId || !this.searchData.TrialReadingCriterionId) return false
let data = {
TrialId: this.$route.query.trialId,
TrialReadingCriterionId: this.searchData.TrialReadingCriterionId,
DoctorUserId: this.searchData.DoctorUserId,
IsAutoSet: true,
SetList: []
}
this.loading = true;
let res = await setRandomTaskOrder(data)
this.loading = false
if (res.IsSuccess) {
this.getList()
}
} catch (err) {
console.log(err)
this.loading = false
@ -325,6 +355,7 @@ export default {
},
getList() {
if (!this.searchData.DoctorUserId || !this.searchData.TrialReadingCriterionId) return false
this.searchData.TrialId = this.$route.query.trialId
this.loading = true
getReadingTaskList(this.searchData)