解决合并冲突

This commit is contained in:
2025-12-10 14:20:24 +08:00
parent e1385cb3e6
commit 18f6a845e6
804 changed files with 61881 additions and 13577 deletions

View File

@@ -59,63 +59,57 @@
>
重置
</el-button>
<el-button
class="table-header-button"
type="primary"
@click="getList"
icon="Search"
>
<el-button class="table-header-button" type="primary" @click="getList" icon="Search">
搜索
</el-button>
</div>
<el-table
max-height="700"
:data="receiptList"
row-key="supplyBusNo"
v-loading="loading"
>
<el-table-column
label="单据号"
align="center"
prop="supplyBusNo"
width="200"
/>
<el-table-column
label="审批状态"
align="center"
prop="statusEnum_enumText"
/>
<el-table-column
label="单据类型"
align="center"
prop="typeEnum_enumText"
/>
<el-table max-height="700" :data="receiptList" row-key="supplyBusNo" v-loading="loading">
<el-table-column label="单据号" align="center" prop="supplyBusNo" width="160" />
<el-table-column label="审批状态" align="center" prop="statusEnum_enumText" />
<el-table-column label="单据类型" align="center" prop="typeEnum_enumText" />
<el-table-column label="经手人" align="center" prop="practitionerId_dictText">
<template #default="scope">
<span>{{ scope.row.practitionerId_dictText || '-' }}</span>
</template>
</el-table-column>
<el-table-column
label="供应商"
align="center"
prop="supplierId_dictText"
/>
<el-table-column
label="经手人"
align="center"
prop="practitionerId_dictText"
/>
<el-table-column
label="申请人"
align="center"
prop="applicantId_dictText"
/>
<el-table-column label="申请时间" align="center" prop="applyTime">
width="180"
:show-overflow-tooltip="true"
>
<template #default="scope">
<span>{{ scope.row.supplierId_dictText || '-' }}</span>
</template>
</el-table-column>
<el-table-column label="目的仓库" align="center" prop="purposeLocationId_dictText">
<template #default="scope">
<span>{{ scope.row.purposeLocationId_dictText || '-' }}</span>
</template>
</el-table-column>
<el-table-column label="总金额" align="center" prop="totalAmount">
<template #default="scope">
<span v-if="scope.row.totalAmount">{{ scope.row.totalAmount }} </span>
<span v-else>{{ '-' }}</span>
</template>
</el-table-column>
<el-table-column label="申请人" align="center" prop="applicantId_dictText">
<template #default="scope">
<span>{{ scope.row.applicantId_dictText || '-' }}</span>
</template>
</el-table-column>
<el-table-column label="申请时间" align="center" prop="applyTime" width="180">
<template #default="scope">
{{ formatDate(scope.row.applyTime) }}
</template>
</el-table-column>
<el-table-column
label="审批人"
align="center"
prop="approverId_dictText"
/>
<el-table-column label="审批时间" align="center" prop="approvalTime">
<el-table-column label="审批人" align="center" prop="approverId_dictText">
<template #default="scope">
<span>{{ scope.row.approverId_dictText || '-' }}</span>
</template>
</el-table-column>
<el-table-column label="审批时间" align="center" prop="approvalTime" width="180">
<template #default="scope">
{{ formatDate(scope.row.approvalTime) }}
</template>
@@ -130,34 +124,12 @@
<el-button
link
type="primary"
@click="handelApplys(scope.row,'apply')"
@click="handelApplys(scope.row, 'apply')"
:disabled="scope.row.statusEnum == 3 || scope.row.statusEnum == 4"
>
审批
</el-button>
<el-button
link
type="primary"
@click="handelApplys(scope.row,'view')"
>
查看
</el-button>
<!-- <el-button
link
type="primary"
@click="handelApply(scope.row)"
:disabled="scope.row.statusEnum == 3 || scope.row.statusEnum == 4"
>
审批通过
</el-button>
<el-button
link
type="primary"
@click="handleReject(scope.row)"
:disabled="scope.row.statusEnum == 4 || scope.row.statusEnum == 3"
>
驳回
</el-button> -->
<el-button link type="primary" @click="handelApplys(scope.row, 'view')"> 查看 </el-button>
</template>
</el-table-column>
</el-table>
@@ -187,14 +159,13 @@ import {
} from "./components/api";
import { purchaseInventoryApproved as purchaseReturnApproved } from '../returnedPurchase/components/api';
import { useStore } from '@/store/store';
import { formatDate } from "@/utils/index";
import { formatDate } from '@/utils/index';
import useTagsViewStore from '@/store/modules/tagsView';
const tagsViewStore = useTagsViewStore();
const router = useRouter();
const route = useRoute();
const store = useStore();
const { proxy } = getCurrentInstance();
const emit = defineEmits(["selectAdviceBase"]);
const emit = defineEmits(['selectAdviceBase']);
const total = ref(0);
const queryParams = ref({
pageNo: 1,
@@ -208,8 +179,8 @@ const loading = ref(false);
watch(
() => route.query.type,
(newVlaue) => {
if(newVlaue){
getList()
if (newVlaue) {
getList();
}
},
{ immediate: true }
@@ -226,38 +197,43 @@ function getList() {
}
function handelApply(row) {
if(row.typeEnum ==2 || row.typeEnum ==8){ //商品调拨 8 批量
if (row.typeEnum == 2 || row.typeEnum == 8) {
//商品调拨 8 批量
productTransferApproved(row.supplyBusNo).then((res) => {
if (res.code == 200) {
proxy.$modal.msgSuccess("操作成功");
proxy.$modal.msgSuccess('操作成功');
getList();
}
});
}else if(row.typeEnum ==7 ){ //领用出库审批通过
} else if (row.typeEnum == 7) {
//领用出库审批通过
requisitionIssueApproved(row.supplyBusNo).then((res) => {
if (res.code == 200) {
proxy.$modal.msgSuccess("操作成功");
proxy.$modal.msgSuccess('操作成功');
getList();
}
});
}else if(row.typeEnum == 9){ //领用退库审批通过
} else if (row.typeEnum == 9) {
//领用退库审批通过
returnIssueApproved(row.supplyBusNo).then((res) => {
if (res.code == 200) {
proxy.$modal.msgSuccess("操作成功");
proxy.$modal.msgSuccess('操作成功');
getList();
}
});
}else if(row.typeEnum == 4||row.typeEnum == 10){ //盘点审批 批量盘点10通过
} else if (row.typeEnum == 4 || row.typeEnum == 10) {
//盘点审批 批量盘点10通过
productStocktakingApproved(row.supplyBusNo).then((res) => {
if (res.code == 200) {
proxy.$modal.msgSuccess("操作成功");
proxy.$modal.msgSuccess('操作成功');
getList();
}
});
}else if(row.typeEnum == 6){ // 报损审批通过
} else if (row.typeEnum == 6) {
// 报损审批通过
lossReportApproved(row.supplyBusNo).then((res) => {
if (res.code == 200) {
proxy.$modal.msgSuccess("操作成功");
proxy.$modal.msgSuccess('操作成功');
getList();
}
})
@@ -279,70 +255,82 @@ function handelApply(row) {
}else{
purchaseInventoryApproved(row.supplyBusNo).then((res) => {
if (res.code == 200) {
proxy.$modal.msgSuccess("操作成功");
proxy.$modal.msgSuccess('操作成功');
getList();
}
});
}
console.log(row,"typeEnum_enumText")
}
// 审批,查看
function handelApplys(row,view) {
// if(view=='apply'){ // 审批
// tagsViewStore.delView(router.currentRoute.value)
// }
if(row.typeEnum == 2){//商品调拨
function handelApplys(row, view) {
if (row.typeEnum == 2) {
//商品调拨
// 跳转到审核页面
router.replace({path: '/medicationmanagement/transferManagement/transferManagent',query:{supplyBusNo:row.supplyBusNo,view:view}});
// router.push({ path: '/medicationmanagement/transferManagement/transferManagent',query:{supplyBusNo:row.supplyBusNo,view:view}})
}else if(row.typeEnum == 8){ //8 批量
router.replace({ path: '/medicationmanagement/transferManagement/batchTransfer',query:{supplyBusNo:row.supplyBusNo,view:view}})
}else if(row.typeEnum == 7 ){ //领用出库审批通过
router.replace({ path: '/medicationmanagement/requisitionManagement/requisitionManagement',query:{supplyBusNo:row.supplyBusNo,view:view}})
}else if(row.typeEnum == 9){ //领用退库审批通过
router.replace({ path: '/medicationmanagement/requisitionManagement/returningInventory',query:{supplyBusNo:row.supplyBusNo,view:view}})
}else if(row.typeEnum == 4){ //盘点审批
router.replace({ path: '/medicationmanagement/chkstock/chkstockPart',query:{supplyBusNo:row.supplyBusNo,view:view}})
}else if(row.typeEnum == 10){ // 批量盘点
router.replace({ path: '/medicationmanagement/chkstock/chkstockBatch',query:{supplyBusNo:row.supplyBusNo,view:view}})
}else if(row.typeEnum == 6){ // 报损审批通过
router.replace({ path: '/medicationmanagement/lossReportingManagement/lossReportingManagement',query:{supplyBusNo:row.supplyBusNo,view:view}})
}else if(row.typeEnum == 5){ // 采购退货通过5
// getpurchaseInventoryDetailReturn(row.supplyBusNo).then((response) => {
// let currentData = response.data;
// console.log(currentData,"退库详情")
// store.setCurrentReturnData({ editRow: row, item: currentData });
router.replace({ path: '/medicationmanagement/medicationmanagement/returnedPurchase',query:{originalSupplyBusNo:row.supplyBusNo,view:view}})
router.replace({
path: '/medicationmanagement/transferManagement/transferManagent',
query: { supplyBusNo: row.supplyBusNo, view: view },
});
} else if (row.typeEnum == 8) {
//8 批量
router.replace({
path: '/medicationmanagement/transferManagement/batchTransfer',
query: { supplyBusNo: row.supplyBusNo, view: view },
});
} else if (row.typeEnum == 7) {
//领用出库审批通过
router.replace({
path: '/medicationmanagement/requisitionManagement/requisitionManagement',
query: { supplyBusNo: row.supplyBusNo, view: view },
});
} else if (row.typeEnum == 9) {
//领用退库审批通过
router.replace({
path: '/medicationmanagement/requisitionManagement/returningInventory',
query: { supplyBusNo: row.supplyBusNo, view: view },
});
} else if (row.typeEnum == 4) {
//盘点审批
router.replace({
path: '/medicationmanagement/chkstock/chkstockPart',
query: { supplyBusNo: row.supplyBusNo, view: view },
});
} else if (row.typeEnum == 10) {
// 批量盘点
router.replace({
path: '/medicationmanagement/chkstock/chkstockBatch',
query: { supplyBusNo: row.supplyBusNo, view: view },
});
} else if (row.typeEnum == 6) {
// 报损审批通过
router.replace({
path: '/medicationmanagement/lossReportingManagement/lossReportingManagement',
query: { supplyBusNo: row.supplyBusNo, view: view },
});
} else if (row.typeEnum == 5) {
// 采购退货通过5
router.replace({
path: '/medicationmanagement/medicationmanagement/returnedPurchase',
query: { originalSupplyBusNo: row.supplyBusNo, view: view },
});
// });
}else{ // 采购入库 1
} else {
// 采购入库 1
getpurchaseInventoryDetail(row.supplyBusNo).then((response) => {
let currentData = response.data;
store.setCurrentData({ editRow: row, item: currentData });
router.replace({ path: '/medicationmanagement/medicationmanagement/purchaseDocument',query:{supplyBusNo:row.supplyBusNo,view:view}})
router.replace({
path: '/medicationmanagement/medicationmanagement/purchaseDocument',
query: { supplyBusNo: row.supplyBusNo, view: view },
});
});
}
console.log(row,"typeEnum_enumText")
}
// 驳回
function handleReject(row) {
reject(row.supplyBusNo).then((res) => {
if (res.code == 200) {
proxy.$modal.msgSuccess("操作成功");
getList();
}
});
}
function handleDateQuery(value) {
if (value) {
queryParams.value.applyTimeSTime = value + " 00:00:00";
queryParams.value.applyTimeETime = value + " 23:59:59";
queryParams.value.applyTimeSTime = value + ' 00:00:00';
queryParams.value.applyTimeETime = value + ' 23:59:59';
} else {
queryParams.value.applyTimeSTime = undefined;
queryParams.value.applyTimeETime = undefined;

View File

@@ -0,0 +1,449 @@
{
"panels": [
{
"index": 0,
"name": 1,
"paperType": "自定义",
"height": 130,
"width": 210,
"paperHeader": 0,
"paperFooter": 365.6692913385827,
"paperNumberDisabled": true,
"paperNumberContinue": true,
"expandCss": "",
"overPrintOptions": {
"content": "",
"opacity": 0.7,
"type": 1
},
"watermarkOptions": {
"content": "",
"fillStyle": "rgba(184, 184, 184, 0.3)",
"fontSize": "14px",
"rotate": 25,
"width": 200,
"height": 200,
"timestamp": false,
"format": "YYYY-MM-DD HH:mm"
},
"panelLayoutOptions": {},
"printElements": [
{
"options": {
"left": 222,
"top": 12,
"height": 12,
"width": 115.5,
"title": "长春大学医院盘点单",
"coordinateSync": false,
"widthHeightSync": false,
"fontSize": 12,
"qrCodeLevel": 0
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 19.5,
"top": 33,
"height": 9.75,
"width": 120,
"title": "日期",
"field": "occurrenceTime",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 222,
"top": 33,
"height": 9.75,
"width": 120,
"title": "单据号",
"field": "busNo",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 465,
"top": 33,
"height": 9.75,
"width": 120,
"title": "机构:长春大学医院",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 19.5,
"top": 57,
"height": 9.75,
"width": 120,
"title": "盘点仓库",
"field": "purposeLocationName",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 19.5,
"top": 84,
"height": 36,
"width": 570,
"title": "undefined+beforeDragIn",
"field": "purchaseinventoryList",
"coordinateSync": false,
"widthHeightSync": false,
"columns": [
[
{
"title": "项目名",
"titleSync": false,
"halign": "center",
"tableQRCodeLevel": 0,
"tableSummaryTitle": true,
"tableSummary": "",
"width": 50.418660151829066,
"field": "name",
"checked": true,
"columnId": "name",
"fixed": false,
"rowspan": 1,
"colspan": 1
},
{
"title": "规格",
"titleSync": false,
"halign": "center",
"tableQRCodeLevel": 0,
"tableSummaryTitle": true,
"tableSummary": "",
"width": 47.38277249096388,
"field": "volume",
"checked": true,
"columnId": "volume",
"fixed": false,
"rowspan": 1,
"colspan": 1
},
{
"title": "厂家/产地",
"titleSync": false,
"halign": "center",
"tableQRCodeLevel": 0,
"tableSummaryTitle": true,
"tableSummary": "",
"width": 70.82692033621548,
"field": "manufacturer",
"checked": true,
"columnId": "manufacturer",
"fixed": false,
"rowspan": 1,
"colspan": 1
},
{
"title": "盘点单位",
"titleSync": false,
"align": "center",
"halign": "center",
"tableQRCodeLevel": 0,
"tableSummaryTitle": true,
"tableSummary": "",
"width": 62.494476949595715,
"field": "measurementUnitCode_dictText",
"checked": true,
"columnId": "measurementUnitCode_dictText",
"fixed": false,
"rowspan": 1,
"colspan": 1
},
{
"title": "单价",
"titleSync": false,
"align": "right",
"halign": "center",
"tableQRCodeLevel": 0,
"tableSummaryTitle": true,
"tableSummary": "",
"formatter2": "function(value,row,index,options,rowIndex,column){ return value + ' 元'; }",
"width": 47.779659918016016,
"field": "price",
"checked": true,
"columnId": "price",
"fixed": false,
"rowspan": 1,
"colspan": 1
},
{
"title": "盈亏数量",
"titleSync": false,
"halign": "center",
"tableQRCodeLevel": 0,
"tableSummaryTitle": true,
"tableSummary": "",
"width": 60.04350865342028,
"field": "itemQuantity",
"checked": true,
"columnId": "itemQuantity",
"fixed": false,
"rowspan": 1,
"colspan": 1
},
{
"title": "盈亏金额",
"titleSync": false,
"align": "right",
"halign": "center",
"tableQRCodeLevel": 0,
"tableSummaryTitle": true,
"tableSummary": "",
"formatter2": "function(value,row,index,options,rowIndex,column){ return value + ' 元'; }",
"width": 60.03571725956876,
"field": "profitAmount",
"checked": true,
"columnId": "profitAmount",
"fixed": false,
"rowspan": 1,
"colspan": 1
},
{
"title": "产品批号",
"titleSync": false,
"halign": "center",
"tableQRCodeLevel": 0,
"tableSummaryTitle": true,
"tableSummary": "",
"width": 56.38575853120875,
"field": "lotNumber",
"checked": true,
"columnId": "lotNumber",
"fixed": false,
"rowspan": 1,
"colspan": 1
},
{
"title": "盈亏类型",
"titleSync": false,
"halign": "center",
"tableQRCodeLevel": 0,
"tableSummaryTitle": true,
"tableSummary": "",
"width": 56.36601841060319,
"field": "reasonCode_dictText",
"checked": true,
"columnId": "reasonCode_dictText",
"fixed": false,
"rowspan": 1,
"colspan": 1
},
{
"title": "盈亏原因",
"titleSync": false,
"halign": "center",
"tableQRCodeLevel": 0,
"tableSummaryTitle": true,
"tableSummary": "",
"width": 58.266507298578894,
"field": "reason",
"checked": true,
"columnId": "reason",
"fixed": false,
"rowspan": 1,
"colspan": 1
},
{
"title": "盘前库存",
"titleSync": false,
"align": "center",
"tableQRCodeLevel": 0,
"tableSummaryTitle": true,
"tableSummary": "",
"width": 51.08786300584732,
"field": "totalPurposeQuantity",
"checked": false,
"columnId": "totalPurposeQuantity",
"fixed": false,
"rowspan": 1,
"colspan": 1
},
{
"title": "实盘数量",
"titleSync": false,
"align": "right",
"halign": "center",
"tableQRCodeLevel": 0,
"tableSummaryTitle": true,
"tableSummary": "",
"width": 53.074934501634054,
"field": "totalQuantity",
"checked": false,
"columnId": "totalQuantity",
"fixed": false,
"rowspan": 1,
"colspan": 1
},
{
"title": "金额",
"titleSync": false,
"align": "right",
"halign": "center",
"tableQRCodeLevel": 0,
"tableSummaryTitle": true,
"tableSummary": "",
"formatter2": "function(value,row,index,options,rowIndex,column){ return value + ' 元'; }",
"width": 39.04544357631049,
"field": "totalPrice",
"checked": false,
"columnId": "totalPrice",
"fixed": false,
"rowspan": 1,
"colspan": 1
},
{
"title": "仓库",
"titleSync": false,
"halign": "center",
"tableQRCodeLevel": 0,
"tableSummaryTitle": true,
"tableSummary": "",
"width": 40.041954542099724,
"field": "purposeLocationName",
"checked": false,
"columnId": "purposeLocationName",
"fixed": false,
"rowspan": 1,
"colspan": 1
},
{
"title": "生产日期",
"titleSync": false,
"halign": "center",
"tableQRCodeLevel": 0,
"tableSummaryTitle": true,
"tableSummary": "",
"width": 63.089377997062755,
"field": "startTime",
"checked": false,
"columnId": "startTime",
"fixed": false,
"rowspan": 1,
"colspan": 1
},
{
"title": "有效期至",
"titleSync": false,
"halign": "center",
"tableQRCodeLevel": 0,
"tableSummaryTitle": true,
"tableSummary": "",
"width": 59.05673483929025,
"field": "endTime",
"checked": false,
"columnId": "endTime",
"fixed": false,
"rowspan": 1,
"colspan": 1
},
{
"title": "发票号",
"titleSync": false,
"halign": "center",
"tableQRCodeLevel": 0,
"tableSummaryTitle": true,
"tableSummary": "",
"width": 51.706448638859854,
"field": "invoiceNo",
"checked": false,
"columnId": "invoiceNo",
"fixed": false,
"rowspan": 1,
"colspan": 1
}
]
]
},
"printElementType": {
"title": "表格",
"type": "table",
"editable": true,
"columnDisplayEditable": true,
"columnDisplayIndexEditable": true,
"columnTitleEditable": true,
"columnResizable": true,
"columnAlignEditable": true,
"isEnableEditField": true,
"isEnableContextMenu": true,
"isEnableInsertRow": true,
"isEnableDeleteRow": true,
"isEnableInsertColumn": true,
"isEnableDeleteColumn": true,
"isEnableMergeCell": true
}
},
{
"options": {
"left": 480,
"top": 130.5,
"height": 12,
"width": 109.5,
"title": "盈亏合计",
"field": "totalAmount",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0,
"formatter": "function(title,value,options,templateData,target,paperNo){\n return value + ' 元'\n}"
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 261.24609375,
"top": 130.74609375,
"height": 12,
"width": 109.5,
"title": "制单人",
"field": "name",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0
},
"printElementType": {
"title": "文本",
"type": "text"
}
}
]
}
]
}

View File

@@ -35,6 +35,7 @@
<el-button type="primary" plain icon="Plus" @click="handleSave">批量保存</el-button>
</el-col>
</el-row>
<el-button type="primary" plain icon="Printer" @click="handlePrint"> 打印单据 </el-button>
<el-form
:model="receiptHeaderForm"
ref="receiptHeaderRef"
@@ -633,6 +634,8 @@ import { useRoute } from 'vue-router';
import { ref, reactive, watch, onMounted, onUnmounted, toRefs, defineEmits, getCurrentInstance } from 'vue';
import { useStore } from '@/store/store';
import useTagsViewStore from '@/store/modules/tagsView';
import templateJson from './components/template';
import { hiprint } from 'vue-plugin-hiprint';
import { debounce } from 'lodash-es';
const tagsViewStore = useTagsViewStore();
const store = useStore();
@@ -1367,6 +1370,39 @@ function handleLocationClick(purposeLocationId, itemId, index, lotNumber) {
});
}
function handlePrint() {
const result = [];
// let supplierName = supplierListOptions.value.filter((item) => {
// return item.value == receiptHeaderForm.supplierId;
// })[0].label;
// const totalAmount = form.purchaseinventoryList.reduce((accumulator, currentRow) => {
// return accumulator + (Number(currentRow.totalPrice) || 0);
// }, 0);
form.purchaseinventoryList = form.purchaseinventoryList.map((item) => {
return {
...item,
price: Number(item.price).toFixed(2),
profitAmount: Number(item.profitAmount).toFixed(2),
reasonCode_dictText: profit_reason.value.filter((k) => k.value == item.reasonCode)[0]?.label,
};
});
result.push({
// supplierName: supplierName,
purposeLocationName: form.purchaseinventoryList[0].purposeLocationName,
name: userStore.name,
totalAmount: totalAmount.value.toFixed(2),
...receiptHeaderForm,
purchaseinventoryList: form.purchaseinventoryList,
});
console.log(result, '345678987654');
const printElements = templateJson;
var hiprintTemplate = new hiprint.PrintTemplate({ template: printElements }); // 定义模板
hiprintTemplate.print2(result, {
printer: 'EPSON LQ-80KFII',
title: '打印标题',
}); //开始打印
}
// 单位处理
function handleUnitCodeChange(row, index, value) {
// 防止点击和已选一样的问题
@@ -1677,8 +1713,8 @@ function getMaxCounts(row, index, counts) {
}
function handleSave(row, index) {
if (form.purchaseinventoryList.length === 0) {
proxy.$message.success('保存成功!');
if (form.purchaseinventoryList.length === 0) {
proxy.$message.success('保存成功!');
return;
}
rowList.value = [];
@@ -2504,7 +2540,7 @@ function totalSourceQuantityChange(rowData, index, value) {
// 计算盈亏金额
if (rowData.price > 0) {
form.purchaseinventoryList[index].lllstatus = true;
const profitAmount =
const profitAmount =
// 修复:正确计算盈亏金额 - 实盘数量减去盘前库存整数部分
rowData.price * (totalQuantityNum - parseFloat(zhengshu)) +
(rowData.price / partPercent) * parseFloat(xiaoshuzhi);
@@ -2529,7 +2565,7 @@ function totalSourceQuantityChange(rowData, index, value) {
// 确保在所有情况下都正确计算盈亏金额
if (rowData.price > 0 && !form.purchaseinventoryList[index].lllstatus) {
// 处理字符串类型的itemQuantity
const itemQuantityNum =
const itemQuantityNum =
typeof form.purchaseinventoryList[index].itemQuantity === 'string'
? parseFloat(form.purchaseinventoryList[index].itemQuantity) || 0
: form.purchaseinventoryList[index].itemQuantity || 0;

View File

@@ -0,0 +1,129 @@
import request from '@/utils/request';
import {parseStrEmpty} from '@/utils/openhis';
// 查询盘点列表
export function getStockTakeList (query) {
return request ({
url: '/nurse-station/orgdevice-stocktake/summary-from',
method: 'get',
params: query,
});
}
// 盘点编辑页列表
export function getstocktakingDetail (busNo) {
return request ({
url: '/inventory-manage/stocktaking/stocktaking-receipt',
method: 'get',
params: {busNo}, // 确保参数正确传递
});
}
// 添加/编辑入库单据
export function addProductStocktaking (data) {
return request ({
url: '/inventory-manage/stocktaking/product-stocktaking',
method: 'put',
data: data,
});
}
// 查询盘点列表初始化查询区数据
export function getInit () {
return request ({
url: '/inventory-manage/stocktaking/init',
method: 'get',
});
}
// 查询盘点详情初始化查询区数据
export function getDetailInit () {
return request ({
url: '/inventory-manage/stocktaking/detail-init',
method: 'get',
});
}
// 生成批量盘点
export function getStocktakingReceiptBatch () {
return request ({
url: '/inventory-manage/stocktaking/stocktaking-receipt-batch',
method: 'get',
});
}
//保存批量盘点
export function addBatch (data) {
return request ({
url: '/inventory-manage/stocktaking/stocktaking-receipt-addBatch',
method: 'put',
data: data,
});
}
// 删除单据
export function delProductStocktaking (param) {
return request ({
url: '/inventory-manage/stocktaking/product-stocktaking?supplyRequestIds=' +
param,
method: 'delete',
});
}
// 提交审批
export function submitApproval (busNo) {
return request ({
url: '/inventory-manage/stocktaking/submit-approval',
method: 'put',
data: busNo,
});
}
// 撤回审批
export function withdrawApproval (busNo) {
return request ({
url: '/inventory-manage/stocktaking/withdraw-approval',
method: 'put',
data: busNo,
});
}
// 获取药品目录
export function getMedicineList (queryParams) {
return request ({
url: '/app-common/inventory-item',
method: 'get',
params: queryParams,
});
}
// 获取药品目录
export function getCount (queryParams) {
return request ({
url: '/inventory-manage/purchase/inventory-item-info',
method: 'get',
params: queryParams,
});
}
// 获取药房列表
export function getPharmacyList () {
return request ({
url: '/app-common/pharmacy-list',
method: 'get',
});
}
// 获取药库列表
export function getDispensaryList () {
return request ({
url: '/app-common/cabinet-list',
method: 'get',
});
}
export function stocktakingReceiptAuto () {
return request ({
url: '/inventory-manage/stocktaking/stocktaking-receipt-auto',
method: 'get',
});
}

View File

@@ -0,0 +1,119 @@
<template>
<div>
<el-table
ref="medicineRef"
height="400"
:data="medicineList"
@cell-click="clickRow"
>
<el-table-column
label="项目名称"
align="center"
prop="name"
width="300"
/>
<el-table-column
label="项目类型"
align="center"
prop="itemType_enumText"
/>
<el-table-column
label="包装单位"
align="center"
prop="unitCode_dictText"
/>
<el-table-column
label="最小单位"
align="center"
prop="minUnitCode_dictText"
/>
<el-table-column label="规格" align="center" prop="volume" />
<!-- <el-table-column label="用法" align="center" prop="methodCode_dictText" />
<el-table-column label="单次剂量" align="center" prop="dose" />
<el-table-column
label="剂量单位"
align="center"
prop="doseUnitCode_dictText"
/> -->
<el-table-column label="生产厂家" align="center" prop="manufacturer" />
<el-table-column
label="编码"
align="center"
prop="ybNo"
/>
</el-table>
</div>
</template>
<script setup>
import { getMedicineList } from "./api";
import { watch } from "vue";
import { throttle } from "lodash-es";
const props = defineProps({
searchKey: {
type: String,
default: "",
},
itemType: {
type: String,
default: "",
},
purposeLocationId:{
type: String,
default: "",
},
purposeLocationId1:{
type: String,
default: "",
},
});
const emit = defineEmits(["selectRow"]);
const queryParams = ref({
itemType: props.itemType,
orgLocationId:props.purposeLocationId,
orgLocationId1:props.purposeLocationId1,
purchaseFlag:0
});
const medicineList = ref([]);
// 节流函数
const throttledGetList = throttle(
() => {
getList();
},
300,
{ leading: true, trailing: true }
);
watch(
() => props,
(newValue) => {
queryParams.value.searchKey = newValue.searchKey
queryParams.value.itemType = newValue.itemType
queryParams.value.orgLocationId = newValue.sourceLocationId
queryParams.value.orgLocationId1 = newValue.sourceLocationId1
throttledGetList();
},
{ immdiate: true, deep: true }
);
getList();
function getList() {
if(route.query.supplyBusNo){ // 编辑
queryParams.value.itemType = queryParams.value.itemType;
queryParams.value.orgLocationId = queryParams.value.orgLocationId1
}
delete queryParams.value.orgLocationId1
getMedicineList(queryParams.value).then((res) => {
medicineList.value = res.data;
});
}
function clickRow(row) {
emit("selectRow", row);
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,178 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch">
<el-form-item label="项目名称" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入项目名称"
clearable
style="width: 200px"
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="仓库类型" prop="purposeTypeEnum">
<el-select
v-model="queryParams.purposeTypeEnum"
placeholder="请选择"
clearable
filterable
style="width: 200px"
@change="handleChangePurposeTypeEnum"
>
<el-option
v-for="item in warehous_type"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="盘点仓库" prop="purposeLocationId">
<el-select
v-model="queryParams.purposeLocationId"
placeholder="请选择"
clearable
filterable
style="width: 200px"
@change="handleCabinetChange(receiptHeaderForm.purposeLocationId)"
>
<el-option
v-for="item in [
{ id: 1, name: '仓库1' },
{ id: 2, name: '仓库2' },
]"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item label="货位" prop="purposeLocation">
<el-select
v-model="queryParams.purposeLocation"
placeholder="请选择"
clearable
filterable
style="width: 200px"
>
<el-option
v-for="item in [
{ id: 1, name: '货位1' },
{ id: 2, name: '货位2' },
]"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-table
v-loading="loading"
:data="dataList"
@selection-change="handleSelectionChange"
height="calc(100vh - 250px)"
>
<el-table-column
label="项目"
align="center"
key="name"
prop="name"
width="200"
fixed
></el-table-column>
<el-table-column label="规格" align="center" prop="totalVolume" />
<el-table-column label="厂家/产地" align="center" prop="manufacturer" show-overflow-tooltip />
<el-table-column label="产品批号" align="center" prop="lotNumber" />
<el-table-column label="单价" align="center" key="unit" prop="unitPrice" />
<el-table-column label="发放数量" align="center" prop="dispenseQuantity" />
<el-table-column label="库存数量" align="center" prop="quantity" />
<el-table-column label="盈亏数量" align="center" prop="itemQuantity">
<template #default="scope">
<el-input v-model="scope.row.itemQuantity" :input-style="{ textAlign: 'center' }" type="number" />
</template>
</el-table-column>
<el-table-column label="单位" align="center" prop="unitCode_dictText" />
<el-table-column label="最小单位" align="center" prop="minUnitCode_dictText" />
<el-table-column label="拆零比" align="center" prop="partPercent" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope">
<el-button
size="mini"
type="text"
icon="Check"
@click="handleSave(scope.row)"
v-hasPermi="['chkstock:partDeptDevice:edit']"
>保存
</el-button>
</template>
</el-table-column>
</el-table>
</div>
</template>
<script setup>
import { ref, reactive, toRaw, computed, watch, onMounted } from 'vue';
const { proxy } = getCurrentInstance();
import { getStockTakeList } from './components/api.js';
const { warehous_type } = proxy.useDict('warehous_type');
const dataList = ref([]);
const queryParams = reactive({
// pageNo: 1,
// pageSize: 10,
});
const loading = ref(false);
const showSearch = ref(true);
const total = ref(0);
// 获取列表
const getList = () => {
loading.value = true;
getStockTakeList(queryParams.value).then((res) => {
loading.value = false;
dataList.value = res.data;
total.value = res.data.length;
});
};
// 搜索
const handleQuery = () => {
getList();
};
// 重置
const resetQuery = () => {
queryParams.value = {};
handleQuery();
};
// 重置
const reset = () => {};
// 多选
const handleSelectionChange = (selection) => {};
// 保存
const handleSave = (row) => {
console.log(row);
// 校验盈亏数量
if (row.itemQuantity == '' || row.itemQuantity == null) {
proxy.$modal.msgWarning('盈亏数量不能为空');
return;
}
proxy.$modal
.confirm('确定保存吗?', '保存', {
confirmButtonText: '保存',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
proxy.$modal.msgSuccess('保存成功');
getList();
})
.catch(() => {});
};
const handleChangePurposeTypeEnum = (val) => {};
const handleCabinetChange = (val) => {};
onMounted(() => {
getList();
});
</script>

View File

@@ -0,0 +1,89 @@
import request from '@/utils/request';
// 查询调价审核列表
export function getPriceAdjustmentPage (query) {
// 创建请求参数对象,确保使用后端期望的参数名
const requestParams = {
// 映射pageNum到pageNo因为后端API期望使用pageNo
pageNo: query.pageNum || query.current || query.page || 1,
// 映射pageSize到pageSize保持一致
pageSize: query.pageSize || query.size || query.limit || 10,
// 保留其他查询参数
...Object.entries(query).reduce((acc, [key, value]) => {
if (!['pageNum', 'current', 'page', 'pageSize', 'size', 'limit'].includes(key)) {
acc[key] = value;
}
return acc;
}, {})
};
return request ({
url: '/change/price/list/getPage',
method: 'get',
params: requestParams,
});
}
// 查询调价申请详情
export function getPriceAdjustmentDetail (query) {
return request({
url: '/change/price/list/searchSupplyRequestInfo',
method: 'post',
params: query
});
}
// 作废价格调整申请
export function cancelSupplyRequestData (query) {
return request({
url: '/change/price/list/cancelChangePriceData',
method: 'post',
params: query
});
}
// 查询挂号调价详情
export function searchSupplyRequestByHealth (query) {
return request({
url: '/change/price/list/searchChangePriceDataByHealth',
method: 'post',
params: query
});
}
// 查询诊疗调价详情
export function searchSupplyRequestByActivity (query) {
return request({
url: '/change/price/list/searchChangePriceDataByActivity',
method: 'post',
params: query || {}
});
}
// 查询耗材调价详情
export function searchSupplyRequestByDevice (query) {
return request({
url: '/change/price/list/searchChangePriceDataByDevice',
method: 'post',
params: query
});
}
// 查询药品调价详情
export function searchSupplyRequestByMed(query) {
return request({
url: '/change/price/list/searchChangePriceDataByMed',
method: 'post',
params: query || {}
});
}
// 提审价格调整申请
export function submitApprovalForPriceAdjustment (query) {
return request({
url: '/change/price/list/updateStatusByApproval',
method: 'post',
params: query
});
}

View File

@@ -0,0 +1,160 @@
<template>
<el-dialog
v-model="dialogVisible"
:title="'价格调整详情'"
width="90%"
:close-on-click-modal="false"
destroy-on-close
>
<div class="detail-container">
<div class="detail-content" v-if="itemList.length > 0">
<el-table :data="itemList" style="width: 100%" size="small" border>
<!-- 挂号调价单特殊显示 -->
<el-table-column label="科室" align="center" prop="orgName" v-if="categoryType.includes('挂号调价')"/>
<el-table-column
label="号源"
align="center"
prop="name"
v-if="categoryType.includes('挂号调价')"
/>
<el-table-column label="项目名称" align="center" prop="itemName" v-else />
<el-table-column label="当前进货价" align="center" prop="originBuyingPrice">
<template #default="scope">
<el-tag type="danger" size="small">
{{ scope.row.originBuyingPrice ? scope.row.originBuyingPrice + ' 元' : '-' }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="调后进货价" align="center" prop="newBuyingPrice">
<template #default="scope">
<el-tag type="success" size="small">
{{ scope.row.newBuyingPrice ? scope.row.newBuyingPrice + ' 元' : '-' }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="当前零售价" align="center" prop="originRetailPrice">
<template #default="scope">
<el-tag type="danger" size="small">
{{ scope.row.originRetailPrice ? scope.row.originRetailPrice + ' 元' : '-' }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="调后零售价" align="center" prop="newRetailPrice">
<template #default="scope">
<el-tag type="success" size="small">
{{ scope.row.newRetailPrice ? scope.row.newRetailPrice + ' 元' : '-' }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="进货价盈负差" align="center" prop="differenceBuyingPrice">
<template #default="scope">
{{ scope.row.differenceBuyingPrice ? scope.row.differenceBuyingPrice + ' 元' : '-' }}
</template>
</el-table-column>
<el-table-column label="影响库存数量" align="center" prop="itemQuantity">
<template #default="scope">
{{ scope.row.itemQuantity ? scope.row.itemQuantity + (scope.row.label || '') : '-' }}
</template>
</el-table-column>
<el-table-column label="调后零售价盈负差" align="center" prop="differenceRetailPrice">
<template #default="scope">
{{ scope.row.differenceRetailPrice ? scope.row.differenceRetailPrice + ' 元' : '-' }}
</template>
</el-table-column>
<el-table-column label="调价原因" align="center" prop="reason" />
</el-table>
<div class="creator-info">
<span class="creator-label">制单人{{ props.createName || '-' }}</span>
</div>
</div>
<div v-else class="empty-tip">暂无调价项目数据</div>
</div>
<template #footer>
<span class="dialog-footer">
<el-button @click="closeDialog">关闭</el-button>
</span>
</template>
</el-dialog>
</template>
<script setup>
import { number } from 'echarts';
import { ref, computed, watch, toRaw, isProxy } from 'vue';
// 定义props
const props = defineProps({
visible: {
type: Boolean,
default: false,
},
detailData: {
type: [Array, Object],
default: () => [],
},
categoryType: {
type: String,
default: '',
},
createName: {
type: String,
default: '',
},
});
// 定义事件
const emit = defineEmits(['update:visible', 'close']);
// 响应式数据
const dialogVisible = ref(false);
// 计算属性:获取需要显示的数据列表
const itemList = computed(() => {
const data = props.detailData;
console.log('data', data);
return toRaw(data);
});
// 监听visible变化
watch(
() => props.visible,
(newVal) => {
dialogVisible.value = newVal;
}
);
// 监听dialogVisible变化
watch(dialogVisible, (newVal) => {
emit('update:visible', newVal);
});
// 关闭对话框
const closeDialog = () => {
dialogVisible.value = false;
emit('close');
};
</script>
<style scoped>
.detail-container {
padding: 10px 0;
}
.creator-info {
text-align: left;
padding: 10px 0;
border-top: 1px solid #ebeef5;
margin-top: 10px;
}
.creator-label {
font-size: 14px;
color: #606266;
}
.empty-tip {
text-align: center;
padding: 40px 0;
color: #999;
}
</style>

View File

@@ -0,0 +1,315 @@
<template>
<div class="app-container">
<el-table
v-loading="loading"
:data="adjustmentList"
tooltip-effect="dark"
:show-overflow-tooltip="true"
style="width: 100%"
>
<el-table-column label="单据编号" align="center" prop="busNo" min-width="180" />
<el-table-column
label="调价类型"
align="center"
prop="categoryEnum_enumText"
min-width="120"
/>
<el-table-column label="审核状态" align="center" prop="statusEnum" min-width="100">
<template #default="scope">
<el-tag :type="getStatusTagType(scope.row.statusEnum)">
{{ scope.row.statusEnum_enumText || '-' }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="制单人" align="center" prop="applicantId_dictText" min-width="120" />
<el-table-column label="制单时间" align="center" prop="createTime" min-width="180">
<template #default="scope">
{{ parseTime(scope.row.createTime) }}
</template>
</el-table-column>
<el-table-column label="审核人" align="center" prop="approverId_dictText" min-width="120" />
<el-table-column label="审核日期" align="center" prop="approvalTime" min-width="180">
<template #default="scope">
{{ scope.row.approvalTime ? parseTime(scope.row.approvalTime) : '-' }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" min-width="180">
<template #default="scope">
<el-button size="small" link @click="handleDetail(scope.row)">详情</el-button>
<template v-if="scope.row.statusEnum === 1">
<el-button
size="small"
link
type="success"
@click="handleSubmitApproval(scope.row)"
style="margin-left: 5px"
>提审</el-button
>
<el-button
size="small"
link
type="danger"
@click="handleCancelApproval(scope.row)"
style="margin-left: 5px"
>作废</el-button
>
</template>
<template v-else>
<el-button size="small" link disabled></el-button>
</template>
</template>
</el-table-column>
</el-table>
<Pagination
v-show="total > 0"
:total="total"
v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize"
@pagination="handlePagination"
/>
<!-- 详情弹窗组件 -->
<DetailDialog
v-model:visible="detailDialogVisible"
:detail-data="selectedRow"
:category-type="categoryType"
:create-name="createName"
@close="handleDetailClose"
/>
</div>
</template>
<script setup>
import { ref, reactive, onMounted } from 'vue';
import { ElMessage, ElMessageBox } from 'element-plus';
import { parseTime } from '@/utils/openhis';
import Pagination from '@/components/Pagination';
import {
getPriceAdjustmentPage,
cancelSupplyRequestData,
searchSupplyRequestByHealth,
searchSupplyRequestByActivity,
searchSupplyRequestByDevice,
searchSupplyRequestByMed,
submitApprovalForPriceAdjustment,
} from './components/api';
import DetailDialog from './components/detailDialog.vue';
// 表格数据
const adjustmentList = ref([]);
const loading = ref(false);
const total = ref(0);
const activeName = ref('1'); // 当前激活的标签页
// 查询参数
const queryParams = reactive({
pageNum: 1,
pageSize: 10,
chargeItemContext: '', // 用于区分不同类型的调价
});
// 详情弹窗相关
const detailDialogVisible = ref(false);
const selectedRow = ref({});
const categoryType = ref('');
const createName = ref('');
// 状态标签类型
const getStatusTagType = (status) => {
const typeMap = {
1: 'warning', // 待审核
2: 'success', // 已审核
3: 'danger', // 已拒绝
};
return typeMap[status] || 'info';
};
// 处理分页事件
const handlePagination = (params) => {
// 将分页组件的参数映射到查询参数
queryParams.pageNum = params.page;
queryParams.pageSize = params.limit;
getList();
};
// 处理标签页切换
const handleClick = (tab) => {
// 更新激活标签页状态
activeName.value = tab.paneName;
// 设置当前查询类型
queryParams.chargeItemContext = tab.paneName;
// 重置页码
queryParams.pageNum = 1;
// 重新获取对应类型的数据
getList();
};
// 查询数据
const getList = async () => {
loading.value = true;
try {
// 确保设置当前查询类型参数
queryParams.chargeItemContext = activeName.value;
// 调用后端API获取对应类型的调价数据
const response = await getPriceAdjustmentPage(queryParams);
console.log('调价审核列表响应数据:', response);
// 处理返回的数据
if (response && response.code === 200) {
// 直接从records字段获取数据
adjustmentList.value = response.data?.records || [];
total.value = response.data?.total || 0;
} else {
ElMessage.error(response?.msg || '获取调价审核列表失败');
adjustmentList.value = [];
total.value = 0;
}
} catch (error) {
ElMessage.error('获取数据异常,请稍后重试');
console.error('获取调价审核列表异常:', error);
adjustmentList.value = [];
total.value = 0;
} finally {
loading.value = false;
}
};
// 操作按钮处理函数
const handleDetail = async (row) => {
// 保存当前行的调价类型
categoryType.value = row.typeEnum_enumText || '';
// 调用详情API获取数据
try {
// 显示加载状态
loading.value = true;
// 准备API参数
const params = {
busNo: row.busNo,
};
console.log('查询详情参数:', params);
console.log('查询详情参数:', row);
// 根据categoryEnum选择不同的API接口
let response;
if (row.itemCategoryEnum === 49) {
// 挂号
response = await searchSupplyRequestByHealth(params);
} else if (row.itemCategoryEnum === 48) {
// 诊疗
response = await searchSupplyRequestByActivity(params);
} else if (row.itemCategoryEnum === 47) {
// 耗材
response = await searchSupplyRequestByDevice(params);
} else if (row.itemCategoryEnum === 46) {
// 药品
response = await searchSupplyRequestByMed(params);
}
if (response && response.code === 200) {
// 日志记录原始返回数据
// 准备显示数据
createName.value = row.applicantId_dictText || '-';
// 设置selectedRow
selectedRow.value = response.data;
// 显示弹窗
detailDialogVisible.value = true;
} else {
ElMessage.error(response?.msg || '获取详情数据失败');
}
} catch (error) {
ElMessage.error('获取详情数据失败');
console.error('获取详情数据异常:', error);
} finally {
loading.value = false;
}
};
// 关闭详情弹窗处理
const handleDetailClose = () => {
// 重置选中的行数据和类型
selectedRow.value = {};
categoryType.value = '';
};
// 处理提审审核
const handleSubmitApproval = async (row) => {
try {
// 弹出确认对话框
await ElMessageBox.confirm('确定要提审该价格调整记录吗?', '确认提审', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'info',
});
// 调用后端提审接口
const response = await submitApprovalForPriceAdjustment({ busNo: row.busNo });
if (response && response.code === 200) {
ElMessage.success('提审成功');
// 重新加载列表数据
getList();
} else {
ElMessage.error(response?.msg || '提审失败');
}
} catch (error) {
// 用户取消操作不会触发错误提示
if (error !== 'cancel') {
ElMessage.error('提审失败');
console.error('提审价格调整记录异常:', error);
}
}
};
// 处理作废审核
const handleCancelApproval = async (row) => {
try {
// 弹出确认对话框
await ElMessageBox.confirm('确定要作废该价格调整记录吗?', '确认作废', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
});
// 调用后端作废接口
const response = await cancelSupplyRequestData({ busNo: row.busNo });
if (response && response.code === 200) {
ElMessage.success('作废成功');
// 重新加载列表数据
getList();
} else {
ElMessage.error(response?.msg || '作废失败');
}
} catch (error) {
// 用户取消操作不会触发错误提示
if (error !== 'cancel') {
ElMessage.error('作废失败');
console.error('作废价格调整记录异常:', error);
}
}
};
// 生命周期 - 加载
onMounted(() => {
// 设置初始查询类型为药品调价
queryParams.chargeItemContext = activeName.value;
getList();
});
</script>
<style scoped>
.app-container {
padding: 20px;
}
:deep(.el-tabs__content) {
height: auto;
}
:deep(.demo-tabs > .el-tabs__content) {
color: #6b778c;
font-size: 14px;
}
</style>

View File

@@ -0,0 +1,80 @@
import request from '@/utils/request';
// 查询调价申请详情
export function getPriceAdjustmentDetail (query) {
return request({
url: '/change/price/list/searchSupplyRequestInfo',
method: 'post',
params: query
});
}
// 查询挂号调价详情
export function searchSupplyRequestByHealth (query) {
return request({
url: '/inventory-examine-page/searchSupplyRequestByHealth',
method: 'post',
params: query
});
}
// 查询诊疗调价详情
export function searchSupplyRequestByActivity (query) {
return request({
url: '/inventory-examine-page/searchSupplyRequestByActivity',
method: 'post',
params: query
});
}
// 查询耗材调价详情
export function searchSupplyRequestByDevice (query) {
return request({
url: '/inventory-examine-page/searchSupplyRequestByDevice',
method: 'post',
params: query
});
}
// 查询药品调价详情
export function searchSupplyRequestByMed (query) {
return request({
url: '/inventory-examine-page/searchSupplyRequestByMed',
method: 'post',
params: query
});
}
// 获取审核状态选项数据
export function getExamineStatusOptions() {
return request({
url: '/inventory-examine-page/init',
method: 'get'
});
}
// 驳回价格调整申请
export function rejectPriceAdjustment(busNo) {
return request({
url: '/inventory-examine-page/updateExamineByRejected',
method: 'post',
params: { busNo }
});
}
// 审批通过价格调整申请
export function updateExamineByApproved(busNo) {
return request({
url: '/inventory-examine-page/updateExamineByApproved',
method: 'post',
params: { busNo }
});
}

View File

@@ -0,0 +1,196 @@
<template>
<el-dialog
v-model="dialogVisible"
:title="'价格调整详情'"
width="90%"
:close-on-click-modal="false"
destroy-on-close
>
<div class="detail-container">
<div class="detail-content" v-if="itemList.length > 0">
<el-table :data="itemList" style="width: 100%" size="small" border>
<!-- 挂号调价单特殊显示 -->
<template v-if="categoryType.includes('挂号调价')">
<el-table-column label="科室" align="center" prop="orgName" min-width="150" />
<el-table-column label="号源" align="center" prop="name" min-width="200" />
<el-table-column
label="当前进货价"
align="center"
prop="originBuyingPrice"
min-width="100"
/>
<el-table-column
label="调后进货价"
align="center"
prop="newBuyingPrice"
min-width="100"
/>
<el-table-column
label="当前零售价"
align="center"
prop="originRetailPrice"
min-width="100"
/>
<el-table-column
label="调后零售价"
align="center"
prop="newRetailPrice"
min-width="100"
/>
<el-table-column label="原因" align="center" prop="reason" min-width="200" />
</template>
<!-- 其他调价类型标准显示 -->
<template v-else>
<el-table-column label="项目编码" align="center" prop="targetId" min-width="180" />
<el-table-column label="项目名称" align="center" prop="chargeName" min-width="200" />
<el-table-column label="规格" align="center" prop="volume" min-width="120" />
<el-table-column
label="当前进货价"
align="center"
prop="originBuyingPrice"
min-width="100"
/>
<el-table-column
label="调后进货价"
align="center"
prop="newBuyingPrice"
min-width="100"
/>
<el-table-column
label="当前零售价"
align="center"
prop="originRetailPrice"
min-width="100"
/>
<el-table-column
label="调后零售价"
align="center"
prop="newRetailPrice"
min-width="100"
/>
<el-table-column label="调价原因" align="center" prop="reason" min-width="200" />
</template>
</el-table>
<div class="creator-info">
<span class="creator-label">制单人{{ detailData?.createName || '-' }}</span>
</div>
</div>
<div v-else class="empty-tip">暂无调价项目数据</div>
</div>
<template #footer>
<span class="dialog-footer">
<!-- 当状态为驳回或同意时不显示审核和驳回按钮 -->
<template
v-if="
!detailData.statusEnum_enumText ||
!['驳回', '同意'].includes(detailData.statusEnum_enumText)
"
>
<el-button type="primary" :plain="true" @click="handleApprove">审核</el-button>
<el-button type="danger" :plain="true" @click="handleReject">驳回</el-button>
</template>
<el-button :plain="true" @click="closeDialog">关闭</el-button>
</span>
</template>
</el-dialog>
</template>
<script setup>
import { ref, computed, watch } from 'vue';
import { rejectPriceAdjustment } from './api';
// 定义props
const props = defineProps({
visible: {
type: Boolean,
default: false,
},
detailData: {
type: Object,
default: () => ({}),
},
categoryType: {
type: String,
default: '',
},
});
// 定义事件
const emit = defineEmits(['update:visible', 'close']);
// 响应式数据
const dialogVisible = ref(false);
// 计算属性:获取需要显示的数据列表
const itemList = computed(() => {
console.log('detailData:', props.detailData);
if (!props.detailData) return [];
// 优先使用items字段从index.vue传递的结构
if (Array.isArray(props.detailData.items)) {
return props.detailData.items;
}
// 如果detailData本身是数组
if (Array.isArray(props.detailData)) {
return props.detailData;
}
return [];
});
// 监听visible变化
watch(
() => props.visible,
(newVal) => {
dialogVisible.value = newVal;
}
);
// 监听dialogVisible变化
watch(dialogVisible, (newVal) => {
emit('update:visible', newVal);
});
// 关闭对话框
const closeDialog = () => {
dialogVisible.value = false;
emit('close');
};
// 处理审核通过
const handleApprove = () => {
emit('approve', props.detailData);
};
// 处理驳回
const handleReject = () => {
// 直接触发事件由父组件处理API调用和状态管理
emit('reject', props.detailData);
};
</script>
<style scoped>
.detail-container {
padding: 10px 0;
}
.creator-info {
text-align: left;
padding: 10px 0;
border-top: 1px solid #ebeef5;
margin-top: 10px;
}
.creator-label {
font-size: 14px;
color: #606266;
}
.empty-tip {
text-align: center;
padding: 40px 0;
color: #999;
}
</style>

View File

@@ -0,0 +1,551 @@
<template>
<div class="app-container">
<!-- 查询条件区域 -->
<div class="query-form">
<el-row :gutter="20">
<el-col :span="6">
<el-form-item label="审批状态">
<el-select
v-model="queryParams.statusEnum"
placeholder="请选择审批状态"
clearable
filterable
@focus="loadExamineStatusOptions"
>
<el-option
v-for="option in examineStatusOptions"
:key="option.value"
:label="option.label"
:value="option.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="申请日期">
<el-date-picker
v-model="queryParams.applicantTime"
type="date"
placeholder="请选择日期"
value-format="YYYY-MM-DD"
format="YYYY-MM-DD"
clearable
/>
</el-form-item>
</el-col>
<el-col :span="6">
<div class="query-buttons">
<el-button plain type="primary" @click="handleSearch">查询</el-button>
<el-button plain type="primary" @click="handleReset">重置</el-button>
</div>
</el-col>
</el-row>
</div>
<el-table
v-loading="loading"
:data="adjustmentList"
tooltip-effect="dark"
:show-overflow-tooltip="true"
style="width: 100%"
>
<el-table-column label="单据编号" align="center" prop="busNo" min-width="180" />
<el-table-column label="调价类型" align="center" prop="categoryEnum_enumText" min-width="120" />
<el-table-column label="审核状态" align="center" prop="statusEnum" min-width="100">
<template #default="scope">
<el-tag :type="getStatusTagType(scope.row.statusEnum)">
{{ scope.row.statusEnum_enumText || '-' }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="制单人" align="center" prop="applicantId_dictText" min-width="120" />
<el-table-column label="申请日期" align="center" prop="applicantTime" min-width="180">
<template #default="scope">
{{ parseTime(scope.row.applicantTime) }}
</template>
</el-table-column>
<el-table-column label="审核人" align="center" prop="approverId_dictText" min-width="120" />
<el-table-column label="审核日期" align="center" prop="approvalTime" min-width="180">
<template #default="scope">
{{ scope.row.approvalTime ? parseTime(scope.row.approvalTime) : '-' }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" min-width="180">
<template #default="scope">
<el-button size="small" type="primary" plain @click="handleDetail(scope.row)">
{{
['驳回', '同意'].includes(scope.row.statusEnum_enumText) ? '查看详情' : '查看并审核'
}}
</el-button>
</template>
</el-table-column>
</el-table>
<Pagination
v-show="total > 0"
:total="total"
v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize"
@pagination="handlePagination"
/>
<!-- 详情弹窗组件 -->
<DetailDialog
v-model:visible="detailDialogVisible"
:detail-data="selectedRow"
:category-type="categoryType"
@close="handleDetailClose"
@approve="handleApprove"
@reject="handleReject"
/>
</div>
</template>
<script setup>
import { ref, reactive, onMounted } from 'vue';
import { ElMessage, ElMessageBox } from 'element-plus';
import { parseTime } from '@/utils/openhis';
import Pagination from '@/components/Pagination';
import request from '@/utils/request';
//import { getPriceAdjustmentPage, getPriceAdjustmentDetail, cancelPriceAdjustment } from './components/api';
import {
getPriceAdjustmentDetail,
searchSupplyRequestByHealth,
searchSupplyRequestByActivity,
searchSupplyRequestByDevice,
searchSupplyRequestByMed,
getExamineStatusOptions,
updateExamineByApproved,
rejectPriceAdjustment,
} from './components/api';
import DetailDialog from './components/detailDialog.vue';
// 表格数据
const adjustmentList = ref([]);
const loading = ref(false);
const total = ref(0);
const activeName = ref('1'); // 当前激活的标签页
// 审核状态选项 - 初始为空数组后续会通过API加载
const examineStatusOptions = ref([]);
const optionsLoading = ref(false);
// 查询参数
const queryParams = reactive({
pageNum: 1,
pageSize: 10,
statusEnum: undefined, // 审核状态
applicantTime: undefined, // 申请日期
});
// 详情弹窗相关
const detailDialogVisible = ref(false);
const selectedRow = ref({});
const categoryType = ref('');
// 状态标签类型
const getStatusTagType = (status) => {
const typeMap = {
1: 'warning', // 待审核
2: 'primary', // 审核中
3: 'success', // 同意
4: 'danger', // 驳回
};
return typeMap[status] || 'info';
};
// 处理分页事件
const handlePagination = (params) => {
// 将分页组件的参数映射到查询参数
queryParams.pageNum = params.page;
queryParams.pageSize = params.limit;
getList();
};
// 查询数据
const getList = async () => {
loading.value = true;
try {
// 构造符合后端要求的请求参数
const requestParams = {
statusEnum: queryParams.statusEnum,
pageNo: queryParams.pageNum,
pageSize: queryParams.pageSize,
};
// 根据后端要求的格式处理日期参数
if (queryParams.applicantTime) {
const dateStr = queryParams.applicantTime;
// requestParams.applicantTime = dateStr; // 原始日期值
requestParams.applicantTimeSTime = `${dateStr} 00:00:00`; // 当天开始时间
requestParams.applicantTimeETime = `${dateStr} 23:59:59`; // 当天结束时间
console.log('applicantTime', requestParams.applicantTime);
console.log('applicantTimeSTime', requestParams.applicantTimeSTime);
console.log('applicantTimeETime', requestParams.applicantTimeETime);
}
// 调用新的后端API接口
const response = await request({
url: '/inventory-examine-page/getPageByExamine',
method: 'get',
params: requestParams,
});
// 处理返回的数据
if (response && response.code === 200) {
// 直接从records字段获取数据
adjustmentList.value = response.data?.records || [];
// 检查total字段是否正确获取增加更多调试日志
total.value = response.data?.total || response.data?.totalCount || 0;
} else {
ElMessage.error(response?.msg || '获取调价审核列表失败');
adjustmentList.value = [];
total.value = 0;
}
} catch (error) {
ElMessage.error('获取数据异常,请稍后重试');
adjustmentList.value = [];
total.value = 0;
} finally {
loading.value = false;
}
};
// 操作按钮处理函数
const handleDetail = async (row) => {
// 保存当前行的调价类型
categoryType.value = row.categoryEnum_enumText || '';
// 调用详情API获取数据
try {
// 显示加载状态
loading.value = true;
// 准备API参数
const params = {
busNo: row.busNo,
};
// 根据itemCategoryEnum选择不同的API接口
let response;
if (row.itemCategoryEnum === 49) {
// 挂号
response = await searchSupplyRequestByHealth(params);
} else if (row.itemCategoryEnum === 48) {
// 诊疗
response = await searchSupplyRequestByActivity(params);
} else if (row.itemCategoryEnum === 47) {
// 耗材
response = await searchSupplyRequestByDevice(params);
} else if (row.itemCategoryEnum === 46) {
// 药品
response = await searchSupplyRequestByMed(params);
}
if (response && response.code === 200) {
// 日志记录原始返回数据
// 准备显示数据
let items = [];
// 根据API实际返回格式处理数据
if (typeof response.data === 'object' && response.data !== null) {
// 首先尝试获取data数组根据截图API返回格式
if (Array.isArray(response.data.data)) {
items = response.data.data;
} else if (Array.isArray(response.data.items)) {
items = response.data.items;
} else if (Array.isArray(response.data)) {
items = response.data;
} else {
// 如果只是单个对象,包装成数组
items = [response.data];
}
} else if (Array.isArray(response.data)) {
items = response.data;
}
// 转换数据格式以便显示
const formattedItems = items.map((item) => {
// 基础字段映射
const baseFields = {
targetId: item.targetId || item.busNo || item.itemId || item.code || item.id || '-',
chargeName: item.chargeName || item.itemName || item.name || '-',
volume: item.totalVolume || item.spec || item.specification || '-',
price: item.price || item.newprice || item.newPrice || item.afterPrice || '-',
reason: item.reason || item.sreason || item.adjustReason || item.remark || '-',
orgName: item.orgName || item.org || '-',
// 额外字段,用于挂号调价单显示
name: item.name || item.chargeName || item.itemName || '-',
originPrice: item.originPrice || '-',
retailPrice: item.retailPrice || '-',
originBuyingPrice: item.originBuyingPrice || '-',
newBuyingPrice: item.newBuyingPrice || '-',
originRetailPrice: item.originRetailPrice || '-',
newRetailPrice: item.newRetailPrice || '-',
};
return baseFields;
});
// 设置selectedRow确保格式一致
selectedRow.value = {
items: formattedItems,
createName: row.applicantId_dictText || '-',
busNo: row.busNo, // 添加busNo字段用于后续的审核和驳回操作
statusEnum_enumText: row.statusEnum_enumText, // 添加状态字段,用于控制按钮显示
};
// 显示弹窗
detailDialogVisible.value = true;
} else {
ElMessage.error(response?.msg || '获取详情数据失败');
}
} catch (error) {
ElMessage.error('获取详情数据失败');
} finally {
loading.value = false;
}
};
// 关闭详情弹窗处理
const handleDetailClose = () => {
// 重置选中的行数据和类型
selectedRow.value = {};
categoryType.value = '';
};
// 处理审批通过事件
const handleApprove = async () => {
try {
// 获取当前选中行的业务编号
const busNo = selectedRow.value.busNo;
// 调用审核通过API
const response = await updateExamineByApproved(busNo);
if (response && response.code === 200) {
ElMessage.success('审核通过成功');
// 关闭详情弹窗
detailDialogVisible.value = false;
// 刷新页面数据
getList();
} else {
ElMessage.error(response?.msg || '审核通过失败');
}
} catch (error) {
ElMessage.error('审核通过失败');
}
};
// 处理驳回事件
const handleReject = async () => {
try {
// 获取当前选中行的业务编号
const busNo = selectedRow.value.busNo;
// 调用驳回API
const response = await rejectPriceAdjustment(busNo);
if (response && response.code === 200) {
ElMessage.success('驳回成功');
// 关闭详情弹窗
detailDialogVisible.value = false;
// 延迟一点时间再刷新,确保弹窗完全关闭
setTimeout(async () => {
await getList();
}, 300);
} else {
ElMessage.error(response?.msg || '驳回失败');
}
} catch (error) {
ElMessage.error('驳回失败');
}
};
// 处理查询
const handleSearch = () => {
queryParams.pageNum = 1; // 重置页码
getList();
};
// 加载审核状态选项
const loadExamineStatusOptions = async () => {
// 如果已经加载过,不再重复加载
if (examineStatusOptions.value.length > 0) {
return;
}
optionsLoading.value = true;
try {
const response = await getExamineStatusOptions();
// 先清空选项数组
examineStatusOptions.value = [];
if (response && response.code === 200 && response.data) {
// 1. 首先检查是否有supplyStatusOptions字段
if (response.data.supplyStatusOptions) {
if (Array.isArray(response.data.supplyStatusOptions)) {
// supplyStatusOptions是数组
examineStatusOptions.value = response.data.supplyStatusOptions.map((item) => ({
value: item.code || item.key || item.value,
label: item.name || item.label || item.value,
}));
} else if (typeof response.data.supplyStatusOptions === 'object') {
// supplyStatusOptions是对象
examineStatusOptions.value = Object.entries(response.data.supplyStatusOptions).map(
([key, value]) => ({
value: key,
label: value,
})
);
}
}
// 2. 如果没有supplyStatusOptions字段但response.data本身是数组
else if (Array.isArray(response.data)) {
examineStatusOptions.value = response.data.map((item) => {
// 处理可能的JSON字符串格式
if (typeof item === 'string') {
try {
const parsed = JSON.parse(item);
return {
value: parsed.value || parsed.code || parsed.key,
label: parsed.label || parsed.name || parsed.value,
};
} catch (e) {
return {
value: item,
label: item,
};
}
}
return {
value: item.value || item.code || item.key,
label: item.label || item.name || item.value,
};
});
}
// 3. 如果response.data是对象
else if (typeof response.data === 'object') {
examineStatusOptions.value = Object.entries(response.data).map(([key, value]) => ({
value: key,
label: value,
}));
}
// 确保选项格式正确
if (examineStatusOptions.value.length === 0) {
// 如果没有数据,添加默认的选项
examineStatusOptions.value = [
{ value: '', label: '全部' },
{ value: '1', label: '待审核' },
{ value: '2', label: '已审核' },
{ value: '3', label: '已拒绝' },
];
} else {
// 在选项开头添加"全部"选项
examineStatusOptions.value.unshift({ value: '', label: '全部' });
}
} else {
// 如果API调用失败使用默认选项
examineStatusOptions.value = [
{ value: '', label: '全部' },
{ value: '1', label: '待审核' },
{ value: '2', label: '已审核' },
{ value: '3', label: '已拒绝' },
];
}
} catch (error) {
// 错误情况下使用默认选项
examineStatusOptions.value = [
{ value: '', label: '全部' },
{ value: '1', label: '待审核' },
{ value: '2', label: '已审核' },
{ value: '3', label: '已拒绝' },
];
} finally {
optionsLoading.value = false;
}
};
// 处理重置
const handleReset = () => {
// 重置查询参数
queryParams.statusEnum = undefined;
queryParams.applicantTime = undefined;
queryParams.pageNum = 1;
getList();
};
// 生命周期 - 加载
onMounted(() => {
// 初始加载审核状态选项
loadExamineStatusOptions();
getList();
});
</script>
<style scoped>
.app-container {
padding: 20px;
}
.query-form {
background-color: #fff;
padding: 20px;
border-radius: 8px;
margin-bottom: 20px;
border: 1px solid #ebeef5;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.05);
}
.query-buttons {
display: flex;
gap: 10px;
align-items: center;
height: 100%;
}
/* 确保表单元素垂直居中对齐 */
:deep(.el-form-item) {
margin-bottom: 0;
display: flex;
align-items: center;
height: 100%;
}
/* 确保标签和输入框垂直居中 */
:deep(.el-form-item__label-wrap) {
display: flex;
align-items: center;
}
:deep(.el-form-item__content) {
display: flex;
align-items: center;
}
:deep(.el-tabs__content) {
height: auto;
}
:deep(.demo-tabs > .el-tabs__content) {
color: #6b778c;
font-size: 14px;
}
:deep(.el-table) {
border: 1px solid #ebeef5;
border-radius: 8px;
overflow: hidden;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.05);
}
:deep(.el-table__header-wrapper) {
border-radius: 8px 8px 0 0;
overflow: hidden;
}
:deep(.el-table__body-wrapper) {
border-radius: 0 0 8px 8px;
overflow: hidden;
}
</style>

View File

@@ -1,9 +1,8 @@
import request from '@/utils/request';
// 查询费用定价信息列表
export function listDefinition (query) {
return request ({
url: '/dict-dictionary/definition/charge-item-info',
url: '/change/price/list/getPage',
method: 'get',
params: query,
});
@@ -14,21 +13,75 @@ export function initOption (query) {
return request ({
url: '/dict-dictionary/definition/init',
method: 'get',
params: query,
data: query,
});
}
// 获取药品列表
export function getMedicineList (query) {
// 确保 query 对象存在
const params = {
...query
};
// 根据categoryEnum值选择不同的接口
let url = '/change/price/searchKeyWordDataList';
if (query?.categoryEnum === 24) {
// 药品
url = '/change/price/searchKeyWordDataListByMed';
} else if (query?.categoryEnum === 25) {
// 耗材
url = '/change/price/searchKeyWordDataListByDevice';
} else if (query?.categoryEnum === 26) {
// 诊疗
url = '/change/price/searchKeyWordDataListByActivity';
}
return request ({
url: '/doctor-station/advice/advice-base-info',
method: 'get',
params: query,
url: url,
method: 'post',
params: params,
});
}
// 获取药品列表 - 药品专用接口
export function getMedicineListByMed(query) {
return request({
url: '/change/price/searchKeyWordDataListByMed',
method: 'post',
params: query || {},
headers: {
repeatSubmit: false // 禁用重复提交检查
}
});
}
// 获取耗材列表 - 耗材专用接口
export function getMedicineListByDevice(query) {
return request({
url: '/change/price/searchKeyWordDataListByDevice',
method: 'post',
params: query || {},
headers: {
repeatSubmit: false // 禁用重复提交检查
}
});
}
// 获取诊疗列表 - 诊疗专用接口
export function getMedicineListByActivity(query) {
return request({
url: '/change/price/searchKeyWordDataListByActivity',
method: 'post',
params: query || {},
headers: {
repeatSubmit: false // 禁用重复提交检查
}
});
}
// 修改费用定价信息
export function updateDefinition (data) {
return request ({
url: `/dict-dictionary/definition/update-charge-item?id=${data.id}&price=${data.price}`,
url: '/dict-dictionary/definition/update-charge-item?id=${data.id}&price=${data.price}',
method: 'put',
});
}
@@ -48,11 +101,79 @@ export function getDetail (id) {
method: 'get',
});
}
// 供应商查询
export function getSupplierList (query) {
return request ({
url: '/change/price/searchAllSupply',
// 提交价格调整数据
export function commitChangePriceData(data) {
return request({
url: '/change/price/commitChangePriceData',
method: 'post',
data: data // 直接提交数组作为body
});
}
// 提交审核价格调整数据
export function commitExamineChangePriceData(data) {
return request({
url: '/change/price/submitExamineChangePriceData',
method: 'post',
data: data // 直接提交数组作为body
});
}
// 查询所有科室数据
export function searchAllOrgData() {
return request({
url: '/change/price/searchAllOrgData',
method: 'post'
});
}
//根据所选科室数据查询当前科室下所有类型数据
export function searchHealthData(query) {
return request({
url: '/change/price/searchHealthData',
method: 'post',
params: query
});
}
// 验证药品
export function checkMedApprovalExist(itemId) {
return request({
url: '/change/price/checkMedApprovalExist',
method: 'post',
params: { itemId }
});
}
export function checkDeviceApprovalExist(itemId) {
return request({
url: '/change/price/checkDeviceApprovalExist',
method: 'post',
params: { itemId }
});
}
export function checkActivityApprovalExist(itemId) {
return request({
url: '/change/price/checkActivityApprovalExist',
method: 'post',
params: { itemId }
});
}
export function checkHealthApprovalExist(itemId) {
return request({
url: '/change/price/checkHealthApprovalExist',
method: 'post',
params: { itemId }
});
}
// 查询调价控制开关状态接口
export function getInitAdjustPriceSwitchState() {
return request({
url: '/change/price/getAdjustPriceSwitchState',
method: 'get',
params: query,
});
}

View File

@@ -1,16 +1,22 @@
<template>
<div>
<el-table ref="medicineRef" height="400" :data="medicineList" @cell-click="clickRow">
<el-table-column label="项目编码" align="center" prop="adviceDefinitionId" />
<el-table-column label="项目名称" align="center" prop="adviceName" />
<el-table-column label="当前价格" align="center" prop="retailPrice" />
<el-table-column label="规格" align="center" prop="volume" />
<el-table-column label="项目编码" align="center" prop="busNo" />
<el-table-column label="项目名称" align="center" prop="name" />
<el-table-column
v-if="categoryEnum !== 26"
label="当前进货价"
align="center"
prop="originBuyingPrice"
/>
<el-table-column label="当前零售价" align="center" prop="originRetailPrice" />
<el-table-column v-if="categoryEnum !== 26" label="规格" align="center" prop="volume" />
</el-table>
</div>
</template>
<script setup>
import { getMedicineList } from './api';
import { getMedicineListByMed, getMedicineListByDevice, getMedicineListByActivity } from './api';
import { watch } from 'vue';
import { throttle } from 'lodash-es';
@@ -23,51 +29,86 @@ const props = defineProps({
type: String,
default: '',
},
categoryEnum: {
type: Number,
default: 24, // 默认值为0表示药品类别
},
});
// 选择药品
const emit = defineEmits(['selectRow']);
// 查询参数
const queryParams = ref({
searchKey: props.searchKey,
// supplierId: props.supplierId,
categoryEnum: props.categoryEnum, // 使用props传入的categoryCode
});
// 药品列表
const medicineList = ref([]);
// 节流函数
// 是否正在请求中,防止重复请求
const isRequesting = ref(false);
const loadding = ref(false);
// 获取药品列表
const getList = async (query) => {
// 防止重复请求
if (isRequesting.value) {
return;
}
const params = query || queryParams.value;
console.log('queryParams', queryParams.value);
loadding.value = true;
isRequesting.value = true;
let apiPromise;
// 根据categoryEnum值选择不同的API函数
if (params.categoryEnum === 24) {
// 药品
apiPromise = getMedicineListByMed(params);
} else if (params.categoryEnum === 25) {
// 耗材
apiPromise = getMedicineListByDevice(params);
} else if (params.categoryEnum === 26) {
// 诊疗
apiPromise = getMedicineListByActivity(params);
}
try {
const res = await apiPromise;
// 检查响应数据结构API返回的data是直接数组而不是带records属性的对象
medicineList.value = Array.isArray(res.data) ? res.data : res.data.data || [];
} catch (error) {
medicineList.value = [];
} finally {
loadding.value = false;
isRequesting.value = false;
}
};
// 节流函数 - 使用防抖更合适,避免频繁请求
const throttledGetList = throttle(
() => {
getList();
},
300,
{ leading: true, trailing: true }
500,
{ leading: true, trailing: false }
);
// 获取药品列表
const getList = (query) => {
getMedicineList(query || queryParams.value).then((res) => {
medicineList.value = res.data.records;
});
};
// 点击行
const clickRow = (row) => {
console.log(row, 'row');
emit('selectRow', row);
};
// 监听搜索关键字
// 监听搜索关键字和类别编码
watch(
() => props,
(newValue) => {
queryParams.value.searchKey = newValue.searchKey;
() => [props.searchKey, props.categoryEnum],
([newSearchKey, newCategoryEnum]) => {
queryParams.value.searchKey = newSearchKey;
queryParams.value.categoryEnum = newCategoryEnum; // 直接使用数字类型
throttledGetList();
},
{ immediate: true, deep: true }
);
// 获取药品列表
getList();
</script>
<style scoped>

View File

@@ -33,7 +33,7 @@
"top": 13.5,
"height": 12,
"width": 75,
"title": "医院",
"title": "长春大学医院",
"coordinateSync": false,
"widthHeightSync": false,
"fontSize": 12,
@@ -84,7 +84,7 @@
"top": 33,
"height": 9.75,
"width": 120,
"title": "机构:医院",
"title": "机构:长春大学医院",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0

View File

@@ -54,7 +54,7 @@
placeholder=""
clearable
filterable
:disabled="viewStatus == 'view'"
:disabled="viewStatus == 'view' || viewStatus == 'apply'"
style="width: 150px"
>
<el-option
@@ -70,7 +70,7 @@
v-model="receiptHeaderForm.occurrenceTime"
value-format="YYYY-MM-DD HH:mm:ss"
type="datetime"
:disabled="viewStatus == 'view'"
:disabled="viewStatus == 'view' || viewStatus == 'apply'"
/>
</el-form-item>
<el-form-item label="供应商:" prop="supplierId">
@@ -80,7 +80,8 @@
clearable
filterable
style="width: 150px"
:disabled="viewStatus == 'view'"
:disabled="viewStatus == 'view' || viewStatus == 'apply'"
v-if="viewStatus != 'apply' && viewStatus != 'view'"
>
<el-option
v-for="supplier in supplierListOptions"
@@ -89,6 +90,13 @@
:value="supplier.value"
/>
</el-select>
<el-input
placeholder="供应商名称"
v-model="receiptHeaderForm.supplierName"
clearable
disabled
v-else-if="viewStatus == 'view' || viewStatus == 'apply'"
/>
</el-form-item>
<el-form-item label="药品类型:" prop="medicationType">
<el-select
@@ -209,17 +217,17 @@
<el-table-column
label="厂家/产地"
align="center"
key="manufacturer"
prop="manufacturer"
key="manufacturerText"
prop="manufacturerText"
:show-overflow-tooltip="true"
width="160"
>
<template #default="scope">
<el-form-item
:prop="`purchaseinventoryList.${scope.$index}.manufacturer`"
:rules="tableRules.manufacturer"
:prop="`purchaseinventoryList.${scope.$index}.manufacturerText`"
:rules="tableRules.manufacturerText"
>
<el-input v-model="scope.row.manufacturer" placeholder="" disabled />
<el-input v-model="scope.row.manufacturerText" placeholder="" disabled />
</el-form-item>
</template>
</el-table-column>
@@ -503,6 +511,7 @@
<el-input
v-model="scope.row.invoiceNo"
placeholder=""
style="text-align: center !important"
:disabled="viewStatus == 'view'"
/>
</el-form-item>
@@ -632,7 +641,6 @@ import {
getPharmacyList,
getCount,
getDispensaryList,
getMedicineList,
getInitBusNo,
purchaseInventoryApproved,
reject,
@@ -682,7 +690,6 @@ const multiple = ref(true);
const total = ref(0);
const title = ref('');
const visible = ref(false);
const row = ref({});
const openTraceNoDialog = ref(false);
const ypName = ref('');
const rowIndex = ref(-1);
@@ -698,6 +705,7 @@ const forms = reactive({
const receiptHeaderForm = reactive({
busNo: undefined,
occurrenceTime: formatDate(new Date()),
practitionerId: userUserStore.practitionerId,
});
const data = reactive({
@@ -724,11 +732,7 @@ const data = reactive({
statusEnum_enumText: [{ required: true, message: '规格不能为空', trigger: 'blur' }],
unitCode: [{ required: true, message: '计量单位不能为空', trigger: 'blur' }],
purposeLocationId: [{ required: true, message: '目的仓库不能为空', trigger: 'blur' }],
// purposeLocationStoreId: [
// { required: true, message: "货位不能为空", trigger: "blur" },
// ],
lotNumber: [{ required: true, message: '产品批号不能为空', trigger: 'change' }],
// traceNo: [{ required: true, message: "追溯码不能为空", trigger: "blur" }],
startTime: [{ required: true, message: '开始时间不能为空', trigger: 'blur' }],
endTime: [{ required: true, message: '结束时间不能为空', trigger: 'blur' }],
price: [{ required: true, message: '单价不能为空', trigger: 'blur' }],
@@ -761,7 +765,6 @@ const saveRowObject = ref({});
watch(
() => store.currentData,
(newVlaue) => {
console.log(newVlaue, '11212121212121');
if (newVlaue) {
editData.value.editRow = newVlaue?.editRow;
editData.value.item = newVlaue?.item;
@@ -803,26 +806,6 @@ watch(
{ immediate: true }
);
onMounted(() => {
document.addEventListener("click", handleClickOutside);
// 获取源仓库列表(假设 getPharmacyList 返回仓库数据)
getPharmacyList({ type: 'source' }).then(res => {
if (res.code === 200) {
sourceTypeListOptions.value = res.data; // 格式需为 [{id, name}, ...]
}
});
// 获取目的仓库列表
getPharmacyList({ type: 'purpose' }).then(res => {
if (res.code === 200) {
purposeTypeListOptions.value = res.data;
}
});
// 初始化默认仓库数据,使用药房类型(16)
handleChangeLocationType(16);
console.log(route, '!1212');
if (route.query.view) {
viewStatus.value = route.query.view;
// 查看模式下不要清空store数据让watch监听器自然处理
@@ -844,42 +827,138 @@ onUnmounted(() => {
});
function addNewRow() {
// 先校验表头表单
proxy.$refs['receiptHeaderRef'].validate((valid) => {
if (valid) {
// if (data.isAdding) {
// proxy.$message.warning('请先保存当前行后再新增!');
// return;
// }
const newRow = {
rowKey: Date.now(),
id: '',
itemTable: '',
itemQuantity: '',
itemId: '',
unitCode: '',
remake: '',
supplierId: '',
purposeTypeEnum: '',
// 使用表头的仓库作为新增行默认值,减少重复选择
purposeLocationId: receiptHeaderForm.purposeLocationId || null,
purposeLocationStoreId: null,
practitionerId: '',
traceNo: '',
invoiceNo: '',
startTime: '',
endTime: '',
price: '',
totalPrice: '',
sellPrice: '',
minSellPrice: '',
// locationInventoryList: [], // 库房列表
unitList: {}, // 单位列表
isEditing: true, // 标记当前行是否正在编辑
error: false, // 新增 error 字段
isSave: false, // 当前行是否保存
};
form.purchaseinventoryList.push(newRow);
data.isAdding = true; // 设置标志位为 true表示有未保存的
// 检查表格中是否有未保存的行
const unsavedRows = form.purchaseinventoryList.filter((row) => !row.isSave);
if (unsavedRows.length > 0) {
// 校验表格中未保存的行
proxy.$refs['formRef'].validate((tableValid) => {
if (!tableValid) {
proxy.$message.warning('请先完善当前行的必填信息后再添加新行');
return;
}
// 手动检查未保存行的必填字段
const invalidRows = [];
unsavedRows.forEach((row, index) => {
const rowIndex = form.purchaseinventoryList.indexOf(row);
const errors = [];
// 检查必填字段
if (!row.itemId || !row.name) {
errors.push('项目');
}
if (!row.volume) {
errors.push('规格');
}
if (!row.unitCode) {
errors.push('计量单位');
}
if (!row.purposeLocationId) {
errors.push('仓库');
}
if (!row.itemQuantity || row.itemQuantity === '' || row.itemQuantity === 0) {
errors.push('采购数量');
}
if (!row.lotNumber) {
errors.push('产品批号');
}
if (!row.startTime) {
errors.push('生产日期');
}
if (!row.endTime) {
errors.push('有效期至');
}
if (!row.price || row.price === '' || row.price === 0) {
errors.push('采购单价');
}
if (!row.invoiceNo || row.invoiceNo === '') {
errors.push('发票号');
}
if (!row.totalPrice || row.totalPrice === '' || row.totalPrice === 0) {
errors.push('合计金额');
}
if (errors.length > 0) {
invalidRows.push({
rowIndex: rowIndex + 1,
errors: errors.join('、'),
});
}
});
if (invalidRows.length > 0) {
const errorMsg = invalidRows
.map((item) => `${item.rowIndex}行缺少:${item.errors}`)
.join('');
proxy.$message.warning(errorMsg + ',请完善后再添加新行');
return;
}
// 所有校验通过,允许新增
const newRow = {
rowKey: Date.now(),
id: '',
itemTable: '',
itemQuantity: '',
itemId: '',
unitCode: '',
remake: '',
supplierId: '',
purposeTypeEnum: '',
purposeLocationId: null,
purposeLocationStoreId: null,
practitionerId: '',
traceNo: '',
invoiceNo: '-',
startTime: '',
endTime: '',
price: '',
totalPrice: '',
sellPrice: '',
minSellPrice: '',
unitList: {}, // 单位列表
isEditing: true, // 标记当前行是否正在编辑
error: false, // 新增 error 字段
isSave: false, // 当前行是否保存
};
form.purchaseinventoryList.push(newRow);
data.isAdding = true; // 设置标志位为 true表示有未保存的
});
} else {
// 没有未保存的行,直接新增
const newRow = {
rowKey: Date.now(),
id: '',
itemTable: '',
itemQuantity: '',
itemId: '',
unitCode: '',
remake: '',
supplierId: '',
purposeTypeEnum: '',
purposeLocationId: null,
purposeLocationStoreId: null,
practitionerId: '',
traceNo: '',
invoiceNo: '-',
startTime: '',
endTime: '',
price: '',
totalPrice: '',
sellPrice: '',
minSellPrice: '',
unitList: {}, // 单位列表
isEditing: true, // 标记当前行是否正在编辑
error: false, // 新增 error 字段
isSave: false, // 当前行是否保存
};
form.purchaseinventoryList.push(newRow);
data.isAdding = true; // 设置标志位为 true表示有未保存的
}
}
});
}
@@ -899,36 +978,9 @@ function handleBlur(row, index) {
row.supplierId = receiptHeaderForm.supplierId;
row.purposeTypeEnum = receiptHeaderForm.purposeTypeEnum;
}
const handleMouseEnter = (row, column, cell, event) => {
// console.log('鼠标移入行', row);
};
const handleMouseEnter = (row, column, cell, event) => {};
const handleMouseLeave = (row, column, cell, event) => {
// handleBlur(row)
// if(row.id){ // 编辑
// let rows = JSON.parse(JSON.stringify(saveRowObject.value))
// delete rows.unitList
// let rowss= JSON.parse(JSON.stringify(row))
// delete rowss.unitList
// let purchaseinventoryIndex = form.purchaseinventoryList.findIndex(k=>k.id==row.id)
// if(!areObjectsEqual(rowss,rows)){
// handleSave(rowss,purchaseinventoryIndex)
// }
// }else{
// let rows = JSON.parse(JSON.stringify(saveRowObject.value))
// delete rows.unitList
// let rowss= JSON.parse(JSON.stringify(row))
// delete rowss.unitList
// console.log(form.purchaseinventoryList.length,form.purchaseinventoryList,"211111111")
// if(form.purchaseinventoryList.length==1){
// handleSave(row,0)
// }else if(form.purchaseinventoryList.length>1&&saveRowObject.value){
// if(!areObjectsEqual(rowss,rows)){
// handleSave(rowss,form.purchaseinventoryList.length-1)
// }
// }
// }
};
const handleMouseLeave = (row, column, cell, event) => {};
// 点击行时记录当前行
function handleRowClick(row) {
@@ -942,66 +994,9 @@ function handleRowClick(row) {
} else {
currentIndex.value = form.purchaseinventoryList.length - 1;
}
// handleBlur(row);
// if (row.id) {
// // 编辑
// let purchaseinventoryIndex = form.purchaseinventoryList.findIndex((k) => k.id == row.id);
// let rows = JSON.parse(JSON.stringify(forms.purchaseinventoryList[purchaseinventoryIndex]));
// delete rows.unitList;
// let rowss = JSON.parse(JSON.stringify(row));
// delete rowss.unitList;
// console.log(
// purchaseinventoryIndex,
// '编辑',
// forms.purchaseinventoryList[purchaseinventoryIndex],
// rowss,
// rows
// );
// if (!areObjectsEqual(rowss, rows)) {
// handleSave(rowss, purchaseinventoryIndex);
// }
// } else {
// let rows = JSON.parse(JSON.stringify(saveRowObject.value));
// delete rows.unitList;
// let rowss = JSON.parse(JSON.stringify(row));
// delete rowss.unitList;
// console.log(form.purchaseinventoryList.length, form.purchaseinventoryList, '211111111');
// if (form.purchaseinventoryList.length == 1) {
// handleSave(row, 0);
// } else if (form.purchaseinventoryList.length > 1 && saveRowObject.value) {
// if (!areObjectsEqual(rowss, rows)) {
// handleSave(rowss, form.purchaseinventoryList.length - 1);
// }
// }
// }
currentRow.value = row;
}
function areObjectsEqual(obj1, obj2) {
const keys1 = Object.keys(obj1);
const keys2 = Object.keys(obj2);
if (keys1.length !== keys2.length) {
return false;
}
for (let key of keys1) {
if (obj1[key] !== obj2[key]) {
return false;
}
}
return true;
}
// 监听表格外的点击事件
// function handleClickOutside(event) {
// if (tableRef.value && !tableRef.value.$el.contains(event.target)) {
// if (currentRow.value) {
// // handleSave(currentRow.value);
// currentRow.value = null; // 清空当前行
// }
// }
// }
function saveRow(row, index) {
form.purchaseinventoryList[index] = row;
addPurchaseinventory(row).then((response) => {
@@ -1060,12 +1055,12 @@ function selectRow(rowValue, index) {
form.purchaseinventoryList[index].volume = rowValue.volume;
form.purchaseinventoryList[index].minUnitCode = rowValue.minUnitCode;
form.purchaseinventoryList[index].unitCode = rowValue.unitCode;
form.purchaseinventoryList[index].manufacturer = rowValue.manufacturer;
form.purchaseinventoryList[index].manufacturerText = rowValue.manufacturerText;
form.purchaseinventoryList[index].partPercent = rowValue.partPercent;
form.purchaseinventoryList[index].invoiceNo = '-';
form.purchaseinventoryList[index].price = (rowValue.purchaseAmount || 0).toFixed(2);
price.value = (rowValue.purchaseAmount || 0).toFixed(2);
form.purchaseinventoryList[index].unitList = rowValue.unitList[0];
// form.purchaseinventoryList[index].locationInventoryList = locationList.value;
unitMap.value['unitCode'] = rowValue.unitCode;
unitMap.value['minUnitCode'] = rowValue.minUnitCode;
unitMap.value['currentCode'] = rowValue.unitCode;
@@ -1092,9 +1087,7 @@ function handleLocationClick(item, row, index) {
row.unitList.unitCode_dictText,
row.unitList.minUnitCode_dictText
) || 0;
// form.purchaseinventoryList[index].price = (res.data[0].price || 0).toFixed(2);
// price.value = (res.data[0].price || 0).toFixed(2);
// form.purchaseinventoryList[index].traceNo = res.data[0].traceNo || '';
form.purchaseinventoryList[index].itemTable = res.data[0].itemTable || '';
form.purchaseinventoryList[index].startTime = formatDateymd(res.data[0].productionDate) || '';
form.purchaseinventoryList[index].endTime = formatDateymd(res.data[0].expirationDate) || '';
@@ -1106,10 +1099,6 @@ function handleLocationClick(item, row, index) {
: '';
}
});
// form.purchaseinventoryList[index].purposeLocationStoreId =
// item.locationStoreId;
// form.purchaseinventoryList[index].locationStoreName = item.locationStoreName;
//
}
// 处理总数量不整时显示的情况,例 10盒2片
@@ -1234,21 +1223,13 @@ function handleUnitCodeChange(row, index, value) {
unitMap.value['unitCode'] != value &&
unitMap.value['currentCode'] == unitMap.value['unitCode']
) {
console.log(1212121, row, index, value);
// 总库存数
form.purchaseinventoryList[index].quantity = totalQuantity;
// // 采购数量
// form.purchaseinventoryList[index].itemQuantity =
// form.purchaseinventoryList[index].itemQuantity * row.partPercent || 0;
// // 采购单价
// form.purchaseinventoryList[index].price = (price.value / row.partPercent).toFixed(4);
// 采购数量
form.purchaseinventoryList[index].itemQuantity = undefined;
// 采购单价
// form.purchaseinventoryList[index].price = undefined;
} else {
//大单位
console.log(12121212, row, index, value);
form.purchaseinventoryList[index].quantity =
handleTotalQuantity(
totalQuantity,
@@ -1256,11 +1237,8 @@ function handleUnitCodeChange(row, index, value) {
row.unitList.unitCode_dictText,
row.unitList.minUnitCode_dictText
) || 0;
// form.purchaseinventoryList[index].itemQuantity =
// form.purchaseinventoryList[index].itemQuantity / row.partPercent || 0;
// form.purchaseinventoryList[index].price = price.value;
form.purchaseinventoryList[index].itemQuantity = undefined;
// form.purchaseinventoryList[index].price = undefined;
}
form.purchaseinventoryList[index].totalPrice = undefined;
unitMap.value['currentCode'] = value;
@@ -1323,74 +1301,22 @@ function handleSave(row, index) {
}
function addPurchaseinventorys(rowList) {
addPurchaseinventory(JSON.parse(JSON.stringify(rowList))).then((res) => {
// 当前行没有id视为首次新增
// if (!row.id) {
// data.isAdding = false; // 允许新增下一行
// }
if (res.data) {
proxy.$message.success('保存成功!');
form.purchaseinventoryList.map((row, index) => {
console.log(row, 'res.data');
form.purchaseinventoryList[index].id = res.data[index];
form.purchaseinventoryList[index].isSave = true;
});
// forms.purchaseinventoryList[index] = JSON.parse(
// JSON.stringify(form.purchaseinventoryList[index])
// );
// currentEditRow.value = {};
// currentIndex.value = -1;
// saveRowObject.value = JSON.parse(JSON.stringify(row));
console.log(saveRowObject.value, '!@121211');
}
});
}
function handleTraceNoInput(value, row) {
row.traceNo = value.concat(',');
// row.traceNo = row.traceNo.startsWith(',') ? row.traceNo.substring(1) : row.traceNo;
}
// function handleSave(row, index) {
// handleBlur(row);
// proxy.$refs['receiptHeaderRef'].validate((valid) => {
// if (valid) {
// proxy.$refs['formRef'].validate((valid) => {
// if (valid) {
// if (row.itemQuantity == 0) {
// proxy.$message.warning('采购数量不能为0');
// return;
// }
// addPurchaseinventory(row).then((res) => {
// // 当前行没有id视为首次新增
// if (!row.id) {
// data.isAdding = false; // 允许新增下一行
// }
// if (res.data) {
// proxy.$message.success('保存成功!');
// form.purchaseinventoryList[index].id = res.data;
// form.purchaseinventoryList[index].isSave = true;
// // form.purchaseinventoryList[index].isEditing = false;
// forms.purchaseinventoryList[index] = JSON.parse(
// JSON.stringify(form.purchaseinventoryList[index])
// );
// currentEditRow.value = {};
// currentIndex.value = -1;
// saveRowObject.value = JSON.parse(JSON.stringify(row));
// // saveRowObject.value = JSON.parse(JSON.stringify(form.purchaseinventoryList[index]))
// console.log(saveRowObject.value, '!@121211');
// }
// });
// }
// });
// }
// });
// // 保存逻辑...
// }
/** 选择条数 */
function handleSelectionChange(selection) {
console.log(selection, 'selection');
// selectedData.value = selection.map((item) => ({ ...item })); // 存储选择的行数据
ids.value = selection.map((item) => item.id);
selectedRows.value = selection;
single.value = selection.length != 1;
@@ -1442,148 +1368,15 @@ function handlePrintPreview() {
const simpleData = {
supplierName: supplierName || '',
totalAmount: totalAmount.toFixed(2),
receiptNumber: receiptHeaderForm.receiptNumber || '',
receiptDate: receiptHeaderForm.receiptDate || '',
organizationName: receiptHeaderForm.organizationName || '',
// 重新添加药品清单数组,但确保格式安全
purchaseinventoryList: Array.isArray(form.purchaseinventoryList) ? form.purchaseinventoryList.map(item => ({
id: item.id || '',
name: item.name || '',
itemQuantity: item.itemQuantity || 0,
price: item.price || 0,
totalPrice: item.totalPrice || 0,
// 保留其他可能需要的字段
...item
})) : []
};
console.log('简化后的预览数据:', simpleData);
try {
// 直接使用templateJson创建打印
// 避免复杂的模板创建和数据处理逻辑
setTimeout(() => {
try {
// 最简单的方式使用hiprint - 直接调用print2方法
// 只传递必要的数据,不传递复杂嵌套的数组
const printOptions = {
preview: true,
title: '药品采购入库清单',
printer: ''
};
// 方法1: 尝试直接使用templateJson
console.log('尝试直接使用templateJson');
if (typeof hiprint.template !== 'undefined' && typeof hiprint.template.print === 'function') {
hiprint.template.print(templateJson, simpleData, printOptions);
}
// 方法2: 尝试创建简单模板
else if (typeof hiprint.PrintTemplate === 'function') {
console.log('尝试使用PrintTemplate');
const template = new hiprint.PrintTemplate({template: templateJson});
template.print(simpleData, printOptions);
}
// 方法3: 最直接的方式
else {
console.log('尝试最直接的打印方式');
hiprint.print(templateJson, simpleData, printOptions);
}
ElMessage.success('正在生成单据预览,请等待...');
} catch (e) {
console.error('预览执行失败:', e);
ElMessage.error('预览功能执行失败,请稍后重试');
}
}, 50);
} catch (error) {
console.error('预览准备失败:', error);
ElMessage.error('预览失败,请检查配置');
}
}
// 打印单据函数 - 简化实现,与预览函数保持一致
function handlePrint() {
// 检查是否存在数据
if (!form.purchaseinventoryList || form.purchaseinventoryList.length === 0) {
ElMessage.warning('没有数据可打印');
return;
}
// 检查是否所有必填字段都已填写
const hasEmptyFields = form.purchaseinventoryList.some(row => {
return !row.name || !row.itemQuantity || !row.price || !row.totalPrice;
...receiptHeaderForm,
purchaseinventoryList: form.purchaseinventoryList,
});
if (hasEmptyFields) {
ElMessage.warning('请确保所有药品信息完整后再打印');
return;
}
// 安全获取供应商名称
let supplierName = '';
if (supplierListOptions.value && receiptHeaderForm.supplierId) {
const filteredSuppliers = supplierListOptions.value.filter((item) => {
return item.value == receiptHeaderForm.supplierId;
});
supplierName = filteredSuppliers.length > 0 ? filteredSuppliers[0].label : '';
}
// 计算总金额
const totalAmount = form.purchaseinventoryList.reduce((accumulator, currentRow) => {
return accumulator + (Number(currentRow.totalPrice) || 0);
}, 0);
// 重新构建包含药品清单的数据结构
const simpleData = {
supplierName: supplierName || '',
totalAmount: totalAmount.toFixed(2),
receiptNumber: receiptHeaderForm.receiptNumber || '',
receiptDate: receiptHeaderForm.receiptDate || '',
organizationName: receiptHeaderForm.organizationName || '',
// 重新添加药品清单数组,但确保格式安全
purchaseinventoryList: Array.isArray(form.purchaseinventoryList) ? form.purchaseinventoryList.map(item => ({
id: item.id || '',
name: item.name || '',
itemQuantity: item.itemQuantity || 0,
price: item.price || 0,
totalPrice: item.totalPrice || 0,
// 保留其他可能需要的字段
...item
})) : []
};
try {
// 使用与预览函数相同的简化打印逻辑
setTimeout(() => {
try {
const printOptions = {
preview: false, // 直接打印模式
title: '药品采购入库清单',
printer: ''
};
// 尝试多种可能的API调用方式
if (typeof hiprint.template !== 'undefined' && typeof hiprint.template.print === 'function') {
hiprint.template.print(templateJson, simpleData, printOptions);
}
else if (typeof hiprint.PrintTemplate === 'function') {
const template = new hiprint.PrintTemplate({template: templateJson});
template.print(simpleData, printOptions);
}
else {
hiprint.print(templateJson, simpleData, printOptions);
}
ElMessage.success('打印请求已发送');
} catch (e) {
console.error('打印执行失败:', e);
ElMessage.error('打印执行失败,请稍后重试');
}
}, 50);
} catch (error) {
console.error('打印失败:', error);
ElMessage.error('打印失败,请检查配置');
}
const printElements = templateJson;
var hiprintTemplate = new hiprint.PrintTemplate({ template: printElements }); // 定义模板
hiprintTemplate.print2(result, {
printer: 'EPSON LQ-80KFII',
title: '打印标题',
}); //开始打印
}
function deleteSelectedRows() {
@@ -1651,47 +1444,20 @@ function show() {
receiptHeaderForm.busNo = res.data.busNo;
}
});
// supplierListOptions.value = props.supplierListOptions;
// itemTypeOptions.value = props.itemTypeOptions;
// practitionerListOptions.value = props.practitionerListOptions;
// receiptHeaderForm.busNo = props.busNoAdd;
// console.log(purchase_type.value, "purchase_type.value")
// // 设置默认值为字典中的第一个值
// if (purchase_type.value.length > 0) {
// form.value.medicationType = purchase_type.value[0].value;
// }
}
// 显示弹框
function edit() {
data.isAdding = false;
data.isEdit = true;
// reset();
visible.value = true;
// supplierListOptions.value = props.supplierListOptions;
// itemTypeOptions.value = props.itemTypeOptions;
// practitionerListOptions.value = props.practitionerListOptions;
// receiptHeaderForm.busNo = props.busNoAdd;
// 确保数据存在
if (!editData.value.item || editData.value.item.length === 0) {
proxy.$message.warning('没有可编辑的数据');
return;
}
receiptHeaderForm.value = editData.value.item.length > 0 ? editData.value.item[0] : {};
receiptHeaderForm.busNo = editData.value.editRow.supplyBusNo;
// 修改这里优先从详情数据中获取供应商ID如果不存在则从列表数据中获取
receiptHeaderForm.supplierId = (editData.value.item[0] && editData.value.item[0].supplierId) || editData.value.editRow.supplierId;
receiptHeaderForm.supplierId = editData.value.editRow.supplierId;
receiptHeaderForm.supplierName = editData.value.item[0].supplierName;
receiptHeaderForm.practitionerId = editData.value.editRow.practitionerId;
console.log(editData.value.editRow, editData.value, 'editData.value.editRow');
receiptHeaderForm.occurrenceTime = editData.value.item[0].occurrenceTime
? formatDate(editData.value.item[0].occurrenceTime)
: formatDate(new Date());
console.log(editData.value.item[0].occurrenceTime);
console.log(
editData.value.editRow.purposeTypeEnum,
editData.value,
'editData.value.editRow.purposeTypeEnum'
);
//仓库类型
receiptHeaderForm.purposeTypeEnum = editData.value.editRow.purposeTypeEnum
? editData.value.editRow.purposeTypeEnum.toString()
@@ -1710,13 +1476,8 @@ function edit() {
...item,
name: item.itemName,
volume: item.totalVolume,
manufacturer: item.supplierName,
// manufacturerText: item.supplierName,
quantity: item.totalQuantity,
// 确保仓库字段回显
purposeLocationId: item.purposeLocationId || editData.value.editRow?.purposeLocationId || null,
locationStoreName: item.locationStoreName || '',
purposeLocationStoreId: item.purposeLocationStoreId || null,
// locationInventoryList: locationList.value,
startTime: formatDateymd(item.startTime),
endTime: formatDateymd(item.endTime),
applyTime: formatDate(item.applyTime),
@@ -1725,8 +1486,6 @@ function edit() {
});
}, 100);
console.log(form.purchaseinventoryList, 'purchaseinventoryList.value');
console.log(receiptHeaderForm, 'receiptHeaderForm');
loading.value = false;
// 使用 Promise 确保数据加载完成
Promise.resolve().then(() => {
@@ -1794,23 +1553,7 @@ function handelApply() {
pageLoading.value = false;
});
}
function toLastView(visitedViews, view) {
const latestView = visitedViews.slice(-1)[0];
if (latestView) {
router.push(latestView.fullPath);
} else {
if (view.name === 'Dashboard') {
router.replace({ path: '/redirect' + view.fullPath });
} else {
router.push('/');
}
}
}
/** 取消按钮 */
function cancel() {
open.value = false;
reset();
}
/** 提交审核 */
function submitAudit() {
let length = form.purchaseinventoryList.length;
@@ -1832,29 +1575,6 @@ function submitAudit() {
});
}
}
/** 修改按钮操作 */
function handleUpdate(row) {
reset();
form.value = JSON.parse(JSON.stringify(row));
form.value.fwTypeCode = form.value.typeCode;
open.value = true;
title.value = '编辑';
}
/** 删除按钮操作 */
function handleDelete(row) {
const delId = row.id || ids.value;
data.isAdding = false;
proxy.$modal
.confirm('是否确认删除以上数据?')
.then(function () {
return delPurchaseinventory({ ids: delId.join(',') });
})
.then(() => {
proxy.$modal.msgSuccess('删除成功');
})
.catch(() => {});
}
function handleClickOutside() {
if (
currentIndex.value != -1 &&

View File

@@ -17,7 +17,14 @@
/>
</el-form-item>
<el-form-item label="审批状态:" prop="statusEnum">
<el-select v-model="queryParams.statusEnum" placeholder="" clearable style="width: 150px">
<el-select
v-model="queryParams.statusEnum"
placeholder=""
clearable
allow-create
filterable
style="width: 150px"
>
<el-option
v-for="supplyStatus in supplyStatusOptions"
:key="supplyStatus.value"
@@ -27,7 +34,13 @@
</el-select>
</el-form-item>
<el-form-item label="单据类型:" prop="typeEnum">
<el-select v-model="queryParams.typeEnum" placeholder="" clearable style="width: 150px">
<el-select
v-model="queryParams.typeEnum"
placeholder=""
clearable
filterable
style="width: 150px"
>
<el-option
v-for="item in supplyTypeOptions"
:key="item.value"
@@ -37,7 +50,13 @@
</el-select>
</el-form-item>
<el-form-item label="供应商:" prop="supplierId">
<el-select v-model="queryParams.supplierId" placeholder="" clearable style="width: 150px">
<el-select
v-model="queryParams.supplierId"
placeholder=""
filterable
clearable
style="width: 150px"
>
<el-option
v-for="supplier in supplierListOptions"
:key="supplier.value"
@@ -51,6 +70,7 @@
v-model="queryParams.practitionerId"
placeholder=""
clearable
filterable
style="width: 150px"
>
<el-option
@@ -77,48 +97,23 @@
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<!-- v-hasPermi="['system:user:add']" -->
<el-button
type="primary"
plain
icon="Plus"
@click="openAddInventoryReceiptDialog"
<el-button type="primary" plain icon="Plus" @click="openAddInventoryReceiptDialog"
>添加记录</el-button
>
</el-col>
<el-col :span="1.5">
<!-- v-hasPermi="['monitor:job:remove']" -->
<el-button
type="danger"
plain
icon="Delete"
:disabled="multiple"
@click="handleDelete"
<!-- v-hasPermi="['monitor:job:remove']" -->
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete"
>删除</el-button
>
</el-col>
<el-col :span="1.5">
<!-- v-hasPermi="['system:user:import']" -->
<el-button
type="primary"
plain
icon="Search"
@click="handleQuery"
>查询</el-button
>
<el-button type="primary" plain icon="Search" @click="handleQuery">查询</el-button>
</el-col>
<!-- v-hasPermi="['system:user:export']" -->
<!-- v-hasPermi="['system:user:export']" -->
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="CircleClose"
@click="handleClear"
>重置</el-button
>
<el-button type="warning" plain icon="CircleClose" @click="handleClear">重置</el-button>
</el-col>
</el-row>
@@ -209,12 +204,8 @@
class-name="small-padding fixed-width"
>
<template #default="scope">
<!-- v-hasPermi="['system:user:edit']" -->
<el-button
link
type="primary"
icon="View"
@click.stop="handleUpdate(scope.row,'view')"
<!-- v-hasPermi="['system:user:edit']" -->
<el-button link type="primary" icon="View" @click.stop="handleUpdate(scope.row, 'view')"
>详情</el-button
>
<el-button
@@ -222,18 +213,20 @@
type="primary"
icon="Edit"
@click.stop="handleUpdate(scope.row)"
:disabled="scope.row.statusEnum != '1' && scope.row.statusEnum != '9'"
:disabled="
scope.row.statusEnum != '1' &&
scope.row.statusEnum != '9' &&
scope.row.statusEnum != '4'
"
>编辑</el-button
>
<!-- v-hasPermi="['system:user:edit']" -->
<!-- v-hasPermi="['system:user:edit']" -->
<el-button
v-if="scope.row.statusEnum_enumText=='同意'"
v-if="scope.row.statusEnum_enumText == '同意'"
link
type="primary"
icon="Edit"
@click.stop="handleUpdateTK(scope.row)"
>退库</el-button
>
<!-- v-hasPermi="['system:user:remove']" -->
@@ -242,17 +235,15 @@
type="primary"
icon="View"
@click.stop="handleSubmitApproval(scope.row)"
v-if="scope.row.statusEnum == '1' || scope.row.statusEnum == '9'"
>提交审批</el-button
>
<!-- v-hasPermi="['system:user:remove']" -->
<!-- v-hasPermi="['system:user:remove']" -->
<el-button
link
type="primary"
icon="View"
@click.stop="handleWithdrawApproval(scope.row)"
v-if="scope.row.statusEnum == '2'"
>撤销审批</el-button
>
@@ -268,8 +259,8 @@
/>
<!-- 退货列表 -->
<el-table
v-if="purchaseinventoryReturnList&&purchaseinventoryReturnList.length>0"
style="height:190px;margin-top:32px;"
v-if="purchaseinventoryReturnList && purchaseinventoryReturnList.length > 0"
style="height: 190px; margin-top: 32px"
v-loading="loadingReturn"
:data="purchaseinventoryReturnList"
@selection-change="handleSelectionChangeReturn"
@@ -354,7 +345,7 @@
link
type="primary"
icon="View"
@click.stop="handleUpdateReturn(scope.row,'view')"
@click.stop="handleUpdateReturn(scope.row, 'view')"
>详情</el-button
>
<el-button
@@ -362,8 +353,11 @@
type="primary"
icon="Edit"
@click.stop="handleUpdateReturn(scope.row)"
:disabled="scope.row.statusEnum != '1' && scope.row.statusEnum != '9' && scope.row.statusEnum != '4'"
:disabled="
scope.row.statusEnum != '1' &&
scope.row.statusEnum != '9' &&
scope.row.statusEnum != '4'
"
>编辑</el-button
>
<!-- v-hasPermi="['system:user:remove']" -->
@@ -372,17 +366,15 @@
type="primary"
icon="View"
@click.stop="handleSubmitApprovalReturn(scope.row)"
v-if="scope.row.statusEnum == '1' || scope.row.statusEnum == '9'"
>提交审批</el-button
>
<!-- v-hasPermi="['system:user:remove']" -->
<!-- v-hasPermi="['system:user:remove']" -->
<el-button
link
type="primary"
icon="View"
@click.stop="handleWithdrawApprovalReturn(scope.row)"
v-if="scope.row.statusEnum == '2'"
>撤销审批</el-button
>
@@ -414,7 +406,7 @@ import {
generatedReturnDetail,
getpurchaseInventoryDetailReturn,
submitApprovalReturn,
withdrawApprovalReturn
withdrawApprovalReturn,
} from './components/purchaseinventory';
import { useStore } from '@/store/store';
import inventoryReceiptDialog from './components/inventoryReceiptDialog';
@@ -424,7 +416,7 @@ const router = useRouter();
const store = useStore();
const { proxy } = getCurrentInstance();
const purchaseinventoryRef = ref(null); // 初始化 ref
const purchaseinventoryReturnList = ref([])
const purchaseinventoryReturnList = ref([]);
const purchaseinventoryList = ref([]);
const open = ref(false);
const loading = ref(true);
@@ -449,7 +441,7 @@ const editRow = ref({});
const editRowTK = ref({});
// 使用 ref 定义当前编辑的采购
const currentData = ref({});
const selectedRows = ref([])
const selectedRows = ref([]);
// 是否停用
const statusFlagOptions = ref(undefined);
@@ -488,10 +480,10 @@ function getList() {
// proxy.addDateRange(queryParams.value, dateRange.value)
getPurchaseinventoryList(queryParams.value).then((res) => {
loading.value = false;
purchaseinventoryList.value = res.data.records
purchaseinventoryList.value.map(k=>{
k.returnStatus_text = k.returnStatus==1?'已退库':''
})
purchaseinventoryList.value = res.data.records;
purchaseinventoryList.value.map((k) => {
k.returnStatus_text = k.returnStatus == 1 ? '已退库' : '';
});
total.value = res.data.total;
});
}
@@ -509,9 +501,9 @@ function handleQuery() {
/** 清空条件按钮操作 */
function handleClear() {
// 清空查询条件
queryParams.value.createTimeSTime = ""
queryParams.value.createTimeETime = ""
dateRange.value = ""
queryParams.value.createTimeSTime = '';
queryParams.value.createTimeETime = '';
dateRange.value = '';
proxy.resetForm('queryRef');
getList();
}
@@ -530,9 +522,9 @@ function openAddInventoryReceiptDialog() {
function handleUpdateTK(row) {
// store.clearCurrentReturnData();
editRow.value = row;
router.push({
router.push({
path: 'returnedPurchase',
query:{originalSupplyBusNo:editRow.value.supplyBusNo}
query: { originalSupplyBusNo: editRow.value.supplyBusNo },
});
// getpurchaseInventoryDetail(row.supplyBusNo).then((response) => {
// currentData.value = response.data;
@@ -547,22 +539,26 @@ function handleUpdateTK(row) {
// });
}
/** 退库修改按钮操作 */
function handleUpdateReturn(row,view) {
if(view){
router.replace({ path: 'returnedPurchase',query:{originalSupplyBusNo:row.supplyBusNo,view:view}})
}else{
function handleUpdateReturn(row, view) {
if (view) {
router.replace({
path: 'returnedPurchase',
query: { originalSupplyBusNo: row.supplyBusNo, view: view },
});
} else {
router.push({
path: 'returnedPurchase',query:{originalSupplyBusNo:row.originalSupplyBusNo,supplyBusNo:row.supplyBusNo}
path: 'returnedPurchase',
query: { originalSupplyBusNo: row.originalSupplyBusNo, supplyBusNo: row.supplyBusNo },
});
}
handleRowClick(editRowTK.value)
handleRowClick(editRowTK.value);
}
/** 退库提交审核按钮 */
function handleSubmitApprovalReturn(row) {
submitApprovalReturn(row.supplyBusNo).then((response) => {
proxy.$modal.msgSuccess('提交审批成功');
// open.value = false;
handleRowClick(editRowTK.value)
handleRowClick(editRowTK.value);
// loadingReturn.value = false
});
}
@@ -577,18 +573,21 @@ function handleWithdrawApprovalReturn(row) {
});
}
/** 退库修改按钮操作 */
function handleUpdate(row,view) {
if(row.typeEnum==5){ //采购退货
function handleUpdate(row, view) {
if (row.typeEnum == 5) {
//采购退货
// editRow.value = row;
// getpurchaseInventoryDetail(row.supplyBusNo).then((response) => {
// currentData.value = response.data;
// store.setCurrentData({ editRow: row, item: currentData.value });
router.push({
path:'returnedPurchase',query:{supplyBusNo:row.supplyBusNo}
});
// getList();
router.push({
path: 'returnedPurchase',
query: { supplyBusNo: row.supplyBusNo },
});
// getList();
// })
}else{ // 采购入库
} else {
// 采购入库
editRow.value = row;
getpurchaseInventoryDetail(row.supplyBusNo).then((response) => {
currentData.value = response.data;
@@ -596,20 +595,21 @@ function handleUpdate(row,view) {
// proxy.$refs['inventoryReceiptRef'].edit();
// });
store.setCurrentData({ editRow: row, item: currentData.value });
if(view){ // 详情
if (view) {
// 详情
router.push({
path: 'purchaseDocument',query:{supplyBusNo:row.supplyBusNo,view:view}
path: 'purchaseDocument',
query: { supplyBusNo: row.supplyBusNo, view: view },
});
}else{
} else {
router.push({
path: 'purchaseDocument',
});
}
getList();
})
});
}
}
/** 提交审核按钮 */
function handleSubmitApproval(row) {
@@ -633,7 +633,7 @@ function handleWithdrawApproval(row) {
function handleSelectionChange(selection) {
ids.value = selection.map((item) => item.id);
selectedRows.value = selection;
console.log(selectedRows.value,"!21212")
console.log(selectedRows.value, '!21212');
single.value = selection.length != 1;
multiple.value = !selection.length;
}
@@ -647,13 +647,13 @@ function handleSelectionChangeReturn(selection) {
/** 删除按钮操作 */
function handleDelete(row) {
let length = selectedRows.value.length;
let ids = []
if(selectedRows.value[0].id){
ids = selectedRows.value.map((item) => {
return item.id
let ids = [];
if (selectedRows.value[0].id) {
ids = selectedRows.value.map((item) => {
return item.id;
});
}
console.log(ids, "ids");
}
console.log(ids, 'ids');
proxy.$modal
.confirm('是否确认删除以上数据?')
.then(function () {
@@ -667,19 +667,18 @@ function handleDelete(row) {
}
//点击列表当前行
function handleRowClick(row) {
editRowTK.value = row
console.log(row,"row")
if(row.returnStatus==1){
loadingReturn.value = true
editRowTK.value = row;
console.log(row, 'row');
if (row.returnStatus == 1) {
loadingReturn.value = true;
generatedReturnDetail(row.supplyBusNo).then((response) => {
purchaseinventoryReturnList.value = response.data
purchaseinventoryReturnList.value.map(k=>{
purchaseinventoryReturnList.value = response.data;
purchaseinventoryReturnList.value.map((k) => {
// k.returnStatus_text = k.returnStatus==1?'已退库':''
k.originalSupplyBusNo = k.originalSupplyBusNo?k.originalSupplyBusNo:row.supplyBusNo
})
})
loadingReturn.value = false
k.originalSupplyBusNo = k.originalSupplyBusNo ? k.originalSupplyBusNo : row.supplyBusNo;
});
});
loadingReturn.value = false;
}
}

View File

@@ -0,0 +1,141 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryRef" :inline="true" label-width="100px">
</el-form>
<el-table
v-loading="loading"
:data="basicInformationDetailsList"
@selection-change="handleSelectionChange"
height="calc(100vh - 300px)"
>
<el-table-column type="selection" width="50" align="center" />
<el-table-column
label="序号"
align="center"
key="no"
prop="no"
width="200"
:show-overflow-tooltip="true"
/>
<el-table-column
label="数据上报日期"
align="center"
key="dataReportingDate"
prop="dataReportingDate"
width="200"
:show-overflow-tooltip="true"
>
<template #default="scope">
<span>{{ parseTime(scope.row.occurrenceTime) }}</span>
</template>
</el-table-column>
<!-- itemTable -->
<el-table-column
label="省级行政区划代码"
align="center"
key="provinceCodes"
prop="provinceCodes"
width="200"
:show-overflow-tooltip="true"
/>
<el-table-column
label="组织机构代码"
align="center"
key="organizationCode"
prop="organizationCode"
width="200"
:show-overflow-tooltip="true"
/>
<el-table-column
label="医疗机构代码"
align="center"
key="medicalCode"
prop="medicalCode"
width="200"
:show-overflow-tooltip="true"
/>
<el-table-column
label="组织机构名称"
align="center"
key="organizationName"
prop="organizationName"
width="200"
:show-overflow-tooltip="true"
/>
<el-table-column
label="年度药品总收入(元)"
align="center"
key="yearMedicineTotalRevenue"
prop="yearMedicineTotalRevenue"
:show-overflow-tooltip="true"
/>
<el-table-column
label="实有床位数"
align="center"
key="actualBedsNo"
prop="actualBedsNo"
:show-overflow-tooltip="true"
/>
</el-table>
<pagination
v-show="total > 0"
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script setup name="basicInformationDetails">
import {
getReportBasicInformationDetails,
} from './statisticalManagent';
const basicInformationDetailsList = ref([]);
const loading = ref(true);
const ids = ref([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const approvalTime = ref([]);
const supplierListOptions = ref([]);
const locationIdList = ref([]);
const data = reactive({
form: {},
queryParams: {
pageNo: 1,
pageSize: 10,
searchKey: undefined,
occurrenceTimeSTime: undefined,
occurrenceTimeETime: undefined,
},
rules: {},
});
const { queryParams, form, rules } = toRefs(data);
function getList() {
loading.value = true;
getReportBasicInformationDetails(queryParams.value).then((res) => {
loading.value = false;
basicInformationDetailsList.value = res.data.records;
total.value = res.data.total;
});
}
getList();
</script>
<style scoped>
.custom-tree-node {
display: flex;
align-items: center;
}
.title {
font-weight: bold;
font-size: large;
margin-bottom: 10px;
}
</style>

View File

@@ -41,7 +41,7 @@
style="width: 150px"
>
<el-option
v-for="categoryCode in item_type"
v-for="categoryCode in item_category_code"
:key="categoryCode.value"
:label="categoryCode.label"
:value="categoryCode.value"

View File

@@ -0,0 +1,169 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryRef" :inline="true" label-width="150px">
<el-form-item label="项目名称:" prop="searchKey">
<el-input
v-model="queryParams.name"
placeholder="项目名称"
clearable
style="width: 200px"
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="医疗机构名称:" prop="searchKey">
<el-input
v-model="queryParams.medinsName"
placeholder="医疗机构名称"
clearable
style="width: 200px"
@keyup.enter="handleQuery"
/>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<!-- 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-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="Download" @click="handleExport">导出</el-button>
</el-col>
</el-row>
<el-table
v-loading="loading"
:data="drugExpensesGrowthRateList"
@selection-change="handleSelectionChange"
height="calc(100vh - 300px)"
>
<el-table-column type="selection" width="50" align="center" />
<el-table-column
label="项目名称"
align="center"
key="name"
prop="name"
width="200"
:show-overflow-tooltip="true"
/>
<el-table-column
label="医疗机构名称"
align="center"
key="medinsName"
prop="medinsName"
width="200"
:show-overflow-tooltip="true"
/>
<el-table-column
label="本年度药品支出额(元)"
align="center"
key="currentYearExpenditure"
prop="currentYearExpenditure"
width="200"
:show-overflow-tooltip="true"
/>
<el-table-column
label="上一年度药品支出额(元)"
align="center"
key="lastYearExpenditure"
prop="lastYearExpenditure"
width="200"
:show-overflow-tooltip="true"
/>
</el-table>
<pagination
v-show="total > 0"
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script setup name="drugExpensesGrowthRate">
import {
getDrugExpensesGrowthRate
} from './statisticalManagent';
const { proxy } = getCurrentInstance();
const drugExpensesGrowthRateList = ref([]);
const loading = ref(true);
const ids = ref([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const data = reactive({
form: {},
queryParams: {
pageNo: 1,
pageSize: 10,
searchKey: undefined
},
rules: {},
});
const { queryParams} = toRefs(data);
/** 导出按钮操作 */
function handleExport() {
proxy.$download.downloadGet(
'report-manage/inbound/excel-out',
{
...queryParams.value,
},
`dict_${new Date().getTime()}.xlsx`
);
}
/** 查询调拨管理项目列表 */
function getList() {
loading.value = true;
getDrugExpensesGrowthRate(queryParams.value).then((res) => {
loading.value = false;
drugExpensesGrowthRateList.value = res.data.records;
total.value = res.data.total;
});
}
/** 搜索按钮操作 */
function handleQuery() {
queryParams.value.pageNo = 1;
getList();
}
/** 清空条件按钮操作 */
function handleClear() {
// 清空查询条件
queryParams.value.name = '';
queryParams.value.medinsName = '';
proxy.resetForm('queryRef');
getList();
}
/** 选择条数 */
function handleSelectionChange(selection) {
ids.value = selection.map((item) => item.id);
single.value = selection.length != 1;
multiple.value = !selection.length;
}
getList();
</script>
<style scoped>
.custom-tree-node {
display: flex;
align-items: center;
}
.title {
font-weight: bold;
font-size: large;
margin-bottom: 10px;
}
</style>

View File

@@ -34,7 +34,7 @@
style="width: 150px"
>
<el-option
v-for="categoryCode in item_type"
v-for="categoryCode in item_category_code"
:key="categoryCode.value"
:label="categoryCode.label"
:value="categoryCode.value"
@@ -203,7 +203,7 @@ import { getExpirationWarning } from './statisticalManagent';
const { proxy } = getCurrentInstance();
const { item_type } = proxy.useDict('item_type');
const { item_category_code } = proxy.useDict('item_category_code');
const purchaseinventoryList = ref([]);
const loading = ref(true);

View File

@@ -4,9 +4,9 @@
<el-form-item label="药品名称:" prop="searchKey">
<el-input
v-model="queryParams.searchKey"
placeholder="药品编码/药品名称/名称拼音/供应商名"
placeholder="药品编码/药品名称/名称拼音"
clearable
style="width: 250px"
style="width: 260px"
@keyup.enter="handleQuery"
/>
</el-form-item>
@@ -35,9 +35,10 @@
placeholder="请选择药品类别"
clearable
style="width: 150px"
@change="handleQuery"
>
<el-option
v-for="categoryCode in item_type"
v-for="categoryCode in item_category_code"
:key="categoryCode.value"
:label="categoryCode.label"
:value="categoryCode.value"
@@ -50,6 +51,7 @@
placeholder="请选择药品类别"
clearable
style="width: 150px"
@change="handleQuery"
>
<el-option label="未停供" :value="2" />
<el-option label="已停供" :value="3" />
@@ -61,6 +63,7 @@
placeholder="请选择医保等级"
clearable
style="width: 150px"
@change="handleQuery"
>
<el-option
v-for="chrgitmLv_enumText in chrgitmLv_enumTextOptions"
@@ -70,27 +73,13 @@
/>
</el-select>
</el-form-item>
<el-form-item label="仓库药房" prop="locationId">
<el-form-item label="库存范围" prop="zeroFlag">
<el-select
v-model="queryParams.locationId"
placeholder="请选择仓库药房"
clearable
style="width: 150px"
>
<el-option
v-for="supplyStatus in locationIdList"
:key="supplyStatus.value"
:label="supplyStatus.name"
:value="supplyStatus.id"
/>
</el-select>
</el-form-item>
<el-form-item label="库存范围:" prop="warehouseScope">
<el-select
v-model="queryParams.warehouseScope"
v-model="queryParams.zeroFlag"
placeholder="请选择库存范围"
clearable
style="width: 150px"
@change="handleQuery"
>
<el-option
v-for="supplyStatus in inventory_range"
@@ -100,40 +89,52 @@
/>
</el-select>
</el-form-item>
<!-- <el-form-item label="医院" prop="hospital" label-width="100px">
<el-form-item label="仓库药房" prop="locationId">
<el-select
v-model="queryParams.hospital"
placeholder=""
v-model="locationId"
placeholder="请选择仓库药房"
multiple
clearable
style="width: 150px"
style="width: 260px"
@change="handleQuery"
>
<el-option
v-for="supplyStatus in supplyTypeOptions"
v-for="supplyStatus in locationIdList"
:key="supplyStatus.value"
:label="supplyStatus.label"
:value="supplyStatus.value"
:label="supplyStatus.name"
:value="supplyStatus.id"
/>
</el-select>
</el-form-item> -->
</el-form-item>
<el-form-item label="供应商:" prop="supplierId">
<el-select
v-model="supplierId"
placeholder="请选择供应商"
multiple
clearable
style="width: 260px"
@change="handleQuery"
>
<el-option
v-for="supplyStatus in supplierList"
:key="supplyStatus.value"
:label="supplyStatus.name"
:value="supplyStatus.id"
/>
</el-select>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<!-- 添加记录 -->
<!-- <el-col :span="1.5">
<el-button
type="primary"
plain
icon="Plus"
@click="openAddaddTransferProductDialog"
>备份</el-button
>
</el-col> -->
<el-col :span="1.5">
<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="danger" plain icon="Download" @click="handleExport"> 导出Excel </el-button>
</el-col>
</el-row>
<el-table
v-loading="loading"
@@ -141,17 +142,9 @@
max-height="600"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="50" align="center" />
<el-table-column type="index" width="50" align="center" />
<el-table-column label="序号" type="index" width="50" align="center" />
<el-table-column
label="药品类别"
align="center"
key="categoryCode_dictText"
prop="categoryCode_dictText"
:show-overflow-tooltip="true"
/>
<el-table-column
label="药品编码"
label="项目编码"
align="center"
key="busNo"
prop="busNo"
@@ -159,13 +152,31 @@
:show-overflow-tooltip="true"
/>
<el-table-column
label="药品名称"
label="项目名称"
align="center"
key="medicineName"
prop="medicineName"
key="itemName"
prop="itemName"
width="160"
:show-overflow-tooltip="true"
/>
<el-table-column
label="项目类别"
align="center"
key="medCategoryCode_dictText"
prop="medCategoryCode_dictText"
width="100"
:show-overflow-tooltip="true"
>
<template #default="scope">
<span>
{{
scope.row.itemTable == 'adm_device_definition'
? scope.row.devCategoryCode_dictText
: scope.row.medCategoryCode_dictText
}}
</span>
</template>
</el-table-column>
<el-table-column
label="仓库"
align="center"
@@ -178,15 +189,9 @@
align="center"
key="totalVolume"
prop="totalVolume"
width="120"
width="150"
:show-overflow-tooltip="true"
/>
<el-table-column
label="医保等级"
align="center"
key="chrgitmLv_enumText"
prop="chrgitmLv_enumText"
/>
<el-table-column
label="厂家/产地"
align="center"
@@ -204,34 +209,31 @@
:show-overflow-tooltip="true"
/>
<el-table-column
label="库存(采购单位)"
align="center"
label="库存(包装单位)"
align="right"
header-align="center"
key="quantityUnit"
prop="quantityUnit"
width="130px"
:show-overflow-tooltip="true"
/>
>
<template #default="scope">
<span>{{ formatQuantity(scope.row) }}</span>
</template>
</el-table-column>
<el-table-column
label="采购单位"
align="center"
key="unitCode_dictText"
prop="unitCode_dictText"
:show-overflow-tooltip="true"
/>
<el-table-column
label="库存数量"
align="center"
label="库存(最小单位"
align="right"
header-align="center"
key="quantity"
prop="quantity"
width="130px"
:show-overflow-tooltip="true"
/>
<el-table-column
label="库存单位"
align="center"
key="minUnitCode_dictText"
prop="minUnitCode_dictText"
:show-overflow-tooltip="true"
/>
>
<template #default="scope">
<span>{{ scope.row.quantity + ' ' + scope.row.minUnitCode_dictText }}</span>
</template>
</el-table-column>
<el-table-column
label="拆零比"
align="center"
@@ -241,50 +243,54 @@
/>
<el-table-column
label="采购价格"
align="center"
key="price"
prop="price"
:show-overflow-tooltip="true"
/>
<el-table-column
label="零售价"
align="center"
key="retailPrice"
prop="retailPrice"
:show-overflow-tooltip="true"
/>
<el-table-column
label="进价总额"
align="center"
key="totalPrice"
prop="totalPrice"
align="right"
header-align="center"
key="purchasePrice"
prop="purchasePrice"
width="100"
:show-overflow-tooltip="true"
>
<template #default="scope">
<span
:style="
scope.row.totalPrice == scope.row.totalSalePrice ? 'color: black' : 'color: red'
"
>{{ scope.row.totalPrice }}</span
>
<span>{{ scope.row.purchasePrice?.toFixed(2) + ' 元' }}</span>
</template>
</el-table-column>
<el-table-column
label="零售价"
align="right"
header-align="center"
key="salePrice"
prop="salePrice"
width="100"
:show-overflow-tooltip="true"
>
<template #default="scope">
<span>{{ scope.row.salePrice?.toFixed(2) + ' 元' }}</span>
</template>
</el-table-column>
<el-table-column
label="进价总额"
align="right"
header-align="center"
key="totalPurchasePrice"
prop="totalPurchasePrice"
width="100"
:show-overflow-tooltip="true"
>
<template #default="scope">
<span>{{ scope.row.totalPurchasePrice?.toFixed(2) + ' 元' }}</span>
</template>
</el-table-column>
<el-table-column
label="零售价总额"
align="center"
align="right"
header-align="center"
key="totalSalePrice"
prop="totalSalePrice"
width="100"
:show-overflow-tooltip="true"
>
<template #default="scope">
<span
:style="
scope.row.totalPrice == scope.row.totalSalePrice ? 'color: black' : 'color: red'
"
>{{ scope.row.totalSalePrice }}</span
>
<span>{{ scope.row.totalSalePrice?.toFixed(2) + ' 元' }}</span>
</template>
</el-table-column>
<el-table-column
@@ -293,7 +299,11 @@
key="doseFormCode_dictText"
prop="doseFormCode_dictText"
:show-overflow-tooltip="true"
/>
>
<template #default="scope">
<span>{{ scope.row.doseFormCode_dictText || '-' }}</span>
</template>
</el-table-column>
<el-table-column
label="国药准字"
align="center"
@@ -301,25 +311,35 @@
prop="approvalNumber"
width="165"
:show-overflow-tooltip="true"
/>
>
<template #default="scope">
<span>{{ scope.row.approvalNumber || '-' }}</span>
</template>
</el-table-column>
<el-table-column
label="供应商"
align="center"
key="supplyName"
prop="supplyName"
key="supplierName"
prop="supplierName"
width="170"
:show-overflow-tooltip="true"
/>
<el-table-column
label="医保等级"
align="center"
key="chrgitmLv_enumText"
prop="chrgitmLv_enumText"
/>
<el-table-column
label="生产日期"
align="center"
key="productionDate"
prop="productionDate"
width="160"
width="120"
:show-overflow-tooltip="true"
>
<template #default="scope">
<span>{{ parseTime(scope.row.productionDate) }}</span>
<span>{{ formatDateStr(scope.row.productionDate, 'YYYY-MM-DD') }}</span>
</template>
</el-table-column>
<el-table-column
@@ -327,21 +347,13 @@
align="center"
key="expirationDate"
prop="expirationDate"
width="160"
width="120"
:show-overflow-tooltip="true"
>
<template #default="scope">
<span>{{ parseTime(scope.row.expirationDate) }}</span>
<span>{{ formatDateStr(scope.row.expirationDate, 'YYYY-MM-DD') }}</span>
</template>
</el-table-column>
<el-table-column
label="拼音码"
align="center"
key="pyStr"
prop="pyStr"
width="110"
:show-overflow-tooltip="true"
/>
<el-table-column
label="剩余过期天数"
align="center"
@@ -350,21 +362,6 @@
width="110px"
:show-overflow-tooltip="true"
/>
<el-table-column
label="药品追溯码"
align="center"
key="traceNo"
prop="traceNo"
width="120px"
:show-overflow-tooltip="true"
/>
<el-table-column
label="药品停用"
align="center"
key="statusEnum_enumText"
prop="statusEnum_enumText"
:show-overflow-tooltip="true"
/>
<el-table-column
label="货位"
align="center"
@@ -372,13 +369,6 @@
prop="locationStoreName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="仓库类型"
align="center"
key="formEnum_enumText"
prop="formEnum_enumText"
:show-overflow-tooltip="true"
/>
<el-table-column
label="停供状态"
align="center"
@@ -386,22 +376,6 @@
prop="inventoryStatusEnum_enumText"
:show-overflow-tooltip="true"
/>
<el-table-column
label="追溯码入库数"
align="center"
key="inCount"
prop="inCount"
width="120px"
:show-overflow-tooltip="true"
/>
<el-table-column
label="追溯码出库数"
align="center"
key="outCount"
prop="outCount"
width="120px"
:show-overflow-tooltip="true"
/>
<el-table-column
label="操作"
align="center"
@@ -429,19 +403,15 @@
v-if="scope.row.inventoryStatusEnum == 3"
>取消停供</el-button
>
<el-button
link
type="primary"
icon="Edit"
@click="handleOpenPage(scope.row)"
<el-button link type="primary" icon="Edit" @click="handleOpenPage(scope.row)"
>追溯码</el-button
>
</template>
</el-table-column>
</el-table>
<div style="float: right; margin-top: 10px; margin-right: 10px">
<span class="descriptions-item-label">进价合计金额{{ salePriceTotal.toFixed(2) }}</span>
<span class="descriptions-item-label">零售价合计金额{{ priceTotal.toFixed(2) }}</span>
<span class="descriptions-item-label"> 进价合计金额{{ salePriceTotal.toFixed(4) }} </span>
<span class="descriptions-item-label"> 零售价合计金额{{ priceTotal.toFixed(4) }} </span>
</div>
<pagination
v-show="total > 0"
@@ -471,18 +441,25 @@ import {
getPharmacyCabinetList,
cancelSupply,
stopSupply,
productPageTotal
productPageTotal,
} from './statisticalManagent';
import Decimal from 'decimal.js';
import traceabilityCodeManagement from './traceabilityCodeManagement.vue';
import { formatDateStr } from '@/utils/index';
import { getSupplierList } from '@/api/public';
import { useStore } from '@/store/store';
const store = useStore();
const { proxy } = getCurrentInstance();
const { item_type, inventory_range } = proxy.useDict('item_type', 'inventory_range');
const { item_category_code, inventory_range } = proxy.useDict(
'item_category_code',
'inventory_range'
);
const purchaseinventoryList = ref([]);
const visible = ref(false);
const recordInfo = ref({});
const route = useRoute();
const loading = ref(true);
@@ -496,6 +473,9 @@ const supplyTypeOptions = ref(undefined);
const supplyStatusOptions = ref(undefined);
const chrgitmLv_enumTextOptions = ref([]);
const locationIdList = ref([]);
const supplierList = ref([]);
const locationId = ref([]);
const supplierId = ref([]);
const data = reactive({
form: {},
@@ -507,7 +487,7 @@ const data = reactive({
// hospital:undefined,
categoryCode: undefined,
chrgitmLv: undefined,
warehouseScope: undefined,
zeroFlag: undefined,
locationId: undefined,
// occurrenceTimeSTime:undefined,
// occurrenceTimeETime:undefined,
@@ -517,19 +497,38 @@ const data = reactive({
const { queryParams, form, rules } = toRefs(data);
watch(
() => store.remainingDays,
(newValue) => {
if (newValue) {
queryParams.value.remainingDays = newValue;
handleQuery(); // 触发查询
store.clearRemainingDays(); // 清除值
}
},
{ immediate: true } // 修正拼写错误
);
function getPharmacyCabinetLists() {
getPharmacyCabinetList().then((response) => {
locationIdList.value = response.data;
});
getSupplierList().then((response) => {
supplierList.value = response.data;
});
getInit().then((response) => {
chrgitmLv_enumTextOptions.value = response.data.chrgitmLvOptions;
});
}
/** 查询调拨管理项目列表 */
function getList() {
console.log(store.remainingDays, '1');
loading.value = true;
salePriceTotal.value = 0;
priceTotal.value = 0;
queryParams.value.locationIds = locationId.value.join(',');
queryParams.value.supplierIds = supplierId.value.join(',');
getproductReturnPage(queryParams.value).then((res) => {
loading.value = false;
purchaseinventoryList.value = res.data.records;
@@ -538,30 +537,14 @@ function getList() {
k.inventoryStatusEnum_enumText =
k.inventoryStatusEnum == 2 ? '未停供' : k.inventoryStatusEnum == 3 ? '已停供' : '';
k.quantityUnit = k.quantity / k.partPercent;
const integerPart1 = Math.floor(k.quantityUnit); // 获取整数部分
const decimalPart1 = k.quantityUnit - integerPart1; // 获取小数部分
if (decimalPart1) {
k.quantityUnit =
integerPart1 +
k.unitCode_dictText +
(decimalPart1 * k.partPercent).toFixed(0) +
k.minUnitCode_dictText;
}
k.price = k.price ? k.price.toFixed(2) : 0;
k.retailPrice = k.retailPrice ? k.retailPrice.toFixed(2) : 0;
k.totalPrice = k.price * (Number(k.quantity) / k.partPercent);
k.totalPrice = k.totalPrice ? k.totalPrice.toFixed(2) : 0;
k.totalSalePrice = k.retailPrice * (Number(k.quantity) / k.partPercent);
k.totalSalePrice = k.totalSalePrice ? k.totalSalePrice.toFixed(2) : 0;
});
}
total.value = res.data.total;
});
productPageTotal(queryParams.value).then((res) => {
salePriceTotal.value = res.data.totalPurchasePrice;
priceTotal.value = res.data.totalSalePrice;
})
salePriceTotal.value = res.data.purchasePriceStatistics;
priceTotal.value = res.data.salePriceStatistics;
});
}
/** 搜索按钮操作 */
@@ -578,6 +561,26 @@ function handleQuery() {
getList();
}
function formatQuantity(row) {
if (row.remainder > 0) {
return (
row.number + ' ' + row.unitCode_dictText + row.remainder + ' ' + row.minUnitCode_dictText
);
} else {
return row.number + ' ' + row.unitCode_dictText;
}
}
// 导出
function handleExport() {
proxy.downloadGet(
'/inventory-manage/product/excel-out',
{
...queryParams.value,
},
`库存明细记录_${proxy.formatDateStr(new Date(), 'YYYY-MM-DD')}.xlsx`
);
}
/** 清空条件按钮操作 */
function handleClear() {
// 清空查询条件
@@ -585,7 +588,7 @@ function handleClear() {
getList();
}
function handleOpenPage (row) {
function handleOpenPage(row) {
recordInfo.value = row;
visible.value = true;
}
@@ -611,14 +614,14 @@ function openAddaddTransferProductDialog() {
// 取消停供 停供
function handlestopcancelSupply(row) {
if (row.inventoryStatusEnum == 2) {
stopSupply(row.id).then((response) => {
stopSupply(row.inventoryId).then((response) => {
proxy.$modal.msgSuccess('停供成功');
open.value = false;
getList();
});
}
if (row.inventoryStatusEnum == 3) {
cancelSupply(row.id).then((response) => {
cancelSupply(row.inventoryId).then((response) => {
proxy.$modal.msgSuccess('取消停供成功');
open.value = false;
getList();
@@ -638,4 +641,4 @@ getPharmacyCabinetLists();
display: flex;
align-items: center;
}
</style>
</style>

View File

@@ -51,7 +51,7 @@
style="width: 150px"
>
<el-option
v-for="categoryCode in item_type"
v-for="categoryCode in item_category_code"
:key="categoryCode.value"
:label="categoryCode.label"
:value="categoryCode.value"
@@ -336,10 +336,10 @@ import { watch } from "vue";
const { proxy } = getCurrentInstance();
const route = useRoute();
const {
item_type,
item_category_code,
inventory_range,
} = proxy.useDict(
"item_type",
"item_category_code",
"inventory_range",
);

View File

@@ -41,7 +41,7 @@
style="width: 150px"
>
<el-option
v-for="categoryCode in item_type"
v-for="categoryCode in item_category_code"
:key="categoryCode.value"
:label="categoryCode.label"
:value="categoryCode.value"

View File

@@ -0,0 +1,140 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryRef" :inline="true" label-width="100px">
</el-form>
<el-table
v-loading="loading"
:data="medicationStockOutDetailsList"
@selection-change="handleSelectionChange"
height="calc(100vh - 300px)"
>
<el-table-column type="selection" width="50" align="center" />
<el-table-column
label="医疗机构代码"
align="center"
key="medicalInstitutionCode"
prop="medicalInstitutionCode"
width="220"
:show-overflow-tooltip="true"
/>
<!-- itemTable -->
<el-table-column
label="组织机构名称"
align="center"
key="organizationName"
prop="organizationName"
width="220"
:show-overflow-tooltip="true"
/>
<el-table-column
label="国家药品编码(YPID)"
align="center"
key="nationalMedicineCode"
prop="nationalMedicineCode"
width="220"
:show-overflow-tooltip="true"
/>
<el-table-column
label="院内药品唯一码"
align="center"
key="busNo"
prop="busNo"
width="220"
:show-overflow-tooltip="true"
/>
<el-table-column
label="省级药品集中采购平台药品编码"
align="center"
key="provincialMedicineConcentratedCode"
prop="provincialMedicineConcentratedCode"
width="220"
:show-overflow-tooltip="true"
/>
<el-table-column
label="产品名称"
align="center"
key="lotName"
prop="lotName"
width="220"
:show-overflow-tooltip="true"
/>
<el-table-column
label="出库数量(最小销售包装单位)"
align="center"
key="quantitySales"
prop="quantitySales"
:show-overflow-tooltip="true"
width="220"
/>
<el-table-column
label="出库数量(最小制剂单位)"
align="center"
key="quantityPreparation"
prop="quantityPreparation"
:show-overflow-tooltip="true"
width="220"
/>
</el-table>
<pagination
v-show="total > 0"
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script setup name="medicationStockOutDetails">
import {
getReportMedicationStockOutDetails,
} from './statisticalManagent';
const medicationStockOutDetailsList = ref([]);
const loading = ref(true);
const ids = ref([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const approvalTime = ref([]);
const supplierListOptions = ref([]);
const locationIdList = ref([]);
const data = reactive({
form: {},
queryParams: {
pageNo: 1,
pageSize: 10,
searchKey: undefined,
occurrenceTimeSTime: undefined,
occurrenceTimeETime: undefined,
},
rules: {},
});
const { queryParams, form, rules } = toRefs(data);
function getList() {
loading.value = true;
getReportMedicationStockOutDetails(queryParams.value).then((res) => {
loading.value = false;
medicationStockOutDetailsList.value = res.data.records;
total.value = res.data.total;
});
}
getList();
</script>
<style scoped>
.custom-tree-node {
display: flex;
align-items: center;
}
.title {
font-weight: bold;
font-size: large;
margin-bottom: 10px;
}
</style>

View File

@@ -0,0 +1,142 @@
<template>
<div class="app-container">
<el-table
v-loading="loading"
:data="medicationUsageList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="50" align="center" />
<el-table-column
label="医疗机构代码"
align="center"
key="orgId"
prop="orgId"
width="200"
:show-overflow-tooltip="true"
/>
<el-table-column
label="组织机构名称"
align="center"
key="orgName"
prop="orgName"
width="200"
:show-overflow-tooltip="true"
/>
<el-table-column
label="国家药品编码(YPID)"
align="center"
key="nationalDrugCode"
prop="ypCode"
width="200"
:show-overflow-tooltip="true"
/>
<el-table-column
label="院内药品唯一码"
align="center"
key="busNo"
prop="busNo"
width="200"
:show-overflow-tooltip="true"
/>
<el-table-column
label="省级药品集中采购平台药品编码"
align="center"
key="provincialDrugCode"
prop="provincialDrugCode"
width="220"
:show-overflow-tooltip="true"
/>
<el-table-column
label="产品名称"
align="center"
key="itemName"
prop="itemName"
width="200"
:show-overflow-tooltip="true"
/>
<el-table-column
label="销售总金额(元)"
align="center"
key="totalSalesPrice"
prop="totalSalesPrice"
width="200"
:show-overflow-tooltip="true"
/>
<el-table-column
label="销售数量(最小销售包装单位)"
align="center"
key="packageSalesQuantity"
prop="packageSalesQuantity"
width="200"
:show-overflow-tooltip="true"
/>
<el-table-column
label="销售数量(最小制剂单位)"
align="center"
key="dosageSalesQuantity"
prop="dosageSalesQuantity"
width="200"
:show-overflow-tooltip="true"
/>
</el-table>
<pagination
v-show="total > 0"
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script setup name="medicationUsageDetails">
import {
getReportMedicationUsage
} from './statisticalManagent';
const medicationUsageList = ref([]);
const loading = ref(true);
const ids = ref([]);
const total = ref(0);
const queryParams = ref({
pageNo: 1,
pageSize: 10,
});
/** 查询调拨管理项目列表 */
function getList() {
loading.value = true;
getReportMedicationUsage(queryParams.value).then((res) => {
loading.value = false;
medicationUsageList.value = res.data.records;
total.value = res.data.total;
})
}
/** 选择条数 */
function handleSelectionChange(selection) {
ids.value = selection.map((item) => item.id);
single.value = selection.length != 1;
multiple.value = !selection.length;
}
// 页面加载时获取数据
onMounted(() => {
getList();
});
</script>
<style scoped>
.custom-tree-node {
display: flex;
align-items: center;
}
.title {
font-weight: bold;
font-size: large;
margin-bottom: 10px;
}
</style>

View File

@@ -0,0 +1,185 @@
<template>
<div class="app-container">
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<!-- 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-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="Download" @click="handleExport">导出</el-button>
</el-col>
</el-row>
<el-table
v-loading="loading"
:data="nonWinQtyRatinoList"
@selection-change="handleSelectionChange"
height="calc(100vh - 300px)"
>
<el-table-column type="selection" width="50" align="center" />
<el-table-column
label="项目名称"
align="center"
key="itemName"
prop="itemName"
:show-overflow-tooltip="true"
width="110px"
/>
<el-table-column
label="医疗机构名称"
align="center"
key="orgName"
prop="orgName"
width="200px"
:show-overflow-tooltip="true"
/>
<!-- itemTable -->
<el-table-column
label="药品通用名"
align="center"
key="medName"
prop="medName"
width="140px"
:show-overflow-tooltip="true"
/>
<el-table-column
label="非中选产品采购数量(片袋支)"
align="center"
key="nonWinQty"
prop="nonWinQty"
width="250px"
:show-overflow-tooltip="true"
/>
<el-table-column
label="通用名药品采购数量(片袋支)"
align="center"
key="quantity"
prop="quantity"
width="250px"
:show-overflow-tooltip="true"
/>
<el-table-column
label="非中选产品采购金额(元)"
align="center"
key="nonWinAmt"
prop="nonWinAmt"
width="250px"
:show-overflow-tooltip="true"
/>
<el-table-column
label="通用名药品采购金额(元)"
align="center"
key="amount"
prop="amount"
width="250px"
:show-overflow-tooltip="true"
/>
</el-table>
<pagination
v-show="total > 0"
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script setup name="nonWinQtyRatio">
import {
getReportNonWinQtyRatio,
} from './statisticalManagent';
const { proxy } = getCurrentInstance();
const route = useRoute();
const nonWinQtyRatioList = ref([]);
const loading = ref(true);
const ids = ref([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const approvalTime = ref([]);
const supplierListOptions = ref([]);
const locationIdList = ref([]);
const data = reactive({
form: {},
queryParams: {
pageNo: 1,
pageSize: 10,
searchKey: undefined,
occurrenceTimeSTime: undefined,
occurrenceTimeETime: undefined,
},
rules: {},
});
const { queryParams, form, rules } = toRefs(data);
/** 导出按钮操作 */
function handleExport() {
proxy.$download.downloadGet(
'report-manage/inbound/excel-out',
{
...queryParams.value,
},
`dict_${new Date().getTime()}.xlsx`
);
}
/** 查询调拨管理项目列表 */
function getList() {
loading.value = true;
getReportNonWinQtyRatio(queryParams.value).then((res) => {
loading.value = false;
nonWinQtyRatioList.value = res.data.records;
total.value = res.data.total;
});
}
/** 搜索按钮操作 */
function handleQuery() {
queryParams.value.occurrenceTimeSTime =
approvalTime.value && approvalTime.value.length == 2 ? approvalTime.value[0] + ' 00:00:00' : '';
queryParams.value.occurrenceTimeETime =
approvalTime.value && approvalTime.value.length == 2 ? approvalTime.value[1] + ' 23:59:59' : '';
queryParams.value.pageNo = 1;
getList();
}
/** 清空条件按钮操作 */
function handleClear() {
// 清空查询条件
queryParams.value.occurrenceTimeSTime = '';
queryParams.value.occurrenceTimeETime = '';
approvalTime.value = '';
proxy.resetForm('queryRef');
getList();
}
/** 选择条数 */
function handleSelectionChange(selection) {
ids.value = selection.map((item) => item.id);
single.value = selection.length != 1;
multiple.value = !selection.length;
}
getList();
</script>
<style scoped>
.custom-tree-node {
display: flex;
align-items: center;
}
.title {
font-weight: bold;
font-size: large;
margin-bottom: 10px;
}
</style>

View File

@@ -0,0 +1,104 @@
<template>
<div class="app-container">
<el-table
v-loading="loading"
:data="offlinePurchaseRatioList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="50" align="center" />
<el-table-column
label="项目名称"
align="center"
key="itemName"
prop="itemName"
width="200"
:show-overflow-tooltip="true"
/>
<el-table-column
label="医疗机构名称"
align="center"
key="orgName"
prop="orgName"
width="200"
:show-overflow-tooltip="true"
/>
<el-table-column
label="实际药品采购金额(元)"
align="center"
key="actualDrugPurchasePrice"
prop="actualDrugPurchasePrice"
width="200"
:show-overflow-tooltip="true"
/>
<el-table-column
label="平台采购金额(元)"
align="center"
key="platformPurchasePrice"
prop="platformPurchasePrice"
width="200"
:show-overflow-tooltip="true"
/>
</el-table>
<pagination
v-show="total > 0"
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script setup name="offlinePurchaseRatioDetails">
import {
getReportOfflinePurchaseRatio
} from './statisticalManagent';
const offlinePurchaseRatioList = ref([]);
const loading = ref(true);
const ids = ref([]);
const total = ref(0);
const queryParams = ref({
pageNo: 1,
pageSize: 10,
searchKey: undefined,
occurrenceTimeSTime: undefined,
occurrenceTimeETime: undefined,
});
/** 查询调拨管理项目列表 */
function getList() {
loading.value = true;
getReportOfflinePurchaseRatio(queryParams.value).then((res) => {
loading.value = false;
offlinePurchaseRatioList.value = res.data.records;
total.value = res.data.total;
})
}
/** 选择条数 */
function handleSelectionChange(selection) {
ids.value = selection.map((item) => item.id);
single.value = selection.length != 1;
multiple.value = !selection.length;
}
// 页面加载时获取数据
onMounted(() => {
getList();
});
</script>
<style scoped>
.custom-tree-node {
display: flex;
align-items: center;
}
.title {
font-weight: bold;
font-size: large;
margin-bottom: 10px;
}
</style>

View File

@@ -1,11 +1,11 @@
<template>
<div busNo="app-container">
<el-form
style="margin-top:20px;margin-left:20px;"
:model="queryParams"
ref="queryRef"
:inline="true"
label-width="90px"
style="margin-top: 20px; margin-left: 20px"
:model="queryParams"
ref="queryRef"
:inline="true"
label-width="90px"
>
<el-form-item label="收费时间:">
<el-date-picker
@@ -61,12 +61,7 @@
/>
</el-form-item> -->
<el-form-item label="科室:" prop="departmentId">
<el-select
v-model="queryParams.departmentId"
placeholder=""
clearable
style="width: 150px"
>
<el-select v-model="queryParams.departmentId" placeholder="" clearable style="width: 150px">
<el-option
v-for="supplyStatus in getDepartmentOptions"
:key="supplyStatus.id"
@@ -76,12 +71,7 @@
</el-select>
</el-form-item>
<el-form-item label="开单人:" prop="issuerId">
<el-select
v-model="queryParams.issuerId"
placeholder=""
clearable
style="width: 150px"
>
<el-select v-model="queryParams.issuerId" placeholder="" clearable style="width: 150px">
<el-option
v-for="supplyStatus in issuerOptions"
:key="supplyStatus.id"
@@ -91,12 +81,7 @@
</el-select>
</el-form-item>
<el-form-item label="收费人:" prop="payeeId">
<el-select
v-model="queryParams.payeeId"
placeholder=""
clearable
style="width: 150px"
>
<el-select v-model="queryParams.payeeId" placeholder="" clearable style="width: 150px">
<el-option
v-for="supplyStatus in payeeOptions"
:key="supplyStatus.id"
@@ -104,17 +89,12 @@
:value="supplyStatus.id"
/>
</el-select>
</el-form-item>
</el-form-item>
<!-- 字典item_type -->
<el-form-item label="项目类型:" prop="clinicalType">
<el-select
v-model="queryParams.clinicalType"
placeholder=""
clearable
style="width: 150px"
>
<el-select v-model="queryParams.clinicalType" placeholder="" clearable style="width: 150px">
<el-option
v-for="supplyStatus in clinicalTypeOptions"
v-for="supplyStatus in clinicalTypeOptions"
:key="supplyStatus.value"
:label="supplyStatus.label"
:value="supplyStatus.value"
@@ -122,7 +102,11 @@
</el-select>
</el-form-item>
<!-- 医保号门诊号患者姓名项目名项目编码 -->
<el-form-item label="医保号/门诊号/患者姓名/项目名/项目编码:" prop="searchKey" label-width="295">
<el-form-item
label="医保号/门诊号/患者姓名/项目名/项目编码:"
prop="searchKey"
label-width="295"
>
<el-input
v-model="queryParams.searchKey"
placeholder="输入医保号/门诊号/患者姓名/项目名称/项目编码后回车查询"
@@ -133,50 +117,34 @@
</el-form-item>
</el-form>
<el-row :gutter="10" busNo="mb8" style="margin-left:20px;margin-right:0px;margin-bottom:5px">
<el-row
:gutter="10"
busNo="mb8"
style="margin-left: 20px; margin-right: 0px; margin-bottom: 5px"
>
<el-col :span="1.5">
<!-- v-hasPermi="['system:user:import']" -->
<el-button
type="primary"
plain
icon="Search"
@click="handleQuery"
>查询</el-button
>
<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="warning" plain icon="CircleClose" @click="handleClear">重置</el-button>
</el-col>
</el-row>
<el-table
style="padding:0 20px;width:100%;height:67vh"
style="padding: 0 20px; width: 100%; height: 67vh"
v-loading="loading"
:data="purchaseinventoryList"
@selection-change="handleSelectionChange"
:span-method="arraySpanMethod"
border
fit
:default-sort="{ prop: 'chargeTime', order: 'descending' }"
@header-click="handleHeaderClick"
show-summary
:summary-method="getSummaries"
>
<!-- :span-method="arraySpanMethod" -->
<!-- :summary-method="getSummaries"
<!-- :span-method="arraySpanMethod" -->
<!-- :summary-method="getSummaries"
show-summary 每页单独合计-->
<el-table-column type="selection" width="50px" align="center" resizable />
<el-table-column
label='门诊号'
label="门诊号"
align="center"
key="busNo"
min-width="150px"
@@ -197,7 +165,6 @@
align="center"
key="departmentName"
prop="departmentName"
min-width="120px"
:show-overflow-tooltip="true"
resizable
/>
@@ -210,7 +177,7 @@
:show-overflow-tooltip="true"
resizable
/>
<el-table-column
<el-table-column
label="医保号"
align="center"
key="ybCode"
@@ -219,13 +186,12 @@
:show-overflow-tooltip="true"
resizable
/>
<el-table-column
label="药品项目"
align="center"
key="clinicalName"
prop="clinicalName"
min-width="180px"
:show-overflow-tooltip="true"
resizable
/>
@@ -243,27 +209,23 @@
align="center"
key="type_dictText"
prop="type_dictText"
min-width="100px"
:show-overflow-tooltip="true"
resizable
/>
<el-table-column
label="开单人"
align="center"
key="issuerName"
prop="issuerName"
min-width="100px"
:show-overflow-tooltip="true"
resizable
/>
<el-table-column
<el-table-column
label="收费人"
align="center"
key="payeeName"
prop="payeeName"
min-width="100px"
:show-overflow-tooltip="true"
resizable
/>
@@ -281,7 +243,6 @@
align="center"
key="number"
prop="number"
min-width="80px"
:show-overflow-tooltip="true"
resizable
/>
@@ -290,7 +251,6 @@
align="center"
key="price"
prop="price"
min-width="100px"
:show-overflow-tooltip="true"
resizable
>
@@ -303,25 +263,20 @@
align="center"
key="totalPrice"
prop="totalPrice"
min-width="100px"
:show-overflow-tooltip="true"
resizable
/>
/>
<el-table-column
label="医保等级"
align="center"
key="chrgitmLv_enumText"
prop="chrgitmLv_enumText"
min-width="100px"
:show-overflow-tooltip="true"
resizable
/>
/>
<el-table-column
label="收费时间"
align="center"
key="chargeTime"
prop="chargeTime"
min-width="160px"
:show-overflow-tooltip="true"
resizable
>
@@ -345,7 +300,9 @@
display: flex;
align-items: center;
justify-content: flex-start;
margin-left:0px;margin-right:0px;padding:0 20px;
margin-left: 0px;
margin-right: 0px;
padding: 0 20px;
"
>
<el-col :span="3">
@@ -361,29 +318,28 @@ import {
getAmbPractitionerDetail,
// getMedicationDetailsInit,
getDepartmentList,
getReportChargeInit
} from "./statisticalManagent";
import useUserStore from "@/store/modules/user";
import { watch } from "vue";
import { parseTime } from '@/utils/his'; // 导入日期时间处理工具函数
getReportChargeInit,
} from './statisticalManagent';
import useUserStore from '@/store/modules/user';
import { watch } from 'vue';
const userStore = useUserStore();
const router = useRouter();
const { proxy } = getCurrentInstance();
const totalAmount = ref(0);
// const {
// item_type,
// item_category_code,
// hosp_lv
// } = proxy.useDict(
// "item_type",
// "item_category_code",
// "hosp_lv"
// );
const purchaseinventoryListAll = ref([])
const xiaojiTotal = ref([])
const rowSpan = ref(1)
const issuerOptions = ref([])
const payeeOptions = ref([])
const inventoryOptions = ref([])
const purchaseinventoryListAll = ref([]);
const xiaojiTotal = ref([]);
const rowSpan = ref(1);
const issuerOptions = ref([]);
const payeeOptions = ref([]);
const inventoryOptions = ref([]);
const clinicalTypeOptions = ref([]);
const purchaseinventoryList = ref([]);
const loading = ref(true);
@@ -392,7 +348,7 @@ const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const occurrenceTime = ref([]);
const getDepartmentOptions = ref([])
const getDepartmentOptions = ref([]);
// const queryParams.value.statisticsType = ref(1)
const data = reactive({
@@ -400,18 +356,18 @@ const data = reactive({
queryParams: {
pageNo: 1,
pageSize: 10,
statisticsType: 1,
searchKey:undefined,
// ybCode: undefined,
// busNo:undefined,
statisticsType: 1,
searchKey: undefined,
// ybCode: undefined,
// busNo:undefined,
// name: undefined,
departmentId:undefined,
issuerId:undefined,
payeeId: undefined,
clinicalType:undefined,
departmentId: undefined,
issuerId: undefined,
payeeId: undefined,
clinicalType: undefined,
// clinicalName:undefined,
chargeTimeSTime:undefined,
chargeTimeETime:undefined,
chargeTimeSTime: undefined,
chargeTimeETime: undefined,
},
rules: {},
});
@@ -420,8 +376,8 @@ const { queryParams, form, rules } = toRefs(data);
watch(
() => purchaseinventoryList.value,
(newVlaue) => {
if(newVlaue&&newVlaue.length>0){
handleTotalAmount()
if (newVlaue && newVlaue.length > 0) {
handleTotalAmount();
}
},
{ immediate: true }
@@ -429,71 +385,96 @@ watch(
watch(
() => queryParams.value.statisticsType,
(newVlaue) => {
queryParams.value.statisticsType = newVlaue
queryParams.value.statisticsType = newVlaue;
},
{ immediate: true }
);
/**计算合计金额 */
function handleTotalAmount() {
totalAmount.value = purchaseinventoryList.value.reduce(
(accumulator, currentRow) => {
return (accumulator + (Number(currentRow.totalPrice) || 0))
},
0
);
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)
// let totalReturnPriceSums = Number(purchaseinventoryList.value[i].refundPrice)
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)
// totalReturnPriceSums += Number(purchaseinventoryList.value[i-j].refundPrice)
}
}
xiaojiTotal.value.push({inde:i+1,busNo:row.busNo,genderEnum_enumText:row.genderEnum_enumText,totalPrice:totalPriceSums.toFixed(2)||0.00})
// var totalPrice2 = 0
// var refundPrice2 = 0
purchaseinventoryList.value.splice(i+1, 0, {busNo:row.busNo,genderEnum_enumText:row.genderEnum_enumText,departmentName:'小计',totalPrice:totalPriceSums.toFixed(2)||0.00})
// purchaseinventoryList.value.map(k=>{
// if(k.departmentName!='小计'){
// totalPrice2 += Number(k.totalPrice)
// refundPrice2 += Number(k.refundPrice)
// }
// })
// totalPrice2 = totalPrice2?totalPrice2.toFixed(4):totalPrice2
// refundPrice2 = refundPrice2?refundPrice2.toFixed(4):refundPrice2
// purchaseinventoryList.value.push({departmentName:'合计',totalPrice:totalPrice2,refundPrice:refundPrice2})
}
// 行合并方法 - 简化实现,避免在合并过程中修改数组
const arraySpanMethod = ({row, column, rowIndex, columnIndex}) => {
// 跳过小计行和合计行的合并处理
if (row.departmentName === '小计' || row.departmentName === '合计') {
return { rowspan: 1, colspan: 1 };
}
// 只合并门诊号列(索引1)
if (columnIndex === 1) {
// 查找当前门诊号的起始位置
let startIndex = rowIndex;
while (startIndex > 0) {
const prevRow = purchaseinventoryList.value[startIndex - 1];
// 如果前一行是小计行或者门诊号不同,当前行就是起始行
if (prevRow.departmentName === '小计' || prevRow.busNo !== row.busNo) {
break;
}
startIndex--;
function getTotals(row, i) {
let totalPriceSums = Number(purchaseinventoryList.value[i].totalPrice);
// let totalReturnPriceSums = Number(purchaseinventoryList.value[i].refundPrice)
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);
// totalReturnPriceSums += Number(purchaseinventoryList.value[i-j].refundPrice)
}
// 如果当前行是门诊号的起始行
if (startIndex === rowIndex) {
}
xiaojiTotal.value.push({
inde: i + 1,
busNo: row.busNo,
genderEnum_enumText: row.genderEnum_enumText,
totalPrice: totalPriceSums.toFixed(4) || 0.0,
});
// var totalPrice2 = 0
// var refundPrice2 = 0
purchaseinventoryList.value.splice(i + 1, 0, {
busNo: row.busNo,
genderEnum_enumText: row.genderEnum_enumText,
departmentName: '小计',
totalPrice: totalPriceSums.toFixed(4) || 0.0,
});
// purchaseinventoryList.value.map(k=>{
// if(k.departmentName!='小计'){
// totalPrice2 += Number(k.totalPrice)
// refundPrice2 += Number(k.refundPrice)
// }
// })
// totalPrice2 = totalPrice2?totalPrice2.toFixed(4):totalPrice2
// refundPrice2 = refundPrice2?refundPrice2.toFixed(4):refundPrice2
// purchaseinventoryList.value.push({departmentName:'合计',totalPrice:totalPrice2,refundPrice:refundPrice2})
}
const arraySpanMethod = ({ row, column, rowIndex, columnIndex }) => {
// 合并一样的列住院号 outpatientNumber属性&&(queryParams.value.statisticsType==1||queryParams.value.statisticsType==4||queryParams.value.statisticsType==6)
if (columnIndex === 1 && purchaseinventoryList.value.length > 0) {
if (
rowIndex === 0 ||
(rowIndex > 0 && row.busNo !== purchaseinventoryList.value[rowIndex - 1]?.busNo)
) {
let rowspan = 1;
// 计算门诊号相同的连续行数
for (let i = rowIndex + 1; i < purchaseinventoryList.value.length; i++) {
const nextRow = purchaseinventoryList.value[i];
// 如果下一行是小计行或者门诊号不同,停止计数
if (nextRow.departmentName === '小计' || nextRow.busNo !== row.busNo) {
break;
let totalPriceSum = 0;
// let totalReturnPriceSum = 0
for (let i = rowIndex + 1; i < purchaseinventoryList.value.length + 1; i++) {
if (purchaseinventoryList.value[i - 1].departmentName != '合计') {
if (
purchaseinventoryList.value[i] &&
purchaseinventoryList.value[i].busNo === row.busNo
) {
rowspan++;
totalPriceSum += Number(purchaseinventoryList.value[i].totalPrice);
// totalReturnPriceSum += Number(purchaseinventoryList.value[i].refundPrice)
if (i == purchaseinventoryList.value.length - 1) {
let findIndexTotal = xiaojiTotal.value.findIndex((k) => k.busNo == row.busNo);
if (findIndexTotal < 0) {
getTotals(row, i);
}
} else {
}
} else {
totalPriceSum += Number(row.totalPrice);
// totalReturnPriceSum += Number(row.refundPrice)
let findIndexTotal = xiaojiTotal.value.findIndex((k) => k.busNo == row.busNo);
if (findIndexTotal < 0) {
xiaojiTotal.value.push({
inde: i,
genderEnum_enumText: row.genderEnum_enumText,
busNo: row.busNo,
totalPrice: totalPriceSum,
});
purchaseinventoryList.value.splice(i, 0, {
busNo: row.busNo,
genderEnum_enumText: row.genderEnum_enumText,
departmentName: '小计',
totalPrice: totalPriceSum.toFixed(4) || 0.0,
});
// console.log(purchaseinventoryList.value,"12121")
}
break;
}
}
rowspan++;
}
@@ -502,59 +483,74 @@ const arraySpanMethod = ({row, column, rowIndex, columnIndex}) => {
// 非起始行不显示
return { rowspan: 0, colspan: 0 };
}
// }else{ // 姓名列patientName
// if (columnIndex ===2&&purchaseinventoryList.value.length>0) {
// if (rowIndex === 0 || (rowIndex > 0 && row.name !== purchaseinventoryList.value[rowIndex - 1]?.name)) {
// let rowspan = 1;
// for (let i = rowIndex + 1; i < purchaseinventoryList.value.length; i++) {
// if (purchaseinventoryList.value[i].name === row.name) {
// rowspan++;
// } else {
// break;
// }
// }
// return { rowspan:rowspan, colspan: 1 };
// } else {
// return { rowspan: 0, colspan: 0 };
// }
// }
}
}
};
const getSummaries = (param) => {
const { columns, data } = param
const sums = []
const { columns, data } = param;
const sums = [];
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = h('div', { style: { textDecoration: 'underline' } }, [
'合计',
])
return
sums[index] = h('div', { style: { textDecoration: 'underline' } }, ['合计']);
return;
}
const values = data.map((item) => (item.departmentName!='小计'&&Number(item[column.property])))
if (column.property=='totalPrice') {
const values = data.map(
(item) => item.departmentName != '小计' && Number(item[column.property])
);
if (column.property == 'totalPrice') {
sums[index] = `${values.reduce((prev, curr) => {
const value = Number(curr)
if (!Number.isNaN(value)) {
return (Number(prev) + Number(curr)).toFixed(2) || 0.00
} else {
return Number(prev)
}
}, 0.00)}`
const value = Number(curr);
if (!Number.isNaN(value)) {
return (Number(prev) + Number(curr)).toFixed(4) || 0.0;
} else {
return Number(prev);
}
}, 0.0)}`;
} else {
sums[index] = ' '
sums[index] = ' ';
}
})
return sums
}
});
return sums;
};
function inventoryChange(val){
queryParams.value.statisticsType = val
xiaojiTotal.value = []
purchaseinventoryList.value = []
getList()
function inventoryChange(val) {
queryParams.value.statisticsType = val;
xiaojiTotal.value = [];
purchaseinventoryList.value = [];
getList();
}
function getPharmacyCabinetLists() {
getReportChargeInit().then((response)=>{
inventoryOptions.value = response.data.statisticsTypeOptions
queryParams.value.statisticsType = 1
issuerOptions.value = response.data.issuerOptions
payeeOptions.value = response.data.payeeOptions
clinicalTypeOptions.value = response.data.clinicalTypeOptions
})
getReportChargeInit().then((response) => {
inventoryOptions.value = response.data.statisticsTypeOptions;
queryParams.value.statisticsType = 1;
issuerOptions.value = response.data.issuerOptions;
payeeOptions.value = response.data.payeeOptions;
clinicalTypeOptions.value = response.data.clinicalTypeOptions;
});
getDepartmentList().then((response) => {
getDepartmentOptions.value = response.data // 科室
})
getDepartmentOptions.value = response.data; // 科室
});
}
/** 查询调拨管理项目列表 */
function getList(type) {
if(type){
xiaojiTotal.value = []
purchaseinventoryList.value = []
function getList(type) {
if (type) {
xiaojiTotal.value = [];
purchaseinventoryList.value = [];
}
loading.value = true;
// purchaseinventoryList.value = [
@@ -570,7 +566,7 @@ function getList(type) {
// {busNo:'M2505070009100307',name:"赵六",departmentName:'CF2505070009101368',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:'旧系统批量'},
// {busNo:'M2505070009100307',name:"赵六",departmentName:'CF2505070009101369',birthDate:'2025-05-07 16:28',practitionerName:'张三',practitionerName:'王东收费',clinicalName:'布洛芬缓释胶囊',busNo:'yp3065',medicalName:'布洛芬缓释胶囊',ybNo:'XC10AXY097A0010',totalVolume:'0.3g*24',salePrice:'2.8',price:'2.8',totalPrice:'2.8',number:'1盒',totalPrice:'2.8',refundQuantity:'0.00盒',refundPrice:'0.00',lotNumber:'72240709',manufacturerText:'上海信谊天平药业有限公司',supplierName:'旧系统批量'},
// ]
var totalPrice2 = 0
var totalPrice2 = 0;
// var refundPrice2 = 0
// var purchaseinventoryLists = []
// var purchaseinventoryListsArray = []
@@ -581,111 +577,139 @@ function getList(type) {
// purchaseinventoryLists.map(p=>{
// purchaseinventoryListsArray = [...purchaseinventoryListsArray, ...p.reportPageItemDto]
// // purchaseinventoryList.value.concat(p.reportPageItemDto)
// })
// })
// }
// purchaseinventoryList.value = purchaseinventoryListsArray
purchaseinventoryList.value = res.data.records||[]
total.value = res.data.total
purchaseinventoryList.value.map(k=>{
k.totalPrice = k.totalPrice?k.totalPrice.toFixed(2):'0.00'
// 优先使用price其次使用salePrice
k.price = k.price ? k.price.toFixed(2) : (k.salePrice ? k.salePrice.toFixed(2) : '0.00')
// 如果没有chargeTime尝试使用createTime作为替代
if (!k.chargeTime && k.createTime) {
k.chargeTime = k.createTime;
}
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.refundPrice = k.refundPrice || '0.00'
k.number = k.number ? (k.number + (k.quantityUnit_dictText || '')) : ('0.00' + (k.quantityUnit_dictText || ''))
k.number = k.number
? k.number + (k.quantityUnit_dictText ? k.quantityUnit_dictText : '')
: '0.0000' + k.quantityUnit_dictText
? k.quantityUnit_dictText
: '';
// k.refundQuantity = k.refundQuantity?(k.refundQuantity+k.refundUnitCode_dictText):('0.00'+ k.quantityUnit_dictText)
if(total.value&&total.value<=queryParams.value.pageSize){
totalPrice2 += Number(k.totalPrice)
// refundPrice2 += Number(k.refundPrice)
if (total.value && total.value <= queryParams.value.pageSize) {
totalPrice2 += Number(k.totalPrice);
// refundPrice2 += Number(k.refundPrice)
}
})
if(total.value<=res.data.size){
});
if (total.value <= res.data.size) {
loading.value = false;
}
// 1页数据不再手动添加合计行使用表格的show-summary功能
// 1页数据
if (total.value && total.value <= queryParams.value.pageSize) {
totalPrice2 = totalPrice2 ? totalPrice2.toFixed(4) : totalPrice2;
// refundPrice2 = refundPrice2?refundPrice2.toFixed(4):refundPrice2
let pageNoAll = total.value / queryParams.value.pageSize;
if (Math.ceil(pageNoAll) == queryParams.value.pageNo) {
purchaseinventoryList.value.push({ departmentName: '合计', totalPrice: totalPrice2 });
}
}
// 带分页数据
if(total.value&&total.value>queryParams.value.pageSize){
if (total.value && total.value > queryParams.value.pageSize) {
// var purchaseinventoryListsAll = []
// var purchaseinventoryListsArrayAll = []
let queryParamsValue = {...queryParams.value}
queryParamsValue.pageSize = total.value
queryParamsValue.pageNo = 1
let queryParamsValue = { ...queryParams.value };
queryParamsValue.pageSize = total.value;
queryParamsValue.pageNo = 1;
getReportChargePage(queryParamsValue).then((res) => {
// purchaseinventoryListsAll = res.data.records||[]
// if(purchaseinventoryListsAll.length>0){
// purchaseinventoryListsAll.map(p=>{
// purchaseinventoryListsArrayAll = [...purchaseinventoryListsArrayAll, ...p.reportPageItemDto]
// // purchaseinventoryList.value.concat(p.reportPageItemDto)
// })
// })
// }
// purchaseinventoryListAll.value = purchaseinventoryListsArrayAll
purchaseinventoryListAll.value = res.data.records||[]
if(purchaseinventoryListAll.value.length>0){
purchaseinventoryListAll.value.map((k,index)=>{
k.totalPrice = k.totalPrice?k.totalPrice.toFixed(2):'0.00'
// 优先使用price其次使用salePrice
k.price = k.price ? k.price.toFixed(2) : (k.salePrice ? k.salePrice.toFixed(2) : '0.00')
// 如果没有chargeTime尝试使用createTime作为替代
if (!k.chargeTime && k.createTime) {
k.chargeTime = k.createTime;
}
purchaseinventoryListAll.value = res.data.records || [];
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';
// k.refundPrice = k.refundPrice || '0.00'
k.number = k.number ? (k.number + (k.quantityUnit_dictText || '')) : ('0.00' + (k.quantityUnit_dictText || ''))
k.number = k.number
? k.number + k.quantityUnit_dictText
? k.quantityUnit_dictText
: ''
: '0.0000' + k.quantityUnit_dictText
? k.quantityUnit_dictText
: '';
// k.refundQuantity = k.refundQuantity?(k.refundQuantity+k.refundUnitCode_dictText):('0.00'+ k.quantityUnit_dictText)
totalPrice2 += Number(k.totalPrice)
totalPrice2 += Number(k.totalPrice);
// refundPrice2 += Number(k.refundPrice)
//处理不同页门诊号相同小计在最后回显问题start
// m<queryParams.value.pageSize&&
for(let m = 1;m<index;m++){
if (queryParams.value.pageNo>1&&index == (queryParams.value.pageSize*(queryParams.value.pageNo-1))&&
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
) {
// purchaseinventoryList.value.unshift(purchaseinventoryListAll.value[index-m]) // 加
// //修改计算的小计缺少加过来的部分
let dispenseNoIndex1 = purchaseinventoryList.value.findIndex(o=>o.departmentName=='小计'&&o.busNo==purchaseinventoryListAll.value[index-m].busNo)
if(dispenseNoIndex1>0){
purchaseinventoryList.value[dispenseNoIndex1].totalPrice = Number(purchaseinventoryList.value[dispenseNoIndex1].totalPrice)+Number(purchaseinventoryListAll.value[index-m].totalPrice)
purchaseinventoryList.value[dispenseNoIndex1].totalPrice = purchaseinventoryList.value[dispenseNoIndex1].totalPrice?purchaseinventoryList.value[dispenseNoIndex1].totalPrice.toFixed(2):'0.00'
// purchaseinventoryList.value.unshift(purchaseinventoryListAll.value[index-m]) // 加
// //修改计算的小计缺少加过来的部分
let dispenseNoIndex1 = purchaseinventoryList.value.findIndex(
(o) =>
o.departmentName == '小计' &&
o.busNo == purchaseinventoryListAll.value[index - m].busNo
);
if (dispenseNoIndex1 > 0) {
purchaseinventoryList.value[dispenseNoIndex1].totalPrice =
Number(purchaseinventoryList.value[dispenseNoIndex1].totalPrice) +
Number(purchaseinventoryListAll.value[index - m].totalPrice);
purchaseinventoryList.value[dispenseNoIndex1].totalPrice = purchaseinventoryList
.value[dispenseNoIndex1].totalPrice
? purchaseinventoryList.value[dispenseNoIndex1].totalPrice.toFixed(4)
: '0.0000';
}
}
if ((index+m) == (queryParams.value.pageSize*queryParams.value.pageNo)&& k.busNo == purchaseinventoryListAll.value[index + m]?.busNo) {
if(purchaseinventoryList.value[purchaseinventoryList.value.length-1].departmentName=='小计'){
purchaseinventoryList.value.splice(purchaseinventoryList.value.length-1,1) // 减掉第二页还有相同门诊号的第一页的小计
if (
index + m == queryParams.value.pageSize * queryParams.value.pageNo &&
k.busNo == purchaseinventoryListAll.value[index + m]?.busNo
) {
if (
purchaseinventoryList.value[purchaseinventoryList.value.length - 1]
.departmentName == '小计'
) {
purchaseinventoryList.value.splice(purchaseinventoryList.value.length - 1, 1); // 减掉第二页还有相同门诊号的第一页的小计
}
// let dispenseNoIndex = purchaseinventoryList.value.findIndex(o=>o.paymentId==k.paymentId&&o.chargeId==k.chargeId) //通过唯一主键进行区分
// purchaseinventoryList.value.splice(dispenseNoIndex,1) // 减
// if(purchaseinventoryList.value[dispenseNoIndex-1]&&purchaseinventoryList.value[dispenseNoIndex-1].departmentName=='小计'){
// purchaseinventoryList.value.splice(dispenseNoIndex+1,1) // 减掉带小计的
// }
}
}
}
// end
})
totalPrice2 = totalPrice2?totalPrice2.toFixed(4):totalPrice2
});
totalPrice2 = totalPrice2 ? totalPrice2.toFixed(4) : totalPrice2;
// refundPrice2 = refundPrice2?refundPrice2.toFixed(4):refundPrice2
loading.value = false;
// 不再手动添加合计行使用表格的show-summary功能
let pageNoAll = total.value / queryParams.value.pageSize;
if (Math.ceil(pageNoAll) == queryParams.value.pageNo) {
purchaseinventoryList.value.push({ departmentName: '合计', totalPrice: totalPrice2 });
}
}
})
});
}
});
}
/** 搜索按钮操作 */
function handleQuery() {
queryParams.value.chargeTimeSTime =
occurrenceTime.value && occurrenceTime.value.length == 2
? occurrenceTime.value[0] + " 00:00:00"
: "";
? occurrenceTime.value[0] + ' 00:00:00'
: '';
queryParams.value.chargeTimeETime =
occurrenceTime.value && occurrenceTime.value.length == 2
? occurrenceTime.value[1] + " 23:59:59"
: "";
? occurrenceTime.value[1] + ' 23:59:59'
: '';
queryParams.value.pageNo = 1;
getList(1);
}
@@ -693,10 +717,10 @@ function handleQuery() {
/** 清空条件按钮操作 */
function handleClear() {
// 清空查询条件
occurrenceTime.value = ""
queryParams.value.chargeTimeSTime = ""
queryParams.value.chargeTimeETime = ""
proxy.resetForm("queryRef");
occurrenceTime.value = '';
queryParams.value.chargeTimeSTime = '';
queryParams.value.chargeTimeETime = '';
proxy.resetForm('queryRef');
getList(1);
}
@@ -707,54 +731,36 @@ function handleSelectionChange(selection) {
multiple.value = !selection.length;
}
// 表头点击事件,用于实现更灵活的列操作
function handleHeaderClick(column) {
// 可以在这里添加额外的表头操作逻辑
// 例如:根据列内容自动调整宽度
if (column.property) {
autoFitColumnWidth(column.property);
}
// 初始化日期范围为当前月第一天到今天
function initDefaultDateRange() {
const now = new Date();
const year = now.getFullYear();
const month = now.getMonth();
// 当前月第一天
const firstDay = new Date(year, month, 1);
// 今天
const today = now;
// 格式化为YYYY-MM-DD格式
const formatDate = (date) => {
const y = date.getFullYear();
const m = String(date.getMonth() + 1).padStart(2, '0');
const d = String(date.getDate()).padStart(2, '0');
return `${y}-${m}-${d}`;
};
occurrenceTime.value = [formatDate(firstDay), formatDate(today)];
// 同时设置到queryParams中确保首次加载时传递时间参数
queryParams.value.chargeTimeSTime = occurrenceTime.value[0] + ' 00:00:00';
queryParams.value.chargeTimeETime = occurrenceTime.value[1] + ' 23:59:59';
}
// 根据内容自动调整列宽
function autoFitColumnWidth(property) {
// 实际项目中可以根据需要实现更复杂的自动宽度计算逻辑
// 这里提供一个简单的实现方式
const table = document.querySelector('.el-table__body-wrapper table');
if (table) {
const rows = table.querySelectorAll('tbody tr');
let maxWidth = 100; // 默认最小宽度
rows.forEach(row => {
const cell = Array.from(row.cells).find((cell, index) => {
const headerCell = table.querySelector(`thead th:nth-child(${index + 1})`);
return headerCell && headerCell.dataset.property === property;
});
if (cell) {
const textWidth = cell.textContent.length * 8; // 粗略估算文本宽度
maxWidth = Math.max(maxWidth, textWidth);
}
});
// 应用计算出的宽度(可以根据实际需要调整)
// 注意在实际Element Plus中可能需要通过ref获取表格实例并调用API来设置列宽
}
}
/** 跳转到患者档案管理页面 */
function handleArchive(row) {
// 跳转到患者档案管理页面并传递busNo参数
proxy.$router.push({
path: '/system/basicmanage/patientmanagement',
query: { searchKey: row.busNo }
});
}
// 初始化页面
getPharmacyCabinetLists();
initDefaultDateRange();
getList();
getPharmacyCabinetLists()
</script>
<style scoped>
.custom-tree-node {
@@ -762,7 +768,7 @@ getPharmacyCabinetLists()
align-items: center;
}
.pagination-container{
margin-right: 20px;
.pagination-container {
margin-right: 20px;
}
</style>
</style>

View File

@@ -0,0 +1,169 @@
<template>
<div class="app-container">
<el-table
v-loading="loading"
:data="patientDetailsList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="50" align="center" />
<el-table-column
label="门诊住院号"
align="center"
key="encounterBusNo"
prop="encounterBusNo"
width="200"
:show-overflow-tooltip="true"
/>
<el-table-column
label="药品通用名"
align="center"
key="medName"
prop="medName"
width="140"
:show-overflow-tooltip="true"
/>
<el-table-column
label="药品医保编码"
align="center"
key="medYbNo"
prop="medYbNo"
width="200"
:show-overflow-tooltip="true"
/>
<el-table-column
label="药品类别"
align="center"
key="categoryCode_dictText"
prop="categoryCode_dictText"
width="200"
:show-overflow-tooltip="true"
/>
<el-table-column
label="剂型"
align="center"
key="doseFormCode_dictText"
prop="doseFormCode_dictText"
width="140px"
:show-overflow-tooltip="true"
/>
<el-table-column
label="规格"
align="center"
key="totalVolume"
prop="totalVolume"
width="140"
:show-overflow-tooltip="true"
/>
<el-table-column
label="计价单位"
align="center"
key="unitCode_dictText"
prop="unitCode_dictText"
width="160"
:show-overflow-tooltip="true"
/>
<el-table-column
label="是否中选产品"
align="center"
key="isSelected"
prop="isSelected"
width="140"
:show-overflow-tooltip="true"
/>
<el-table-column
label="生产企业"
align="center"
key="manufacturerText"
prop="manufacturerText"
width="100"
:show-overflow-tooltip="true"
/>
<el-table-column
label="单价(元)"
align="center"
key="price"
prop="price"
width="200"
:show-overflow-tooltip="true"
/>
<el-table-column
label="使用数量(片袋支)"
align="center"
key="quantity"
prop="quantity"
width="200"
:show-overflow-tooltip="true"
/>
<el-table-column
label="使用总金额(元)"
align="center"
key="totalPrice"
prop="totalPrice"
width="200"
:show-overflow-tooltip="true"
/>
</el-table>
<pagination
v-show="total > 0"
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script setup name="patientDetails">
import {
getReportPatientDetails
} from './statisticalManagent';
const patientDetailsList = ref([]);
const loading = ref(true);
const ids = ref([]);
const total = ref(0);
const queryParams = ref({
pageNo: 1,
pageSize: 10,
searchKey: undefined,
occurrenceTimeSTime: undefined,
occurrenceTimeETime: undefined,
});
/** 查询调拨管理项目列表 */
function getList() {
loading.value = true;
getReportPatientDetails(queryParams.value).then((res) => {
loading.value = false;
patientDetailsList.value = res.data.records;
total.value = res.data.total;
})
}
/** 选择条数 */
function handleSelectionChange(selection) {
ids.value = selection.map((item) => item.id);
single.value = selection.length != 1;
multiple.value = !selection.length;
}
// 页面加载时获取数据
onMounted(() => {
getList();
});
</script>
<style scoped>
.custom-tree-node {
display: flex;
align-items: center;
}
.title {
font-weight: bold;
font-size: large;
margin-bottom: 10px;
}
</style>

View File

@@ -0,0 +1,189 @@
<template>
<div class="app-container">
<el-table
v-loading="loading"
:data="patientMasterList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="50" align="center" />
<el-table-column
label="门诊住院号"
align="center"
key="encounterBusNo"
prop="encounterBusNo"
width="200"
:show-overflow-tooltip="true"
/>
<el-table-column
label="患者姓名"
align="center"
key="patientName"
prop="patientName"
width="140"
:show-overflow-tooltip="true"
/>
<el-table-column
label="身份证号"
align="center"
key="idCard"
prop="idCard"
width="200"
:show-overflow-tooltip="true"
/>
<el-table-column
label="人员编码"
align="center"
key="psnNo"
prop="psnNo"
width="200"
:show-overflow-tooltip="true"
/>
<el-table-column
label="参保地区"
align="center"
key="insuPlcNo"
prop="insuPlcNo"
width="140px"
:show-overflow-tooltip="true"
/>
<el-table-column
label="参保类型"
align="center"
key="ybType"
prop="ybType"
width="140"
:show-overflow-tooltip="true"
/>
<el-table-column
label="入院时间"
align="center"
key="encounterStartTime"
prop="encounterStartTime"
width="160"
:show-overflow-tooltip="true"
>
<template #default="scope">
<span>{{ parseTime(scope.row.occurrenceTime) }}</span>
</template>
</el-table-column>
<el-table-column
label="出院时间"
align="center"
key="encounterEndTime"
prop="encounterEndTime"
width="160"
:show-overflow-tooltip="true"
>
<template #default="scope">
<span>{{ parseTime(scope.row.approvalTime) }}</span>
</template>
</el-table-column>
<el-table-column
label="处方日期"
align="center"
key="issueTime"
prop="issueTime"
width="160"
:show-overflow-tooltip="true"
>
<template #default="scope">
<span>{{ parseTime(scope.row.approvalTime) }}</span>
</template>
</el-table-column>
<el-table-column
label="出院诊断"
align="center"
key="outDiagnoseName"
prop="outDiagnoseName"
width="160"
:show-overflow-tooltip="true"
/>
<el-table-column
label="总费用(元)"
align="center"
key="feeAmount"
prop="feeAmount"
width="140"
:show-overflow-tooltip="true"
/>
<el-table-column
label="政策范围内"
align="center"
key="inscpScpAmt"
prop="inscpScpAmt"
width="100"
:show-overflow-tooltip="true"
/>
<el-table-column
label="基本医保统筹支付金额(元)"
align="center"
key="tcPayAmount"
prop="tcPayAmount"
width="200"
:show-overflow-tooltip="true"
/>
</el-table>
<pagination
v-show="total > 0"
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script setup name="patientMasterDetails">
import {
getReportPatientMasterDetail
} from './statisticalManagent';
const patientMasterList = ref([]);
const loading = ref(true);
const ids = ref([]);
const total = ref(0);
const queryParams = ref({
pageNo: 1,
pageSize: 10,
searchKey: undefined,
occurrenceTimeSTime: undefined,
occurrenceTimeETime: undefined,
});
/** 查询调拨管理项目列表 */
function getList() {
loading.value = true;
getReportPatientMasterDetail(queryParams.value).then((res) => {
loading.value = false;
patientMasterList.value = res.data.records;
total.value = res.data.total;
})
}
/** 选择条数 */
function handleSelectionChange(selection) {
ids.value = selection.map((item) => item.id);
single.value = selection.length != 1;
multiple.value = !selection.length;
}
// 页面加载时获取数据
onMounted(() => {
getList();
});
</script>
<style scoped>
.custom-tree-node {
display: flex;
align-items: center;
}
.title {
font-weight: bold;
font-size: large;
margin-bottom: 10px;
}
</style>

View File

@@ -296,7 +296,7 @@ function handleCurrentChange(val) {
}
/** 导出按钮操作 */
function handleExport() {
proxy.$download.downloadGet("report-manage/medication-device/excel-out", {
proxy.$download.downloadGet("/report-manage/medication-device/excel-out", {
...rightQueryParams.value,
}, `config_${new Date().getTime()}.xlsx`);
}

View File

@@ -0,0 +1,228 @@
<template>
<div class="app-container">
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<!-- 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-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="Download" @click="handleExport">导出</el-button>
</el-col>
</el-row>
<el-table
v-loading="loading"
:data="productUsageDetailsList"
@selection-change="handleSelectionChange"
height="calc(100vh - 300px)"
>
<el-table-column type="selection" width="50" align="center" />
<el-table-column
label="编码"
align="center"
key="busNo"
prop="busNo"
:show-overflow-tooltip="true"
width="110"
/>
<el-table-column
label="药品通用名"
align="center"
key="medName"
prop="medName"
width="200"
:show-overflow-tooltip="true"
/>
<!-- itemTable -->
<el-table-column
label="产品名称"
align="center"
key="productName"
prop="productName"
width="140"
:show-overflow-tooltip="true"
/>
<el-table-column
label="剂型"
align="center"
key="doseFormCode_dictText"
prop="doseFormCode_dictText"
width="140"
:show-overflow-tooltip="true"
/>
<el-table-column
label="规格"
align="center"
key="totalVolume"
prop="totalVolume"
width="120"
:show-overflow-tooltip="true"
/>
<el-table-column
label="包装"
align="center"
key="packageUnit"
prop="packageUnit"
width="140px"
:show-overflow-tooltip="true"
/>
<el-table-column
label="计价单位"
align="center"
key="unitCode_dictText"
prop="unitCode_dictText"
width="140"
:show-overflow-tooltip="true"
/>
<el-table-column
label="生产企业"
align="center"
key="manufacturerText"
prop="manufacturerText"
:show-overflow-tooltip="true"
/>
<el-table-column
label="价格(每盒瓶/元)"
align="center"
key="price"
prop="price"
width="140"
:show-overflow-tooltip="true"
/>
<el-table-column
label="是否医保患者使用"
align="center"
key="isUsed"
prop="isUsed"
width="140"
:show-overflow-tooltip="true"
/>
<el-table-column
label="患者参保地"
align="center"
key="insuplcName"
prop="insuplcName"
width="140"
:show-overflow-tooltip="true"
/>
<el-table-column
label="参保类型"
align="center"
key="ybType"
prop="ybType"
:show-overflow-tooltip="true"
/>
<el-table-column
label="使用数量(片袋支)"
align="center"
key="quantity"
prop="quantity"
width="160"
:show-overflow-tooltip="true"
/>
<el-table-column
label="使用金额(片袋支)"
align="center"
key="totalPrice"
prop="totalPrice"
width="160"
:show-overflow-tooltip="true"
/>
</el-table>
<pagination
v-show="total > 0"
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script setup name="productUsageDetails">
import {
getReportProductUsageDetails,
} from './statisticalManagent';
const { proxy } = getCurrentInstance();
const route = useRoute();
const productUsageDetailsList = ref([]);
const loading = ref(true);
const ids = ref([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const approvalTime = ref([]);
const supplierListOptions = ref([]);
const locationIdList = ref([]);
const data = reactive({
form: {},
queryParams: {
pageNo: 1,
pageSize: 10,
searchKey: undefined,
occurrenceTimeSTime: undefined,
occurrenceTimeETime: undefined,
},
rules: {},
});
const { queryParams, form, rules } = toRefs(data);
/** 查询产品使用情况项目列表 */
function getList() {
loading.value = true;
getReportProductUsageDetails(queryParams.value).then((res) => {
loading.value = false;
productUsageDetailsList.value = res.data.records;
total.value = res.data.total;
});
}
/** 搜索按钮操作 */
function handleQuery() {
queryParams.value.occurrenceTimeSTime =
approvalTime.value && approvalTime.value.length == 2 ? approvalTime.value[0] + ' 00:00:00' : '';
queryParams.value.occurrenceTimeETime =
approvalTime.value && approvalTime.value.length == 2 ? approvalTime.value[1] + ' 23:59:59' : '';
queryParams.value.pageNo = 1;
getList();
}
/** 清空条件按钮操作 */
function handleClear() {
// 清空查询条件
queryParams.value.occurrenceTimeSTime = '';
queryParams.value.occurrenceTimeETime = '';
approvalTime.value = '';
proxy.resetForm('queryRef');
getList();
}
/** 选择条数 */
function handleSelectionChange(selection) {
ids.value = selection.map((item) => item.id);
single.value = selection.length != 1;
multiple.value = !selection.length;
}
getList();
</script>
<style scoped>
.custom-tree-node {
display: flex;
align-items: center;
}
.title {
font-weight: bold;
font-size: large;
margin-bottom: 10px;
}
</style>

View File

@@ -86,7 +86,7 @@
style="width: 150px"
>
<el-option
v-for="categoryCode in item_type"
v-for="categoryCode in item_category_code"
:key="categoryCode.value"
:label="categoryCode.label"
:value="categoryCode.value"
@@ -141,7 +141,13 @@
prop="supplyBusno"
width="200"
:show-overflow-tooltip="true"
/>
>
<template #default="scope">
<el-button type="primary" link @click="showDetail(scope.row.supplyBusno)">
{{ scope.row.supplyBusno }}
</el-button>
</template>
</el-table-column>
<!-- itemTable -->
<el-table-column
label="药品名称"
@@ -285,6 +291,64 @@
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
<el-dialog v-model="dialogVisible" title="单据详情" width="1700px" destroy-on-close>
<el-row>
<el-col :span="24">
<el-descriptions :column="4">
<el-descriptions-item label="单据编号:">
{{ documentDetails[0].busNo }}
</el-descriptions-item>
<el-descriptions-item label="制单日期:">
{{ documentDetails[0].applyTime }}
</el-descriptions-item>
<el-descriptions-item label="供应商:">
{{ documentDetails[0].supplierName }}
</el-descriptions-item>
<el-descriptions-item label="制单人:">
{{ documentDetails[0].practitionerName }}
</el-descriptions-item>
</el-descriptions>
</el-col>
</el-row>
<el-table :data="documentDetails" border max-height="600">
<el-table-column label="序号" align="center" type="index" width="60" />
<el-table-column label="项目名" align="center" prop="itemName" />
<el-table-column label="规格" align="center" prop="totalVolume" />
<el-table-column label="厂家/产地" align="center" prop="manufacturerText" width="240" />
<el-table-column label="仓库" align="center" prop="purposeLocationName" />
<el-table-column label="采购数量" align="right" prop="totalQuantity" header-align="center">
<template #default="scope">
<span>{{ scope.row.totalQuantity + scope.row.unitCode_dictText }}</span>
</template>
</el-table-column>
<el-table-column label="单价" align="right" prop="price" header-align="center">
<template #default="scope">
<span>{{ scope.row.price.toFixed(2) + ' 元' }}</span>
</template>
</el-table-column>
<el-table-column label="合计金额" align="right" prop="totalPrice" header-align="center">
<template #default="scope">
<span>{{ scope.row.totalPrice.toFixed(2) + ' 元' }}</span>
</template>
</el-table-column>
<el-table-column label="批号" align="center" prop="lotNumber" />
<el-table-column label="生产日期" align="center" prop="startTime" width="130">
<template #default="scope">
<span>{{ formatDateStr(scope.row.startTime, 'YYYY-MM-DD') }}</span>
</template>
</el-table-column>
<el-table-column label="有效期至" align="center" prop="endTime" width="130">
<template #default="scope">
<span>{{ formatDateStr(scope.row.endTime, 'YYYY-MM-DD') }}</span>
</template>
</el-table-column>
</el-table>
<template #footer>
<div class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
@@ -293,26 +357,24 @@ import {
getReportInboundPCage,
getPharmacyCabinetList,
getInboundInit,
getDocumentDetails,
} from './statisticalManagent';
import { formatDateStr } from '@/utils/index';
const { proxy } = getCurrentInstance();
const route = useRoute();
// const {
// item_type
// } = proxy.useDict(
// "item_type"
// );
const purchaseinventoryList = ref([]);
const loading = ref(true);
const ids = ref([]);
const single = ref(true);
const multiple = ref(true);
const dialogVisible = ref(false);
const total = ref(0);
const approvalTime = ref([]);
const supplierListOptions = ref([]);
// const chrgitmLv_enumTextOptions = ref([]);
const locationIdList = ref([]);
const documentDetails = ref([]);
const data = reactive({
form: {},
@@ -364,6 +426,14 @@ function getList() {
});
}
// 查看单据详情
function showDetail(busNo) {
getDocumentDetails({ busNo: busNo }).then((res) => {
dialogVisible.value = true;
documentDetails.value = res.data;
});
}
// 监听路由变化
watch(
() => route.query,

View File

@@ -91,7 +91,7 @@
style="width: 150px"
>
<el-option
v-for="categoryCode in item_type"
v-for="categoryCode in item_category_code"
:key="categoryCode.value"
:label="categoryCode.label"
:value="categoryCode.value"
@@ -343,9 +343,9 @@ import {
const { proxy } = getCurrentInstance();
const route = useRoute();
// const {
// item_type
// item_category_code
// } = proxy.useDict(
// "item_type"
// "item_category_code"
// );
const purchaseinventoryList = ref([]);
const loading = ref(true);

View File

@@ -208,10 +208,10 @@ const userStore = useUserStore();
const { proxy } = getCurrentInstance();
const totalAmount = ref(0);
// const {
// item_type,
// item_category_code,
// hosp_lv
// } = proxy.useDict(
// "item_type",
// "item_category_code",
// "hosp_lv"
// );
const purchaseinventoryListAll = ref([])

View File

@@ -328,9 +328,9 @@ const { proxy } = getCurrentInstance();
const route = useRoute();
const {
item_type,
item_category_code,
} = proxy.useDict(
"item_type",
"item_category_code",
);
const purchaseinventoryList = ref([]);

View File

@@ -90,7 +90,7 @@
style="width: 150px"
>
<el-option
v-for="categoryCode in item_type"
v-for="categoryCode in item_category_code"
:key="categoryCode.value"
:label="categoryCode.label"
:value="categoryCode.value"
@@ -105,7 +105,7 @@
style="width: 150px"
>
<el-option
v-for="categoryCode in item_type"
v-for="categoryCode in item_category_code"
:key="categoryCode.value"
:label="categoryCode.label"
:value="categoryCode.value"

View File

@@ -1,12 +1,7 @@
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryRef"
:inline="true"
label-width="90px"
>
<el-form-item label="药品名称:" prop="searchKey">
<el-form :model="queryParams" ref="queryRef" :inline="true" label-width="90px">
<el-form-item label="药品名称:" prop="searchKey">
<el-input
v-model="queryParams.searchKey"
placeholder="药品编码/药品名称/名称拼音/供应商名"
@@ -33,7 +28,7 @@
@keyup.enter="handleQuery"
/>
</el-form-item> -->
<el-form-item label="药品类别:" prop="categoryCode">
<el-select
v-model="queryParams.categoryCode"
@@ -42,14 +37,14 @@
style="width: 150px"
>
<el-option
v-for="categoryCode in item_type"
v-for="categoryCode in item_category_code"
:key="categoryCode.value"
:label="categoryCode.label"
:value="categoryCode.value"
/>
</el-select>
</el-form-item>
<el-form-item label="医保等级:" prop="chrgitmLv" >
<el-form-item label="医保等级:" prop="chrgitmLv">
<el-select
v-model="queryParams.chrgitmLv"
placeholder="请选择医保等级"
@@ -64,7 +59,7 @@
/>
</el-select>
</el-form-item>
<el-form-item label="仓库药房:" prop="locationId" >
<el-form-item label="仓库药房:" prop="locationId">
<el-select
v-model="queryParams.locationId"
placeholder="请选择仓库药房"
@@ -72,7 +67,7 @@
style="width: 150px"
>
<el-option
v-for="supplyStatus in locationIdList"
v-for="supplyStatus in locationIdList"
:key="supplyStatus.value"
:label="supplyStatus.name"
:value="supplyStatus.id"
@@ -99,25 +94,11 @@
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<!-- v-hasPermi="['system:user:import']" -->
<el-button
type="primary"
plain
icon="Search"
@click="handleQuery"
>查询</el-button
>
<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="warning" plain icon="CircleClose" @click="handleClear">重置</el-button>
</el-col>
</el-row>
@@ -133,7 +114,6 @@
key="categoryCode_dictText"
prop="categoryCode_dictText"
:show-overflow-tooltip="true"
/>
<el-table-column
label="药品编码"
@@ -262,7 +242,7 @@
prop="price"
:show-overflow-tooltip="true"
/>
<el-table-column
<el-table-column
label="本期库存数量"
align="center"
key="quantity"
@@ -298,19 +278,15 @@
</template>
<script setup name="settlementDoc">
import {
getproductReturnPage,
getInit,
getPharmacyCabinetList,
} from "./statisticalManagent";
import { getproductReturnPage, getInit, getPharmacyCabinetList } from './statisticalManagent';
const { proxy } = getCurrentInstance();
const {
item_type,
item_category_code,
inventory_range,
} = proxy.useDict(
"item_type",
"item_category_code",
"inventory_range",
);
@@ -322,7 +298,7 @@ const ids = ref([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const supplyTypeOptions = ref(undefined);
const supplyTypeOptions = ref(undefined);
const supplyStatusOptions = ref(undefined);
const chrgitmLv_enumTextOptions = ref([]);
const locationIdList = ref([]);
@@ -332,13 +308,13 @@ const data = reactive({
queryParams: {
pageNo: 1,
pageSize: 10,
searchKey: undefined,
remainingDays: undefined,
// hospital:undefined,
categoryCode:undefined,
chrgitmLv:undefined,
searchKey: undefined,
remainingDays: undefined,
// hospital:undefined,
categoryCode: undefined,
chrgitmLv: undefined,
warehouseScope: undefined,
locationId: undefined,
locationId: undefined,
// occurrenceTimeSTime:undefined,
// occurrenceTimeETime:undefined,
},
@@ -349,37 +325,41 @@ const { queryParams, form, rules } = toRefs(data);
function getPharmacyCabinetLists() {
getPharmacyCabinetList().then((response) => {
locationIdList.value = response.data
locationIdList.value = response.data;
});
getInit().then((response) => {
chrgitmLv_enumTextOptions.value = response.data.chrgitmLvOptions
})
chrgitmLv_enumTextOptions.value = response.data.chrgitmLvOptions;
});
}
/** 查询调拨管理项目列表 */
function getList() {
loading.value = true;
getproductReturnPage(queryParams.value).then((res) => {
loading.value = false;
purchaseinventoryList.value = res.data.records
if(purchaseinventoryList.value&& purchaseinventoryList.value.length>0){
purchaseinventoryList.value.map((k,index)=>{
k.inventoryStatusEnum_enumText = k.inventoryStatusEnum==2?'未停供':(k.inventoryStatusEnum==3?'已停供':'')
k.quantityUnit = k.quantity / k.partPercent
purchaseinventoryList.value = res.data.records;
if (purchaseinventoryList.value && purchaseinventoryList.value.length > 0) {
purchaseinventoryList.value.map((k, index) => {
k.inventoryStatusEnum_enumText =
k.inventoryStatusEnum == 2 ? '未停供' : k.inventoryStatusEnum == 3 ? '已停供' : '';
k.quantityUnit = k.quantity / k.partPercent;
const integerPart1 = Math.floor(k.quantityUnit); // 获取整数部分
const decimalPart1 = k.quantityUnit - integerPart1; // 获取小数部分
if(decimalPart1){
k.quantityUnit = integerPart1 + k.unitCode_dictText +
(decimalPart1*k.partPercent).toFixed(0) + k.minUnitCode_dictText
if (decimalPart1) {
k.quantityUnit =
integerPart1 +
k.unitCode_dictText +
(decimalPart1 * k.partPercent).toFixed(0) +
k.minUnitCode_dictText;
}
k.price = k.price?k.price.toFixed(2):0
k.retailPrice = k.retailPrice?k.retailPrice.toFixed(2):0
k.totalPrice = k.price * (Number(k.quantity) / k.partPercent)
k.totalPrice = k.totalPrice?k.totalPrice.toFixed(2):0
k.totalSalePrice = k.retailPrice * (Number(k.quantity) / k.partPercent)
k.totalSalePrice = k.totalSalePrice?k.totalSalePrice.toFixed(2):0
})
k.price = k.price ? k.price.toFixed(2) : 0;
k.retailPrice = k.retailPrice ? k.retailPrice.toFixed(2) : 0;
k.totalPrice = k.price * (Number(k.quantity) / k.partPercent);
k.totalPrice = k.totalPrice ? k.totalPrice.toFixed(2) : 0;
k.totalSalePrice = k.retailPrice * (Number(k.quantity) / k.partPercent);
k.totalSalePrice = k.totalSalePrice ? k.totalSalePrice.toFixed(2) : 0;
});
}
total.value = res.data.total;
});
@@ -387,14 +367,14 @@ function getList() {
/** 搜索按钮操作 */
function handleQuery() {
// queryParams.value.occurrenceTimeSTime =
// occurrenceTime.value && occurrenceTime.value.length == 2
// ? occurrenceTime.value[0] + " 00:00:00"
// : "";
// queryParams.value.occurrenceTimeETime =
// occurrenceTime.value && occurrenceTime.value.length == 2
// ? occurrenceTime.value[1] + " 23:59:59"
// : "";
// queryParams.value.occurrenceTimeSTime =
// occurrenceTime.value && occurrenceTime.value.length == 2
// ? occurrenceTime.value[0] + " 00:00:00"
// : "";
// queryParams.value.occurrenceTimeETime =
// occurrenceTime.value && occurrenceTime.value.length == 2
// ? occurrenceTime.value[1] + " 23:59:59"
// : "";
queryParams.value.pageNo = 1;
getList();
}
@@ -402,7 +382,7 @@ function handleQuery() {
/** 清空条件按钮操作 */
function handleClear() {
// 清空查询条件
proxy.resetForm("queryRef");
proxy.resetForm('queryRef');
getList();
}
@@ -414,13 +394,11 @@ function handleSelectionChange(selection) {
}
getList();
getPharmacyCabinetLists()
getPharmacyCabinetLists();
</script>
<style scoped>
.custom-tree-node {
display: flex;
align-items: center;
}
</style>
</style>

View File

@@ -387,7 +387,7 @@ export function handOperatedApplyReconcileAccounts(data) {
export function productPageTotal(query) {
return request({
url: '/inventory-manage/product/product-page-total',
url: '/inventory-manage/product/product-statistics',
method: 'get',
params: query
})
@@ -415,4 +415,125 @@ export function getReportStocktakingPageAuto(query) {
method: 'get',
params: query
})
}
}
//报表导出
export function exportRecords(params) {
return request({
url: '/pharmacy-manage/medication-details/excel-out',
method: 'get',
params: qparamsuery
})
}
//查看单据详情
export function getDocumentDetails(params) {
return request({
url: '/inventory-manage/purchase/inventory-receipt',
method: 'get',
params: params
})
}
//药剂科报表_常规报表:出库明细表(例子)
export function getStockOutDetail(query) {
return request({
url: '/report-manage/report/stock-out-detail-page',
method: 'get',
params: query
})
}
//查询患者明细主报表--20251106追加
export function getReportPatientMasterDetail(query) {
return request({
url: '/report-manage/report/patient-master-detail',
method: 'get',
params: query
})
}
//线下采购占比报表--20251106追加
export function getReportOfflinePurchaseRatio(query) {
return request({
url: '/report-manage/report/offline-purchase-ratio',
method: 'get',
params: query
})
}
//药品使用情况报表--20251106追加
export function getReportMedicationUsage(query) {
return request({
url: '/report-manage/report/medication-usage',
method: 'get',
params: query
})
}
//查询患者明细报表--20251106追加
export function getReportPatientDetails(query) {
return request({
url: '/report-manage/report/patient-details',
method: 'get',
params: query
})
}
//药剂科报表:药品费用增长率--20251106追加
export function getDrugExpensesGrowthRate(query) {
return request({
url: '/report-manage/report/drug-expenses-growth-rate',
method: 'get',
params: query
})
}
//药剂科报表:30天回款率--20251106追加
export function getThirtyDayCollectionRate(query) {
return request({
url: '/report-manage/report/thirty-day-collection-rate',
method: 'get',
params: query
})
}
//药剂科报表:基本情况--20251106追加
export function getReportBasicInformationDetails(query) {
return request({
url: '/report-manage/report/basic-information-details',
method: 'get',
params: query
})
}
//药剂科报表:药品出库情况--20251106追加
export function getReportMedicationStockOutDetails(query) {
return request({
url: '/report-manage/report/medication-stock-out-details',
method: 'get',
params: query
})
}
//药剂科报表:产品使用情况--20251106追加
export function getReportProductUsageDetails(query) {
return request({
url: '/report-manage/report/product-usage-details',
method: 'get',
params: query
})
}
//药剂科报表:非中选产品采购量占比--20251106追加
export function getReportNonWinQtyRatio(query) {
return request({
url: '/report-manage/report/non-win-qty-ratio',
method: 'get',
params: query
})
}

View File

@@ -0,0 +1,225 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryRef" :inline="true" label-width="100px">
</el-form>
<el-table
v-loading="loading"
:data="stockOutDetailList"
@selection-change="handleSelectionChange"
height="calc(100vh - 300px)"
>
<el-table-column type="selection" width="50" align="center" />
<el-table-column
label="单据号"
align="center"
key="supplyBusno"
prop="supplyBusno"
width="200"
:show-overflow-tooltip="true"
/>
<el-table-column
label="出库类型"
align="center"
key="type"
prop="type"
width="140"
:show-overflow-tooltip="true"
/>
<el-table-column
label="药品名称"
align="center"
key="medName"
prop="medName"
width="140"
:show-overflow-tooltip="true"
/>
<el-table-column
label="院内药品唯一码"
align="center"
key="busNo"
prop="busNo"
width="140"
:show-overflow-tooltip="true"
/>
<el-table-column
label="药品类型"
align="center"
key="itemTableText"
prop="itemTableText"
width="140"
:show-overflow-tooltip="true"
/>
<el-table-column
label="批次号"
align="center"
key="lotNumber"
prop="lotNumber"
width="140px"
:show-overflow-tooltip="true"
/>
<el-table-column
label="存放仓库"
align="center"
key="locationName"
prop="locationName"
width="140"
:show-overflow-tooltip="true"
/>
<el-table-column
label="货位"
align="center"
key="locationStoreName"
prop="locationStoreName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="计量单位"
align="center"
key="unitCode_dictText"
prop="unitCode_dictText"
:show-overflow-tooltip="true"
/>
<el-table-column
label="采购数量"
align="center"
key="quantity"
prop="quantity"
:show-overflow-tooltip="true"
/>
<el-table-column
label="采购单价"
align="center"
key="price"
prop="price"
:show-overflow-tooltip="true"
/>
<el-table-column
label="采购金额"
align="center"
key="totalPrice"
prop="totalPrice"
:show-overflow-tooltip="true"
/>
<el-table-column
label="售价"
align="center"
key="salePrice"
prop="salePrice"
:show-overflow-tooltip="true"
/>
<el-table-column
label="售价金额"
align="center"
key="totalSalePrice"
prop="totalSalePrice"
:show-overflow-tooltip="true"
/>
<el-table-column
label="出库科室"
align="center"
key="orgId_dictText"
prop="orgId_dictText"
:show-overflow-tooltip="true"
/>
<el-table-column
label="供应商"
align="center"
key="supplier"
prop="supplier"
:show-overflow-tooltip="true"
/>
<el-table-column
label="审核人"
align="center"
key="approverId_dictText"
prop="approverId_dictText"
:show-overflow-tooltip="true"
/>
<el-table-column
label="审批日期"
align="center"
key="approvalTime"
prop="approvalTime"
width="160"
:show-overflow-tooltip="true"
>
<template #default="scope">
<span>{{ parseTime(scope.row.approvalTime) }}</span>
</template>
</el-table-column>
<el-table-column
label="出库原因"
align="center"
key="reason"
prop="reason"
:show-overflow-tooltip="true"
/>
</el-table>
<pagination
v-show="total > 0"
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script setup name="getStockOutDetail">
import {
getStockOutDetail,
} from './statisticalManagent';
const { proxy } = getCurrentInstance();
const route = useRoute();
const stockOutDetailList = ref([]);
const loading = ref(true);
const ids = ref([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const approvalTime = ref([]);
const supplierListOptions = ref([]);
const locationIdList = ref([]);
const data = reactive({
form: {},
queryParams: {
pageNo: 1,
pageSize: 10,
searchKey: undefined,
occurrenceTimeSTime: undefined,
occurrenceTimeETime: undefined,
},
rules: {},
});
const { queryParams, form, rules } = toRefs(data);
/** 药剂科报表_常规报表:出库明细表的查询 */
function getList() {
loading.value = true;
getStockOutDetail(queryParams.value).then((res) => {
loading.value = false;
stockOutDetailList.value = res.data.records;
total.value = res.data.total;
});
}
getList();
</script>
<style scoped>
.custom-tree-node {
display: flex;
align-items: center;
}
.title {
font-weight: bold;
font-size: large;
margin-bottom: 10px;
}
</style>

View File

@@ -0,0 +1,195 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryRef" :inline="true" label-width="150px">
<el-form-item label="项目名称:" prop="searchKey">
<el-input
v-model="queryParams.name"
placeholder="项目名称"
clearable
style="width: 200px"
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="医疗机构名称:" prop="searchKey">
<el-input
v-model="queryParams.medinsName"
placeholder="医疗机构名称"
clearable
style="width: 200px"
@keyup.enter="handleQuery"
/>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<!-- 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-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="Download" @click="handleExport">导出</el-button>
</el-col>
</el-row>
<el-table
v-loading="loading"
:data="collectionRateList"
@selection-change="handleSelectionChange"
height="calc(100vh - 300px)"
>
<el-table-column type="selection" width="50" align="center" />
<el-table-column
label="项目名称"
align="center"
key="name"
prop="name"
width="200"
:show-overflow-tooltip="true"
/>
<el-table-column
label="医疗机构名称"
align="center"
key="medinsName"
prop="medinsName"
width="200"
:show-overflow-tooltip="true"
/>
<el-table-column
label="药品通用名"
align="center"
key="drugGenname"
prop="drugGenname"
width="200"
:show-overflow-tooltip="true"
/>
<el-table-column
label="30天回款率%"
align="center"
key="collectionRate"
prop="collectionRate"
width="200"
:show-overflow-tooltip="true"
/>
</el-table>
<pagination
v-show="total > 0"
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script setup name="thirtyDayCollectionRate">
import {
getThirtyDayCollectionRate
} from './statisticalManagent';
const { proxy } = getCurrentInstance();
const route = useRoute();
const collectionRateList = ref([]);
const loading = ref(true);
const ids = ref([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const data = reactive({
form: {},
queryParams: {
pageNo: 1,
pageSize: 10,
searchKey: undefined,
name: undefined,
medinsName: undefined
},
rules: {},
});
const { queryParams} = toRefs(data);
/** 导出按钮操作 */
function handleExport() {
proxy.$download.downloadGet(
'report-manage/inbound/excel-out',
{
...queryParams.value,
},
`dict_${new Date().getTime()}.xlsx`
);
}
/** 查询调拨管理项目列表 */
function getList() {
loading.value = true;
getThirtyDayCollectionRate(queryParams.value).then((res) => {
loading.value = false;
collectionRateList.value = res.data.records;
total.value = res.data.total;
});
}
// 监听路由变化
watch(
() => route.query,
(newQuery) => {
// 如果路由中包含指定参数,则使用这些参数进行查询
if (
newQuery.name ||
newQuery.medinsName
) {
// 设置查询参数
if (newQuery.name) {
queryParams.value.name = newQuery.name;
}
// 设置查询参数
if (newQuery.medinsName) {
queryParams.value.medinsName = newQuery.medinsName;
}
// 执行查询
getList();
}
},
{ immediate: true }
);
/** 搜索按钮操作 */
function handleQuery() {
queryParams.value.pageNo = 1;
getList();
}
/** 清空条件按钮操作 */
function handleClear() {
// 清空查询条件
queryParams.value.name = '';
queryParams.value.medinsName = '';
proxy.resetForm('queryRef');
getList();
}
/** 选择条数 */
function handleSelectionChange(selection) {
ids.value = selection.map((item) => item.id);
single.value = selection.length != 1;
multiple.value = !selection.length;
}
getList();
</script>
<style scoped>
.custom-tree-node {
display: flex;
align-items: center;
}
.title {
font-weight: bold;
font-size: large;
margin-bottom: 10px;
}
</style>

View File

@@ -72,9 +72,9 @@ import { formatDateStr } from '@/utils';
const { proxy } = getCurrentInstance();
const {
item_type,
item_category_code,
} = proxy.useDict(
"item_type",
"item_category_code",
);
const purchaseinventoryList = ref([]);