wangxiaoshuang 2024-03-28 17:53:07 +08:00
parent 6c0423e659
commit 94f8461dfb
4 changed files with 461 additions and 379 deletions

View File

@ -80,171 +80,27 @@
</div>
</el-form>
</div>
<div class="search">
<p class="line">{{ $t("trials:inspection:message:confirmVisit") }}</p>
<div class="form">
<el-form :inline="true" class="base-search-form">
<!-- 检查日期 -->
<el-form-item :label="$t('trials:uploadedDicoms:table:studyDate')">
<el-date-picker
v-model="dateValue"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
>
</el-date-picker>
</el-form-item>
<el-form-item>
<!-- 查询 -->
<el-button
type="primary"
icon="el-icon-search"
@click="handleSearch"
>
{{ $t("common:button:search") }}
</el-button>
<!-- 重置 -->
<el-button
type="primary"
icon="el-icon-refresh-left"
@click="handleReset"
>
{{ $t("common:button:reset") }}
</el-button>
</el-form-item>
</el-form>
<div class="buttonBox" v-if="status === 'visit'">
<!--确认-->
<el-button
type="primary"
:loading="btnLoading2"
@click="confirm"
v-if="visitStatus === 'confirm'"
>
{{ $t("trials:seletctedReviews:timeline:confirmation") }}
</el-button>
<!--确认提交-->
<el-button
type="primary"
:loading="btnLoading2"
@click="confirmSubmit"
v-if="visitStatus === 'submit'"
>
{{ $t("trials:inspection:button:confirmAndSubmit") }}
</el-button>
</div>
</div>
</div>
<!--可加入项目列表-->
<!--:header-cell-style="{ background: '#f9f9f9' }"-->
<el-table
ref="confirmVisitList"
v-loading="loading"
v-adaptive="{ bottomOffset: 60 }"
:data="list"
stripe
height="100"
@selection-change="handleSelectChange"
@sort-change="handleSortByColumn"
:default-sort="{ prop: 'StudyTime', order: 'descending' }"
>
<el-table-column type="selection" align="center" width="45" />
<el-table-column type="index" width="40" />
<!--检查描述-->
<el-table-column
align="center"
prop="Description"
:label="$t('trials:inspection:table:studyDescription')"
show-overflow-tooltip
min-width="140"
></el-table-column>
<!--检查类型-->
<el-table-column
align="center"
prop="Modalities"
:label="$t('trials:audit:table:modality')"
show-overflow-tooltip
min-width="140"
></el-table-column>
<!--序列数-->
<el-table-column
align="center"
prop="SeriesCount"
:label="$t('trials:audit:table:seriesCount')"
show-overflow-tooltip
min-width="140"
></el-table-column>
<!--检查日期-->
<el-table-column
align="center"
prop="StudyTime"
:label="$t('trials:audit:table:studyDate')"
show-overflow-tooltip
min-width="140"
sortable="custom"
></el-table-column>
<!--操作-->
<el-table-column
:label="$t('common:action:action')"
width="300"
class-name="actionBox"
>
<template slot-scope="scope">
<!--切换访视-->
<el-select
v-model="scope.row.SubjectVisitId"
placeholder="请选择"
@visible-change="selectChange"
>
<el-option
v-for="item in visitList"
:key="item.SubjectVisitId"
:label="item.VisitName"
:value="item.SubjectVisitId"
/>
<p class="addVisit" @click.stop="addVisit">
<i class="el-icon-plus" v-loading="addLoading"></i>
</p>
</el-select>
<!-- 详情 -->
<el-button
type="text"
@click.stop="detail(scope.row)"
class="detail"
>{{ $t("trials:trials-list:action:panel") }}</el-button
>
</template>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination
class="page"
:total="total"
:page.sync="searchData.PageIndex"
:limit.sync="searchData.PageSize"
@pagination="getList"
<confirmTrialsList
ref="confirmVisit"
:Patient="Patient"
:submitMessage="submitMessage"
:status="status"
/>
</el-dialog>
</template>
<script>
import Pagination from "@/components/Pagination";
import trialsSelect from "./trials-select.vue";
import confirmTrialsList from "./confirm-visit-list.vue";
import {
getPatientJoinTrialInitSelectList,
getTrialSubejctSelectList,
addSubjectPatientBinding,
deleteSubjectPatientBinding,
getVisitPatientStudyList,
getSubjectVisitSelectList,
addOrUpdateSubjectVisit,
addSubjectPatientStudyBinding,
submitVisitStudyBinding,
} from "@/api/inspection.js";
export default {
name: "addTrialsList",
components: { Pagination, trialsSelect },
components: { Pagination, trialsSelect, confirmTrialsList },
props: {
visible: {
require: true,
@ -259,30 +115,6 @@ export default {
},
data() {
return {
//
dateValue: [],
searchData: {
EarliestStudyTime: null,
LatestStudyTime: null,
Asc: false,
SortField: "StudyTime",
PageIndex: 1,
PageSize: 20,
},
// 访
total: 0,
loading: false,
list: [
{
SeriesCount: 1,
},
{
SeriesCount: 1,
},
],
visitList: [],
visitRule: {},
addLoading: false,
//
status: "trial", // trial visit 访
trialList: [],
@ -308,10 +140,6 @@ export default {
},
],
},
// 访
tableSelectData: [], //
btnLoading2: false,
visitStatus: "confirm", // 访 confirm submit
};
},
created() {
@ -367,11 +195,22 @@ export default {
let res = await addSubjectPatientBinding(data);
this.btnLoading = false;
if (res.IsSuccess) {
this.submitMessage.SubjectId = res.Result;
if (data.SubjectCode) {
let obj = {
PatientList: [],
SubejctId: res.Result,
SubjectCode: data.SubjectCode,
};
this.subjectIdList.unshift(obj);
}
this.$message.success(this.$t("common:message:addedSuccessfully"));
this.status = "visit";
this.$emit("getList");
this.getList();
this.getSubjectVisitSelectList();
this.$nextTick(() => {
this.$refs.confirmVisit.getList();
this.$refs.confirmVisit.getSubjectVisitSelectList();
});
}
} catch (err) {
console.log(err);
@ -398,88 +237,11 @@ export default {
let res = await deleteSubjectPatientBinding(params);
this.btnLoading = false;
if (res.IsSuccess) {
this.reset();
this.list = [];
this.$refs.confirmVisit.reset(true);
this.status = "trial";
this.$message.success(this.$t("common:message:removedSuccessfully"));
this.$emit("getList");
}
} catch (err) {
console.log(err);
}
},
// 访
selectChange(flag) {
if (flag) {
this.getSubjectVisitSelectList();
}
},
// 访
async getSubjectVisitSelectList() {
let data = {
TrialId: this.submitMessage.TrialId,
SubjectId: this.submitMessage.SubjectId,
};
try {
let res = await getSubjectVisitSelectList(data);
if (res.IsSuccess) {
this.visitRule = res.OtherInfo;
this.visitList = res.Result.map((item) => {
item.SubjectVisitId = item.Id;
return item;
});
}
} catch (err) {
console.log(err);
}
},
// 访
async addVisit() {
let data = {
TrialId: this.submitMessage.TrialId,
SubjectId: this.submitMessage.SubjectId,
};
data.VisitNum = this.visitList.length;
data.VisitName =
this.visitRule.BlindFollowUpPrefix + " " + this.visitList.length;
try {
this.addLoading = true;
let res = await addOrUpdateSubjectVisit(data);
this.addLoading = false;
if (res.IsSuccess) {
this.getSubjectVisitSelectList();
}
} catch (err) {
this.addLoading = false;
console.log(err);
}
},
//
async getList() {
if (this.status === "trial")
return this.$message.warning(
this.$t("trials:inspection:message:checkAddTrials")
);
let data = {};
Object.keys(this.searchData).forEach((key) => {
data[key] = this.searchData[key];
});
data.PatientId = this.Patient.PatientId;
if (this.dateValue[0] && this.dateValue[1]) {
data.earliestStudyTime = this.dateValue[0].toISOString();
data.latestStudyTime = this.dateValue[1].toISOString();
} else {
data.EarliestStudyTime = null;
data.LatestStudyTime = null;
}
data.TrialId = this.submitMessage.TrialId;
try {
this.loading = true;
let res = await getVisitPatientStudyList(data);
this.loading = false;
if (res.IsSuccess) {
this.list = res.Result.CurrentPageData;
this.total = res.Result.TotalCount;
this.$refs.confirmVisit.changeVisitStatus(true);
}
} catch (err) {
console.log(err);
@ -498,114 +260,6 @@ export default {
console.log(err);
}
},
//
handleSearch() {
this.getList();
},
//
handleReset() {
this.reset();
this.getList();
},
//
reset() {
Object.keys(this.searchData).forEach((key) => {
this.searchData[key] = null;
});
this.searchData.PageIndex = 1;
this.searchData.PageSize = 20;
this.searchData.Asc = false;
this.SortField.Asc = "StudyTime";
this.dateValue = [];
this.$refs.confirmVisitList.clearSort();
},
//
handleSelectChange(selection) {
// console.log(selection);
this.tableSelectData = selection;
},
//
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();
},
//
detail() {},
//
async confirm() {
let fd = await this.formatData();
if (!fd) return;
let arr = this.tableSelectData.map((item) => {
let obj = {
TrialId: this.submitMessage.TrialId,
SubjectId: this.submitMessage.SubjectId,
SubjectVisitId: item.SubjectVisitId,
ScpStudyId: item.SCPStudyId,
};
return obj;
});
try {
this.btnLoading2 = true;
let res = await addSubjectPatientStudyBinding(arr);
this.btnLoading2 = false;
if (res.IsSuccess) {
this.visitStatus = "submit";
this.$message.success(this.$t("common:message:savedSuccessfully"));
}
} catch (err) {
this.btnLoading2 = false;
console.log(err);
}
},
//
async confirmSubmit() {
let fd = await this.formatData();
if (!fd) return;
let data = {
TrialId: this.submitMessage.TrialId,
SubjectVisitId: [],
};
this.tableSelectData.forEach((item) => {
data.SubjectVisitId.push(item.SubjectVisitId);
});
try {
this.btnLoading2 = true;
let res = await submitVisitStudyBinding(data);
this.btnLoading2 = false;
if (res.IsSuccess) {
this.$message.success(
this.$t("trials:crcUpload:message:submittedSuccessfully")
);
}
} catch (err) {
this.btnLoading2 = false;
console.log(err);
}
},
//
formatData() {
if (this.tableSelectData.length <= 0) {
this.$message.warning(
this.$t("trials:inspection:formatData:notCheckStudy")
);
return false;
}
let index = this.tableSelectData.indexOf((item) => !item.SubjectVisitId);
if (~index) {
this.$message.warning(
this.$t("trials:inspection:formatData:notCheckVisit").replace(
"xx",
index + 1
)
);
return false;
}
return true;
},
},
};
</script>
@ -650,13 +304,4 @@ export default {
.demo-form-inline {
width: 100%;
}
.detail {
margin-left: 10px;
}
.addVisit {
margin: 0;
line-height: 34px;
text-align: center;
cursor: pointer;
}
</style>

View File

@ -0,0 +1,437 @@
<template>
<div>
<div class="search">
<p class="line">{{ $t("trials:inspection:message:confirmVisit") }}</p>
<div class="form">
<el-form :inline="true" class="base-search-form">
<!-- 检查日期 -->
<el-form-item :label="$t('trials:uploadedDicoms:table:studyDate')">
<el-date-picker
v-model="dateValue"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
>
</el-date-picker>
</el-form-item>
<el-form-item>
<!-- 查询 -->
<el-button
type="primary"
icon="el-icon-search"
@click="handleSearch"
>
{{ $t("common:button:search") }}
</el-button>
<!-- 重置 -->
<el-button
type="primary"
icon="el-icon-refresh-left"
@click="handleReset"
>
{{ $t("common:button:reset") }}
</el-button>
</el-form-item>
</el-form>
<div class="buttonBox" v-if="status === 'visit'">
<!--确认-->
<el-button
type="primary"
:loading="btnLoading2"
@click="confirm"
v-if="visitStatus === 'confirm'"
>
{{ $t("trials:seletctedReviews:timeline:confirmation") }}
</el-button>
<!--确认提交-->
<el-button
type="primary"
:loading="btnLoading2"
@click="confirmSubmit"
v-if="visitStatus === 'submit'"
>
{{ $t("trials:inspection:button:confirmAndSubmit") }}
</el-button>
</div>
</div>
</div>
<!--可加入项目列表-->
<!--:header-cell-style="{ background: '#f9f9f9' }"-->
<el-table
ref="confirmVisitList"
v-loading="loading"
v-adaptive="{ bottomOffset: 60 }"
:data="list"
stripe
height="100"
@selection-change="handleSelectChange"
@sort-change="handleSortByColumn"
:default-sort="{ prop: 'StudyTime', order: 'descending' }"
>
<el-table-column type="selection" align="center" width="45" />
<el-table-column type="index" width="40" />
<!--检查描述-->
<el-table-column
align="center"
prop="Description"
:label="$t('trials:inspection:table:studyDescription')"
show-overflow-tooltip
min-width="140"
></el-table-column>
<!--检查类型-->
<el-table-column
align="center"
prop="Modalities"
:label="$t('trials:audit:table:modality')"
show-overflow-tooltip
min-width="140"
></el-table-column>
<!--序列数-->
<el-table-column
align="center"
prop="SeriesCount"
:label="$t('trials:audit:table:seriesCount')"
show-overflow-tooltip
min-width="140"
></el-table-column>
<!--检查日期-->
<el-table-column
align="center"
prop="StudyTime"
:label="$t('trials:audit:table:studyDate')"
show-overflow-tooltip
min-width="140"
sortable="custom"
></el-table-column>
<!--操作-->
<el-table-column
:label="$t('common:action:action')"
width="300"
class-name="actionBox"
>
<template slot-scope="scope">
<!--切换访视-->
<el-select
v-model="scope.row.SubjectVisitId"
placeholder="请选择"
@visible-change="selectChange"
>
<el-option
v-for="item in visitList"
:key="item.SubjectVisitId"
:label="item.VisitName"
:value="item.SubjectVisitId"
/>
<p class="addVisit" @click.stop="addVisit">
<i class="el-icon-plus" v-loading="addLoading"></i>
</p>
</el-select>
<!-- 详情 -->
<el-button
type="text"
@click.stop="detail(scope.row)"
class="detail"
>{{ $t("trials:trials-list:action:panel") }}</el-button
>
</template>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination
class="page"
:total="total"
:page.sync="searchData.PageIndex"
:limit.sync="searchData.PageSize"
@pagination="getList"
/>
</div>
</template>
<script>
import Pagination from "@/components/Pagination";
import {
getVisitPatientStudyList,
getSubjectVisitSelectList,
addOrUpdateSubjectVisit,
addSubjectPatientStudyBinding,
submitVisitStudyBinding,
} from "@/api/inspection.js";
export default {
name: "confirmVisitList",
components: { Pagination },
props: {
Patient: {
require: true,
default: () => {
return {};
},
},
submitMessage: {
require: true,
default: () => {
return {};
},
},
status: {
require: true,
default: "trial",
},
},
data() {
return {
//
dateValue: [],
searchData: {
EarliestStudyTime: null,
LatestStudyTime: null,
Asc: false,
SortField: "StudyTime",
PageIndex: 1,
PageSize: 20,
},
// 访
total: 0,
loading: false,
list: [],
visitList: [],
visitRule: {},
addLoading: false,
// 访
tableSelectData: [], //
btnLoading2: false,
visitStatus: "confirm", // 访 confirm submit
};
},
methods: {
//
changeVisitStatus(flag = false) {
this.visitStatus = "submit";
if (flag) this.visitStatus = "confirm";
},
// 访
selectChange(flag) {
if (flag) {
this.getSubjectVisitSelectList();
}
},
// 访
async getSubjectVisitSelectList() {
let data = {
TrialId: this.submitMessage.TrialId,
SubjectId: this.submitMessage.SubjectId,
};
try {
let res = await getSubjectVisitSelectList(data);
if (res.IsSuccess) {
this.visitRule = res.OtherInfo;
this.visitList = res.Result.map((item) => {
item.SubjectVisitId = item.Id;
return item;
});
}
} catch (err) {
console.log(err);
}
},
// 访
async addVisit() {
let data = {
TrialId: this.submitMessage.TrialId,
SubjectId: this.submitMessage.SubjectId,
};
data.VisitNum = this.visitList.length;
data.VisitName =
this.visitRule.BlindFollowUpPrefix + " " + this.visitList.length;
try {
this.addLoading = true;
let res = await addOrUpdateSubjectVisit(data);
this.addLoading = false;
if (res.IsSuccess) {
this.getSubjectVisitSelectList();
}
} catch (err) {
this.addLoading = false;
console.log(err);
}
},
//
async getList() {
if (this.status === "trial") {
return this.$message.warning(
this.$t("trials:inspection:message:checkAddTrials")
);
}
let data = {};
Object.keys(this.searchData).forEach((key) => {
data[key] = this.searchData[key];
});
data.PatientId = this.Patient.PatientId;
if (this.dateValue[0] && this.dateValue[1]) {
data.earliestStudyTime = this.dateValue[0].toISOString();
data.latestStudyTime = this.dateValue[1].toISOString();
} else {
data.EarliestStudyTime = null;
data.LatestStudyTime = null;
}
data.TrialId = this.submitMessage.TrialId;
try {
this.loading = true;
let res = await getVisitPatientStudyList(data);
this.loading = false;
if (res.IsSuccess) {
this.list = res.Result.CurrentPageData;
this.total = res.Result.TotalCount;
}
} catch (err) {
console.log(err);
}
},
//
handleSearch() {
this.getList();
},
//
handleReset() {
this.reset();
this.getList();
},
//
reset(flag = false) {
Object.keys(this.searchData).forEach((key) => {
this.searchData[key] = null;
});
this.searchData.PageIndex = 1;
this.searchData.PageSize = 20;
this.searchData.Asc = false;
this.searchData.SortField = "StudyTime";
this.dateValue = [];
this.$refs.confirmVisitList.clearSort();
if (flag) this.list = [];
},
//
handleSelectChange(selection) {
// console.log(selection);
this.tableSelectData = selection;
},
//
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();
},
//
detail() {},
//
async confirm() {
let fd = await this.formatData();
if (!fd) return;
let arr = this.tableSelectData.map((item) => {
let obj = {
TrialId: this.submitMessage.TrialId,
SubjectId: this.submitMessage.SubjectId,
SubjectVisitId: item.SubjectVisitId,
ScpStudyId: item.SCPStudyId,
};
return obj;
});
try {
this.btnLoading2 = true;
let res = await addSubjectPatientStudyBinding(arr);
this.btnLoading2 = false;
if (res.IsSuccess) {
this.visitStatus = "submit";
this.$message.success(this.$t("common:message:savedSuccessfully"));
}
} catch (err) {
this.btnLoading2 = false;
console.log(err);
}
},
//
async confirmSubmit() {
let fd = await this.formatData();
if (!fd) return;
let data = {
TrialId: this.submitMessage.TrialId,
SubjectVisitId: [],
};
this.tableSelectData.forEach((item) => {
data.SubjectVisitId.push(item.SubjectVisitId);
});
try {
this.btnLoading2 = true;
let res = await submitVisitStudyBinding(data);
this.btnLoading2 = false;
if (res.IsSuccess) {
this.$message.success(
this.$t("trials:crcUpload:message:submittedSuccessfully")
);
}
} catch (err) {
this.btnLoading2 = false;
console.log(err);
}
},
//
formatData() {
if (this.tableSelectData.length <= 0) {
console.log(1111111111111111);
this.$message.warning(
this.$t("trials:inspection:formatData:notCheckStudy")
);
return false;
}
let index = this.tableSelectData.indexOf((item) => !item.SubjectVisitId);
if (~index) {
this.$message.warning(
this.$t("trials:inspection:formatData:notCheckVisit").replace(
"xx",
index + 1
)
);
return false;
}
return true;
},
},
};
</script>
<style lang="scss" scoped>
.search {
display: flex;
align-items: center;
flex-wrap: wrap;
.form {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
}
}
.line {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
&::after {
display: block;
content: "";
flex: 1;
height: 1px;
border-top: 1px solid #ddd;
}
}
.detail {
margin-left: 10px;
}
.addVisit {
margin: 0;
line-height: 34px;
text-align: center;
cursor: pointer;
}
</style>

View File

@ -211,7 +211,7 @@ export default {
this.searchData[key] = null;
});
this.searchData.Asc = false;
this.SortField.Asc = "StudyTime";
this.searchData.SortField = "StudyTime";
this.dateValue = [];
},
//

View File

@ -309,7 +309,7 @@ export default {
this.searchData.PageSize = 10;
this.searchData.CalledAEList = [];
this.searchData.Asc = false;
this.SortField.Asc = "LatestPushTime";
this.searchData.SortField = "LatestPushTime";
this.$refs.inspectionList.clearSort();
this.getList();
},