550 lines
18 KiB
Vue
550 lines
18 KiB
Vue
<template>
|
|
<div v-loading="loading" class="reading-unit-wrapper">
|
|
<div v-if="isShow" class="content">
|
|
<el-tabs v-model="TrialReadingCriterionId" type="border-card">
|
|
<template v-for="item of trialCriterionList">
|
|
<el-tab-pane
|
|
:key="item.TrialReadingCriterionId"
|
|
:label="item.TrialReadingCriterionName"
|
|
:name="item.TrialReadingCriterionId"
|
|
>
|
|
<div style="text-align: right; padding: 5px 0px" v-if="!hasPermi(['role:admin','role:qa','role:ea'])">
|
|
<!-- 同步当前标准 -->
|
|
<el-button
|
|
type="primary"
|
|
icon="el-icon-refresh-left"
|
|
:loading="loading"
|
|
size="mini"
|
|
|
|
@click="syncSign"
|
|
>
|
|
{{ $t("trials:readingUnit:button:sync") }}
|
|
</el-button>
|
|
</div>
|
|
<el-collapse
|
|
v-model="activeCollapse"
|
|
class="setting-config"
|
|
v-if="
|
|
item.isPaneShow &&
|
|
item.TrialReadingCriterionId === TrialReadingCriterionId
|
|
"
|
|
>
|
|
<!-- 阅片规则 -->
|
|
<el-collapse-item
|
|
:title="$t('trials:readingUnit:readingRules')"
|
|
name="1"
|
|
>
|
|
<ReadingRules
|
|
:ref="`readingRules${item.TrialReadingCriterionId}`"
|
|
:trial-reading-criterion-id="TrialReadingCriterionId"
|
|
:CriterionType="item.CriterionType"
|
|
@setConfirm="setConfirm"
|
|
@reloadArbitrationRules="reloadArbitrationRules"
|
|
@setArbitrationReading="setArbitrationReading"
|
|
@setAdditionalAssessment="setAdditionalAssessment"
|
|
@setIsClinicalReading="setIsClinicalReading"
|
|
@setGlobalReading="setGlobalReading"
|
|
@setOncologyReading="setOncologyReading"
|
|
@setDigitPlaces="setDigitPlaces"
|
|
@setReadingTools="setReadingTools"
|
|
/>
|
|
</el-collapse-item>
|
|
<!-- 阅片标准 -->
|
|
<el-collapse-item
|
|
:title="$t('trials:readingUnit:readingCriterion')"
|
|
name="2"
|
|
>
|
|
<ReadingCriterions
|
|
:ref="`readingCriterions${item.TrialReadingCriterionId}`"
|
|
:trial-reading-criterion-id="TrialReadingCriterionId"
|
|
:digit-places="digitPlaces"
|
|
:readingTools="readingTools"
|
|
:is-additional-assessment="isAdditionalAssessment"
|
|
@reloadArbitrationRules="reloadArbitrationRules"
|
|
/>
|
|
</el-collapse-item>
|
|
<!-- 全局阅片 -->
|
|
<el-collapse-item
|
|
v-if="isGlobalReading && CriterionType !== 10"
|
|
:title="$t('trials:readingUnit:GlobalReading')"
|
|
name="5"
|
|
>
|
|
<GlobalReading
|
|
:ref="`globalReading${item.TrialReadingCriterionId}`"
|
|
:trial-reading-criterion-id="TrialReadingCriterionId"
|
|
/>
|
|
</el-collapse-item>
|
|
<!-- 仲裁规则 -->
|
|
<el-collapse-item
|
|
v-if="isArbitrationReading"
|
|
:title="$t('trials:readingUnit:adRules')"
|
|
name="3"
|
|
>
|
|
<ArbitrationRules
|
|
:ref="`arbitrationRules${item.TrialReadingCriterionId}`"
|
|
:trial-reading-criterion-id="TrialReadingCriterionId"
|
|
/>
|
|
</el-collapse-item>
|
|
<!-- 肿瘤学阅片配置 -->
|
|
<!-- v-if="isClinicalReading" -->
|
|
<el-collapse-item
|
|
v-if="isOncologyReading"
|
|
:title="$t('trials:readingUnit:oncologyReading')"
|
|
name="4"
|
|
>
|
|
<OncologyForm
|
|
:ref="`oncologyForm${item.TrialReadingCriterionId}`"
|
|
:trial-reading-criterion-id="TrialReadingCriterionId"
|
|
/>
|
|
</el-collapse-item>
|
|
</el-collapse>
|
|
</el-tab-pane>
|
|
</template>
|
|
</el-tabs>
|
|
</div>
|
|
|
|
<div
|
|
v-if="
|
|
!isConfirm &&
|
|
hasPermi(['trials:trials-panel:setting:reading-unit:edit'])
|
|
"
|
|
class="bottom"
|
|
>
|
|
<!-- 确认 -->
|
|
<el-button type="danger" @click="handleConfirm">
|
|
{{ $t("trials:readingUnit:button:confirm") }}
|
|
</el-button>
|
|
</div>
|
|
|
|
<!--签名框 -->
|
|
<el-dialog
|
|
v-if="signVisible"
|
|
:visible.sync="signVisible"
|
|
:close-on-click-modal="false"
|
|
width="600px"
|
|
custom-class="base-dialog-wrapper"
|
|
>
|
|
<div slot="title">
|
|
<span style="font-size: 18px">{{ $t("common:dialogTitle:sign") }}</span>
|
|
<span style="font-size: 12px; margin-left: 5px">{{
|
|
`(${$t("common:label:sign")}${currentUser})`
|
|
}}</span>
|
|
</div>
|
|
<SignForm
|
|
ref="signForm"
|
|
:sign-code-enum="signCode"
|
|
@closeDialog="closeSignDialog"
|
|
/>
|
|
</el-dialog>
|
|
<!--签名框 -->
|
|
<el-dialog
|
|
v-if="signVisible2"
|
|
:visible.sync="signVisible2"
|
|
:close-on-click-modal="false"
|
|
width="600px"
|
|
custom-class="base-dialog-wrapper"
|
|
>
|
|
<div slot="title">
|
|
<span style="font-size: 18px">{{ $t("common:dialogTitle:sign") }}</span>
|
|
<span style="font-size: 12px; margin-left: 5px">{{
|
|
`(${$t("common:label:sign")}${currentUser})`
|
|
}}</span>
|
|
</div>
|
|
<SignForm
|
|
ref="signForm2"
|
|
:sign-code-enum="signCode2"
|
|
@closeDialog="closeSignDialog2"
|
|
/>
|
|
</el-dialog>
|
|
</div>
|
|
</template>
|
|
<script>
|
|
import {
|
|
resetAndAsyncCriterion,
|
|
resetTrialCriterionAsyncState,
|
|
asyncTrialCriterionDictionary,
|
|
getTrialCriterionList,
|
|
trialReadingInfoSign,
|
|
trialReadingInfoSignVerify,
|
|
verifyeCriterionNeedSynchronize,
|
|
synchronizeCriterion,
|
|
} from "@/api/trials";
|
|
import ReadingRules from "./components/ReadingRules";
|
|
import ReadingCriterions from "./components/ReadingCriterions";
|
|
import ArbitrationRules from "./components/ArbitrationRules";
|
|
import GlobalReading from "./components/GlobalReading";
|
|
import OncologyForm from "./components/OncologyForm";
|
|
import SignForm from "@/views/trials/components/newSignForm";
|
|
import const_ from "@/const/sign-code";
|
|
import { getCustomizeStandardsTools } from '@/views/trials/trials-panel/reading/dicoms3D/components/toolConfig'
|
|
export default {
|
|
name: "ReadingUnit",
|
|
components: {
|
|
GlobalReading,
|
|
ReadingRules,
|
|
ReadingCriterions,
|
|
ArbitrationRules,
|
|
OncologyForm,
|
|
SignForm,
|
|
},
|
|
data() {
|
|
return {
|
|
NODE_ENV: process.env.NODE_ENV,
|
|
activeCollapse: ["1", "2", "3", "4", "5"],
|
|
signCode: null,
|
|
signCode2: null,
|
|
signVisible: false,
|
|
signVisible2: false,
|
|
currentUser: zzSessionStorage.getItem("userName"),
|
|
isConfirm: true,
|
|
loading: false,
|
|
isArbitrationReading: false,
|
|
isClinicalReading: false,
|
|
trialCriterionList: [],
|
|
TrialReadingCriterionId: "0",
|
|
CriterionType: 0,
|
|
trialId: this.$route.query.trialId,
|
|
isPaneShow: true,
|
|
isShow: false,
|
|
isOncologyReading: false,
|
|
isGlobalReading: false,
|
|
digitPlaces: 0,
|
|
isAdditionalAssessment: false,
|
|
readingTools: []
|
|
};
|
|
},
|
|
watch: {
|
|
async TrialReadingCriterionId(v) {
|
|
// await this.asyncTrialCriterionDictionary(v)
|
|
// let i = this.trialCriterionList.findIndex(i => i.TrialReadingCriterionId === v)
|
|
// if(i === -1) return
|
|
// this.CriterionType = this.trialCriterionList[i].CriterionType
|
|
// this.trialCriterionList[i].isPaneShow = false
|
|
// this.$nextTick(() => {
|
|
// this.trialCriterionList[i].isPaneShow = true
|
|
// })
|
|
},
|
|
},
|
|
mounted() {
|
|
this.getTrialCriterionList();
|
|
},
|
|
methods: {
|
|
closeSignDialog2(isSign, signInfo) {
|
|
if (isSign) {
|
|
this.handleSync(signInfo);
|
|
} else {
|
|
this.signVisible2 = false;
|
|
}
|
|
},
|
|
syncSign() {
|
|
const { ResetAndAsyncCriterion } = const_.processSignature;
|
|
this.signCode2 = ResetAndAsyncCriterion;
|
|
this.signVisible2 = true;
|
|
},
|
|
handleSync(signInfo) {
|
|
// '确定要同步最新标准配置吗?'
|
|
this.loading = true;
|
|
const params = {
|
|
data: {
|
|
TrialReadingCriterionId: this.TrialReadingCriterionId,
|
|
},
|
|
signInfo: signInfo,
|
|
};
|
|
resetAndAsyncCriterion(params)
|
|
.then((res) => {
|
|
this.loading = false;
|
|
let i = this.trialCriterionList.findIndex(
|
|
(i) => i.TrialReadingCriterionId === this.TrialReadingCriterionId
|
|
);
|
|
if (i === -1) return;
|
|
this.trialCriterionList[i].isPaneShow = false;
|
|
this.$nextTick(() => {
|
|
this.signVisible2 = false;
|
|
this.trialCriterionList[i].isPaneShow = true;
|
|
});
|
|
})
|
|
.catch(() => {
|
|
this.$refs["signForm2"].btnLoading = false;
|
|
this.loading = false;
|
|
});
|
|
},
|
|
asyncTrialCriterionDictionary(TrialReadingCriterionId) {
|
|
return new Promise((resolve) => {
|
|
asyncTrialCriterionDictionary({
|
|
TrialReadingCriterionId: this.TrialReadingCriterionId,
|
|
}).then((res) => {
|
|
resolve();
|
|
});
|
|
});
|
|
},
|
|
getTrialCriterionList() {
|
|
getTrialCriterionList(this.trialId, false)
|
|
.then(async (res) => {
|
|
this.trialCriterionList = res.Result.map((item) => {
|
|
return {
|
|
...item,
|
|
isPaneShow: true,
|
|
};
|
|
});
|
|
this.TrialReadingCriterionId =
|
|
this.trialCriterionList[0].TrialReadingCriterionId;
|
|
this.isShow = true;
|
|
})
|
|
.catch(() => {});
|
|
},
|
|
setConfirm(isConfirm) {
|
|
this.isConfirm = isConfirm;
|
|
},
|
|
setDigitPlaces(digitPlaces) {
|
|
this.digitPlaces = digitPlaces;
|
|
},
|
|
setReadingTools(readingTools) {
|
|
this.readingTools = getCustomizeStandardsTools(readingTools)
|
|
},
|
|
setIsClinicalReading(isClinicalReading) {
|
|
this.isClinicalReading = isClinicalReading;
|
|
},
|
|
setAdditionalAssessment(isAdditionalAssessment) {
|
|
this.isAdditionalAssessment = isAdditionalAssessment;
|
|
},
|
|
setArbitrationReading(isArbitrationReading) {
|
|
this.isArbitrationReading = isArbitrationReading;
|
|
},
|
|
setGlobalReading(isGlobalReading) {
|
|
this.isGlobalReading = isGlobalReading;
|
|
},
|
|
setOncologyReading(isOncologyReading) {
|
|
this.isOncologyReading = isOncologyReading;
|
|
},
|
|
updateCriterions() {
|
|
this.loading = true;
|
|
synchronizeCriterion({
|
|
trialId: this.$route.query.trialId,
|
|
TrialReadingCriterionId: this.TrialReadingCriterionId,
|
|
})
|
|
.then((res) => {
|
|
this.$router.push({
|
|
path: `/trials/trials-panel/setting/reading-unit?trialId=${
|
|
this.$route.query.trialId
|
|
}&trialCode=${this.$route.query.trialCode}&researchProgramNo=${
|
|
this.$route.query.researchProgramNo
|
|
}&t=${new Date().getTime()}`,
|
|
});
|
|
this.loading = false;
|
|
})
|
|
.catch(() => {
|
|
this.loading = false;
|
|
});
|
|
},
|
|
handleConfirm() {
|
|
this.loading = true;
|
|
verifyeCriterionNeedSynchronize({
|
|
trialId: this.$route.query.trialId,
|
|
TrialReadingCriterionId: this.TrialReadingCriterionId,
|
|
})
|
|
.then(async (res) => {
|
|
this.loading = false;
|
|
if (res.Result !== 1) {
|
|
// 系统检测当前阅片标准配置发生更新,是否确认获取最新配置信息?
|
|
this.$confirm(this.$t("trials:readingUnit:message:msg1"), {
|
|
type: "warning",
|
|
})
|
|
.then(() => {
|
|
this.updateCriterions();
|
|
})
|
|
.catch((action) => {});
|
|
} else {
|
|
try {
|
|
var isCheckList = [];
|
|
if (
|
|
this.$refs["arbitrationRules" + this.TrialReadingCriterionId] &&
|
|
this.$refs["arbitrationRules" + this.TrialReadingCriterionId]
|
|
.length
|
|
) {
|
|
var arbitrationRules = await this.$refs[
|
|
"arbitrationRules" + this.TrialReadingCriterionId
|
|
][0].saveAllSync();
|
|
isCheckList.push({
|
|
isCheck: arbitrationRules,
|
|
msg: this.$t("trials:readingUnit:adRules"), // '仲裁规则'
|
|
});
|
|
}
|
|
var readingRules = await this.$refs[
|
|
"readingRules" + this.TrialReadingCriterionId
|
|
][0].handleSave(false);
|
|
isCheckList.push({
|
|
isCheck: readingRules,
|
|
msg: this.$t("trials:readingUnit:readingRules"), // '阅片规则'
|
|
});
|
|
var qsLength = this.$refs['readingCriterions' + this.TrialReadingCriterionId][0].getQuestionLength()
|
|
isCheckList.push({
|
|
isCheck: qsLength > 0,
|
|
msg: this.$t('trials:readingUnit:readingCriterion')
|
|
})
|
|
if (
|
|
this.$refs["globalReading" + this.TrialReadingCriterionId] &&
|
|
this.$refs["globalReading" + this.TrialReadingCriterionId]
|
|
.length
|
|
) {
|
|
var globalReading = await this.$refs[
|
|
"globalReading" + this.TrialReadingCriterionId
|
|
][0].handleSave(false);
|
|
isCheckList.push({
|
|
isCheck: globalReading,
|
|
msg: this.$t("trials:readingUnit:GlobalReading"), // '全局阅片'
|
|
});
|
|
}
|
|
if (
|
|
this.$refs["oncologyForm" + this.TrialReadingCriterionId] &&
|
|
this.$refs["oncologyForm" + this.TrialReadingCriterionId].length
|
|
) {
|
|
var oncologyForm = await this.$refs[
|
|
"oncologyForm" + this.TrialReadingCriterionId
|
|
][0].handleSave(false);
|
|
isCheckList.push({
|
|
isCheck: oncologyForm,
|
|
msg: this.$t("trials:readingUnit:oncologyReading"), // '肿瘤学阅片配置'
|
|
});
|
|
}
|
|
if (isCheckList.every((v) => v.isCheck === true)) {
|
|
trialReadingInfoSignVerify({
|
|
trialId: this.$route.query.trialId,
|
|
TrialReadingCriterionId: this.TrialReadingCriterionId,
|
|
}).then((res) => {
|
|
if (res.IsSuccess) {
|
|
const { ReadingUnitConfirmation } = const_.processSignature;
|
|
this.signCode = ReadingUnitConfirmation;
|
|
this.signVisible = true;
|
|
}
|
|
});
|
|
} else {
|
|
var notCheckList = isCheckList.filter(
|
|
(v) => v.isCheck === false
|
|
);
|
|
var msg = notCheckList.map((v) => v.msg);
|
|
msg = this.$t("trials:readingUnit:message:msg2").replace(
|
|
"xxx",
|
|
msg
|
|
);
|
|
this.$alert(msg); // ${msg}区域信息不完整,请完成后确认!
|
|
}
|
|
} catch (e) {
|
|
console.log(e);
|
|
}
|
|
}
|
|
})
|
|
.catch(() => {
|
|
console.log(222);
|
|
this.loading = false;
|
|
});
|
|
},
|
|
// 关闭签名框并设置确认状态
|
|
closeSignDialog(isSign, signInfo) {
|
|
if (isSign) {
|
|
this.signConfirm(signInfo);
|
|
} else {
|
|
this.signVisible = false;
|
|
}
|
|
},
|
|
// 签名确认
|
|
signConfirm(signInfo) {
|
|
this.loading = true;
|
|
const params = {
|
|
data: {
|
|
trialId: this.$route.query.trialId,
|
|
TrialReadingCriterionId: this.TrialReadingCriterionId,
|
|
},
|
|
signInfo: signInfo,
|
|
};
|
|
trialReadingInfoSign(params)
|
|
.then((res) => {
|
|
if (res.IsSuccess) {
|
|
try {
|
|
this.$message.success(
|
|
this.$t("common:message:savedSuccessfully")
|
|
);
|
|
this.isConfirm = true;
|
|
try {
|
|
this.$refs[
|
|
"readingRules" + this.TrialReadingCriterionId
|
|
][0].initPage();
|
|
} catch (e) {}
|
|
try {
|
|
this.$refs[
|
|
"readingCriterions" + this.TrialReadingCriterionId
|
|
][0].initPage();
|
|
} catch (e) {}
|
|
try {
|
|
this.$refs[
|
|
"arbitrationRules" + this.TrialReadingCriterionId
|
|
][0].getList();
|
|
} catch (e) {}
|
|
try {
|
|
this.$refs[
|
|
"globalReading" + this.TrialReadingCriterionId
|
|
][0].initForm();
|
|
} catch (e) {}
|
|
try {
|
|
this.$refs[
|
|
"oncologyForm" + this.TrialReadingCriterionId
|
|
][0].initForm();
|
|
} catch (e) {}
|
|
this.$refs["signForm"].btnLoading = false;
|
|
this.signVisible = false;
|
|
} catch (e) {
|
|
console.log(e);
|
|
}
|
|
}
|
|
this.loading = false;
|
|
})
|
|
.catch((_) => {
|
|
this.loading = false;
|
|
this.$refs["signForm"].btnLoading = false;
|
|
});
|
|
},
|
|
reloadArbitrationRules() {
|
|
if (this.$refs[
|
|
"arbitrationRules" + this.TrialReadingCriterionId
|
|
]) {
|
|
this.$refs[
|
|
"arbitrationRules" + this.TrialReadingCriterionId
|
|
][0].getList();
|
|
this.$refs[
|
|
"arbitrationRules" + this.TrialReadingCriterionId
|
|
][0].getTrialJudgyInfo();
|
|
}
|
|
},
|
|
},
|
|
};
|
|
</script>
|
|
<style lang="scss" scoped>
|
|
.reading-unit-wrapper {
|
|
height: 100%;
|
|
background-color: #fff;
|
|
display: flex;
|
|
flex-direction: column;
|
|
.content {
|
|
flex: 1;
|
|
overflow-y: auto;
|
|
}
|
|
::v-deep .el-collapse-item__header {
|
|
background: #e5ecef;
|
|
padding-left: 10px;
|
|
}
|
|
::v-deep .el-tabs--border-card>.el-tabs__content {
|
|
padding: 0px 15px;
|
|
}
|
|
::v-deep .el-collapse-item__content {
|
|
padding: 10px;
|
|
}
|
|
.bottom {
|
|
height: 50px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
text-align: center;
|
|
border-top: 1px solid #e1e1e1;
|
|
}
|
|
}
|
|
</style>
|