|
@@ -137,9 +137,9 @@ const patientHealthRecords = ref<HealthReportVO[]>([]);
|
|
|
async function loadHealthRecords(patientId?: string) {
|
|
async function loadHealthRecords(patientId?: string) {
|
|
|
try {
|
|
try {
|
|
|
const { data } = await getPatientHealthRecordsMethod(1, 100, { patientId: patientId ?? currentPatient.value?.patientId! });
|
|
const { data } = await getPatientHealthRecordsMethod(1, 100, { patientId: patientId ?? currentPatient.value?.patientId! });
|
|
|
- patientHealthRecords.value = data
|
|
|
|
|
|
|
+ patientHealthRecords.value = data;
|
|
|
} catch (err) {
|
|
} catch (err) {
|
|
|
- patientHealthRecords.value = []
|
|
|
|
|
|
|
+ patientHealthRecords.value = [];
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
const patientRecord = ref<PatientRecord[]>([]);
|
|
const patientRecord = ref<PatientRecord[]>([]);
|
|
@@ -204,7 +204,6 @@ onMounted(async () => {
|
|
|
}
|
|
}
|
|
|
// 获取省份
|
|
// 获取省份
|
|
|
await loadProvinces();
|
|
await loadProvinces();
|
|
|
-
|
|
|
|
|
});
|
|
});
|
|
|
// 患者标签
|
|
// 患者标签
|
|
|
const patientTags = ref<PatientTagVO[]>([]);
|
|
const patientTags = ref<PatientTagVO[]>([]);
|
|
@@ -229,7 +228,6 @@ async function selectPatient(item: any) {
|
|
|
// 清空服务包选择
|
|
// 清空服务包选择
|
|
|
selectedPackage.value = '';
|
|
selectedPackage.value = '';
|
|
|
currentSelectedPackage.value = null;
|
|
currentSelectedPackage.value = null;
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 打开调养记录
|
|
// 打开调养记录
|
|
@@ -347,10 +345,9 @@ const totalPrice = computed(() => {
|
|
|
});
|
|
});
|
|
|
function onSelectProject({ row }: any) {
|
|
function onSelectProject({ row }: any) {
|
|
|
if ((formData.items ?? []).some((item) => item.conditioningProgramDetail?.name === row.name)) {
|
|
if ((formData.items ?? []).some((item) => item.conditioningProgramDetail?.name === row.name)) {
|
|
|
- message.warning('不能重复添加该项目');
|
|
|
|
|
|
|
+ notification.warning({ message: '不能重复添加该项目' });
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
// 添加新行到主表格
|
|
// 添加新行到主表格
|
|
|
if (!formData.items) formData.items = [];
|
|
if (!formData.items) formData.items = [];
|
|
|
formData.items.push({
|
|
formData.items.push({
|
|
@@ -364,25 +361,8 @@ function onSelectProject({ row }: any) {
|
|
|
totalMeasure: '',
|
|
totalMeasure: '',
|
|
|
totalPrice: '',
|
|
totalPrice: '',
|
|
|
initialDay: '',
|
|
initialDay: '',
|
|
|
- cwcpAcuMeridians: [
|
|
|
|
|
- {
|
|
|
|
|
- id: 0,
|
|
|
|
|
- name: '',
|
|
|
|
|
- code: '',
|
|
|
|
|
- type: '',
|
|
|
|
|
- photo: '',
|
|
|
|
|
- },
|
|
|
|
|
- ],
|
|
|
|
|
- cwcpAcuPoints: [
|
|
|
|
|
- {
|
|
|
|
|
- id: 0,
|
|
|
|
|
- name: '',
|
|
|
|
|
- code: '',
|
|
|
|
|
- type: '',
|
|
|
|
|
- merName: '',
|
|
|
|
|
- photo: '',
|
|
|
|
|
- },
|
|
|
|
|
- ],
|
|
|
|
|
|
|
+ cwcpAcuMeridians: [],
|
|
|
|
|
+ cwcpAcuPoints: [],
|
|
|
conditioningProgramDetail: {
|
|
conditioningProgramDetail: {
|
|
|
...row,
|
|
...row,
|
|
|
id: row.id || '',
|
|
id: row.id || '',
|
|
@@ -405,6 +385,7 @@ function onSelectProject({ row }: any) {
|
|
|
},
|
|
},
|
|
|
remark: '',
|
|
remark: '',
|
|
|
});
|
|
});
|
|
|
|
|
+ console.log(formData.items, '添加项目之后');
|
|
|
// 关闭弹窗
|
|
// 关闭弹窗
|
|
|
showProjectPopover.value = false;
|
|
showProjectPopover.value = false;
|
|
|
// 清空搜索
|
|
// 清空搜索
|
|
@@ -472,26 +453,26 @@ function detailPreview(row) {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
function editPart(row) {
|
|
function editPart(row) {
|
|
|
- VxeUI.modal.open({
|
|
|
|
|
- title: `编辑部位`,
|
|
|
|
|
- height: 700,
|
|
|
|
|
- width: 750,
|
|
|
|
|
- escClosable: true,
|
|
|
|
|
- destroyOnClose: true,
|
|
|
|
|
- id: `edit-part-modal`,
|
|
|
|
|
- remember: true,
|
|
|
|
|
- storage: true,
|
|
|
|
|
- slots: {
|
|
|
|
|
- default() {
|
|
|
|
|
- return h(AcupointEdit, <any>{
|
|
|
|
|
- data: row,
|
|
|
|
|
- onSubmit(data: any) {
|
|
|
|
|
- VxeUI.modal.close(`edit-part-modal`);
|
|
|
|
|
- },
|
|
|
|
|
- });
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ VxeUI.modal.open({
|
|
|
|
|
+ title: `编辑部位`,
|
|
|
|
|
+ height: 700,
|
|
|
|
|
+ width: 750,
|
|
|
|
|
+ escClosable: true,
|
|
|
|
|
+ destroyOnClose: true,
|
|
|
|
|
+ id: `edit-part-modal`,
|
|
|
|
|
+ remember: true,
|
|
|
|
|
+ storage: true,
|
|
|
|
|
+ slots: {
|
|
|
|
|
+ default() {
|
|
|
|
|
+ return h(AcupointEdit, <any>{
|
|
|
|
|
+ data: row,
|
|
|
|
|
+ onSubmit(data: any) {
|
|
|
|
|
+ VxeUI.modal.close(`edit-part-modal`);
|
|
|
|
|
+ },
|
|
|
|
|
+ });
|
|
|
},
|
|
},
|
|
|
- });
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
const allProjects = ref<
|
|
const allProjects = ref<
|
|
|
Array<{
|
|
Array<{
|
|
@@ -526,7 +507,7 @@ function calculateCount(row: any) {
|
|
|
const frequency = Number(row.frequencyMeasure) || 0;
|
|
const frequency = Number(row.frequencyMeasure) || 0;
|
|
|
const maxCount = row.conditioningProgramDetail.cpDynamicPricingRule?.[1]?.max;
|
|
const maxCount = row.conditioningProgramDetail.cpDynamicPricingRule?.[1]?.max;
|
|
|
const acCount = (row.acuMeridianNames?.length ?? 0) + (row.acuPointNames?.length ?? 0);
|
|
const acCount = (row.acuMeridianNames?.length ?? 0) + (row.acuPointNames?.length ?? 0);
|
|
|
- // console.log(row, 'calculateCount',pricingType);
|
|
|
|
|
|
|
+ console.log(row, '添加计算数量的函数', pricingType, row.conditioningProgramDetail.pricingType);
|
|
|
// 一口价
|
|
// 一口价
|
|
|
if (pricingType === '0') {
|
|
if (pricingType === '0') {
|
|
|
// 检查是否选择了"不限"
|
|
// 检查是否选择了"不限"
|
|
@@ -546,13 +527,19 @@ function calculateCount(row: any) {
|
|
|
// 按穴位计价
|
|
// 按穴位计价
|
|
|
const frequencyType = Number(row.frequencyType) || 0;
|
|
const frequencyType = Number(row.frequencyType) || 0;
|
|
|
row.totalMeasure = Math.ceil((period / frequencyType) * frequency);
|
|
row.totalMeasure = Math.ceil((period / frequencyType) * frequency);
|
|
|
|
|
+ console.log(row.totalMeasure, 'row.totalMeasure', acCount, maxCount);
|
|
|
if (acCount > maxCount) {
|
|
if (acCount > maxCount) {
|
|
|
if (row.conditioningProgramDetail.cpDynamicPricingRule?.[1]?.priceType === 0) {
|
|
if (row.conditioningProgramDetail.cpDynamicPricingRule?.[1]?.priceType === 0) {
|
|
|
// 单价
|
|
// 单价
|
|
|
- let unitPrice: number = row.conditioningProgramDetail.cpDynamicPricingRule[1].price*acCount;
|
|
|
|
|
- row.unitPrice = unitPrice;
|
|
|
|
|
- // row.totalMeasure = Math.ceil((period / frequencyType) * frequency);
|
|
|
|
|
- row.totalPrice = Math.ceil((period / frequencyType) * frequency * unitPrice);
|
|
|
|
|
|
|
+ if (acCount > 0) {
|
|
|
|
|
+ let unitPrice: number = row.conditioningProgramDetail.cpDynamicPricingRule[1].price * acCount;
|
|
|
|
|
+ row.unitPrice = unitPrice;
|
|
|
|
|
+ // row.totalMeasure = Math.ceil((period / frequencyType) * frequency);
|
|
|
|
|
+ row.totalPrice = Math.ceil((period / frequencyType) * frequency * unitPrice);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ row.unitPrice = '-';
|
|
|
|
|
+ row.totalPrice = 0;
|
|
|
|
|
+ }
|
|
|
} else if (row.conditioningProgramDetail.cpDynamicPricingRule?.[1]?.priceType === 1) {
|
|
} else if (row.conditioningProgramDetail.cpDynamicPricingRule?.[1]?.priceType === 1) {
|
|
|
// 一口价
|
|
// 一口价
|
|
|
row.unitPrice = '-';
|
|
row.unitPrice = '-';
|
|
@@ -560,14 +547,19 @@ function calculateCount(row: any) {
|
|
|
// row.totalMeasure = Math.ceil((period / frequencyType) * frequency);
|
|
// row.totalMeasure = Math.ceil((period / frequencyType) * frequency);
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
- // console.log("数量很少",row.conditioningProgramDetail.cpDynamicPricingRule?.[0]?.priceType)
|
|
|
|
|
|
|
+ console.log('数量很少', row.conditioningProgramDetail.cpDynamicPricingRule?.[0]);
|
|
|
if (row.conditioningProgramDetail.cpDynamicPricingRule?.length > 0) {
|
|
if (row.conditioningProgramDetail.cpDynamicPricingRule?.length > 0) {
|
|
|
if (row.conditioningProgramDetail.cpDynamicPricingRule?.[0]?.priceType === 0) {
|
|
if (row.conditioningProgramDetail.cpDynamicPricingRule?.[0]?.priceType === 0) {
|
|
|
// 单价
|
|
// 单价
|
|
|
- let unitPrice: number = row.conditioningProgramDetail.cpDynamicPricingRule[0].price*acCount;
|
|
|
|
|
- row.unitPrice = unitPrice;
|
|
|
|
|
- // row.totalMeasure = Math.ceil((period / frequencyType) * frequency);
|
|
|
|
|
- row.totalPrice = Math.ceil((period / frequencyType) * frequency * unitPrice );
|
|
|
|
|
|
|
+ if (acCount > 0) {
|
|
|
|
|
+ let unitPrice: number = row.conditioningProgramDetail.cpDynamicPricingRule[0].price * acCount;
|
|
|
|
|
+ row.unitPrice = unitPrice;
|
|
|
|
|
+ // row.totalMeasure = Math.ceil((period / frequencyType) * frequency);
|
|
|
|
|
+ row.totalPrice = Math.ceil((period / frequencyType) * frequency * unitPrice);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ row.unitPrice = '-';
|
|
|
|
|
+ row.totalPrice = 0;
|
|
|
|
|
+ }
|
|
|
// console.log("数量很少",row.totalPrice,'row.unitPrice',row.unitPrice,'period',period,'frequencyType',frequencyType,'acCount',acCount)
|
|
// console.log("数量很少",row.totalPrice,'row.unitPrice',row.unitPrice,'period',period,'frequencyType',frequencyType,'acCount',acCount)
|
|
|
} else if (row.conditioningProgramDetail.cpDynamicPricingRule?.[0]?.priceType === 1) {
|
|
} else if (row.conditioningProgramDetail.cpDynamicPricingRule?.[0]?.priceType === 1) {
|
|
|
// 一口价
|
|
// 一口价
|
|
@@ -612,7 +604,6 @@ async function selectCw(item: any) {
|
|
|
form.conditioningWrapName = item.name;
|
|
form.conditioningWrapName = item.name;
|
|
|
form.conditioningWrapId = item.id;
|
|
form.conditioningWrapId = item.id;
|
|
|
form.phone = item.phone;
|
|
form.phone = item.phone;
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
function handleCancel() {
|
|
function handleCancel() {
|
|
|
console.log('取消');
|
|
console.log('取消');
|
|
@@ -621,11 +612,14 @@ function handleCancel() {
|
|
|
watch(
|
|
watch(
|
|
|
() => formData.items,
|
|
() => formData.items,
|
|
|
(newData) => {
|
|
(newData) => {
|
|
|
|
|
+ console.log(newData, 'newData');
|
|
|
if (!newData) return;
|
|
if (!newData) return;
|
|
|
newData.forEach((row) => {
|
|
newData.forEach((row) => {
|
|
|
- if (row?.days || row?.frequencyType || row?.frequencyMeasure) {
|
|
|
|
|
- calculateCount(row);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ console.log(row, '数据更新');
|
|
|
|
|
+ calculateCount(row);
|
|
|
|
|
+ // if (row?.days || row?.frequencyType || row?.frequencyMeasure) {
|
|
|
|
|
+ // calculateCount(row);
|
|
|
|
|
+ // }
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
{ deep: true }
|
|
{ deep: true }
|
|
@@ -843,7 +837,9 @@ function openPatientTagEdit(event: MouseEvent) {
|
|
|
id: currentPatient.value?.patientId!,
|
|
id: currentPatient.value?.patientId!,
|
|
|
tags: patientTags.value,
|
|
tags: patientTags.value,
|
|
|
onDestroy(values?: PatientTagVO[]) {
|
|
onDestroy(values?: PatientTagVO[]) {
|
|
|
- if (values) { patientTags.value = values; }
|
|
|
|
|
|
|
+ if (values) {
|
|
|
|
|
+ patientTags.value = values;
|
|
|
|
|
+ }
|
|
|
VxeUI.modal.close(id);
|
|
VxeUI.modal.close(id);
|
|
|
},
|
|
},
|
|
|
});
|
|
});
|
|
@@ -853,9 +849,9 @@ function openPatientTagEdit(event: MouseEvent) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function openHistoryPreviewHandle() {
|
|
function openHistoryPreviewHandle() {
|
|
|
- const data = currentPatient.value
|
|
|
|
|
- const patient = { id: data?.patientId }
|
|
|
|
|
- const report = { id: data?.healthAnalysisReportId }
|
|
|
|
|
|
|
+ const data = currentPatient.value;
|
|
|
|
|
+ const patient = { id: data?.patientId };
|
|
|
|
|
+ const report = { id: data?.healthAnalysisReportId };
|
|
|
|
|
|
|
|
const component = defineAsyncComponent(() => import('@/components/PatientHealthRecordPreview.vue'));
|
|
const component = defineAsyncComponent(() => import('@/components/PatientHealthRecordPreview.vue'));
|
|
|
const id = `drawer:report-history:preview`;
|
|
const id = `drawer:report-history:preview`;
|
|
@@ -876,9 +872,7 @@ function openHistoryPreviewHandle() {
|
|
|
patient,
|
|
patient,
|
|
|
report,
|
|
report,
|
|
|
onDestroy,
|
|
onDestroy,
|
|
|
- onRefresh() {
|
|
|
|
|
-
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ onRefresh() {},
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
@@ -903,7 +897,7 @@ function openPatientHealthRecord(row: { id: string }, showType: 'analysis' | 'sc
|
|
|
width: window.innerWidth - 256,
|
|
width: window.innerWidth - 256,
|
|
|
escClosable: true,
|
|
escClosable: true,
|
|
|
maskClosable: true,
|
|
maskClosable: true,
|
|
|
- title: {analysis: `健康分析报告`, scheme: `调理方案`}[showType],
|
|
|
|
|
|
|
+ title: { analysis: `健康分析报告`, scheme: `调理方案` }[showType],
|
|
|
slots: {
|
|
slots: {
|
|
|
default() {
|
|
default() {
|
|
|
return h(component, {
|
|
return h(component, {
|
|
@@ -1036,7 +1030,7 @@ function openPatientHealthRecord(row: { id: string }, showType: 'analysis' | 'sc
|
|
|
<a-input v-model:value="row.frequencyType" style="width: 50px" @change="() => calculateCount(row)" :disabled="row.frequencyType === '不限'" />
|
|
<a-input v-model:value="row.frequencyType" style="width: 50px" @change="() => calculateCount(row)" :disabled="row.frequencyType === '不限'" />
|
|
|
<span>天</span>
|
|
<span>天</span>
|
|
|
<a-input v-model:value="row.frequencyMeasure" style="width: 50px" @change="() => calculateCount(row)" :disabled="row.frequencyType === '不限'" />
|
|
<a-input v-model:value="row.frequencyMeasure" style="width: 50px" @change="() => calculateCount(row)" :disabled="row.frequencyType === '不限'" />
|
|
|
- <span>{{ row.conditioningProgramDetail?.cpFixedPricingRule?.convertUnit ? row.conditioningProgramDetail?.cpFixedPricingRule?.convertUnit : '次' }}</span>
|
|
|
|
|
|
|
+ <span>{{ row.conditioningProgramDetail?.cpFixedPricingRule?.convertUnit ? row.conditioningProgramDetail?.cpFixedPricingRule?.convertUnit : '次' }}</span>
|
|
|
</div>
|
|
</div>
|
|
|
<div>
|
|
<div>
|
|
|
<a-checkbox-group
|
|
<a-checkbox-group
|
|
@@ -1058,7 +1052,7 @@ function openPatientHealthRecord(row: { id: string }, showType: 'analysis' | 'sc
|
|
|
<a-input v-model:value="row.frequencyType" style="width: 50px" @change="() => calculateCount(row)" />
|
|
<a-input v-model:value="row.frequencyType" style="width: 50px" @change="() => calculateCount(row)" />
|
|
|
<span>天</span>
|
|
<span>天</span>
|
|
|
<a-input v-model:value="row.frequencyMeasure" style="width: 50px" @change="() => calculateCount(row)" />
|
|
<a-input v-model:value="row.frequencyMeasure" style="width: 50px" @change="() => calculateCount(row)" />
|
|
|
- <span>{{ row.conditioningProgramDetail?.cpFixedPricingRule?.convertUnit ? row.conditioningProgramDetail?.cpFixedPricingRule?.convertUnit : '次' }}</span>
|
|
|
|
|
|
|
+ <span>{{ row.conditioningProgramDetail?.cpFixedPricingRule?.convertUnit ? row.conditioningProgramDetail?.cpFixedPricingRule?.convertUnit : '次' }}</span>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
</vxe-column>
|
|
</vxe-column>
|
|
@@ -1195,8 +1189,8 @@ function openPatientHealthRecord(row: { id: string }, showType: 'analysis' | 'sc
|
|
|
</div>
|
|
</div>
|
|
|
<!-- 右侧调养记录 -->
|
|
<!-- 右侧调养记录 -->
|
|
|
<div class="right-panel flex flex-col overflow-hidden">
|
|
<div class="right-panel flex flex-col overflow-hidden">
|
|
|
- <section style="flex: 0 0 auto; max-height: 270px; overflow-y: auto;">
|
|
|
|
|
- <div style="margin-top: -6px; padding-right: 8px;">
|
|
|
|
|
|
|
+ <section style="flex: 0 0 auto; max-height: 270px; overflow-y: auto">
|
|
|
|
|
+ <div style="margin-top: -6px; padding-right: 8px">
|
|
|
<label>标签:</label>
|
|
<label>标签:</label>
|
|
|
<a-tag v-for="tag in patientTags" :key="tag.id" :color="tag.color">{{ tag.name }}</a-tag>
|
|
<a-tag v-for="tag in patientTags" :key="tag.id" :color="tag.color">{{ tag.name }}</a-tag>
|
|
|
<a-button type="link" @click="openPatientTagEdit($event)">
|
|
<a-button type="link" @click="openPatientTagEdit($event)">
|
|
@@ -1206,11 +1200,11 @@ function openPatientHealthRecord(row: { id: string }, showType: 'analysis' | 'sc
|
|
|
</a-button>
|
|
</a-button>
|
|
|
</div>
|
|
</div>
|
|
|
</section>
|
|
</section>
|
|
|
- <section style="margin: 8px;">
|
|
|
|
|
|
|
+ <section style="margin: 8px">
|
|
|
<a-button type="primary" block @click="openHistoryPreviewHandle()">健康档案</a-button>
|
|
<a-button type="primary" block @click="openHistoryPreviewHandle()">健康档案</a-button>
|
|
|
</section>
|
|
</section>
|
|
|
<div class="record-title">报告记录</div>
|
|
<div class="record-title">报告记录</div>
|
|
|
- <section class="overflow-auto" style="flex: 4 4 auto; min-height: 240px;">
|
|
|
|
|
|
|
+ <section class="overflow-auto" style="flex: 4 4 auto; min-height: 240px">
|
|
|
<div class="record-list">
|
|
<div class="record-list">
|
|
|
<div class="record-item flex justify-between" v-for="item in patientHealthRecords" :key="item.id" @click="openPatientHealthRecord(item, 'analysis')">
|
|
<div class="record-item flex justify-between" v-for="item in patientHealthRecords" :key="item.id" @click="openPatientHealthRecord(item, 'analysis')">
|
|
|
{{ item.date }}
|
|
{{ item.date }}
|
|
@@ -1220,7 +1214,7 @@ function openPatientHealthRecord(row: { id: string }, showType: 'analysis' | 'sc
|
|
|
</div>
|
|
</div>
|
|
|
</section>
|
|
</section>
|
|
|
<div class="record-title">调养记录</div>
|
|
<div class="record-title">调养记录</div>
|
|
|
- <section class="overflow-auto" style="flex: 4 4 auto; min-height: 240px;">
|
|
|
|
|
|
|
+ <section class="overflow-auto" style="flex: 4 4 auto; min-height: 240px">
|
|
|
<div class="record-list">
|
|
<div class="record-list">
|
|
|
<div class="record-item" v-for="item in patientRecord" :key="item.id" @click="openRecord(item)">{{ item.estimatedStartDate }}~{{ item.estimatedEndDate }}</div>
|
|
<div class="record-item" v-for="item in patientRecord" :key="item.id" @click="openRecord(item)">{{ item.estimatedStartDate }}~{{ item.estimatedEndDate }}</div>
|
|
|
<div v-if="!patientRecord.length" style="padding-bottom: 8px; text-align: center; margin-top: 40px">暂无数据</div>
|
|
<div v-if="!patientRecord.length" style="padding-bottom: 8px; text-align: center; margin-top: 40px">暂无数据</div>
|