irc_web/.svn/pristine/cc/ccbfca0a2833168f3a13d9c955b...

288 lines
7.9 KiB
Plaintext

<template>
<!-- 系统问题 -->
<box-content v-loading="loading">
<!-- 搜索框 -->
<div class="search">
<el-form
:inline="true"
size="mini"
class="base-search-form"
>
<!-- 审核问题 -->
<el-form-item
:label="$t('trials:qcCfg:table:questionName')"
>
<el-input
v-model="searchData.QuestionName"
clearable
style="width:120px;"
/>
</el-form-item>
<!-- 类型 -->
<el-form-item
label="任务类型"
>
<el-select
v-model="searchData.ReadingCategory"
clearable
style="width:120px;"
>
<el-option
v-for="item of $d.ReadingCategory"
:key="item.value"
:value="item.value"
:label="item.label"
/>
</el-select>
</el-form-item>
<el-form-item label="阅片标准:">
<el-select clearable v-model="searchData.CriterionTypeEnum">
<el-option v-for="item of $d.CriterionType" :key="item.id" :value="item.value" :label="item.label" />
</el-select>
</el-form-item>
<el-form-item label="是否通用:">
<el-select clearable v-model="searchData.IsGeneral">
<el-option v-for="item of $d.YesOrNo" :key="item.id" :value="item.value" :label="item.label" />
</el-select>
</el-form-item>
<el-form-item>
<el-button
type="primary"
@click="handleSearch"
>{{ $t('common:button:search') }}</el-button>
<el-button
type="primary"
@click="handleReset"
>{{ $t('common:button:reset') }}</el-button>
</el-form-item>
</el-form>
<span style="margin-left:auto">
<el-button
type="primary"
size="mini"
:disabled="selectArr.length<=0"
@click="handleSubmit"
>
{{ $t('common:button:submit') }}
</el-button>
</span>
</div>
<el-table
:data="list"
stripe
size="small"
height="400"
@selection-change="handleSelectChange"
>
<el-table-column
type="selection"
align="left"
width="45"
/>
<el-table-column type="index" width="60" />
<!-- 审核问题 -->
<el-table-column
prop="QuestionName"
:label="$t('trials:qcCfg:table:questionName')"
show-overflow-tooltip
/>
<!-- 类型 -->
<el-table-column
prop="Type"
:label="$t('trials:qcCfg:table:type')"
show-overflow-tooltip
>
<template slot-scope="scope">
{{ $fd('QcType', scope.row.Type) }}
</template>
</el-table-column>
<!-- 选项 -->
<el-table-column
prop="TypeValue"
:label="$t('trials:qcCfg:table:typeValue')"
show-overflow-tooltip
min-width="110"
/>
<!-- 任务类型 -->
<el-table-column
prop="ReadingCategory"
label="任务类型"
show-overflow-tooltip
>
<template slot-scope="scope">
<el-tag v-if="scope.row.ReadingCategory === 1" type="primary">
{{ $fd('ReadingCategory', scope.row.ReadingCategory) }}
</el-tag>
<el-tag v-if="scope.row.ReadingCategory === 2" type="info">
{{ $fd('ReadingCategory', scope.row.ReadingCategory) }}
</el-tag>
<el-tag v-if="scope.row.ReadingCategory === 4" type="danger">
{{ $fd('ReadingCategory', scope.row.ReadingCategory) }}
</el-tag>
<el-tag v-if="scope.row.ReadingCategory === 5" type="warning">
{{ $fd('ReadingCategory', scope.row.ReadingCategory) }}
</el-tag>
</template>
</el-table-column>
<el-table-column
prop="ReadingCategory"
label="阅片标准"
width="120"
show-overflow-tooltip
>
<template slot-scope="scope">
<div>
{{$fd('CriterionType', scope.row.CriterionTypeEnum)}}
</div>
</template>
</el-table-column>
<el-table-column
prop="IsGeneral"
label="是否通用"
width="80"
show-overflow-tooltip
>
<template slot-scope="scope">
<div>
{{$fd('YesOrNo', scope.row.IsGeneral)}}
</div>
</template>
</el-table-column>
<!-- 父问题 -->
<el-table-column
prop="ParentShowOrder"
:label="$t('trials:qcCfg:table:parentQs')"
show-overflow-tooltip
/>
<!-- 父问题触发值 -->
<el-table-column
prop="ParentTriggerValue"
:label="$t('trials:qcCfg:table:parentTriggerValue')"
show-overflow-tooltip
/>
<!-- 序号 -->
<el-table-column
prop="ShowOrder"
:label="$t('trials:qcCfg:table:order')"
min-width="70"
/>
<!-- 是否必填 -->
<el-table-column
prop="IsRequired"
:label="$t('trials:qcCfg:table:isRequired')"
min-width="90"
>
<template slot-scope="scope">
{{ $fd('YesOrNo', scope.row.IsRequired) }}
</template>
</el-table-column>
<!-- 启用状态 -->
<el-table-column
prop="IsEnable"
:label="$t('trials:qcCfg:table:isEnable')"
min-width="120"
>
<template slot-scope="scope">
{{ $fd('IsEnable', scope.row.IsEnable) }}
</template>
</el-table-column>
</el-table>
<Pagination class="page" :total="total" :page.sync="searchData.PageIndex" :limit.sync="searchData.PageSize" @pagination="getList" />
</box-content>
</template>
<script>
import { getReadingMedicineSystemQuestionList } from '@/api/dictionary'
import Pagination from '@/components/Pagination'
import { addTrialDataFromSystem } from '@/api/trials'
import BoxContent from '@/components/BoxContent'
const searchDataDefault = () => {
return {
PageIndex: 1,
PageSize: 20,
QuestionName: '',
Type: '',
CriterionTypeEnum: null,
IsGeneral: null
}
}
export default {
name: 'AddDefaultQS',
components: { BoxContent, Pagination },
props: {
TrialReadingCriterionId: {
type: String,
default() {
return ''
}
},
CurrentCriterionType: {
type: Number,
default() {
return 0
}
}
},
data() {
return {
trialId: '',
searchData: searchDataDefault(),
list: [],
loading: false,
selectArr: [],
total: 0
}
},
mounted() {
this.trialId = this.$route.query.trialId
this.getList()
},
methods: {
getList() {
this.loading = true
this.searchData.TrialId = this.trialId
this.searchData.CurrentCriterionType = this.CurrentCriterionType
getReadingMedicineSystemQuestionList(this.searchData).then(res => {
this.loading = false
this.list = res.Result.CurrentPageData
this.total = res.Result.TotalCount
}).catch(() => { this.loading = false })
},
handleSelectChange(val) {
console.log(val)
const arr = []
for (let index = 0; index < val.length; index++) {
arr.push(val[index].Id)
}
console.log(arr)
this.selectArr = arr
},
handleSubmit() {
this.loading = true
var param = {
trialId: this.trialId,
systemQuestionIds: this.selectArr,
TrialReadingCriterionId: this.TrialReadingCriterionId
}
addTrialDataFromSystem(param).then(res => {
this.loading = false
if (res.IsSuccess) {
this.$message.success(this.$t('common:message:savedSuccessfully'))
this.$emit('getList')
this.$emit('close')
}
}).catch(() => { this.loading = false })
},
// 查询
handleSearch() {
this.getList()
},
// 重置
handleReset() {
this.searchData = searchDataDefault()
this.getList()
}
}
}
</script>