|
@@ -0,0 +1,363 @@
|
|
|
+<script setup lang="tsx">
|
|
|
+// 检验检查申请
|
|
|
+import { useCompShallowRef } from "@/utils/useCompRef";
|
|
|
+import { ElTable } from "element-plus";
|
|
|
+import {
|
|
|
+ createPatientJyJcReq,
|
|
|
+ getTemplateContentById,
|
|
|
+} from "@/api/dictionary/diagnoseToJyJcReq";
|
|
|
+import SystemDeptSelect from "@/components/system/dept-select/SystemDeptSelect.vue";
|
|
|
+import JcPartSelect from "@/components/system/JcPartSelect.vue";
|
|
|
+import JySampleSelect from "@/components/system/jy-sample/JySampleSelect.vue";
|
|
|
+import { xcMessage } from "@/utils/xiaochan-element-plus";
|
|
|
+import CyTabs from "@/components/cy/tabs/src/CyTabs";
|
|
|
+import CyTabPane from "@/components/cy/tabs/src/CyTabPane.vue";
|
|
|
+import DiagNoseIcdCodeNew from "@/components/system/DiagNoseIcdCodeNew.vue";
|
|
|
+import type { CodeNameArray } from "@/ts-type/Code";
|
|
|
+import { copyStrFunc } from "@/utils/public";
|
|
|
+import PrintCheckList from "@/components/zhu-yuan-yi-sheng/jian-cha-shen-qing/da-ying/PrintCheckList.vue";
|
|
|
+import { CyMessageBox } from "@/utils/cy-message-box";
|
|
|
+
|
|
|
+const props = withDefaults(
|
|
|
+ defineProps<{
|
|
|
+ patNo: string;
|
|
|
+ times: number;
|
|
|
+ // 检验检查模板列表
|
|
|
+ templateList: CodeNameArray;
|
|
|
+ // 诊断列表
|
|
|
+ diagnoseList: CodeNameArray;
|
|
|
+ emrBusinessList?: {
|
|
|
+ [key: string]: {
|
|
|
+ value?: string | CodeNameArray;
|
|
|
+ };
|
|
|
+ };
|
|
|
+ }>(),
|
|
|
+ {
|
|
|
+ emrBusinessList: {},
|
|
|
+ }
|
|
|
+);
|
|
|
+
|
|
|
+const jcTable = useCompShallowRef(ElTable);
|
|
|
+const jyTable = useCompShallowRef(ElTable);
|
|
|
+const printRef = useCompShallowRef(PrintCheckList);
|
|
|
+const searchBusiness = ref("");
|
|
|
+
|
|
|
+const tmpEmrBusinessList = computed(() => {
|
|
|
+ const tmp = {};
|
|
|
+ for (let key in props.emrBusinessList) {
|
|
|
+ if (key.includes(searchBusiness.value)) {
|
|
|
+ tmp[key] = props.emrBusinessList[key];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return tmp;
|
|
|
+});
|
|
|
+
|
|
|
+const tmpPrefabrication = computed(() => {
|
|
|
+ return props.diagnoseList.map(item => {
|
|
|
+ return {
|
|
|
+ label: item.name,
|
|
|
+ value: item.code,
|
|
|
+ };
|
|
|
+ });
|
|
|
+});
|
|
|
+
|
|
|
+const store = reactive({
|
|
|
+ // 病史摘要
|
|
|
+ reqComment: "",
|
|
|
+ // 体征信息
|
|
|
+ reqTzComment: "",
|
|
|
+ // 相关辅检结果
|
|
|
+ reqOtherResult: "",
|
|
|
+ // 临床诊断
|
|
|
+ diagCode: "",
|
|
|
+ diagName: "",
|
|
|
+});
|
|
|
+
|
|
|
+const tabValue = ref("jc");
|
|
|
+
|
|
|
+function handleRowClick(row, tableRef: InstanceType<typeof ElTable>) {
|
|
|
+ tableRef.toggleRowSelection(row);
|
|
|
+}
|
|
|
+
|
|
|
+const tableData = reactive({
|
|
|
+ jc: [],
|
|
|
+ jy: [],
|
|
|
+});
|
|
|
+
|
|
|
+const DefaultTableColumns = (_props, { slots, ...val }) => {
|
|
|
+ return [
|
|
|
+ <el-table-column type="selection" />,
|
|
|
+ <el-table-column prop="zyOrderCode" label="编码" width="50" />,
|
|
|
+ <el-table-column prop="orderName" label="名称" />,
|
|
|
+ <el-table-column label="执行科室" width="220">
|
|
|
+ {{
|
|
|
+ default(scope) {
|
|
|
+ return (
|
|
|
+ <SystemDeptSelect
|
|
|
+ v-model={scope.row}
|
|
|
+ value="execDept"
|
|
|
+ label="execName"
|
|
|
+ />
|
|
|
+ );
|
|
|
+ },
|
|
|
+ }}
|
|
|
+ </el-table-column>,
|
|
|
+ <el-table-column label="标本/部位" width="90">
|
|
|
+ {{
|
|
|
+ default(scope) {
|
|
|
+ return slots?.default?.(scope);
|
|
|
+ },
|
|
|
+ }}
|
|
|
+ </el-table-column>,
|
|
|
+ ];
|
|
|
+};
|
|
|
+
|
|
|
+function handleQueryTemplateById(row) {
|
|
|
+ getTemplateContentById(row.code).then(res => {
|
|
|
+ if (res.reqTemplates.length === 0) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const tmp = {
|
|
|
+ jc: [],
|
|
|
+ jy: [],
|
|
|
+ };
|
|
|
+ res.reqTemplates.forEach(item => {
|
|
|
+ if (item.reqType === 3) {
|
|
|
+ tmp.jc.push(item);
|
|
|
+ } else {
|
|
|
+ tmp.jy.push(item);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ tableData.jc = tmp.jc;
|
|
|
+ tableData.jy = tmp.jy;
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+function handleSave(value: "jc" | "jy") {
|
|
|
+ const tmp = {
|
|
|
+ patNo: props.patNo,
|
|
|
+ times: props.times,
|
|
|
+ data: [],
|
|
|
+ reqType: "3",
|
|
|
+ ...store,
|
|
|
+ };
|
|
|
+ const jcData = jcTable.value.getSelectionRows();
|
|
|
+ const jyData = jyTable.value.getSelectionRows();
|
|
|
+
|
|
|
+ if (value === "jc") {
|
|
|
+ tmp.reqType = "3";
|
|
|
+ tmp.data.push(...jcData);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (value === "jy") {
|
|
|
+ tmp.reqType = "2";
|
|
|
+ tmp.data.push(...jyData);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (tmp.data.length == 0) {
|
|
|
+ xcMessage.error("请选择项目");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ createPatientJyJcReq(tmp).then(async res => {
|
|
|
+ if (tmp.reqType === "3") {
|
|
|
+ await CyMessageBox.confirm({
|
|
|
+ message: "是否打印检查申请单,您也可以稍后再检查申请中批量打印",
|
|
|
+ });
|
|
|
+ printRef.value.print(res);
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ store.diagCode = props.diagnoseList[0].code;
|
|
|
+ store.diagName = props.diagnoseList[0].name;
|
|
|
+ if (props.templateList.length === 1) {
|
|
|
+ handleQueryTemplateById(props.templateList[0]);
|
|
|
+ }
|
|
|
+});
|
|
|
+</script>
|
|
|
+
|
|
|
+<template>
|
|
|
+ <div class="layout-horizontal layout_container simple_jyjc_req">
|
|
|
+ <PrintCheckList ref="printRef" />
|
|
|
+ <aside style="width: 220px; height: 100%" class="layout_container">
|
|
|
+ <el-table
|
|
|
+ :data="props.templateList"
|
|
|
+ @row-click="handleQueryTemplateById"
|
|
|
+ style="height: 30%"
|
|
|
+ >
|
|
|
+ <el-table-column prop="name" label="模板名称" />
|
|
|
+ </el-table>
|
|
|
+ <div
|
|
|
+ style="flex: 1; overflow: auto; margin-top: 5px"
|
|
|
+ class="layout_container"
|
|
|
+ >
|
|
|
+ <header>
|
|
|
+ <el-input placeholder="搜索数据源" v-model="searchBusiness" />
|
|
|
+ </header>
|
|
|
+ <div class="layout_main">
|
|
|
+ <template v-for="(value, key) in tmpEmrBusinessList">
|
|
|
+ <div
|
|
|
+ v-if="typeof value.value === 'string'"
|
|
|
+ class="simple_jyjc_req-copy__content"
|
|
|
+ >
|
|
|
+ <div class="simple_jyjc_req-copy__header">
|
|
|
+ {{ key }}
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ link
|
|
|
+ @click="
|
|
|
+ () => {
|
|
|
+ copyStrFunc(value.value);
|
|
|
+ }
|
|
|
+ "
|
|
|
+ >复制
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ <div class="simple_jyjc_req-copy__text">
|
|
|
+ {{ value.value }}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </aside>
|
|
|
+ <div class="layout_main layout_container">
|
|
|
+ <header>
|
|
|
+ <el-form label-position="right">
|
|
|
+ <el-row :gutter="4" style="margin: 0; padding: 0">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="当前诊断" prop="diagCode">
|
|
|
+ <DiagNoseIcdCodeNew
|
|
|
+ placement="bottom"
|
|
|
+ v-model="store"
|
|
|
+ :left-table-header="[
|
|
|
+ { code: 'label', name: '名称', width: '150px' },
|
|
|
+ ]"
|
|
|
+ :prefabrication-options="tmpPrefabrication"
|
|
|
+ style="width: 100%"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="病史摘要" prop="reqComment">
|
|
|
+ <el-input
|
|
|
+ style="width: 100%"
|
|
|
+ v-model="store.reqComment"
|
|
|
+ :rows="2"
|
|
|
+ maxlength="125"
|
|
|
+ show-word-limit
|
|
|
+ type="textarea"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="体征信息" prop="reqTzComment">
|
|
|
+ <el-input
|
|
|
+ style="width: 100%"
|
|
|
+ v-model="store.reqTzComment"
|
|
|
+ :rows="2"
|
|
|
+ maxlength="125"
|
|
|
+ show-word-limit
|
|
|
+ type="textarea"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="辅检结果" prop="reqOtherResult">
|
|
|
+ <el-input
|
|
|
+ style="width: 100%"
|
|
|
+ v-model="store.reqOtherResult"
|
|
|
+ :rows="2"
|
|
|
+ maxlength="125"
|
|
|
+ show-word-limit
|
|
|
+ type="textarea"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ </header>
|
|
|
+ <div class="layout_main">
|
|
|
+ <cy-tabs type="idea" v-model="tabValue">
|
|
|
+ <cy-tab-pane name="jc" label="检查">
|
|
|
+ <div class="layout_container">
|
|
|
+ <header>
|
|
|
+ <el-button type="primary" @click="handleSave('jc')"
|
|
|
+ >保存检查
|
|
|
+ </el-button>
|
|
|
+ </header>
|
|
|
+ <el-table
|
|
|
+ ref="jcTable"
|
|
|
+ height="100%"
|
|
|
+ :data="tableData.jc"
|
|
|
+ @row-click="val => handleRowClick(val, jcTable)"
|
|
|
+ >
|
|
|
+ <DefaultTableColumns>
|
|
|
+ <template #default="scope">
|
|
|
+ <JcPartSelect
|
|
|
+ v-model="scope.row"
|
|
|
+ value="partOrSample"
|
|
|
+ label="partOrSampleName"
|
|
|
+ style="width: 100%"
|
|
|
+ :code-type="scope.row.classes"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ </DefaultTableColumns>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ </cy-tab-pane>
|
|
|
+ <cy-tab-pane name="jy" label="检验">
|
|
|
+ <div class="layout_container">
|
|
|
+ <header>
|
|
|
+ <el-button type="primary" @click="handleSave('jy')"
|
|
|
+ >保存检验
|
|
|
+ </el-button>
|
|
|
+ </header>
|
|
|
+ <el-table
|
|
|
+ ref="jyTable"
|
|
|
+ height="100%"
|
|
|
+ :data="tableData.jy"
|
|
|
+ @row-click="val => handleRowClick(val, jyTable)"
|
|
|
+ >
|
|
|
+ <DefaultTableColumns>
|
|
|
+ <template #default="scope">
|
|
|
+ <JySampleSelect
|
|
|
+ v-model="scope.row"
|
|
|
+ value="partOrSample"
|
|
|
+ label="partOrSampleName"
|
|
|
+ style="width: 100%"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ </DefaultTableColumns>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ </cy-tab-pane>
|
|
|
+ </cy-tabs>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<style lang="scss">
|
|
|
+.simple_jyjc_req {
|
|
|
+ .simple_jyjc_req-copy__content {
|
|
|
+ border: 1px solid var(--el-border-color);
|
|
|
+ padding: 5px;
|
|
|
+ margin: 8px 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ .simple_jyjc_req-copy__header {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ padding-bottom: 5px;
|
|
|
+ border-bottom: 1px solid var(--el-border-color);
|
|
|
+ }
|
|
|
+
|
|
|
+ .simple_jyjc_req-copy__text {
|
|
|
+ padding: 5px;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|