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",
"description" : "应用描述",
"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"/>
</view>
<view class="card-info">
<text class="info-item">申请人: {{ item.apply_user_name }}</text>
<text class="info-item">归还时间: {{ item.return_at || '-' }}</text>
<text class="info-item">申请人: {{ item.applicant_name }}</text>
<text class="info-item">归还时间: {{ formatDate(item.return_at) }}</text>
</view>
<view class="action-btns">
@@ -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
+332 -291
View File
@@ -1,308 +1,349 @@
<template>
<view class="page">
<uni-nav-bar
leftText=" "
:fixed="true"
leftIcon="back"
background-color="rgb(48, 116, 247)"
color="#fff"
:statusBar="true"
title="归还详情"
@clickLeft="onBack"
/>
<view class="page">
<uni-nav-bar
:fixed="true"
leftIcon="back"
backgroundColor="rgb(48, 116, 247)"
color="#fff"
:statusBar="true"
title="归还详情"
@clickLeft="onBack"
/>
<view class="content">
<!-- 基本信息 -->
<view class="card">
<view class="card-head">
<text class="card-title">归还信息</text>
<view class="status-tag" :class="'s' + (detail.status || 0)">
<text class="status-text">{{ statusText }}</text>
</view>
</view>
<view class="content">
<!-- 基本信息 -->
<view class="card">
<view class="card-head">
<text class="card-title">归还信息</text>
<view class="status-tag" :class="'s' + (detail.status || 0)">
<text class="status-text">{{ statusText }}</text>
</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.return_at || '-' }}</text></view>
<view class="row" v-if="detail.apply_remark !== undefined">
<text class="label">归还备注</text>
<text class="value">{{ detail.apply_remark || '-' }}</text>
</view>
</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.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-head">
<text class="card-title">归还物品</text>
</view>
<!-- 归还物品明细 -->
<view class="card">
<view class="card-head">
<text class="card-title">归还物品明细</text>
</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 class="item-left">
<text class="item-name">{{ it.item_name || '-' }}</text>
<text class="item-meta" v-if="it.spec_model">规格:{{ it.spec_model }}</text>
</view>
<view class="item-right">
<text class="qty-label">归还数量</text>
<text class="qty-val">{{ detail.return_qty || 0 }}</text>
</view>
</view>
</view>
<view v-for="(it, idx) in detail.item_return" :key="it.id" class="item">
<view class="item-left">
<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.requisition_item && it.requisition_item.spec_model_snap">规格:{{ it.requisition_item.spec_model_snap }}</text>
<text class="item-meta" v-if="it.requisition_item && String(it.requisition_item.is_consumable_snap) === '1'">耗材</text>
</view>
<view class="item-right">
<view class="qty-info">
<view class="qty-row">
<text class="qty-label">借用数量</text>
<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-head">
<text class="card-title">借用信息</text>
</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="row"><text class="label">申请人</text><text class="value">{{ borrowDetail.applicant_name || '-' }}</text></view>
<view class="row"><text class="label">借用时间</text><text class="value">{{ borrowDetail.use_start_date || '-' }} ~ {{ borrowDetail.use_end_date || '-' }}</text></view>
<view class="row" v-if="borrowDetail.borrow_reason !== undefined">
<text class="label">借用事由</text>
<text class="value">{{ borrowDetail.borrow_reason || '-' }}</text>
</view>
</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>
<text class="attachment-size" v-if="attach.file_size">大小:{{ formatFileSize(attach.file_size) }}</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 class="card" v-if="borrowDetail.id">
<view class="card-head">
<text class="card-title">借用物品明细</text>
</view>
<view v-if="!borrowDetail.item || borrowDetail.item.length === 0" class="empty">暂无物品</view>
<view v-for="(it, idx) in borrowDetail.item" :key="it.id || idx" class="item">
<view class="item-left">
<text class="item-name">{{ it.item_name_snap || '-' }}</text>
<text class="item-meta" v-if="String(it.is_consumable_snap) === '1'">耗材</text>
</view>
<view class="item-right">
<view class="grid-cell">
<text class="g-label">数量</text>
<text class="g-val">{{ safeNum(it.request_qty) }}</text>
</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>
<!-- 审核信息 -->
<view class="card" v-if="detail.handler_name || detail.audit_info">
<view class="card-head">
<text class="card-title">审核信息</text>
</view>
<view class="row">
<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>
<view class="row">
<text class="label">审核时间</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 class="row" v-if="detail.handle_remark || (detail.audit_info && detail.audit_info.handle_remark)">
<text class="label">审核意见</text>
<text class="value">{{ detail.handle_remark || (detail.audit_info && detail.audit_info.handle_remark ? detail.audit_info.handle_remark : '-') }}</text>
</view>
</view>
</view>
</view>
</template>
<script>
import { request, showToast } from '@/api/apiT.js'
import { request, showToast } from '@/api/apiT.js'
export default {
data() {
return {
id: '',
detail: {},
borrowDetail: {} // 借用详情数据
}
},
computed: {
statusText() {
const s = Number(this.detail.status || 0)
if (s === 0) return '待审核'
if (s === 1) return '已通过'
if (s === 2) return '已驳回'
return '处理中'
}
},
onLoad(option) {
this.id = option.id || ''
if (!this.id) {
showToast({ title: '缺少id参数' })
return
}
this.getDetail()
},
methods: {
onBack() {
uni.navigateBack()
},
getDetail() {
request({
url: 'mobile/inv/requisition/return/show',
method: 'GET',
data: { id: this.id }
}).then((res) => {
if (res.data && res.data.code === 200) {
this.detail = res.data.data || {}
// 兜底,避免 v-for 报错
this.detail.item = Array.isArray(this.detail.item) ? this.detail.item : []
// 如果有借用详情的id,则获取借用详情数据
const borrowId = this.detail.requisition_item_id || this.detail.item_id
if (borrowId) {
this.getBorrowDetail(borrowId)
}
} else {
showToast({ title: res.data.message || '获取详情失败' })
}
})
},
// 获取借用详情数据
getBorrowDetail(borrowId) {
request({
url: 'mobile/inv/requisition/show',
method: 'GET',
data: { id: borrowId }
}).then((res) => {
if (res.data && res.data.code === 200) {
this.borrowDetail = res.data.data || {}
// 兜底,避免 v-for 报错
this.borrowDetail.item = Array.isArray(this.borrowDetail.item) ? this.borrowDetail.item : []
} else {
showToast({ title: res.data.message || '获取借用详情失败' })
}
})
},
// 安全处理数字显示
safeNum(v) {
const n = Number(v)
return Number.isFinite(n) ? n : 0
}
}
}
export default {
data() {
return {
id: '',
detail: {}
}
},
computed: {
statusText() {
const s = Number(this.detail.status || 0)
if (s === 0) return '待审核'
if (s === 1) return '已通过'
if (s === 2) return '已驳回'
return '处理中'
}
},
onLoad(option) {
this.id = option.id || ''
if (!this.id) {
showToast({ title: '缺少id参数' })
return
}
this.getDetail()
},
methods: {
onBack() {
uni.navigateBack()
},
getDetail() {
request({
url: 'mobile/inv/requisition/return/show',
method: 'GET',
data: { id: this.id }
}).then((res) => {
if (res.data && res.data.code === 200) {
this.detail = res.data.data || {}
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 || '获取详情失败' })
}
})
},
safeNum(v) {
const n = Number(v)
return Number.isFinite(n) ? n : 0
},
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]
},
formatDateTime(dateStr) {
if (!dateStr) return '-'
if (typeof dateStr === 'string' && dateStr.includes('T')) {
return dateStr.replace('T', ' ').replace('Z', '')
}
return dateStr
},
formatFileSize(size) {
if (!size) return '-'
if (size < 1024) {
return size + ' B'
} 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>
<style lang="scss">
.page {
min-height: 100vh;
background: rgb(244, 246, 248);
}
.content {
padding: 20rpx;
}
.card {
background: #fff;
border-radius: 20rpx;
padding: 22rpx;
margin-bottom: 18rpx;
box-shadow: 0 6rpx 18rpx rgba(0, 0, 0, 0.04);
}
.card-head {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 16rpx;
}
.card-title {
font-size: 30rpx;
font-weight: 700;
color: #1f2d3d;
}
.row {
display: flex;
align-items: flex-start;
justify-content: space-between;
padding: 10rpx 0;
border-bottom: 1rpx solid #f1f3f5;
}
.row:last-child {
border-bottom: none;
}
.label {
width: 160rpx;
font-size: 26rpx;
color: #667085;
}
.value {
flex: 1;
text-align: right;
font-size: 26rpx;
color: #101828;
}
.status-tag {
padding: 6rpx 14rpx;
border-radius: 999rpx;
background: rgba(48, 116, 247, 0.12);
}
.status-text {
font-size: 24rpx;
color: rgb(48, 116, 247);
}
.empty {
padding: 24rpx 0;
text-align: center;
color: #98a2b3;
font-size: 26rpx;
}
.item {
padding: 16rpx 0;
border-top: 1rpx dashed #eef2f6;
display: flex;
align-items: center;
justify-content: space-between;
gap: 16rpx;
}
.item-left {
flex: 1;
min-width: 0;
display: flex;
flex-direction: column;
gap: 6rpx;
}
.item-right {
display: flex;
align-items: baseline;
gap: 10rpx;
flex-shrink: 0;
}
.qty-label {
font-size: 22rpx;
color: #667085;
}
.qty-val {
font-size: 30rpx;
font-weight: 700;
color: #101828;
}
.item:first-child {
border-top: none;
padding-top: 0;
}
.item-name {
font-size: 28rpx;
font-weight: 700;
color: #101828;
}
.item-meta {
font-size: 24rpx;
color: #98a2b3;
}
/* 借用物品明细样式 */
.grid-cell {
// background: #fafbff;
border-radius: 10rpx;
padding: 14rpx 10rpx;
text-align: center;
// border: 1rpx solid #f0f0f0;
margin-left: 10rpx;
}
.g-label {
display: block;
font-size: 22rpx;
color: #888;
margin-bottom: 6rpx;
}
.g-val {
display: block;
font-size: 30rpx;
font-weight: 700;
color: #222;
}
.page {
min-height: 100vh;
background: rgb(244, 246, 248);
}
.content {
padding: 20rpx;
}
.card {
background: #fff;
border-radius: 20rpx;
padding: 22rpx;
margin-bottom: 18rpx;
box-shadow: 0 6rpx 18rpx rgba(0, 0, 0, 0.04);
}
.card-head {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 16rpx;
}
.card-title {
font-size: 30rpx;
font-weight: 700;
color: #1f2d3d;
}
.row {
display: flex;
align-items: flex-start;
justify-content: space-between;
padding: 10rpx 0;
border-bottom: 1rpx solid #f1f3f5;
}
.row:last-child {
border-bottom: none;
}
.label {
width: 160rpx;
font-size: 26rpx;
color: #667085;
}
.value {
flex: 1;
text-align: right;
font-size: 26rpx;
color: #101828;
}
.status-tag {
padding: 6rpx 14rpx;
border-radius: 999rpx;
background: rgba(48, 116, 247, 0.12);
}
.status-text {
font-size: 24rpx;
color: rgb(48, 116, 247);
}
.empty {
padding: 24rpx 0;
text-align: center;
color: #98a2b3;
font-size: 26rpx;
}
.item {
padding: 16rpx 0;
border-top: 1rpx dashed #eef2f6;
display: flex;
align-items: center;
justify-content: space-between;
gap: 16rpx;
}
.item-left {
flex: 1;
min-width: 0;
display: flex;
flex-direction: column;
gap: 6rpx;
}
.item-right {
display: flex;
align-items: baseline;
gap: 10rpx;
flex-shrink: 0;
}
.qty-info {
display: flex;
flex-direction: column;
gap: 8rpx;
}
.qty-row {
display: flex;
align-items: center;
gap: 8rpx;
}
.qty-label {
font-size: 22rpx;
color: #667085;
}
.qty-val {
font-size: 30rpx;
font-weight: 700;
color: #101828;
}
.item:first-child {
border-top: none;
padding-top: 0;
}
.item-name {
font-size: 28rpx;
font-weight: 700;
color: #101828;
}
.item-meta {
font-size: 24rpx;
color: #98a2b3;
}
.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-size {
font-size: 22rpx;
color: #98a2b3;
}
.attachment-img {
width: 120rpx;
height: 120rpx;
border-radius: 12rpx;
flex-shrink: 0;
}
</style>
+104 -26
View File
@@ -21,9 +21,10 @@
</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.return_at || '-' }}</text></view>
<view class="row" v-if="detail.apply_remark !== undefined">
<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.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>
@@ -35,16 +36,40 @@
<text class="card-title">归还物品</text>
</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">
<text class="item-name">{{ it.item_name }}</text>
<text class="item-meta" v-if="it.spec_model">规格:{{ it.spec_model }}</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.requisition_item && it.requisition_item.spec_model_snap">规格:{{ it.requisition_item.spec_model_snap }}</text>
</view>
<view class="item-right">
<text class="qty-label">归还数量</text>
<text class="qty-val">{{ detail.return_qty || 0 }}</text>
<view class="qty-info">
<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>
@@ -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;
}
</style>
+16 -8
View File
@@ -46,14 +46,15 @@
<text class="form-label required">计划归还时间</text>
<view class="form-input-container">
<uni-datetime-picker
ref="returnTimePicker"
type="date"
v-model="formData.use_end_date"
placeholder="请选择时间"
:border="false"
:clear-icon="false"
@change="onReturnTimeChange"
>
ref="returnTimePicker"
type="date"
v-model="formData.use_end_date"
placeholder="请选择时间"
:border="false"
:clear-icon="false"
:start="formData.use_start_date"
@change="onReturnTimeChange"
>
<view class="custom-datetime-input">
<text class="custom-datetime-text" :class="{ 'placeholder': !formData.use_end_date }">
{{ 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(){
+1 -1
View File
@@ -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',
+7 -7
View File
@@ -1,6 +1,6 @@
<template>
<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 class="cards">
<view class="title">审批管理</view>
@@ -28,7 +28,7 @@
</u-grid-item>
</u-grid>
</view>
<view class="cards">
<!-- <view class="cards">
<view class="title">备货单</view>
<u-grid :border="false" col="5" >
<u-grid-item
@@ -40,7 +40,7 @@
<text class="grid-text">{{listItem.title}}</text>
</u-grid-item>
</u-grid>
</view>
</view> -->
</view>
</view>
</template>
@@ -51,10 +51,10 @@
data() {
return {
list: [
{
title: '备货单审批',
url:''
},
// {
// title: '备货单审批',
// url:''
// },
{
title: '借用审批',
url:'/pages/approval/borrow_approval'
+6 -6
View File
@@ -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 = '正在跳转飞书授权'