diff --git a/manifest.json b/manifest.json
index a33f6b4..7b6e4b1 100644
--- a/manifest.json
+++ b/manifest.json
@@ -1,5 +1,5 @@
{
- "name" : "uniapp",
+ "name" : "物品领用",
"appid" : "__UNI__C9A60ED",
"description" : "应用描述",
"versionName" : "1.0.0",
diff --git a/pages/approval/return_approval.vue b/pages/approval/return_approval.vue
index f74c6fd..3c1ffc1 100644
--- a/pages/approval/return_approval.vue
+++ b/pages/approval/return_approval.vue
@@ -35,8 +35,8 @@
- 申请人: {{ item.apply_user_name }}
- 归还时间: {{ item.return_at || '-' }}
+ 申请人: {{ item.applicant_name }}
+ 归还时间: {{ formatDate(item.return_at) }}
@@ -128,6 +128,11 @@
}
return actionMap[status] || ''
},
+ // 格式化日期,只显示年月日
+ formatDate(dateStr) {
+ if (!dateStr) return '-'
+ return dateStr.split(' ')[0]
+ },
handleAction(item) {
uni.navigateTo({
url: '/pages/approval/return_approval_detils?id='+item.id
diff --git a/pages/approval/return_approval_detail.vue b/pages/approval/return_approval_detail.vue
index 509c3df..4690229 100644
--- a/pages/approval/return_approval_detail.vue
+++ b/pages/approval/return_approval_detail.vue
@@ -1,308 +1,349 @@
-
-
+
+
-
-
-
-
- 归还信息
-
- {{ statusText }}
-
-
+
+
+
+
+ 归还信息
+
+ {{ statusText }}
+
+
- 申请人{{ detail.apply_user_name || '-' }}
- 归还时间{{ detail.return_at || '-' }}
-
- 归还备注
- {{ detail.apply_remark || '-' }}
-
-
+
+ 单号
+ {{ detail.order_no || '-' }}
+
+
+ 申请人
+ {{ detail.applicant_name || detail.apply_user_name || '-' }}
+
+
+ 归还时间
+ {{ formatDate(detail.return_at) }}
+
+
+ 归还备注
+ {{ detail.apply_remark || '-' }}
+
+
-
-
-
- 归还物品
-
+
+
+
+ 归还物品明细
+
- 暂无物品
+ 暂无物品
-
-
- {{ it.item_name || '-' }}
- 规格:{{ it.spec_model }}
-
-
- 归还数量
- {{ detail.return_qty || 0 }}
-
-
-
+
+
+ {{ it.requisition_item && it.requisition_item.item_name_snap ? it.requisition_item.item_name_snap : '-' }}
+ 规格:{{ it.requisition_item.spec_model_snap }}
+ 耗材
+
+
+
+
+ 借用数量
+ {{ safeNum(it.requisition_item && it.requisition_item.request_qty ? it.requisition_item.request_qty : 0) }}
+
+
+ 已还数量
+ {{ safeNum(it.requisition_item && it.requisition_item.returned_qty ? it.requisition_item.returned_qty : 0) }}
+
+
+ 本次归还
+ {{ safeNum(it.return_qty) }}
+
+
+
+
+
-
-
-
- 借用信息
-
+
+
+
+ 附件信息
+
- 申请人{{ borrowDetail.applicant_name || '-' }}
- 借用时间{{ borrowDetail.use_start_date || '-' }} ~ {{ borrowDetail.use_end_date || '-' }}
-
- 借用事由
- {{ borrowDetail.borrow_reason || '-' }}
-
-
+
+
+
+ {{ attach.file_name || '-' }}
+ 大小:{{ formatFileSize(attach.file_size) }}
+
+
+
+
+
-
-
-
- 借用物品明细
-
-
- 暂无物品
-
-
-
- {{ it.item_name_snap || '-' }}
- 耗材
-
-
-
- 数量
- {{ safeNum(it.request_qty) }}
-
-
-
-
-
-
-
-
- 审核信息
-
- 审核人{{ detail.audit_info.handler_name || '-' }}
- 审核时间{{ detail.audit_info.handle_time || '-' }}
-
- 审核意见
- {{ detail.audit_info.handle_remark }}
-
-
-
-
+
+
+
+ 审核信息
+
+
+ 审核人
+ {{ detail.handler_name || (detail.audit_info && detail.audit_info.handler_name ? detail.audit_info.handler_name : '-') }}
+
+
+ 审核时间
+ {{ detail.updated_at ? formatDateTime(detail.updated_at) : (detail.audit_info && detail.audit_info.handle_time ? detail.audit_info.handle_time : '-') }}
+
+
+ 审核意见
+ {{ detail.handle_remark || (detail.audit_info && detail.audit_info.handle_remark ? detail.audit_info.handle_remark : '-') }}
+
+
+
+
\ No newline at end of file
diff --git a/pages/approval/return_approval_detils.vue b/pages/approval/return_approval_detils.vue
index 32d66c6..42d3abf 100644
--- a/pages/approval/return_approval_detils.vue
+++ b/pages/approval/return_approval_detils.vue
@@ -21,9 +21,10 @@
- 申请人{{ detail.apply_user_name || '-' }}
- 归还时间{{ detail.return_at || '-' }}
-
+ 单号{{ detail.order_no || '-' }}
+ 申请人{{ detail.applicant_name || detail.apply_user_name || '-' }}
+ 归还时间{{ formatDate(detail.return_at) }}
+
归还备注
{{ detail.apply_remark || '-' }}
@@ -35,16 +36,40 @@
归还物品
- 暂无物品
+ 暂无物品
-
+
- {{ it.item_name }}
- 规格:{{ it.spec_model }}
+ {{ it.requisition_item && it.requisition_item.item_name_snap ? it.requisition_item.item_name_snap : '-' }}
+ 规格:{{ it.requisition_item.spec_model_snap }}
- 归还数量
- {{ detail.return_qty || 0 }}
+
+
+ 借用数量
+ {{ it.requisition_item && it.requisition_item.request_qty ? it.requisition_item.request_qty : 0 }}
+
+
+ 本次归还
+ {{ it.return_qty || 0 }}
+
+
+
+
+
+
+
+
+
+ 附件信息
+
+
+
+
+
+ {{ attach.file_name || '-' }}
+
+
@@ -85,7 +110,6 @@
return {
id: '',
detail: {},
- approveItems: [],
auditRemark: ''
}
},
@@ -116,18 +140,13 @@
method: 'GET',
data: { id: this.id }
}).then((res) => {
- this.detail = (res.data && res.data.data) || {}
- this.initApproveItems()
- })
- },
- initApproveItems() {
- const list = Array.isArray(this.detail.item) ? this.detail.item : []
- this.approveItems = list.map((it) => {
- return {
- item_id: it.id,
- item_name: it.item_name || '',
- spec_model: it.spec_model || '',
- unit: it.unit || ''
+ if (res.data && res.data.code === 200) {
+ this.detail = res.data.data || {}
+ // 兜底,避免 v-for 报错
+ this.detail.item_return = Array.isArray(this.detail.item_return) ? this.detail.item_return : []
+ this.detail.return_attachment = Array.isArray(this.detail.return_attachment) ? this.detail.return_attachment : []
+ } else {
+ showToast({ title: res.data.message || '获取详情失败' })
}
})
},
@@ -139,7 +158,7 @@
}
},
doSubmit(action) {
- if (!this.approveItems.length) {
+ if (!this.detail.item_return || this.detail.item_return.length === 0) {
showToast({ title: '没有可审核的物品' })
return
}
@@ -187,6 +206,27 @@
if (r.confirm) this.doSubmit('2')
}
})
+ },
+ // 格式化日期,只显示年月日
+ formatDate(dateStr) {
+ if (!dateStr) return '-'
+ if (typeof dateStr === 'number') {
+ const date = new Date(dateStr * 1000)
+ const year = date.getFullYear()
+ const month = String(date.getMonth() + 1).padStart(2, '0')
+ const day = String(date.getDate()).padStart(2, '0')
+ return `${year}-${month}-${day}`
+ }
+ return dateStr.split(' ')[0]
+ },
+ // 预览附件
+ previewAttachment(url) {
+ if (!url) return
+ // 去除可能的多余空格和引号
+ url = url.trim().replace(/^["'`]+|["'`]+$/g, '')
+ uni.previewImage({
+ urls: [url]
+ })
}
}
}
@@ -342,7 +382,45 @@
color: #344054;
}
.btn-primary {
- background: rgb(48, 116, 247);
- color: #fff;
- }
+ background: rgb(48, 116, 247);
+ color: #fff;
+ }
+ .qty-info {
+ display: flex;
+ flex-direction: column;
+ gap: 8rpx;
+ }
+ .qty-row {
+ display: flex;
+ align-items: center;
+ gap: 8rpx;
+ }
+ .attachment-list {
+ display: flex;
+ flex-direction: column;
+ gap: 16rpx;
+ }
+ .attachment-item {
+ display: flex;
+ align-items: center;
+ gap: 16rpx;
+ padding: 12rpx 0;
+ }
+ .attachment-info {
+ flex: 1;
+ min-width: 0;
+ }
+ .attachment-name {
+ display: block;
+ font-size: 26rpx;
+ color: #101828;
+ margin-bottom: 4rpx;
+ word-break: break-all;
+ }
+ .attachment-img {
+ width: 120rpx;
+ height: 120rpx;
+ border-radius: 12rpx;
+ flex-shrink: 0;
+ }
\ No newline at end of file
diff --git a/pages/borrow/borrow.vue b/pages/borrow/borrow.vue
index 6e8c4ed..8450d3b 100644
--- a/pages/borrow/borrow.vue
+++ b/pages/borrow/borrow.vue
@@ -46,14 +46,15 @@
计划归还时间
+ ref="returnTimePicker"
+ type="date"
+ v-model="formData.use_end_date"
+ placeholder="请选择时间"
+ :border="false"
+ :clear-icon="false"
+ :start="formData.use_start_date"
+ @change="onReturnTimeChange"
+ >
{{ formData.use_end_date || '请选择时间' }}
@@ -168,6 +169,13 @@
onLoad() {
this.getinfo()
this.getItemNameOptions()
+ // 设置借用时间默认当天
+ const today = new Date()
+ const year = today.getFullYear()
+ const month = String(today.getMonth() + 1).padStart(2, '0')
+ const day = String(today.getDate()).padStart(2, '0')
+ const todayStr = `${year}-${month}-${day}`
+ this.formData.use_start_date = todayStr
},
methods: {
leftClick(){
diff --git a/pages/borrow/borrow_list.vue b/pages/borrow/borrow_list.vue
index b29b56d..265c77d 100644
--- a/pages/borrow/borrow_list.vue
+++ b/pages/borrow/borrow_list.vue
@@ -112,7 +112,7 @@
current:pageNo,
size:10,
applicant_id:'self',
- status: this.currentTab === 0 ? '' : (this.currentTab === 1 ? 'repaid' : (this.currentTab === 2 ? 'unreturned' : 'approve'))
+ phase: this.currentTab === 0 ? '' : (this.currentTab === 1 ? 'repaid' : (this.currentTab === 2 ? 'unreturned' : 'approve'))
};
request({
url:'mobile/inv/requisition/list',
diff --git a/pages/index/index.vue b/pages/index/index.vue
index 6034e75..ca6c816 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -1,6 +1,6 @@
-
+
审批管理
@@ -28,7 +28,7 @@
-
+
@@ -51,10 +51,10 @@
data() {
return {
list: [
- {
- title: '备货单审批',
- url:''
- },
+ // {
+ // title: '备货单审批',
+ // url:''
+ // },
{
title: '借用审批',
url:'/pages/approval/borrow_approval'
diff --git a/pages/login/index.vue b/pages/login/index.vue
index 65630eb..b0ba161 100644
--- a/pages/login/index.vue
+++ b/pages/login/index.vue
@@ -67,12 +67,12 @@
async silentAuth() {
try {
// 1) 如果本地已有 token,直接进首页(丝滑)
- const token = uni.getStorageSync('token')
- if (token) {
- this.title = '已登录'
- this.desc = '正在进入首页'
- return this.goHomeSmooth()
- }
+ // const token = uni.getStorageSync('token')
+ // if (token) {
+ // this.title = '已登录'
+ // this.desc = '正在进入首页'
+ // return this.goHomeSmooth()
+ // }
// 2) 获取飞书授权跳转地址(静默授权/免登)
this.title = '正在跳转飞书授权'