<template>
	<view class="ConsumablesTop">
		<view>
			货品类别
		</view>
		<view>
			搜索货品ID/货品编码
		</view>
		<view>
			新增类别
		</view>
	</view>
	<ul class="ConsumablesConent">
		<li>
			<view>
				吸管 <view> 分类 </view>
			</view>
			<view>
				<view>
					<view style="color: #333333;">
						根
					</view>
					<view>
						耗材单位
					</view>
				</view>
				<view>
					<view style="color: #318AFE;">
						根
					</view>
					<view>
						耗材单位
					</view>
				</view>
			</view>
			<view>
				<view class="">
					已绑定商品(10)
				</view>
				<view class="">
					<up-button type="primary" color="#999" :plain="true" text="查看记录"></up-button>
					<up-button type="primary" @click="toggle" :plain="true" text="更多操作"></up-button>
				</view>
			</view>
		</li>
	</ul>
	<view class="ConsumablesBottom">
		<view class="">
			新增耗材
		</view>
		<view class="">
			供应商管理
		</view>
	</view>
	<my-action-sheet @itemClick="sheetClick" ref="refMoreSheet" :list="actionSheet.list"></my-action-sheet>
</template>

<script setup>
	import myActionSheet from '@/components/my-components/my-action-sheet';
	import {
		ref,
		reactive
	} from 'vue';
	import go from '@/commons/utils/go.js';
	let refMoreSheet = ref(null)
	const actionSheet = reactive({
		list: ['报损', '编辑', '清点', '入库', '出库']
	})
	let toggle = () => {
		refMoreSheet.value.open()
	}
	let sheetClick = (index) => {
		console.log(index)
		if (index == 0) {} else if (index == 1) {

		} else if (index == 2) {
			toUrl('PAGES_SALES_INVENTORYCHECK')
		} else if (index == 3) {
			toUrl('PAGES_SALES_WAREHOUSEENTRY')
		} else if (index == 4) {
			toUrl('PAGES_SALES_OUTBOUND')
		}
	}

	let toUrl = (url) => {
		go.to(url)
	}
</script>

<style scoped lang="less">
	page{
		background-color: #f9f9f9;
	}
	ul,
	li {
		list-style: none;
		padding: 0;
	}

	.ConsumablesTop {
		display: flex;
		justify-content: space-around;
		align-items: center;
		padding-bottom: 22rpx;

		>view:first-child,
		>view:last-child {
			font-size: 24rpx;
			font-family: Source Han Sans CN, Source Han Sans CN;
			font-weight: 500;
			color: #333333;
		}

		>view:last-child {
			color: #318AFE;
		}

		>view:nth-child(2) {
			width: 414rpx;
			height: 60rpx;
			line-height: 60rpx;
			background: #F9F9F9;
			border-radius: 32rpx 32rpx 32rpx 32rpx;

			font-family: Source Han Sans CN, Source Han Sans CN;
			font-weight: 400;
			font-size: 28rpx;
			color: #999999;

		}
	}

	.ConsumablesConent {
		min-height: 80vh;
		background-color: #f9f9f9;
		padding-top: 1rpx;

		>li {
			width: 694rpx;
			height: 332rpx;
			background: #FFFFFF;
			border-radius: 10rpx 10rpx 10rpx 10rpx;
			padding: 32rpx 16rpx;
			box-sizing: border-box;
			margin: 32rpx auto;
			display: flex;
			flex-direction: column;
			justify-content: space-between;

			>view:first-child {
				font-family: Source Han Sans CN, Source Han Sans CN;
				font-weight: 500;
				font-size: 24rpx;
				color: #333333;
				.df;

				>view {
					width: 90rpx;
					height: 36rpx;
					line-height: 36rpx;
					background: #EBF4FC;
					border-radius: 4rpx 4rpx 4rpx 4rpx;
					text-align: center;
					font-family: Source Han Sans CN, Source Han Sans CN;
					font-weight: 400;
					font-size: 24rpx;
					color: #318AFE;
					margin-left: 12rpx;
				}
			}

			>view:nth-child(2) {
				width: 662rpx;
				height: 128rpx;
				background: #F9F9F9;
				border-radius: 12rpx 12rpx 12rpx 12rpx;
				.df;
				justify-content: space-around;
				text-align: center;

				font-family: Source Han Sans CN, Source Han Sans CN;
				font-weight: 400;
				font-size: 24rpx;
				color: #666666;
			}

			>view:last-child {
				.df;
				justify-content: space-between;

				>view:last-child {
					.df;

					>button {
						width: 128rpx;
						height: 48rpx;
						background: #FFFFFF;
						border-radius: 28rpx 28rpx 28rpx 28rpx;
					}

					>button:last-child {
						margin-left: 24rpx;
					}
				}
			}
		}
	}

	.ConsumablesBottom {
		.df;
		position: fixed;
		bottom: 20rpx;
		left: 50%;
		transform: translateX(-50%);

		>view {
			width: 346rpx;
			height: 80rpx;
			line-height: 80rpx;
			text-align: center;
			border: 2rpx solid #318AFE;

			font-family: Source Han Sans CN, Source Han Sans CN;
			font-weight: 500;
			font-size: 32rpx;
		}

		>view:first-child {
			border-radius: 56rpx 0rpx 0rpx 56rpx;
			color: #318AFE;
		}

		>view:last-child {
			border-radius: 0 56rpx 56rpx 0;
			background-color: #318AFE;
			color: #fff;
		}
	}

	.popup-content {
		padding: 15px;
		background-color: #fff;
		margin: 0 auto;

		>view {
			height: 88rpx;
			line-height: 88rpx;
			width: 660rpx;
			border-top: 10rpx solid #f9f9f9;
			text-align: center;
		}

		.operate {
			>li {
				height: 88rpx;
				line-height: 88rpx;
				text-align: center;
				width: 660rpx;
				border-bottom: 2rpx solid #E5E5E5;

			}
		}
	}

	.df() {
		display: flex;
		align-items: center;
	}
</style>