诊断排序
This commit is contained in:
@@ -99,7 +99,7 @@
|
|||||||
>
|
>
|
||||||
<el-select v-model="scope.row.medTypeCode" placeholder=" " style="width: 150px">
|
<el-select v-model="scope.row.medTypeCode" placeholder=" " style="width: 150px">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in med_type"
|
v-for="item in diag_type"
|
||||||
:key="item.value"
|
:key="item.value"
|
||||||
:label="item.label"
|
:label="item.label"
|
||||||
:value="item.value"
|
:value="item.value"
|
||||||
@@ -235,7 +235,7 @@ const props = defineProps({
|
|||||||
const emits = defineEmits(['diagnosisSave']);
|
const emits = defineEmits(['diagnosisSave']);
|
||||||
const { proxy } = getCurrentInstance();
|
const { proxy } = getCurrentInstance();
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
const { med_type } = proxy.useDict('med_type');
|
const { diag_type } = proxy.useDict('diag_type');
|
||||||
const rules = ref({
|
const rules = ref({
|
||||||
name: [{ required: true, message: '请选择诊断', trigger: 'change' }],
|
name: [{ required: true, message: '请选择诊断', trigger: 'change' }],
|
||||||
medTypeCode: [{ required: true, message: '请选择诊断类型', trigger: 'change' }],
|
medTypeCode: [{ required: true, message: '请选择诊断类型', trigger: 'change' }],
|
||||||
@@ -275,6 +275,10 @@ function getList() {
|
|||||||
diagnosisDoctor: item.diagnosisDoctor || props.patientInfo.practitionerName || props.patientInfo.doctorName || props.patientInfo.physicianName || userStore.name,
|
diagnosisDoctor: item.diagnosisDoctor || props.patientInfo.practitionerName || props.patientInfo.doctorName || props.patientInfo.physicianName || userStore.name,
|
||||||
diagnosisTime: item.diagnosisTime || new Date().toLocaleString('zh-CN')
|
diagnosisTime: item.diagnosisTime || new Date().toLocaleString('zh-CN')
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
// 获取诊断列表后按排序号排序
|
||||||
|
form.value.diagnosisList.sort((a, b) => (a.diagSrtNo || 0) - (b.diagSrtNo || 0));
|
||||||
|
|
||||||
emits('diagnosisSave', false);
|
emits('diagnosisSave', false);
|
||||||
console.log(form.value.diagnosisList);
|
console.log(form.value.diagnosisList);
|
||||||
}
|
}
|
||||||
@@ -320,6 +324,11 @@ function handleImport() {
|
|||||||
// 获取患者慢性病信息
|
// 获取患者慢性病信息
|
||||||
getChronicDisease({ encounterId: props.patientInfo.encounterId }).then((res) => {
|
getChronicDisease({ encounterId: props.patientInfo.encounterId }).then((res) => {
|
||||||
if (res.data && res.data.length > 0) {
|
if (res.data && res.data.length > 0) {
|
||||||
|
// 计算现有最大排序号
|
||||||
|
const maxSortNo = form.value.diagnosisList.length > 0
|
||||||
|
? Math.max(...form.value.diagnosisList.map(item => item.diagSrtNo || 0))
|
||||||
|
: 0;
|
||||||
|
|
||||||
res.data.forEach((item, index) => {
|
res.data.forEach((item, index) => {
|
||||||
form.value.diagnosisList.push({
|
form.value.diagnosisList.push({
|
||||||
...item,
|
...item,
|
||||||
@@ -327,7 +336,7 @@ function handleImport() {
|
|||||||
medTypeCode: '140104',
|
medTypeCode: '140104',
|
||||||
verificationStatusEnum: 4,
|
verificationStatusEnum: 4,
|
||||||
definitionId: item.id,
|
definitionId: item.id,
|
||||||
diagSrtNo: form.value.diagnosisList.length + 1,
|
diagSrtNo: maxSortNo + index + 1,
|
||||||
iptDiseTypeCode: 2,
|
iptDiseTypeCode: 2,
|
||||||
diagnosisDesc: '',
|
diagnosisDesc: '',
|
||||||
diagnosisDoctor: props.patientInfo.practitionerName || props.patientInfo.doctorName || props.patientInfo.physicianName || userStore.name,
|
diagnosisDoctor: props.patientInfo.practitionerName || props.patientInfo.doctorName || props.patientInfo.physicianName || userStore.name,
|
||||||
@@ -335,6 +344,10 @@ function handleImport() {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 导入完成后按排序号排序
|
||||||
|
form.value.diagnosisList.sort((a, b) => (a.diagSrtNo || 0) - (b.diagSrtNo || 0));
|
||||||
|
emits('diagnosisSave', false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -417,17 +430,26 @@ function handleAddDiagnosis() {
|
|||||||
proxy.$modal.msgWarning('请先填写病历');
|
proxy.$modal.msgWarning('请先填写病历');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// 计算现有最大排序号
|
||||||
|
const maxSortNo = form.value.diagnosisList.length > 0
|
||||||
|
? Math.max(...form.value.diagnosisList.map(item => item.diagSrtNo || 0))
|
||||||
|
: 0;
|
||||||
|
|
||||||
form.value.diagnosisList.push({
|
form.value.diagnosisList.push({
|
||||||
showPopover: false,
|
showPopover: false,
|
||||||
name: undefined,
|
name: undefined,
|
||||||
verificationStatusEnum: 4,
|
verificationStatusEnum: 4,
|
||||||
medTypeCode: '11',
|
medTypeCode: '11',
|
||||||
diagSrtNo: form.value.diagnosisList.length + 1,
|
diagSrtNo: maxSortNo + 1,
|
||||||
iptDiseTypeCode: 2,
|
iptDiseTypeCode: 2,
|
||||||
diagnosisDesc: '',
|
diagnosisDesc: '',
|
||||||
diagnosisDoctor: props.patientInfo.practitionerName || props.patientInfo.doctorName || props.patientInfo.physicianName || userStore.name,
|
diagnosisDoctor: props.patientInfo.practitionerName || props.patientInfo.doctorName || props.patientInfo.physicianName || userStore.name,
|
||||||
diagnosisTime: new Date().toLocaleString('zh-CN')
|
diagnosisTime: new Date().toLocaleString('zh-CN')
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 添加后按排序号排序
|
||||||
|
form.value.diagnosisList.sort((a, b) => (a.diagSrtNo || 0) - (b.diagSrtNo || 0));
|
||||||
|
|
||||||
if (form.value.diagnosisList.length == 1) {
|
if (form.value.diagnosisList.length == 1) {
|
||||||
form.value.diagnosisList[0].maindiseFlag = 1;
|
form.value.diagnosisList[0].maindiseFlag = 1;
|
||||||
}
|
}
|
||||||
@@ -445,12 +467,17 @@ function handleAddTcmDiagonsis() {
|
|||||||
*/
|
*/
|
||||||
function handleDeleteDiagnosis(row, index) {
|
function handleDeleteDiagnosis(row, index) {
|
||||||
if (row.conditionId) {
|
if (row.conditionId) {
|
||||||
delEncounterDiagnosis(row.conditionId).then(() => {
|
delEncounterDiagnosis({ conditionId: row.conditionId }).then((res) => {
|
||||||
|
if (res.code == 200) {
|
||||||
|
proxy.$modal.msgSuccess('删除成功');
|
||||||
getList();
|
getList();
|
||||||
getTree();
|
getTree();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
form.value.diagnosisList.splice(index, 1);
|
form.value.diagnosisList.splice(index, 1);
|
||||||
|
// 删除后不重新计算排序号,保持用户设置的排序不变
|
||||||
|
emits('diagnosisSave', false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -458,7 +485,6 @@ function handleMaindise(value, index) {
|
|||||||
if (value == 1) {
|
if (value == 1) {
|
||||||
let flag = 0;
|
let flag = 0;
|
||||||
form.value.diagnosisList.forEach((item) => {
|
form.value.diagnosisList.forEach((item) => {
|
||||||
console.log(item);
|
|
||||||
if (item.maindiseFlag == 1) {
|
if (item.maindiseFlag == 1) {
|
||||||
flag++;
|
flag++;
|
||||||
}
|
}
|
||||||
@@ -482,6 +508,9 @@ function handleSaveDiagnosis() {
|
|||||||
} else if (!form.value.diagnosisList.some((diagnosis) => diagnosis.maindiseFlag === 1)) {
|
} else if (!form.value.diagnosisList.some((diagnosis) => diagnosis.maindiseFlag === 1)) {
|
||||||
proxy.$modal.msgWarning('至少添加一条主诊断');
|
proxy.$modal.msgWarning('至少添加一条主诊断');
|
||||||
} else {
|
} else {
|
||||||
|
// 保存前按排序号排序
|
||||||
|
form.value.diagnosisList.sort((a, b) => (a.diagSrtNo || 0) - (b.diagSrtNo || 0));
|
||||||
|
|
||||||
saveDiagnosis({
|
saveDiagnosis({
|
||||||
patientId: props.patientInfo.patientId,
|
patientId: props.patientInfo.patientId,
|
||||||
encounterId: props.patientInfo.encounterId,
|
encounterId: props.patientInfo.encounterId,
|
||||||
@@ -491,7 +520,7 @@ function handleSaveDiagnosis() {
|
|||||||
getTree();
|
getTree();
|
||||||
getList();
|
getList();
|
||||||
emits('diagnosisSave', false);
|
emits('diagnosisSave', false);
|
||||||
proxy.$modal.msgSuccess('诊断已保存');
|
proxy.$modal.msgSuccess('诊断已保存并按排序号排序');
|
||||||
//食源性疾病病例数据智能采集 ---START---
|
//食源性疾病病例数据智能采集 ---START---
|
||||||
isFoodDiseasesNew({
|
isFoodDiseasesNew({
|
||||||
encounterId: props.patientInfo.encounterId,
|
encounterId: props.patientInfo.encounterId,
|
||||||
@@ -566,16 +595,26 @@ function handleNodeClick(data) {
|
|||||||
proxy.$modal.msgWarning('该诊断项已存在');
|
proxy.$modal.msgWarning('该诊断项已存在');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 计算现有最大排序号
|
||||||
|
const maxSortNo = form.value.diagnosisList.length > 0
|
||||||
|
? Math.max(...form.value.diagnosisList.map(item => item.diagSrtNo || 0))
|
||||||
|
: 0;
|
||||||
|
|
||||||
form.value.diagnosisList.push({
|
form.value.diagnosisList.push({
|
||||||
ybNo: data.ybNo,
|
ybNo: data.ybNo,
|
||||||
name: data.name,
|
name: data.name,
|
||||||
verificationStatusEnum: 4,
|
verificationStatusEnum: 4,
|
||||||
medTypeCode: '11',
|
medTypeCode: '11',
|
||||||
diagSrtNo: form.value.diagnosisList.length + 1,
|
diagSrtNo: maxSortNo + 1,
|
||||||
definitionId: data.definitionId,
|
definitionId: data.definitionId,
|
||||||
diagnosisDoctor: props.patientInfo.practitionerName || props.patientInfo.doctorName || props.patientInfo.physicianName || userStore.name,
|
diagnosisDoctor: props.patientInfo.practitionerName || props.patientInfo.doctorName || props.patientInfo.physicianName || userStore.name,
|
||||||
diagnosisTime: new Date().toLocaleString('zh-CN')
|
diagnosisTime: new Date().toLocaleString('zh-CN')
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 添加后按排序号排序
|
||||||
|
form.value.diagnosisList.sort((a, b) => (a.diagSrtNo || 0) - (b.diagSrtNo || 0));
|
||||||
|
|
||||||
if (form.value.diagnosisList.length == 1) {
|
if (form.value.diagnosisList.length == 1) {
|
||||||
form.value.diagnosisList[0].maindiseFlag = 1;
|
form.value.diagnosisList[0].maindiseFlag = 1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user