|
@@ -11,7 +11,11 @@ import {
|
|
|
} from "./emr-ca";
|
|
|
import XEUtils from "xe-utils";
|
|
|
import { BizException, ExceptionEnum } from "@/utils/BizException";
|
|
|
-import { sendMoreEventSign } from "@/api/ca/ca-api";
|
|
|
+import {
|
|
|
+ getIdCardTypeList,
|
|
|
+ PatientIdCardType,
|
|
|
+ sendMoreEventSign,
|
|
|
+} from "@/api/ca/ca-api";
|
|
|
import { useDialog } from "@/components/cy/CyDialog/index";
|
|
|
import EmrCaSign from "./EmrCaSign.vue";
|
|
|
import { ElMessageBox } from "element-plus";
|
|
@@ -19,6 +23,9 @@ import XcElOption from "@/components/xiao-chan/xc-el-option/XcElOption.vue";
|
|
|
import { useUserStore } from "@/pinia/user-store";
|
|
|
import { patientInfo } from "@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/emr-init";
|
|
|
import { stringIsBlank } from "@/utils/blank-utils";
|
|
|
+import { isDev } from "@/utils/public";
|
|
|
+
|
|
|
+const SignIdCard = defineAsyncComponent(() => import("./SignIdCard.vue"));
|
|
|
|
|
|
const root = inject(emrRootContextKey) as EmrStore;
|
|
|
const selectList = ref<SignComp[]>([]);
|
|
@@ -28,6 +35,8 @@ const signTypeValue = ref(null);
|
|
|
const idCardPublicKey =
|
|
|
"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCgHPo86lSh7IzXcrgxi+7us2UeeY/O5ftBhk+P8hFfivGbS9RqCIDg+r7+nhINojsJeloeoavF0eHCMs1crzGd+XSMN6BjfPTm7bgoWu4CzplmFCBlZ5FAZCxXiHcHuBfG6tateaO2s7E1XpEsjSX/8J8VjKfIm7bzuNU/AyM2TwIDAQAB";
|
|
|
|
|
|
+const idCardTypeList = ref([]);
|
|
|
+
|
|
|
const us = useUserStore().userInfo;
|
|
|
|
|
|
const changeSignType = val => {
|
|
@@ -237,7 +246,6 @@ const signType = [
|
|
|
];
|
|
|
|
|
|
const addCompByInternal = (name: string) => {
|
|
|
- console.log(1);
|
|
|
const editor = root.getEditor();
|
|
|
editor.execute("insertContents", {
|
|
|
value: [
|
|
@@ -268,6 +276,59 @@ const addAuthorizedSignatureDataElement = () => {
|
|
|
});
|
|
|
};
|
|
|
|
|
|
+function handleCardType() {
|
|
|
+ getIdCardTypeList(patientInfo.value.inpatientNo).then(res => {
|
|
|
+ res.forEach(item => {
|
|
|
+ const find = XEUtils.find(selectData, i => {
|
|
|
+ return i.code === item.caType;
|
|
|
+ });
|
|
|
+ item.caTypeName = find.name ?? "未知";
|
|
|
+ });
|
|
|
+ idCardTypeList.value = res;
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+function openSignIdCard() {
|
|
|
+ useDialog(SignIdCard, {
|
|
|
+ params: {
|
|
|
+ data: idCardTypeList.value,
|
|
|
+ patNo: patientInfo.value.inpatientNo,
|
|
|
+ },
|
|
|
+ dialogProps: {
|
|
|
+ title: "维护患者身份证",
|
|
|
+ },
|
|
|
+ confirmText: "保存",
|
|
|
+ }).then(() => {
|
|
|
+ handleCardType();
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+function handleSignType(val, index) {
|
|
|
+ const find = XEUtils.filter(idCardTypeList.value ?? [], i => {
|
|
|
+ return i.caType === val;
|
|
|
+ });
|
|
|
+
|
|
|
+ if (find.length === 0) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (find.length === 1) {
|
|
|
+ setSelectListByIndex(index, find[0]);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+function setSelectListByIndex(index, data: PatientIdCardType) {
|
|
|
+ selectList.value[index] = {
|
|
|
+ ...selectList.value[index],
|
|
|
+ idCard: data.idCard,
|
|
|
+ signName: data.name,
|
|
|
+ };
|
|
|
+}
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ handleCardType();
|
|
|
+});
|
|
|
+
|
|
|
defineExpose({
|
|
|
change,
|
|
|
});
|
|
@@ -293,6 +354,11 @@ defineExpose({
|
|
|
</el-button>
|
|
|
<el-button @click="addCompByInternal('患者CA签名')">签名组件</el-button>
|
|
|
<el-button @click="addCompByInternal('患者CA意见')">意见组件</el-button>
|
|
|
+
|
|
|
+ <hr />
|
|
|
+
|
|
|
+ <el-button @click="openSignIdCard"> 维护签名详情</el-button>
|
|
|
+
|
|
|
<el-form label-position="top">
|
|
|
<el-form-item label="签名方式">
|
|
|
<el-select
|
|
@@ -336,7 +402,11 @@ defineExpose({
|
|
|
</template>
|
|
|
<el-form label-position="left">
|
|
|
<el-form-item label="关系">
|
|
|
- <el-select v-model="item.signType" style="width: 30%">
|
|
|
+ <el-select
|
|
|
+ v-model="item.signType"
|
|
|
+ style="width: 30%"
|
|
|
+ @change="val => handleSignType(val, index)"
|
|
|
+ >
|
|
|
<xc-el-option :data="selectData" />
|
|
|
</el-select>
|
|
|
<el-input style="width: 70%" v-model="item.signTypeName">
|