From 9bb8cd939f30213d7f23c53226ad3065d1f92dcf Mon Sep 17 00:00:00 2001 From: wuxw <928255095@qq.com> Date: Wed, 16 Jul 2025 00:16:30 +0800 Subject: [PATCH] 优化采购模块 --- src/api/community/communityApi.js | 8 +++++++- src/api/resource/resourceDetailApi.js | 116 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/api/resource/resourceStoreManageApi.js | 4 ++-- src/components/resource/addResourceStore.vue | 4 ++-- src/components/resource/editResourceStore.vue | 19 ++++++++++--------- src/components/resource/importResourceStore.vue | 18 +++++++++++------- src/components/resource/resourceDetailAllocation.vue | 173 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/components/resource/resourceDetailAllocationUser.vue | 155 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/components/resource/resourceDetailInventory.vue | 144 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/components/resource/resourceDetailItemOut.vue | 138 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/components/resource/resourceDetailPurchase.vue | 133 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/components/resource/resourceDetailUseRecord.vue | 173 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/i18n/resourceI18n.js | 3 +++ src/router/resourceRouter.js | 5 +++++ src/views/layout/layout.vue | 1 + src/views/resource/resourceDetailLang.js | 226 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/views/resource/resourceDetailList.vue | 308 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/views/resource/resourceStoreManageLang.js | 6 ++++-- src/views/resource/resourceStoreManageList.vue | 13 ++++++++----- 19 files changed, 1619 insertions(+), 28 deletions(-) create mode 100644 src/api/resource/resourceDetailApi.js create mode 100644 src/components/resource/resourceDetailAllocation.vue create mode 100644 src/components/resource/resourceDetailAllocationUser.vue create mode 100644 src/components/resource/resourceDetailInventory.vue create mode 100644 src/components/resource/resourceDetailItemOut.vue create mode 100644 src/components/resource/resourceDetailPurchase.vue create mode 100644 src/components/resource/resourceDetailUseRecord.vue create mode 100644 src/views/resource/resourceDetailLang.js create mode 100644 src/views/resource/resourceDetailList.vue diff --git a/src/api/community/communityApi.js b/src/api/community/communityApi.js index dab8ec1..edbf219 100644 --- a/src/api/community/communityApi.js +++ b/src/api/community/communityApi.js @@ -13,8 +13,14 @@ export function _loadCommunityInfo(_param) { const res = response.data let _communityInfos = res.communitys; if (_communityInfos && _communityInfos.length > 0) { - setCurrentCommunity(_communityInfos[0]); setCommunitys(_communityInfos); + let _currentCommunity = getCurrentCommunity() + if(_currentCommunity){ + resolve(res) + return ; + } + + setCurrentCommunity(_communityInfos[0]); if (_param && _param.communityId) { let _communityId = _param.communityId; _communityInfos.forEach(_c => { diff --git a/src/api/resource/resourceDetailApi.js b/src/api/resource/resourceDetailApi.js new file mode 100644 index 0000000..f10929f --- /dev/null +++ b/src/api/resource/resourceDetailApi.js @@ -0,0 +1,116 @@ +import request from '@/utils/request' +import { getCommunityId } from '@/api/community/communityApi' + +// 获取物品详情 +export function getResourceStoreList(params) { + return new Promise((resolve, reject) => { + request({ + url: '/resourceStore.listResourceStores', + method: 'get', + params: { + ...params, + communityId: getCommunityId() + } + }).then(response => { + const res = response.data + resolve(res) + }).catch(error => { + reject(error) + }) + }) +} + +// 获取采购记录 +export function getPurchaseApplyDetailList(params) { + return new Promise((resolve, reject) => { + request({ + url: '/purchaseApplyDetail.listPurchaseApplyDetails', + method: 'get', + params: { + ...params, + communityId: getCommunityId() + } + }).then(response => { + const res = response.data + resolve(res) + }).catch(error => { + reject(error) + }) + }) +} + +// 获取盘点记录 +export function getAssetInventoryList(params) { + return new Promise((resolve, reject) => { + request({ + url: '/assetInventory.listAssetInventory', + method: 'get', + params: { + ...params, + communityId: getCommunityId() + } + }).then(response => { + const res = response.data + resolve(res) + }).catch(error => { + reject(error) + }) + }) +} + +// 获取调拨记录 +export function getAllocationStorehouseList(params) { + return new Promise((resolve, reject) => { + request({ + url: '/resourceStore.listAllocationStorehouses', + method: 'get', + params: { + ...params, + communityId: getCommunityId() + } + }).then(response => { + const res = response.data + resolve(res) + }).catch(error => { + reject(error) + }) + }) +} + +// 获取转赠记录 +export function getAllocationUserStorehouseList(params) { + return new Promise((resolve, reject) => { + request({ + url: '/resourceStore.listAllocationUserStorehouses', + method: 'get', + params: { + ...params, + communityId: getCommunityId() + } + }).then(response => { + const res = response.data + resolve(res) + }).catch(error => { + reject(error) + }) + }) +} + +// 获取使用记录 +export function getResourceStoreUseRecordList(params) { + return new Promise((resolve, reject) => { + request({ + url: '/resourceStore.listResourceStoreUseRecords', + method: 'get', + params: { + ...params, + communityId: getCommunityId() + } + }).then(response => { + const res = response.data + resolve(res) + }).catch(error => { + reject(error) + }) + }) +} \ No newline at end of file diff --git a/src/api/resource/resourceStoreManageApi.js b/src/api/resource/resourceStoreManageApi.js index cebcba6..aa92e04 100644 --- a/src/api/resource/resourceStoreManageApi.js +++ b/src/api/resource/resourceStoreManageApi.js @@ -161,7 +161,7 @@ export function exportData(params) { export function importData(data) { return new Promise((resolve, reject) => { request({ - url: '/importResourceStore.importData', + url: '/callComponent/upload/importResourceStore/importData', method: 'post', data, headers: { @@ -175,7 +175,7 @@ export function importData(data) { reject(new Error(res.msg || '导入数据失败')) } }).catch(error => { - reject(error) + reject(error.response.data) }) }) } diff --git a/src/components/resource/addResourceStore.vue b/src/components/resource/addResourceStore.vue index d884037..73048fc 100644 --- a/src/components/resource/addResourceStore.vue +++ b/src/components/resource/addResourceStore.vue @@ -144,7 +144,7 @@ + @notifyUploadCoverImage="handleImageUpload"> @@ -362,7 +362,7 @@ export default { }, handleImageUpload(images) { - this.formData.photos = images.map(img => img.fileId) + this.formData.photos = images }, saveResourceStore() { diff --git a/src/components/resource/editResourceStore.vue b/src/components/resource/editResourceStore.vue index 5cb6f2e..17e7c6f 100644 --- a/src/components/resource/editResourceStore.vue +++ b/src/components/resource/editResourceStore.vue @@ -30,7 +30,8 @@ - + @@ -127,9 +128,9 @@ - + + @notifyUploadCoverImage="handleImageUpload"> @@ -143,7 +144,7 @@ + + \ No newline at end of file diff --git a/src/components/resource/resourceDetailAllocationUser.vue b/src/components/resource/resourceDetailAllocationUser.vue new file mode 100644 index 0000000..d9ddec3 --- /dev/null +++ b/src/components/resource/resourceDetailAllocationUser.vue @@ -0,0 +1,155 @@ + + + + + \ No newline at end of file diff --git a/src/components/resource/resourceDetailInventory.vue b/src/components/resource/resourceDetailInventory.vue new file mode 100644 index 0000000..76bf129 --- /dev/null +++ b/src/components/resource/resourceDetailInventory.vue @@ -0,0 +1,144 @@ + + + + + \ No newline at end of file diff --git a/src/components/resource/resourceDetailItemOut.vue b/src/components/resource/resourceDetailItemOut.vue new file mode 100644 index 0000000..3e57459 --- /dev/null +++ b/src/components/resource/resourceDetailItemOut.vue @@ -0,0 +1,138 @@ + + + + + \ No newline at end of file diff --git a/src/components/resource/resourceDetailPurchase.vue b/src/components/resource/resourceDetailPurchase.vue new file mode 100644 index 0000000..6fcc88e --- /dev/null +++ b/src/components/resource/resourceDetailPurchase.vue @@ -0,0 +1,133 @@ + + + + + \ No newline at end of file diff --git a/src/components/resource/resourceDetailUseRecord.vue b/src/components/resource/resourceDetailUseRecord.vue new file mode 100644 index 0000000..cda8191 --- /dev/null +++ b/src/components/resource/resourceDetailUseRecord.vue @@ -0,0 +1,173 @@ + + + + + \ No newline at end of file diff --git a/src/i18n/resourceI18n.js b/src/i18n/resourceI18n.js index ea9af06..91d13bb 100644 --- a/src/i18n/resourceI18n.js +++ b/src/i18n/resourceI18n.js @@ -19,6 +19,7 @@ import { messages as myResourceStoreManageMessages } from '../views/resource/myR import { messages as allocationUserStorehouseManageMessages } from '../views/resource/allocationUserStorehouseManageLang' import { messages as resourceStoreUseRecordManageMessages } from '../views/resource/resourceStoreUseRecordManageLang' import { messages as printEquipmentAccountLabelMessages } from '../views/resource/printEquipmentAccountLabelLang' +import { messages as resourceDetailMessages } from '../views/resource/resourceDetailLang' export const messages = { @@ -43,6 +44,7 @@ export const messages = { ...allocationUserStorehouseManageMessages.en, ...resourceStoreUseRecordManageMessages.en, ...printEquipmentAccountLabelMessages.en, + ...resourceDetailMessages.en, }, zh: { ...resourceAuditFlowMessages.zh, @@ -65,5 +67,6 @@ export const messages = { ...allocationUserStorehouseManageMessages.zh, ...resourceStoreUseRecordManageMessages.zh, ...printEquipmentAccountLabelMessages.zh, + ...resourceDetailMessages.zh, } } \ No newline at end of file diff --git a/src/router/resourceRouter.js b/src/router/resourceRouter.js index 482bded..407a01d 100644 --- a/src/router/resourceRouter.js +++ b/src/router/resourceRouter.js @@ -100,5 +100,10 @@ export default [ name: '/pages/common/resourceStoreUseRecordManage', component: () => import('@/views/resource/resourceStoreUseRecordManageList.vue') }, + { + path:'/views/resource/resourceDetail', + name:'/views/resource/resourceDetail', + component: () => import('@/views/resource/resourceDetailList.vue') + }, ] \ No newline at end of file diff --git a/src/views/layout/layout.vue b/src/views/layout/layout.vue index d823ea8..772173d 100644 --- a/src/views/layout/layout.vue +++ b/src/views/layout/layout.vue @@ -201,6 +201,7 @@ export default { } setCurrentCommunity(community); this.curCommunityName = getCommunityName() + window.location.href="/" }, handleMenuSelect(index) { // 处理菜单选择 diff --git a/src/views/resource/resourceDetailLang.js b/src/views/resource/resourceDetailLang.js new file mode 100644 index 0000000..802da8f --- /dev/null +++ b/src/views/resource/resourceDetailLang.js @@ -0,0 +1,226 @@ +export const messages = { + en: { + resourceDetail: { + itemInfo: 'Item Information', + itemNameWithCode: 'Item Name(Code):', + warehouseName: 'Warehouse Name:', + itemType: 'Item Type:', + itemSpec: 'Item Specification:', + fixedItem: 'Fixed Item:', + referencePrice: 'Reference Price:', + chargeStandard: 'Charge Standard:', + itemStock: 'Item Stock:', + minMeasurement: 'Minimum Measurement:', + minMeasurementTotal: 'Minimum Measurement Total:', + itemAvgPrice: 'Item Average Price:', + purchaseRecord: 'Purchase Record', + useRecordText: 'Use Record', + inventoryRecord: 'Inventory Record', + allocationRecord: 'Allocation Record', + transferRecord: 'Transfer Record', + usageRecord: 'Usage Record', + purchase: { + applyOrderId: 'Application No.', + applicant: 'Applicant', + endUser: 'End User', + itemType: 'Item Type', + itemName: 'Item Name', + itemSpec: 'Item Specification', + fixedItem: 'Fixed Item', + supplier: 'Supplier', + warehouse: 'Warehouse', + applyQuantity: 'Application Quantity', + actualQuantity: 'Actual Quantity', + purchasePrice: 'Purchase Price', + totalPrice: 'Total Price', + remark: 'Remark', + status: 'Status', + createTime: 'Create Time' + }, + itemOut: { + applyOrderId: 'Application No.', + applicant: 'Applicant', + endUser: 'End User', + itemType: 'Item Type', + itemName: 'Item Name', + itemSpec: 'Item Specification', + fixedItem: 'Fixed Item', + supplier: 'Supplier', + warehouse: 'Warehouse', + applyQuantity: 'Application Quantity', + quantity: 'Quantity', + purchasePrice: 'Purchase Price', + totalPrice: 'Total Price', + remark: 'Remark', + status: 'Status', + createTime: 'Create Time' + }, + inventory: { + inventoryId: 'Inventory No.', + inventoryName: 'Inventory Name', + inventoryTime: 'Inventory Time', + warehouse: 'Warehouse', + inventoryPerson: 'Inventory Person', + status: 'Status', + createTime: 'Create Time' + }, + allocation: { + allocationId: 'Allocation No.', + itemType: 'Item Type', + itemName: 'Item Name', + itemSpec: 'Item Specification', + fixedItem: 'Fixed Item', + originalStock: 'Original Stock', + allocationQuantity: 'Allocation Quantity', + sourceWarehouse: 'Source Warehouse', + targetWarehouse: 'Target Warehouse', + applicant: 'Applicant', + remark: 'Remark', + allocationType: 'Allocation Type', + status: 'Status', + createTime: 'Create Time' + }, + allocationUser: { + id: 'ID', + itemType: 'Item Type', + itemName: 'Item Name', + itemSpec: 'Item Specification', + fixedItem: 'Fixed Item', + transferUser: 'Transfer User', + transferTarget: 'Transfer Target', + originalStock: 'Original Stock', + transferQuantity: 'Transfer Quantity', + createTime: 'Create Time', + remark: 'Remark' + }, + useRecord: { + id: 'ID', + repairId: 'Repair ID', + itemId: 'Item ID', + itemType: 'Item Type', + itemName: 'Item Name', + itemSpec: 'Item Specification', + fixedItem: 'Fixed Item', + useType: 'Use Type', + useQuantity: 'Use Quantity', + itemPrice: 'Item Price', + userId: 'User ID', + userName: 'User Name', + createTime: 'Create Time', + remark: 'Remark' + } + } + }, + zh: { + resourceDetail: { + itemInfo: '物品信息', + itemNameWithCode: '物品名称(编号):', + warehouseName: '仓库名称:', + itemType: '物品类型:', + itemSpec: '物品规格:', + fixedItem: '固定物品:', + referencePrice: '参考价格:', + chargeStandard: '收费标准:', + itemStock: '物品库存:', + minMeasurement: '最小计量:', + minMeasurementTotal: '最小计量总数:', + itemAvgPrice: '物品均价:', + purchaseRecord: '采购记录', + useRecordText: '领用记录', + inventoryRecord: '盘点记录', + allocationRecord: '调拨记录', + transferRecord: '转赠记录', + usageRecord: '使用记录', + purchase: { + applyOrderId: '申请单号', + applicant: '申请人', + endUser: '使用人', + itemType: '物品类型', + itemName: '物品名称', + itemSpec: '物品规格', + fixedItem: '固定物品', + supplier: '供应商', + warehouse: '物品仓库', + applyQuantity: '申请数量', + actualQuantity: '实际采购数量', + purchasePrice: '采购价格', + totalPrice: '总价', + remark: '申请备注', + status: '状态', + createTime: '创建时间' + }, + itemOut: { + applyOrderId: '申请单号', + applicant: '申请人', + endUser: '使用人', + itemType: '物品类型', + itemName: '物品名称', + itemSpec: '物品规格', + fixedItem: '固定物品', + supplier: '供应商', + warehouse: '物品仓库', + applyQuantity: '申请数量', + quantity: '数量', + purchasePrice: '采购价格', + totalPrice: '总价', + remark: '申请备注', + status: '状态', + createTime: '创建时间' + }, + inventory: { + inventoryId: '盘点单号', + inventoryName: '盘点名称', + inventoryTime: '盘点时间', + warehouse: '盘点仓库', + inventoryPerson: '盘点人', + status: '状态', + createTime: '创建时间' + }, + allocation: { + allocationId: '调拨单号', + itemType: '物品类型', + itemName: '物品名称', + itemSpec: '物品规格', + fixedItem: '固定物品', + originalStock: '被调仓库原库存', + allocationQuantity: '调拨数量', + sourceWarehouse: '被调仓库', + targetWarehouse: '目标仓库', + applicant: '申请人', + remark: '调拨备注', + allocationType: '调拨类型', + status: '状态', + createTime: '时间' + }, + allocationUser: { + id: '编号', + itemType: '物品类型', + itemName: '物品名称', + itemSpec: '物品规格', + fixedItem: '固定物品', + transferUser: '转赠人', + transferTarget: '转赠对象', + originalStock: '原有库存', + transferQuantity: '转赠数量', + createTime: '创建时间', + remark: '备注' + }, + useRecord: { + id: '编号', + repairId: '维修编号', + itemId: '物品编号', + itemType: '物品类型', + itemName: '物品名称', + itemSpec: '物品规格', + fixedItem: '固定物品', + useType: '使用类型', + useQuantity: '使用数量', + itemPrice: '物品价格', + userId: '使用人ID', + userName: '使用人', + createTime: '创建时间', + remark: '备注' + } + } + } +} \ No newline at end of file diff --git a/src/views/resource/resourceDetailList.vue b/src/views/resource/resourceDetailList.vue new file mode 100644 index 0000000..df2c6b5 --- /dev/null +++ b/src/views/resource/resourceDetailList.vue @@ -0,0 +1,308 @@ + + + + + \ No newline at end of file diff --git a/src/views/resource/resourceStoreManageLang.js b/src/views/resource/resourceStoreManageLang.js index 233f71e..0c57438 100644 --- a/src/views/resource/resourceStoreManageLang.js +++ b/src/views/resource/resourceStoreManageLang.js @@ -115,7 +115,8 @@ export const messages = { deleteTypeSuccess: 'Delete type success', inboundTime: 'Inbound Time', unitPrice: 'Unit Price', - fetchTotalPriceError: 'Failed to get total price details' + fetchTotalPriceError: 'Failed to get total price details', + storehouse: 'Storehouse' } }, zh: { @@ -234,7 +235,8 @@ export const messages = { deleteTypeSuccess: '删除类型成功', inboundTime: '入库时间', unitPrice: '单价', - fetchTotalPriceError: '获取物品总价详情失败' + fetchTotalPriceError: '获取物品总价详情失败', + storehouse: '仓库' } } } \ No newline at end of file diff --git a/src/views/resource/resourceStoreManageList.vue b/src/views/resource/resourceStoreManageList.vue index 3880ddb..5248c7b 100644 --- a/src/views/resource/resourceStoreManageList.vue +++ b/src/views/resource/resourceStoreManageList.vue @@ -218,7 +218,7 @@