1
continuous-integration/drone/push Build is passing Details

uat_us
wangxiaoshuang 2024-11-25 13:13:06 +08:00
parent 12e93fbd15
commit 1be88b66af
1 changed files with 117 additions and 58 deletions

View File

@ -10,7 +10,7 @@
<div class="base-dialog-body">
<!-- 临床数据名称 -->
<el-form-item
:label="$t('trials:processCfg:title:clinicalDataName') "
:label="$t('trials:processCfg:title:clinicalDataName')"
prop="ClinicalDataSetEnName"
>
<el-input
@ -37,11 +37,11 @@
>
<el-select
v-model="form.UploadRole"
style="width:100%;"
style="width: 100%"
@change="handleUploadRoleChange"
>
<el-option
v-for="(item,index) of $d.ClinicalDataUploadRole"
v-for="(item, index) of $d.ClinicalDataUploadRole"
:key="index"
:label="item.label"
:value="item.value"
@ -55,11 +55,15 @@
>
<el-select
v-model="form.ClinicalDataLevel"
style="width:100%;"
@change="() => {form.ClinicalUploadType = null}"
style="width: 100%"
@change="
() => {
form.ClinicalUploadType = null
}
"
>
<el-option
v-for="(item,index) of $d.ClinicalLevel"
v-for="(item, index) of $d.ClinicalLevel"
v-show="!(form.UploadRole === 1 && item.value === 4)"
:key="index"
:label="item.label"
@ -73,16 +77,21 @@
:label="$t('trials:processCfg:title:transferType')"
prop="ClinicalUploadType"
>
<el-select
v-model="form.ClinicalUploadType"
style="width:100%;"
>
<el-select v-model="form.ClinicalUploadType" style="width: 100%">
<el-option
v-for="(item,index) of $d.ClinicalUploadType"
v-for="(item, index) of $d.ClinicalUploadType"
:key="index"
:label="item.label"
: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-form-item>
@ -94,10 +103,10 @@
<el-select
v-model="form.TrialCriterionIdList"
multiple
style="width:100%;"
style="width: 100%"
>
<el-option
v-for="(item,index) of criterionList"
v-for="(item, index) of criterionList"
:key="index"
:label="item.CriterionName"
:value="item.Id"
@ -125,24 +134,18 @@
:disabled="form.Type === ''"
>
<!-- 选择 -->
<el-button size="small" type="primary">{{ $t('trials:processCfg:button:select') }}</el-button>
<span
slot="tip"
style="margin-left:10px;"
class="el-upload__tip"
>
<el-button size="small" type="primary">{{
$t('trials:processCfg:button:select')
}}</el-button>
<span slot="tip" style="margin-left: 10px" class="el-upload__tip">
<!-- (必须是doc/docx格式) -->
{{ $t('system:tip:file:docx') }}
</span>
</el-upload>
</div>
</el-form-item>
</div>
<div
class="base-dialog-footer"
style="text-align:right;margin-top:10px;"
>
<div class="base-dialog-footer" style="text-align: right; margin-top: 10px">
<el-form-item>
<!-- 取消 -->
<el-button
@ -167,18 +170,25 @@
</el-form>
</template>
<script>
import { addOrUpdateClinicalDataTrialSet, uploadClinicalTemplate, getTrialCriterionSelectList, getReadingQuestionCriterionTrialList } from '@/api/trials'
import {
addOrUpdateClinicalDataTrialSet,
uploadClinicalTemplate,
getTrialCriterionSelectList,
getReadingQuestionCriterionTrialList,
} from '@/api/trials'
export default {
name: 'AddOrUpdateClinicalData',
props: {
data: {
type: Object,
default() { return {} }
default() {
return {}
},
},
trialId: {
type: String,
required: true
}
required: true,
},
},
data() {
@ -193,21 +203,57 @@ export default {
UploadRole: null,
FileName: '',
Path: '',
TrialCriterionIdList: []
TrialCriterionIdList: [],
},
rules: {
ClinicalDataSetName: [{ required: true, message: this.$t('common:ruleMessage:specify'), 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'] }]
ClinicalDataSetName: [
{
required: true,
message: this.$t('common:ruleMessage:specify'),
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,
btnLoading: false,
fileList: [],
trialCriterionSelectList: [],
criterionList: []
criterionList: [],
}
},
mounted() {
@ -219,13 +265,17 @@ export default {
getReadingQuestionCriterionTrialList({
TrialId: this.trialId,
PageIndex: 1,
PageSize: 500
}).then(res => {
this.criterionList = res.Result.CurrentPageData
}).catch(() => { this.listLoading = false })
PageSize: 500,
})
.then((res) => {
this.criterionList = res.Result.CurrentPageData
})
.catch(() => {
this.listLoading = false
})
},
getTrialCriterionSelectList() {
getTrialCriterionSelectList({ TrialId: this.trialId }).then(res => {
getTrialCriterionSelectList({ TrialId: this.trialId }).then((res) => {
this.trialCriterionSelectList = res.Result
})
},
@ -240,22 +290,23 @@ export default {
this.fileList = [
{
name: this.data.FileName,
path: this.data.Path
}
path: this.data.Path,
},
]
}
},
save() {
this.$refs.clinicalDataForm.validate(valid => {
this.$refs.clinicalDataForm.validate((valid) => {
if (!valid) return
this.btnLoading = true
this.form.TrialId = this.trialId
addOrUpdateClinicalDataTrialSet(this.form).then(res => {
this.btnLoading = false
this.$emit('getList', true)
this.$emit('close')
this.$message.success(this.$t('common:message:savedSuccessfully'))
})
addOrUpdateClinicalDataTrialSet(this.form)
.then((res) => {
this.btnLoading = false
this.$emit('getList', true)
this.$emit('close')
this.$message.success(this.$t('common:message:savedSuccessfully'))
})
.catch(() => {
this.btnLoading = false
})
@ -265,9 +316,16 @@ export default {
async handleUploadFile(param) {
this.loading = true
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)
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.form.Path = this.$getObjectName(res.url)
this.form.FileName = param.file.name
@ -299,7 +357,9 @@ export default {
},
checkFileSuffix(fileName) {
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) {
return true
} else {
@ -312,13 +372,12 @@ export default {
},
close() {
this.$emit('close')
}
}
},
},
}
</script>
<style lang="scss" scoped>
.upload-container{
.upload-container {
/deep/ .el-upload {
width: 100%;
text-align: left;