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"> <div class="base-dialog-body">
<!-- 临床数据名称 --> <!-- 临床数据名称 -->
<el-form-item <el-form-item
:label="$t('trials:processCfg:title:clinicalDataName') " :label="$t('trials:processCfg:title:clinicalDataName')"
prop="ClinicalDataSetEnName" prop="ClinicalDataSetEnName"
> >
<el-input <el-input
@ -37,11 +37,11 @@
> >
<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
v-for="(item,index) of $d.ClinicalDataUploadRole" v-for="(item, index) of $d.ClinicalDataUploadRole"
:key="index" :key="index"
:label="item.label" :label="item.label"
:value="item.value" :value="item.value"
@ -55,11 +55,15 @@
> >
<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"
v-show="!(form.UploadRole === 1 && item.value === 4)" v-show="!(form.UploadRole === 1 && item.value === 4)"
:key="index" :key="index"
:label="item.label" :label="item.label"
@ -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,10 +103,10 @@
<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"
:key="index" :key="index"
:label="item.CriterionName" :label="item.CriterionName"
:value="item.Id" :value="item.Id"
@ -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 => { })
this.criterionList = res.Result.CurrentPageData .then((res) => {
}).catch(() => { this.listLoading = false }) this.criterionList = res.Result.CurrentPageData
})
.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,22 +290,23 @@ 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)
this.btnLoading = false .then((res) => {
this.$emit('getList', true) this.btnLoading = false
this.$emit('close') this.$emit('getList', true)
this.$message.success(this.$t('common:message:savedSuccessfully')) this.$emit('close')
}) this.$message.success(this.$t('common:message:savedSuccessfully'))
})
.catch(() => { .catch(() => {
this.btnLoading = false this.btnLoading = false
}) })
@ -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,13 +372,12 @@ export default {
}, },
close() { close() {
this.$emit('close') this.$emit('close')
} },
},
}
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.upload-container{ .upload-container {
/deep/ .el-upload { /deep/ .el-upload {
width: 100%; width: 100%;
text-align: left; text-align: left;