-
+
@@ -15,8 +16,8 @@
import { ref, watch, toRefs, onMounted, computed } from 'vue'
import { inputmdl } from "@/api/liswork/work/LisWork";
import CustomTable from '@/components/elTable/index.vue'
-
-
+import emitter from '@/utils/mitt'
+import { useCommonStore } from '@/store/modules/commonStore';
const props = defineProps({
// 主键
queryParams: {
@@ -24,7 +25,7 @@ const props = defineProps({
default: {}
},
})
-
+const mbStore = useCommonStore();
const { queryParams } = toRefs(props);
const tableData = ref([])
const columns = ref([
@@ -46,15 +47,28 @@ const tableConfig = ref({
const getCombination = () => {
inputmdl(queryParams.value).then((res: any) => {
if (res.code == 0) {
- tableData.value = res.data || []
+ tableData.value = res.data?.map((item: any) => {
+ return {
+ ...item,
+ lxsr: mbStore.lxsrs.includes(item.mbmc) ? true : false,
+ }
+ })
}
})
};
-watch(() => props.queryParams, (newValue) => {
+watch(() => props.queryParams.yq, (newValue) => {
getCombination()
}, { immediate: true })
-// 解构 props
+const changeLxsr = (row: any) => {
+ const lxsrs = tableData.value.filter((item: any) => item.lxsr).map((item: any) => item.mbmc);
+ console.log('lxsrs==>', lxsrs);
+ mbStore.setLxsrList(lxsrs);
+}
+
+const handleRowDblclick = (row: any) => {
+ emitter.emit('dbMbHandle', row);
+}
diff --git a/src/views/liswork/work/components/labpat copy.vue b/src/views/liswork/work/components/labpat copy.vue
index ba7b559..593fab5 100644
--- a/src/views/liswork/work/components/labpat copy.vue
+++ b/src/views/liswork/work/components/labpat copy.vue
@@ -55,7 +55,7 @@
-
diff --git a/src/views/liswork/work/components/labpat.vue b/src/views/liswork/work/components/labpat.vue
index e675eb8..da64d73 100644
--- a/src/views/liswork/work/components/labpat.vue
+++ b/src/views/liswork/work/components/labpat.vue
@@ -14,24 +14,22 @@
+ label="label" value="value" objKey="value" :border="true" size="small"
+ @getDataValue="handleFieldChange" />
- 急诊
-
+ 急诊
+
-
+
-
+
@@ -53,13 +51,11 @@
+ value="userName" objKey="userName" :border="true" size="small" @getDataValue="getJyysData" placeholder="" />
+ value="userName" objKey="userName" :border="true" size="small" @getDataValue="getHdysData" placeholder="" />
@@ -119,6 +115,7 @@ import SelectTable from '@/components/SelectTable/index.vue';
// @ts-ignore
import { listUser } from '@/api/system/user.js'
import { PropType } from 'vue';
+import emitter from '@/utils/mitt';
interface LabSysItem {
kj: string;
@@ -152,9 +149,10 @@ const sqhRef = ref();
watch(() => props.labPat, (newVal) => {
lastValue.value = JSON.stringify(newVal);
lastJgbz.value = newVal.jgbz;
+ sqhValue.value = '';
})
-const emit = defineEmits(['update:labPat', 'getLabList', 'changeStatus']);
+const emit = defineEmits(['update:labPat', 'changeStatus']);
const lastValue = ref('');
const brlyFields = ref([
@@ -250,6 +248,7 @@ const getHdysData = (data: any) => {
})
}
+
/**
* 通用字段变化处理(失焦、回车触发)
*/
@@ -258,6 +257,7 @@ const handleFieldChange = async () => {
const currentValue = JSON.stringify(props.labPat);
// 对比与上一次保存的值是否有变化
if (currentValue !== lastValue.value) {
+ emitter.emit('saveLab');
// 找出变化的字段
const oldObj = JSON.parse(lastValue.value);
const newObj = props.labPat;
@@ -265,44 +265,7 @@ const handleFieldChange = async () => {
if (changedField) {
// 这里可以添加实际的更新逻辑,比如调用接口
try {
- if (props.labPat.id) {
- updateLabPat({ ...props.labPatKey, ...props.labPat }).then((res: any) => {
- if (res.code == 0) {
- emit('getLabList', newObj);
- if (sqhFlag.value) {
- sqhValue.value = ''
- sqhRef.value.focus()
- }
-
- if (res.data) {
- emit('update:labPat', res.data)
- emit("changeStatus", props.labPat, sqhFlag.value);
- } else {
- emit("changeStatus", props.labPat, sqhFlag.value);
- }
- sqhFlag.value = false
- }
- })
- } else {
- changepatcolumn({ ...props.labPatKey, column: changedField?.field, value: changedField?.newValue }).then((res: any) => {
- if (res.code == 0) {
- if (sqhFlag.value) {
- sqhValue.value = ''
- sqhRef.value.focus()
- }
-
- if (res.data) {
- emit('update:labPat', res.data)
- emit("changeStatus", props.labPat, sqhFlag.value);
- } else {
- emit("changeStatus", props.labPat, sqhFlag.value);
- }
-
- sqhFlag.value = false
- }
- })
- }
-
+ saveLabPat(changedField)
} catch (error) {
console.error('更新失败:', error);
// 失败时可以恢复旧值
@@ -312,6 +275,47 @@ const handleFieldChange = async () => {
}
}
};
+// 保存病人信息
+const saveLabPat = async (changedField: any) => {
+ if (props.labPat.id) {
+ updateLabPat({ ...props.labPatKey, ...props.labPat }).then((res: any) => {
+ if (res.code == 0) {
+ if (sqhFlag.value) {
+ sqhValue.value = ''
+ sqhRef.value.focus()
+ }
+
+ if (res.data) {
+ emit('update:labPat', res.data)
+ emit("changeStatus", res.data, sqhFlag.value);
+ } else {
+ emit("changeStatus", props.labPat, sqhFlag.value);
+ }
+ sqhFlag.value = false
+ }
+ })
+ } else {
+ if (!changedField) return
+ changepatcolumn({ ...props.labPatKey, column: changedField?.field, value: changedField?.newValue }).then((res: any) => {
+ if (res.code == 0) {
+ if (sqhFlag.value) {
+ sqhValue.value = ''
+ sqhRef.value.focus()
+ }
+
+ if (res.data) {
+ emit('update:labPat', res.data)
+ emit("changeStatus", props.labPat, sqhFlag.value);
+ } else {
+ emit("changeStatus", props.labPat, sqhFlag.value);
+ }
+
+ sqhFlag.value = false
+ }
+ })
+ }
+
+};
// 完善字段变化检测方法
const getChangedField = (oldObj: { [key: string]: any }, newObj: { [key: string]: any }) => {
@@ -379,6 +383,11 @@ onMounted(() => {
listUser(data).then((res: any) => {
userList.value = res.rows;
});
+
+ // 监听保存病人结果
+ emitter.on('saveResult', () => {
+ saveLabPat(null)
+ })
})
diff --git a/src/views/liswork/work/components/labpatlist.vue b/src/views/liswork/work/components/labpatlist.vue
index 6c8188e..7335a3f 100644
--- a/src/views/liswork/work/components/labpatlist.vue
+++ b/src/views/liswork/work/components/labpatlist.vue
@@ -2,7 +2,7 @@
@@ -19,12 +19,18 @@
{{ formatDict(row.brly, 'PT') }}
+
+ {{ row.brxm }}
+
{{ formatDict(row.brxb, 'SX') }}
{{ formatDict(row.nldw, 'AU') }}
+
+ {{ formatDict(row.yblx, 'BT') }}
+
{{ formatDict(row.ksdh, 'DP') }}
@@ -54,6 +60,7 @@
diff --git a/src/views/mzcx/blood/index.vue b/src/views/mzcx/blood/index.vue
index 9ea1a1a..9bbef75 100644
--- a/src/views/mzcx/blood/index.vue
+++ b/src/views/mzcx/blood/index.vue
@@ -539,7 +539,7 @@ onMounted(async () => {
// 字典格式化方法
const formatDict = (v: string, dictType: string) => {
- return dictData.value[dictType]?.find((item: any) => item.value == v)?.label;
+ return dictData.value[dictType]?.find((item: any) => item.value == v)?.label || v;
};
diff --git a/src/views/mzcx/charge/index.vue b/src/views/mzcx/charge/index.vue
index 1416c30..bd326cd 100644
--- a/src/views/mzcx/charge/index.vue
+++ b/src/views/mzcx/charge/index.vue
@@ -615,7 +615,7 @@ onMounted(async () => {
// 字典格式化方法
const formatDict = (v: string, dictType: string) => {
- return dictData.value[dictType]?.find((item: any) => item.value == v)?.label;
+ return dictData.value[dictType]?.find((item: any) => item.value == v)?.label || v;
};