diff --git a/core/api/src/main/java/com/wansenai/api/receipt/RetailController.java b/core/api/src/main/java/com/wansenai/api/receipt/RetailController.java index 2a3e0db5..42a51bd4 100644 --- a/core/api/src/main/java/com/wansenai/api/receipt/RetailController.java +++ b/core/api/src/main/java/com/wansenai/api/receipt/RetailController.java @@ -67,6 +67,11 @@ public Response detail(@PathVariable("id") Long id) { return receiptRetailService.getRetailShipmentsDetail(id); } + @GetMapping("/shipments/getLinkShipmentDetail/{otherReceipt}") + public Response getLinkShipmentDetail(@PathVariable("otherReceipt") String otherReceipt) { + return receiptRetailService.getLinkRetailShipmentsDetail(otherReceipt); + } + @PostMapping("/refund/pageList") public Response> refundPageList(@RequestBody QueryRetailRefundDTO refundDTO) { return receiptRetailService.getRetailRefund(refundDTO); @@ -82,6 +87,11 @@ public Response refundDetail(@PathVariable("id") Long id) return receiptRetailService.getRetailRefundDetail(id); } + @GetMapping("/refund/getLinkRefundDetail/{otherReceipt}") + public Response getLinkRefundDetail(@PathVariable("otherReceipt") String otherReceipt) { + return receiptRetailService.getLinkRetailRefundDetail(otherReceipt); + } + @PostMapping("/refund/deleteByIds") public Response refundDeleteByIds(@RequestParam("ids") List ids) { return receiptRetailService.deleteRetailRefund(ids); diff --git a/core/domain/src/main/java/com/wansenai/bo/ShipmentsDataBO.java b/core/domain/src/main/java/com/wansenai/bo/ShipmentsDataBO.java index f65d84d7..7cf1893a 100644 --- a/core/domain/src/main/java/com/wansenai/bo/ShipmentsDataBO.java +++ b/core/domain/src/main/java/com/wansenai/bo/ShipmentsDataBO.java @@ -18,6 +18,8 @@ public class ShipmentsDataBO { @JsonFormat(shape = JsonFormat.Shape.STRING) private Long warehouseId; + private String warehouseName; + private String productCode; @JsonFormat(shape = JsonFormat.Shape.STRING) @@ -29,6 +31,10 @@ public class ShipmentsDataBO { private String productUnit; + private String productModel; + + private String productColor; + private String productStandard; private Integer stock; diff --git a/core/domain/src/main/java/com/wansenai/vo/receipt/retail/RetailRefundDetailVO.java b/core/domain/src/main/java/com/wansenai/vo/receipt/retail/RetailRefundDetailVO.java index 598cdd89..ebad645d 100644 --- a/core/domain/src/main/java/com/wansenai/vo/receipt/retail/RetailRefundDetailVO.java +++ b/core/domain/src/main/java/com/wansenai/vo/receipt/retail/RetailRefundDetailVO.java @@ -31,9 +31,13 @@ public class RetailRefundDetailVO { @JsonFormat(shape = JsonFormat.Shape.STRING) private Long memberId; + private String memberName; + @JsonFormat(shape = JsonFormat.Shape.STRING) private Long accountId; + private String accountName; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private LocalDateTime receiptDate; @@ -41,6 +45,8 @@ public class RetailRefundDetailVO { private String otherReceipt; + private String paymentType; + @JsonSerialize(using = BigDecimalSerializerBO.class) private BigDecimal paymentAmount; @@ -55,4 +61,6 @@ public class RetailRefundDetailVO { private List tableData; private List files; + + private Integer status; } diff --git a/core/domain/src/main/java/com/wansenai/vo/receipt/retail/RetailShipmentsDetailVO.java b/core/domain/src/main/java/com/wansenai/vo/receipt/retail/RetailShipmentsDetailVO.java index 1efc1904..c0dd7333 100644 --- a/core/domain/src/main/java/com/wansenai/vo/receipt/retail/RetailShipmentsDetailVO.java +++ b/core/domain/src/main/java/com/wansenai/vo/receipt/retail/RetailShipmentsDetailVO.java @@ -31,9 +31,13 @@ public class RetailShipmentsDetailVO { @JsonFormat(shape = JsonFormat.Shape.STRING) private Long memberId; + private String memberName; + @JsonFormat(shape = JsonFormat.Shape.STRING) private Long accountId; + private String accountName; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private LocalDateTime receiptDate; @@ -55,4 +59,6 @@ public class RetailShipmentsDetailVO { private List tableData; private List files; + + private Integer status; } diff --git a/core/service/src/main/java/com/wansenai/service/common/CommonService.java b/core/service/src/main/java/com/wansenai/service/common/CommonService.java index a9df3d6f..9e1ce10c 100644 --- a/core/service/src/main/java/com/wansenai/service/common/CommonService.java +++ b/core/service/src/main/java/com/wansenai/service/common/CommonService.java @@ -33,4 +33,6 @@ public interface CommonService { Response generateSnowflakeId(String type); List getFileList(String fileId); + + String getWarehouseName(Long warehouseId); } diff --git a/core/service/src/main/java/com/wansenai/service/common/CommonServiceImpl.java b/core/service/src/main/java/com/wansenai/service/common/CommonServiceImpl.java index 0c763c38..62137b76 100644 --- a/core/service/src/main/java/com/wansenai/service/common/CommonServiceImpl.java +++ b/core/service/src/main/java/com/wansenai/service/common/CommonServiceImpl.java @@ -718,6 +718,11 @@ public List getFileList(String fileId) { return fileList; } + @Override + public String getWarehouseName(Long warehouseId) { + return warehouseService.getById(warehouseId).getWarehouseName(); + } + private String getCellValue(Cell cell, DataFormatter dataFormatter) { if (cell != null) { String value = dataFormatter.formatCellValue(cell); diff --git a/core/service/src/main/java/com/wansenai/service/receipt/ReceiptRetailService.java b/core/service/src/main/java/com/wansenai/service/receipt/ReceiptRetailService.java index f9d2c4c1..f2830249 100644 --- a/core/service/src/main/java/com/wansenai/service/receipt/ReceiptRetailService.java +++ b/core/service/src/main/java/com/wansenai/service/receipt/ReceiptRetailService.java @@ -82,6 +82,17 @@ public interface ReceiptRetailService extends IService { */ Response getRetailShipmentsDetail(Long id); + /** + * Query the detailed data of shipment receipt based on the associated document number + * 根据关联单号查询出库单详情数据 + * + * @param receiptNumber associated document number + * 关联单号 + * @return Returns the detailed data of the shipment receipt + * 返回出库单详情数据 + */ + Response getLinkRetailShipmentsDetail(String receiptNumber); + /** * According to the id collection and status, the status of the retail shipment order is modified in batches. *

@@ -140,6 +151,17 @@ public interface ReceiptRetailService extends IService { */ Response getRetailRefundDetail(Long id); + /** + * Query return receipt details data based on return order number + * 根据退货单号查询退货单详情数据 + * + * @param otherReceipt Return order number + * 退货单号 + * @return Return order details data + * 退货单详情数据 + */ + Response getLinkRetailRefundDetail(String otherReceipt); + /** * Delete retail return document data based on ID * 根据id删除零售退货单据数据 diff --git a/core/service/src/main/java/com/wansenai/service/receipt/impl/ReceiptRetailServiceImpl.java b/core/service/src/main/java/com/wansenai/service/receipt/impl/ReceiptRetailServiceImpl.java index bc3dfc5f..3886ff2c 100644 --- a/core/service/src/main/java/com/wansenai/service/receipt/impl/ReceiptRetailServiceImpl.java +++ b/core/service/src/main/java/com/wansenai/service/receipt/impl/ReceiptRetailServiceImpl.java @@ -33,6 +33,7 @@ import com.wansenai.mappers.system.SysFileMapper; import com.wansenai.service.basic.MemberService; import com.wansenai.service.common.CommonService; +import com.wansenai.service.financial.IFinancialAccountService; import com.wansenai.service.product.ProductService; import com.wansenai.service.receipt.ReceiptRetailService; import com.wansenai.service.receipt.ReceiptRetailSubService; @@ -69,6 +70,8 @@ public class ReceiptRetailServiceImpl extends ServiceImpl deleteRetailShipments(List ids) { return deleteRetail(ids, RetailCodeEnum.DELETE_RETAIL_SHIPMENTS_SUCCESS, RetailCodeEnum.DELETE_RETAIL_SHIPMENTS_ERROR); } - @Override - public Response getRetailShipmentsDetail(Long id) { - if (id == null) { - return Response.responseMsg(BaseCodeEnum.PARAMETER_NULL); - } - var shipment = getById(id); + private RetailShipmentsDetailVO createRetailShipmentsDetail(ReceiptRetailMain shipment) { var fileList = commonService.getFileList(shipment.getFileId()); var receiptSubList = receiptRetailSubService.lambdaQuery() - .eq(ReceiptRetailSub::getReceiptMainId, id) + .eq(ReceiptRetailSub::getReceiptMainId, shipment.getId()) .list(); - var tableData = new ArrayList(receiptSubList.size() + 1); - for (ReceiptRetailSub item : receiptSubList) { - var shipmentBo = createShipmentsDataFromReceiptSub(item); - tableData.add(shipmentBo); - } + var tableData = receiptSubList.stream() + .map(this::createShipmentsDataFromReceiptSub) + .collect(Collectors.toCollection(ArrayList::new)); - var retailShipmentsDetailVO = RetailShipmentsDetailVO.builder() + return RetailShipmentsDetailVO.builder() .receiptNumber(shipment.getReceiptNumber()) .receiptDate(shipment.getReceiptDate()) .memberId(shipment.getMemberId()) + .memberName(getMemberName(shipment.getMemberId())) + .accountName(getAccountName(shipment.getAccountId())) .accountId(shipment.getAccountId()) .paymentType(shipment.getPaymentType()) .collectAmount(shipment.getChangeAmount()) @@ -477,8 +488,30 @@ public Response getRetailShipmentsDetail(Long id) { .remark(shipment.getRemark()) .tableData(tableData) .files(fileList) + .status(shipment.getStatus()) .build(); + } + + @Override + public Response getRetailShipmentsDetail(Long id) { + if (id == null) { + return Response.responseMsg(BaseCodeEnum.PARAMETER_NULL); + } + var shipment = getById(id); + var retailShipmentsDetailVO = createRetailShipmentsDetail(shipment); + return Response.responseData(retailShipmentsDetailVO); + } + @Override + public Response getLinkRetailShipmentsDetail(String receiptNumber) { + if (!StringUtils.hasLength(receiptNumber)) { + return Response.responseMsg(BaseCodeEnum.PARAMETER_NULL); + } + var shipment = lambdaQuery() + .eq(ReceiptRetailMain::getReceiptNumber, receiptNumber) + .eq(ReceiptRetailMain::getDeleteFlag, CommonConstants.NOT_DELETED) + .one(); + var retailShipmentsDetailVO = createRetailShipmentsDetail(shipment); return Response.responseData(retailShipmentsDetailVO); } @@ -692,38 +725,56 @@ public Response> retailDetail(Long id) { return Response.responseData(result); } - @Override - public Response getRetailRefundDetail(Long id) { - if (id == null) { - return Response.responseMsg(BaseCodeEnum.PARAMETER_NULL); - } - var refund = getById(id); + private RetailRefundDetailVO createRetailRefundDetail(ReceiptRetailMain refund) { var fileList = commonService.getFileList(refund.getFileId()); var receiptSubList = receiptRetailSubService.lambdaQuery() - .eq(ReceiptRetailSub::getReceiptMainId, id) + .eq(ReceiptRetailSub::getReceiptMainId, refund.getId()) .eq(ReceiptRetailSub::getDeleteFlag, CommonConstants.NOT_DELETED) .list(); - var tableData = new ArrayList(receiptSubList.size() + 1); - for (ReceiptRetailSub item : receiptSubList) { - var shipmentBo = createShipmentsDataFromReceiptSub(item); - tableData.add(shipmentBo); - } + var tableData = receiptSubList.stream() + .map(this::createShipmentsDataFromReceiptSub) + .collect(Collectors.toCollection(ArrayList::new)); - var retailRefundDetailVO = RetailRefundDetailVO.builder() + return RetailRefundDetailVO.builder() .receiptNumber(refund.getReceiptNumber()) .receiptDate(refund.getReceiptDate()) .memberId(refund.getMemberId()) + .memberName(getMemberName(refund.getMemberId())) .accountId(refund.getAccountId()) + .accountName(getAccountName(refund.getAccountId())) .otherReceipt(refund.getOtherReceipt()) .paymentAmount(refund.getChangeAmount()) + .paymentType(refund.getPaymentType()) .receiptAmount(refund.getTotalAmount()) .backAmount(refund.getBackAmount()) .remark(refund.getRemark()) .tableData(tableData) .files(fileList) + .status(refund.getStatus()) .build(); + } + @Override + public Response getRetailRefundDetail(Long id) { + if (id == null) { + return Response.responseMsg(BaseCodeEnum.PARAMETER_NULL); + } + var refund = getById(id); + var retailRefundDetailVO = createRetailRefundDetail(refund); + return Response.responseData(retailRefundDetailVO); + } + + @Override + public Response getLinkRetailRefundDetail(String receiptNumber) { + if (!StringUtils.hasLength(receiptNumber)) { + return Response.responseMsg(BaseCodeEnum.PARAMETER_NULL); + } + var refund = lambdaQuery() + .eq(ReceiptRetailMain::getReceiptNumber, receiptNumber) + .eq(ReceiptRetailMain::getDeleteFlag, CommonConstants.NOT_DELETED) + .one(); + var retailRefundDetailVO = createRetailRefundDetail(refund); return Response.responseData(retailRefundDetailVO); } diff --git a/web/src/api/retail/model/refundModel.ts b/web/src/api/retail/model/refundModel.ts index 3903e59a..eeceab52 100644 --- a/web/src/api/retail/model/refundModel.ts +++ b/web/src/api/retail/model/refundModel.ts @@ -16,6 +16,24 @@ export interface AddOrUpdateRefundReq { files: FileData[]; } +export interface AddOrUpdateRefundResp { + id: number | string | undefined; + memberId: string; + memberName: string; + accountId: string; + accountName: string; + receiptDate: string; + receiptNumber: string; + otherReceipt: string; + paymentAmount: number; + receiptAmount: number; + backAmount: number; + remark: string; + status: number; + tableData: ShipmentsData[]; + files: FileData[]; +} + export interface RefundResp { id: number | string; memberName: string; diff --git a/web/src/api/retail/model/shipmentsModel.ts b/web/src/api/retail/model/shipmentsModel.ts index e649f191..0eadd94f 100644 --- a/web/src/api/retail/model/shipmentsModel.ts +++ b/web/src/api/retail/model/shipmentsModel.ts @@ -37,6 +37,24 @@ export interface AddOrUpdateShipmentsReq { fileDataList: FileData[]; } +export interface AddOrUpdateShipmentsResp { + id: number | string | undefined; + memberId: number | string; + memberName: string; + accountId: number | string; + accountName: string; + receiptDate: string; + receiptNumber: string; + receiptType: string; + collectionAmount: number; + receiptAmount: number; + backAmount: number; + remark: string; + status: number; + tableData: ShipmentsData[]; + fileDataList: FileData[]; +} + export interface QueryShipmentsReq { receiptNumber: string; productInfo: string; diff --git a/web/src/api/retail/refund.ts b/web/src/api/retail/refund.ts index 01e9c448..06ae735e 100644 --- a/web/src/api/retail/refund.ts +++ b/web/src/api/retail/refund.ts @@ -2,7 +2,7 @@ import {defHttp} from '/@/utils/http/axios'; import {BaseDataResp, BaseResp} from "@/api/model/baseModel"; import { QueryShipmentsReq } from "@/api/retail/model/shipmentsModel" import { - AddOrUpdateRefundReq, + AddOrUpdateRefundReq, AddOrUpdateRefundResp, RefundResp } from "@/api/retail/model/refundModel" @@ -12,6 +12,7 @@ enum API { GetDetail = '/retail/refund/detail', UpdateStatus = '/retail/refund/updateStatus', Delete = '/retail/refund/deleteByIds', + GetLinkRefundDetail = '/retail/refund/getLinkRefundDetail', } export function getRefundPageList(params: QueryShipmentsReq) { @@ -40,6 +41,14 @@ export function getRefundDetail(id: string) { ); } +export function getLinkRefundDetail(otherReceipt: string) { + return defHttp.get>( + { + url: `${API.GetLinkRefundDetail}/${otherReceipt}`, + } + ); +} + export function updateRefundStatus(ids: string[], status: number) { return defHttp.put( { diff --git a/web/src/api/retail/shipments.ts b/web/src/api/retail/shipments.ts index d3a41795..692fbeaa 100644 --- a/web/src/api/retail/shipments.ts +++ b/web/src/api/retail/shipments.ts @@ -1,7 +1,7 @@ import {defHttp} from '/@/utils/http/axios'; import {BaseDataResp, BaseResp} from "@/api/model/baseModel"; import { - AddOrUpdateShipmentsReq, + AddOrUpdateShipmentsReq, AddOrUpdateShipmentsResp, QueryShipmentsReq, ShipmentsResp } from "@/api/retail/model/shipmentsModel" @@ -14,6 +14,7 @@ enum API { DeleteBatch = '/retail/shipments/deleteByIds', UpdateStatus = '/retail/shipments/updateStatus', GetDetail = '/retail/shipments/detail', + GetLinkShipmentDetail = '/retail/shipments/getLinkShipmentDetail', } export function getShipmentsPageList(params: QueryShipmentsReq, mode: ErrorMessageMode = 'notice') { @@ -69,4 +70,12 @@ export function getShipmentsDetail(id: string | number) { url: `${API.GetDetail}/${id}`, } ); +} + +export function getLinkShipmentsDetail(otherReceipt: string) { + return defHttp.get>( + { + url: `${API.GetLinkShipmentDetail}/${otherReceipt}`, + } + ); } \ No newline at end of file diff --git a/web/src/views/retail/refund/components/ViewRefundModal.vue b/web/src/views/retail/refund/components/ViewRefundModal.vue new file mode 100644 index 00000000..8c2bd87a --- /dev/null +++ b/web/src/views/retail/refund/components/ViewRefundModal.vue @@ -0,0 +1,162 @@ + + + diff --git a/web/src/views/retail/refund/index.vue b/web/src/views/retail/refund/index.vue index c80fec71..7861f5f4 100644 --- a/web/src/views/retail/refund/index.vue +++ b/web/src/views/retail/refund/index.vue @@ -14,7 +14,7 @@ :actions="[ { icon: 'clarity:info-standard-line', - tooltip: t('sys.user.viewUserDetails'), + tooltip: '查看单据详情', onClick: handleView.bind(null, record), }, { @@ -41,6 +41,7 @@ +

@@ -56,13 +57,16 @@ import {useI18n} from "vue-i18n"; import AddEditModal from "@/views/retail/refund/components/AddEditModal.vue" import {Tag} from "ant-design-vue"; import {getRefundPageList, updateRefundStatus, deleteRefund} from "@/api/retail/refund"; +import {useModal} from "@/components/Modal"; +import ViewModal from "@/views/retail/refund/components/ViewRefundModal.vue"; export default defineComponent({ name: 'Shipments', - components: {Tag, TableAction, BasicTable, AddEditModal}, + components: {Tag, TableAction, BasicTable, AddEditModal, ViewModal}, setup() { const { t } = useI18n(); const { createMessage } = useMessage(); const addEditModalRef = ref(null); + const [receiptViewModal, {openModal: openReceiptViewModal}] = useModal(); const [registerTable, { reload, getSelectRows }] = useTable({ title: '零售退货列表', rowKey: 'id', @@ -133,8 +137,11 @@ export default defineComponent({ await reload(); } - function handleView(){ - + function handleView(record: Recordable){ + openReceiptViewModal(true, { + isUpdate: false, + receiptNumber: record.receiptNumber, + }); } const getTimestamp = (date) => { @@ -189,6 +196,7 @@ export default defineComponent({ handleView, handleOk, handleExport, + receiptViewModal, } } }) diff --git a/web/src/views/retail/shipments/components/DetailInfoModal.vue b/web/src/views/retail/shipments/components/DetailInfoModal.vue deleted file mode 100644 index 5ff38f59..00000000 --- a/web/src/views/retail/shipments/components/DetailInfoModal.vue +++ /dev/null @@ -1,7 +0,0 @@ - - - \ No newline at end of file diff --git a/web/src/views/retail/shipments/components/ViewShipmentModal.vue b/web/src/views/retail/shipments/components/ViewShipmentModal.vue new file mode 100644 index 00000000..94a29f79 --- /dev/null +++ b/web/src/views/retail/shipments/components/ViewShipmentModal.vue @@ -0,0 +1,155 @@ + + + diff --git a/web/src/views/retail/shipments/index.vue b/web/src/views/retail/shipments/index.vue index 7d97056b..68325f48 100644 --- a/web/src/views/retail/shipments/index.vue +++ b/web/src/views/retail/shipments/index.vue @@ -14,7 +14,7 @@ :actions="[ { icon: 'clarity:info-standard-line', - tooltip: t('sys.user.viewUserDetails'), + tooltip: '查看单据详情', onClick: handleView.bind(null, record), }, { @@ -41,6 +41,7 @@ +
@@ -55,14 +56,17 @@ import {exportXlsx} from "@/api/basic/common"; import {useI18n} from "vue-i18n"; import {getShipmentsPageList, deleteShipments, updateShipmentsStatus} from "@/api/retail/shipments"; import AddEditModal from "@/views/retail/shipments/components/AddEditModal.vue" +import ReceiptViewModal from "@/views/retail/shipments/components/ViewShipmentModal.vue"; import {Tag} from "ant-design-vue"; +import {useModal} from "@/components/Modal"; export default defineComponent({ name: 'Shipments', - components: {Tag, TableAction, BasicTable, AddEditModal}, + components: {Tag, TableAction, BasicTable, AddEditModal, ReceiptViewModal}, setup() { const { t } = useI18n(); const { createMessage } = useMessage(); const addEditModalRef = ref(null); + const [receiptViewModal, {openModal: openReceiptViewModal}] = useModal(); const [registerTable, { reload, getSelectRows }] = useTable({ title: '零售出库列表', rowKey: 'id', @@ -132,8 +136,11 @@ export default defineComponent({ await reload(); } - function handleView(){ - + function handleView(record: Recordable){ + openReceiptViewModal(true, { + isUpdate: false, + receiptNumber: record.receiptNumber, + }); } const getTimestamp = (date) => { @@ -175,6 +182,7 @@ export default defineComponent({ return { t, + receiptViewModal, addEditModalRef, registerTable, handleCreate, diff --git a/web/src/views/retail/shipments/shipments.data.ts b/web/src/views/retail/shipments/shipments.data.ts index 4354e36d..2c65271d 100644 --- a/web/src/views/retail/shipments/shipments.data.ts +++ b/web/src/views/retail/shipments/shipments.data.ts @@ -158,4 +158,67 @@ export const searchFormSchema: FormSchema[] = [ }, } +] + +export const retailShipmentsTableColumns: BasicColumn[] = [ + { + title: '仓库名称', + dataIndex: 'warehouseName', + width: 100, + }, + { + title: '条码', + dataIndex: 'barCode', + width: 100, + }, + { + title: '商品名称', + dataIndex: 'productName', + width: 120, + }, + { + title: '规格', + dataIndex: 'productStandard', + width: 120, + }, + { + title: '型号', + dataIndex: 'productModel', + width: 120, + }, + { + title: '颜色', + dataIndex: 'productColor', + width: 70, + }, + { + title: '库存', + dataIndex: 'stock', + width: 80, + }, + { + title: '单位', + dataIndex: 'productUnit', + width: 60, + }, + { + title: '数量', + dataIndex: 'productNumber', + width: 60, + }, + { + title: '单价', + dataIndex: 'unitPrice', + width: 60, + }, + { + title: '金额', + dataIndex: 'amount', + width: 60, + }, + { + title: '备注', + dataIndex: 'remark', + width: 100, + }, ] \ No newline at end of file