1
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
12e93fbd15
commit
1be88b66af
|
@ -37,7 +37,7 @@
|
||||||
>
|
>
|
||||||
<el-select
|
<el-select
|
||||||
v-model="form.UploadRole"
|
v-model="form.UploadRole"
|
||||||
style="width:100%;"
|
style="width: 100%"
|
||||||
@change="handleUploadRoleChange"
|
@change="handleUploadRoleChange"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
|
@ -55,8 +55,12 @@
|
||||||
>
|
>
|
||||||
<el-select
|
<el-select
|
||||||
v-model="form.ClinicalDataLevel"
|
v-model="form.ClinicalDataLevel"
|
||||||
style="width:100%;"
|
style="width: 100%"
|
||||||
@change="() => {form.ClinicalUploadType = null}"
|
@change="
|
||||||
|
() => {
|
||||||
|
form.ClinicalUploadType = null
|
||||||
|
}
|
||||||
|
"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="(item, index) of $d.ClinicalLevel"
|
v-for="(item, index) of $d.ClinicalLevel"
|
||||||
|
@ -73,16 +77,21 @@
|
||||||
:label="$t('trials:processCfg:title:transferType')"
|
:label="$t('trials:processCfg:title:transferType')"
|
||||||
prop="ClinicalUploadType"
|
prop="ClinicalUploadType"
|
||||||
>
|
>
|
||||||
<el-select
|
<el-select v-model="form.ClinicalUploadType" style="width: 100%">
|
||||||
v-model="form.ClinicalUploadType"
|
|
||||||
style="width:100%;"
|
|
||||||
>
|
|
||||||
<el-option
|
<el-option
|
||||||
v-for="(item, index) of $d.ClinicalUploadType"
|
v-for="(item, index) of $d.ClinicalUploadType"
|
||||||
:key="index"
|
:key="index"
|
||||||
:label="item.label"
|
:label="item.label"
|
||||||
:value="item.value"
|
:value="item.value"
|
||||||
:disabled="item.value === 0 || item.value === 2 && form.UploadRole === 1 || (form.UploadRole === 0 && [2, 3].includes(form.ClinicalDataLevel) && item.value === 1)"
|
:disabled="
|
||||||
|
(item.value === 2 &&
|
||||||
|
(form.UploadRole !== 0 || form.ClinicalDataLevel !== 1)) ||
|
||||||
|
item.value === 0 ||
|
||||||
|
(item.value === 2 && form.UploadRole === 1) ||
|
||||||
|
(form.UploadRole === 0 &&
|
||||||
|
[2, 3].includes(form.ClinicalDataLevel) &&
|
||||||
|
item.value === 1)
|
||||||
|
"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
@ -94,7 +103,7 @@
|
||||||
<el-select
|
<el-select
|
||||||
v-model="form.TrialCriterionIdList"
|
v-model="form.TrialCriterionIdList"
|
||||||
multiple
|
multiple
|
||||||
style="width:100%;"
|
style="width: 100%"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="(item, index) of criterionList"
|
v-for="(item, index) of criterionList"
|
||||||
|
@ -125,24 +134,18 @@
|
||||||
:disabled="form.Type === ''"
|
:disabled="form.Type === ''"
|
||||||
>
|
>
|
||||||
<!-- 选择 -->
|
<!-- 选择 -->
|
||||||
<el-button size="small" type="primary">{{ $t('trials:processCfg:button:select') }}</el-button>
|
<el-button size="small" type="primary">{{
|
||||||
<span
|
$t('trials:processCfg:button:select')
|
||||||
slot="tip"
|
}}</el-button>
|
||||||
style="margin-left:10px;"
|
<span slot="tip" style="margin-left: 10px" class="el-upload__tip">
|
||||||
class="el-upload__tip"
|
|
||||||
>
|
|
||||||
<!-- (必须是doc/docx格式) -->
|
<!-- (必须是doc/docx格式) -->
|
||||||
{{ $t('system:tip:file:docx') }}
|
{{ $t('system:tip:file:docx') }}
|
||||||
</span>
|
</span>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div class="base-dialog-footer" style="text-align: right; margin-top: 10px">
|
||||||
class="base-dialog-footer"
|
|
||||||
style="text-align:right;margin-top:10px;"
|
|
||||||
>
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<!-- 取消 -->
|
<!-- 取消 -->
|
||||||
<el-button
|
<el-button
|
||||||
|
@ -167,18 +170,25 @@
|
||||||
</el-form>
|
</el-form>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { addOrUpdateClinicalDataTrialSet, uploadClinicalTemplate, getTrialCriterionSelectList, getReadingQuestionCriterionTrialList } from '@/api/trials'
|
import {
|
||||||
|
addOrUpdateClinicalDataTrialSet,
|
||||||
|
uploadClinicalTemplate,
|
||||||
|
getTrialCriterionSelectList,
|
||||||
|
getReadingQuestionCriterionTrialList,
|
||||||
|
} from '@/api/trials'
|
||||||
export default {
|
export default {
|
||||||
name: 'AddOrUpdateClinicalData',
|
name: 'AddOrUpdateClinicalData',
|
||||||
props: {
|
props: {
|
||||||
data: {
|
data: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default() { return {} }
|
default() {
|
||||||
|
return {}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
trialId: {
|
trialId: {
|
||||||
type: String,
|
type: String,
|
||||||
required: true
|
required: true,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
|
@ -193,21 +203,57 @@ export default {
|
||||||
UploadRole: null,
|
UploadRole: null,
|
||||||
FileName: '',
|
FileName: '',
|
||||||
Path: '',
|
Path: '',
|
||||||
TrialCriterionIdList: []
|
TrialCriterionIdList: [],
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
ClinicalDataSetName: [{ required: true, message: this.$t('common:ruleMessage:specify'), trigger: ['blur', 'change'] }],
|
ClinicalDataSetName: [
|
||||||
ClinicalDataSetEnName: [{ required: true, message: this.$t('common:ruleMessage:specify'), trigger: ['blur', 'change'] }],
|
{
|
||||||
ClinicalDataLevel: [{ required: true, message: this.$t('common:ruleMessage:select'), trigger: ['blur', 'change'] }],
|
required: true,
|
||||||
ClinicalUploadType: [{ required: true, message: this.$t('common:ruleMessage:select'), trigger: ['blur', 'change'] }],
|
message: this.$t('common:ruleMessage:specify'),
|
||||||
UploadRole: [{ required: true, message: this.$t('common:ruleMessage:select'), trigger: ['blur', 'change'] }],
|
trigger: ['blur', 'change'],
|
||||||
TrialCriterionIdList: [{ required: true, message: this.$t('common:ruleMessage:select'), trigger: ['blur', 'change'] }]
|
},
|
||||||
|
],
|
||||||
|
ClinicalDataSetEnName: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: this.$t('common:ruleMessage:specify'),
|
||||||
|
trigger: ['blur', 'change'],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
ClinicalDataLevel: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: this.$t('common:ruleMessage:select'),
|
||||||
|
trigger: ['blur', 'change'],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
ClinicalUploadType: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: this.$t('common:ruleMessage:select'),
|
||||||
|
trigger: ['blur', 'change'],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
UploadRole: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: this.$t('common:ruleMessage:select'),
|
||||||
|
trigger: ['blur', 'change'],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
TrialCriterionIdList: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: this.$t('common:ruleMessage:select'),
|
||||||
|
trigger: ['blur', 'change'],
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
loading: false,
|
loading: false,
|
||||||
btnLoading: false,
|
btnLoading: false,
|
||||||
fileList: [],
|
fileList: [],
|
||||||
trialCriterionSelectList: [],
|
trialCriterionSelectList: [],
|
||||||
criterionList: []
|
criterionList: [],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
@ -219,13 +265,17 @@ export default {
|
||||||
getReadingQuestionCriterionTrialList({
|
getReadingQuestionCriterionTrialList({
|
||||||
TrialId: this.trialId,
|
TrialId: this.trialId,
|
||||||
PageIndex: 1,
|
PageIndex: 1,
|
||||||
PageSize: 500
|
PageSize: 500,
|
||||||
}).then(res => {
|
})
|
||||||
|
.then((res) => {
|
||||||
this.criterionList = res.Result.CurrentPageData
|
this.criterionList = res.Result.CurrentPageData
|
||||||
}).catch(() => { this.listLoading = false })
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.listLoading = false
|
||||||
|
})
|
||||||
},
|
},
|
||||||
getTrialCriterionSelectList() {
|
getTrialCriterionSelectList() {
|
||||||
getTrialCriterionSelectList({ TrialId: this.trialId }).then(res => {
|
getTrialCriterionSelectList({ TrialId: this.trialId }).then((res) => {
|
||||||
this.trialCriterionSelectList = res.Result
|
this.trialCriterionSelectList = res.Result
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@ -240,17 +290,18 @@ export default {
|
||||||
this.fileList = [
|
this.fileList = [
|
||||||
{
|
{
|
||||||
name: this.data.FileName,
|
name: this.data.FileName,
|
||||||
path: this.data.Path
|
path: this.data.Path,
|
||||||
}
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
save() {
|
save() {
|
||||||
this.$refs.clinicalDataForm.validate(valid => {
|
this.$refs.clinicalDataForm.validate((valid) => {
|
||||||
if (!valid) return
|
if (!valid) return
|
||||||
this.btnLoading = true
|
this.btnLoading = true
|
||||||
this.form.TrialId = this.trialId
|
this.form.TrialId = this.trialId
|
||||||
addOrUpdateClinicalDataTrialSet(this.form).then(res => {
|
addOrUpdateClinicalDataTrialSet(this.form)
|
||||||
|
.then((res) => {
|
||||||
this.btnLoading = false
|
this.btnLoading = false
|
||||||
this.$emit('getList', true)
|
this.$emit('getList', true)
|
||||||
this.$emit('close')
|
this.$emit('close')
|
||||||
|
@ -265,9 +316,16 @@ export default {
|
||||||
async handleUploadFile(param) {
|
async handleUploadFile(param) {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
const file = await this.fileToBlob(param.file)
|
const file = await this.fileToBlob(param.file)
|
||||||
const res = await this.OSSclient.put(`/TrialConfig/${this.trialId}/ClinicalData/${param.file.name}`, file)
|
const res = await this.OSSclient.put(
|
||||||
|
`/TrialConfig/${this.trialId}/ClinicalData/${param.file.name}`,
|
||||||
|
file
|
||||||
|
)
|
||||||
// console.log(res)
|
// console.log(res)
|
||||||
const file1 = { name: param.file.name, path: this.form.Path, url: this.$getObjectName(res.url) }
|
const file1 = {
|
||||||
|
name: param.file.name,
|
||||||
|
path: this.form.Path,
|
||||||
|
url: this.$getObjectName(res.url),
|
||||||
|
}
|
||||||
this.fileList.push(file1)
|
this.fileList.push(file1)
|
||||||
this.form.Path = this.$getObjectName(res.url)
|
this.form.Path = this.$getObjectName(res.url)
|
||||||
this.form.FileName = param.file.name
|
this.form.FileName = param.file.name
|
||||||
|
@ -299,7 +357,9 @@ export default {
|
||||||
},
|
},
|
||||||
checkFileSuffix(fileName) {
|
checkFileSuffix(fileName) {
|
||||||
var typeArr = ['doc', 'docx']
|
var typeArr = ['doc', 'docx']
|
||||||
var extendName = fileName.substring(fileName.lastIndexOf('.') + 1).toLocaleLowerCase()
|
var extendName = fileName
|
||||||
|
.substring(fileName.lastIndexOf('.') + 1)
|
||||||
|
.toLocaleLowerCase()
|
||||||
if (typeArr.indexOf(extendName) !== -1) {
|
if (typeArr.indexOf(extendName) !== -1) {
|
||||||
return true
|
return true
|
||||||
} else {
|
} else {
|
||||||
|
@ -312,9 +372,8 @@ export default {
|
||||||
},
|
},
|
||||||
close() {
|
close() {
|
||||||
this.$emit('close')
|
this.$emit('close')
|
||||||
}
|
},
|
||||||
|
},
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
Loading…
Reference in New Issue