解决合并冲突并优化代码结构

This commit is contained in:
2025-12-10 14:24:34 +08:00
parent 18f6a845e6
commit b863c14f2b
4 changed files with 20 additions and 270 deletions

View File

@@ -43,11 +43,7 @@ const props = defineProps({
required: true,
},
});
<<<<<<< HEAD
getList();
=======
getList();
>>>>>>> upstream/develop
function getList() {
queryParams.value.useScopeCode = 1;
getEmrTemplateList(queryParams.value).then((res) => {

View File

@@ -18,7 +18,6 @@
<plus />
</el-icon>
<el-icon
<<<<<<< HEAD
class="delete-icon"
title="删除处方单"
@click="handleDeletePrescriptionClick(index)"
@@ -31,22 +30,6 @@
<div class="summary">
<span class="summary-item">药品数: {{ getPrescriptionMedicineCount(index) }}</span>
<span class="summary-item">总价: ¥ {{ getPrescriptionTotalPrice(index) }}</span>
=======
class="add-icon"
title="删除处方"
@click="deletePrescription()"
style="font-size: 26px !important; margin-left: 10px; color: red"
>
<Delete />
</el-icon>
</div>
<div class="summary">
<span class="summary-item">
药品数:
{{ prescription.prescriptionList ? prescription.prescriptionList.length : '0' }}
</span>
<span class="summary-item">总价: ¥ {{ calculatePrescriptionTotal(pIndex) }}</span>
>>>>>>> upstream/develop
</div>
</div>
<div>
@@ -86,15 +69,10 @@
:value="item.accountId"
/>
</el-select>
<<<<<<< HEAD
<span class="doctor-station"> 配方名称 </span>
<el-input v-model="formulaName" placeholder=" " style="width: 100px" />
<span class="doctor-station"> 用药途径 </span>
<el-select v-model="methodCode" placeholder="费用性质" style="width: 120px">
=======
<span class="doctor-station"> 用法 </span>
<el-select v-model="prescription.methodCode" placeholder="用法" style="width: 120px">
>>>>>>> upstream/develop
<el-option
v-for="dict in method_code"
:key="dict.value"
@@ -224,6 +202,7 @@
<el-form-item
label="数量"
prop="minUnitQuantity"
prop="minUnitQuantity"
class="required-field"
data-prop="minUnitQuantity"
>
@@ -265,7 +244,6 @@
/>
</template>
</el-select>
<<<<<<< HEAD
<span class="doctor-station"> 脚注: </span>
<el-select
v-model="footNote"
@@ -281,25 +259,6 @@
:value="dict.value">
</el-option>
</el-select>
=======
<!-- 单次剂量 -->
<el-form-item
label="特殊煎法"
prop="dosageInstruction"
class="required-field"
data-prop="dosageInstruction"
>
<el-select
v-model="scope.row.dosageInstruction"
style="width: 90px; margin-right: 20px"
placeholder=" "
>
<template v-for="item in dosage_instruction" :key="item.value">
<el-option :value="item.value" :label="item.label" />
</template>
</el-select>
</el-form-item>
>>>>>>> upstream/develop
</div>
<span class="total-amount">
总金额:{{
@@ -503,7 +462,6 @@ const tcmPrescriptionList = ref([
const unitCodeList = ref([]);
const adviceTableRef = ref([]);
const organization = ref([]);
<<<<<<< HEAD
const conditionDefinitionId = ref('');
const encounterDiagnosisId = ref('');
const diagnosisName = ref('');
@@ -528,11 +486,6 @@ const rowRules = ref({
rateCode: [{ required: true, message: '请选择频次', trigger: 'change' }],
methodCode: [{ required: true, message: '请选择给药途径', trigger: 'change' }],
orgId: [{ required: true, message: '请选择执行科室', trigger: 'change' }],
=======
const loading = ref(false);
const rowRules = ref({
minUnitQuantity: [{ required: true, message: '请输入单次剂量', trigger: 'change' }],
>>>>>>> upstream/develop
});
const unitMap = ref({
dose: 'dose',
@@ -562,7 +515,6 @@ const inputRefs = ref({}); // 存储输入框实例
const requiredProps = ref([]); // 存储必填项 prop 顺序
const totalAmount = ref(0);
const tcmDianosis = ref();
<<<<<<< HEAD
const { method_code, unit_code, rate_code, method_of_decocting_medicine,hjerbal_footnotes,distribution_category_code } = proxy.useDict(
'method_code',
'unit_code',
@@ -594,17 +546,6 @@ const adviceTypeList = ref([
value: '',
},
]);
=======
const { method_code, unit_code, rate_code, distribution_category_code, dosage_instruction } =
proxy.useDict(
'method_code',
'unit_code',
'rate_code',
'distribution_category_code',
'dosage_instruction'
);
>>>>>>> upstream/develop
onMounted(() => {
document.addEventListener('keydown', escKeyListener);
});
@@ -630,7 +571,6 @@ function getList() {
});
}
<<<<<<< HEAD
function getListInfo(addNewRow) {
isAdding.value = false;
@@ -675,83 +615,11 @@ function getListInfo(addNewRow) {
} else {
console.error('获取医嘱列表失败或数据格式错误:', res);
prescriptionList.value = [];
=======
async function getListInfo(addNewRow) {
// 重置所有处方的添加状态
tcmPrescriptionList.value.forEach((prescription) => {
prescription.isAdding = false;
});
await getTcmAdviceList({ encounterId: props.patientInfo.encounterId }).then(async (res) => {
// 按 groupId 分组数据
const groupedData = {};
res.data.forEach((item) => {
const groupId = item.groupId || 'default';
if (!groupedData[groupId]) {
groupedData[groupId] = [];
}
groupedData[groupId].push({
...item,
doseQuantity: JSON.parse(item.contentJson)?.doseQuantity,
doseUnitCode_dictText: JSON.parse(item.contentJson)?.doseUnitCode_dictText,
});
});
await getContract({ encounterId: props.patientInfo.encounterId }).then((res) => {
contractList.value = res.data;
});
// 更新处方列表
const groupIds = Object.keys(groupedData);
tcmPrescriptionList.value = groupIds.map((groupId, index) => {
const prescription = tcmPrescriptionList.value[index] || {
prescriptionList: [],
conditionDefinitionId: '',
accountId: contractList.value[0].accountId,
methodCode: '',
rateCode: '',
dispensePerDuration: '',
chineseHerbsDoseQuantity: '',
sufferingFlag: '0',
checkAll: false,
groupIndexList: [],
expandOrder: [],
totalAmount: 0,
nextId: 1,
isAdding: false,
};
prescription.prescriptionList = groupedData[groupId];
return prescription;
});
// 如果没有处方数据,确保至少有一个空处方
if (tcmPrescriptionList.value.length === 0) {
tcmPrescriptionList.value.push({
prescriptionList: [],
conditionDefinitionId: '',
accountId: contractList.value[0].accountId,
methodCode: '',
rateCode: '',
dispensePerDuration: '',
chineseHerbsDoseQuantity: '',
sufferingFlag: '0',
checkAll: false,
groupIndexList: [],
expandOrder: [],
totalAmount: 0,
nextId: 1,
isAdding: false,
});
}
tcmPrescriptionList.value.accountId = contractList.value[0].accountId;
if (props.activeTab == 'prescription' && addNewRow) {
handleAddMedicine(0);
>>>>>>> upstream/develop
}
}).catch(error => {
console.error('获取医嘱列表异常:', error);
prescriptionList.value = [];
});
<<<<<<< HEAD
tcmDiagnosisList.value = getFromDiagnosis(props.patientInfo.encounterId);
@@ -762,11 +630,6 @@ async function getListInfo(addNewRow) {
});
accountId.value = props.patientInfo.accountId || '';
=======
tcmDiagnosisList.value = getFromDiagnosis(props.patientInfo.encounterId);
accountId.value = props.patientInfo.accountId;
>>>>>>> upstream/develop
}
function getDiagnosisInfo() {
@@ -875,32 +738,27 @@ function handleChange(value) {
adviceQueryParams.value.searchKey = value;
}
function addNewPrescription() {
tcmPrescriptionList.value.push({
prescriptionList: [],
conditionDefinitionId: '',
accountId: accountId.value,
methodCode: '',
rateCode: '',
dispensePerDuration: '',
chineseHerbsDoseQuantity: '',
sufferingFlag: '0',
checkAll: false,
groupIndexList: [],
expandOrder: [],
totalAmount: 0,
nextId: 1,
isAdding: false,
});
function openDialog() {
tcmDianosis.value.openDialog();
}
function deletePrescription(index) {
if (tcmPrescriptionList.value.length <= 1) {
proxy.$modal.msgError('至少保留一张处方');
return;
}
function deleteDiagnosisBind(id) {
const data = localStorage.getItem(`tcmDiagnosisList_${props.patientInfo.encounterId}`);
let list = [];
list = JSON.parse(data);
// 添加到列表
const index = list.findIndex((item) => item.id === id);
if (index === -1) return;
tcmPrescriptionList.value.splice(index, 1);
list.splice(index, 1);
localStorage.removeItem(`tcmDiagnosisList_${props.patientInfo.encounterId}`);
// 保存到本地缓存
localStorage.setItem(`tcmDiagnosisList_${props.patientInfo.encounterId}`, JSON.stringify(list));
getListInfo();
}
function addNewPrescription(){
tcmPrescriptionList.value.push({})
}
// 删除处方单
@@ -1103,25 +961,17 @@ function handleDelete(pIndex) {
prescription.expandOrder = [];
prescription.isAdding = false;
adviceQueryParams.value.adviceType = undefined;
groupMarkers.value = getGroupMarkers(prescriptionList.value); // 删除行会出现组号混乱的情况,所以这里重新更新标记
}
<<<<<<< HEAD
function handleNumberClick(item, index) {
prescriptionList.value[index].unitPrice = item.price;
// prescriptionList.value[index].lotNumber = item.lotNumber;
prescriptionList.value[index].locationId = item.locationId;
prescriptionList.value[index].positionId = item.locationId;
prescriptionList.value[index].positionName = item.locationName;
=======
function handleNumberClick(item, index, pIndex) {
const prescription = tcmPrescriptionList.value[pIndex];
prescription.prescriptionList[index].unitPrice = item.price;
prescription.prescriptionList[index].locationId = item.locationId;
prescription.prescriptionList[index].positionId = item.locationId;
prescription.prescriptionList[index].positionName = item.locationName;
>>>>>>> upstream/develop
}
/**
@@ -1195,7 +1045,6 @@ function handleSave(pIndex) {
}
// 单行处方保存
<<<<<<< HEAD
function handleSaveSign(row, index) {
try {
// 直接执行保存逻辑,不再进行表单验证
@@ -1269,37 +1118,6 @@ function handleSaveSign(row, index) {
function handleSaveBatch() {
let saveList = prescriptionList.value
=======
function handleSaveSign(row, index, pIndex) {
const prescription = tcmPrescriptionList.value[pIndex];
const formRefName = 'formRef' + pIndex + '-' + index;
proxy.$refs[formRefName][0].validate((valid) => {
row.isEdit = false;
prescription.isAdding = false;
prescription.expandOrder = [];
row.contentJson = undefined;
row.patientId = props.patientInfo.patientId;
row.encounterId = props.patientInfo.encounterId;
row.accountId = prescription.accountId;
row.quantity = row.minUnitQuantity;
row.conditionId = prescription.conditionId;
row.unitPrice =
row.unitCodeList.find((item) => item.value == row.unitCode).type == 'unit'
? row.unitPrice
: new Decimal(row.unitPrice).div(row.partPercent).toFixed(2);
row.conditionDefinitionId = prescription.conditionDefinitionId;
row.encounterDiagnosisId = prescription.encounterDiagnosisId;
row.diagnosisName = prescription.diagnosisName;
row.contentJson = JSON.stringify(row);
});
}
function handleSaveBatch(pIndex) {
const prescription = tcmPrescriptionList.value[pIndex];
let timestamp = new Date().getTime();
let saveList = prescription.prescriptionList
>>>>>>> upstream/develop
.filter((item) => {
return item.statusEnum == 1;
})

View File

@@ -2,7 +2,6 @@
<div>
<el-row :gutter="24">
<el-col :span="4" :xs="24">
<<<<<<< HEAD
<el-input
v-model="diagnosis"
placeholder="诊断名称"
@@ -24,18 +23,6 @@
:filter-node-method="filterNode"
@node-click="handleNodeClick"
>
=======
<div style="height: 44px; display: flex; align-items: center; flex: none">
<el-input v-model="diagnosis" placeholder="诊断名称" clearable style="width: 100%"
@keyup.enter="queryDiagnosisUse">
<template #append>
<el-button icon="Search" @click="queryDiagnosisUse" />
</template>
</el-input>
</div>
<el-tree ref="treeRef" :data="tree" node-key="id" :props="{ label: 'name', children: 'children' }"
highlight-current default-expand-all :filter-node-method="filterNode" @node-click="handleNodeClick">
>>>>>>> upstream/develop
<template #default="{ node, data }">
<div class="custom-tree-node">
<span>{{ node.label }}</span>
@@ -118,7 +105,6 @@
<el-table-column label="诊断代码" align="center" prop="ybNo" width="180" />
<el-table-column label="诊断类型" align="center" prop="maindiseFlag" width="120">
<template #default="scope">
<<<<<<< HEAD
<div style="display:flex;flex-direction:column;align-items:center;gap:5px;">
<el-checkbox
label="主诊断"
@@ -141,14 +127,6 @@
:label="item.label"
:value="item.value"
/>
=======
<el-checkbox label="主诊断" :trueLabel="1" :falseLabel="0" v-model="scope.row.maindiseFlag" border
size="small" @change="(value) => handleMaindise(value, scope.$index)" />
<el-select v-model="scope.row.verificationStatusEnum" placeholder=" "
style="width: 40%; padding-bottom: 5px; padding-left: 10px" size="small">
<el-option v-for="item in diagnosisOptions" :key="item.value" :label="item.label"
:value="item.value" />
>>>>>>> upstream/develop
</el-select>
</div>
</template>
@@ -164,7 +142,6 @@
</el-form>
</el-col>
</el-row>
<<<<<<< HEAD
<diagnosisdialog
:openDiagnosis="openDiagnosis"
@close="closeDiagnosisDialog"
@@ -175,11 +152,6 @@
:patientInfo="props.patientInfo"
@close="closeDiagnosisDialog"
/>
=======
<diagnosisdialog :openDiagnosis="openDiagnosis" @close="closeDiagnosisDialog" :radio="orgOrUser" />
<AddDiagnosisDialog :openAddDiagnosisDialog="openAddDiagnosisDialog" :patientInfo="patientInfo"
@close="closeDiagnosisDialog" />
>>>>>>> upstream/develop
</div>
</template>

View File

@@ -701,7 +701,6 @@ import {
addBatch, //保存批量盘点
productStocktakingApproved,
reject,
<<<<<<< HEAD
getpharmacyCabinetList
} from "../components/api";
import PopoverList from "@/components/OpenHis/popoverList/index.vue";
@@ -709,14 +708,6 @@ import MedicineList from "../components/medicineList.vue";
import TraceNoDialog from '@/components/OpenHis/TraceNoDialog/index.vue'
import { formatDate,formatDateymd } from "@/utils/index";
import { ref } from "vue";
=======
} from '../components/api';
import PopoverList from '@/components/OpenHis/popoverList/index.vue';
import MedicineList from '../components/medicineList.vue';
import TraceNoDialog from '@/components/OpenHis/TraceNoDialog/index.vue';
import { formatDate, formatDateymd } from '@/utils/index';
import { ref } from 'vue';
>>>>>>> upstream/develop
const router = useRouter();
const route = useRoute();
@@ -2174,13 +2165,7 @@ function getStockReceiptTypeList() {
console.log('详情页查询下拉树response1111111', response);
// categoryListOptions.value = response.data.categoryListOptions; // 药品类型
<<<<<<< HEAD
profitReasonOptions.value = response.data.profitReasonOptions; // 盈亏原因
=======
profitReasonOptions.value = response.data.profitReasonOptions; // 盈亏原因
// receiptHeaderForm.purposeTypeEnum = warehous_type.value[0].value // 仓库类型默认值
// handleChangePurposeTypeEnum(receiptHeaderForm.purposeTypeEnum)
>>>>>>> upstream/develop
// cabinetListOptionsBk.value = response.data.purposeTypeListOptions; // 盘点仓库列表(未过滤)
// purposeTypeListOptions.value = cabinetListOptionsBk.value.filter(item => item.formEnum === receiptHeaderForm.purposeTypeEnum) // 盘点仓库列表
@@ -2291,7 +2276,6 @@ function totalQuantityChange(rowData, index, value) {
editBatchTransfer(index);
}
// 切换仓库类型获取药房/药库列表 目的仓库切换
<<<<<<< HEAD
function handleChangePurposeTypeEnum(value,type) {
// 确保value是数字类型
const numValue = Number(value);
@@ -2315,26 +2299,6 @@ function handleChangePurposeTypeEnum(value,type) {
console.error('获取仓库列表失败:', error);
purposeTypeListOptions.value = [];
freightListOptions.value = [];
=======
function handleChangePurposeTypeEnum(value, type) {
if (value == 16) {
getPharmacyList().then((res) => {
purposeTypeListOptions.value = res.data;
if (!route.query.supplyBusNo && !type) {
receiptHeaderForm.purposeLocationId = '';
receiptHeaderForm.purposeLocationId1 = '';
}
// getinitValue()
});
} else if (value == 11) {
getDispensaryList().then((res) => {
purposeTypeListOptions.value = res.data;
if (!route.query.supplyBusNo && !type) {
receiptHeaderForm.purposeLocationId = '';
receiptHeaderForm.purposeLocationId1 = '';
}
// getinitValue()
>>>>>>> upstream/develop
});
} else if (numValue === 17) {
// 处理耗材库类型