修改库房管理-》采购管理-》采购入库:仓库字段值为中心耗材库在采购管理未显示的问题,修改了采购入库仓库字段值的布局样式,修改了在批量保存入库业务中添加申请人等核心数据数据,
修改了获取入库数据的查询SQL语句。
This commit is contained in:
@@ -25,6 +25,7 @@ import com.openhis.web.inventorymanage.dto.*;
|
|||||||
import com.openhis.web.inventorymanage.mapper.PurchaseInventoryMapper;
|
import com.openhis.web.inventorymanage.mapper.PurchaseInventoryMapper;
|
||||||
import com.openhis.workflow.domain.SupplyRequest;
|
import com.openhis.workflow.domain.SupplyRequest;
|
||||||
import com.openhis.workflow.service.ISupplyRequestService;
|
import com.openhis.workflow.service.ISupplyRequestService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
@@ -40,6 +41,7 @@ import java.util.stream.Stream;
|
|||||||
* @author zwh
|
* @author zwh
|
||||||
* @date 2025-03-08
|
* @date 2025-03-08
|
||||||
*/
|
*/
|
||||||
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
public class PurchaseInventoryAppServiceImpl implements IPurchaseInventoryAppService {
|
public class PurchaseInventoryAppServiceImpl implements IPurchaseInventoryAppService {
|
||||||
|
|
||||||
@@ -159,6 +161,7 @@ public class PurchaseInventoryAppServiceImpl implements IPurchaseInventoryAppSer
|
|||||||
@Override
|
@Override
|
||||||
public R<List<ReceiptDetailDto>> getDetail(String busNo) {
|
public R<List<ReceiptDetailDto>> getDetail(String busNo) {
|
||||||
List<ReceiptDetailDto> receiptDetailList = purchaseInventoryMapper.selectDetail(busNo);
|
List<ReceiptDetailDto> receiptDetailList = purchaseInventoryMapper.selectDetail(busNo);
|
||||||
|
log.debug("返回查询结果,receiptDetailList:{}", receiptDetailList);
|
||||||
if (receiptDetailList.isEmpty()) {
|
if (receiptDetailList.isEmpty()) {
|
||||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00006, null));
|
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00006, null));
|
||||||
}
|
}
|
||||||
@@ -182,7 +185,7 @@ public class PurchaseInventoryAppServiceImpl implements IPurchaseInventoryAppSer
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
log.debug("返回查询结果,receiptDetailList:{}", receiptDetailList);
|
||||||
return R.ok(receiptDetailList);
|
return R.ok(receiptDetailList);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -194,7 +197,6 @@ public class PurchaseInventoryAppServiceImpl implements IPurchaseInventoryAppSer
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public R<?> addOrEditInventoryReceipt(List<PurchaseInventoryDto> purchaseInventoryDtoList) {
|
public R<?> addOrEditInventoryReceipt(List<PurchaseInventoryDto> purchaseInventoryDtoList) {
|
||||||
|
|
||||||
// 校验(已经审批通过的单号(请求状态是同意),不能再重复编辑请求)
|
// 校验(已经审批通过的单号(请求状态是同意),不能再重复编辑请求)
|
||||||
boolean validation = supplyRequestService.supplyRequestValidation(purchaseInventoryDtoList.get(0).getBusNo());
|
boolean validation = supplyRequestService.supplyRequestValidation(purchaseInventoryDtoList.get(0).getBusNo());
|
||||||
if (validation) {
|
if (validation) {
|
||||||
@@ -232,11 +234,14 @@ public class PurchaseInventoryAppServiceImpl implements IPurchaseInventoryAppSer
|
|||||||
// 制单人
|
// 制单人
|
||||||
.setApplicantId(SecurityUtils.getLoginUser().getPractitionerId())
|
.setApplicantId(SecurityUtils.getLoginUser().getPractitionerId())
|
||||||
// 申请时间
|
// 申请时间
|
||||||
.setApplyTime(DateUtils.getNowDate());
|
.setApplyTime(DateUtils.getNowDate())
|
||||||
|
|
||||||
|
.setCreateBy(SecurityUtils.getLoginUser().getUsername())
|
||||||
|
.setCreateTime(DateUtils.getNowDate())
|
||||||
|
.setTenantId(SecurityUtils.getLoginUser().getTenantId());
|
||||||
supplyRequestList.add(supplyRequest);
|
supplyRequestList.add(supplyRequest);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 保存
|
// 保存
|
||||||
supplyRequestService.saveOrUpdateBatch(supplyRequestList);
|
supplyRequestService.saveOrUpdateBatch(supplyRequestList);
|
||||||
|
|
||||||
|
|||||||
@@ -86,7 +86,7 @@
|
|||||||
T3.total_volume,
|
T3.total_volume,
|
||||||
T5."name" AS practitioner_name,
|
T5."name" AS practitioner_name,
|
||||||
T6."name" AS purpose_location_name,
|
T6."name" AS purpose_location_name,
|
||||||
T6."id" AS purpose_location_id,
|
T1.purpose_location_id AS purpose_location_id,
|
||||||
T7."name" AS purpose_location_store_name,
|
T7."name" AS purpose_location_store_name,
|
||||||
T1.occurrence_time,
|
T1.occurrence_time,
|
||||||
(SELECT SUM(T9.quantity)
|
(SELECT SUM(T9.quantity)
|
||||||
@@ -119,7 +119,7 @@
|
|||||||
ON T1.supplier_id = T10.id
|
ON T1.supplier_id = T10.id
|
||||||
AND T10.delete_flag = '0'
|
AND T10.delete_flag = '0'
|
||||||
LEFT JOIN sys_dict_data sdt
|
LEFT JOIN sys_dict_data sdt
|
||||||
ON sdt.dict_value = T1.unit_code AND dict_type = 'unit_code'
|
ON sdt.dict_value = T1.unit_code AND sdt.dict_type = 'unit_code'
|
||||||
WHERE T1.bus_no = #{busNo}
|
WHERE T1.bus_no = #{busNo}
|
||||||
AND T1.delete_flag = '0'
|
AND T1.delete_flag = '0'
|
||||||
UNION
|
UNION
|
||||||
@@ -145,7 +145,7 @@
|
|||||||
T8."size" AS total_volume,
|
T8."size" AS total_volume,
|
||||||
T5."name" AS practitioner_name,
|
T5."name" AS practitioner_name,
|
||||||
T6."name" AS purpose_location_name,
|
T6."name" AS purpose_location_name,
|
||||||
T6."id" AS purpose_location_id,
|
T1.purpose_location_id AS purpose_location_id,
|
||||||
T7."name" AS purpose_location_store_name,
|
T7."name" AS purpose_location_store_name,
|
||||||
T1.occurrence_time,
|
T1.occurrence_time,
|
||||||
(SELECT SUM(T9.quantity)
|
(SELECT SUM(T9.quantity)
|
||||||
@@ -175,7 +175,7 @@
|
|||||||
ON T1.supplier_id = T10.id
|
ON T1.supplier_id = T10.id
|
||||||
AND T10.delete_flag = '0'
|
AND T10.delete_flag = '0'
|
||||||
LEFT JOIN sys_dict_data sdt
|
LEFT JOIN sys_dict_data sdt
|
||||||
ON sdt.dict_value = T1.unit_code AND dict_type = 'unit_code'
|
ON sdt.dict_value = T1.unit_code AND sdt.dict_type = 'unit_code'
|
||||||
WHERE T1.bus_no = #{busNo}
|
WHERE T1.bus_no = #{busNo}
|
||||||
AND T1.delete_flag = '0'
|
AND T1.delete_flag = '0'
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
@@ -24,9 +24,9 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="10" class="mb8" v-else>
|
<el-row :gutter="10" class="mb8" v-else>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="primary" plain icon="Plus" @click="submitAudit"
|
<el-button type="primary" plain icon="Plus" @click="submitAudit">
|
||||||
>提交审核</el-button
|
提交审核
|
||||||
>
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="primary" plain icon="EditPen" @click="handleTotalAmount">
|
<el-button type="primary" plain icon="EditPen" @click="handleTotalAmount">
|
||||||
@@ -35,7 +35,8 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="primary" plain icon="Plus" @click="handleSave"
|
<el-button type="primary" plain icon="Plus" @click="handleSave"
|
||||||
>批量保存</el-button
|
>批量保存
|
||||||
|
</el-button
|
||||||
>
|
>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@@ -271,11 +272,11 @@
|
|||||||
>
|
>
|
||||||
<div class="select_wrapper_div">
|
<div class="select_wrapper_div">
|
||||||
<el-select
|
<el-select
|
||||||
|
v-if="viewStatus !== 'view'"
|
||||||
v-model="scope.row.purposeLocationId"
|
v-model="scope.row.purposeLocationId"
|
||||||
placeholder="请选择仓库"
|
placeholder="请选择仓库"
|
||||||
:class="{ 'error-border': scope.row.error }"
|
:class="{ 'error-border': scope.row.error }"
|
||||||
clearable
|
clearable
|
||||||
:disabled="viewStatus == 'view'"
|
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="(item, index) in locationList"
|
v-for="(item, index) in locationList"
|
||||||
@@ -285,8 +286,19 @@
|
|||||||
@click="handleLocationClick(item, scope.row, scope.$index)"
|
@click="handleLocationClick(item, scope.row, scope.$index)"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
|
|
||||||
|
<!-- 非编辑状态下显示为只读输入框 -->
|
||||||
|
<el-input
|
||||||
|
v-else
|
||||||
|
:model-value="getLocationNameById(scope.row.purposeLocationId)"
|
||||||
|
readonly
|
||||||
|
disabled
|
||||||
|
:placeholder="'-'"
|
||||||
|
class="readonly-input" style="pointer-events: none;"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
@@ -724,7 +736,27 @@ const {
|
|||||||
"specialty_code",
|
"specialty_code",
|
||||||
"purchase_type"
|
"purchase_type"
|
||||||
);
|
);
|
||||||
|
//
|
||||||
|
// // 监听locationList变化,重新处理已存在的数据
|
||||||
|
// watch(locationList, (newList) => {
|
||||||
|
// if (newList && newList.length > 0) {
|
||||||
|
// // 可以触发表格重新渲染或更新相关数据
|
||||||
|
// }
|
||||||
|
// }, { immediate: true });
|
||||||
|
const getLocationNameById = (id) => {
|
||||||
|
|
||||||
|
// 检查locationList是否已加载
|
||||||
|
if (!locationList.value || !Array.isArray(locationList.value) || locationList.value.length === 0) {
|
||||||
|
return '仓库列表未加载';
|
||||||
|
}
|
||||||
|
|
||||||
|
// 使用严格相等比较,处理类型转换
|
||||||
|
const location = locationList.value.find(item => {
|
||||||
|
return item.id == id; // 使用 == 而不是 === 以处理字符串和数字之间的比较
|
||||||
|
});
|
||||||
|
|
||||||
|
return location ? location.name : '仓库不存在';
|
||||||
|
};
|
||||||
const viewStatus = ref("");
|
const viewStatus = ref("");
|
||||||
const startTimeOld = ref("");
|
const startTimeOld = ref("");
|
||||||
const endTimeOld = ref("");
|
const endTimeOld = ref("");
|
||||||
|
|||||||
@@ -205,9 +205,9 @@
|
|||||||
>
|
>
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<!-- v-hasPermi="['system:user:edit']" -->
|
<!-- v-hasPermi="['system:user:edit']" -->
|
||||||
<el-button link type="primary" icon="View" @click.stop="handleUpdate(scope.row, 'view')"
|
<el-button link type="primary" icon="View" @click.stop="handleUpdate(scope.row, 'view')">
|
||||||
>详情</el-button
|
详情
|
||||||
>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
link
|
link
|
||||||
type="primary"
|
type="primary"
|
||||||
@@ -588,6 +588,7 @@ function handleUpdate(row, view) {
|
|||||||
// 采购入库
|
// 采购入库
|
||||||
editRow.value = row;
|
editRow.value = row;
|
||||||
getpurchaseInventoryDetail(row.supplyBusNo).then((response) => {
|
getpurchaseInventoryDetail(row.supplyBusNo).then((response) => {
|
||||||
|
console.log('返回的数据,response:', response.data)
|
||||||
currentData.value = response.data;
|
currentData.value = response.data;
|
||||||
// nextTick(() => {
|
// nextTick(() => {
|
||||||
// proxy.$refs['inventoryReceiptRef'].edit();
|
// proxy.$refs['inventoryReceiptRef'].edit();
|
||||||
@@ -604,7 +605,6 @@ function handleUpdate(row, view) {
|
|||||||
path: 'purchaseDocument',
|
path: 'purchaseDocument',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
getList();
|
getList();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user