|
@@ -176,7 +176,6 @@ async function getCpRecordDetail(id: string) {
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
function getPatientList(id: string) {
|
|
function getPatientList(id: string) {
|
|
|
- // console.log(id, '切换');
|
|
|
|
|
if (id) {
|
|
if (id) {
|
|
|
getCpDetail(id);
|
|
getCpDetail(id);
|
|
|
loadTags(id);
|
|
loadTags(id);
|
|
@@ -246,12 +245,11 @@ async function selectPatient(item: any) {
|
|
|
const btnType = ref('');
|
|
const btnType = ref('');
|
|
|
// 打开调养记录
|
|
// 打开调养记录
|
|
|
function openRecord(item: any) {
|
|
function openRecord(item: any) {
|
|
|
|
|
+ const status=currentPatient.value.status;
|
|
|
const types = 'record';
|
|
const types = 'record';
|
|
|
VxeUI.modal.open({
|
|
VxeUI.modal.open({
|
|
|
id: 'servicePackageDetail-modal',
|
|
id: 'servicePackageDetail-modal',
|
|
|
title: '调养记录',
|
|
title: '调养记录',
|
|
|
- // height: 700,
|
|
|
|
|
- // width: 1200,
|
|
|
|
|
height: window.innerHeight,
|
|
height: window.innerHeight,
|
|
|
width: window.innerWidth,
|
|
width: window.innerWidth,
|
|
|
escClosable: true,
|
|
escClosable: true,
|
|
@@ -259,7 +257,13 @@ function openRecord(item: any) {
|
|
|
slots: {
|
|
slots: {
|
|
|
default() {
|
|
default() {
|
|
|
return h(ServicePackageDetail, <any>{
|
|
return h(ServicePackageDetail, <any>{
|
|
|
- data: { ...item, types },
|
|
|
|
|
|
|
+ data: { ...item, types ,status},
|
|
|
|
|
+ onSubmit(data: any) {
|
|
|
|
|
+ selectedPackage.value=data.conditioningWrapId;
|
|
|
|
|
+ formData.items = data?.items ?? [];
|
|
|
|
|
+ form.conditioningWrapName = data.conditioningWrapName;
|
|
|
|
|
+ form.conditioningWrapId = data.conditioningWrapId;
|
|
|
|
|
+ },
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
@@ -399,7 +403,6 @@ function onSelectProject({ row }: any) {
|
|
|
},
|
|
},
|
|
|
remark: '',
|
|
remark: '',
|
|
|
});
|
|
});
|
|
|
- console.log(formData.items, '添加项目之后');
|
|
|
|
|
// 关闭弹窗
|
|
// 关闭弹窗
|
|
|
showProjectPopover.value = false;
|
|
showProjectPopover.value = false;
|
|
|
// 清空搜索
|
|
// 清空搜索
|
|
@@ -515,7 +518,6 @@ 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, '添加计算数量的函数', pricingType, row.conditioningProgramDetail.pricingType);
|
|
|
|
|
// 一口价
|
|
// 一口价
|
|
|
if (pricingType === '0') {
|
|
if (pricingType === '0') {
|
|
|
// 检查是否选择了"不限"
|
|
// 检查是否选择了"不限"
|
|
@@ -535,14 +537,12 @@ 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) {
|
|
|
// 单价
|
|
// 单价
|
|
|
if (acCount > 0) {
|
|
if (acCount > 0) {
|
|
|
let unitPrice: number = row.conditioningProgramDetail.cpDynamicPricingRule[1].price * acCount;
|
|
let unitPrice: number = row.conditioningProgramDetail.cpDynamicPricingRule[1].price * acCount;
|
|
|
row.unitPrice = unitPrice;
|
|
row.unitPrice = unitPrice;
|
|
|
- // row.totalMeasure = Math.ceil((period / frequencyType) * frequency);
|
|
|
|
|
row.totalPrice = Math.ceil((period / frequencyType) * frequency * unitPrice);
|
|
row.totalPrice = Math.ceil((period / frequencyType) * frequency * unitPrice);
|
|
|
} else {
|
|
} else {
|
|
|
row.unitPrice = '-';
|
|
row.unitPrice = '-';
|
|
@@ -552,48 +552,28 @@ function calculateCount(row: any) {
|
|
|
// 一口价
|
|
// 一口价
|
|
|
row.unitPrice = '-';
|
|
row.unitPrice = '-';
|
|
|
row.totalPrice = row.conditioningProgramDetail.cpDynamicPricingRule[1].price;
|
|
row.totalPrice = row.conditioningProgramDetail.cpDynamicPricingRule[1].price;
|
|
|
- // row.totalMeasure = Math.ceil((period / frequencyType) * frequency);
|
|
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
- // 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) {
|
|
|
// 单价
|
|
// 单价
|
|
|
if (acCount > 0) {
|
|
if (acCount > 0) {
|
|
|
let unitPrice: number = row.conditioningProgramDetail.cpDynamicPricingRule[0].price * acCount;
|
|
let unitPrice: number = row.conditioningProgramDetail.cpDynamicPricingRule[0].price * acCount;
|
|
|
row.unitPrice = unitPrice;
|
|
row.unitPrice = unitPrice;
|
|
|
- // row.totalMeasure = Math.ceil((period / frequencyType) * frequency);
|
|
|
|
|
row.totalPrice = Math.ceil((period / frequencyType) * frequency * unitPrice);
|
|
row.totalPrice = Math.ceil((period / frequencyType) * frequency * unitPrice);
|
|
|
} else {
|
|
} else {
|
|
|
row.unitPrice = '-';
|
|
row.unitPrice = '-';
|
|
|
row.totalPrice = 0;
|
|
row.totalPrice = 0;
|
|
|
}
|
|
}
|
|
|
- // 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) {
|
|
|
// 一口价
|
|
// 一口价
|
|
|
row.unitPrice = '-';
|
|
row.unitPrice = '-';
|
|
|
row.totalPrice = row.conditioningProgramDetail.cpDynamicPricingRule[0].price;
|
|
row.totalPrice = row.conditioningProgramDetail.cpDynamicPricingRule[0].price;
|
|
|
- // row.totalMeasure = Math.ceil((period / frequencyType) * frequency);
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-// function calculateCount(row: any) {
|
|
|
|
|
-// const convertDose = Number(row.conditioningProgramDetail.cpFixedPricingRule.convertDose) || 0;
|
|
|
|
|
-// console.log(convertDose, 'convertDose');
|
|
|
|
|
-// const period = Number(row.days) || 0;
|
|
|
|
|
-// const frequency = Number(row.frequencyMeasure) || 0;
|
|
|
|
|
-// let count = 0;
|
|
|
|
|
-// count = Math.ceil(((period / (Number(row.frequencyType) || 1)) * frequency)/convertDose);
|
|
|
|
|
-// row.totalMeasure = count;
|
|
|
|
|
-
|
|
|
|
|
-// // 取单价
|
|
|
|
|
-// const unitPrice = Number(row.conditioningProgramDetail?.cpFixedPricingRule?.unitPrice) || 0;
|
|
|
|
|
-// // 计算总价
|
|
|
|
|
-// row.totalPrice = (count * unitPrice).toFixed(2);
|
|
|
|
|
-// }
|
|
|
|
|
-
|
|
|
|
|
// 添加监听器
|
|
// 添加监听器
|
|
|
watch(totalPrice, (val) => {
|
|
watch(totalPrice, (val) => {
|
|
|
formData.price = val;
|
|
formData.price = val;
|
|
@@ -620,14 +600,9 @@ 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) => {
|
|
|
- // console.log(row, '数据更新');
|
|
|
|
|
calculateCount(row);
|
|
calculateCount(row);
|
|
|
- // if (row?.days || row?.frequencyType || row?.frequencyMeasure) {
|
|
|
|
|
- // calculateCount(row);
|
|
|
|
|
- // }
|
|
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
{ deep: true }
|
|
{ deep: true }
|
|
@@ -991,7 +966,7 @@ function openPatientHealthRecord(row: { id: string }, showType: 'analysis' | 'sc
|
|
|
<span>{{ form.conditioningWrapName }}</span>
|
|
<span>{{ form.conditioningWrapName }}</span>
|
|
|
</template>
|
|
</template>
|
|
|
<template v-else>
|
|
<template v-else>
|
|
|
- <a-select v-model:value="selectedPackage" style="width: 180px" placeholder="请选择服务包">
|
|
|
|
|
|
|
+ <a-select v-model:value="selectedPackage" style="width: 180px" placeholder="请选择服务包" >
|
|
|
<a-select-option v-for="item in lifeCwData" :key="item.id" :value="item.id" @click="selectCw(item)">
|
|
<a-select-option v-for="item in lifeCwData" :key="item.id" :value="item.id" @click="selectCw(item)">
|
|
|
{{ item.name }}
|
|
{{ item.name }}
|
|
|
</a-select-option>
|
|
</a-select-option>
|