添加项目接口对接

main
wangxiaoshuang 2024-03-26 16:31:27 +08:00
parent c7575b7048
commit 20cbde0348
3 changed files with 211 additions and 46 deletions

View File

@ -81,21 +81,18 @@
<el-button
size="mini"
type="text"
icon="el-icon-edit-outline"
@click="openDialog('edit', scope.row)"
>编辑</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-edit-outline"
@click="delAE(scope.row)"
>删除</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-edit-outline"
@click="test(scope.row)"
>测试</el-button
>

View File

@ -9,10 +9,11 @@
<span slot="title"
>{{ $t("trials:inspection:button:addTrials") }}{{
$t("trials:uploadDicomList:table:patientInfo")
}}T0001132ZhangSan</span
}}{{ Patient.PatientIdStr }}{{ Patient.PatientName }}</span
>
<div class="top">
<el-form
ref="submitMessageForm"
:inline="true"
:model="submitMessage"
class="demo-form-inline"
@ -21,9 +22,23 @@
<!--受试者编号-->
<el-form-item
:label="$t('trials:crcQuestion:table:subjectId')"
prop="subjectId"
prop="SubjectId"
>
<el-input v-model="submitMessage.subjectId"></el-input>
<el-select
v-model="submitMessage.SubjectId"
filterable
allow-create
default-first-option
clearable
>
<el-option
v-for="item in subjectIdList"
:key="item.SubejctId"
:label="item.SubjectCode"
:value="item.SubejctId"
>
</el-option>
</el-select>
</el-form-item>
</el-form>
</div>
@ -31,33 +46,45 @@
<p>{{ $t("trials:inspection:message:checkAddTrials") }}</p>
<div class="form">
<el-form :inline="true" class="base-search-form">
<!-- 项目类型 -->
<el-form-item
class="my_multiple"
:label="$t('trials:trials-list:form:trialType')"
>
<el-select
v-model="searchData.TrialType"
clearable
style="width: 140px"
>
<el-option
v-for="item of $d.TrialType"
:key="item.id"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
<!-- 研究方案编号 -->
<el-form-item :label="$t('trials:trials-list:table:researchNumber')">
<el-input v-model="searchData.SubjectInfo" style="width: 100px" />
<el-input
v-model="searchData.ResearchProgramNo"
style="width: 100px"
/>
</el-form-item>
<!-- 研究名称 -->
<el-form-item :label="$t('trials:trials-list:table:researchName')">
<el-input v-model="searchData.SubjectInfo" style="width: 100px" />
<el-input
v-model="searchData.ExperimentName"
style="width: 100px"
/>
</el-form-item>
<!-- 申办方 -->
<el-form-item
class="my_multiple"
:label="$t('trials:trials-list:table:sponsor')"
>
<el-select
v-model="searchData.VisitPlanArray"
clearable
multiple
style="width: 140px"
>
<el-option
v-for="(item, index) of sponsorList"
:key="index"
:label="item.VisitName"
:value="item.VisitNum"
>
</el-option>
</el-select>
<el-input v-model="searchData.SponsorName" style="width: 100px" />
</el-form-item>
<el-form-item>
<!-- 查询 -->
@ -78,7 +105,7 @@
</el-button>
</el-form-item>
</el-form>
<el-button type="primary" @click="addTrials">
<el-button type="primary" @click="addTrials" :loading="btnLoading">
{{ $t("trials:addRP:button:confirmAddPR") }}
</el-button>
</div>
@ -94,19 +121,34 @@
height="100"
@selection-change="handleSelectChange"
>
<el-table-column type="selection" align="center" width="45" />
<el-table-column
type="selection"
align="center"
width="45"
:selectable="
(row, index) =>
!tableSelectData.trialId || tableSelectData.trialId === row.trialId
"
/>
<!--项目类型-->
<el-table-column
align="center"
prop="IsUrgent"
prop="TrialType"
:label="$t('trials:trials-list:form:trialType')"
show-overflow-tooltip
min-width="140"
></el-table-column>
>
<template slot-scope="scope">
<span>{{
$d.TrialType.filter((item) => item.value == scope.row.TrialType)[0]
.label
}}</span>
</template>
</el-table-column>
<!--研究方案号-->
<el-table-column
align="center"
prop="IsUrgent"
prop="ResearchProgramNo"
:label="$t('trials:trials-list:table:researchNumber')"
show-overflow-tooltip
min-width="140"
@ -114,7 +156,7 @@
<!--研究名称-->
<el-table-column
align="center"
prop="IsUrgent"
prop="ExperimentName"
:label="$t('trials:trials-list:table:researchName')"
show-overflow-tooltip
min-width="140"
@ -122,7 +164,7 @@
<!--申办方-->
<el-table-column
align="center"
prop="IsUrgent"
prop="SponsorName"
:label="$t('trials:trials-list:table:sponsor')"
show-overflow-tooltip
min-width="140"
@ -130,7 +172,7 @@
<!--状态-->
<el-table-column
align="center"
prop="IsUrgent"
prop="TrialStatusStr"
:label="$t('trials:trials-list:table:status')"
show-overflow-tooltip
min-width="140"
@ -138,7 +180,7 @@
<!--创建日期-->
<el-table-column
align="center"
prop="IsUrgent"
prop="CreateTime"
:label="$t('trials:trials-list:table:createDate')"
show-overflow-tooltip
min-width="140"
@ -157,6 +199,11 @@
</template>
<script>
import Pagination from "@/components/Pagination";
import {
getPatientJoinTrialInitList,
getTrialSubejctSelectList,
addSubjectPatientBinding,
} from "@/api/inspection.js";
export default {
name: "addTrialsList",
components: { Pagination },
@ -165,47 +212,161 @@ export default {
require: true,
default: false,
},
Patient: {
require: true,
default: () => {
return {};
},
},
},
data() {
return {
//
searchData: {},
sponsorList: [],
searchData: {
ExperimentName: null, //
ResearchProgramNo: null, //
TrialType: null, //
SponsorName: null, //
Asc: true,
SortField: null,
PageIndex: 1,
PageSize: 10,
},
//
total: 0,
loading: false,
list: [{ key: 1, IsUrgent: "123" }],
list: [],
//
submitMessage: {},
btnLoading: false,
tableSelectData: {}, //
submitMessage: {
SubjectId: null,
},
subjectIdList: [], //
rules: {
subjectId: [
SubjectId: [
{
required: true,
message: this.$t("common:ruleMessage:specify"),
trigger: "blur",
message: this.$t("trials:inscept:rules:selectOrInputSubject"),
trigger: "change",
},
],
},
};
},
watch: {
visible() {
if (this.visible) {
this.getList();
}
},
"tableSelectData.TrialId": {
handler() {
if (tableSelectData.TrialId) {
this.getTrialSubejctSelectList();
}
},
},
},
methods: {
//
async getTrialSubejctSelectList(id) {
let data = {
TrialId: id,
};
try {
let res = await getTrialSubejctSelectList(data);
if (res.IsSuccess) {
this.subjectIdList = res.Result;
}
} catch (err) {
console.log(err);
}
},
//
beforeCloseStudyDig() {
this.$emit("update:visible", false);
},
//
addTrials() {
this.$emit("update:visible", false);
this.$emit("handleOpenDialog", {}, "confirm");
async addTrials() {
if (this.btnLoading) return;
try {
let validate = await this.$refs.submitMessageForm.validate();
if (!validate) return;
if (!this.tableSelectData.TrialId)
return this.$message.warning(
this.$t("trials:inspection:message:notJionTrial")
);
let data = {
TrialId: this.tableSelectData.TrialId,
PatientIdList: [this.Patient.PatientId],
};
if (this.submitMessage.SubjectId.length === 36) {
data.SubjectId = this.submitMessage.SubjectId;
} else {
data.SubjectCode = this.submitMessage.SubjectId;
}
this.btnLoading = true;
let res = await addSubjectPatientBinding(data);
this.btnLoading = false;
if (res.IsSuccess) {
let obj = JSON.parse(JSON.stringify(this.tableSelectData));
this.$emit("update:visible", false);
this.$emit("handleOpenDialog", obj, "confirm");
}
} catch (err) {
console.log(err);
}
},
//
getList() {},
async getList() {
let data = {};
Object.keys(this.searchData).forEach((key) => {
data[key] = this.searchData[key];
});
console.log(this.Patient);
data.PatientId = this.Patient.PatientId;
try {
this.loading = true;
let res = await getPatientJoinTrialInitList(data);
this.loading = false;
if (res.IsSuccess) {
this.list = res.Result.CurrentPageData;
this.total = res.Result.TotalCount;
}
} catch (err) {
console.log(err);
}
},
//
handleSearch() {},
handleSearch() {
this.getList();
},
//
handleReset() {},
handleReset() {
Object.keys(this.searchData).forEach((key) => {
this.searchData[key] = null;
});
this.searchData.PageIndex = 1;
this.searchData.PageSize = 10;
this.searchData.Asc = true;
this.$refs.addTrialsList.clearSort();
this.getList();
},
//
handleSelectChange() {},
handleSelectChange(selection) {
console.log(selection);
this.tableSelectData = selection[0];
if (!selection[0]) this.tableSelectData = {};
},
//
handleSortByColumn(sort) {
this.searchData.SortField = sort.prop;
if (sort.order === "ascending") this.searchData.Asc = true;
if (sort.order === "descending") this.searchData.Asc = false;
if (!sort.order) this.searchData.SortField = null;
this.getList();
},
},
};
</script>
@ -240,4 +401,11 @@ export default {
justify-content: space-between;
}
}
::v-deep .has-gutter {
.el-table-column--selection {
.el-checkbox {
display: none;
}
}
}
</style>

View File

@ -243,7 +243,7 @@ export default {
//
total: 0,
loading: false,
list: [{ key: 1, VisitName: "123" }],
list: [],
//
selectPatient: {},
//