物资管理

This commit is contained in:
huangchenhao 2025-10-16 16:44:08 +08:00
parent b6051ba485
commit 8c51565237
4 changed files with 158 additions and 3 deletions

View File

@ -15,6 +15,11 @@ const routes = [
path: '/equipManage',
name: 'EquipManage',
component: () => import('../views/EquipmentManagement.vue')
},
{
path: '/materialManage',
name: 'MaterialManage',
component: () => import('../views/MaterialManagement.vue')
}
]

View File

@ -4,7 +4,7 @@
</van-nav-bar>
<van-search
shape="round"
v-model="value"
:value="searchValue"
:show-action="false"
placeholder="请输入设备名称"
/>
@ -44,6 +44,20 @@
>
添加设备
</van-button>
<!-- 弹出层 -->
<van-popup
:show="showPopup"
position="bottom"
closeable
close-on-click-overlay
:style="{ height: '80%' }"
@close="onPopupClose"
>
<div class="popup-content">
<h3>添加新设备</h3>
</div>
</van-popup>
</div>
</template>
@ -53,11 +67,20 @@ import { useRouter } from "vue-router";
import { showToast } from "vant";
const router = useRouter();
const active = ref(0);
const searchValue = ref(""); //
const showPopup = ref(false); //
const onClickLeft = () => {
router.push("/");
};
const handleAddDevice = () => {
showPopup.value = true;
};
const onPopupClose = () => {
showPopup.value = false;
};
</script>
<style scoped>

View File

@ -12,7 +12,7 @@
<van-grid-item
icon="setting-o"
text="物资管理"
@click="showToast('物资管理')"
to="/MaterialManage"
/>
<van-grid-item
icon="setting-o"

View File

@ -0,0 +1,127 @@
<template>
<div class="home">
<van-nav-bar title="物资管理" fixed left-arrow @click-left="onClickLeft">
</van-nav-bar>
<van-search
shape="round"
:value="searchValue"
:show-action="false"
placeholder="请输入物资名称"
/>
<van-cell-group>
<van-cell title="当前站点" value="李家坝仓库" />
</van-cell-group>
<div class="content">
<van-cell-group>
<van-cell
title="融雪剂"
is-link
label="余量:2吨"
>
</van-cell>
<van-cell title="警示标志杆(柱、牌)" is-link label="余量:131个">
</van-cell>
</van-cell-group>
</div>
<van-button
type="primary"
class="add-btn"
icon="plus"
@click="handleAdd"
>
添加物资
</van-button>
<!-- 弹出层 -->
<van-popup
:show="showPopup"
position="bottom"
closeable
close-on-click-overlay
:style="{ height: '80%' }"
@close="onPopupClose"
>
<div class="popup-content">
<h3>添加新物资</h3>
</div>
</van-popup>
</div>
</template>
<script setup>
import { ref } from "vue";
import { useRouter } from "vue-router";
import { showToast } from "vant";
const router = useRouter();
const searchValue = ref(""); //
const showPopup = ref(false); //
const onClickLeft = () => {
router.push("/");
};
const handleAdd = () => {
showPopup.value = true;
};
const onPopupClose = () => {
showPopup.value = false;
};
</script>
<style scoped>
.home {
padding-top: var(--van-nav-bar-height); /* 自动匹配导航栏高度 */
}
.content {
padding: 16px;
}
.content .van-cell-group .van-cell {
margin-bottom: 10px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
.add-btn {
position: fixed;
bottom: 20px;
left: 16px;
right: 16px;
width: calc(100% - 32px);
margin: 0 auto;
border-radius: 24px;
font-size: 16px;
height: 44px;
z-index: 999;
}
.grid {
margin-top: 16px;
}
.btn {
margin-top: 24px;
}
.status-tag {
display: inline-block;
padding: 3px 8px;
border-radius: 4px;
color: white;
font-size: 12px;
}
.status-good {
background-color: #07c160;
}
.status-warning {
background-color: #ff976a;
}
.status-danger {
background-color: #ee0a24;
}
</style>