diff --git a/src/views/trials/trials-panel/setting/trial-config/components/logicalConfig.vue b/src/views/trials/trials-panel/setting/trial-config/components/logicalConfig.vue index a037a345..8f6fa39d 100644 --- a/src/views/trials/trials-panel/setting/trial-config/components/logicalConfig.vue +++ b/src/views/trials/trials-panel/setting/trial-config/components/logicalConfig.vue @@ -225,7 +225,7 @@ type="primary" @click="handleSave" > - {{ $t("common:button:save") }} + {{ $t('common:button:save') }} - {{ $t("trials:trialCfg:button:confirm") }} + {{ $t('trials:trialCfg:button:confirm') }} - {{ $t("trials:trialCfg:button:update") }} + {{ $t('trials:trialCfg:button:update') }} - {{ $t("trials:trialCfg:button:updateAndConfirm") }} + {{ $t('trials:trialCfg:button:updateAndConfirm') }} - {{ $t("common:button:cancel") }} + {{ $t('common:button:cancel') }} @@ -310,7 +310,7 @@ :loading="btnLoading" @click="handleConfirmConfigData" > - {{ $t("trials:trialCfg:button:confirmCfg") }} + {{ $t('trials:trialCfg:button:confirmCfg') }} @@ -367,7 +367,7 @@ :loading="btnLoading" @click="handleUpdateConfigData" > - {{ $t("trials:trialCfg:button:confirmCfg") }} + {{ $t('trials:trialCfg:button:confirmCfg') }} @@ -381,9 +381,9 @@ custom-class="base-dialog-wrapper" >
- {{ $t("common:dialogTitle:sign") }} + {{ $t('common:dialogTitle:sign') }} {{ - `(${$t("common:label:sign")}${currentUser})` + `(${$t('common:label:sign')}${currentUser})` }}
- {{ $t("common:button:new") }} + {{ $t('common:button:new') }} - {{ $t("common:button:cancel") }} + {{ $t('common:button:cancel') }} - {{ $t("common:button:confirm") }} + {{ $t('common:button:confirm') }} @@ -557,7 +557,7 @@ @click="addBodyPart_model.visible = true" style="position: absolute; top: 10px; right: 10px; z-index: 9" > - {{ $t("common:button:add") }} + {{ $t('common:button:add') }} - {{ $t("common:button:cancel") }} + {{ $t('common:button:cancel') }} - {{ $t("common:button:confirm") }} + {{ $t('common:button:confirm') }} @@ -673,7 +673,7 @@ :disabled="listLoading" @click="modalityListVisible = false" > - {{ $t("common:button:cancel") }} + {{ $t('common:button:cancel') }} - {{ $t("common:button:confirm") }} + {{ $t('common:button:confirm') }} @@ -701,7 +701,7 @@ label-width="150px" > @@ -741,38 +741,38 @@ import { getTrialClinicalDataTrialSetList, deleteClinicalTrialSetData, DownloadTrialClinicalFile, -} from "@/api/trials"; +} from '@/api/trials' import { ConfigTrialBasicInfoConfirm, getTrialBodyPartList, addOrUpdateTrialBodyPart, -} from "@/api/trials/setting"; -import SignForm from "@/views/trials/components/newSignForm"; -import ClinicalDataForm from "./clinicalDataForm"; -import const_ from "@/const/sign-code"; -import BaseModel from "@/components/BaseModel"; +} from '@/api/trials/setting' +import SignForm from '@/views/trials/components/newSignForm' +import ClinicalDataForm from './clinicalDataForm' +import const_ from '@/const/sign-code' +import BaseModel from '@/components/BaseModel' export default { - name: "LogicalConfig", + name: 'LogicalConfig', components: { SignForm, ClinicalDataForm, BaseModel }, data() { return { form: { - TrialId: "", + TrialId: '', IsNoticeSubjectCodeRule: false, - SubjectCodeRule: "", + SubjectCodeRule: '', IsSubjectSecondCodeView: false, IsVerifyVisitImageDate: false, IsHaveFirstGiveMedicineDate: true, IsHaveSubjectAge: false, IsSubjectSexView: false, - OutEnrollmentVisitName: "EOT", + OutEnrollmentVisitName: 'EOT', // ClinicalInformationTransmissionEnum: 1, IsImageReplicationAcrossTrial: false, - BodyPartTypes: "", + BodyPartTypes: '', BodyPartTypeList: [], - Modalitys: "", + Modalitys: '', ModalityList: [], - ModalityListStr: "", + ModalityListStr: '', ChangeDefalutDays: 5, IsTrialBasicLogicConfirmed: false, // ClinicalDataSetNames: [], @@ -783,58 +783,58 @@ export default { IsNoticeSubjectCodeRule: [ { required: true, - message: this.$t("common:ruleMessage:select"), - trigger: "blur", + message: this.$t('common:ruleMessage:select'), + trigger: 'blur', }, ], SubjectCodeRule: [ { required: true, - message: this.$t("common:ruleMessage:specify"), - trigger: "blur", + message: this.$t('common:ruleMessage:specify'), + trigger: 'blur', }, { max: 250, - message: `${this.$t("common:ruleMessage:maxLength")} 250`, + message: `${this.$t('common:ruleMessage:maxLength')} 250`, }, ], IsSubjectSecondCodeView: [ { required: true, - message: this.$t("common:ruleMessage:select"), - trigger: "blur", + message: this.$t('common:ruleMessage:select'), + trigger: 'blur', }, ], IsVerifyVisitImageDate: [ { required: true, - message: this.$t("common:ruleMessage:select"), - trigger: "blur", + message: this.$t('common:ruleMessage:select'), + trigger: 'blur', }, ], IsHaveFirstGiveMedicineDate: [ { required: true, - message: this.$t("common:ruleMessage:select"), - trigger: "blur", + message: this.$t('common:ruleMessage:select'), + trigger: 'blur', }, ], OutEnrollmentVisitName: [ { required: true, - message: this.$t("common:ruleMessage:specify"), - trigger: "blur", + message: this.$t('common:ruleMessage:specify'), + trigger: 'blur', }, { max: 250, - message: `${this.$t("common:ruleMessage:maxLength")} 50`, + message: `${this.$t('common:ruleMessage:maxLength')} 50`, }, ], BodyPartTypes: [ { required: true, - message: this.$t("trials:trialCfg:formRule:bodyPart"), - trigger: "blur", + message: this.$t('trials:trialCfg:formRule:bodyPart'), + trigger: 'blur', }, ], // Modalitys: [ @@ -844,8 +844,8 @@ export default { ModalityListStr: [ { required: true, - message: this.$t("trials:trialCfg:formRule:modality"), - trigger: "blur", + message: this.$t('trials:trialCfg:formRule:modality'), + trigger: 'blur', }, ], // ClinicalDataSetNamesStr: [ @@ -861,14 +861,14 @@ export default { btnLoading: false, confirmData: [], loading: false, - signText: "", - signCode: "", - currentUser: zzSessionStorage.getItem("userName"), + signText: '', + signCode: '', + currentUser: zzSessionStorage.getItem('userName'), initialForm: {}, isEdit: false, clinicalDataList: [], clinicalDataVisible: false, - addOrEditCD: { visible: false, title: "" }, + addOrEditCD: { visible: false, title: '' }, currentRow: {}, selectClinicalDataArr: [], selectedCD: [], @@ -880,8 +880,8 @@ export default { trialBodyPartList: [], addBodyPart_model: { visible: false, - title: this.$t("trials:setting:button:add"), - width: "500px", + title: this.$t('trials:setting:button:add'), + width: '500px', appendToBody: true, }, addBodyPartForm: { @@ -892,24 +892,24 @@ export default { bodyPartStr: [ { required: true, - message: this.$t("trials:setting:format:notBodyPart"), - trigger: ["blur", "change"], + message: this.$t('trials:setting:format:notBodyPart'), + trigger: ['blur', 'change'], }, { validator: (rule, value, callback) => { let flag = this.trialBodyPartList.some( (item) => item.Name === value - ); + ) if (flag) { callback( - new Error(this.$t("trials:setting:format:hasBodyPart")) - ); + new Error(this.$t('trials:setting:format:hasBodyPart')) + ) } else { - callback(); + callback() } }, - message: this.$t("trials:setting:format:hasBodyPart"), - trigger: ["blur", "change"], + message: this.$t('trials:setting:format:hasBodyPart'), + trigger: ['blur', 'change'], }, ], }, @@ -918,12 +918,12 @@ export default { renderFunc(h, option) { return ( - {option.label} -{" "} + {option.label} -{' '} {option.raw.Description} - ); + ) }, - }; + } }, // created() { // this.getTrialBodyPartList(); @@ -931,325 +931,323 @@ export default { methods: { // 取消配置更新 confirmCancel() { - this.isEdit = false; - this.form = { ...this.initialForm }; + this.isEdit = false + this.form = { ...this.initialForm } }, handleConfirmModality() { this.form.ModalityList = Object.assign( [], this.selectedList.map((v) => v) - ); + ) let Modalitys = this.form.ModalityList.map((item) => { - return this.$fd("Modality", item.trim()); - }); - this.form.ModalityListStr = Modalitys.toString().replaceAll(",", " | "); - this.modalityListVisible = false; + return this.$fd('Modality', item.trim()) + }) + this.form.ModalityListStr = Modalitys.toString().replaceAll(',', ' | ') + this.modalityListVisible = false }, handleSelectionChange(val) { - this.selectedList = val; + this.selectedList = val }, toggleSelection(rows) { if (rows) { rows.forEach((row) => { - this.$refs.multipleTable.toggleRowSelection(row); - }); + this.$refs.multipleTable.toggleRowSelection(row) + }) } else { - this.$refs.multipleTable.clearSelection(); + this.$refs.multipleTable.clearSelection() } }, filterMethod(query, item) { - return item.value.toLowerCase().indexOf(query.toLowerCase()) > -1; + return item.value.toLowerCase().indexOf(query.toLowerCase()) > -1 }, handleSetModality() { - this.modalityListVisible = true; + this.modalityListVisible = true var a = this.$d.Modality.filter((v) => { return !!this.form.ModalityList.find((v1) => { - return v1 === v.value; - }); - }); - this.selectedList = a.map((item) => item.value); + return v1 === v.value + }) + }) + this.selectedList = a.map((item) => item.value) }, handleBodyPartSelectionChange(val) { - this.selectedBodyParts = val; + this.selectedBodyParts = val }, // 获取检查部位 async getTrialBodyPartList(data) { try { let params = { TrialId: this.$route.query.trialId, - }; - let res = await getTrialBodyPartList(params); + } + let res = await getTrialBodyPartList(params) if (res.IsSuccess) { - this.trialBodyPartList = res.Result; + this.trialBodyPartList = res.Result if (data) { if (this.$refs.bodyPartTable) { this.$nextTick(() => { let obj = this.trialBodyPartList.filter( (item) => item.Code === data.Code - ); - if(obj[0]){ - this.$refs.bodyPartTable.toggleRowSelection(obj[0]); + ) + if (obj[0]) { + this.$refs.bodyPartTable.toggleRowSelection(obj[0]) } - }); + }) var bodyPartTypes = this.form.BodyPartTypeList.map((i) => { - return this.changeBodyPart(i.trim()); - }); + return this.changeBodyPart(i.trim()) + }) this.form.BodyPartTypes = bodyPartTypes .toString() - .replaceAll(",", " | "); + .replaceAll(',', ' | ') } } - return true; + return true } - return false; + return false } catch (err) { - console.log(err); - return false; + console.log(err) + return false } }, // 添加检查部位 async addOrUpdateTrialBodyPart() { try { - this.errMessage = null; - let validate = await this.$refs.addBodyPartForm.validate(); - if (!validate) return; - let str = this.addBodyPartForm.bodyPartStr; + this.errMessage = null + let validate = await this.$refs.addBodyPartForm.validate() + if (!validate) return + let str = this.addBodyPartForm.bodyPartStr let data = { Code: str, Name: str, NameCN: str, TrialId: this.$route.query.trialId, - }; - if (this.addBodyPartForm.Id) { - data.Id = this.addBodyPartForm.Id; - data.Code = this.addBodyPartForm.Code; } - let res = await addOrUpdateTrialBodyPart(data); + if (this.addBodyPartForm.Id) { + data.Id = this.addBodyPartForm.Id + data.Code = this.addBodyPartForm.Code + } + let res = await addOrUpdateTrialBodyPart(data) if (res.IsSuccess) { - this.getTrialBodyPartList(data); + this.getTrialBodyPartList(data) this.$message.success( - this.$t("trials:seeting:message:addBodyPartSuccess") - ); - this.addBodyPart_model.visible = false; - this.addBodyPartForm.bodyPartStr = null; - this.addBodyPartForm.Id = null; + this.$t('trials:seeting:message:addBodyPartSuccess') + ) + this.addBodyPart_model.visible = false + this.addBodyPartForm.bodyPartStr = null + this.addBodyPartForm.Id = null } } catch (err) { - console.log(err); + console.log(err) if (err.Code === 5) { - this.getTrialBodyPartList(); - this.errMessage = err.ErrorMessage; + this.getTrialBodyPartList() + this.errMessage = err.ErrorMessage } } }, // 编辑检查部位 handleEditBodyPart(item) { - this.addBodyPartForm.bodyPartStr = item.Name; - this.addBodyPartForm.Code = item.Code; - this.addBodyPartForm.Id = item.Id; - this.addBodyPart_model.title = this.$t("trials:setting:button:edit"); - this.addBodyPart_model.visible = true; + this.addBodyPartForm.bodyPartStr = item.Name + this.addBodyPartForm.Code = item.Code + this.addBodyPartForm.Id = item.Id + this.addBodyPart_model.title = this.$t('trials:setting:button:edit') + this.addBodyPart_model.visible = true }, handleSetBodyPart() { - this.bodyPartListVisible = true; + this.bodyPartListVisible = true this.$nextTick(() => { var a = this.trialBodyPartList.filter((v) => { return !!this.form.BodyPartTypeList.find((v1) => { - return v1 === v.Code; - }); - }); - this.toggleBodyPartSelection(a); - }); + return v1 === v.Code + }) + }) + this.toggleBodyPartSelection(a) + }) }, toggleBodyPartSelection(rows) { if (rows) { rows.forEach((row) => { - this.$refs.bodyPartTable.toggleRowSelection(row); - }); + this.$refs.bodyPartTable.toggleRowSelection(row) + }) } else { - this.$refs.bodyPartTable.clearSelection(); + this.$refs.bodyPartTable.clearSelection() } }, handleConfirmBodyParts() { this.form.BodyPartTypeList = Object.assign( [], this.selectedBodyParts.map((v) => v.Code) - ); + ) var bodyPartTypes = this.form.BodyPartTypeList.map((i) => { - return this.changeBodyPart(i.trim()); - }); - this.form.BodyPartTypes = bodyPartTypes.join(" | "); - this.bodyPartListVisible = false; + return this.changeBodyPart(i.trim()) + }) + this.form.BodyPartTypes = bodyPartTypes.join(' | ') + this.bodyPartListVisible = false }, // 配置信息保存 handleSave() { - this.$refs["logicalConfigForm"].validate((valid) => { - if (!valid) return; - this.loading = true; + this.$refs['logicalConfigForm'].validate((valid) => { + if (!valid) return + this.loading = true // 保存配置信息 - var params = Object.assign({}, this.form); + var params = Object.assign({}, this.form) params.BodyPartTypes = this.form.BodyPartTypeList.toString().replaceAll( - ",", - "|" - ); + ',', + '|' + ) configTrialBasicInfo(params) .then((res) => { - this.loading = false; + this.loading = false if (res.IsSuccess) { - this.$message.success( - this.$t("common:message:savedSuccessfully") - ); - this.initialForm = { ...this.form }; + this.$message.success(this.$t('common:message:savedSuccessfully')) + this.initialForm = { ...this.form } } }) .catch((_) => { - this.loading = false; - }); - }); + this.loading = false + }) + }) }, // 打开配置信息确认框 handleConfirm() { - this.$refs["logicalConfigForm"].validate((valid) => { - if (!valid) return; - this.getConfigArr(); - this.confirmVisible = true; - }); + this.$refs['logicalConfigForm'].validate((valid) => { + if (!valid) return + this.getConfigArr() + this.confirmVisible = true + }) }, // 打开配置信息更新框 handleUpdate() { - this.$refs["logicalConfigForm"].validate((valid) => { - if (!valid) return; - this.getConfigArr(); - this.updateVisible = true; - }); + this.$refs['logicalConfigForm'].validate((valid) => { + if (!valid) return + this.getConfigArr() + this.updateVisible = true + }) }, // 配置确认签名 handleConfirmConfigData() { - const { LogicalConfigConfirmation } = const_.processSignature; - this.signCode = LogicalConfigConfirmation; + const { LogicalConfigConfirmation } = const_.processSignature + this.signCode = LogicalConfigConfirmation // this.confirmConfigData() - this.initialForm = { ...this.form }; - this.signVisible = true; + this.initialForm = { ...this.form } + this.signVisible = true }, // 配置更新签名 handleUpdateConfigData() { - const { LogicalConfigUpdates } = const_.processSignature; - this.signCode = LogicalConfigUpdates; - this.initialForm = { ...this.form }; - this.signVisible = true; + const { LogicalConfigUpdates } = const_.processSignature + this.signCode = LogicalConfigUpdates + this.initialForm = { ...this.form } + this.signVisible = true }, // 配置确认(废除) confirmConfigData() { - this.$refs["logicalConfigForm"].validate((valid) => { - if (!valid) return; - this.btnLoading = true; + this.$refs['logicalConfigForm'].validate((valid) => { + if (!valid) return + this.btnLoading = true // 保存配置信息 - var params = Object.assign({}, this.form); + var params = Object.assign({}, this.form) params.BodyPartTypes = this.form.BodyPartTypeList.toString().replaceAll( - ",", - " | " - ); + ',', + ' | ' + ) configTrialBasicInfo(params) .then((res) => { - this.btnLoading = false; + this.btnLoading = false if (res.IsSuccess) { - this.initialForm = { ...this.form }; - this.signVisible = true; + this.initialForm = { ...this.form } + this.signVisible = true } }) .catch((_) => { - this.btnLoading = false; - }); - }); + this.btnLoading = false + }) + }) }, // 关闭签名框 closeSignDialog(isSign, signInfo) { if (isSign) { - this.signConfirm(signInfo); + this.signConfirm(signInfo) } else { - this.signVisible = false; + this.signVisible = false } }, // 签名并确认 signConfirm(signInfo) { - this.loading = true; - var obj = Object.assign({}, this.form); + this.loading = true + var obj = Object.assign({}, this.form) obj.BodyPartTypes = this.form.BodyPartTypeList.toString().replaceAll( - ",", - "|" - ); + ',', + '|' + ) const params = { data: obj, signInfo: signInfo, - }; + } // 保存并签名确认 ConfigTrialBasicInfoConfirm(params) .then((res) => { - this.loading = false; + this.loading = false if (res.IsSuccess) { - this.$message.success(this.$t("common:message:savedSuccessfully")); - this.form.IsTrialBasicLogicConfirmed = true; - this.isEdit = false; - this.$refs["signForm"].btnLoading = false; - this.signVisible = false; - this.updateVisible = false; - this.confirmVisible = false; - this.$emit("refresh"); + this.$message.success(this.$t('common:message:savedSuccessfully')) + this.form.IsTrialBasicLogicConfirmed = true + this.isEdit = false + this.$refs['signForm'].btnLoading = false + this.signVisible = false + this.updateVisible = false + this.confirmVisible = false + this.$emit('refresh') } }) .catch((_) => { - this.loading = false; - this.$refs["signForm"].btnLoading = false; - }); + this.loading = false + this.$refs['signForm'].btnLoading = false + }) }, // 配置信息数组结构 getConfigArr() { this.confirmData = [ { - Name: this.$t("trials:logincCfg:form:subjectNumberRule"), - NewVal: this.$fd("YesOrNo", this.form.IsNoticeSubjectCodeRule), - OldVal: this.$fd("YesOrNo", this.initialForm.IsNoticeSubjectCodeRule), + Name: this.$t('trials:logincCfg:form:subjectNumberRule'), + NewVal: this.$fd('YesOrNo', this.form.IsNoticeSubjectCodeRule), + OldVal: this.$fd('YesOrNo', this.initialForm.IsNoticeSubjectCodeRule), }, { - Name: this.$t("trials:logincCfg:form:subjectNumFormat"), + Name: this.$t('trials:logincCfg:form:subjectNumFormat'), NewVal: this.form.SubjectCodeRule, OldVal: this.initialForm.SubjectCodeRule, }, { - Name: this.$t("trials:logincCfg:form:subjectNum2"), - NewVal: this.$fd("YesOrNo", this.initialForm.IsSubjectSecondCodeView), - OldVal: this.$fd("YesOrNo", this.initialForm.IsSubjectSecondCodeView), + Name: this.$t('trials:logincCfg:form:subjectNum2'), + NewVal: this.$fd('YesOrNo', this.initialForm.IsSubjectSecondCodeView), + OldVal: this.$fd('YesOrNo', this.initialForm.IsSubjectSecondCodeView), }, { - Name: this.$t("trials:logincCfg:form:scanDateVerify"), - NewVal: this.$fd("YesOrNo", this.form.IsVerifyVisitImageDate), - OldVal: this.$fd("YesOrNo", this.initialForm.IsVerifyVisitImageDate), + Name: this.$t('trials:logincCfg:form:scanDateVerify'), + NewVal: this.$fd('YesOrNo', this.form.IsVerifyVisitImageDate), + OldVal: this.$fd('YesOrNo', this.initialForm.IsVerifyVisitImageDate), }, { - Name: this.$t("trials:logincCfg:form:visitBaseDate"), - NewVal: this.$fd("YesOrNo", this.form.IsHaveFirstGiveMedicineDate), + Name: this.$t('trials:logincCfg:form:visitBaseDate'), + NewVal: this.$fd('YesOrNo', this.form.IsHaveFirstGiveMedicineDate), OldVal: this.$fd( - "YesOrNo", + 'YesOrNo', this.initialForm.IsHaveFirstGiveMedicineDate ), }, { - Name: this.$t("trials:logincCfg:form:subjectAge"), - NewVal: this.$fd("YesOrNo", this.form.IsHaveSubjectAge), - OldVal: this.$fd("YesOrNo", this.initialForm.IsHaveSubjectAge), + Name: this.$t('trials:logincCfg:form:subjectAge'), + NewVal: this.$fd('YesOrNo', this.form.IsHaveSubjectAge), + OldVal: this.$fd('YesOrNo', this.initialForm.IsHaveSubjectAge), }, { - Name: this.$t("trials:logincCfg:form:subjectGender"), - NewVal: this.$fd("YesOrNo", this.form.IsSubjectSexView), - OldVal: this.$fd("YesOrNo", this.initialForm.IsSubjectSexView), + Name: this.$t('trials:logincCfg:form:subjectGender'), + NewVal: this.$fd('YesOrNo', this.form.IsSubjectSexView), + OldVal: this.$fd('YesOrNo', this.initialForm.IsSubjectSexView), }, { - Name: this.$t("trials:logincCfg:form:lastVisitName"), + Name: this.$t('trials:logincCfg:form:lastVisitName'), NewVal: this.form.OutEnrollmentVisitName, OldVal: this.initialForm.OutEnrollmentVisitName, }, @@ -1259,25 +1257,25 @@ export default { // OldVal: this.$fd('ClinicalInformationTransmissionEnum', this.initialForm.ClinicalInformationTransmissionEnum) // }, { - Name: this.$t("trials:logincCfg:form:imageCopy"), - NewVal: this.$fd("YesOrNo", this.form.IsImageReplicationAcrossTrial), + Name: this.$t('trials:logincCfg:form:imageCopy'), + NewVal: this.$fd('YesOrNo', this.form.IsImageReplicationAcrossTrial), OldVal: this.$fd( - "YesOrNo", + 'YesOrNo', this.initialForm.IsImageReplicationAcrossTrial ), }, { - Name: this.$t("trials:logincCfg:form:bodypart"), + Name: this.$t('trials:logincCfg:form:bodypart'), NewVal: this.form.BodyPartTypes, OldVal: this.initialForm.BodyPartTypes, }, { - Name: this.$t("trials:logincCfg:form:modality"), + Name: this.$t('trials:logincCfg:form:modality'), NewVal: this.form.ModalityListStr, OldVal: this.initialForm.ModalityListStr, }, { - Name: this.$t("trials:logincCfg:form:exceededDays"), + Name: this.$t('trials:logincCfg:form:exceededDays'), NewVal: this.form.ChangeDefalutDays, OldVal: this.initialForm.ChangeDefalutDays, }, @@ -1286,64 +1284,64 @@ export default { // NewVal: this.form.ClinicalDataSetNames.join(', '), // OldVal: this.initialForm.ClinicalDataSetNames.join(', ') // } - ]; + ] }, // 筛选号规则提醒 subjectCodeRuleChange(val) { if (!val) { - this.form.SubjectCodeRule = ""; + this.form.SubjectCodeRule = '' } }, // 初始化表单 async initForm(res) { - this.form.TrialId = res.TrialId; - this.loading = true; + this.form.TrialId = res.TrialId + this.loading = true for (const k in this.form) { if (res.hasOwnProperty(k)) { - this.form[k] = res[k]; + this.form[k] = res[k] } } let Modalitys = this.form.ModalityList.map((item) => { - return this.$fd("Modality", item.trim()); - }); - this.form.ModalityListStr = Modalitys.toString().replaceAll(",", " | "); + return this.$fd('Modality', item.trim()) + }) + this.form.ModalityListStr = Modalitys.toString().replaceAll(',', ' | ') // this.form.ModalityListStr = this.form.ModalityList.toString().replaceAll( // ",", // " | " // ); - let BodyPartTypes = res.BodyPartTypes; - this.form.BodyPartTypes = ""; - this.form.BodyPartTypeList = BodyPartTypes.split("|"); - let r = await this.getTrialBodyPartList(); + let BodyPartTypes = res.BodyPartTypes + this.form.BodyPartTypes = '' + this.form.BodyPartTypeList = BodyPartTypes.split('|') + let r = await this.getTrialBodyPartList() if (r) { var bodyPartTypes = this.form.BodyPartTypeList.map((i) => { - return this.changeBodyPart(i.trim()); - }); + return this.changeBodyPart(i.trim()) + }) this.form.BodyPartTypes = bodyPartTypes .toString() - .replaceAll(",", " | "); + .replaceAll(',', ' | ') // this.form.ClinicalDataSetNamesStr = this.form.ClinicalDataSetNames.join(', ') - this.initialForm = { ...this.form }; - this.loading = false; + this.initialForm = { ...this.form } + this.loading = false } }, // bodyPart中英文转换 changeBodyPart(code) { - let arr = this.trialBodyPartList.filter((item) => item.Code === code); + let arr = this.trialBodyPartList.filter((item) => item.Code === code) if (arr[0]) { - return arr[0].Name; + return arr[0].Name } else { - return null; + return null } }, // 获取临床数据模板信息 getClinicalDataList(isSelect = false) { return new Promise((resolve, reject) => { - this.listLoading = true; + this.listLoading = true getTrialClinicalDataTrialSetList({ trialId: this.form.TrialId }) .then((res) => { - this.clinicalDataList = res.Result; - this.listLoading = false; + this.clinicalDataList = res.Result + this.listLoading = false if (isSelect) { this.$nextTick(() => { for ( @@ -1353,127 +1351,125 @@ export default { ) { var index = this.clinicalDataList.findIndex( (item) => item.Id === this.form.ClinicalDataTrialSetIds[i] - ); + ) if (index > -1) { - this.$refs["clinicalData"].toggleRowSelection( + this.$refs['clinicalData'].toggleRowSelection( this.clinicalDataList[index], true - ); + ) } } - }); + }) } - resolve(); + resolve() }) .catch(() => { - this.listLoading = false; - reject(); - }); - }); + this.listLoading = false + reject() + }) + }) }, // 获取勾选行数据 handleSelectChange(val) { - const arr = []; - this.selectedCD = []; + const arr = [] + this.selectedCD = [] for (let index = 0; index < val.length; index++) { - arr.push(val[index].Id); - this.selectedCD.push(val[index].ClinicalDataSetName); + arr.push(val[index].Id) + this.selectedCD.push(val[index].ClinicalDataSetName) } - this.selectClinicalDataArr = arr; + this.selectClinicalDataArr = arr }, handleConfirmClinicalData() { - this.form.ClinicalDataSetNames = this.selectedCD; - this.form.ClinicalDataTrialSetIds = this.selectClinicalDataArr; + this.form.ClinicalDataSetNames = this.selectedCD + this.form.ClinicalDataTrialSetIds = this.selectClinicalDataArr this.form.ClinicalDataSetNamesStr = - this.form.ClinicalDataSetNames.join(", "); - this.clinicalDataVisible = false; + this.form.ClinicalDataSetNames.join(', ') + this.clinicalDataVisible = false }, handleSetCD() { - this.clinicalDataVisible = true; + this.clinicalDataVisible = true this.$nextTick(() => { for (let i = 0; i < this.form.ClinicalDataTrialSetIds.length; i++) { var index = this.clinicalDataList.findIndex( (item) => item.Id === this.form.ClinicalDataTrialSetIds[i] - ); + ) if (index > -1) { - this.$refs["clinicalData"].toggleRowSelection( + this.$refs['clinicalData'].toggleRowSelection( this.clinicalDataList[index], true - ); + ) } } - }); + }) }, handleAddClinicalData() { - this.currentRow = {}; - this.addOrEditCD.title = "新增"; - this.addOrEditCD.visible = true; + this.currentRow = {} + this.addOrEditCD.title = '新增' + this.addOrEditCD.visible = true }, handleEditClinicalData(row) { - this.currentRow = { ...row }; - this.addOrEditCD.title = "编辑"; - this.addOrEditCD.visible = true; + this.currentRow = { ...row } + this.addOrEditCD.title = '编辑' + this.addOrEditCD.visible = true }, handleDeleteClinicalData(row) { - this.$confirm(this.$t("trials:staffResearch:message:confirmDel"), { - type: "warning", + this.$confirm(this.$t('trials:staffResearch:message:confirmDel'), { + type: 'warning', distinguishCancelAndClose: true, }).then(() => { - this.loading = true; + this.loading = true deleteClinicalTrialSetData(row.Id) .then((res) => { - this.loading = false; + this.loading = false if (res.IsSuccess) { - var cdNameIndex = this.selectedCD.indexOf( - row.ClinicalDataSetName - ); + var cdNameIndex = this.selectedCD.indexOf(row.ClinicalDataSetName) if (cdNameIndex > -1) { - this.selectedCD.splice(cdNameIndex, 1); + this.selectedCD.splice(cdNameIndex, 1) } - var cdIdIndex = this.selectClinicalDataArr.indexOf(row.Id); + var cdIdIndex = this.selectClinicalDataArr.indexOf(row.Id) if (cdIdIndex > -1) { - this.selectClinicalDataArr.splice(cdIdIndex, 1); + this.selectClinicalDataArr.splice(cdIdIndex, 1) } - var index = this.form.ClinicalDataTrialSetIds.indexOf(row.Id); + var index = this.form.ClinicalDataTrialSetIds.indexOf(row.Id) if (index > -1) { - this.form.ClinicalDataTrialSetIds.splice(index, 1); + this.form.ClinicalDataTrialSetIds.splice(index, 1) } var i = this.form.ClinicalDataSetNames.indexOf( row.ClinicalDataSetName - ); + ) if (i > -1) { - this.form.ClinicalDataSetNames.splice(i, 1); + this.form.ClinicalDataSetNames.splice(i, 1) this.form.ClinicalDataSetNamesStr = - this.form.ClinicalDataSetNames.join(", "); + this.form.ClinicalDataSetNames.join(', ') } - this.getClinicalDataList(true); - this.$message.success("删除成功!"); + this.getClinicalDataList(true) + this.$message.success('删除成功!') } }) .catch(() => { - this.loading = false; - }); - }); + this.loading = false + }) + }) }, handleDownloadTpl(row) { - this.listLoading = true; + this.listLoading = true DownloadTrialClinicalFile(row.Id) .then((data) => { - this.listLoading = false; + this.listLoading = false }) .catch(() => { - this.listLoading = false; - }); + this.listLoading = false + }) }, handleSelectable(row) { if (!row.IsUsed) { - return true; + return true } else { - return false; + return false } }, }, -}; +}