|
@@ -57,8 +57,6 @@ const { loading: addOrgCwLoading, send: addOrgCw } = useRequest(addOrgCwMethod,
|
|
|
emit('submit');
|
|
emit('submit');
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
-const localData = reactive({ ...props.data }); // Create a local copy of props.data
|
|
|
|
|
-
|
|
|
|
|
const formData = reactive<FollowModel>({
|
|
const formData = reactive<FollowModel>({
|
|
|
name: '', //服务包名称
|
|
name: '', //服务包名称
|
|
|
price: 0, //总计价格
|
|
price: 0, //总计价格
|
|
@@ -197,8 +195,8 @@ watch(totalPrice, (val) => {
|
|
|
// }
|
|
// }
|
|
|
const projectSearchRef = useTemplateRef<HTMLInputElement>('projectSearchRef');
|
|
const projectSearchRef = useTemplateRef<HTMLInputElement>('projectSearchRef');
|
|
|
const projectSearchFocus = (visible: boolean) => {
|
|
const projectSearchFocus = (visible: boolean) => {
|
|
|
- if (visible) setTimeout(() => projectSearchRef.value?.focus?.(), 300)
|
|
|
|
|
-}
|
|
|
|
|
|
|
+ if (visible) setTimeout(() => projectSearchRef.value?.focus?.(), 300);
|
|
|
|
|
+};
|
|
|
|
|
|
|
|
const projectSearch = ref('');
|
|
const projectSearch = ref('');
|
|
|
const showProjectPopover = ref(false);
|
|
const showProjectPopover = ref(false);
|
|
@@ -221,6 +219,7 @@ const filteredProjects = computed(() => {
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
function onSelectProject({ row }: any) {
|
|
function onSelectProject({ row }: any) {
|
|
|
|
|
+ console.log(row, 'onSelectProject');
|
|
|
if ((formData.items ?? []).some((item) => item.conditioningProgramDetail?.name === row.name)) {
|
|
if ((formData.items ?? []).some((item) => item.conditioningProgramDetail?.name === row.name)) {
|
|
|
message.warning('不能重复添加该项目');
|
|
message.warning('不能重复添加该项目');
|
|
|
return;
|
|
return;
|
|
@@ -318,36 +317,38 @@ function detailPreview(row: any) {
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
- onHide() { showProjectPopover.value = true; }
|
|
|
|
|
|
|
+ onHide() {
|
|
|
|
|
+ showProjectPopover.value = true;
|
|
|
|
|
+ },
|
|
|
});
|
|
});
|
|
|
showProjectPopover.value = false;
|
|
showProjectPopover.value = false;
|
|
|
} else {
|
|
} else {
|
|
|
message.warning('请先添加服务包');
|
|
message.warning('请先添加服务包');
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-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, {
|
|
|
|
|
- data: row,
|
|
|
|
|
- onSubmit: (data) => {
|
|
|
|
|
- refresh(page.value);
|
|
|
|
|
- VxeUI.modal.close(`edit-part-modal`);
|
|
|
|
|
- },
|
|
|
|
|
- });
|
|
|
|
|
- },
|
|
|
|
|
|
|
+function editPart(row: any) {
|
|
|
|
|
+ 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, {
|
|
|
|
|
+ data: row,
|
|
|
|
|
+ onSubmit: (data:any) => {
|
|
|
|
|
+ console.log(data, '编辑穴位传递的参数');
|
|
|
|
|
+ // refresh(page.value);
|
|
|
|
|
+ VxeUI.modal.close(`edit-part-modal`);
|
|
|
|
|
+ },
|
|
|
|
|
+ });
|
|
|
},
|
|
},
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 添加计算数量的函数
|
|
// 添加计算数量的函数
|
|
@@ -355,6 +356,10 @@ function calculateCount(row: any) {
|
|
|
const pricingType = row.conditioningProgramDetail.pricingType;
|
|
const pricingType = row.conditioningProgramDetail.pricingType;
|
|
|
const period = Number(row.days) || 0;
|
|
const period = Number(row.days) || 0;
|
|
|
const frequency = Number(row.frequencyMeasure) || 0;
|
|
const frequency = Number(row.frequencyMeasure) || 0;
|
|
|
|
|
+ const maxCount = row.conditioningProgramDetail.cpDynamicPricingRule?.[1]?.max;
|
|
|
|
|
+ console.log(row, '添加计算数量的函数');
|
|
|
|
|
+ const acCount = (row.acuMeridianNames?.length ?? 0) + (row.acuPointNames?.length ?? 0);
|
|
|
|
|
+ console.log(acCount, 'acCount');
|
|
|
// 一口价
|
|
// 一口价
|
|
|
if (pricingType === '0') {
|
|
if (pricingType === '0') {
|
|
|
// 检查是否选择了"不限"
|
|
// 检查是否选择了"不限"
|
|
@@ -364,7 +369,7 @@ function calculateCount(row: any) {
|
|
|
} else {
|
|
} else {
|
|
|
const convertDose = Number(row.conditioningProgramDetail.cpFixedPricingRule.convertDose) || 0;
|
|
const convertDose = Number(row.conditioningProgramDetail.cpFixedPricingRule.convertDose) || 0;
|
|
|
const frequencyType = Number(row.frequencyType) || 0;
|
|
const frequencyType = Number(row.frequencyType) || 0;
|
|
|
- row.totalMeasure = Math.ceil(((period / frequencyType) * frequency)/convertDose);
|
|
|
|
|
|
|
+ row.totalMeasure = Math.ceil(((period / frequencyType) * frequency) / convertDose);
|
|
|
}
|
|
}
|
|
|
// 获取单价
|
|
// 获取单价
|
|
|
const unitPrice = Number(row.conditioningProgramDetail?.cpFixedPricingRule?.unitPrice) || 0;
|
|
const unitPrice = Number(row.conditioningProgramDetail?.cpFixedPricingRule?.unitPrice) || 0;
|
|
@@ -372,10 +377,39 @@ function calculateCount(row: any) {
|
|
|
row.totalPrice = (row.totalMeasure * unitPrice).toFixed(2);
|
|
row.totalPrice = (row.totalMeasure * unitPrice).toFixed(2);
|
|
|
} else if (pricingType === '1') {
|
|
} else if (pricingType === '1') {
|
|
|
// 按穴位计价
|
|
// 按穴位计价
|
|
|
- row.totalPrice =
|
|
|
|
|
- row.conditioningProgramDetail?.cpDynamicPricingRule?.reduce((sum: number, item: any) => {
|
|
|
|
|
- return sum + (Number(item.price) || 0);
|
|
|
|
|
- }, 0) || 0;
|
|
|
|
|
|
|
+ const frequencyType = Number(row.frequencyType) || 0;
|
|
|
|
|
+ row.totalMeasure = Math.ceil((period / frequencyType) * frequency);
|
|
|
|
|
+ let unitPrice: number = row.conditioningProgramDetail.cpDynamicPricingRule[0].price;
|
|
|
|
|
+ if (acCount > maxCount) {
|
|
|
|
|
+ if (row.conditioningProgramDetail.cpDynamicPricingRule?.[1]?.priceType === 0) {
|
|
|
|
|
+ // 单价
|
|
|
|
|
+ // let unitPrice: number = row.conditioningProgramDetail.cpDynamicPricingRule[1].price;
|
|
|
|
|
+ row.unitPrice = unitPrice;
|
|
|
|
|
+ // row.totalMeasure = Math.ceil((period / frequencyType) * frequency);
|
|
|
|
|
+ row.totalPrice = Math.ceil((period / frequencyType) * unitPrice * acCount);
|
|
|
|
|
+ } else if (row.conditioningProgramDetail.cpDynamicPricingRule?.[1]?.priceType === 1) {
|
|
|
|
|
+
|
|
|
|
|
+ // 一口价
|
|
|
|
|
+ row.conditioningProgramDetail.unitPrice = '-';
|
|
|
|
|
+ row.totalPrice = row.conditioningProgramDetail.cpDynamicPricingRule[1].price;
|
|
|
|
|
+ // row.totalMeasure = Math.ceil((period / frequencyType) * frequency);
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (row.conditioningProgramDetail.cpDynamicPricingRule?.length > 0) {
|
|
|
|
|
+ if (row.conditioningProgramDetail.cpDynamicPricingRule?.[0]?.priceType === 0) {
|
|
|
|
|
+ // 单价
|
|
|
|
|
+ // let unitPrice: number = row.conditioningProgramDetail.cpDynamicPricingRule[0].price;
|
|
|
|
|
+ row.unitPrice = unitPrice;
|
|
|
|
|
+ // row.totalMeasure = Math.ceil((period / frequencyType) * frequency);
|
|
|
|
|
+ row.totalPrice = Math.ceil((period / frequencyType) * unitPrice * acCount);
|
|
|
|
|
+ } else if (row.conditioningProgramDetail.cpDynamicPricingRule?.[0]?.priceType === 1) {
|
|
|
|
|
+ // 一口价
|
|
|
|
|
+ row.unitPrice = '-';
|
|
|
|
|
+ row.totalPrice = row.conditioningProgramDetail.cpDynamicPricingRule[0].price;
|
|
|
|
|
+ // row.totalMeasure = Math.ceil((period / frequencyType) * frequency);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -384,7 +418,7 @@ watch(
|
|
|
() => formData.items,
|
|
() => formData.items,
|
|
|
(newData) => {
|
|
(newData) => {
|
|
|
if (!newData) return;
|
|
if (!newData) return;
|
|
|
- newData.forEach((row) => {
|
|
|
|
|
|
|
+ newData.forEach((row: any) => {
|
|
|
if (row?.days || row?.frequencyType || row?.frequencyMeasure) {
|
|
if (row?.days || row?.frequencyType || row?.frequencyMeasure) {
|
|
|
calculateCount(row);
|
|
calculateCount(row);
|
|
|
}
|
|
}
|
|
@@ -538,9 +572,6 @@ onMounted(async () => {
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
await getProjectList();
|
|
await getProjectList();
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
const tableData = computed(() => {
|
|
const tableData = computed(() => {
|
|
@@ -609,15 +640,15 @@ function handleSelect(value: string, node: any, extra: any) {
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
<template>
|
|
|
- <div style="padding:0 24px">
|
|
|
|
|
- <div class="flex" style="align-items: center;">
|
|
|
|
|
|
|
+ <div style="padding: 0 24px">
|
|
|
|
|
+ <div class="flex" style="align-items: center">
|
|
|
<!-- 机构名称 -->
|
|
<!-- 机构名称 -->
|
|
|
- <div class="mr-10" v-if="props.data?.types === 'institution'" style="display: flex; align-items: center; margin-bottom: 0;">
|
|
|
|
|
- <span style="white-space: nowrap; margin-right: 8px;">机构名称:</span>
|
|
|
|
|
|
|
+ <div class="mr-10" v-if="props.data?.types === 'institution'" style="display: flex; align-items: center; margin-bottom: 0">
|
|
|
|
|
+ <span style="white-space: nowrap; margin-right: 8px">机构名称:</span>
|
|
|
<a-tree-select
|
|
<a-tree-select
|
|
|
v-model:value="formData.institutionId"
|
|
v-model:value="formData.institutionId"
|
|
|
show-search
|
|
show-search
|
|
|
- style="width: 220px;"
|
|
|
|
|
|
|
+ style="width: 220px"
|
|
|
:dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
|
|
:dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
|
|
|
placeholder="请选择"
|
|
placeholder="请选择"
|
|
|
allow-clear
|
|
allow-clear
|
|
@@ -627,14 +658,14 @@ function handleSelect(value: string, node: any, extra: any) {
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
<!-- 服务包名称 -->
|
|
<!-- 服务包名称 -->
|
|
|
- <div class="mr-6" style="display: flex; align-items: center; margin-bottom: 0;">
|
|
|
|
|
- <span style="white-space: nowrap; margin-right: 8px;">服务包名称:</span>
|
|
|
|
|
|
|
+ <div class="mr-6" style="display: flex; align-items: center; margin-bottom: 0">
|
|
|
|
|
+ <span style="white-space: nowrap; margin-right: 8px">服务包名称:</span>
|
|
|
<a-input style="width: 200px" v-model:value="formData.name" />
|
|
<a-input style="width: 200px" v-model:value="formData.name" />
|
|
|
<a-button type="primary" @click="addInstitution" class="ml-4" v-if="props.data?.types === 'institution'">引入</a-button>
|
|
<a-button type="primary" @click="addInstitution" class="ml-4" v-if="props.data?.types === 'institution'">引入</a-button>
|
|
|
</div>
|
|
</div>
|
|
|
<!-- 服务形象照 -->
|
|
<!-- 服务形象照 -->
|
|
|
- <div class="flex" v-if="props.data?.types === 'institution'" style="align-items: center; margin-bottom: 0;">
|
|
|
|
|
- <div class="w-35" style="white-space: nowrap; margin-right: 8px;">服务形象照:</div>
|
|
|
|
|
|
|
+ <div class="flex" v-if="props.data?.types === 'institution'" style="align-items: center; margin-bottom: 0">
|
|
|
|
|
+ <div class="w-35" style="white-space: nowrap; margin-right: 8px">服务形象照:</div>
|
|
|
<a-upload
|
|
<a-upload
|
|
|
:showUploadList="uploadProps"
|
|
:showUploadList="uploadProps"
|
|
|
v-model:file-list="fileList"
|
|
v-model:file-list="fileList"
|
|
@@ -752,7 +783,13 @@ function handleSelect(value: string, node: any, extra: any) {
|
|
|
<vxe-column field="conditioningProgramDetail.name" title="项目名称" width="180">
|
|
<vxe-column field="conditioningProgramDetail.name" title="项目名称" width="180">
|
|
|
<template #default="{ row, rowIndex }">
|
|
<template #default="{ row, rowIndex }">
|
|
|
<template v-if="rowIndex === tableData.length - 1">
|
|
<template v-if="rowIndex === tableData.length - 1">
|
|
|
- <a-popover v-model:open="showProjectPopover" trigger="click" placement="bottomLeft" :overlayStyle="{ width: '350px', padding: 0 }" @openChange="projectSearchFocus($event)">
|
|
|
|
|
|
|
+ <a-popover
|
|
|
|
|
+ v-model:open="showProjectPopover"
|
|
|
|
|
+ trigger="click"
|
|
|
|
|
+ placement="bottomLeft"
|
|
|
|
|
+ :overlayStyle="{ width: '350px', padding: 0 }"
|
|
|
|
|
+ @openChange="projectSearchFocus($event)"
|
|
|
|
|
+ >
|
|
|
<template #content>
|
|
<template #content>
|
|
|
<a-input ref="projectSearchRef" v-model:value="projectSearch" placeholder="输入项目名称搜索" style="margin: 8px; width: 90%" @input="() => nextTick()" />
|
|
<a-input ref="projectSearchRef" v-model:value="projectSearch" placeholder="输入项目名称搜索" style="margin: 8px; width: 90%" @input="() => nextTick()" />
|
|
|
<vxe-table :data="filteredProjects" border size="small" style="max-height: 240px; overflow-y: auto" @cell-click="onSelectProject">
|
|
<vxe-table :data="filteredProjects" border size="small" style="max-height: 240px; overflow-y: auto" @cell-click="onSelectProject">
|
|
@@ -795,7 +832,7 @@ function handleSelect(value: string, node: any, extra: any) {
|
|
|
<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 }}</span>
|
|
|
|
|
|
|
+ <span>{{ row.conditioningProgramDetail?.cpFixedPricingRule?.convertUnit ? row.conditioningProgramDetail?.cpFixedPricingRule?.convertUnit : '次' }}</span>
|
|
|
</div>
|
|
</div>
|
|
|
<div>
|
|
<div>
|
|
|
<a-checkbox-group
|
|
<a-checkbox-group
|
|
@@ -817,7 +854,7 @@ function handleSelect(value: string, node: any, extra: any) {
|
|
|
<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 }}</span>
|
|
|
|
|
|
|
+ <span>{{ row.conditioningProgramDetail?.cpFixedPricingRule?.convertUnit ? row.conditioningProgramDetail?.cpFixedPricingRule?.convertUnit : '次' }}</span>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
</vxe-column>
|
|
</vxe-column>
|
|
@@ -834,12 +871,12 @@ function handleSelect(value: string, node: any, extra: any) {
|
|
|
</vxe-column>
|
|
</vxe-column>
|
|
|
<vxe-column field="row?.conditioningProgramDetail?.cpFixedPricingRule?.unit" title="单位" width="60">
|
|
<vxe-column field="row?.conditioningProgramDetail?.cpFixedPricingRule?.unit" title="单位" width="60">
|
|
|
<template #default="{ row }">
|
|
<template #default="{ row }">
|
|
|
- {{ row?.conditioningProgramDetail?.cpFixedPricingRule?.pricingUnit || '-' }}
|
|
|
|
|
|
|
+ {{ row?.conditioningProgramDetail?.cpFixedPricingRule?.pricingUnit ? row?.conditioningProgramDetail?.cpFixedPricingRule?.pricingUnit : '次' }}
|
|
|
</template>
|
|
</template>
|
|
|
</vxe-column>
|
|
</vxe-column>
|
|
|
<vxe-column field="row.conditioningProgramDetail.cpFixedPricingRule.unitPrice" title="单价(元)" width="100">
|
|
<vxe-column field="row.conditioningProgramDetail.cpFixedPricingRule.unitPrice" title="单价(元)" width="100">
|
|
|
<template #default="{ row }">
|
|
<template #default="{ row }">
|
|
|
- {{ row.conditioningProgramDetail?.cpFixedPricingRule?.unitPrice ?? '-' }}
|
|
|
|
|
|
|
+ {{ row?.conditioningProgramDetail?.pricingType === '0' ? row.conditioningProgramDetail?.cpFixedPricingRule?.unitPrice : row?.unitPrice }}
|
|
|
</template>
|
|
</template>
|
|
|
</vxe-column>
|
|
</vxe-column>
|
|
|
<vxe-column field="row.totalPrice" title="总价(元)" width="auto" @change="() => calculateCount(row)">
|
|
<vxe-column field="row.totalPrice" title="总价(元)" width="auto" @change="() => calculateCount(row)">
|
|
@@ -867,7 +904,7 @@ function handleSelect(value: string, node: any, extra: any) {
|
|
|
|
|
|
|
|
<vxe-column field="conditioningProgramDetail.pricingType" title="穴位/经络/部位" width="120">
|
|
<vxe-column field="conditioningProgramDetail.pricingType" title="穴位/经络/部位" width="120">
|
|
|
<template #default="{ row }">
|
|
<template #default="{ row }">
|
|
|
- <a @click="editPart(row)" style="color: #1890ff; cursor: pointer" v-if="row?.conditioningProgramDetail?.pricingType === '1'">编辑</a>
|
|
|
|
|
|
|
+ <a @click="editPart(row)" style="color: #1890ff; cursor: pointer" v-if="row?.conditioningProgramDetail?.pricingType === '1'">编辑</a>
|
|
|
</template>
|
|
</template>
|
|
|
</vxe-column>
|
|
</vxe-column>
|
|
|
<vxe-column field="remark" title="说明" width="180">
|
|
<vxe-column field="remark" title="说明" width="180">
|