From 38a551da22845ba4dbd435e994c111dd9709c914 Mon Sep 17 00:00:00 2001 From: feie9456 Date: Tue, 7 Oct 2025 13:20:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96ui=EF=BC=8C=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=9B=BA=E5=AE=9A=E8=B5=84=E4=BA=A7=E5=80=9F=E7=94=A8=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 9 + src/pages.json | 13 + src/pages/api/consumable-temp.ts | 2 +- src/pages/api/fixedAssets.js | 26 + src/pages/consumables/temp-approve-detail.vue | 53 +- src/pages/consumables/temp-approve.vue | 2 +- src/pages/consumables/temp-request-detail.vue | 40 +- src/pages/consumables/temp-request-edit.vue | 672 +++++++++++ src/pages/consumables/temp-request.vue | 2 +- src/pages/fixed-assets/index.vue | 1061 ++++++++++++----- src/pages/fixed-assets/inventory-plan.vue | 2 +- src/pages/fixed-assets/lent-management.vue | 547 +++++++++ src/pages/fixed-assets/my-borrows.vue | 447 +++++-- src/pages/index/index.vue | 69 +- src/pages/login/index.vue | 8 +- src/pages/mine/index.vue | 9 +- src/utils/messageManager.ts | 19 +- 17 files changed, 2465 insertions(+), 516 deletions(-) create mode 100644 src/pages/consumables/temp-request-edit.vue create mode 100644 src/pages/fixed-assets/lent-management.vue diff --git a/index.html b/index.html index f8a54cb..0fd9429 100644 --- a/index.html +++ b/index.html @@ -13,6 +13,15 @@ +
diff --git a/src/pages.json b/src/pages.json index bcbd209..74db6c5 100644 --- a/src/pages.json +++ b/src/pages.json @@ -137,6 +137,12 @@ "navigationBarTitleText": "申请详情" } }, + { + "path": "pages/consumables/temp-request-edit", + "style": { + "navigationBarTitleText": "编辑申请" + } + }, { "path": "pages/consumables/temp-approve", "style": { @@ -160,6 +166,13 @@ "style": { "navigationBarTitleText": "扫码查看信息" } + }, + { + "path": "pages/fixed-assets/lent-management", + "style": { + "navigationBarTitleText": "出借资产管理", + "enablePullDownRefresh": false + } } ], "globalStyle": { diff --git a/src/pages/api/consumable-temp.ts b/src/pages/api/consumable-temp.ts index e196184..2434f74 100644 --- a/src/pages/api/consumable-temp.ts +++ b/src/pages/api/consumable-temp.ts @@ -1,6 +1,6 @@ import { formatTime, formatDate, formatDateTime, getHeaders } from './index'; -const BASE_URL = 'http://localhost:3000' // 替换为你的实际后端地址 +const BASE_URL = 'http://localhost:8090' // 替换为你的实际后端地址 // 请求封装 const request = (url: string, options: any = {}) => { const token = uni.getStorageSync('token') diff --git a/src/pages/api/fixedAssets.js b/src/pages/api/fixedAssets.js index 7a607dc..1f58ad2 100644 --- a/src/pages/api/fixedAssets.js +++ b/src/pages/api/fixedAssets.js @@ -178,6 +178,8 @@ export function borrowAssetById(addDTO) { //作用:前端 “个人借用记录页” 加载数据时调用(如显示当前用户借了哪些资产)。 export function borrowInfo(borrowerId) { return new Promise((resolve, reject) => { + console.log(1); + uni.request({ url: `${BASE_URL}/api/asset/borrow/list`,// 接口路径:个人借用记录列表 method: 'POST', @@ -222,6 +224,30 @@ export function returnAsset(id) { }); } + +//查询所有借出资产列表 +//作用:前端"出借资产管理"页面加载数据时调用(管理员查看所有借出的资产,包括已归还和未归还)。 +export function fetchBorrowList() { + return new Promise((resolve, reject) => { + uni.request({ + url: `${BASE_URL}/api/asset/borrow/list`, // 接口路径:借出资产列表接口 + method: 'POST', // 请求方法:POST + header: getHeaders(), + data: {}, // 请求体:空(获取所有借出记录,不过滤条件) + success: (res) => { + if (res.statusCode === 200) { + resolve(res.data); // 返回借出资产列表数据 + } else { + reject(res); + } + }, + fail: (err) => { + reject(err); + } + }); + }); +} + //————————————————————————————————————————————————业务接口函数(易耗品相关)—————————————————————————————————————————— //易耗品领用 diff --git a/src/pages/consumables/temp-approve-detail.vue b/src/pages/consumables/temp-approve-detail.vue index 726aa2a..a3cd0b3 100644 --- a/src/pages/consumables/temp-approve-detail.vue +++ b/src/pages/consumables/temp-approve-detail.vue @@ -60,7 +60,7 @@ 需要时间: - {{ detail.neededAt || '-' }} + {{ detail.neededAt ? new Date(detail.neededAt).toLocaleDateString() : '-' }} 审批人ID: @@ -459,47 +459,51 @@ onMounted(() => { } .status-card { - background: #3a5ddd; + background: #fff; border-radius: 20rpx; padding: 32rpx; margin-bottom: 24rpx; display: flex; - flex-direction: column; + justify-content: space-between; align-items: center; - gap: 16rpx; + box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.06); } .status-badge { - padding: 12rpx 32rpx; - border-radius: 24rpx; - font-size: 32rpx; - font-weight: 600; - background: rgba(255, 255, 255, 0.9); + padding: 8rpx 24rpx; + border-radius: 8rpx; + font-size: 28rpx; + font-weight: 500; } .status-pending { + background: #fff3e0; color: #f57c00; } .status-approved { + background: #e8f5e9; color: #2e7d32; } .status-rejected { + background: #ffebee; color: #c62828; } .status-cancelled { + background: #f5f5f5; color: #757575; } .status-completed { + background: #e3f2fd; color: #1976d2; } .status-time { font-size: 26rpx; - color: rgba(255, 255, 255, 0.9); + color: #999; } .section { @@ -527,16 +531,17 @@ onMounted(() => { width: 100rpx; height: 100rpx; border-radius: 50%; - background: #3a5ddd; + background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); display: flex; align-items: center; justify-content: center; flex-shrink: 0; + border: 4rpx solid #f0f0f0; } .avatar-text { - font-size: 40rpx; - font-weight: 600; + font-size: 36rpx; + font-weight: 500; color: #fff; } @@ -680,25 +685,26 @@ onMounted(() => { } .total-card { - background: #f9a825; + background: #fff; border-radius: 20rpx; padding: 32rpx; display: flex; justify-content: space-between; align-items: center; - box-shadow: 0 8rpx 24rpx rgba(249, 168, 37, 0.2); + box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.06); + border-left: 6rpx solid #ff9800; } .total-label { font-size: 32rpx; - font-weight: 600; - color: #fff; + font-weight: 500; + color: #666; } .total-value { font-size: 40rpx; font-weight: 700; - color: #fff; + color: #ff6b00; } .footer-actions { @@ -726,12 +732,13 @@ onMounted(() => { } .btn-reject { - background: #ef5350; - color: #fff; + background: #fff; + color: #f44336; + border: 2rpx solid #f44336; } .btn-approve { - background: #3a5ddd; + background: #007aff; color: #fff; } @@ -837,12 +844,12 @@ onMounted(() => { } .btn-confirm { - background: #3a5ddd; + background: #007aff; color: #fff; } .btn-confirm.btn-danger { - background: #ef5350; + background: #f44336; } .btn-confirm[disabled] { diff --git a/src/pages/consumables/temp-approve.vue b/src/pages/consumables/temp-approve.vue index d6525bd..1f73e30 100644 --- a/src/pages/consumables/temp-approve.vue +++ b/src/pages/consumables/temp-approve.vue @@ -177,7 +177,7 @@ async function loadList(reset = false) { // 根据开关过滤数据:默认不显示 COMPLETED if (!showCompleted.value) { - newData = newData.filter((item: ConsumableRequest) => item.status !== 'COMPLETED') + newData = newData.filter((item: ConsumableRequest) => item.status !== 'COMPLETED' && item.status !== 'REJECTED') } list.value = reset ? newData : [...list.value, ...newData] diff --git a/src/pages/consumables/temp-request-detail.vue b/src/pages/consumables/temp-request-detail.vue index 8137689..d352327 100644 --- a/src/pages/consumables/temp-request-detail.vue +++ b/src/pages/consumables/temp-request-detail.vue @@ -247,47 +247,51 @@ onMounted(() => { } .status-card { - background: #3a5ddd; + background: #fff; border-radius: 20rpx; padding: 32rpx; margin-bottom: 24rpx; display: flex; - flex-direction: column; + justify-content: space-between; align-items: center; - gap: 16rpx; + box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.06); } .status-badge { - padding: 12rpx 32rpx; - border-radius: 24rpx; - font-size: 32rpx; - font-weight: 600; - background: rgba(255, 255, 255, 0.9); + padding: 8rpx 24rpx; + border-radius: 8rpx; + font-size: 28rpx; + font-weight: 500; } .status-pending { + background: #fff3e0; color: #f57c00; } .status-approved { + background: #e8f5e9; color: #2e7d32; } .status-rejected { + background: #ffebee; color: #c62828; } .status-cancelled { + background: #f5f5f5; color: #757575; } .status-completed { + background: #e3f2fd; color: #1976d2; } .status-time { font-size: 26rpx; - color: rgba(255, 255, 255, 0.9); + color: #999; } .section { @@ -400,25 +404,26 @@ onMounted(() => { } .total-card { - background: #f9a825; + background: #fff; border-radius: 20rpx; padding: 32rpx; display: flex; justify-content: space-between; align-items: center; - box-shadow: 0 8rpx 24rpx rgba(249, 168, 37, 0.2); + box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.06); + border-left: 6rpx solid #ff9800; } .total-label { font-size: 32rpx; - font-weight: 600; - color: #fff; + font-weight: 500; + color: #666; } .total-value { font-size: 40rpx; font-weight: 700; - color: #fff; + color: #ff6b00; } .footer-actions { @@ -445,12 +450,13 @@ onMounted(() => { } .btn-danger { - background: #ef5350; - color: #fff; + background: #fff; + color: #f44336; + border: 2rpx solid #f44336; } .btn-primary { - background: #3a5ddd; + background: #007aff; color: #fff; } diff --git a/src/pages/consumables/temp-request-edit.vue b/src/pages/consumables/temp-request-edit.vue new file mode 100644 index 0000000..403b6cc --- /dev/null +++ b/src/pages/consumables/temp-request-edit.vue @@ -0,0 +1,672 @@ +