药品出货单按钮被隐藏bug修复
This commit is contained in:
@@ -59,12 +59,12 @@ public class PharmacyWarehouseStockOutOrderServiceImpl implements IPharmacyWareh
|
|||||||
|
|
||||||
// 单据分类
|
// 单据分类
|
||||||
List<PharmacyWarehouseInitDto.IntegerOption> supplyCategoryOption = new ArrayList<>();
|
List<PharmacyWarehouseInitDto.IntegerOption> supplyCategoryOption = new ArrayList<>();
|
||||||
// supplyCategoryOption.add(new PharmacyWarehouseInitDto.IntegerOption(SupplyCategory.IN_HOSPITAL_OUTBOUND.getValue(),
|
supplyCategoryOption.add(new PharmacyWarehouseInitDto.IntegerOption(SupplyCategory.IN_HOSPITAL_OUTBOUND.getValue(),
|
||||||
// SupplyCategory.IN_HOSPITAL_OUTBOUND.getInfo()));
|
SupplyCategory.IN_HOSPITAL_OUTBOUND.getInfo()));
|
||||||
// supplyCategoryOption.add(new PharmacyWarehouseInitDto.IntegerOption(SupplyCategory.OUT_OF_HOSPITAL_OUTBOUND.getValue(),
|
supplyCategoryOption.add(new PharmacyWarehouseInitDto.IntegerOption(SupplyCategory.OUT_OF_HOSPITAL_OUTBOUND.getValue(),
|
||||||
// SupplyCategory.OUT_OF_HOSPITAL_OUTBOUND.getInfo()));
|
SupplyCategory.OUT_OF_HOSPITAL_OUTBOUND.getInfo()));
|
||||||
// supplyCategoryOption.add(new PharmacyWarehouseInitDto.IntegerOption(SupplyCategory.OTHER_OUTBOUND.getValue(),
|
supplyCategoryOption.add(new PharmacyWarehouseInitDto.IntegerOption(SupplyCategory.OTHER_OUTBOUND.getValue(),
|
||||||
// SupplyCategory.OTHER_OUTBOUND.getInfo()));
|
SupplyCategory.OTHER_OUTBOUND.getInfo()));
|
||||||
|
|
||||||
purchaseOrderInitDto.setSupplyCategoryOptions(supplyCategoryOption);
|
purchaseOrderInitDto.setSupplyCategoryOptions(supplyCategoryOption);
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ public enum SupplyCategory implements HisEnumInterface {
|
|||||||
/**
|
/**
|
||||||
* 非库存供应
|
* 非库存供应
|
||||||
*/
|
*/
|
||||||
NON_STOCK(2, "2", "非库存供应");
|
NON_STOCK(2, "2", "非库存供应"),
|
||||||
|
|
||||||
// /**
|
// /**
|
||||||
// * 普通
|
// * 普通
|
||||||
@@ -61,15 +61,15 @@ public enum SupplyCategory implements HisEnumInterface {
|
|||||||
// /**
|
// /**
|
||||||
// * 院内出库
|
// * 院内出库
|
||||||
// */
|
// */
|
||||||
// IN_HOSPITAL_OUTBOUND(11, "11","0.院内出库"),
|
IN_HOSPITAL_OUTBOUND(11, "11","0.院内出库"),
|
||||||
// /**
|
// /**
|
||||||
// * 院外出库
|
// * 院外出库
|
||||||
// */
|
// */
|
||||||
// OUT_OF_HOSPITAL_OUTBOUND(12, "12","1.院外出库"),
|
OUT_OF_HOSPITAL_OUTBOUND(12, "12","1.院外出库"),
|
||||||
// /**
|
// /**
|
||||||
// * 其他出库
|
// * 其他出库
|
||||||
// */
|
// */
|
||||||
// OTHER_OUTBOUND(13, "13","2.其他出库"),
|
OTHER_OUTBOUND(13, "13","2.其他出库");
|
||||||
// /**
|
// /**
|
||||||
// * 普通损益
|
// * 普通损益
|
||||||
// */
|
// */
|
||||||
|
|||||||
@@ -1353,27 +1353,37 @@ const handleSave = async () => {
|
|||||||
addOrEditOrder(editData).then((res) => {
|
addOrEditOrder(editData).then((res) => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
proxy.$message.success('新增成功');
|
proxy.$message.success('新增成功');
|
||||||
// 调用父组件的 getList 方法
|
// 调用父组件的 getList 方法,传递 true 清除临时订单
|
||||||
emit('getList');
|
emit('getList', true);
|
||||||
// 清空表单
|
// 清空表单
|
||||||
resetAllData();
|
resetAllData();
|
||||||
// 关闭加载
|
// 关闭加载
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
|
} else {
|
||||||
|
proxy.$message.error(res.msg || '新增失败');
|
||||||
|
loading.value = false;
|
||||||
}
|
}
|
||||||
|
}).catch((error) => {
|
||||||
|
proxy.$message.error(error.message || '新增失败,请检查网络或联系管理员');
|
||||||
|
loading.value = false;
|
||||||
});
|
});
|
||||||
} else if (localIsAddOrEditOrder.value.isEditOrder) {
|
} else if (localIsAddOrEditOrder.value.isEditOrder) {
|
||||||
addOrEditOrder(editData).then((res) => {
|
addOrEditOrder(editData).then((res) => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
proxy.$message.success('保存成功');
|
proxy.$message.success('保存成功');
|
||||||
// 调用父组件的 getList 方法
|
// 调用父组件的 getList 方法,传递 true 清除临时订单
|
||||||
emit('getList');
|
emit('getList', true);
|
||||||
// 清空表单
|
// 清空表单
|
||||||
resetAllData();
|
resetAllData();
|
||||||
} else {
|
} else {
|
||||||
proxy.$message.error('保存失败');
|
proxy.$message.error(res.msg || '保存失败');
|
||||||
}
|
}
|
||||||
// 关闭加载
|
// 关闭加载
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
|
}).catch((error) => {
|
||||||
|
proxy.$message.error(error.message || '保存失败,请检查网络或联系管理员');
|
||||||
|
// 关闭加载
|
||||||
|
loading.value = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -113,6 +113,14 @@
|
|||||||
<el-row :gutter="10">
|
<el-row :gutter="10">
|
||||||
<el-scrollbar height="calc(100vh - 350px)" style="width: 100%">
|
<el-scrollbar height="calc(100vh - 350px)" style="width: 100%">
|
||||||
<div class="order-list-container">
|
<div class="order-list-container">
|
||||||
|
<!-- 始终显示新增单据按钮 -->
|
||||||
|
<div class="add-order-button-container">
|
||||||
|
<el-button type="primary" @click="handleAdd" :disabled="isAddDisabled" style="width: 100%">
|
||||||
|
<el-icon><Plus /></el-icon>
|
||||||
|
新增单据
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- 有数据时显示列表 -->
|
<!-- 有数据时显示列表 -->
|
||||||
<template v-if="orderList.length > 0">
|
<template v-if="orderList.length > 0">
|
||||||
<div
|
<div
|
||||||
@@ -161,11 +169,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<!-- 空状态显示 -->
|
<!-- 空状态显示(仅在没有数据且没有临时单据时显示) -->
|
||||||
<div v-else class="empty-state">
|
<div v-else-if="!currentTempOrder" class="empty-state">
|
||||||
<el-empty description="暂无单据" :image-size="80">
|
<el-empty description="暂无单据" :image-size="80" />
|
||||||
<el-button type="primary" @click="handleAdd"> 新增单据 </el-button>
|
|
||||||
</el-empty>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-scrollbar>
|
</el-scrollbar>
|
||||||
@@ -205,7 +211,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue';
|
import { ref, nextTick } from 'vue';
|
||||||
import { useRoute, useRouter } from 'vue-router';
|
import { useRoute, useRouter } from 'vue-router';
|
||||||
import orderTable from './components/orderTable.vue';
|
import orderTable from './components/orderTable.vue';
|
||||||
import {
|
import {
|
||||||
@@ -275,6 +281,8 @@ const acceptanceResultoryOptions = ref([]);
|
|||||||
const pharmacyListOptions = ref([]);
|
const pharmacyListOptions = ref([]);
|
||||||
// 订货单单据列表 orderList
|
// 订货单单据列表 orderList
|
||||||
const orderList = ref([]);
|
const orderList = ref([]);
|
||||||
|
// 存储当前的临时订单,用于确保它不会被覆盖
|
||||||
|
const currentTempOrder = ref(null);
|
||||||
// 订货单单据列表总条数
|
// 订货单单据列表总条数
|
||||||
const tableDataTotal = ref(0);
|
const tableDataTotal = ref(0);
|
||||||
// 选中的单据ID
|
// 选中的单据ID
|
||||||
@@ -324,10 +332,29 @@ const init = async () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// 获取订货单单据列表
|
// 获取订货单单据列表
|
||||||
const getList = async () => {
|
const getList = async (clearTempOrder = false) => {
|
||||||
const res = await getOrderList(queryParams.value);
|
const res = await getOrderList(queryParams.value);
|
||||||
// 订货单单据列表 orderList
|
// 获取API返回的真实订单
|
||||||
orderList.value = res.data.records;
|
const realOrders = res.data.records || [];
|
||||||
|
|
||||||
|
// 如果指定清除临时订单(保存成功后),清除临时订单
|
||||||
|
if (clearTempOrder) {
|
||||||
|
currentTempOrder.value = null;
|
||||||
|
orderList.value = realOrders;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查是否有当前的临时订单
|
||||||
|
if (currentTempOrder.value) {
|
||||||
|
// 如果有临时订单,保留它并添加到真实订单之后(按钮下方)
|
||||||
|
orderList.value = [...realOrders, currentTempOrder.value];
|
||||||
|
|
||||||
|
// 确保选中状态仍然是临时订单
|
||||||
|
selectedOrder.value = currentTempOrder.value;
|
||||||
|
} else {
|
||||||
|
// 如果没有临时订单,直接使用真实订单
|
||||||
|
orderList.value = realOrders;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// 新增按钮
|
// 新增按钮
|
||||||
@@ -358,6 +385,26 @@ const handleAdd = async () => {
|
|||||||
isEditOrder: false,
|
isEditOrder: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 创建临时新增订单对象并添加到左侧列表
|
||||||
|
const tempOrder = {
|
||||||
|
supplyBusNo: '新增单据',
|
||||||
|
applicantId: userInfo.practitionerId,
|
||||||
|
applicantId_dictText: userInfo.nickName,
|
||||||
|
statusEnum_enumText: '新增',
|
||||||
|
typeEnum_enumText: '药品出库',
|
||||||
|
applyTime: new Date().getTime(),
|
||||||
|
// 添加一个临时标识,用于后续识别和处理
|
||||||
|
isTempOrder: true
|
||||||
|
};
|
||||||
|
|
||||||
|
// 存储临时订单到单独变量
|
||||||
|
currentTempOrder.value = tempOrder;
|
||||||
|
|
||||||
|
// 将临时订单添加到订单列表末尾(按钮下方)
|
||||||
|
orderList.value = [...orderList.value, tempOrder];
|
||||||
|
// 设置为选中状态
|
||||||
|
selectedOrder.value = tempOrder;
|
||||||
|
|
||||||
// 延迟执行
|
// 延迟执行
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
// 更新按钮状态为编辑模式
|
// 更新按钮状态为编辑模式
|
||||||
@@ -404,6 +451,32 @@ const handleEdit = async (order) => {
|
|||||||
proxy.$modal.msgError('请选择要编辑的单据');
|
proxy.$modal.msgError('请选择要编辑的单据');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 检查是否是临时新增的订单
|
||||||
|
if (selectedOrder.value.isTempOrder) {
|
||||||
|
// 对于临时订单,不需要调用API获取详情,直接保持编辑状态
|
||||||
|
isAddOrEditOrder.value = {
|
||||||
|
isAddOrder: true,
|
||||||
|
isEditOrder: false,
|
||||||
|
};
|
||||||
|
|
||||||
|
// 更新按钮状态为编辑模式
|
||||||
|
handleUpdateButtonState({
|
||||||
|
isAuditDisabled: true,
|
||||||
|
isCancelDisabled: false,
|
||||||
|
isDeleteDisabled: true,
|
||||||
|
isAddDisabled: true,
|
||||||
|
isEditDisabled: true,
|
||||||
|
isAddShow: true,
|
||||||
|
isDeleteShow: false,
|
||||||
|
isSaveShow: false,
|
||||||
|
isEditShow: false,
|
||||||
|
isOrderImport: true,
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 对于正常订单,调用API获取详情
|
||||||
const res = await getOrderDetail({
|
const res = await getOrderDetail({
|
||||||
busNo: selectedOrder.value.supplyBusNo,
|
busNo: selectedOrder.value.supplyBusNo,
|
||||||
pageNo: tableForm.value.pageNo,
|
pageNo: tableForm.value.pageNo,
|
||||||
@@ -640,6 +713,13 @@ const buildEditForm = (data) => {
|
|||||||
};
|
};
|
||||||
// 取消按钮
|
// 取消按钮
|
||||||
const handleCancel = () => {
|
const handleCancel = () => {
|
||||||
|
// 移除临时新增的订单
|
||||||
|
orderList.value = orderList.value.filter(order => !order.isTempOrder);
|
||||||
|
// 清空当前临时订单
|
||||||
|
currentTempOrder.value = null;
|
||||||
|
// 重置选中状态
|
||||||
|
selectedOrder.value = null;
|
||||||
|
|
||||||
// 更新按钮状态为初始状态
|
// 更新按钮状态为初始状态
|
||||||
handleUpdateButtonState({
|
handleUpdateButtonState({
|
||||||
// 审核 按钮禁用
|
// 审核 按钮禁用
|
||||||
@@ -895,6 +975,17 @@ init();
|
|||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 新增单据按钮容器
|
||||||
|
.add-order-button-container {
|
||||||
|
width: 100%;
|
||||||
|
padding: 10px 0;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
position: sticky;
|
||||||
|
top: 0;
|
||||||
|
background: #fff;
|
||||||
|
z-index: 10;
|
||||||
|
}
|
||||||
|
|
||||||
// 订单列表项样式
|
// 订单列表项样式
|
||||||
.order-item {
|
.order-item {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|||||||
Reference in New Issue
Block a user