This commit is contained in:
浅念
2026-02-06 16:23:35 +08:00
parent bf3d85de0d
commit 8d8245ee4a
8 changed files with 474 additions and 342 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
{ {
"name" : "uniapp", "name" : "物品领用",
"appid" : "__UNI__C9A60ED", "appid" : "__UNI__C9A60ED",
"description" : "应用描述", "description" : "应用描述",
"versionName" : "1.0.0", "versionName" : "1.0.0",
+7 -2
View File
@@ -35,8 +35,8 @@
<uni-tag :text="item1.item_name" size="mini" type="primary" v-for="(item1, index) in item.item" :key="index"/> <uni-tag :text="item1.item_name" size="mini" type="primary" v-for="(item1, index) in item.item" :key="index"/>
</view> </view>
<view class="card-info"> <view class="card-info">
<text class="info-item">申请人: {{ item.apply_user_name }}</text> <text class="info-item">申请人: {{ item.applicant_name }}</text>
<text class="info-item">归还时间: {{ item.return_at || '-' }}</text> <text class="info-item">归还时间: {{ formatDate(item.return_at) }}</text>
</view> </view>
<view class="action-btns"> <view class="action-btns">
@@ -128,6 +128,11 @@
} }
return actionMap[status] || '' return actionMap[status] || ''
}, },
// 格式化日期,只显示年月日
formatDate(dateStr) {
if (!dateStr) return '-'
return dateStr.split(' ')[0]
},
handleAction(item) { handleAction(item) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/approval/return_approval_detils?id='+item.id url: '/pages/approval/return_approval_detils?id='+item.id
+332 -291
View File
@@ -1,308 +1,349 @@
<template> <template>
<view class="page"> <view class="page">
<uni-nav-bar <uni-nav-bar
leftText=" " :fixed="true"
:fixed="true" leftIcon="back"
leftIcon="back" backgroundColor="rgb(48, 116, 247)"
background-color="rgb(48, 116, 247)" color="#fff"
color="#fff" :statusBar="true"
:statusBar="true" title="归还详情"
title="归还详情" @clickLeft="onBack"
@clickLeft="onBack" />
/>
<view class="content"> <view class="content">
<!-- 基本信息 --> <!-- 基本信息 -->
<view class="card"> <view class="card">
<view class="card-head"> <view class="card-head">
<text class="card-title">归还信息</text> <text class="card-title">归还信息</text>
<view class="status-tag" :class="'s' + (detail.status || 0)"> <view class="status-tag" :class="'s' + (detail.status || 0)">
<text class="status-text">{{ statusText }}</text> <text class="status-text">{{ statusText }}</text>
</view> </view>
</view> </view>
<view class="row"><text class="label">申请人</text><text class="value">{{ detail.apply_user_name || '-' }}</text></view> <view class="row">
<view class="row"><text class="label">归还时间</text><text class="value">{{ detail.return_at || '-' }}</text></view> <text class="label">单号</text>
<view class="row" v-if="detail.apply_remark !== undefined"> <text class="value">{{ detail.order_no || '-' }}</text>
<text class="label">归还备注</text> </view>
<text class="value">{{ detail.apply_remark || '-' }}</text> <view class="row">
</view> <text class="label">申请人</text>
</view> <text class="value">{{ detail.applicant_name || detail.apply_user_name || '-' }}</text>
</view>
<view class="row">
<text class="label">归还时间</text>
<text class="value">{{ formatDate(detail.return_at) }}</text>
</view>
<view class="row" v-if="detail.apply_remark">
<text class="label">归还备注</text>
<text class="value">{{ detail.apply_remark || '-' }}</text>
</view>
</view>
<!-- 物品明细 --> <!-- 归还物品明细 -->
<view class="card"> <view class="card">
<view class="card-head"> <view class="card-head">
<text class="card-title">归还物品</text> <text class="card-title">归还物品明细</text>
</view> </view>
<view v-if="detail.item && detail.item.length === 0" class="empty">暂无物品</view> <view v-if="!detail.item_return || detail.item_return.length === 0" class="empty">暂无物品</view>
<view v-for="(it, idx) in detail.item" :key="it.id" class="item"> <view v-for="(it, idx) in detail.item_return" :key="it.id" class="item">
<view class="item-left"> <view class="item-left">
<text class="item-name">{{ it.item_name || '-' }}</text> <text class="item-name">{{ it.requisition_item && it.requisition_item.item_name_snap ? it.requisition_item.item_name_snap : '-' }}</text>
<text class="item-meta" v-if="it.spec_model">规格:{{ it.spec_model }}</text> <text class="item-meta" v-if="it.requisition_item && it.requisition_item.spec_model_snap">规格:{{ it.requisition_item.spec_model_snap }}</text>
</view> <text class="item-meta" v-if="it.requisition_item && String(it.requisition_item.is_consumable_snap) === '1'">耗材</text>
<view class="item-right"> </view>
<text class="qty-label">归还数量</text> <view class="item-right">
<text class="qty-val">{{ detail.return_qty || 0 }}</text> <view class="qty-info">
</view> <view class="qty-row">
</view> <text class="qty-label">借用数量</text>
</view> <text class="qty-val">{{ safeNum(it.requisition_item && it.requisition_item.request_qty ? it.requisition_item.request_qty : 0) }}</text>
</view>
<view class="qty-row">
<text class="qty-label">已还数量</text>
<text class="qty-val">{{ safeNum(it.requisition_item && it.requisition_item.returned_qty ? it.requisition_item.returned_qty : 0) }}</text>
</view>
<view class="qty-row">
<text class="qty-label">本次归还</text>
<text class="qty-val">{{ safeNum(it.return_qty) }}</text>
</view>
</view>
</view>
</view>
</view>
<!-- 借用详情 --> <!-- 附件信息 -->
<view class="card" v-if="borrowDetail.id"> <view class="card" v-if="detail.return_attachment && detail.return_attachment.length > 0">
<view class="card-head"> <view class="card-head">
<text class="card-title">借用信息</text> <text class="card-title">附件信息</text>
</view> </view>
<view class="row"><text class="label">申请人</text><text class="value">{{ borrowDetail.applicant_name || '-' }}</text></view> <view class="attachment-list">
<view class="row"><text class="label">借用时间</text><text class="value">{{ borrowDetail.use_start_date || '-' }} ~ {{ borrowDetail.use_end_date || '-' }}</text></view> <view v-for="(attach, idx) in detail.return_attachment" :key="attach.id" class="attachment-item">
<view class="row" v-if="borrowDetail.borrow_reason !== undefined"> <view class="attachment-info">
<text class="label">借用事由</text> <text class="attachment-name">{{ attach.file_name || '-' }}</text>
<text class="value">{{ borrowDetail.borrow_reason || '-' }}</text> <text class="attachment-size" v-if="attach.file_size">大小:{{ formatFileSize(attach.file_size) }}</text>
</view> </view>
</view> <image v-if="attach.file_path_pull" :src="attach.file_path_pull" mode="aspectFill" class="attachment-img" @click="previewAttachment(attach.file_path_pull)"></image>
</view>
</view>
</view>
<!-- 借用物品明细 --> <!-- 审核信息 -->
<view class="card" v-if="borrowDetail.id"> <view class="card" v-if="detail.handler_name || detail.audit_info">
<view class="card-head"> <view class="card-head">
<text class="card-title">借用物品明细</text> <text class="card-title">审核信息</text>
</view> </view>
<view class="row">
<view v-if="!borrowDetail.item || borrowDetail.item.length === 0" class="empty">暂无物品</view> <text class="label">审核人</text>
<text class="value">{{ detail.handler_name || (detail.audit_info && detail.audit_info.handler_name ? detail.audit_info.handler_name : '-') }}</text>
<view v-for="(it, idx) in borrowDetail.item" :key="it.id || idx" class="item"> </view>
<view class="item-left"> <view class="row">
<text class="item-name">{{ it.item_name_snap || '-' }}</text> <text class="label">审核时间</text>
<text class="item-meta" v-if="String(it.is_consumable_snap) === '1'">耗材</text> <text class="value">{{ detail.updated_at ? formatDateTime(detail.updated_at) : (detail.audit_info && detail.audit_info.handle_time ? detail.audit_info.handle_time : '-') }}</text>
</view> </view>
<view class="item-right"> <view class="row" v-if="detail.handle_remark || (detail.audit_info && detail.audit_info.handle_remark)">
<view class="grid-cell"> <text class="label">审核意见</text>
<text class="g-label">数量</text> <text class="value">{{ detail.handle_remark || (detail.audit_info && detail.audit_info.handle_remark ? detail.audit_info.handle_remark : '-') }}</text>
<text class="g-val">{{ safeNum(it.request_qty) }}</text> </view>
</view> </view>
</view> </view>
</view> </view>
</view>
<!-- 审核信息 -->
<view class="card" v-if="detail.audit_info">
<view class="card-head">
<text class="card-title">审核信息</text>
</view>
<view class="row"><text class="label">审核人</text><text class="value">{{ detail.audit_info.handler_name || '-' }}</text></view>
<view class="row"><text class="label">审核时间</text><text class="value">{{ detail.audit_info.handle_time || '-' }}</text></view>
<view class="row" v-if="detail.audit_info.handle_remark">
<text class="label">审核意见</text>
<text class="value">{{ detail.audit_info.handle_remark }}</text>
</view>
</view>
</view>
</view>
</template> </template>
<script> <script>
import { request, showToast } from '@/api/apiT.js' import { request, showToast } from '@/api/apiT.js'
export default { export default {
data() { data() {
return { return {
id: '', id: '',
detail: {}, detail: {}
borrowDetail: {} // 借用详情数据 }
} },
}, computed: {
computed: { statusText() {
statusText() { const s = Number(this.detail.status || 0)
const s = Number(this.detail.status || 0) if (s === 0) return '待审核'
if (s === 0) return '待审核' if (s === 1) return '已通过'
if (s === 1) return '已通过' if (s === 2) return '已驳回'
if (s === 2) return '已驳回' return '处理中'
return '处理中' }
} },
}, onLoad(option) {
onLoad(option) { this.id = option.id || ''
this.id = option.id || '' if (!this.id) {
if (!this.id) { showToast({ title: '缺少id参数' })
showToast({ title: '缺少id参数' }) return
return }
} this.getDetail()
this.getDetail() },
}, methods: {
methods: { onBack() {
onBack() { uni.navigateBack()
uni.navigateBack() },
}, getDetail() {
getDetail() { request({
request({ url: 'mobile/inv/requisition/return/show',
url: 'mobile/inv/requisition/return/show', method: 'GET',
method: 'GET', data: { id: this.id }
data: { id: this.id } }).then((res) => {
}).then((res) => { if (res.data && res.data.code === 200) {
if (res.data && res.data.code === 200) { this.detail = res.data.data || {}
this.detail = res.data.data || {} this.detail.item_return = Array.isArray(this.detail.item_return) ? this.detail.item_return : []
// 兜底,避免 v-for 报错 this.detail.return_attachment = Array.isArray(this.detail.return_attachment) ? this.detail.return_attachment : []
this.detail.item = Array.isArray(this.detail.item) ? this.detail.item : [] } else {
showToast({ title: res.data.message || '获取详情失败' })
// 如果有借用详情的id,则获取借用详情数据 }
const borrowId = this.detail.requisition_item_id || this.detail.item_id })
if (borrowId) { },
this.getBorrowDetail(borrowId) safeNum(v) {
} const n = Number(v)
} else { return Number.isFinite(n) ? n : 0
showToast({ title: res.data.message || '获取详情失败' }) },
} formatDate(dateStr) {
}) if (!dateStr) return '-'
}, if (typeof dateStr === 'number') {
// 获取借用详情数据 const date = new Date(dateStr * 1000)
getBorrowDetail(borrowId) { const year = date.getFullYear()
request({ const month = String(date.getMonth() + 1).padStart(2, '0')
url: 'mobile/inv/requisition/show', const day = String(date.getDate()).padStart(2, '0')
method: 'GET', return `${year}-${month}-${day}`
data: { id: borrowId } }
}).then((res) => { return dateStr.split(' ')[0]
if (res.data && res.data.code === 200) { },
this.borrowDetail = res.data.data || {} formatDateTime(dateStr) {
// 兜底,避免 v-for 报错 if (!dateStr) return '-'
this.borrowDetail.item = Array.isArray(this.borrowDetail.item) ? this.borrowDetail.item : [] if (typeof dateStr === 'string' && dateStr.includes('T')) {
} else { return dateStr.replace('T', ' ').replace('Z', '')
showToast({ title: res.data.message || '获取借用详情失败' }) }
} return dateStr
}) },
}, formatFileSize(size) {
// 安全处理数字显示 if (!size) return '-'
safeNum(v) { if (size < 1024) {
const n = Number(v) return size + ' B'
return Number.isFinite(n) ? n : 0 } else if (size < 1024 * 1024) {
} return (size / 1024).toFixed(2) + ' KB'
} } else {
} return (size / (1024 * 1024)).toFixed(2) + ' MB'
}
},
previewAttachment(url) {
if (!url) return
url = url.trim().replace(/^["'`]+|["'`]+$/g, '')
uni.previewImage({
urls: [url]
})
}
}
}
</script> </script>
<style lang="scss"> <style lang="scss">
.page { .page {
min-height: 100vh; min-height: 100vh;
background: rgb(244, 246, 248); background: rgb(244, 246, 248);
} }
.content { .content {
padding: 20rpx; padding: 20rpx;
} }
.card { .card {
background: #fff; background: #fff;
border-radius: 20rpx; border-radius: 20rpx;
padding: 22rpx; padding: 22rpx;
margin-bottom: 18rpx; margin-bottom: 18rpx;
box-shadow: 0 6rpx 18rpx rgba(0, 0, 0, 0.04); box-shadow: 0 6rpx 18rpx rgba(0, 0, 0, 0.04);
} }
.card-head { .card-head {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
margin-bottom: 16rpx; margin-bottom: 16rpx;
} }
.card-title { .card-title {
font-size: 30rpx; font-size: 30rpx;
font-weight: 700; font-weight: 700;
color: #1f2d3d; color: #1f2d3d;
} }
.row { .row {
display: flex; display: flex;
align-items: flex-start; align-items: flex-start;
justify-content: space-between; justify-content: space-between;
padding: 10rpx 0; padding: 10rpx 0;
border-bottom: 1rpx solid #f1f3f5; border-bottom: 1rpx solid #f1f3f5;
} }
.row:last-child { .row:last-child {
border-bottom: none; border-bottom: none;
} }
.label { .label {
width: 160rpx; width: 160rpx;
font-size: 26rpx; font-size: 26rpx;
color: #667085; color: #667085;
} }
.value { .value {
flex: 1; flex: 1;
text-align: right; text-align: right;
font-size: 26rpx; font-size: 26rpx;
color: #101828; color: #101828;
} }
.status-tag { .status-tag {
padding: 6rpx 14rpx; padding: 6rpx 14rpx;
border-radius: 999rpx; border-radius: 999rpx;
background: rgba(48, 116, 247, 0.12); background: rgba(48, 116, 247, 0.12);
} }
.status-text { .status-text {
font-size: 24rpx; font-size: 24rpx;
color: rgb(48, 116, 247); color: rgb(48, 116, 247);
} }
.empty { .empty {
padding: 24rpx 0; padding: 24rpx 0;
text-align: center; text-align: center;
color: #98a2b3; color: #98a2b3;
font-size: 26rpx; font-size: 26rpx;
} }
.item { .item {
padding: 16rpx 0; padding: 16rpx 0;
border-top: 1rpx dashed #eef2f6; border-top: 1rpx dashed #eef2f6;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
gap: 16rpx; gap: 16rpx;
} }
.item-left { .item-left {
flex: 1; flex: 1;
min-width: 0; min-width: 0;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 6rpx; gap: 6rpx;
} }
.item-right { .item-right {
display: flex; display: flex;
align-items: baseline; align-items: baseline;
gap: 10rpx; gap: 10rpx;
flex-shrink: 0; flex-shrink: 0;
} }
.qty-label { .qty-info {
font-size: 22rpx; display: flex;
color: #667085; flex-direction: column;
} gap: 8rpx;
.qty-val { }
font-size: 30rpx; .qty-row {
font-weight: 700; display: flex;
color: #101828; align-items: center;
} gap: 8rpx;
.item:first-child { }
border-top: none; .qty-label {
padding-top: 0; font-size: 22rpx;
} color: #667085;
.item-name { }
font-size: 28rpx; .qty-val {
font-weight: 700; font-size: 30rpx;
color: #101828; font-weight: 700;
} color: #101828;
.item-meta { }
font-size: 24rpx; .item:first-child {
color: #98a2b3; border-top: none;
} padding-top: 0;
/* 借用物品明细样式 */ }
.grid-cell { .item-name {
// background: #fafbff; font-size: 28rpx;
border-radius: 10rpx; font-weight: 700;
padding: 14rpx 10rpx; color: #101828;
text-align: center; }
// border: 1rpx solid #f0f0f0; .item-meta {
margin-left: 10rpx; font-size: 24rpx;
} color: #98a2b3;
.g-label { }
display: block; .attachment-list {
font-size: 22rpx; display: flex;
color: #888; flex-direction: column;
margin-bottom: 6rpx; gap: 16rpx;
} }
.g-val { .attachment-item {
display: block; display: flex;
font-size: 30rpx; align-items: center;
font-weight: 700; gap: 16rpx;
color: #222; 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-size {
font-size: 22rpx;
color: #98a2b3;
}
.attachment-img {
width: 120rpx;
height: 120rpx;
border-radius: 12rpx;
flex-shrink: 0;
}
</style> </style>
+104 -26
View File
@@ -21,9 +21,10 @@
</view> </view>
</view> </view>
<view class="row"><text class="label">申请人</text><text class="value">{{ detail.apply_user_name || '-' }}</text></view> <view class="row"><text class="label">单号</text><text class="value">{{ detail.order_no || '-' }}</text></view>
<view class="row"><text class="label">归还时间</text><text class="value">{{ detail.return_at || '-' }}</text></view> <view class="row"><text class="label">申请人</text><text class="value">{{ detail.applicant_name || detail.apply_user_name || '-' }}</text></view>
<view class="row" v-if="detail.apply_remark !== undefined"> <view class="row"><text class="label">归还时间</text><text class="value">{{ formatDate(detail.return_at) }}</text></view>
<view class="row" v-if="detail.apply_remark">
<text class="label">归还备注</text> <text class="label">归还备注</text>
<text class="value">{{ detail.apply_remark || '-' }}</text> <text class="value">{{ detail.apply_remark || '-' }}</text>
</view> </view>
@@ -35,16 +36,40 @@
<text class="card-title">归还物品</text> <text class="card-title">归还物品</text>
</view> </view>
<view v-if="approveItems.length === 0" class="empty">暂无物品</view> <view v-if="!detail.item_return || detail.item_return.length === 0" class="empty">暂无物品</view>
<view v-for="(it, idx) in approveItems" :key="it.item_id" class="item"> <view v-for="(it, idx) in detail.item_return" :key="it.id" class="item">
<view class="item-left"> <view class="item-left">
<text class="item-name">{{ it.item_name }}</text> <text class="item-name">{{ it.requisition_item && it.requisition_item.item_name_snap ? it.requisition_item.item_name_snap : '-' }}</text>
<text class="item-meta" v-if="it.spec_model">规格:{{ it.spec_model }}</text> <text class="item-meta" v-if="it.requisition_item && it.requisition_item.spec_model_snap">规格:{{ it.requisition_item.spec_model_snap }}</text>
</view> </view>
<view class="item-right"> <view class="item-right">
<text class="qty-label">归还数量</text> <view class="qty-info">
<text class="qty-val">{{ detail.return_qty || 0 }}</text> <view class="qty-row">
<text class="qty-label">借用数量</text>
<text class="qty-val">{{ it.requisition_item && it.requisition_item.request_qty ? it.requisition_item.request_qty : 0 }}</text>
</view>
<view class="qty-row">
<text class="qty-label">本次归还</text>
<text class="qty-val">{{ it.return_qty || 0 }}</text>
</view>
</view>
</view>
</view>
</view>
<!-- 附件信息 -->
<view class="card" v-if="detail.return_attachment && detail.return_attachment.length > 0">
<view class="card-head">
<text class="card-title">附件信息</text>
</view>
<view class="attachment-list">
<view v-for="(attach, idx) in detail.return_attachment" :key="attach.id" class="attachment-item">
<view class="attachment-info">
<text class="attachment-name">{{ attach.file_name || '-' }}</text>
</view>
<image v-if="attach.file_path_pull" :src="attach.file_path_pull" mode="aspectFill" class="attachment-img" @click="previewAttachment(attach.file_path_pull)"></image>
</view> </view>
</view> </view>
</view> </view>
@@ -85,7 +110,6 @@
return { return {
id: '', id: '',
detail: {}, detail: {},
approveItems: [],
auditRemark: '' auditRemark: ''
} }
}, },
@@ -116,18 +140,13 @@
method: 'GET', method: 'GET',
data: { id: this.id } data: { id: this.id }
}).then((res) => { }).then((res) => {
this.detail = (res.data && res.data.data) || {} if (res.data && res.data.code === 200) {
this.initApproveItems() this.detail = res.data.data || {}
}) // 兜底,避免 v-for 报错
}, this.detail.item_return = Array.isArray(this.detail.item_return) ? this.detail.item_return : []
initApproveItems() { this.detail.return_attachment = Array.isArray(this.detail.return_attachment) ? this.detail.return_attachment : []
const list = Array.isArray(this.detail.item) ? this.detail.item : [] } else {
this.approveItems = list.map((it) => { showToast({ title: res.data.message || '获取详情失败' })
return {
item_id: it.id,
item_name: it.item_name || '',
spec_model: it.spec_model || '',
unit: it.unit || ''
} }
}) })
}, },
@@ -139,7 +158,7 @@
} }
}, },
doSubmit(action) { doSubmit(action) {
if (!this.approveItems.length) { if (!this.detail.item_return || this.detail.item_return.length === 0) {
showToast({ title: '没有可审核的物品' }) showToast({ title: '没有可审核的物品' })
return return
} }
@@ -187,6 +206,27 @@
if (r.confirm) this.doSubmit('2') 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; color: #344054;
} }
.btn-primary { .btn-primary {
background: rgb(48, 116, 247); background: rgb(48, 116, 247);
color: #fff; 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;
}
</style> </style>
+16 -8
View File
@@ -46,14 +46,15 @@
<text class="form-label required">计划归还时间</text> <text class="form-label required">计划归还时间</text>
<view class="form-input-container"> <view class="form-input-container">
<uni-datetime-picker <uni-datetime-picker
ref="returnTimePicker" ref="returnTimePicker"
type="date" type="date"
v-model="formData.use_end_date" v-model="formData.use_end_date"
placeholder="请选择时间" placeholder="请选择时间"
:border="false" :border="false"
:clear-icon="false" :clear-icon="false"
@change="onReturnTimeChange" :start="formData.use_start_date"
> @change="onReturnTimeChange"
>
<view class="custom-datetime-input"> <view class="custom-datetime-input">
<text class="custom-datetime-text" :class="{ 'placeholder': !formData.use_end_date }"> <text class="custom-datetime-text" :class="{ 'placeholder': !formData.use_end_date }">
{{ formData.use_end_date || '请选择时间' }} {{ formData.use_end_date || '请选择时间' }}
@@ -168,6 +169,13 @@
onLoad() { onLoad() {
this.getinfo() this.getinfo()
this.getItemNameOptions() 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: { methods: {
leftClick(){ leftClick(){
+1 -1
View File
@@ -112,7 +112,7 @@
current:pageNo, current:pageNo,
size:10, size:10,
applicant_id:'self', 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({ request({
url:'mobile/inv/requisition/list', url:'mobile/inv/requisition/list',
+7 -7
View File
@@ -1,6 +1,6 @@
<template> <template>
<view class="home-page"> <view class="home-page">
<uni-nav-bar leftText=" " :fixed="true" :border="false" @clickLeft="leftClick" color="#fff" backgroundColor="rgb(79 137 247)" :statusBar="true" title="X-Server"></uni-nav-bar> <uni-nav-bar leftText=" " :fixed="true" :border="false" @clickLeft="leftClick" color="#fff" backgroundColor="rgb(79 137 247)" :statusBar="true" title="领用管理"></uni-nav-bar>
<view> <view>
<view class="cards"> <view class="cards">
<view class="title">审批管理</view> <view class="title">审批管理</view>
@@ -28,7 +28,7 @@
</u-grid-item> </u-grid-item>
</u-grid> </u-grid>
</view> </view>
<view class="cards"> <!-- <view class="cards">
<view class="title">备货单</view> <view class="title">备货单</view>
<u-grid :border="false" col="5" > <u-grid :border="false" col="5" >
<u-grid-item <u-grid-item
@@ -40,7 +40,7 @@
<text class="grid-text">{{listItem.title}}</text> <text class="grid-text">{{listItem.title}}</text>
</u-grid-item> </u-grid-item>
</u-grid> </u-grid>
</view> </view> -->
</view> </view>
</view> </view>
</template> </template>
@@ -51,10 +51,10 @@
data() { data() {
return { return {
list: [ list: [
{ // {
title: '备货单审批', // title: '备货单审批',
url:'' // url:''
}, // },
{ {
title: '借用审批', title: '借用审批',
url:'/pages/approval/borrow_approval' url:'/pages/approval/borrow_approval'
+6 -6
View File
@@ -67,12 +67,12 @@
async silentAuth() { async silentAuth() {
try { try {
// 1) 如果本地已有 token,直接进首页(丝滑) // 1) 如果本地已有 token,直接进首页(丝滑)
const token = uni.getStorageSync('token') // const token = uni.getStorageSync('token')
if (token) { // if (token) {
this.title = '已登录' // this.title = '已登录'
this.desc = '正在进入首页' // this.desc = '正在进入首页'
return this.goHomeSmooth() // return this.goHomeSmooth()
} // }
// 2) 获取飞书授权跳转地址(静默授权/免登) // 2) 获取飞书授权跳转地址(静默授权/免登)
this.title = '正在跳转飞书授权' this.title = '正在跳转飞书授权'