feat: Spring Boot 3.5.14 全量升级 + 组件升级

核心升级:
- Spring Boot 2.7.18 → 3.5.14
- MyBatis Plus 3.5.5 → 3.5.16 (spring-boot3-starter)
- Springdoc 1.8.0 → 2.8.6 (OpenAPI 3)
- Flowable 6.8.0 → 7.1.0
- Druid 1.2.x → 1.2.28 (boot3-starter)
- kotlin-reflect 1.9.10 → 1.9.25

迁移适配:
- javax → jakarta 命名空间 (620+ 文件)
- Swagger 注解迁移到 OpenAPI 3 (@Tag/@Schema/@Operation/@Parameter)
- Spring Security 6.2 适配 (antMatchers→requestMatchers, EnableMethodSecurity)
- Druid 包名迁移 (boot→boot3)
- Redis 配置路径迁移 (spring.redis→spring.data.redis)
- Flyway 适配 (flyway-database-postgresql)
- Flowable 7.x 适配 (MULE_TASK_IMAGE 移除)

修复:
- spring-boot-maven-plugin 2.5.15→3.5.14 (SPI服务发现失效)
- mybatis-plus-boot-starter 3.5.5→3.5.16 (kotlin-reflect+fastjson2冲突)
- Flowable database-schema-update 启用自动建表

验证: 23/23 测试通过, 1374 API端点正常
This commit is contained in:
2026-06-04 22:39:10 +08:00
parent b8d719429d
commit 1d21661a78
781 changed files with 57907 additions and 1301 deletions

View File

@@ -0,0 +1,122 @@
import request from '@/utils/request'
// 查询盘点列表
export function getStockinventoryList(query) {
return request({
url: '/inventory-manage/stocktaking/stocktaking-receipt-page',
method: 'get',
params: query
})
}
// 盘点编辑页列表
export function getstocktakingDetail(busNo) {
return request({
url: '/inventory-manage/stocktaking/stocktaking-receipt',
method: 'get',
params: { busNo } // 确保参数正确传递
})
}
// 添加/编辑入库单据
export function addPurchaseinventory(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(params) {
return request({
url: '/inventory-manage/stocktaking/stocktaking-receipt-batch',
method: 'get',
params: params
})
}
//保存批量盘点
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',
})
}

View File

@@ -0,0 +1,106 @@
<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="manufacturerText"
/>
</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: "",
},
});
const emit = defineEmits(["selectRow"]);
const queryParams = ref({
pageNum: 1,
pageSize: 50,
itemType: props.itemType,
});
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;
throttledGetList();
},
{ immdiate: true, deep: true }
);
getList();
function getList() {
getMedicineList(queryParams.value).then((res) => {
medicineList.value = res.data;
});
}
function clickRow(row) {
emit("selectRow", row);
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,130 @@
import request from '@/utils/request'
// 查询盘点列表
export function getStockinventoryList(query) {
return request({
url: '/inventory-manage/stocktaking/stocktaking-receipt-page',
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(params) {
return request({
url: '/inventory-manage/stocktaking/stocktaking-receipt-batch',
method: 'get',
params: params
})
}
//保存批量盘点
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,127 @@
<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="manufacturerText"
/>
<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,433 @@
{
"panels": [
{
"index": 0,
"name": 1,
"paperType": "自定义",
"height": 130,
"width": 210,
"paperHeader": 73.5,
"paperFooter": 337.5,
"paperNumberDisabled": true,
"paperNumberContinue": true,
"expandCss": "",
"overPrintOptions": {},
"watermarkOptions": {},
"panelLayoutOptions": {},
"printElements": [
{
"options": {
"left": 222,
"top": 12,
"height": 12,
"width": 115.5,
"title": "{{HOSPITAL_NAME}}医院盘点单",
"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": "机构:{{HOSPITAL_NAME}}医院",
"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": 59.68821015182906,
"field": "name",
"checked": true,
"columnId": "name",
"fixed": false,
"rowspan": 1,
"colspan": 1
},
{
"title": "规格",
"titleSync": false,
"halign": "center",
"tableQRCodeLevel": 0,
"tableSummaryTitle": true,
"tableSummary": "",
"width": 46.07372249096389,
"field": "volume",
"checked": true,
"columnId": "volume",
"fixed": false,
"rowspan": 1,
"colspan": 1
},
{
"title": "厂家/产地",
"titleSync": false,
"halign": "center",
"tableQRCodeLevel": 0,
"tableSummaryTitle": true,
"tableSummary": "",
"width": 62.86642033621548,
"field": "manufacturerText",
"checked": true,
"columnId": "manufacturerText",
"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,
"halign": "center",
"tableQRCodeLevel": 0,
"tableSummaryTitle": true,
"tableSummary": "",
"width": 70.82692033621548,
"field": "manufacturerText",
"checked": false,
"columnId": "manufacturerText",
"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": 456,
"top": 343.5,
"height": 12,
"width": 109.5,
"title": "制单人",
"field": "name",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0
},
"printElementType": {
"title": "文本",
"type": "text"
}
}
]
}
]
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,42 @@
import request from '@/utils/request';
// 查询盘点列表
export function getStockTakeList (query) {
return request ({
url: '/nurse-station/org-device-stockTake/summary-from',
method: 'get',
params: query,
});
}
// 获取药房列表
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 getMedicineList (queryParams) {
return request ({
url: '/app-common/inventory-item',
method: 'get',
params: queryParams,
});
}
// 科室耗材汇总
export function saveOrgDeviceSummary (data) {
return request ({
url: '/nurse-station/org-device-stockTake/org-device-summary',
method: 'put',
data,
});
}

View File

@@ -0,0 +1,127 @@
<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="manufacturerText"
/>
<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,390 @@
<template>
<div class="app-container">
<el-form
ref="queryRef"
:model="queryParams"
:inline="true"
:rules="rules"
>
<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"
@keyup.enter="handleQuery"
>
<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="sourceLocationId"
>
<el-select
v-model="queryParams.sourceLocationId"
placeholder="请选择"
clearable
filterable
style="width: 200px"
:disabled="!queryParams.purposeTypeEnum"
@keyup.enter="handleQuery"
>
<el-option
v-for="item in purposeTypeListOptions"
: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 []"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item
label="请求日期"
prop="applyTime"
>
<el-date-picker
v-model="queryParams.applyTime"
type="daterange"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="YYYY-MM-DD"
format="YYYY-MM-DD"
/>
</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-row
:gutter="10"
class="mb8"
>
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="Plus"
size="small"
:disabled="multiple"
@click="handleSave()"
>
批量保存
</el-button>
</el-col>
</el-row>
<el-table
v-loading="loading"
:data="dataList"
height="calc(100vh - 250px)"
@selection-change="handleSelectionChange"
>
<el-table-column
type="selection"
width="55"
align="center"
fixed
/>
<el-table-column
key="name"
label="项目"
align="center"
prop="name"
width="200"
fixed
/>
<el-table-column
label="规格"
align="center"
prop="totalVolume"
/>
<el-table-column
label="厂家/产地"
align="center"
prop="manufacturerText"
show-overflow-tooltip
/>
<el-table-column
label="产品批号"
align="center"
prop="lotNumber"
/>
<el-table-column
key="unit"
label="单价(元)"
align="center"
prop="unitPrice"
/>
<el-table-column
label="发放数量"
align="center"
prop="dispenseQuantity"
>
<template #default="scope">
{{ formatQuantityWithUnit(scope.row.dispenseQuantity, scope.row.minUnitCode_dictText) }}
</template>
</el-table-column>
<el-table-column
label="库存数量"
align="center"
prop="quantity"
>
<template #default="scope">
{{ formatQuantityWithUnit(scope.row.quantity, scope.row.minUnitCode_dictText) }}
</template>
</el-table-column>
<el-table-column
label="实盘数量"
align="center"
prop="stockTakeQuantity"
>
<template #default="scope">
<el-input-number
v-model="scope.row.stockTakeQuantity"
:precision="0"
:min="0"
:input-style="{ textAlign: 'center' }"
:controls="false"
style="width: 100%"
@keyup.enter="handleSave(scope.row)"
/>
</template>
</el-table-column>
<el-table-column
label="盈亏数量"
align="center"
prop="profitLoss"
>
<template #default="scope">
{{ calcProfitLoss(scope.row) }}
</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
v-hasPermi="['chkstock:partDeptDevice:edit']"
size="small"
type="primary"
link
icon="Check"
@click="handleSave(scope.row)"
>
保存
</el-button>
</template>
</el-table-column>
</el-table>
</div>
</template>
<script setup>
import {getCurrentInstance, onMounted, reactive, ref} from 'vue';
import {getDispensaryList, getPharmacyList, getStockTakeList, saveOrgDeviceSummary,} from './components/api.js';
const { proxy } = getCurrentInstance();
const { warehous_type } = proxy.useDict('warehous_type');
const dataList = ref([]);
const queryParams = reactive({
name: undefined,
purposeTypeEnum: undefined,
sourceLocationId: undefined,
applyTime: [],
applyTimeSTime: undefined,
applyTimeETime: undefined,
});
const loading = ref(false);
const rules = ref({});
// 获取列表
const getList = () => {
loading.value = true;
const params = {
...queryParams,
pageNo: queryParams.pageNo || 1,
pageSize: queryParams.pageSize || 10,
applyTime: undefined,
applyTimeSTime: queryParams.applyTime[0] ? `${queryParams.applyTime[0]} 00:00:00` : undefined,
applyTimeETime: queryParams.applyTime[1] ? `${queryParams.applyTime[1]} 23:59:59` : undefined,
};
getStockTakeList(params).then((res) => {
loading.value = false;
dataList.value = res.data;
});
};
// 搜索
const handleQuery = () => {
getList();
};
// 重置
const resetQuery = () => {
Object.assign(queryParams, {
name: undefined,
purposeTypeEnum: undefined,
sourceLocationId: undefined,
applyTime: [],
});
handleQuery();
};
const ids = ref([]);
const single = ref(true);
const multiple = ref(true);
// 多选
const handleSelectionChange = (selection) => {
ids.value = selection.map((item) => item);
single.value = selection.length != 1;
multiple.value = !selection.length;
};
const toNumber = (value) => {
if (value === '' || value === null || value === undefined) return null;
const num = Number(value);
return Number.isNaN(num) ? null : num;
};
const formatQuantityWithUnit = (quantity, unitText) => {
const num = toNumber(quantity);
if (num === null) return '';
return unitText ? `${num} ${unitText}` : `${num}`;
};
const calcProfitLoss = (row) => {
const stockTakeQuantity = toNumber(row.stockTakeQuantity);
const dispenseQuantity = toNumber(row.dispenseQuantity);
if (stockTakeQuantity === null || dispenseQuantity === null) return '';
const profitLoss = stockTakeQuantity - dispenseQuantity;
return `${profitLoss} ${row.minUnitCode_dictText ?? ''}`;
};
const buildSummaryPayload = (rows) =>
rows.map((item) => ({
id: item.id,
stockTakeQuantity: Number(item.stockTakeQuantity),
useUnitCode: item.minUnitCode,
...item,
}));
// 保存(单条/批量)
const handleSave = (row) => {
const targetRows = row ? [row] : ids.value;
if (!targetRows.length) {
proxy.$modal.msgWarning('请选择需要保存的数据');
return;
}
const invalidRow = targetRows.find(
(item) =>
item.stockTakeQuantity === '' ||
item.stockTakeQuantity === null ||
item.stockTakeQuantity === undefined
);
if (invalidRow) {
proxy.$modal.msgWarning('实盘数量不能为空');
return;
}
const payload = buildSummaryPayload(targetRows);
proxy.$modal
.confirm('确定保存吗?', '保存', {
confirmButtonText: '保存',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
saveOrgDeviceSummary(payload).then(() => {
proxy.$modal.msgSuccess('保存成功');
getList();
});
})
.catch(() => {});
};
const purposeTypeListOptions = ref([]);
// 仓库类型切换
const handleChangePurposeTypeEnum = (val) => {
// 药房
if (val == '16') {
getPharmacyList().then((res) => {
purposeTypeListOptions.value = res.data;
});
} else if (val == '11') {
getDispensaryList().then((res) => {
purposeTypeListOptions.value = res.data;
});
}
getList();
};
onMounted(() => {
getList();
});
</script>

View File

@@ -0,0 +1,106 @@
import request from '@/utils/request'
// 查询盘点列表
export function getStockinventoryList(query) {
return request({
url: '/inventory-manage/stocktaking/stocktaking-receipt-page',
method: 'get',
params: query
})
}
// 盘点编辑页列表
export function getstocktakingDetail(busNo) {
return request({
url: '/inventory-manage/stocktaking/stocktaking-receipt',
method: 'get',
params: { busNo } // 确保参数正确传递
})
}
// 添加/编辑入库单据
export function addPurchaseinventory(data) {
return request({
url: '/inventory-manage/purchase/inventory-receipt',
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 delPurchaseinventory(param) {
return request({
url: '/inventory-manage/purchase/inventory-receipt?supplyRequestIds=' + param,
method: 'delete',
})
}
// 提交审批
export function submitApproval(busNo) {
return request({
url: '/inventory-manage/purchase/submit-approval',
method: 'put',
data: { busNo } // 修复:发送对象而不是字符串
})
}
// 撤回审批
export function withdrawApproval(busNo) {
return request({
url: '/inventory-manage/purchase/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',
})
}

View File

@@ -0,0 +1,106 @@
<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="manufacturerText"
/>
</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: "",
},
});
const emit = defineEmits(["selectRow"]);
const queryParams = ref({
pageNum: 1,
pageSize: 50,
itemType: props.itemType,
});
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;
throttledGetList();
},
{ immdiate: true, deep: true }
);
getList();
function getList() {
getMedicineList(queryParams.value).then((res) => {
medicineList.value = res.data;
});
}
function clickRow(row) {
emit("selectRow", row);
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,479 @@
<template>
<div class="app-container">
<el-form
v-show="showSearch"
ref="queryRef"
:model="queryParams"
:inline="true"
label-width="90px"
>
<el-form-item
label="单据号:"
prop="searchKey"
>
<el-input
v-model="queryParams.searchKey"
placeholder="单据号:"
clearable
style="width: 220px"
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item
label="审批状态:"
prop="statusEnum"
label-width="100px"
>
<el-select
v-model="queryParams.statusEnum"
placeholder=""
clearable
style="width: 150px"
>
<el-option
v-for="supplyStatus in supplyStatusOptions"
:key="supplyStatus.value"
:label="supplyStatus.label"
:value="supplyStatus.value"
/>
</el-select>
</el-form-item>
<el-form-item
label="制单人:"
prop="applicantId"
label-width="120px"
>
<el-select
v-model="queryParams.applicantId"
placeholder=""
clearable
style="width: 150px"
>
<el-option
v-for="practitioner in applicantListOptions"
:key="practitioner.value"
:label="practitioner.label"
:value="practitioner.value"
/>
</el-select>
</el-form-item>
<el-form-item label="制单日期:">
<el-date-picker
v-model="occurrenceTime"
value-format="YYYY-MM-DD"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
/>
</el-form-item>
</el-form>
<el-row
:gutter="10"
class="mb8"
>
<!-- 添加记录 -->
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="Plus"
@click="openAddStockPart"
>
新增盘点单
</el-button>
<!-- v-hasPermi="['system:user:add']" -->
</el-col>
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="Plus"
@click="openAddStockBatch"
>
新增批量盘点单
</el-button>
<!-- v-hasPermi="['system:user:add']" -->
</el-col>
<!-- 查询 -->
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="Search"
@click="handleQuery"
>
查询
</el-button>
<!-- v-hasPermi="['system:user:import']" -->
</el-col>
<!-- 重置 -->
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="CircleClose"
@click="handleClear"
>
重置
</el-button>
<!-- v-hasPermi="['system:user:export']" -->
</el-col>
</el-row>
<el-table
v-loading="loading"
:data="stockinventoryList"
@selection-change="handleSelectionChange"
>
<el-table-column
type="selection"
width="50"
align="center"
/>
<el-table-column
key="supplyBusNo"
label="单据号"
align="center"
prop="supplyBusNo"
width="200"
:show-overflow-tooltip="true"
/>
<el-table-column
key="typeEnum_enumText"
label="单据类型"
align="center"
prop="typeEnum_enumText"
:show-overflow-tooltip="true"
/>
<el-table-column
key="statusEnum_enumText"
label="审批状态"
align="center"
prop="statusEnum_enumText"
:show-overflow-tooltip="true"
/>
<el-table-column
key="purposeLocationId_dictText"
label="盘点仓库"
align="center"
prop="purposeLocationId_dictText"
:show-overflow-tooltip="true"
/>
<el-table-column
key="breakevenPrice"
label="盈亏金额"
align="center"
prop="breakevenPrice"
:show-overflow-tooltip="true"
/>
<el-table-column
key="applicantId_dictText"
label="制单人"
align="center"
prop="applicantId_dictText"
:show-overflow-tooltip="true"
/>
<el-table-column
key="approverId_dictText"
label="审核人"
align="center"
prop="approverId_dictText"
:show-overflow-tooltip="true"
/>
<el-table-column
key="createTime"
label="制单日期"
align="center"
prop="createTime"
width="180"
:show-overflow-tooltip="true"
>
<template #default="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column
key="approvalTime"
label="审核日期 "
align="center"
prop="approvalTime"
width="180"
:show-overflow-tooltip="true"
>
<template #default="scope">
<span>{{ parseTime(scope.row.approvalTime) }}</span>
</template>
</el-table-column>
<!-- <el-table-column
label="备注"
align="center"
key="remake"
prop="remake"
/> -->
<el-table-column
label="操作"
align="center"
width="230"
class-name="small-padding fixed-width"
>
<template #default="scope">
<el-button
link
type="primary"
icon="View"
@click="
() => {
proxy.$refs['detailsDialogRef'].open(scope.row.supplyBusNo);
}
"
>
详情
</el-button>
<el-button
link
type="primary"
icon="Edit"
:disabled="
scope.row.statusEnum != '1' &&
scope.row.statusEnum != '9' &&
scope.row.statusEnum != '4'
"
@click="handleUpdate(scope.row)"
>
编辑
</el-button>
<!-- :disabled="scope.row.statusEnum != '1' && scope.row.statusEnum != '9' && scope.row.statusEnum != '4'" -->
<!-- v-hasPermi="['system:user:edit']" -->
<el-button
v-if="scope.row.statusEnum == '1' || scope.row.statusEnum == '9'"
link
type="primary"
icon="View"
@click="handleSubmitApproval(scope.row)"
>
提交审批
</el-button>
<!-- v-hasPermi="['system:user:remove']" -->
<el-button
v-if="scope.row.statusEnum == '2'"
link
type="primary"
icon="View"
@click="handleWithdrawApproval(scope.row)"
>
撤销审批
</el-button>
<!-- v-hasPermi="['system:user:remove']" -->
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
:total="total"
@pagination="getList"
/>
<ChkstockDetailsDialog ref="detailsDialogRef" />
<!-- <stock-receipt-dialog
ref="stockReceiptRef"
:cabinetListOptions="cabinetListOptions"
:categoryListOptions ="categoryListOptions"
:profitReasonOptions = "profitReasonOptions"
:busNoAdd="busNoAdd"
:item="currentData"
:editRow="editRow"
@refresh="getList"
/> -->
</div>
</template>
<script setup name="ChkstockRecord">
// 导入onActivated钩子
import {onActivated, onMounted} from 'vue';
import {getInit, getStockinventoryList, submitApproval, withdrawApproval,} from '../components/api';
import ChkstockDetailsDialog from '../components/chkstockDetailsDialog.vue';
// import stockReceiptDialog from "./components/stockReceiptDialog";
const router = useRouter();
const { proxy } = getCurrentInstance();
const stockinventoryList = ref([]);
const open = ref(false);
const loading = ref(true);
const showSearch = ref(true);
const ids = ref([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const occurrenceTime = ref([]);
const busNoAdd = ref(''); // 单据号新增
const applicantListOptions = ref(undefined); // 制单人列表
const cabinetListOptions = ref(undefined); // 仓库列表
const categoryListOptions = ref(undefined); // 药品类型
const pharmacyListOptions = ref(undefined); // 药房列表
const supplyStatusOptions = ref(undefined); // 审批状态
const profitReasonOptions = ref(undefined); // 盈亏原因
const editRow = ref({});
// 使用 ref 定义当前编辑的采购
const currentData = ref({});
// 是否停用
const statusFlagOptions = ref(undefined);
const data = reactive({
form: {},
queryParams: {
supplyBusNo: undefined, // 编码
statusEnum: undefined, // 审批状态
applicantId: undefined, // 制单人
createTimeSTime: undefined,
createTimeETime: undefined,
pageNo: 1,
pageSize: 10,
searchKey: undefined, // 供应商名称
},
rules: {},
});
const { queryParams, form, rules } = toRefs(data);
/** 列表页查询下拉树结构 */
function getStockinventoryTypeList() {
getInit().then((response) => {
console.log('列表页下拉树response1111111', response);
busNoAdd.value = response.data.busNo; // 单据号新增
applicantListOptions.value = response.data.applicantListOptions; // 制单人列表
cabinetListOptions.value = response.data.cabinetListOptions; // 仓库列表
categoryListOptions.value = response.data.categoryListOptions; // 药品类型列表
pharmacyListOptions.value = response.data.pharmacyListOptions; // 药房列表
profitReasonOptions.value = response.data.profitReasonOptions; // 盈亏类型列表
supplyStatusOptions.value = response.data.supplyStatusOptions; // 审批状态
});
}
/** 详情页查询下拉树结构 */
/** 查询盘点列表 */
function getList() {
loading.value = true;
getStockinventoryList(queryParams.value).then((res) => {
console.log('查询盘点列表response1111111', res);
loading.value = false;
stockinventoryList.value = res.data.records;
total.value = res.data.total;
});
}
/** 搜索按钮操作 */
function handleQuery() {
queryParams.value.createTimeSTime =
occurrenceTime.value && occurrenceTime.value.length == 2
? occurrenceTime.value[0] + ' 00:00:00'
: '';
queryParams.value.createTimeETime =
occurrenceTime.value && occurrenceTime.value.length == 2
? occurrenceTime.value[1] + ' 23:59:59'
: '';
queryParams.value.pageNo = 1;
getList();
}
/** 清空条件按钮操作 */
function handleClear() {
// 清空查询条件
queryParams.value.createTimeSTime = '';
queryParams.value.createTimeETime = '';
occurrenceTime.value = '';
proxy.resetForm('queryRef');
getList();
}
/** 选择条数 */
function handleSelectionChange(selection) {
ids.value = selection.map((item) => item.id);
single.value = selection.length != 1;
multiple.value = !selection.length;
}
/** 打开商品盘点 */
function openAddStockPart() {
// nextTick(() => {
// proxy.$refs["stockReceiptRef"].show();
// });
router.push({ path: '/medicationmanagement/chkstock/chkstockPart' });
}
/** 打开批量商品盘点 */
function openAddStockBatch() {
// nextTick(() => {
// proxy.$refs["stockReceiptRef"].show();
// });
router.push({ path: '/medicationmanagement/chkstock/chkstockBatch' });
}
/** 修改按钮操作 */
function handleUpdate(row, view) {
editRow.value = row;
if (row.typeEnum == 4) {
// 盘点
router.push({
path: '/medicationmanagement/chkstock/chkstockPart',
query: { supplyBusNo: editRow.value.supplyBusNo, isEdit: true },
});
} else {
if (view) {
router.replace({
path: '/medicationmanagement/chkstock/chkstockBatch',
query: { supplyBusNo: row.supplyBusNo, view: view },
});
} else {
router.push({
path: '/medicationmanagement/chkstock/chkstockBatch',
query: { supplyBusNo: editRow.value.supplyBusNo },
});
}
}
}
/** 提交审核按钮 */
function handleSubmitApproval(row) {
submitApproval(row.supplyBusNo).then((response) => {
proxy.$modal.msgSuccess('提交审批成功');
open.value = false;
getList();
});
}
/** 撤回审批按钮 */
function handleWithdrawApproval(row) {
withdrawApproval(row.supplyBusNo).then((response) => {
proxy.$modal.msgSuccess('撤销审批成功');
open.value = false;
getList();
});
}
onMounted(() => {
getStockinventoryTypeList();
getList();
});
// 添加组件被激活时的处理逻辑
onActivated(() => {
// 重新加载数据
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,150 @@
import request from '@/utils/request'
// 查询盘点列表
export function getStockinventoryList(query) {
return request({
url: '/inventory-manage/stocktaking/stocktaking-receipt-page',
method: 'get',
params: query
})
}
// 盘点编辑页列表
export function getstocktakingDetail(params) {
return request({
url: '/inventory-manage/stocktaking/stocktaking-receipt',
method: 'get',
params: params // 确保参数正确传递
})
}
// 添加/编辑入库单据
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(params) {
return request({
url: '/inventory-manage/stocktaking/stocktaking-receipt-batch',
method: 'get',
params: params // 确保参数正确传递
})
}
//保存批量盘点
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: '/app-common/inventory-item-info',
method: 'get',
params: queryParams
})
}
// 获取药房列表
export function getPharmacyList() {
return request({
url: '/app-common/inventory-pharmacy-list',
// '/app-common/pharmacy-list',
method: 'get',
})
}
// 获取药库列表
export function getDispensaryList() {
return request({
url: '/app-common/inventory-cabinet-list',
// '/app-common/cabinet-list',
method: 'get',
})
}
// 获取仓库药房列表
export function getpharmacyCabinetList() {
return request({
url: '/app-common/pharmacy-cabinet-list',
method: 'get',
})
}
/**
* 审批驳回
*/
export function reject(busNo) {
return request({
url: '/inventory-manage/receipt/reject?busNo=' + busNo,
method: 'put',
})
}
/**
* 盘点审批通过
*/
export function productStocktakingApproved(busNo) {
return request({
url: '/inventory-manage/receipt/product-stocktaking-approved?busNo=' + busNo,
method: 'put',
})
}

View File

@@ -0,0 +1,338 @@
<template>
<div>
<el-dialog
v-model="dialogVisible"
v-loading="loading"
title="盘点单明细"
width="90%"
:destroy-on-close="true"
@close="close"
>
<el-row style="margin-bottom: 20px">
<template v-if="props.isApply">
<el-button
plain
type="primary"
icon="Edit"
@click="handelApply"
>
审批通过
</el-button>
<el-button
type="primary"
plain
icon="Edit"
@click="handleReject"
>
驳回
</el-button>
</template>
<el-button
type="warning"
plain
icon="Printer"
@click="handlePrint"
>
打印单据
</el-button>
<el-button
type="primary"
plain
icon="Download"
@click="handleExport"
>
导出
</el-button>
</el-row>
<el-descriptions
:column="4"
style="margin-bottom: 10px"
>
<el-descriptions-item label="单据号:">
{{ detailsList[0]?.busNo || '-' }}
</el-descriptions-item>
<el-descriptions-item label="盘点仓库:">
{{ detailsList[0]?.purposeLocationName || '-' }}
</el-descriptions-item>
<el-descriptions-item label="项目类型:">
{{ detailsList[0]?.itemType_dictText || '-' }}
</el-descriptions-item>
<el-descriptions-item label="盘点日期:">
{{ proxy.formatDateStr(detailsList[0]?.occurrenceTime, 'YYYY-MM-DD HH:mm:ss') || '-' }}
</el-descriptions-item>
</el-descriptions>
<el-table
:data="detailsList"
border
max-height="600"
>
<el-table-column
label="序号"
width="60"
type="index"
align="center"
/>
<el-table-column
label="项目名称"
align="center"
prop="itemName"
/>
<el-table-column
label="规格"
align="center"
prop="totalVolume"
:show-overflow-tooltip="true"
/>
<el-table-column
label="厂家/产地"
align="center"
prop="manufacturerText"
width="180"
:show-overflow-tooltip="true"
/>
<el-table-column
label="产品批号"
align="center"
prop="lotNumber"
/>
<el-table-column
label="单价"
align="right"
header-align="center"
prop="price"
width="120"
>
<template #default="scope">
{{ scope.row.price.toFixed(2) + ' 元' }}
</template>
</el-table-column>
<el-table-column
label="盘点单位"
align="center"
prop="measurementUnitCode_dictText"
width="80"
/>
<el-table-column
label="盘前库存"
align="right"
header-align="center"
prop="itemName"
width="100"
>
<template #default="scope">
{{
formatQuantity(
Number(scope.row.totalQuantity) - Number(scope.row.itemQuantity),
scope.row
)
}}
</template>
</el-table-column>
<el-table-column
label="实盘数量"
align="right"
header-align="center"
prop="totalQuantity"
width="100"
>
<template #default="scope">
{{ formatQuantity(scope.row.totalQuantity, scope.row) }}
</template>
</el-table-column>
<el-table-column
label="实盘金额"
align="right"
header-align="center"
prop="totalPrice"
width="120"
>
<template #default="scope">
{{ scope.row.totalPrice.toFixed(2) + ' 元' }}
</template>
</el-table-column>
<el-table-column
label="盈亏数量"
align="right"
header-align="center"
prop="itemQuantity"
width="100"
>
<template #default="scope">
{{ formatQuantity(scope.row.itemQuantity, scope.row) }}
</template>
</el-table-column>
<el-table-column
label="盈亏金额"
align="right"
header-align="center"
prop=""
>
<template #default="scope">
{{
((scope.row.itemQuantity * scope.row.price) / scope.row.partPercent).toFixed(2) + '元'
}}
</template>
</el-table-column>
<el-table-column
label="盈亏类型"
align="center"
prop="reasonCode_dictText"
/>
<el-table-column
label="盈亏原因"
align="center"
prop="reason"
/>
</el-table>
<div>
<span>合计盈亏金额{{ totalAmount ? totalAmount.toFixed(4) : 0 }}</span>
</div>
<template #footer>
<div class="dialog-footer">
<el-button @click="dialogVisible = false">
</el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup>
import {getCurrentInstance} from 'vue';
import {getstocktakingDetail, productStocktakingApproved, reject} from './api';
import templateJson from '@/views/medicationmanagement/chkstock/chkstockPart/components/template.json';
import {hiprint} from 'vue-plugin-hiprint';
import useUserStore from '@/store/modules/user';
const detailsList = ref([]);
const dialogVisible = ref(false);
const loading = ref(false);
const totalAmount = ref(0);
const supplyBusNo = ref('');
const userStore = useUserStore();
const { proxy } = getCurrentInstance();
const props = defineProps({
isApply: {
type: Boolean,
default: false,
},
});
function open(busNo) {
dialogVisible.value = true;
supplyBusNo.value = busNo;
getstocktakingDetail({ busNo: busNo, pageSize: 1000, pageNo: 1 }).then((res) => {
detailsList.value = res.data.records;
totalAmount.value = res.data.records.reduce((accumulator, currentRow) => {
return accumulator + (Number(((currentRow.itemQuantity * currentRow.price) / currentRow.partPercent).toFixed(2)) || 0);
}, 0);
});
}
function formatQuantity(quantity, row) {
if (row.measurementUnitCode == row.unitCode) {
return formatInventory(
quantity,
row.partPercent,
row.unitCode_dictText,
row.minUnitCode_dictText
);
} else {
return quantity + row.minUnitCode_dictText;
}
}
function handelApply() {
loading.value = true;
productStocktakingApproved(supplyBusNo.value).then((res) => {
if (res.code == 200) {
proxy.$modal.msgSuccess('操作成功');
loading.value = false;
}
});
}
function handleReject() {
reject(supplyBusNo.value).then((res) => {
if (res.code == 200) {
proxy.$modal.msgSuccess('操作成功');
}
});
}
/**
* 格式化库存数量显示(大单位情况)
* @param quantity 小单位库存数量
* @param partPercent 拆零比
* @param unitCode 大单位
* @param minUnitCode 小单位
*/
function formatInventory(quantity, partPercent, unitCode, minUnitCode) {
// 处理负数情况
const isNegative = quantity < 0;
const absQuantity = Math.abs(quantity);
if (absQuantity % partPercent !== 0) {
const integerPart = Math.floor(absQuantity / partPercent);
const decimalPart = absQuantity % partPercent;
let result = integerPart.toString() + ' ' + unitCode;
if (decimalPart > 0) {
result += decimalPart.toString() + ' ' + minUnitCode;
}
return isNegative ? '-' + result : result;
}
// 整除情况
const result = absQuantity / partPercent + ' ' + unitCode;
return isNegative ? '-' + result : result;
}
// 打印盘点单
function handlePrint() {
const result = [];
const printList = detailsList.value.map((item) => {
return {
...item,
name: item.itemName,
volume: item.totalVolume,
price: Number(item.price).toFixed(2),
itemQuantity: formatQuantity(item.itemQuantity, item),
profitAmount: ((item.itemQuantity * item.price) / item.partPercent).toFixed(2),
};
});
result.push({
purposeLocationName: printList[0].purposeLocationName,
name: userStore.name,
// totalAmount: totalAmount.value.toFixed(2),
occurrenceTime: proxy.formatDateStr(printList[0].occurrenceTime, 'YYYY-MM-DD HH:mm:ss'),
busNo: printList[0].busNo,
purposeLocationName: printList[0].purposeLocationName,
purchaseinventoryList: printList,
});
const printElements = JSON.parse(
JSON.stringify(templateJson).replace(/{{HOSPITAL_NAME}}/g, userStore.hospitalName)
);
var hiprintTemplate = new hiprint.PrintTemplate({ template: printElements }); // 定义模板
hiprintTemplate.print2(result, {
// printer: 'EPSON LQ-80KFII',
title: '打印标题',
}); //开始打印
}
// 导出
function handleExport() {
proxy.downloadGet(
'/inventory-manage/stocktaking/excel-out',
{
busNo: supplyBusNo.value,
},
`盘点单明细_${proxy.formatDateStr(new Date(), 'YYYY-MM-DD')}.xlsx`
);
}
defineExpose({
open,
});
</script>

View File

@@ -0,0 +1,143 @@
<template>
<div>
<el-table
ref="medicineRef"
height="400"
:data="medicineList"
@cell-click="clickRow"
>
<el-table-column
label="项目名称"
align="center"
prop="name"
width="200"
:show-overflow-tooltip="true"
/>
<el-table-column
label="项目类型"
align="center"
prop="itemType_enumText"
:show-overflow-tooltip="true"
/>
<el-table-column
label="包装单位"
align="center"
prop="unitCode_dictText"
:show-overflow-tooltip="true"
/>
<el-table-column
label="最小单位"
align="center"
prop="minUnitCode_dictText"
:show-overflow-tooltip="true"
/>
<el-table-column
label="规格"
align="center"
prop="volume"
:show-overflow-tooltip="true"
/>
<el-table-column
label="产品批号"
align="center"
prop="lotNumber"
/>
<!-- <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="manufacturerText"
/>
<el-table-column
label="编码"
align="center"
prop="ybNo"
/>
</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>
import {getMedicineList} from "./api";
import {ref, watch} from "vue";
import {throttle} from "lodash-es";
const router = useRouter();
const route = useRoute();
const total = ref(0)
const props = defineProps({
searchKey: {
type: String,
default: "",
},
itemType: {
type: String,
default: "",
},
purposeLocationId:{
type: String,
default: "",
},
});
const emit = defineEmits(["selectRow"]);
const queryParams = ref({
// pageNum: 1,
// pageSize: 50,
itemType: props.itemType,
orgLocationId:props.purposeLocationId,
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.purposeLocationId;
queryParams.value.purchaseFlag = 0
throttledGetList();
},
{ immdiate: true, deep: true }
);
getList();
function getList() {
console.log(queryParams.value,"queryParams.value")
getMedicineList(queryParams.value).then((res) => {
medicineList.value = res.data.records?res.data.records:res.data
total.value = res.data.total?res.data.total:medicineList.value.length
console.log(medicineList.value,"medicineList.value ")
});
}
function clickRow(row) {
emit("selectRow", row);
}
</script>
<style scoped>
</style>