irc_web/.svn/pristine/c6/c61516b615e82c31d81b3d28a53...

172 lines
4.3 KiB
Plaintext

/* eslint-disable */
<template>
<el-form>
<div class="base-dialog-body">
<el-table
v-loading="loading"
:data="list"
stripe
height="100"
style="min-height: 400px;"
@selection-change="handleSelectChange"
>
<el-table-column :selectable="selectable" type="selection" align="left" width="45" />
<el-table-column
prop="TrialSiteCode"
label="中心编号"
min-width="100"
sortable="custom"
show-overflow-tooltip
/>
<el-table-column
prop="SubjectCode"
label="受试者编号"
min-width="120"
sortable="custom"
show-overflow-tooltip
/>
<el-table-column
prop="ValidVisitCount"
label="符合规则访视数"
min-width="160"
sortable="custom"
show-overflow-tooltip
/>
</el-table>
<!-- 分页组件 -->
<div style="text-align: right">
<pagination class="page" :total="total" :page.sync="searchData.PageIndex" :limit.sync="searchData.PageSize" @pagination="getList" />
</div>
</div>
<div class="base-dialog-footer" style="text-align:right;margin-top:10px;">
<el-form-item>
<!-- 取消 -->
<el-button
:disabled="btnLoading"
size="small"
type="primary"
@click="close"
>
{{ $t('common:button:cancel') }}
</el-button>
<!-- 保存 -->
<el-button size="small" type="primary" :loading="btnLoading" @click="save">
生成
</el-button>
</el-form-item>
</div>
</el-form>
</template>
<script>
import { getGroupConsistentRuleSubjectList, confirmGenerateGroupConsistentTask, getDoctorConsistentRuleSubjectList, confirmGenerateConsistentTask } from '@/api/trials/reading'
import BaseContainer from '@/components/BaseContainer'
import Pagination from '@/components/Pagination'
const searchDataDefault = () => {
return {
PageIndex: 1,
PageSize: 20,
Asc: true,
SortField: '',
TrialId: null,
TaskConsistentRuleId: null
}
}
export default {
name: 'TrialsNotice',
components: { BaseContainer, Pagination },
props: {
changeNum: {
type: Number,
default() {
return 0
}
},
IsSelfAnalysis: {
type: Boolean,
default() {
return false
}
},
data: {
type: Object,
default() {
return {}
}
},
},
watch: {
changeNum(v) {
this.getList()
}
},
data() {
return {
searchData: searchDataDefault(),
list: [],
total: 0,
loading: false,
trialId: this.$route.query.trialId,
SelectList: [],
btnLoading: false
}
},
mounted() {
this.getList()
},
methods: {
selectable(row) {
if (row.IsHaveGeneratedTask) {
return false
} else {
return true
}
},
handleSelectChange(e) {
this.SelectList = e
},
save () {
if (this.SelectList.length === 0) {
this.$message.error('请选择要生成的受试者')
return
}
this.btnLoading = true
this.loading = true
var params = {
TrialId: this.$route.query.trialId,
SubejctIdList: this.SelectList.map(v => v.SubjectId)
}
confirmGenerateGroupConsistentTask(params).then(res => {
this.loading = false
this.btnLoading = false
this.$message.success('保存成功')
this.$emit('getList')
}).catch(() => {
this.loading = false
this.btnLoading = false
})
},
getList() {
this.searchData.TrialId = this.$route.query.trialId
this.loading = true
getGroupConsistentRuleSubjectList(this.searchData).then(res => {
this.loading = false
this.list = res.Result.CurrentPageData
this.total = res.Result.TotalCount
}).catch(() => { this.loading = false })
},
close() { this.$emit('close') },
// 排序
handleSortChange(column) {
if (column.order === 'ascending') {
this.searchData.Asc = true
} else {
this.searchData.Asc = false
}
this.searchData.SortField = column.prop
this.searchData.PageIndex = 1
this.getList()
}
}
}
</script>