irc_web/src/views/trials/trials-panel/reading/consistency-analysis/components/VirtualCenter.vue

139 lines
3.8 KiB
Vue

/* eslint-disable */
<template>
<el-form
ref="taskAllocationRuleDataForm"
v-loading="loading"
:model="form"
size="small"
:rules="rules"
label-width="170px"
>
<div class="base-dialog-body" style="position: relative;padding-top: 50px">
<el-button @click="openSiteCodeHistory" type="text" style="position: absolute;right: 10px;top: 10px;">{{$t('trials:consistencyAnalysisRule:table:SiteCodeHistory')}}</el-button>
<!-- 访视数 -->
<el-form-item :label="$t('trials:consistencyAnalysisRule:table:nowSiteCode')">
{{ OtherInfo.VitrualSiteCode }}
</el-form-item>
<!-- 虚拟中心编号 -->
<el-form-item :label="$t('trials:consistencyAnalysisRule:table:siteCode')" prop="VirtualSiteCode">
<el-input v-model="form.VirtualSiteCode" style="width: 140px;" />
</el-form-item>
</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">
{{ $t('common:button:save') }}
</el-button>
</el-form-item>
</div>
<el-dialog
v-if="isSiteCodeHistory"
:title="$t('trials:consistencyAnalysis:dialog:isSiteCodeHistory')"
:visible.sync="isSiteCodeHistory"
width="800px"
append-to-body
:close-on-click-modal="false"
custom-class="base-dialog-wrapper"
>
<el-table
v-loading="loading"
:data="list"
stripe
min-height="300"
>
<el-table-column
show-overflow-tooltip
width="80"
>
<template slot-scope="scope">
{{scope.$index + 1}}
</template>
</el-table-column>
<el-table-column
prop="VirtualSiteCode"
:label="$t('trials:consistencyAnalysis:siteTable:VirtualSiteCode')"
show-overflow-tooltip
min-width="120"
>
</el-table-column>
<el-table-column
prop="Creatime"
:label="$t('trials:consistencyAnalysis:siteTable:Creatime')"
show-overflow-tooltip
sortable="custom"
>
</el-table-column>
</el-table>
</el-dialog>
</el-form>
</template>
<script>
import { updateTrialVirtualSiteCode, getUpdateVirtualSiteCodeList } from '@/api/trials'
export default {
name: 'VirtualCenter',
props: {
OtherInfo: {
type: Object,
default() {
return {}
}
}
},
data() {
return {
form: {
TrialId: this.$route.query.trialId,
VirtualSiteCode: '',
},
rules: {
VirtualSiteCode: [{ required: true, message: this.$t('common:ruleMessage:specify'), trigger: 'blur' }],
},
loading: false,
btnLoading: false,
isSiteCodeHistory: false,
list: []
}
},
mounted() {
},
methods: {
openSiteCodeHistory() {
this.isSiteCodeHistory = true
getUpdateVirtualSiteCodeList({
trialId: this.$route.query.trialId
}).then(res => {
this.list = res.Result
})
},
save() {
this.$refs.taskAllocationRuleDataForm.validate(valid => {
if (!valid) return
this.btnLoading = true
this.loading = true
updateTrialVirtualSiteCode(this.form).then(res => {
this.$message.success(this.$t('common:message:savedSuccessfully'))
this.btnLoading = false
this.loading = false
this.$emit('getList')
this.$emit('close')
})
})
},
close() { this.$emit('close') }
}
}
</script>
<style lang="scss" scoped>
</style>