前端最新版本同步
This commit is contained in:
@@ -78,6 +78,7 @@
|
||||
>
|
||||
<el-table-column prop="patientName" label="姓名" width="130" align="center" />
|
||||
<el-table-column prop="genderEnum_enumText" label="性别" width="80" align="center" />
|
||||
<el-table-column prop="age" label="年龄" width="80" align="center" />
|
||||
<el-table-column prop="receptionTime" label="就诊日期" align="center">
|
||||
<template #default="scope">
|
||||
{{ scope.row.receptionTime ? formatDate(scope.row.receptionTime) : '-' }}
|
||||
@@ -100,7 +101,7 @@
|
||||
<!-- <el-button type="success" plain @click="print" icon="Printer" style="margin-left: 30px;">打印</el-button> -->
|
||||
<!-- </div> -->
|
||||
<div class="top">
|
||||
<el-descriptions :column="4" title="患者基本信息">
|
||||
<!-- <el-descriptions :column="4" title="患者基本信息">
|
||||
<el-descriptions-item label="姓名:">{{ personInfo.patientName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="性别:">
|
||||
{{ personInfo.genderEnum_enumText }}
|
||||
@@ -119,7 +120,7 @@
|
||||
<el-descriptions-item label="总金额:">
|
||||
{{ personInfo.totalPrice ? personInfo.totalPrice.toFixed(2) : '0.00' }}元
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-descriptions> -->
|
||||
<!-- <el-row>
|
||||
<el-col :span="4">姓名:{{ personInfo.patientName }}</el-col>
|
||||
<el-col :span="3">性别:{{ personInfo.genderEnum_enumText }}</el-col>
|
||||
@@ -173,6 +174,19 @@
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
<span style="color: #606266; font-size: 14px; font-weight: 700; margin-right: 15px">
|
||||
项目
|
||||
</span>
|
||||
<el-select
|
||||
v-model="projectTypeCode"
|
||||
placeholder="项目"
|
||||
style="width: 160px"
|
||||
@change="getMedicineList(currentRow.encounterId)"
|
||||
>
|
||||
<el-option label="全部" value="1" />
|
||||
<el-option label="药品" value="2" />
|
||||
<el-option label="耗材" value="3" />
|
||||
</el-select>
|
||||
<el-button
|
||||
:disabled="medicineInfoList && medicineInfoList.length == 0"
|
||||
type="primary"
|
||||
@@ -182,13 +196,12 @@
|
||||
批量发药
|
||||
</el-button>
|
||||
<el-button type="primary" @click="handleScan()" style="margin-left: 30px"> 扫码 </el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="printPrescription()"
|
||||
style="margin-left: 30px"
|
||||
>
|
||||
<el-button type="primary" @click="printPrescription()" style="margin-left: 30px">
|
||||
处方打印
|
||||
</el-button>
|
||||
<div style="position: absolute; top: 30px; right: 25px">
|
||||
总金额:{{ medicineTotalPrice ? medicineTotalPrice.toFixed(2) : '0.00' }}元
|
||||
</div>
|
||||
</div>
|
||||
<el-table
|
||||
:data="medicineInfoList"
|
||||
@@ -200,8 +213,8 @@
|
||||
ref="tableRef"
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center" fixed="left" />
|
||||
<el-table-column prop="prescriptionNo" label="处方号" width="140" align="center" />
|
||||
<el-table-column prop="medicineName" label="药品名称" width="180" align="center" />
|
||||
<el-table-column prop="prescriptionNo" label="处方号" width="120" align="center" />
|
||||
<el-table-column prop="itemName" label="项目名称" width="160" align="center" />
|
||||
<el-table-column prop="statusEnum_enumText" label="发药状态" width="100" align="center">
|
||||
<template #default="scope">
|
||||
<el-tag :type="tagType(scope.row.statusEnum)">
|
||||
@@ -221,7 +234,7 @@
|
||||
<el-table-column
|
||||
prop="doseUnitCode_dictText"
|
||||
label="单次剂量"
|
||||
width="100"
|
||||
width="80"
|
||||
align="center"
|
||||
v-if="tcmFlag == '0'"
|
||||
>
|
||||
@@ -260,7 +273,7 @@
|
||||
align="right"
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column prop="departmentName" label="科室" width="90" align="center" />
|
||||
<el-table-column prop="locationName" label="发药药房" width="90" align="center" />
|
||||
<el-table-column prop="doctorName" label="开单医生" width="100" align="center" />
|
||||
<el-table-column prop="conditionName" label="诊断" width="120" align="center" />
|
||||
<!-- <el-table-column prop="dose" label="剂量" width="100" align="center" /> -->
|
||||
@@ -354,7 +367,11 @@ import {
|
||||
backMedicion,
|
||||
prepareMedicion,
|
||||
itemTraceNo,
|
||||
getReportRegisterInit,
|
||||
deviceDispense,
|
||||
deviceInvalid,
|
||||
} from './components/api';
|
||||
import { advicePrint } from '@/api/public';
|
||||
import { formatDate, formatDateStr } from '@/utils/index';
|
||||
import { debounce } from 'lodash-es';
|
||||
import TraceNoDialog from '@/components/OpenHis/TraceNoDialog/index.vue';
|
||||
@@ -390,6 +407,9 @@ const isManualSelection = ref(false);
|
||||
const groups = ref({});
|
||||
const openTraceNoDialog = ref(false);
|
||||
const ypName = ref('');
|
||||
const medicineTotalPrice = ref(0);
|
||||
const projectTypeCode = ref('1');
|
||||
const selectedRow = ref(null);
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
const medCategoryCode = ref([
|
||||
@@ -411,6 +431,7 @@ const data = reactive({
|
||||
condition: null,
|
||||
departmentId: null,
|
||||
statusEnum: 3,
|
||||
classEnum: 2,
|
||||
},
|
||||
});
|
||||
const { queryParams } = toRefs(data);
|
||||
@@ -475,7 +496,7 @@ function getList() {
|
||||
backReason.value = response.data.notPerformedReasonOptions;
|
||||
dispenseStatusOptions.value = response.data.dispenseStatusOptions;
|
||||
preparerDoctorOptions.value = response.data.preparerDoctorOptions;
|
||||
preparerDoctor.value = preparerDoctorOptions.value[1].value;
|
||||
preparerDoctor.value = preparerDoctorOptions.value[0].value;
|
||||
});
|
||||
}
|
||||
//打印中西药处方
|
||||
@@ -485,7 +506,53 @@ async function printPrescription() {
|
||||
proxy.$modal.msgWarning('未选择要打印的项目,请重新选择,打印失败');
|
||||
return;
|
||||
}
|
||||
console.log(selectedRows, personInfo, 'selectedRows');
|
||||
let requestIds = selectedRows.map((item) => item.requestId).join(',');
|
||||
const result = [];
|
||||
advicePrint({ requestIds: requestIds, isPrescription: '1' }).then((res) => {
|
||||
const groupedRows = {};
|
||||
res.data.adviceItemList.forEach((row) => {
|
||||
const prescriptionNo = row.prescriptionNo;
|
||||
if (!groupedRows[prescriptionNo]) {
|
||||
groupedRows[prescriptionNo] = [];
|
||||
}
|
||||
row.contractName = res.data.contractName;
|
||||
groupedRows[prescriptionNo].push(row);
|
||||
});
|
||||
|
||||
console.log('按处方号分组的结果:', groupedRows);
|
||||
|
||||
// 如果您需要将分组后的数据转换为数组形式
|
||||
const groupedArray = Object.values(groupedRows);
|
||||
console.log('分组后的数组形式:', groupedArray);
|
||||
|
||||
groupedArray.forEach((item, index) => {
|
||||
const total = item.reduce((sum, item) => {
|
||||
return sum + (item.totalPrice || 0);
|
||||
}, 0);
|
||||
result.push({
|
||||
...res.data,
|
||||
medTotalAmount: total,
|
||||
prescriptionList: item,
|
||||
});
|
||||
});
|
||||
console.log(result, 'result');
|
||||
const printElements = templateJson;
|
||||
var hiprintTemplate = new hiprint.PrintTemplate({ template: printElements }); // 定义模板
|
||||
hiprintTemplate.print2(result, {
|
||||
title: '打印标题',
|
||||
height: 210,
|
||||
width: 148,
|
||||
}); //开始打印
|
||||
// 直接打印回调
|
||||
// 发送任务到打印机成功
|
||||
hiprintTemplate.on('printSuccess', function (e) {
|
||||
console.log('打印成功');
|
||||
});
|
||||
// 发送任务到打印机失败
|
||||
hiprintTemplate.on('printError', function (e) {
|
||||
console.log('打印失败');
|
||||
});
|
||||
});
|
||||
// 计算总价
|
||||
// const result = {
|
||||
// data: selectedRows.map((item) => ({
|
||||
@@ -502,55 +569,41 @@ async function printPrescription() {
|
||||
// })),
|
||||
// };
|
||||
// 按 prescriptionNo 分组
|
||||
const groupedRows = {};
|
||||
selectedRows.forEach(row => {
|
||||
const prescriptionNo = row.prescriptionNo;
|
||||
if (!groupedRows[prescriptionNo]) {
|
||||
groupedRows[prescriptionNo] = [];
|
||||
}
|
||||
groupedRows[prescriptionNo].push(row);
|
||||
});
|
||||
|
||||
console.log('按处方号分组的结果:', groupedRows);
|
||||
|
||||
// 如果您需要将分组后的数据转换为数组形式
|
||||
const groupedArray = Object.values(groupedRows);
|
||||
console.log('分组后的数组形式:', groupedArray);
|
||||
// const groupedRows = {};
|
||||
// selectedRows.forEach(row => {
|
||||
// const prescriptionNo = row.prescriptionNo;
|
||||
// if (!groupedRows[prescriptionNo]) {
|
||||
// groupedRows[prescriptionNo] = [];
|
||||
// }
|
||||
// row.contractName = personInfo.value.contractName;
|
||||
// groupedRows[prescriptionNo].push(row);
|
||||
// });
|
||||
|
||||
const result = [];
|
||||
groupedArray.forEach((item, index) => {
|
||||
result.push({
|
||||
...personInfo.value,
|
||||
prescriptionNo: item[0].prescriptionNo,
|
||||
reqAuthoredTime: item[0].reqAuthoredTime,
|
||||
prescriptionList: item,
|
||||
})
|
||||
})
|
||||
// console.log('按处方号分组的结果:', groupedRows);
|
||||
|
||||
// // 如果您需要将分组后的数据转换为数组形式
|
||||
// const groupedArray = Object.values(groupedRows);
|
||||
// console.log('分组后的数组形式:', groupedArray);
|
||||
|
||||
// const result = [];
|
||||
// groupedArray.forEach((item, index) => {
|
||||
// const total = item.reduce((sum, item) => {
|
||||
// return sum + (item.totalPrice || 0);
|
||||
// }, 0);
|
||||
// result.push({
|
||||
// ...personInfo.value,
|
||||
// medTotalAmount: total,
|
||||
// doctor: item[0].doctorName,
|
||||
// prescriptionNo: item[0].prescriptionNo,
|
||||
// reqAuthoredTime: item[0].reqAuthoredTime,
|
||||
// prescriptionList: item,
|
||||
// })
|
||||
// })
|
||||
|
||||
// 将对象转换为 JSON 字符串
|
||||
// let jsonString = JSON.stringify(result, null, 2);
|
||||
console.log(result, 'result');
|
||||
// 模板对象获取
|
||||
|
||||
const printElements = templateJson;
|
||||
var hiprintTemplate = new hiprint.PrintTemplate({ template: printElements }); // 定义模板
|
||||
const printerList = hiprintTemplate.getPrinterList();
|
||||
console.log(hiprintTemplate, '打印机列表');
|
||||
hiprintTemplate.print2(result, {
|
||||
printer: 'Microsoft Print to PDF',
|
||||
title: '打印标题',
|
||||
height: 210,
|
||||
width: 148,
|
||||
}); //开始打印
|
||||
// 直接打印回调
|
||||
// 发送任务到打印机成功
|
||||
hiprintTemplate.on('printSuccess', function (e) {
|
||||
console.log('打印成功');
|
||||
})
|
||||
// 发送任务到打印机失败
|
||||
hiprintTemplate.on('printError', function (e) {
|
||||
console.log('打印失败');
|
||||
})
|
||||
// 模板对象获取
|
||||
|
||||
// await CefSharp.BindObjectAsync('boundAsync');
|
||||
// await boundAsync
|
||||
@@ -632,25 +685,27 @@ function getRowMarkers(groupCounts, data) {
|
||||
function spanMethod({ row, column, rowIndex, columnIndex }) {
|
||||
// 定义需要合并的列范围(前6列,包括selection列)
|
||||
const columnsToMerge = [1, 16]; // 假设selection列是第0列,其他列依次是1, 2, 3, 4, 5
|
||||
|
||||
console.log(row);
|
||||
// 检查当前列是否在需要合并的列范围内
|
||||
if (columnsToMerge.includes(columnIndex)) {
|
||||
const prescriptionNo = row.prescriptionNo;
|
||||
if (row.prescriptionNo) {
|
||||
if (columnsToMerge.includes(columnIndex)) {
|
||||
const prescriptionNo = row.prescriptionNo;
|
||||
|
||||
// 查找当前处方号在列表中第一次出现的索引
|
||||
const firstRowIndex = medicineInfoList.value.findIndex(
|
||||
(item) => item.prescriptionNo === prescriptionNo
|
||||
);
|
||||
|
||||
// 如果当前行是该处方号的首行,则合并count行
|
||||
if (rowIndex === firstRowIndex) {
|
||||
// 计算该处方号的总行数
|
||||
const count = medicineInfoList.value.filter(
|
||||
// 查找当前处方号在列表中第一次出现的索引
|
||||
const firstRowIndex = medicineInfoList.value.findIndex(
|
||||
(item) => item.prescriptionNo === prescriptionNo
|
||||
).length;
|
||||
return [count, 1]; // 合并count行,1列
|
||||
} else {
|
||||
return [0, 0]; // 其他行不显示
|
||||
);
|
||||
|
||||
// 如果当前行是该处方号的首行,则合并count行
|
||||
if (rowIndex === firstRowIndex) {
|
||||
// 计算该处方号的总行数
|
||||
const count = medicineInfoList.value.filter(
|
||||
(item) => item.prescriptionNo === prescriptionNo
|
||||
).length;
|
||||
return [count, 1]; // 合并count行,1列
|
||||
} else {
|
||||
return [0, 0]; // 其他行不显示
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -661,7 +716,7 @@ function spanMethod({ row, column, rowIndex, columnIndex }) {
|
||||
function handleSelectionChange(selectedRows, currentRow) {
|
||||
medicineInfoList.value
|
||||
.filter((item) => {
|
||||
return item.prescriptionNo == currentRow.prescriptionNo;
|
||||
return item.dispenseId == currentRow.dispenseId;
|
||||
})
|
||||
.forEach((item, index) => {
|
||||
tableRef.value.toggleRowSelection(item, selectedRows.includes(currentRow));
|
||||
@@ -696,76 +751,190 @@ function handleCurrentChange(row) {
|
||||
}
|
||||
|
||||
function getMedicineList(encounterId) {
|
||||
listWesternmedicine({
|
||||
encounterId: encounterId,
|
||||
statusEnum: queryParams.value.statusEnum,
|
||||
tcmFlag: tcmFlag.value,
|
||||
}).then((response) => {
|
||||
console.log('121212', response);
|
||||
personInfo.value = response.data.prescriptionPatientInfoDto;
|
||||
medicineInfoList.value = Array.isArray(response.data.prescriptionMedicineInfoDtoList)
|
||||
? response.data.prescriptionMedicineInfoDtoList
|
||||
: [response.data.prescriptionMedicineInfoDtoList];
|
||||
// 创建分组映射表
|
||||
const groupMap = {};
|
||||
medicineInfoList.value.forEach((item) => {
|
||||
const groupId = item.groupId; // 确保属性名一致
|
||||
if (groupId != null) {
|
||||
// 过滤掉null/undefined
|
||||
groupMap[groupId] = groupMap[groupId] || [];
|
||||
groupMap[groupId].push(item);
|
||||
}
|
||||
});
|
||||
// 根据projectTypeCode的值决定调用哪些接口
|
||||
if (projectTypeCode.value == 1) {
|
||||
// 同时调用两个接口并将数据合并显示
|
||||
Promise.all([
|
||||
listWesternmedicine({
|
||||
pageNo: 1,
|
||||
pageSize: 100,
|
||||
encounterId: encounterId,
|
||||
statusEnum: queryParams.value.statusEnum,
|
||||
tcmFlag: tcmFlag.value,
|
||||
}),
|
||||
getReportRegisterInit({
|
||||
pageNo: 1,
|
||||
pageSize: 100,
|
||||
encounterId: encounterId,
|
||||
statusEnum: queryParams.value.statusEnum,
|
||||
tcmFlag: tcmFlag.value,
|
||||
}),
|
||||
])
|
||||
.then(([westernRes, reportRes]) => {
|
||||
// 合并两个接口的数据
|
||||
let westernData = Array.isArray(westernRes.data.records)
|
||||
? westernRes.data.records
|
||||
: [westernRes.data.records];
|
||||
|
||||
// 处理每个分组
|
||||
Object.values(groupMap).forEach((group) => {
|
||||
const count = group.length;
|
||||
if (count === 2) {
|
||||
group[0].flag = '┓';
|
||||
group[1].flag = '┛';
|
||||
} else if (count > 2) {
|
||||
group[0].flag = '┓';
|
||||
group.slice(1, -1).forEach((item) => (item.flag = '┃')); // 中间元素
|
||||
group[group.length - 1].flag = '┛';
|
||||
}
|
||||
});
|
||||
let reportData = Array.isArray(reportRes.data.records)
|
||||
? reportRes.data.records
|
||||
: [reportRes.data.records];
|
||||
|
||||
// 处理没有分组的项
|
||||
medicineInfoList.value.forEach((item) => {
|
||||
if (item.groupId == null) {
|
||||
// 确保属性名一致
|
||||
item.flag = '';
|
||||
} else if (!item.flag) {
|
||||
// 确保所有项都有flag属性
|
||||
item.flag = '';
|
||||
}
|
||||
});
|
||||
// 合并数据
|
||||
medicineInfoList.value = [...westernData, ...reportData];
|
||||
|
||||
diagnoses.value = medicineInfoList.value.map((item) => item.诊断 || '无').join(', ');
|
||||
// 处理合并后的数据
|
||||
processMedicineListData();
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('获取数据失败:', error);
|
||||
proxy.$modal.msgError('获取数据失败');
|
||||
});
|
||||
} else if (projectTypeCode.value == 2) {
|
||||
// 只调用listWesternmedicine接口
|
||||
listWesternmedicine({
|
||||
pageNo: 1,
|
||||
pageSize: 100,
|
||||
encounterId: encounterId,
|
||||
statusEnum: queryParams.value.statusEnum,
|
||||
tcmFlag: tcmFlag.value,
|
||||
}).then((response) => {
|
||||
console.log('121212', response);
|
||||
// personInfo.value = response.data.prescriptionPatientInfoDto;
|
||||
medicineInfoList.value = Array.isArray(response.data.records)
|
||||
? response.data.records
|
||||
: [response.data.records];
|
||||
|
||||
// 处理数据
|
||||
processMedicineListData();
|
||||
});
|
||||
} else if (projectTypeCode.value == 3) {
|
||||
// 只调用getReportRegisterInit接口
|
||||
getReportRegisterInit({
|
||||
encounterId: encounterId,
|
||||
statusEnum: queryParams.value.statusEnum,
|
||||
tcmFlag: tcmFlag.value,
|
||||
}).then((response) => {
|
||||
medicineInfoList.value = Array.isArray(response.data.records)
|
||||
? response.data.records
|
||||
: [response.data.records];
|
||||
|
||||
// 处理数据
|
||||
processMedicineListData();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 提取公共的数据处理逻辑
|
||||
function processMedicineListData() {
|
||||
// 创建分组映射表
|
||||
const groupMap = {};
|
||||
medicineTotalPrice.value = 0;
|
||||
medicineInfoList.value.forEach((item) => {
|
||||
const groupId = item.groupId; // 确保属性名一致
|
||||
medicineTotalPrice.value = medicineTotalPrice.value + item.totalPrice;
|
||||
if (groupId != null) {
|
||||
// 过滤掉null/undefined
|
||||
groupMap[groupId] = groupMap[groupId] || [];
|
||||
groupMap[groupId].push(item);
|
||||
}
|
||||
});
|
||||
|
||||
// 处理每个分组
|
||||
Object.values(groupMap).forEach((group) => {
|
||||
const count = group.length;
|
||||
if (count === 2) {
|
||||
group[0].flag = '┓';
|
||||
group[1].flag = '┛';
|
||||
} else if (count > 2) {
|
||||
group[0].flag = '┓';
|
||||
group.slice(1, -1).forEach((item) => (item.flag = '┃')); // 中间元素
|
||||
group[group.length - 1].flag = '┛';
|
||||
}
|
||||
});
|
||||
|
||||
// 处理没有分组的项
|
||||
medicineInfoList.value.forEach((item) => {
|
||||
if (item.groupId == null) {
|
||||
// 确保属性名一致
|
||||
item.flag = '';
|
||||
} else if (!item.flag) {
|
||||
// 确保所有项都有flag属性
|
||||
item.flag = '';
|
||||
}
|
||||
});
|
||||
|
||||
diagnoses.value = medicineInfoList.value.map((item) => item.诊断 || '无').join(', ');
|
||||
}
|
||||
|
||||
function submitMedicine(saveList) {
|
||||
prepareMedicion(saveList).then((res) => {
|
||||
if (res.code == 200) {
|
||||
updateMedicion(saveList).then((response) => {
|
||||
proxy.$modal.msgSuccess('发药成功');
|
||||
listWesternmedicine({
|
||||
encounterId: currentRow.value.encounterId,
|
||||
statusEnum: queryParams.value.statusEnum,
|
||||
tcmFlag: tcmFlag.value,
|
||||
}).then((response) => {
|
||||
medicineInfoList.value = Array.isArray(response.data.prescriptionMedicineInfoDtoList)
|
||||
? response.data.prescriptionMedicineInfoDtoList
|
||||
: [response.data.prescriptionMedicineInfoDtoList];
|
||||
// 统计每个 prescriptionNo 的行数
|
||||
const groupCounts = countGroupRows(medicineInfoList.value);
|
||||
// 设置每行的标记
|
||||
markers.value = getRowMarkers(groupCounts, medicineInfoList.value);
|
||||
});
|
||||
});
|
||||
console.log(saveList);
|
||||
if (projectTypeCode.value == 1) {
|
||||
// 根据itemTable分类数据
|
||||
const deviceList = saveList.filter((item) => item.itemTable === 'adm_device_definition');
|
||||
const medicineList = saveList.filter((item) => item.itemTable === 'med_medication_definition');
|
||||
|
||||
// 并行处理两种类型的发药
|
||||
const promises = [];
|
||||
|
||||
// 如果有耗材数据,调用deviceDispense接口
|
||||
if (deviceList.length > 0) {
|
||||
promises.push(
|
||||
deviceDispense(deviceList).then((res) => {
|
||||
if (res.code != 200) {
|
||||
throw new Error('耗材发药失败');
|
||||
}
|
||||
return res;
|
||||
})
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
// 如果有药品数据,调用prepareMedicion接口
|
||||
if (medicineList.length > 0) {
|
||||
promises.push(
|
||||
prepareMedicion(medicineList).then((res) => {
|
||||
if (res.code != 200) {
|
||||
throw new Error('药品发药失败');
|
||||
}
|
||||
return res;
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
// 等待所有发药接口完成
|
||||
Promise.all(promises)
|
||||
.then(() => {
|
||||
// 所有发药都成功后,调用更新接口
|
||||
if (medicineList.length > 0) {
|
||||
return updateMedicion(medicineList);
|
||||
}
|
||||
})
|
||||
.then((response) => {
|
||||
proxy.$modal.msgSuccess('发药成功');
|
||||
// 重新获取数据
|
||||
getMedicineList(currentRow.value.encounterId);
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('发药失败:', error);
|
||||
proxy.$modal.msgError('发药失败: ' + error.message);
|
||||
});
|
||||
} else if (projectTypeCode.value == 2) {
|
||||
prepareMedicion(saveList).then((res) => {
|
||||
if (res.code == 200) {
|
||||
updateMedicion(saveList).then((response) => {
|
||||
proxy.$modal.msgSuccess('发药成功');
|
||||
getMedicineList(currentRow.value.encounterId);
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
deviceDispense(saveList).then((res) => {
|
||||
if (res.code == 200) {
|
||||
proxy.$modal.msgSuccess('发药成功');
|
||||
getMedicineList(currentRow.value.encounterId);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
const throttledGetList = debounce(handelTraceNo, 500);
|
||||
const traceNoInput = debounce(handleTraceNoInput, 500);
|
||||
@@ -815,7 +984,7 @@ function handleBatch(row) {
|
||||
if (row) {
|
||||
saveList = medicineInfoList.value
|
||||
.filter((item) => {
|
||||
return item.prescriptionNo === row.prescriptionNo;
|
||||
return item.dispenseId === row.dispenseId;
|
||||
})
|
||||
.map((item) => {
|
||||
return {
|
||||
@@ -824,6 +993,7 @@ function handleBatch(row) {
|
||||
traceNo: item.traceNo,
|
||||
prescriptionNo: item.prescriptionNo,
|
||||
preparerId: preparerDoctor.value,
|
||||
itemTable: item.itemTable,
|
||||
};
|
||||
});
|
||||
} else {
|
||||
@@ -835,6 +1005,7 @@ function handleBatch(row) {
|
||||
traceNo: item.traceNo,
|
||||
prescriptionNo: item.prescriptionNo,
|
||||
preparerId: preparerDoctor.value,
|
||||
itemTable: item.itemTable,
|
||||
};
|
||||
});
|
||||
}
|
||||
@@ -846,7 +1017,8 @@ function handleBatch(row) {
|
||||
|
||||
function backMedicine(row) {
|
||||
showDialog.value = true;
|
||||
selectedPrescriptionNo.value = row.prescriptionNo;
|
||||
selectedPrescriptionNo.value = row.dispenseId;
|
||||
selectedRow.value = row;
|
||||
console.log('作废原因:', selectedPrescriptionNo.value, row.prescriptionNo);
|
||||
}
|
||||
|
||||
@@ -855,24 +1027,26 @@ function handleConfirm() {
|
||||
ElMessage.error('请选择作废原因');
|
||||
return;
|
||||
}
|
||||
backMedicion(selectedPrescriptionNo.value, notPerformedReasonEnum.value).then((response) => {
|
||||
proxy.$modal.msgSuccess('作废成功');
|
||||
});
|
||||
listWesternmedicine({
|
||||
encounterId: currentRow.value.encounterId,
|
||||
statusEnum: queryParams.value.statusEnum,
|
||||
tcmFlag: tcmFlag.value,
|
||||
}).then((response) => {
|
||||
console.log('1212*******12', response);
|
||||
medicineInfoList.value = Array.isArray(response.data.prescriptionMedicineInfoDtoList)
|
||||
? response.data.prescriptionMedicineInfoDtoList
|
||||
: [response.data.prescriptionMedicineInfoDtoList];
|
||||
// medicineInfoList.value = response.data;
|
||||
// 统计每个 prescriptionNo 的行数
|
||||
const groupCounts = countGroupRows(medicineInfoList.value);
|
||||
// 设置每行的标记
|
||||
markers.value = getRowMarkers(groupCounts, medicineInfoList.value);
|
||||
});
|
||||
if (selectedRow.value.itemTable != 'adm_device_definition') {
|
||||
backMedicion([
|
||||
{
|
||||
dispenseId: selectedPrescriptionNo.value,
|
||||
notPerformedReasonEnum: notPerformedReasonEnum.value,
|
||||
},
|
||||
]).then((response) => {
|
||||
proxy.$modal.msgSuccess('作废成功');
|
||||
});
|
||||
} else {
|
||||
deviceInvalid([
|
||||
{
|
||||
dispenseId: selectedPrescriptionNo.value,
|
||||
notPerformedReasonEnum: notPerformedReasonEnum.value,
|
||||
},
|
||||
]).then((response) => {
|
||||
proxy.$modal.msgSuccess('作废成功');
|
||||
});
|
||||
}
|
||||
getMedicineList(currentRow.value.encounterId);
|
||||
showDialog.value = false;
|
||||
notPerformedReasonEnum.value = ''; // 清空选择
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user