|
|
@@ -155,7 +155,7 @@ async function getCpRecordDetail(id: string) {
|
|
|
});
|
|
|
}
|
|
|
async function getPatientList(id: string) {
|
|
|
- console.log(id, '切换');
|
|
|
+ // console.log(id, '切换');
|
|
|
if (id) {
|
|
|
getCpDetail(id);
|
|
|
loadTags(id);
|
|
|
@@ -188,6 +188,7 @@ onMounted(async () => {
|
|
|
}
|
|
|
// 获取省份
|
|
|
await loadProvinces();
|
|
|
+
|
|
|
});
|
|
|
// 患者标签
|
|
|
const tags = ref<PatientTagModel>({ id: '', tags: [] });
|
|
|
@@ -212,6 +213,7 @@ async function selectPatient(item: any) {
|
|
|
// 清空服务包选择
|
|
|
selectedPackage.value = '';
|
|
|
currentSelectedPackage.value = null;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
// 打开调养记录
|
|
|
@@ -271,6 +273,7 @@ const emptyRow = {
|
|
|
conditioningProgramId: 0,
|
|
|
days: '',
|
|
|
frequencyType: '',
|
|
|
+ frequencyTypeing: [],
|
|
|
frequencyMeasure: '',
|
|
|
totalMeasure: '',
|
|
|
totalPrice: '',
|
|
|
@@ -314,6 +317,10 @@ watch(displayTableData, (newValue, oldValue) => {
|
|
|
isShowDelivery.value = newValue.some((item) => {
|
|
|
return item.conditioningProgramDetail?.isDelivery === 'Y';
|
|
|
});
|
|
|
+ newValue.forEach((row: any) => {
|
|
|
+ row.frequencyTypeing = row.frequencyType ? [row.frequencyType] : [];
|
|
|
+ });
|
|
|
+ console.log(newValue, '开过的newValue');
|
|
|
}
|
|
|
});
|
|
|
const totalPrice = computed(() => {
|
|
|
@@ -336,6 +343,7 @@ function onSelectProject({ row }: any) {
|
|
|
// conditioningProgramId: 0,
|
|
|
days: '',
|
|
|
frequencyType: '',
|
|
|
+ frequencyTypeing: [],
|
|
|
frequencyMeasure: '',
|
|
|
totalMeasure: '',
|
|
|
totalPrice: '',
|
|
|
@@ -502,17 +510,46 @@ const filteredProjects = computed(() => {
|
|
|
});
|
|
|
// 添加计算数量的函数
|
|
|
function calculateCount(row: any) {
|
|
|
+ const pricingType = row.conditioningProgramDetail.pricingType;
|
|
|
const period = Number(row.days) || 0;
|
|
|
const frequency = Number(row.frequencyMeasure) || 0;
|
|
|
- let count = 0;
|
|
|
- count = Math.ceil(period / (Number(row.frequencyType) || 1)) * frequency;
|
|
|
- row.totalMeasure = count;
|
|
|
-
|
|
|
- // 取单价
|
|
|
- const unitPrice = Number(row.conditioningProgramDetail?.cpFixedPricingRule?.unitPrice) || 0;
|
|
|
- // 计算总价
|
|
|
- row.totalPrice = (count * unitPrice).toFixed(2);
|
|
|
+ // 一口价
|
|
|
+ if (pricingType === '0') {
|
|
|
+ // 检查是否选择了"不限"
|
|
|
+ if (row.frequencyType === '不限') {
|
|
|
+ row.frequencyMeasure = ''; // 重置 frequencyMeasure
|
|
|
+ row.totalMeasure = 1;
|
|
|
+ } else {
|
|
|
+ const convertDose = Number(row.conditioningProgramDetail.cpFixedPricingRule.convertDose) || 0;
|
|
|
+ const frequencyType = Number(row.frequencyType) || 0;
|
|
|
+ row.totalMeasure = Math.ceil(((period / frequencyType) * frequency) / convertDose);
|
|
|
+ }
|
|
|
+ // 获取单价
|
|
|
+ const unitPrice = Number(row.conditioningProgramDetail?.cpFixedPricingRule?.unitPrice) || 0;
|
|
|
+ // 计算总价
|
|
|
+ row.totalPrice = (row.totalMeasure * unitPrice).toFixed(2);
|
|
|
+ } else if (pricingType === '1') {
|
|
|
+ // 按穴位计价
|
|
|
+ row.totalPrice =
|
|
|
+ row.conditioningProgramDetail?.cpDynamicPricingRule?.reduce((sum: number, item: any) => {
|
|
|
+ return sum + (Number(item.price) || 0);
|
|
|
+ }, 0) || 0;
|
|
|
+ }
|
|
|
}
|
|
|
+// 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) => {
|
|
|
@@ -532,10 +569,25 @@ async function selectCw(item: any) {
|
|
|
form.conditioningWrapName = item.name;
|
|
|
form.conditioningWrapId = item.id;
|
|
|
form.phone = item.phone;
|
|
|
+
|
|
|
}
|
|
|
function handleCancel() {
|
|
|
console.log('取消');
|
|
|
}
|
|
|
+// 添加监听器
|
|
|
+watch(
|
|
|
+ () => formData.items,
|
|
|
+ (newData) => {
|
|
|
+ if (!newData) return;
|
|
|
+ newData.forEach((row) => {
|
|
|
+ if (row?.days || row?.frequencyType || row?.frequencyMeasure) {
|
|
|
+ calculateCount(row);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ { deep: true }
|
|
|
+);
|
|
|
+
|
|
|
// 添加电话号码验证函数
|
|
|
function isValidPhone(phone: string): boolean {
|
|
|
// 中国大陆手机号码正则表达式
|
|
|
@@ -552,6 +604,7 @@ async function handleSubmit() {
|
|
|
delete item.id;
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
form.id = Number(currentPatient.value.id);
|
|
|
form.patientId = currentPatient.value.patientId;
|
|
|
form.patientName = currentPatient.value.patientName;
|
|
|
@@ -744,7 +797,6 @@ watch(showProjectPopover, (val) => {
|
|
|
</div>
|
|
|
<div v-else style="padding-bottom: 8px; text-align: center; margin-top: 40px">暂无数据</div>
|
|
|
</div>
|
|
|
-
|
|
|
<!-- 中间主内容 -->
|
|
|
<div class="main-panel">
|
|
|
<!-- 顶部患者信息 -->
|
|
|
@@ -839,12 +891,35 @@ watch(showProjectPopover, (val) => {
|
|
|
</vxe-column>
|
|
|
<vxe-column field="frequencyType" title="频率" width="auto">
|
|
|
<template #default="{ row }">
|
|
|
- <div style="display: flex; align-items: center">
|
|
|
+ <div v-if="row.conditioningProgramDetail?.name === '健康咨询' || row.conditioningProgramDetail?.name === '健康评估'" class="flex items-center">
|
|
|
+ <div class="flex items-center mr-4">
|
|
|
+ <span>每</span>
|
|
|
+ <a-input v-model:value="row.frequencyType" style="width: 50px" @change="() => calculateCount(row)" :disabled="row.frequencyType === '不限'" />
|
|
|
+ <span>天</span>
|
|
|
+ <a-input v-model:value="row.frequencyMeasure" style="width: 50px" @change="() => calculateCount(row)" :disabled="row.frequencyType === '不限'" />
|
|
|
+ <span>{{ row.conditioningProgramDetail?.cpFixedPricingRule?.convertUnit }}</span>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <a-checkbox-group
|
|
|
+ v-model:value="row.frequencyTypeing"
|
|
|
+ @change="
|
|
|
+ (value) => {
|
|
|
+ row.frequencyTypeing = value.includes('不限') ? ['不限'] : [];
|
|
|
+ row.frequencyType = value.includes('不限') ? '不限' : '';
|
|
|
+ calculateCount(row);
|
|
|
+ }
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <a-checkbox value="不限">不限</a-checkbox>
|
|
|
+ </a-checkbox-group>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="flex items-center" v-else>
|
|
|
<span>每</span>
|
|
|
- <a-input v-model:value="row.frequencyType" style="width: 60px" @change="() => calculateCount(row)" :disabled="currentPatient?.status === '0' ? true : false" />
|
|
|
+ <a-input v-model:value="row.frequencyType" style="width: 50px" @change="() => calculateCount(row)" />
|
|
|
<span>天</span>
|
|
|
- <a-input v-model:value="row.frequencyMeasure" style="width: 60px" @change="() => calculateCount(row)" :disabled="currentPatient?.status === '0' ? true : false" />
|
|
|
- <span>{{ row.conditioningProgramDetail?.cpFixedPricingRule?.pricingUnit }}</span>
|
|
|
+ <a-input v-model:value="row.frequencyMeasure" style="width: 50px" @change="() => calculateCount(row)" />
|
|
|
+ <span>{{ row.conditioningProgramDetail?.cpFixedPricingRule?.convertUnit }}</span>
|
|
|
</div>
|
|
|
</template>
|
|
|
</vxe-column>
|
|
|
@@ -901,7 +976,15 @@ watch(showProjectPopover, (val) => {
|
|
|
</vxe-column>
|
|
|
<vxe-column field="remark" title="说明" width="180">
|
|
|
<template #default="{ row }">
|
|
|
- <a-input v-model:value="row.remark" style="width: 120px" :disabled="currentPatient?.status === '0' ? true : false" />
|
|
|
+ <!-- <a-input v-model:value="row.remark" style="width: 120px" :disabled="currentPatient?.status === '0' ? true : false" /> -->
|
|
|
+ <a-textarea
|
|
|
+ v-model:value="row.remark"
|
|
|
+ style="max-width: 180px; width: 100%; height: 50px"
|
|
|
+ :rows="2"
|
|
|
+ show-count
|
|
|
+ :maxLength="200"
|
|
|
+ :disabled="currentPatient?.status === '0' ? true : false"
|
|
|
+ />
|
|
|
</template>
|
|
|
</vxe-column>
|
|
|
</vxe-table>
|
|
|
@@ -968,19 +1051,12 @@ watch(showProjectPopover, (val) => {
|
|
|
<a-button type="primary" style="margin-left: 24px" @click="handleSubmit">确认</a-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
+
|
|
|
<a-result class="area" v-else style="background-color: #fff" status="warning" title="暂无数据" />
|
|
|
</div>
|
|
|
-
|
|
|
<!-- 右侧调养记录 -->
|
|
|
<div class="right-panel">
|
|
|
- <PatientTagWidget
|
|
|
- style="min-height: 112px; flex: none"
|
|
|
- :style="{ height: `${height}px` }"
|
|
|
- :dataset="tags"
|
|
|
- editable
|
|
|
- @refresh="loadTags(currentPatient.patientId)"
|
|
|
- :data="currentPatient"
|
|
|
- />
|
|
|
+ <PatientTagWidget style="min-height: 112px; flex: none" :dataset="tags" editable @refresh="loadTags(currentPatient?.patientId)" :data="currentPatient" />
|
|
|
<!-- <a-button
|
|
|
type="primary"
|
|
|
size="small"
|
|
|
@@ -1007,7 +1083,9 @@ watch(showProjectPopover, (val) => {
|
|
|
display: flex;
|
|
|
flex-direction: row;
|
|
|
width: 100vw;
|
|
|
- min-height: 100vh;
|
|
|
+ /* min-height: 100vh; */
|
|
|
+ height: var(--page-main-container);
|
|
|
+ overflow: hidden;
|
|
|
background: #fff;
|
|
|
}
|
|
|
.left-panel {
|
|
|
@@ -1016,7 +1094,7 @@ watch(showProjectPopover, (val) => {
|
|
|
border-right: 1px solid #eee;
|
|
|
padding: 16px 8px 0 16px;
|
|
|
background: #fafbfc;
|
|
|
- min-height: 100vh;
|
|
|
+ /* min-height: 100vh; */
|
|
|
box-sizing: border-box;
|
|
|
}
|
|
|
.patient-item {
|
|
|
@@ -1035,6 +1113,7 @@ watch(showProjectPopover, (val) => {
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
box-sizing: border-box;
|
|
|
+ overflow: auto;
|
|
|
}
|
|
|
.patient-info {
|
|
|
font-size: 14px;
|
|
|
@@ -1077,7 +1156,7 @@ watch(showProjectPopover, (val) => {
|
|
|
border-left: 1px solid #eee;
|
|
|
padding: 16px 8px 0 8px;
|
|
|
background: #fafbfc;
|
|
|
- min-height: 100vh;
|
|
|
+ /* min-height: 100vh; */
|
|
|
box-sizing: border-box;
|
|
|
}
|
|
|
.record-title {
|
|
|
@@ -1105,4 +1184,11 @@ watch(showProjectPopover, (val) => {
|
|
|
cursor: pointer;
|
|
|
margin-right: 10px;
|
|
|
}
|
|
|
+.scroll-content {
|
|
|
+ /* max-height: 600px; */
|
|
|
+ overflow-y: auto;
|
|
|
+ /* 可选:让滚动条更美观 */
|
|
|
+ scrollbar-width: thin;
|
|
|
+ scrollbar-color: #aaa #f5f5f5;
|
|
|
+}
|
|
|
</style>
|