diff --git a/.env.development b/.env.development index 8b0f18b..b362568 100644 --- a/.env.development +++ b/.env.development @@ -4,8 +4,8 @@ VITE_API_PREFIX = '/dev-api' # 接口地址 # VITE_API_BASE_URL = 'http://pms.dtyx.net:9158/' -# VITE_API_BASE_URL = 'http://localhost:8888/' -VITE_API_BASE_URL = 'http://10.18.34.163:8888/' +VITE_API_BASE_URL = 'http://localhost:8888/' +# VITE_API_BASE_URL = 'http://10.18.34.163:8888/' # VITE_API_BASE_URL = 'http://10.18.34.213:8888/' # 接口地址 (WebSocket) diff --git a/src/apis/equipment/procurement.ts b/src/apis/equipment/procurement.ts index dd8b3f6..2aab76b 100644 --- a/src/apis/equipment/procurement.ts +++ b/src/apis/equipment/procurement.ts @@ -99,6 +99,34 @@ export const equipmentProcurementApi = { return http.get>(`/equipment/procurement/detail/${equipmentId}`) }, + /** + * 确认收货 + */ + receiveGoods: (equipmentId: string, data: ReceiptRequest) => { + return http.post>(`/equipment/procurement/receipt/${equipmentId}`, data) + }, + + /** + * 获取收货详情 + */ + getReceiptDetail: (equipmentId: string) => { + return http.get>(`/equipment/procurement/receipt/${equipmentId}`) + }, + + /** + * 执行付款 + */ + makePayment: (equipmentId: string, data: PaymentRequest) => { + return http.post>(`/equipment/procurement/payment/${equipmentId}`, data) + }, + + /** + * 获取支付详情 + */ + getPaymentDetail: (equipmentId: string) => { + return http.get>(`/equipment/procurement/payment/${equipmentId}`) + }, + /** * 获取采购统计信息 */ @@ -117,9 +145,6 @@ export const equipmentProcurementApi = { * 导出设备采购记录 */ export: (params: EquipmentListReq) => { - return http.get('/equipment/procurement/export', { - params, - responseType: 'blob' - }) + return http.get('/equipment/procurement/export', params, { responseType: 'blob' }) } } \ No newline at end of file diff --git a/src/apis/equipment/type.ts b/src/apis/equipment/type.ts index 2bd5a1e..a7fdf57 100644 --- a/src/apis/equipment/type.ts +++ b/src/apis/equipment/type.ts @@ -101,28 +101,28 @@ export interface EquipmentResp { /** 资产编号 */ assetCode?: string /** 设备名称 */ - equipmentName: string + equipmentName?: string /** 设备类型 */ - equipmentType: string - /** 设备类型描述 */ + equipmentType?: string + /** 设备类型标签 */ equipmentTypeLabel?: string /** 设备型号 */ - equipmentModel: string - /** 设备SN */ - equipmentSn: string + equipmentModel?: string + /** 设备序列号 */ + equipmentSn?: string /** 品牌 */ brand?: string /** 配置规格/参数 */ specification?: string /** 设备状态 */ - equipmentStatus: string - /** 设备状态描述 */ + equipmentStatus?: string + /** 设备状态标签 */ equipmentStatusLabel?: string /** 使用状态 */ - useStatus: string + useStatus?: string /** 位置状态 */ locationStatus?: string - /** 位置状态描述 */ + /** 位置状态标签 */ locationStatusLabel?: string /** 设备当前物理位置 */ physicalLocation?: string @@ -130,7 +130,7 @@ export interface EquipmentResp { responsiblePerson?: string /** 健康状态 */ healthStatus?: string - /** 健康状态描述 */ + /** 健康状态标签 */ healthStatusLabel?: string /** 采购时间 */ purchaseTime?: string @@ -138,13 +138,13 @@ export interface EquipmentResp { inStockTime?: string /** 启用时间 */ activationTime?: string - /** 预计报废时间 */ + /** 预期报废时间 */ expectedScrapTime?: string /** 实际报废时间 */ actualScrapTime?: string /** 状态变更时间 */ statusChangeTime?: string - /** 采购订单 */ + /** 采购订单号 */ purchaseOrder?: string /** 供应商名称 */ supplierName?: string @@ -158,9 +158,9 @@ export interface EquipmentResp { depreciationYears?: number /** 残值 */ salvageValue?: number - /** 保修截止日期 */ + /** 保修到期日期 */ warrantyExpireDate?: string - /** 上次维护日期 */ + /** 最后维护日期 */ lastMaintenanceDate?: string /** 下次维护日期 */ nextMaintenanceDate?: string @@ -176,7 +176,7 @@ export interface EquipmentResp { projectName?: string /** 使用人ID */ userId?: string - /** 使用人 */ + /** 使用人姓名 */ name?: string /** 创建时间 */ createTime?: string @@ -194,12 +194,14 @@ export interface EquipmentResp { inventoryBasis?: string /** 动态记录 */ dynamicRecord?: string - /** 采购状态 */ procurementStatus?: string - /** 审批状态 */ approvalStatus?: string + /** 收货状态 */ + receiptStatus?: string + /** 支付状态 */ + paymentStatus?: string } /** @@ -406,3 +408,191 @@ export interface EquipmentApprovalResp { /** 更新时间 */ updateTime: string } + +/** + * 收货请求参数 + */ +export interface ReceiptRequest { + /** 收货时间 */ + receiptTime: string + /** 收货人 */ + receiptPerson: string + /** 收货数量 */ + receiptQuantity: number + /** 收货备注 */ + receiptRemark?: string + /** 外观检查结果 */ + appearanceCheck: string + /** 功能测试结果 */ + functionTest: string + /** 包装完整性 */ + packageIntegrity: string + /** 配件完整性 */ + accessoryIntegrity: string + /** 检查结果 */ + checkResult: 'PASS' | 'FAIL' | 'CONDITIONAL' + /** 检查备注 */ + checkRemark?: string + /** 入库位置 */ + storageLocation: string + /** 库管员 */ + storageManager: string +} + +/** + * 收货详情响应 + */ +export interface ReceiptDetail { + /** 设备ID */ + equipmentId: string + /** 设备名称 */ + equipmentName: string + /** 设备类型 */ + equipmentType: string + /** 设备型号 */ + equipmentModel: string + /** 品牌 */ + brand: string + /** 供应商 */ + supplierName: string + /** 采购订单 */ + purchaseOrder: string + /** 收货状态 */ + receiptStatus: string + /** 收货时间 */ + receiptTime: string + /** 收货人 */ + receiptPerson: string + /** 收货数量 */ + receiptQuantity: number + /** 收货备注 */ + receiptRemark?: string + /** 外观检查 */ + appearanceCheck: string + /** 功能测试 */ + functionTest: string + /** 包装完整性 */ + packageIntegrity: string + /** 配件完整性 */ + accessoryIntegrity: string + /** 检查结果 */ + checkResult: string + /** 检查备注 */ + checkRemark?: string + /** 入库状态 */ + storageStatus: string + /** 入库时间 */ + storageTime: string + /** 入库位置 */ + storageLocation: string + /** 库管员 */ + storageManager: string +} + +/** + * 支付请求参数 + */ +export interface PaymentRequest { + /** 支付方式 */ + paymentMethod: string + /** 支付金额 */ + paymentAmount: number + /** 支付时间 */ + paymentTime: string + /** 支付人 */ + paymentPerson: string + /** 支付备注 */ + paymentRemark?: string + /** 发票类型 */ + invoiceType: string + /** 发票号码 */ + invoiceNumber: string + /** 开票日期 */ + invoiceDate: string + /** 发票金额 */ + invoiceAmount: number + /** 税率 */ + taxRate: number + /** 税额 */ + taxAmount: number + /** 不含税金额 */ + amountWithoutTax: number + /** 合同编号 */ + contractNumber: string + /** 合同金额 */ + contractAmount: number + /** 签订日期 */ + contractDate: string + /** 付款条件 */ + paymentTerms: string + /** 付款期限 */ + paymentDeadline: string +} + +/** + * 支付详情响应 + */ +export interface PaymentDetail { + /** 设备ID */ + equipmentId: string + /** 设备名称 */ + equipmentName: string + /** 设备类型 */ + equipmentType: string + /** 设备型号 */ + equipmentModel: string + /** 品牌 */ + brand: string + /** 供应商 */ + supplierName: string + /** 采购订单 */ + purchaseOrder: string + /** 采购价格 */ + purchasePrice: number + /** 采购数量 */ + quantity: number + /** 总金额 */ + totalPrice: number + /** 采购日期 */ + purchaseTime: string + /** 支付状态 */ + paymentStatus: string + /** 支付方式 */ + paymentMethod: string + /** 支付金额 */ + paymentAmount: number + /** 支付时间 */ + paymentTime: string + /** 支付人 */ + paymentPerson: string + /** 支付备注 */ + paymentRemark?: string + /** 发票状态 */ + invoiceStatus: string + /** 发票类型 */ + invoiceType: string + /** 发票号码 */ + invoiceNumber: string + /** 开票日期 */ + invoiceDate: string + /** 发票金额 */ + invoiceAmount: number + /** 税率 */ + taxRate: number + /** 税额 */ + taxAmount: number + /** 不含税金额 */ + amountWithoutTax: number + /** 合同编号 */ + contractNumber: string + /** 合同状态 */ + contractStatus: string + /** 合同金额 */ + contractAmount: number + /** 签订日期 */ + contractDate: string + /** 付款条件 */ + paymentTerms: string + /** 付款期限 */ + paymentDeadline: string +} diff --git a/src/types/components.d.ts b/src/types/components.d.ts index a427ece..7fa6b1b 100644 --- a/src/types/components.d.ts +++ b/src/types/components.d.ts @@ -7,70 +7,7 @@ export {} declare module 'vue' { export interface GlobalComponents { - ApprovalAssistant: typeof import('./../components/ApprovalAssistant/index.vue')['default'] - ApprovalMessageItem: typeof import('./../components/NotificationCenter/ApprovalMessageItem.vue')['default'] - Avatar: typeof import('./../components/Avatar/index.vue')['default'] - Breadcrumb: typeof import('./../components/Breadcrumb/index.vue')['default'] - CellCopy: typeof import('./../components/CellCopy/index.vue')['default'] - Chart: typeof import('./../components/Chart/index.vue')['default'] - CircularProgress: typeof import('./../components/CircularProgress/index.vue')['default'] - ColumnSetting: typeof import('./../components/GiTable/src/components/ColumnSetting.vue')['default'] - CronForm: typeof import('./../components/GenCron/CronForm/index.vue')['default'] - CronModal: typeof import('./../components/GenCron/CronModal/index.vue')['default'] - DateRangePicker: typeof import('./../components/DateRangePicker/index.vue')['default'] - DayForm: typeof import('./../components/GenCron/CronForm/component/day-form.vue')['default'] - FilePreview: typeof import('./../components/FilePreview/index.vue')['default'] - GiCellAvatar: typeof import('./../components/GiCell/GiCellAvatar.vue')['default'] - GiCellGender: typeof import('./../components/GiCell/GiCellGender.vue')['default'] - GiCellStatus: typeof import('./../components/GiCell/GiCellStatus.vue')['default'] - GiCellTag: typeof import('./../components/GiCell/GiCellTag.vue')['default'] - GiCellTags: typeof import('./../components/GiCell/GiCellTags.vue')['default'] - GiCodeView: typeof import('./../components/GiCodeView/index.vue')['default'] - GiDot: typeof import('./../components/GiDot/index.tsx')['default'] - GiEditTable: typeof import('./../components/GiEditTable/GiEditTable.vue')['default'] - GiFooter: typeof import('./../components/GiFooter/index.vue')['default'] - GiForm: typeof import('./../components/GiForm/src/GiForm.vue')['default'] - GiIconBox: typeof import('./../components/GiIconBox/index.vue')['default'] - GiIconSelector: typeof import('./../components/GiIconSelector/index.vue')['default'] - GiIframe: typeof import('./../components/GiIframe/index.vue')['default'] - GiOption: typeof import('./../components/GiOption/index.vue')['default'] - GiOptionItem: typeof import('./../components/GiOptionItem/index.vue')['default'] - GiPageLayout: typeof import('./../components/GiPageLayout/index.vue')['default'] - GiSpace: typeof import('./../components/GiSpace/index.vue')['default'] - GiSplitButton: typeof import('./../components/GiSplitButton/index.vue')['default'] - GiSplitPane: typeof import('./../components/GiSplitPane/index.vue')['default'] - GiSplitPaneFlexibleBox: typeof import('./../components/GiSplitPane/components/GiSplitPaneFlexibleBox.vue')['default'] - GiSvgIcon: typeof import('./../components/GiSvgIcon/index.vue')['default'] - GiTable: typeof import('./../components/GiTable/src/GiTable.vue')['default'] - GiTag: typeof import('./../components/GiTag/index.tsx')['default'] - GiThemeBtn: typeof import('./../components/GiThemeBtn/index.vue')['default'] - HourForm: typeof import('./../components/GenCron/CronForm/component/hour-form.vue')['default'] - Icon403: typeof import('./../components/icons/Icon403.vue')['default'] - Icon404: typeof import('./../components/icons/Icon404.vue')['default'] - Icon500: typeof import('./../components/icons/Icon500.vue')['default'] - IconBorders: typeof import('./../components/icons/IconBorders.vue')['default'] - IconTableSize: typeof import('./../components/icons/IconTableSize.vue')['default'] - IconTreeAdd: typeof import('./../components/icons/IconTreeAdd.vue')['default'] - IconTreeReduce: typeof import('./../components/icons/IconTreeReduce.vue')['default'] - ImageImport: typeof import('./../components/ImageImport/index.vue')['default'] - ImageImportWizard: typeof import('./../components/ImageImportWizard/index.vue')['default'] - IndustrialImageList: typeof import('./../components/IndustrialImageList/index.vue')['default'] - JsonPretty: typeof import('./../components/JsonPretty/index.vue')['default'] - MinuteForm: typeof import('./../components/GenCron/CronForm/component/minute-form.vue')['default'] - MonthForm: typeof import('./../components/GenCron/CronForm/component/month-form.vue')['default'] - NotificationCenter: typeof import('./../components/NotificationCenter/index.vue')['default'] - ParentView: typeof import('./../components/ParentView/index.vue')['default'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] - SecondForm: typeof import('./../components/GenCron/CronForm/component/second-form.vue')['default'] - SplitPanel: typeof import('./../components/SplitPanel/index.vue')['default'] - TextCopy: typeof import('./../components/TextCopy/index.vue')['default'] - TurbineGrid: typeof import('./../components/TurbineGrid/index.vue')['default'] - UserSelect: typeof import('./../components/UserSelect/index.vue')['default'] - Verify: typeof import('./../components/Verify/index.vue')['default'] - VerifyPoints: typeof import('./../components/Verify/Verify/VerifyPoints.vue')['default'] - VerifySlide: typeof import('./../components/Verify/Verify/VerifySlide.vue')['default'] - WeekForm: typeof import('./../components/GenCron/CronForm/component/week-form.vue')['default'] - YearForm: typeof import('./../components/GenCron/CronForm/component/year-form.vue')['default'] } } diff --git a/src/views/system-resource/device-management/procurement/components/PaymentModal.vue b/src/views/system-resource/device-management/procurement/components/PaymentModal.vue new file mode 100644 index 0000000..81b7d52 --- /dev/null +++ b/src/views/system-resource/device-management/procurement/components/PaymentModal.vue @@ -0,0 +1,505 @@ + + + + + diff --git a/src/views/system-resource/device-management/procurement/components/ReceiptModal.vue b/src/views/system-resource/device-management/procurement/components/ReceiptModal.vue new file mode 100644 index 0000000..1d8a437 --- /dev/null +++ b/src/views/system-resource/device-management/procurement/components/ReceiptModal.vue @@ -0,0 +1,368 @@ + + + + + diff --git a/src/views/system-resource/device-management/procurement/index.vue b/src/views/system-resource/device-management/procurement/index.vue index 5155506..91f57f1 100644 --- a/src/views/system-resource/device-management/procurement/index.vue +++ b/src/views/system-resource/device-management/procurement/index.vue @@ -312,6 +312,20 @@ v-model:visible="paymentDetailModalVisible" :payment-data="currentPaymentData" /> + + + + + + @@ -333,6 +347,8 @@ import ProcurementSearch from './components/ProcurementSearch.vue' import ProcurementApplicationModal from './components/ProcurementApplicationModal.vue' import ReceiptDetailModal from './components/ReceiptDetailModal.vue' import PaymentDetailModal from './components/PaymentDetailModal.vue' +import ReceiptModal from './components/ReceiptModal.vue' +import PaymentModal from './components/PaymentModal.vue' import { equipmentProcurementApi } from '@/apis/equipment/procurement' import { equipmentApprovalApi } from '@/apis/equipment/approval' import type { EquipmentListReq, EquipmentResp } from '@/apis/equipment/type' @@ -377,6 +393,10 @@ const currentReceiptData = ref(null) const paymentDetailModalVisible = ref(false) const currentPaymentData = ref(null) +// 收货弹窗控制 +const receiptModalVisible = ref(false) +const paymentModalVisible = ref(false) + // 表格选择 const selectedRowKeys = ref([]) const rowSelection = reactive({ @@ -988,17 +1008,8 @@ const canReceiveGoods = (record: EquipmentResp) => { // 收货操作 const handleReceiveGoods = async (record: EquipmentResp) => { - try { - // 暂时模拟API调用 - // await equipmentProcurementApi.receiveGoods(record.equipmentId) - message.success('收货成功') - // 模拟状态更新 - (record as any).receiptStatus = 'RECEIVED' - loadData(currentSearchParams.value) - } catch (error: any) { - console.error('收货失败:', error) - message.error(error?.message || '收货失败') - } + currentReceiptData.value = { ...record } + receiptModalVisible.value = true } // 查看收货详情 @@ -1007,6 +1018,12 @@ const handleViewReceipt = (record: EquipmentResp) => { receiptDetailModalVisible.value = true } +// 收货成功回调 +const handleReceiptSuccess = () => { + receiptModalVisible.value = false + loadData(currentSearchParams.value) +} + // 检查是否可以付款 const canMakePayment = (record: EquipmentResp) => { const paymentStatus = (record as any).paymentStatus @@ -1015,17 +1032,8 @@ const canMakePayment = (record: EquipmentResp) => { // 付款操作 const handleMakePayment = async (record: EquipmentResp) => { - try { - // 暂时模拟API调用 - // await equipmentProcurementApi.makePayment(record.equipmentId) - message.success('付款成功') - // 模拟状态更新 - (record as any).paymentStatus = 'PAID' - loadData(currentSearchParams.value) - } catch (error: any) { - console.error('付款失败:', error) - message.error(error?.message || '付款失败') - } + currentPaymentData.value = { ...record } + paymentModalVisible.value = true } // 查看支付详情 @@ -1034,6 +1042,12 @@ const handleViewPayment = (record: EquipmentResp) => { paymentDetailModalVisible.value = true } +// 支付成功回调 +const handlePaymentSuccess = () => { + paymentModalVisible.value = false + loadData(currentSearchParams.value) +} + // 获取审批状态颜色 const getApprovalStatusColor = (status: string) => { const colorMap: Record = {