提交merge1.3
This commit is contained in:
@@ -17,7 +17,6 @@
|
||||
value-format="YYYY-MM-DD"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- @change="inventoryChange(queryParams.statisticsType)" -->
|
||||
<el-form-item label="统计类型:">
|
||||
<el-select
|
||||
v-model="queryParams.statisticsType"
|
||||
@@ -33,33 +32,6 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="医保号:" prop="ybCode">
|
||||
<el-input
|
||||
v-model="queryParams.ybCode"
|
||||
placeholder=""
|
||||
clearable
|
||||
style="width: 150px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="门诊号:" prop="busNo">
|
||||
<el-input
|
||||
v-model="queryParams.busNo"
|
||||
placeholder=""
|
||||
clearable
|
||||
style="width: 150px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="病人姓名:" prop="name">
|
||||
<el-input
|
||||
v-model="queryParams.name"
|
||||
placeholder=""
|
||||
clearable
|
||||
style="width:150px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="科室:" prop="departmentId">
|
||||
<el-select v-model="queryParams.departmentId" placeholder="" clearable style="width: 150px">
|
||||
<el-option
|
||||
@@ -89,6 +61,7 @@
|
||||
:value="supplyStatus.id"
|
||||
/>
|
||||
</el-select>
|
||||
<<<<<<< HEAD
|
||||
</el-form-item>
|
||||
<!-- 字典item_type -->
|
||||
<el-form-item label="项目类型:" prop="clinicalType">
|
||||
@@ -102,6 +75,27 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- 医保号,门诊号,患者姓名,项目名,项目编码 -->
|
||||
=======
|
||||
</el-form-item>
|
||||
<el-form-item label="项目类型:" prop="clinicalType" label-width="90px">
|
||||
<el-tree-select
|
||||
v-model="selectedTypeIds"
|
||||
:data="clinicalTree"
|
||||
:props="treeProps"
|
||||
placeholder="选择项目类型"
|
||||
clearable
|
||||
multiple
|
||||
style="width: 220px"
|
||||
:filterable="true"
|
||||
:check-strictly="false"
|
||||
:collapse-tags="selectedTypeIds.length > 2"
|
||||
:max-tag-count="3"
|
||||
:collapse-tags-tooltip="true"
|
||||
@change="handleTreeChange"
|
||||
@clear="handleTreeClear"
|
||||
/>
|
||||
</el-form-item>
|
||||
>>>>>>> v1.3
|
||||
<el-form-item
|
||||
label="医保号/门诊号/患者姓名/项目名/项目编码:"
|
||||
prop="searchKey"
|
||||
@@ -123,12 +117,22 @@
|
||||
style="margin-left: 20px; margin-right: 0px; margin-bottom: 5px"
|
||||
>
|
||||
<el-col :span="1.5">
|
||||
<<<<<<< HEAD
|
||||
<!-- v-hasPermi="['system:user:import']" -->
|
||||
<el-button type="primary" plain icon="Search" @click="handleQuery">查询</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<!-- v-hasPermi="['system:user:export']" -->
|
||||
<el-button type="warning" plain icon="CircleClose" @click="handleClear">重置</el-button>
|
||||
=======
|
||||
<el-button type="primary" plain icon="Search" @click="handleQuery">查询</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="CircleClose" @click="handleClear">重置</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport">导出</el-button>
|
||||
>>>>>>> v1.3
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
@@ -139,10 +143,14 @@
|
||||
@selection-change="handleSelectionChange"
|
||||
:span-method="arraySpanMethod"
|
||||
>
|
||||
<<<<<<< HEAD
|
||||
<!-- :span-method="arraySpanMethod" -->
|
||||
<!-- :summary-method="getSummaries"
|
||||
show-summary 每页单独合计-->
|
||||
<el-table-column type="selection" width="50px" align="center" resizable />
|
||||
=======
|
||||
<el-table-column type="selection" width="50px" align="center" />
|
||||
>>>>>>> v1.3
|
||||
<el-table-column
|
||||
label="门诊号"
|
||||
align="center"
|
||||
@@ -186,7 +194,10 @@
|
||||
:show-overflow-tooltip="true"
|
||||
resizable
|
||||
/>
|
||||
<<<<<<< HEAD
|
||||
|
||||
=======
|
||||
>>>>>>> v1.3
|
||||
<el-table-column
|
||||
label="药品项目"
|
||||
align="center"
|
||||
@@ -212,7 +223,10 @@
|
||||
:show-overflow-tooltip="true"
|
||||
resizable
|
||||
/>
|
||||
<<<<<<< HEAD
|
||||
|
||||
=======
|
||||
>>>>>>> v1.3
|
||||
<el-table-column
|
||||
label="开单人"
|
||||
align="center"
|
||||
@@ -286,7 +300,7 @@
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
v-show="total > 0 && !queryParams.searchKey"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNo"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@@ -316,17 +330,21 @@
|
||||
import {
|
||||
getReportChargePage,
|
||||
getAmbPractitionerDetail,
|
||||
// getMedicationDetailsInit,
|
||||
getDepartmentList,
|
||||
getReportChargeInit,
|
||||
} from './statisticalManagent';
|
||||
import useUserStore from '@/store/modules/user';
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
import { get } from 'lodash';
|
||||
>>>>>>> v1.3
|
||||
import { watch } from 'vue';
|
||||
const userStore = useUserStore();
|
||||
|
||||
const router = useRouter();
|
||||
const { proxy } = getCurrentInstance();
|
||||
const totalAmount = ref(0);
|
||||
<<<<<<< HEAD
|
||||
// const {
|
||||
// item_category_code,
|
||||
// hosp_lv
|
||||
@@ -334,6 +352,8 @@ const totalAmount = ref(0);
|
||||
// "item_category_code",
|
||||
// "hosp_lv"
|
||||
// );
|
||||
=======
|
||||
>>>>>>> v1.3
|
||||
const purchaseinventoryListAll = ref([]);
|
||||
const xiaojiTotal = ref([]);
|
||||
const rowSpan = ref(1);
|
||||
@@ -349,7 +369,27 @@ const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const occurrenceTime = ref([]);
|
||||
const getDepartmentOptions = ref([]);
|
||||
<<<<<<< HEAD
|
||||
// const queryParams.value.statisticsType = ref(1)
|
||||
=======
|
||||
|
||||
// 树形结构相关变量
|
||||
const selectedTypeIds = ref([]); // 选中的节点ID集合
|
||||
const clinicalTree = ref([]); // 树形结构数据
|
||||
const treeProps = ref({
|
||||
label: 'label',
|
||||
value: 'value',
|
||||
children: 'children',
|
||||
disabled: 'disabled',
|
||||
});
|
||||
|
||||
// 字典
|
||||
const { device_category_code, med_category_code, activity_category_code } = proxy.useDict(
|
||||
'device_category_code',
|
||||
'med_category_code',
|
||||
'activity_category_code'
|
||||
);
|
||||
>>>>>>> v1.3
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
@@ -358,14 +398,23 @@ const data = reactive({
|
||||
pageSize: 10,
|
||||
statisticsType: 1,
|
||||
searchKey: undefined,
|
||||
<<<<<<< HEAD
|
||||
// ybCode: undefined,
|
||||
// busNo:undefined,
|
||||
// name: undefined,
|
||||
=======
|
||||
>>>>>>> v1.3
|
||||
departmentId: undefined,
|
||||
issuerId: undefined,
|
||||
payeeId: undefined,
|
||||
clinicalType: undefined,
|
||||
<<<<<<< HEAD
|
||||
// clinicalName:undefined,
|
||||
=======
|
||||
medicationCategoryCode: undefined,
|
||||
deviceCategoryCode: undefined,
|
||||
activityCategoryCode: undefined,
|
||||
>>>>>>> v1.3
|
||||
chargeTimeSTime: undefined,
|
||||
chargeTimeETime: undefined,
|
||||
},
|
||||
@@ -373,17 +422,27 @@ const data = reactive({
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
// 监听表格数据变化计算合计金额
|
||||
watch(
|
||||
() => purchaseinventoryList.value,
|
||||
<<<<<<< HEAD
|
||||
(newVlaue) => {
|
||||
if (newVlaue && newVlaue.length > 0) {
|
||||
=======
|
||||
(newValue) => {
|
||||
if (newValue && newValue.length > 0) {
|
||||
>>>>>>> v1.3
|
||||
handleTotalAmount();
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
|
||||
// 监听统计类型变化
|
||||
watch(
|
||||
() => queryParams.value.statisticsType,
|
||||
<<<<<<< HEAD
|
||||
(newVlaue) => {
|
||||
queryParams.value.statisticsType = newVlaue;
|
||||
},
|
||||
@@ -430,6 +489,218 @@ function getTotals(row, i) {
|
||||
}
|
||||
const arraySpanMethod = ({ row, column, rowIndex, columnIndex }) => {
|
||||
// 合并一样的列住院号 outpatientNumber属性&&(queryParams.value.statisticsType==1||queryParams.value.statisticsType==4||queryParams.value.statisticsType==6)
|
||||
=======
|
||||
(newValue) => {
|
||||
queryParams.value.statisticsType = newValue;
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
|
||||
// 构建树形结构数据
|
||||
function buildClinicalTree() {
|
||||
clinicalTree.value = [];
|
||||
|
||||
if (!clinicalTypeOptions.value || !Array.isArray(clinicalTypeOptions.value)) {
|
||||
return;
|
||||
}
|
||||
|
||||
clinicalTypeOptions.value.forEach((topOption) => {
|
||||
if (!topOption) return;
|
||||
|
||||
const rootNode = {
|
||||
label: topOption.label || '',
|
||||
value: String(topOption.value),
|
||||
children: [],
|
||||
disabled: false,
|
||||
};
|
||||
|
||||
const parentValue = String(topOption.value);
|
||||
switch (parentValue) {
|
||||
case '1': // 药品类别
|
||||
if (med_category_code.value && Array.isArray(med_category_code.value)) {
|
||||
rootNode.children = med_category_code.value.map((item) => ({
|
||||
label: item.label || '',
|
||||
value: `med_${item.value}`,
|
||||
disabled: false,
|
||||
}));
|
||||
}
|
||||
break;
|
||||
case '2': // 器械类别
|
||||
if (device_category_code.value && Array.isArray(device_category_code.value)) {
|
||||
rootNode.children = device_category_code.value.map((item) => ({
|
||||
label: item.label || '',
|
||||
value: `dev_${item.value}`,
|
||||
disabled: false,
|
||||
}));
|
||||
}
|
||||
break;
|
||||
case '3': // 诊疗类别
|
||||
if (activity_category_code.value && Array.isArray(activity_category_code.value)) {
|
||||
rootNode.children = activity_category_code.value.map((item) => ({
|
||||
label: item.label || '',
|
||||
value: `act_${item.value}`,
|
||||
disabled: false,
|
||||
}));
|
||||
}
|
||||
break;
|
||||
case '4': // 挂号类别(无子节点)
|
||||
rootNode.children = [];
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
clinicalTree.value.push(rootNode);
|
||||
});
|
||||
}
|
||||
|
||||
// 树形选择器变化处理
|
||||
function handleTreeChange(selectedIds) {
|
||||
if (!Array.isArray(selectedIds)) {
|
||||
selectedIds = [];
|
||||
}
|
||||
|
||||
// 获取所有选中的叶子节点
|
||||
const leafNodeIds = getLeafNodeIds(selectedIds);
|
||||
|
||||
// 按类型拆分参数
|
||||
const medIds = [];
|
||||
const devIds = [];
|
||||
const actIds = [];
|
||||
const clinicalTypes = [];
|
||||
|
||||
leafNodeIds.forEach((id) => {
|
||||
const idStr = String(id);
|
||||
|
||||
if (idStr === '4') {
|
||||
// 挂号类型
|
||||
if (!clinicalTypes.includes('4')) clinicalTypes.push('4');
|
||||
} else if (idStr.startsWith('med_')) {
|
||||
// 药品子类别
|
||||
medIds.push(idStr.replace('med_', ''));
|
||||
if (!clinicalTypes.includes('1')) clinicalTypes.push('1');
|
||||
} else if (idStr.startsWith('dev_')) {
|
||||
// 器械子类别
|
||||
devIds.push(idStr.replace('dev_', ''));
|
||||
if (!clinicalTypes.includes('2')) clinicalTypes.push('2');
|
||||
} else if (idStr.startsWith('act_')) {
|
||||
// 诊疗子类别
|
||||
actIds.push(idStr.replace('act_', ''));
|
||||
if (!clinicalTypes.includes('3')) clinicalTypes.push('3');
|
||||
} else if (['1', '2', '3'].includes(idStr)) {
|
||||
// 父节点选中(全选)
|
||||
clinicalTypes.push(idStr);
|
||||
// 自动选中所有子类别
|
||||
const parentNode = clinicalTree.value.find(node => String(node.value) === idStr);
|
||||
if (parentNode?.children?.length) {
|
||||
parentNode.children.forEach(child => {
|
||||
const childId = String(child.value);
|
||||
if (childId.startsWith('med_')) medIds.push(childId.replace('med_', ''));
|
||||
if (childId.startsWith('dev_')) devIds.push(childId.replace('dev_', ''));
|
||||
if (childId.startsWith('act_')) actIds.push(childId.replace('act_', ''));
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// 更新查询参数
|
||||
queryParams.value.clinicalType = clinicalTypes.length ? clinicalTypes.join(',') : undefined;
|
||||
queryParams.value.medicationCategoryCode = medIds.length ? medIds.join(',') : undefined;
|
||||
queryParams.value.deviceCategoryCode = devIds.length ? devIds.join(',') : undefined;
|
||||
queryParams.value.activityCategoryCode = actIds.length ? actIds.join(',') : undefined;
|
||||
|
||||
console.log('最终查询参数:', {
|
||||
clinicalType: queryParams.value.clinicalType,
|
||||
medicationCategoryCode: queryParams.value.medicationCategoryCode,
|
||||
deviceCategoryCode: queryParams.value.deviceCategoryCode,
|
||||
activityCategoryCode: queryParams.value.activityCategoryCode
|
||||
});
|
||||
}
|
||||
|
||||
// 获取所有叶子节点ID(处理父节点选中情况)
|
||||
function getLeafNodeIds(selectedIds) {
|
||||
const leafIds = [];
|
||||
|
||||
const traverse = (nodes) => {
|
||||
nodes.forEach(node => {
|
||||
const nodeValue = String(node.value);
|
||||
if (selectedIds.includes(nodeValue)) {
|
||||
if (!node.children || !node.children.length) {
|
||||
// 叶子节点直接添加
|
||||
leafIds.push(nodeValue);
|
||||
} else {
|
||||
// 父节点选中,递归获取所有子节点
|
||||
traverse(node.children);
|
||||
}
|
||||
} else if (node.children && node.children.length) {
|
||||
// 继续递归检查子节点
|
||||
traverse(node.children);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
traverse(clinicalTree.value);
|
||||
|
||||
// 处理直接选中的叶子节点(非父节点递归获取的)
|
||||
selectedIds.forEach(id => {
|
||||
const idStr = String(id);
|
||||
// 挂号类型或无子节点的节点直接添加
|
||||
if (idStr === '4' || !clinicalTree.value.some(node =>
|
||||
String(node.value) === idStr && node.children && node.children.length
|
||||
)) {
|
||||
if (!leafIds.includes(idStr)) {
|
||||
leafIds.push(idStr);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return [...new Set(leafIds)];
|
||||
}
|
||||
|
||||
// 树形选择器清空处理
|
||||
function handleTreeClear() {
|
||||
selectedTypeIds.value = [];
|
||||
queryParams.value.clinicalType = undefined;
|
||||
queryParams.value.medicationCategoryCode = undefined;
|
||||
queryParams.value.deviceCategoryCode = undefined;
|
||||
queryParams.value.activityCategoryCode = undefined;
|
||||
}
|
||||
|
||||
// 计算合计金额
|
||||
function handleTotalAmount() {
|
||||
totalAmount.value = purchaseinventoryList.value.reduce((accumulator, currentRow) => {
|
||||
return accumulator + (Number(currentRow.totalPrice) || 0);
|
||||
}, 0);
|
||||
}
|
||||
|
||||
// 门诊号合并行处理
|
||||
function getTotals(row, i) {
|
||||
let totalPriceSums = Number(purchaseinventoryList.value[i].totalPrice);
|
||||
|
||||
for (let j = 1; i - j >= 0; j++) {
|
||||
if (purchaseinventoryList.value[i].busNo == purchaseinventoryList.value[i - j].busNo) {
|
||||
totalPriceSums += Number(purchaseinventoryList.value[i - j].totalPrice);
|
||||
}
|
||||
}
|
||||
|
||||
xiaojiTotal.value.push({
|
||||
inde: i + 1,
|
||||
busNo: row.busNo,
|
||||
genderEnum_enumText: row.genderEnum_enumText,
|
||||
totalPrice: totalPriceSums.toFixed(4) || 0.0,
|
||||
});
|
||||
|
||||
purchaseinventoryList.value.splice(i + 1, 0, {
|
||||
busNo: row.busNo,
|
||||
genderEnum_enumText: row.genderEnum_enumText,
|
||||
departmentName: '小计',
|
||||
totalPrice: totalPriceSums.toFixed(4) || 0.0,
|
||||
});
|
||||
}
|
||||
|
||||
// 表格合并行方法
|
||||
const arraySpanMethod = ({ row, column, rowIndex, columnIndex }) => {
|
||||
>>>>>>> v1.3
|
||||
if (columnIndex === 1 && purchaseinventoryList.value.length > 0) {
|
||||
if (
|
||||
rowIndex === 0 ||
|
||||
@@ -437,7 +708,11 @@ const arraySpanMethod = ({ row, column, rowIndex, columnIndex }) => {
|
||||
) {
|
||||
let rowspan = 1;
|
||||
let totalPriceSum = 0;
|
||||
<<<<<<< HEAD
|
||||
// let totalReturnPriceSum = 0
|
||||
=======
|
||||
|
||||
>>>>>>> v1.3
|
||||
for (let i = rowIndex + 1; i < purchaseinventoryList.value.length + 1; i++) {
|
||||
if (purchaseinventoryList.value[i - 1].departmentName != '合计') {
|
||||
if (
|
||||
@@ -446,18 +721,30 @@ const arraySpanMethod = ({ row, column, rowIndex, columnIndex }) => {
|
||||
) {
|
||||
rowspan++;
|
||||
totalPriceSum += Number(purchaseinventoryList.value[i].totalPrice);
|
||||
<<<<<<< HEAD
|
||||
// totalReturnPriceSum += Number(purchaseinventoryList.value[i].refundPrice)
|
||||
=======
|
||||
|
||||
>>>>>>> v1.3
|
||||
if (i == purchaseinventoryList.value.length - 1) {
|
||||
let findIndexTotal = xiaojiTotal.value.findIndex((k) => k.busNo == row.busNo);
|
||||
if (findIndexTotal < 0) {
|
||||
getTotals(row, i);
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
} else {
|
||||
}
|
||||
} else {
|
||||
totalPriceSum += Number(row.totalPrice);
|
||||
// totalReturnPriceSum += Number(row.refundPrice)
|
||||
let findIndexTotal = xiaojiTotal.value.findIndex((k) => k.busNo == row.busNo);
|
||||
=======
|
||||
}
|
||||
} else {
|
||||
totalPriceSum += Number(row.totalPrice);
|
||||
let findIndexTotal = xiaojiTotal.value.findIndex((k) => k.busNo == row.busNo);
|
||||
|
||||
>>>>>>> v1.3
|
||||
if (findIndexTotal < 0) {
|
||||
xiaojiTotal.value.push({
|
||||
inde: i,
|
||||
@@ -465,19 +752,27 @@ const arraySpanMethod = ({ row, column, rowIndex, columnIndex }) => {
|
||||
busNo: row.busNo,
|
||||
totalPrice: totalPriceSum,
|
||||
});
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
|
||||
>>>>>>> v1.3
|
||||
purchaseinventoryList.value.splice(i, 0, {
|
||||
busNo: row.busNo,
|
||||
genderEnum_enumText: row.genderEnum_enumText,
|
||||
departmentName: '小计',
|
||||
totalPrice: totalPriceSum.toFixed(4) || 0.0,
|
||||
});
|
||||
<<<<<<< HEAD
|
||||
// console.log(purchaseinventoryList.value,"12121")
|
||||
=======
|
||||
>>>>>>> v1.3
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
rowspan++;
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
return { rowspan, colspan: 1 };
|
||||
} else {
|
||||
// 非起始行不显示
|
||||
@@ -534,12 +829,32 @@ function inventoryChange(val) {
|
||||
purchaseinventoryList.value = [];
|
||||
getList();
|
||||
}
|
||||
=======
|
||||
|
||||
return { rowspan, colspan: 1 };
|
||||
} else {
|
||||
return { rowspan: 0, colspan: 0 };
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// 统计类型变化处理
|
||||
function inventoryChange(val) {
|
||||
queryParams.value.statisticsType = val;
|
||||
xiaojiTotal.value = [];
|
||||
purchaseinventoryList.value = [];
|
||||
getList();
|
||||
}
|
||||
|
||||
// 初始化数据加载
|
||||
>>>>>>> v1.3
|
||||
function getPharmacyCabinetLists() {
|
||||
getReportChargeInit().then((response) => {
|
||||
inventoryOptions.value = response.data.statisticsTypeOptions;
|
||||
queryParams.value.statisticsType = 1;
|
||||
issuerOptions.value = response.data.issuerOptions;
|
||||
payeeOptions.value = response.data.payeeOptions;
|
||||
<<<<<<< HEAD
|
||||
clinicalTypeOptions.value = response.data.clinicalTypeOptions;
|
||||
});
|
||||
getDepartmentList().then((response) => {
|
||||
@@ -547,12 +862,30 @@ function getPharmacyCabinetLists() {
|
||||
});
|
||||
}
|
||||
/** 查询调拨管理项目列表 */
|
||||
=======
|
||||
clinicalTypeOptions.value = response.data.clinicalTypeOptions || [];
|
||||
|
||||
// 确保字典数据加载完成后再构建树形
|
||||
nextTick(() => {
|
||||
buildClinicalTree();
|
||||
});
|
||||
});
|
||||
|
||||
getDepartmentList().then((response) => {
|
||||
getDepartmentOptions.value = response.data || [];
|
||||
});
|
||||
}
|
||||
|
||||
// 查询列表数据
|
||||
>>>>>>> v1.3
|
||||
function getList(type) {
|
||||
if (type) {
|
||||
xiaojiTotal.value = [];
|
||||
purchaseinventoryList.value = [];
|
||||
}
|
||||
|
||||
loading.value = true;
|
||||
<<<<<<< HEAD
|
||||
// purchaseinventoryList.value = [
|
||||
// {busNo:'M2505070009100304',name:"张三",departmentName:'CF2505070009101361',birthDate:'2025-05-07 16:28',practitionerName:'张三',practitionerName:'王东收费',clinicalName:'依折麦布片',busNo:'yp3065',medicalName:'依折麦布片',ybNo:'XC10AXY097A0010',totalVolume:'10mg*10',salePrice:'63.56',price:'63.56',totalPrice:'63.56',number:'1盒',totalPrice:'63.56',refundQuantity:'0.00盒',refundPrice:'0.00',lotNumber:'Y013201',manufacturerText:'杭州默沙东制药有限公司',supplierName:'旧系统批量'},
|
||||
// {busNo:'M2505070009100304',name:"张三",departmentName:'CF2505070009101362',birthDate:'2025-05-07 16:28',practitionerName:'张三',practitionerName:'王东收费',clinicalName:'布洛芬缓释胶囊',busNo:'yp3065',medicalName:'布洛芬缓释胶囊',ybNo:'XC10AXY097A0010',totalVolume:'0.3g*24',salePrice:'4.8',price:'4.8',totalPrice:'4.8',number:'1盒',totalPrice:'4.8',refundQuantity:'0.00盒',refundPrice:'0.00',lotNumber:'72240709',manufacturerText:'上海信谊天平药业有限公司',supplierName:'旧系统批量'},
|
||||
@@ -605,11 +938,72 @@ function getList(type) {
|
||||
totalPrice2 = totalPrice2 ? totalPrice2.toFixed(4) : totalPrice2;
|
||||
// refundPrice2 = refundPrice2?refundPrice2.toFixed(4):refundPrice2
|
||||
let pageNoAll = total.value / queryParams.value.pageSize;
|
||||
=======
|
||||
var totalPrice2 = 0;
|
||||
|
||||
// 构建请求参数(自动排除undefined/null属性)
|
||||
let param = {
|
||||
...queryParams.value,
|
||||
pageSize: queryParams.value.searchKey ? 1000 : queryParams.value.pageSize,
|
||||
pageNo: queryParams.value.searchKey ? 1 : queryParams.value.pageNo,
|
||||
};
|
||||
|
||||
// 移除空值参数
|
||||
Object.keys(param).forEach(key => {
|
||||
if (param[key] === undefined || param[key] === null || param[key] === '') {
|
||||
delete param[key];
|
||||
}
|
||||
});
|
||||
|
||||
getReportChargePage(param).then((res) => {
|
||||
purchaseinventoryList.value = res.data.records || [];
|
||||
total.value = res.data.total;
|
||||
|
||||
purchaseinventoryList.value.map((k) => {
|
||||
k.totalPrice = k.totalPrice ? k.totalPrice.toFixed(4) : '0.0000';
|
||||
k.price = k.price ? k.price.toFixed(4) : '0.0000';
|
||||
k.number = k.number
|
||||
? k.number + (k.quantityUnit_dictText ? k.quantityUnit_dictText : '')
|
||||
: '0.0000' + (k.quantityUnit_dictText ? k.quantityUnit_dictText : '');
|
||||
});
|
||||
|
||||
// 处理搜索关键词时的合计
|
||||
if (queryParams.value.searchKey) {
|
||||
purchaseinventoryList.value.forEach((k) => {
|
||||
if (k.departmentName !== '小计' && k.departmentName !== '合计') {
|
||||
totalPrice2 += Number(k.totalPrice) || 0;
|
||||
}
|
||||
});
|
||||
|
||||
totalPrice2 = totalPrice2 ? totalPrice2.toFixed(4) : totalPrice2;
|
||||
purchaseinventoryList.value.push({ departmentName: '合计', totalPrice: totalPrice2 });
|
||||
loading.value = false;
|
||||
return;
|
||||
}
|
||||
|
||||
// 处理分页数据
|
||||
purchaseinventoryList.value.forEach((k) => {
|
||||
if (total.value && total.value <= queryParams.value.pageSize) {
|
||||
totalPrice2 += Number(k.totalPrice);
|
||||
}
|
||||
});
|
||||
|
||||
if (total.value <= res.data.size) {
|
||||
loading.value = false;
|
||||
}
|
||||
|
||||
// 单页数据合计
|
||||
if (total.value && total.value <= queryParams.value.pageSize) {
|
||||
totalPrice2 = totalPrice2 ? totalPrice2.toFixed(4) : totalPrice2;
|
||||
let pageNoAll = total.value / queryParams.value.pageSize;
|
||||
|
||||
>>>>>>> v1.3
|
||||
if (Math.ceil(pageNoAll) == queryParams.value.pageNo) {
|
||||
purchaseinventoryList.value.push({ departmentName: '合计', totalPrice: totalPrice2 });
|
||||
}
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
// 带分页数据
|
||||
if (total.value && total.value > queryParams.value.pageSize) {
|
||||
// var purchaseinventoryListsAll = []
|
||||
@@ -627,10 +1021,29 @@ function getList(type) {
|
||||
// }
|
||||
// purchaseinventoryListAll.value = purchaseinventoryListsArrayAll
|
||||
purchaseinventoryListAll.value = res.data.records || [];
|
||||
=======
|
||||
// 多页数据处理
|
||||
if (total.value && total.value > queryParams.value.pageSize && !queryParams.value.searchKey) {
|
||||
let queryParamsValue = { ...queryParams.value };
|
||||
queryParamsValue.pageSize = total.value;
|
||||
queryParamsValue.pageNo = 1;
|
||||
|
||||
// 移除空值参数
|
||||
Object.keys(queryParamsValue).forEach(key => {
|
||||
if (queryParamsValue[key] === undefined || queryParamsValue[key] === null || queryParamsValue[key] === '') {
|
||||
delete queryParamsValue[key];
|
||||
}
|
||||
});
|
||||
|
||||
getReportChargePage(queryParamsValue).then((res) => {
|
||||
purchaseinventoryListAll.value = res.data.records || [];
|
||||
|
||||
>>>>>>> v1.3
|
||||
if (purchaseinventoryListAll.value.length > 0) {
|
||||
purchaseinventoryListAll.value.map((k, index) => {
|
||||
k.totalPrice = k.totalPrice ? k.totalPrice.toFixed(4) : '0.0000';
|
||||
k.price = k.price ? k.price.toFixed(4) : '0.0000';
|
||||
<<<<<<< HEAD
|
||||
// k.refundPrice = k.refundPrice || '0.00'
|
||||
k.number = k.number
|
||||
? k.number + k.quantityUnit_dictText
|
||||
@@ -644,22 +1057,37 @@ function getList(type) {
|
||||
// refundPrice2 += Number(k.refundPrice)
|
||||
//处理不同页门诊号相同小计在最后回显问题start
|
||||
// m<queryParams.value.pageSize&&
|
||||
=======
|
||||
k.number = k.number
|
||||
? k.number + (k.quantityUnit_dictText ? k.quantityUnit_dictText : '')
|
||||
: '0.0000' + (k.quantityUnit_dictText ? k.quantityUnit_dictText : '');
|
||||
|
||||
totalPrice2 += Number(k.totalPrice);
|
||||
|
||||
// 处理跨页门诊号小计
|
||||
>>>>>>> v1.3
|
||||
for (let m = 1; m < index; m++) {
|
||||
if (
|
||||
queryParams.value.pageNo > 1 &&
|
||||
index == queryParams.value.pageSize * (queryParams.value.pageNo - 1) &&
|
||||
k.busNo == purchaseinventoryListAll.value[index - m]?.busNo
|
||||
) {
|
||||
<<<<<<< HEAD
|
||||
// purchaseinventoryList.value.unshift(purchaseinventoryListAll.value[index-m]) // 加
|
||||
// //修改计算的小计缺少加过来的部分
|
||||
let dispenseNoIndex1 = purchaseinventoryList.value.findIndex(
|
||||
(o) =>
|
||||
o.departmentName == '小计' &&
|
||||
o.busNo == purchaseinventoryListAll.value[index - m].busNo
|
||||
=======
|
||||
let dispenseNoIndex1 = purchaseinventoryList.value.findIndex(
|
||||
(o) => o.departmentName == '小计' && o.busNo == purchaseinventoryListAll.value[index - m].busNo
|
||||
>>>>>>> v1.3
|
||||
);
|
||||
|
||||
if (dispenseNoIndex1 > 0) {
|
||||
purchaseinventoryList.value[dispenseNoIndex1].totalPrice =
|
||||
<<<<<<< HEAD
|
||||
Number(purchaseinventoryList.value[dispenseNoIndex1].totalPrice) +
|
||||
Number(purchaseinventoryListAll.value[index - m].totalPrice);
|
||||
purchaseinventoryList.value[dispenseNoIndex1].totalPrice = purchaseinventoryList
|
||||
@@ -668,6 +1096,13 @@ function getList(type) {
|
||||
: '0.0000';
|
||||
}
|
||||
}
|
||||
=======
|
||||
(Number(purchaseinventoryList.value[dispenseNoIndex1].totalPrice) +
|
||||
Number(purchaseinventoryListAll.value[index - m].totalPrice)).toFixed(4) || '0.0000';
|
||||
}
|
||||
}
|
||||
|
||||
>>>>>>> v1.3
|
||||
if (
|
||||
index + m == queryParams.value.pageSize * queryParams.value.pageNo &&
|
||||
k.busNo == purchaseinventoryListAll.value[index + m]?.busNo
|
||||
@@ -676,6 +1111,7 @@ function getList(type) {
|
||||
purchaseinventoryList.value[purchaseinventoryList.value.length - 1]
|
||||
.departmentName == '小计'
|
||||
) {
|
||||
<<<<<<< HEAD
|
||||
purchaseinventoryList.value.splice(purchaseinventoryList.value.length - 1, 1); // 减掉第二页还有相同门诊号的第一页的小计
|
||||
}
|
||||
// let dispenseNoIndex = purchaseinventoryList.value.findIndex(o=>o.paymentId==k.paymentId&&o.chargeId==k.chargeId) //通过唯一主键进行区分
|
||||
@@ -690,6 +1126,17 @@ function getList(type) {
|
||||
totalPrice2 = totalPrice2 ? totalPrice2.toFixed(4) : totalPrice2;
|
||||
// refundPrice2 = refundPrice2?refundPrice2.toFixed(4):refundPrice2
|
||||
loading.value = false;
|
||||
=======
|
||||
purchaseinventoryList.value.splice(purchaseinventoryList.value.length - 1, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
totalPrice2 = totalPrice2 ? totalPrice2.toFixed(4) : totalPrice2;
|
||||
loading.value = false;
|
||||
|
||||
>>>>>>> v1.3
|
||||
let pageNoAll = total.value / queryParams.value.pageSize;
|
||||
if (Math.ceil(pageNoAll) == queryParams.value.pageNo) {
|
||||
purchaseinventoryList.value.push({ departmentName: '合计', totalPrice: totalPrice2 });
|
||||
@@ -700,49 +1147,87 @@ function getList(type) {
|
||||
});
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
/** 搜索按钮操作 */
|
||||
=======
|
||||
// 查询按钮点击事件
|
||||
>>>>>>> v1.3
|
||||
function handleQuery() {
|
||||
queryParams.value.chargeTimeSTime =
|
||||
occurrenceTime.value && occurrenceTime.value.length == 2
|
||||
? occurrenceTime.value[0] + ' 00:00:00'
|
||||
: '';
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
|
||||
>>>>>>> v1.3
|
||||
queryParams.value.chargeTimeETime =
|
||||
occurrenceTime.value && occurrenceTime.value.length == 2
|
||||
? occurrenceTime.value[1] + ' 23:59:59'
|
||||
: '';
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
|
||||
>>>>>>> v1.3
|
||||
queryParams.value.pageNo = 1;
|
||||
getList(1);
|
||||
}
|
||||
|
||||
/** 清空条件按钮操作 */
|
||||
// 重置按钮点击事件
|
||||
function handleClear() {
|
||||
<<<<<<< HEAD
|
||||
// 清空查询条件
|
||||
occurrenceTime.value = '';
|
||||
queryParams.value.chargeTimeSTime = '';
|
||||
queryParams.value.chargeTimeETime = '';
|
||||
=======
|
||||
occurrenceTime.value = [];
|
||||
queryParams.value.chargeTimeSTime = '';
|
||||
queryParams.value.chargeTimeETime = '';
|
||||
queryParams.value.searchKey = undefined;
|
||||
queryParams.value.departmentId = undefined;
|
||||
queryParams.value.issuerId = undefined;
|
||||
queryParams.value.payeeId = undefined;
|
||||
queryParams.value.clinicalType = undefined;
|
||||
queryParams.value.medicationCategoryCode = undefined;
|
||||
queryParams.value.deviceCategoryCode = undefined;
|
||||
queryParams.value.activityCategoryCode = undefined;
|
||||
|
||||
selectedTypeIds.value = [];
|
||||
>>>>>>> v1.3
|
||||
proxy.resetForm('queryRef');
|
||||
getList(1);
|
||||
}
|
||||
|
||||
/** 选择条数 */
|
||||
// 表格选择事件
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map((item) => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
// 初始化日期范围为当前月第一天到今天
|
||||
=======
|
||||
// 初始化日期范围为当月
|
||||
>>>>>>> v1.3
|
||||
function initDefaultDateRange() {
|
||||
const now = new Date();
|
||||
const year = now.getFullYear();
|
||||
const month = now.getMonth();
|
||||
|
||||
<<<<<<< HEAD
|
||||
// 当前月第一天
|
||||
const firstDay = new Date(year, month, 1);
|
||||
// 今天
|
||||
const today = now;
|
||||
|
||||
// 格式化为YYYY-MM-DD格式
|
||||
=======
|
||||
const firstDay = new Date(year, month, 1);
|
||||
const today = now;
|
||||
|
||||
>>>>>>> v1.3
|
||||
const formatDate = (date) => {
|
||||
const y = date.getFullYear();
|
||||
const m = String(date.getMonth() + 1).padStart(2, '0');
|
||||
@@ -752,16 +1237,44 @@ function initDefaultDateRange() {
|
||||
|
||||
occurrenceTime.value = [formatDate(firstDay), formatDate(today)];
|
||||
|
||||
<<<<<<< HEAD
|
||||
// 同时设置到queryParams中,确保首次加载时传递时间参数
|
||||
=======
|
||||
>>>>>>> v1.3
|
||||
queryParams.value.chargeTimeSTime = occurrenceTime.value[0] + ' 00:00:00';
|
||||
queryParams.value.chargeTimeETime = occurrenceTime.value[1] + ' 23:59:59';
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
// 导出Excel
|
||||
function handleExport() {
|
||||
// 构建导出参数(移除分页参数)
|
||||
const exportParams = { ...queryParams.value };
|
||||
delete exportParams.pageNo;
|
||||
delete exportParams.pageSize;
|
||||
|
||||
// 移除空值参数
|
||||
Object.keys(exportParams).forEach(key => {
|
||||
if (exportParams[key] === undefined || exportParams[key] === null || exportParams[key] === '') {
|
||||
delete exportParams[key];
|
||||
}
|
||||
});
|
||||
|
||||
proxy.downloadGet(
|
||||
'/report-manage/charge/excel-out',
|
||||
exportParams,
|
||||
`门诊收费报表_${proxy.formatDateStr(new Date(), 'YYYY-MM-DD')}.xlsx`
|
||||
);
|
||||
}
|
||||
|
||||
>>>>>>> v1.3
|
||||
// 初始化页面
|
||||
getPharmacyCabinetLists();
|
||||
initDefaultDateRange();
|
||||
getList();
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.custom-tree-node {
|
||||
display: flex;
|
||||
|
||||
Reference in New Issue
Block a user