提交merge1.3
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
</el-input>
|
||||
</div>
|
||||
<el-table
|
||||
:data="conditionList"
|
||||
:data="conditionDatas"
|
||||
max-height="460"
|
||||
@row-click="handleClickRow"
|
||||
highlight-current-row
|
||||
@@ -33,7 +33,7 @@
|
||||
<div class="syndrome-section">
|
||||
<div class="section-title">证候</div>
|
||||
<div class="search-box">
|
||||
<el-input v-model="searchDisease" placeholder="搜索疾病名称或编码" clearable>
|
||||
<el-input v-model="searchMiddleDisease" placeholder="搜索疾病名称或编码" clearable>
|
||||
<template #prefix>
|
||||
<el-icon><search /></el-icon>
|
||||
</template>
|
||||
@@ -41,7 +41,7 @@
|
||||
</div>
|
||||
<div v-if="selectedDisease">
|
||||
<el-table
|
||||
:data="syndromeList"
|
||||
:data="syndromeListDatas"
|
||||
max-height="460"
|
||||
@row-click="clickSyndromeRow"
|
||||
highlight-current-row
|
||||
@@ -85,13 +85,14 @@
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
getTcmCondition,
|
||||
getTcmSyndrome,
|
||||
saveTcmDiagnosis,
|
||||
} from '@/views/doctorstation/components/api';
|
||||
import { computed } from 'vue';
|
||||
|
||||
const props = defineProps({
|
||||
openAddDiagnosisDialog: {
|
||||
@@ -111,6 +112,8 @@ const tcmDiagonsisSaveList = ref([]);
|
||||
const syndromeSelected = ref(false); // 当前诊断是否选择对应证候
|
||||
const timestamp = ref('');
|
||||
const selectedDisease = ref(false);
|
||||
const searchDisease = ref('');
|
||||
const searchMiddleDisease = ref('');
|
||||
const { proxy } = getCurrentInstance();
|
||||
const emit = defineEmits(['close']);
|
||||
|
||||
@@ -120,6 +123,26 @@ function handleOpen() {
|
||||
});
|
||||
}
|
||||
|
||||
// 搜索诊断
|
||||
const conditionDatas = computed(() => {
|
||||
return conditionList.value.filter((item) => {
|
||||
if (searchDisease.value) {
|
||||
return searchDisease.value == item.name || searchDisease.value == item.ybNo;
|
||||
}
|
||||
return conditionList;
|
||||
});
|
||||
});
|
||||
|
||||
// 后证
|
||||
const syndromeListDatas = computed(() => {
|
||||
return syndromeList.value.filter((item) => {
|
||||
if (searchMiddleDisease.value) {
|
||||
return searchMiddleDisease.value == item.name || searchMiddleDisease.value == item.ybNo;
|
||||
}
|
||||
return syndromeList;
|
||||
});
|
||||
});
|
||||
|
||||
// 点击诊断列表处理,点击以后才显示证候列表
|
||||
function handleClickRow(row) {
|
||||
if (syndromeSelected.value || tcmDiagonsisList.value == 0) {
|
||||
@@ -156,7 +179,7 @@ function clickSyndromeRow(row) {
|
||||
// 删除诊断
|
||||
function removeDiagnosis(row, index) {
|
||||
tcmDiagonsisList.value.splice(index, 1);
|
||||
tcmDiagonsisSaveList.value = tcmDiagonsisSaveList.filter((item) => {
|
||||
tcmDiagonsisSaveList.value = tcmDiagonsisSaveList.value.filter((item) => {
|
||||
return item.syndromeGroupNo !== row.syndromeGroupNo;
|
||||
});
|
||||
}
|
||||
@@ -418,4 +441,4 @@ function close() {
|
||||
padding: 20px 0;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@@ -28,7 +28,16 @@
|
||||
<span>{{ node.label }}</span>
|
||||
<span class="tree-node-actions">
|
||||
<template v-if="node.level === 1 && data.name != '常用' && data.name != '历史'">
|
||||
<<<<<<< HEAD
|
||||
<el-button style="color: #000000" type="text" size="small" @click.stop="addChild(data)">
|
||||
=======
|
||||
<el-button
|
||||
style="color: #000000"
|
||||
type="text"
|
||||
size="small"
|
||||
@click.stop="addChild(data)"
|
||||
>
|
||||
>>>>>>> v1.3
|
||||
<el-icon>
|
||||
<Plus />
|
||||
</el-icon>
|
||||
@@ -37,11 +46,25 @@
|
||||
<el-popconfirm width="200" :hide-after="10" title="确认删除此常用诊断吗" placement="top-start"
|
||||
@confirm="deleteChild(data)">
|
||||
<template #reference>
|
||||
<<<<<<< HEAD
|
||||
<el-button style="color: #000000" v-if="
|
||||
node.level === 2 &&
|
||||
node.parent.data.name != '常用' &&
|
||||
node.parent.data.name != '历史'
|
||||
" type="text" size="small" @click.stop="">
|
||||
=======
|
||||
<el-button
|
||||
style="color: #000000"
|
||||
v-if="
|
||||
node.level === 2 &&
|
||||
node.parent.data.name != '常用' &&
|
||||
node.parent.data.name != '历史'
|
||||
"
|
||||
type="text"
|
||||
size="small"
|
||||
@click.stop=""
|
||||
>
|
||||
>>>>>>> v1.3
|
||||
<el-icon>
|
||||
<Minus />
|
||||
</el-icon>
|
||||
@@ -57,7 +80,7 @@
|
||||
<div style="margin-bottom: 10px">
|
||||
<el-button type="primary" plain @click="handleAddDiagnosis()"> 新增诊断 </el-button>
|
||||
<el-button type="primary" plain @click="handleSaveDiagnosis()"> 保存诊断 </el-button>
|
||||
<el-button type="primary" plain @click="handleAddTcmDiagonsis()"> 中医诊断 </el-button>
|
||||
<!-- <el-button type="primary" plain @click="handleAddTcmDiagonsis()"> 中医诊断 </el-button> -->
|
||||
<el-button type="primary" plain @click="handleImport()"> 导入慢性病诊断 </el-button>
|
||||
</div>
|
||||
|
||||
@@ -170,9 +193,15 @@ import {
|
||||
delEncounterDiagnosis,
|
||||
isFoodDiseasesNew,
|
||||
} from '../api';
|
||||
import { deleteTcmDiagnosis } from '../../../../doctorstation/components/api.js';
|
||||
import diagnosisdialog from '../diagnosis/diagnosisdialog.vue';
|
||||
import AddDiagnosisDialog from './addDiagnosisDialog.vue';
|
||||
import diagnosislist from '../diagnosis/diagnosislist.vue';
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
import { patientInfo } from '../../store/patient.js';
|
||||
import { ElMessage } from 'element-plus';
|
||||
>>>>>>> v1.3
|
||||
// const diagnosisList = ref([]);
|
||||
const allowAdd = ref(false);
|
||||
const tree = ref([]);
|
||||
@@ -201,7 +230,12 @@ const rules = ref({
|
||||
medTypeCode: [{ required: true, message: '请选择诊断类型', trigger: 'change' }],
|
||||
diagSrtNo: [{ required: true, message: '请输入诊断序号', trigger: 'change' }],
|
||||
});
|
||||
<<<<<<< HEAD
|
||||
const isSaving = ref(false);
|
||||
=======
|
||||
const diagnosisNetDatas = ref([]);
|
||||
|
||||
>>>>>>> v1.3
|
||||
watch(
|
||||
() => form.value.diagnosisList,
|
||||
() => {
|
||||
@@ -232,6 +266,7 @@ function getList() {
|
||||
|
||||
getEncounterDiagnosis(props.patientInfo.encounterId).then((res) => {
|
||||
if (res.code == 200) {
|
||||
<<<<<<< HEAD
|
||||
// 为每个诊断项添加默认的诊断医生和时间(如果不存在)
|
||||
const diagnosisList = res.data.map(item => ({
|
||||
...item,
|
||||
@@ -255,6 +290,28 @@ function getList() {
|
||||
if (res.code == 200) {
|
||||
if (res.data.illness && res.data.illness.length > 0 && res.data.symptom) {
|
||||
const newList = [];
|
||||
=======
|
||||
const datas = (res.data || []).map((item) => {
|
||||
let obj = {
|
||||
...item,
|
||||
};
|
||||
if (obj.diagSrtNo == null) {
|
||||
obj.diagSrtNo = '1';
|
||||
}
|
||||
return obj;
|
||||
});
|
||||
form.value.diagnosisList = datas;
|
||||
// form.value.diagnosisList = res.data;
|
||||
emits('diagnosisSave', false);
|
||||
}
|
||||
});
|
||||
getTcmDiagnosis({ encounterId: patientInfo.value.encounterId }).then((res) => {
|
||||
console.log('getTcmDiagnosis=======>', JSON.stringify(res.data.illness));
|
||||
|
||||
if (res.code == 200) {
|
||||
if (res.data.illness.length > 0) {
|
||||
diagnosisNetDatas.value = res.data.illness;
|
||||
>>>>>>> v1.3
|
||||
res.data.illness.forEach((item, index) => {
|
||||
newList.push({
|
||||
name: item.name + '-' + (res.data.symptom[index]?.name || ''),
|
||||
@@ -428,7 +485,10 @@ function handleAddTcmDiagonsis() {
|
||||
* 删除诊断
|
||||
*/
|
||||
function handleDeleteDiagnosis(row, index) {
|
||||
//中医诊断用-拼接 例如:疳气-表里俱实证
|
||||
const nameArr = row.name?.split('-') || [];
|
||||
if (row.conditionId) {
|
||||
<<<<<<< HEAD
|
||||
delEncounterDiagnosis(row.conditionId).then(() => {
|
||||
// 不要立即调用getList(),而是从当前列表中移除
|
||||
form.value.diagnosisList.splice(index, 1);
|
||||
@@ -448,8 +508,39 @@ function handleDeleteDiagnosis(row, index) {
|
||||
form.value.diagnosisList = sortedList.map(item => ({ ...item }));
|
||||
getTree();
|
||||
});
|
||||
=======
|
||||
if (nameArr.length > 1) {
|
||||
deleteTcmDiagnosis(row.syndromeGroupNo).then(() => {
|
||||
getList();
|
||||
getTree();
|
||||
});
|
||||
} else {
|
||||
delEncounterDiagnosis(row.conditionId).then(() => {
|
||||
getList();
|
||||
getTree();
|
||||
});
|
||||
}
|
||||
>>>>>>> v1.3
|
||||
} else {
|
||||
form.value.diagnosisList.splice(index, 1);
|
||||
console.log('row============>', JSON.stringify(row));
|
||||
console.log('item============>', index);
|
||||
if (nameArr.length > 1) {
|
||||
let obj = null;
|
||||
for (let index = 0; index < diagnosisNetDatas.value.length; index++) {
|
||||
const item = diagnosisNetDatas.value[index];
|
||||
console.log('item.name============>', item.name);
|
||||
console.log('row.name============>', row.name);
|
||||
if (item.ybNo == row.ybNo) {
|
||||
obj = item;
|
||||
}
|
||||
}
|
||||
deleteTcmDiagnosis(obj.syndromeGroupNo).then(() => {
|
||||
getList();
|
||||
getTree();
|
||||
});
|
||||
} else {
|
||||
form.value.diagnosisList.splice(index, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -482,6 +573,18 @@ function handleMaindise(value, index) {
|
||||
* 保存诊断
|
||||
*/
|
||||
function handleSaveDiagnosis() {
|
||||
console.log('form.value.diagnosisList=======>', JSON.stringify(form.value.diagnosisList));
|
||||
|
||||
for (let index = 0; index < (form.value.diagnosisList || []).length; index++) {
|
||||
const item = form.value.diagnosisList[index];
|
||||
if (!item.diagSrtNo) {
|
||||
ElMessage({
|
||||
type: 'error',
|
||||
message: '请录入诊断序号',
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
proxy.$refs.formRef.validate((valid) => {
|
||||
if (valid) {
|
||||
if (form.value.diagnosisList.length === 0) {
|
||||
@@ -546,6 +649,7 @@ function closeDiagnosisDialog(str) {
|
||||
openAddDiagnosisDialog.value = false;
|
||||
openDiagnosis.value = false;
|
||||
getTree();
|
||||
getList();
|
||||
}
|
||||
|
||||
function queryDiagnosisUse(value) { }
|
||||
@@ -579,10 +683,10 @@ function handleNodeClick(data) {
|
||||
// 如果是根节点,不执行任何操作
|
||||
return;
|
||||
}
|
||||
if (!allowAdd.value) {
|
||||
proxy.$modal.msgWarning('请先填写病历');
|
||||
return;
|
||||
}
|
||||
// if (!allowAdd.value) {
|
||||
// proxy.$modal.msgWarning('请先填写病历');
|
||||
// return;
|
||||
// }
|
||||
const isDuplicate = form.value.diagnosisList.some(
|
||||
(diagnosis) => diagnosis.ybNo === data.ybNo || diagnosis.name === data.name
|
||||
);
|
||||
@@ -625,4 +729,7 @@ defineExpose({ getList, getDetail, handleSaveDiagnosis });
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
<<<<<<< HEAD
|
||||
|
||||
=======
|
||||
>>>>>>> v1.3
|
||||
|
||||
Reference in New Issue
Block a user