<!-- 底部导航栏：仓库 -->
<template>
	<navigation title="仓储" :showBack="false"></navigation>

	<view class="contentBox">
		<uni-card v-for="(item, index) in menuList" :key="item.id" :title="item.title" :isFull="true"
			class="custom-card">
			<view v-for="value in item.menuItem" :key="value.id" class="card_items" @tap="value.click">
				<uv-image :src="value.icon" width="40rpx" height="40rpx" style="margin-top:10rpx" />
				<p> {{ value.title }} </p>
			</view>
		</uni-card>
	</view>
</template>

<script setup>
import { onShow } from '@dcloudio/uni-app';
import { objectToQuery, removeStorage } from '../until';
import Navigation from '../components/Navigation.vue';

const menuList = [
	{
		id: 'inventory',
		title: '库存信息',
		menuItem: [
			{
				id: "inventory_uniqueCodeInventory",
				icon: '../../static/warehousing/uniqueCodeInventory.png',
				title: '唯一码盘点',
				click: () => {
					console.log('唯一码盘点')
					// pages/weif/index
					uni.navigateTo({
						url: '/pages/weif/index'
					});
				}
			},
			{
				id: "inventory_ inventoryAgeQuery",
				icon: '../../static/warehousing/inventoryAgeQuery.png',
				title: '库龄查看',
				click: () => {
					console.log('库龄查看')
					removeStorage()
					uni.navigateTo({
						url: '/pages/warehousing/InventoryInfo/inventoryAgeView'
					});

				}
			},
			{
				id: "inventory_inventoryWarning",
				icon: '../../static/warehousing/inventoryWarning.png',
				title: '库存预警',
				click: () => {
					console.log('库存预警')

				}
			},
		]
	},
	{
		id: 'report',
		title: '报表',
		menuItem: [
			{
				id: "report_inventoryDailyReport",
				icon: '../../static/report/inventoryDailyReport.png',
				title: '库存日报',
				click: () => {
					console.log('库存日报')
					removeStorage()
					uni.navigateTo({
						url: '/pages/warehousing/report/daily'
					});
				}
			},
			{
				id: "report_ inventoryMonthlyReport",
				icon: '../../static/report/inventoryMonthlyReport.png',
				title: '库存月报',

				click: () => {
					console.log('库存月报')
					removeStorage()
					uni.navigateTo({
						url: '/pages/warehousing/Report/monthly'
					});
				}
			},
			{
				id: "report_companyInventoryReport",
				icon: '../../static/report/companyInventoryReport.png',
				title: '公司库存报表',
				click: () => {
					console.log('公司库存报表')
					removeStorage()
					uni.navigateTo({
						url: '/pages/warehousing/Report/company'
					});
				}
			},
			{
				id: "report_ warehouseInventoryReport",
				icon: '../../static/report/warehouseInventoryReport.png',
				title: '仓库库存报表',

				click: () => {
					console.log('仓库库存报表')
					removeStorage()
					uni.navigateTo({
						url: '/pages/warehousing/Report/warehouse'
					});
				}
			},
		]
	},
	{
		id: 'declarationForm',
		title: '申报单',
		menuItem: [
			{
				id: "declarationForm_materialsQuery",
				icon: '../../static/declarationForm/materialsQuery.png',
				title: '物资查询',
				click: () => {
					console.log('物资查询')
					removeStorage()
					uni.navigateTo({
						url: '/pages/warehousing/Declaration/materialQuery'
					});

				}
			},
			{
				id: "declarationForm_createDeclarationForm",
				icon: '../../static/declarationForm/createDeclarationForm.png',
				title: '申报单开单',
				click: () => {
					console.log('申报单开单')
					removeStorage()
					uni.navigateTo({
						url: '/pages/warehousing/Declaration/create?type=declaration'
					});

				}
			},
			{
				id: "declarationForm_myDeclarationForms",
				icon: '../../static/declarationForm/myDeclarationForms.png',
				title: '我的申报单',
				click: () => {
					console.log('我的申报单')
					removeStorage()
					uni.navigateTo({
						url: '/pages/warehousing/Declaration/my?type=my'
					});


				}
			},
		]
	},
	{
		id: 'warehousingReceipt',
		title: '入库单',
		menuItem: [
			{
				id: "warehousingReceipt_stockInCreateOrder",
				icon: '../../static/stockInOrOut/stockInCreateOrder.png',
				title: '入库单开单',
				click: () => {
					removeStorage()
					console.log('入库单开单')
					uni.navigateTo({
						url: '/pages/warehousing/stockIn/create'
					});
				}
			},
			{
				id: "warehousingReceipt_myWarehousingReceipt",
				icon: '../../static/stockInOrOut/myWarehousingReceipt.png',
				title: '我的入库单',
				click: () => {
					console.log('我的入库单')
					removeStorage()
					uni.navigateTo({
						url: '/pages/warehousing/stockIn/my'
					});
				}
			},
			{
				id: "warehousingReceipt_stockIn",
				icon: '../../static/stockInOrOut/stockIn.png',
				title: '入库单入库',
				click: () => {
					console.log('入库单入库')
					uni.navigateTo({
						url: '/pages/warehousing/stockIn/putAway'
					});

				}
			},
		]
	},
	{
		id: 'outboundOrder',
		title: '出库单',
		menuItem: [
			{
				id: "outboundOrder_stockOutCreateOrder",
				icon: '../../static/stockInOrOut/stockOutCreateOrder.png',
				title: '出库单开单',
				click: () => {
					console.log('出库单开单')
					removeStorage()
					uni.navigateTo({
						url: '/pages/warehousing/stockOut/create'
					});
				}
			},
			{
				id: "outboundOrder_myOutboundOrder",
				icon: '../../static/stockInOrOut/myOutboundOrder.png',
				title: '我的出库单',
				click: () => {
					console.log('我的出库单')
					removeStorage()
					uni.navigateTo({
						url: '/pages/warehousing/stockOut/my'
					});
				}
			},
			{
				id: "outboundOrder_stockOut",
				icon: '../../static/stockInOrOut/stockOut.png',
				title: '出库单出库',
				click: () => {
					console.log('出库单出库')
					removeStorage()
					uni.navigateTo({
						url: '/pages/warehousing/stockOut/outbound'
					});

				}
			},
		]
	},
	{
		id: 'uniqueCode',
		title: '唯一码',
		menuItem: [
			{
				id: "uniqueCode_issueUniqueCode",
				icon: '../../static/uniqueCode/issueUniqueCode.png',
				title: '唯一码发放',
				click: () => {
					console.log('唯一码发放')
					removeStorage()
					uni.navigateTo({
						url: '/pages/warehousing/uniqueCode/issueUniqueCode/index'
					});
				}
			},
			{
				id: "uniqueCode_myUniqueCode",
				icon: '../../static/uniqueCode/myUniqueCode.png',
				title: '唯一码',
				click: () => {
					console.log('唯一码')
					uni.navigateTo({
						url: '/pages/warehousing/uniqueCode/myUniqueCode/index'
					});
				}
			},
			{
				id: "uniqueCode_bindRFID",
				icon: '../../static/uniqueCode/bindRFID.png',
				title: '绑定RFID',
				click: () => {
					console.log('绑定RFID')

				}
			},
		]
	},
	{
		id: 'recycling',
		title: '模式评估处置',
		menuItem: [
			{
				id: "recycling_integratedModeAssessment",
				icon: '../../static/recycling/integratedModeAssessment.png',
				title: '综合模式评估',
				click: () => {
					console.log('综合模式评估')
					removeStorage()
					uni.navigateTo({
						url: `/pages/recycling/integratedModeAssessment/valueEvaluation`
					});
				}
			},
			{
				id: "recycling_leadBatteryCascadeUse",
				icon: '../../static/recycling/leadBatteryCascadeUse.png',
				title: '智能处置',
				click: () => {
					console.log('智能处置')
					removeStorage()
					uni.navigateTo({
						url: `/pages/recycling/leadBatteryCascadeUse/conditionAssessment`
					});
				}
			},
		]
	},
	{
		id: 'carbonFootprint',
		title: '碳足迹',
		menuItem: [
			{
				id: "recycling_wasteCloudControlSystem",
				icon: '../../static/recycling/wasteCloudControlSystem.png',
				title: '废物云控体系',
				click: () => {
					console.log('废物云控体系')
					removeStorage()
					uni.navigateTo({
						url: `/pages/recycling/carbonFootprint/wasteCloudControl`
					});
				}
			},
			{
				id: "recycling_carbonFootprint",
				icon: '../../static/recycling/carbonFootprint.png',
				title: '碳足迹',
				click: () => {
					console.log('碳足迹')
					removeStorage()
					uni.navigateTo({
						url: `/pages/recycling/carbonFootprint/wasteCarbonFootprint`
					});
				}
			},
		]
	},
	{
		id: 'leadBatterySmartRepair',
		title: '铅蓄智修样机',
		menuItem: [
			{
				id: "recycling_leadBatterySmartRepair",
				icon: '../../static/recycling/leadBatterySmartRepair.png',
				title: '铅蓄智修样机',
				click: () => {
					console.log('铅蓄智修样机')
					removeStorage()
					uni.navigateTo({
						url: `/pages/recycling/leadBatterySmartRepair/index`
					});
				}
			},
		]
	},
	{
		id: 'transportCheckIn',
		title: '运输打卡',
		menuItem: [
			{
				id: "transportCheckIn_transportCheckIn",
				icon: '../../static/transportCheckIn/transportCheckIn.png',
				title: '运输打卡',
				click: () => {
					console.log('运输打卡')
					const query = objectToQuery({ type: 'transport' })
					removeStorage()
					uni.navigateTo({
						url: `/pages/warehousing/Transport/checkIn${query}`
					});
				}
			},
			{
				id: "transportCheckIn_myTransportCheckIn",
				icon: '../../static/transportCheckIn/myTransportCheckIn.png',
				title: '我的运输打卡',
				click: () => {
					console.log('我的运输打卡')
					removeStorage()
					const query = objectToQuery({ type: 'my' })
					uni.navigateTo({
						url: `/pages/warehousing/Transport/my${query}`
					});
				}
			},
		]
	},
]
onShow(() => {
	uni.removeStorage({
		key: 'app_material',
		success: (result) => { },
		fail: (error) => { }
	})
})
</script>

<style scoped lang="scss">
::v-deep .custom-card.uni-card {
	margin-bottom: 6rpx !important;
	border-color: #F8F8FF !important;
	box-shadow: none !important;

	.uni-card__header {
		padding: 10rpx;

		.uni-card__header-box {
			.uni-card__header-content-title {
				font-weight: 800;
				font-size: 14px;

			}
		}
	}

	.uni-card__content {
		display: flex;
		align-items: center;
		justify-content: flex-start;
	}

	.card_items {
		width: 25%;
		display: flex;
		flex-direction: column;
		align-items: center;

		p {
			margin-top: 10rpx;
			font-size: 12px;
			color: #1b1b1b;
			;
		}
	}
}
</style>
