<template>
	<!-- 位置信息管理 -->
	<div class="pricemoitorrecord">
		<a-card :bordered="false">
			<a-space class="search">
				<div class="silt-title">
					<span style="width: 70px; margin-right: 8px; text-align: right; display: block; line-height: 30px">{{
						'库区名称'
					}}</span>
					<a-input style="width: 220px" v-model:value="SearchFormDel.orgName" placeholder="请输入" />
				</div>
				<div class="silt-title">
					<span style="width: 70px; margin-right: 8px; text-align: right; display: block; line-height: 30px">{{
						'所属地区'
					}}</span>
					<a-select style="width: 220px" v-model:value="SearchFormDel.city">
						<a-select-option v-for="item in optionsGender" :key="item.id" :value="item.id">{{
							item.dictLabel
						}}</a-select-option>
					</a-select>
				</div>
				<div class="silt-title">
					<span style="width: 70px; margin-right: 8px; text-align: right; display: block; line-height: 30px">{{
						'企业储量'
					}}</span>
					<a-input style="width: 220px" v-model:value="SearchFormDel.designCapacity" placeholder="请输入" />
				</div>
				<div class="btnBox">
					<a-button type="primary" class="primarySele" @click="Search"> 查询 </a-button>
					<a-button class="snowy-buttom-left primarySele" @click="onReset"> 重置 </a-button>
				</div>
			</a-space>
		</a-card>

		<div class="list" style="margin-top: 10px">
			<a-table :dataSource="tableData" :pagination="pagination" :columns="tableColumns">
				<template #bodyCell="{ column, record }">
					<template v-if="column.key === '操作'">
						<a-button type="link" @click="onView('view', record)">查看</a-button>
					</template>
				</template>
			</a-table>
		</div>
	</div>
</template>
<script setup>
	import business from '@/api/security/index'
	import { listPagination } from '@/hook/listlistPagination.js'

	import { reactive, ref, onMounted } from 'vue'
	import { useRouter } from 'vue-router'
	import { defineComponent } from 'vue'
	const formRef = ref(null)
	const router = useRouter()
	const tableColumns = [
		{
			title: '序号',
			dataIndex: 'Index',
			align: 'center',
			width: '5%',
			customRender: ({ text, record, index }) => {
				return `${index + 1}`
			}
		},
		{ title: '库区名称', align: 'center', dataIndex: 'orgName' },
		{ title: '库存数量', align: 'center', dataIndex: 'kcsl' },
		{ title: '库存质量合格数量', align: 'center', dataIndex: 'hgsl' },
		{ title: '库存质量不合格数量', align: 'center', dataIndex: 'bhgsl' },
		{ title: '库区地址', align: 'center', dataIndex: 'address' },
		{ title: '操作', width: '20%', align: 'center', key: '操作' }
	]

	const { DEl, change, tableData, onSearch, handlePageChange, pagination, Search, onReset, SearchFormDel } =
		listPagination({ orgName: '', city: '', designCapacity: '' }, business.TJFXpage, {}, { sortOrder: 'ASCEND' })

	// 查看表单数据
	const onView = (record, row) => {
		switch (record) {
			case 'add':
				router.push('/business/planningDel')
				break
			case 'del':
				DEl(row)
				break
			case 'view':
				router.push(`/security/UnifiedDel?orgId=${row.orgId}&codeAkk=${true}`)
				break
			case 'edit':
				break
			case 'application':
				application(row)
				break
			default:
				// router.push('/business/personnelDel')
				break
		}
	}
	onMounted(() => {
		DQlist()
	})

	const optionsGender = ref([])

	const DQlist = async () => {
		const res = await business.TJFXDQ({ parentId: '1781535965870915586' })
		optionsGender.value = res
	}
</script>
<style lang="less" scoped>
	.search {
		padding-top: 20px;
		// padding-left: 50px;
		margin-bottom: 32px;
	}
	.btnBox {
		width: 100%;
		display: inline-block;
		display: flex;
		// justify-content: space-around;
		align-items: center;
		.primarySele {
			margin-left: 20px;
			margin-right: 20px;
		}
	}
	.silt-title {
		display: flex;
	}
</style>
