<template>
	<div>
		<a-form
			:label-col="labelCol"
			:wrapper-col="wrapperCol"
			layout="horizontal"
			:disabled="componentDisabled"
			style="max-width: 1000px"
			class="form-box"
		>
			<a-row :gutter="42">
				<a-col :span="8">
					<a-form-item label="监测点名称">
						<a-input :disabled="true" v-model:value="typeObj.monitorName" /> </a-form-item
				></a-col>
				<a-col :span="8">
					<a-form-item label="所属行政管理部门">
						<a-input :disabled="true" v-model:value="typeObj.orgName" /> </a-form-item
				></a-col>
				<a-col :span="8"
					><a-form-item label="详细地址"> <a-input :disabled="true" v-model:value="typeObj.address" /> </a-form-item
				></a-col>
			</a-row>
			<a-row :gutter="42">
				<a-col :span="8"
					><a-form-item label="价格采集人">
						<a-input :disabled="true" v-model:value="typeObj.userCollectName" /> </a-form-item
				></a-col>
				<a-col :span="8"
					><a-form-item label="联系方式"> <a-input :disabled="true" v-model:value="information" /> </a-form-item
				></a-col>
				<a-col :span="8"
					><a-form-item label="采集日期"> <a-input :disabled="true" v-model:value="timeDate" /> </a-form-item
				></a-col>
			</a-row>
		</a-form>
	</div>
	<table style="margin-bottom: 24px">
		<tr>
			<td colspan="3">品种</td>
			<td>收购价</td>
			<td>入库价</td>
			<td>出库价</td>
			<td>出厂价</td>
			<td>批发价</td>
			<td>零售价</td>
		</tr>
		<tr>
			<td rowspan="3">原粮</td>
			<td colspan="2">小麦</td>
			<td>
				<a-input class="input-box" type="number" v-model:value="xm[0]" />
			</td>

			<td><a-input class="input-box" type="number" v-model:value="xm[1]" /></td>
			<td><a-input class="input-box" type="number" v-model:value="xm[2]" /></td>
			<td><a-input class="input-box" type="number" v-model:value="xm[3]" /></td>
			<td><a-input class="input-box" type="number" v-model:value="xm[4]" /></td>
			<td><a-input class="input-box" type="number" v-model:value="xm[5]" /></td>
		</tr>
		<tr>
			<td colspan="2">青稞</td>
			<td>
				<a-input class="input-box" v-model:value="qk[0]" />
			</td>
			<td><a-input class="input-box" v-model:value="qk[1]" /></td>
			<td><a-input class="input-box" v-model:value="qk[2]" /></td>
			<td><a-input class="input-box" v-model:value="qk[3]" /></td>
			<td><a-input class="input-box" v-model:value="qk[4]" /></td>
			<td><a-input class="input-box" v-model:value="qk[5]" /></td>
		</tr>
		<tr>
			<td colspan="2">油菜籽</td>
			<td><a-input class="input-box" v-model:value="ycz[0]" /></td>
			<td><a-input class="input-box" v-model:value="ycz[1]" /></td>
			<td><a-input class="input-box" v-model:value="ycz[2]" /></td>
			<td><a-input class="input-box" v-model:value="ycz[3]" /></td>
			<td><a-input class="input-box" v-model:value="ycz[4]" /></td>
			<td><a-input class="input-box" v-model:value="ycz[5]" /></td>
		</tr>
		<tr>
			<td rowspan="3">杂粮</td>
			<td colspan="2">黄豆</td>
			<td><a-input class="input-box" v-model:value="hd[0]" /></td>
			<td><a-input class="input-box" v-model:value="hd[1]" /></td>
			<td><a-input class="input-box" v-model:value="hd[2]" /></td>
			<td><a-input class="input-box" v-model:value="hd[3]" /></td>
			<td><a-input class="input-box" v-model:value="hd[4]" /></td>
			<td><a-input class="input-box" v-model:value="hd[5]" /></td>
		</tr>
		<tr>
			<td colspan="2">玉米面</td>
			<td><a-input class="input-box" v-model:value="ymm[0]" /></td>
			<td><a-input class="input-box" v-model:value="ymm[1]" /></td>
			<td><a-input class="input-box" v-model:value="ymm[2]" /></td>
			<td><a-input class="input-box" v-model:value="ymm[3]" /></td>
			<td><a-input class="input-box" v-model:value="ymm[4]" /></td>
			<td><a-input class="input-box" v-model:value="ymm[5]" /></td>
		</tr>
		<tr>
			<td colspan="2">小米</td>
			<td><a-input class="input-box" v-model:value="xiaom[0]" /></td>
			<td><a-input class="input-box" v-model:value="xiaom[1]" /></td>
			<td><a-input class="input-box" v-model:value="xiaom[2]" /></td>
			<td><a-input class="input-box" v-model:value="xiaom[3]" /></td>
			<td><a-input class="input-box" v-model:value="xiaom[4]" /></td>
			<td><a-input class="input-box" v-model:value="xiaom[5]" /></td>
		</tr>
		<tr>
			<td rowspan="9">成品粮</td>
			<td rowspan="3">菜籽油</td>
			<td>一级菜籽油</td>
			<td><a-input class="input-box" v-model:value="yjczy[0]" /></td>
			<td><a-input class="input-box" v-model:value="yjczy[1]" /></td>
			<td><a-input class="input-box" v-model:value="yjczy[2]" /></td>
			<td><a-input class="input-box" v-model:value="yjczy[3]" /></td>
			<td><a-input class="input-box" v-model:value="yjczy[4]" /></td>
			<td><a-input class="input-box" v-model:value="yjczy[5]" /></td>
		</tr>
		<tr>
			<td>三级菜籽油</td>
			<td><a-input class="input-box" v-model:value="sjczy[0]" /></td>
			<td><a-input class="input-box" v-model:value="sjczy[1]" /></td>
			<td><a-input class="input-box" v-model:value="sjczy[2]" /></td>
			<td><a-input class="input-box" v-model:value="sjczy[3]" /></td>
			<td><a-input class="input-box" v-model:value="sjczy[4]" /></td>
			<td><a-input class="input-box" v-model:value="sjczy[5]" /></td>
		</tr>
		<tr>
			<td>小榨菜籽油</td>
			<td><a-input class="input-box" v-model:value="xzczy[0]" /></td>
			<td><a-input class="input-box" v-model:value="xzczy[1]" /></td>
			<td><a-input class="input-box" v-model:value="xzczy[2]" /></td>
			<td><a-input class="input-box" v-model:value="xzczy[3]" /></td>
			<td><a-input class="input-box" v-model:value="xzczy[4]" /></td>
			<td><a-input class="input-box" v-model:value="xzczy[5]" /></td>
		</tr>
		<tr>
			<td rowspan="2">面粉</td>
			<td>特一粉</td>
			<td><a-input class="input-box" v-model:value="tyf[0]" /></td>
			<td><a-input class="input-box" v-model:value="tyf[1]" /></td>
			<td><a-input class="input-box" v-model:value="tyf[2]" /></td>
			<td><a-input class="input-box" v-model:value="tyf[3]" /></td>
			<td><a-input class="input-box" v-model:value="tyf[4]" /></td>
			<td><a-input class="input-box" v-model:value="tyf[5]" /></td>
		</tr>
		<tr>
			<td>牛肉粉</td>
			<td><a-input class="input-box" v-model:value="nrmf[0]" /></td>
			<td><a-input class="input-box" v-model:value="nrmf[1]" /></td>
			<td><a-input class="input-box" v-model:value="nrmf[2]" /></td>
			<td><a-input class="input-box" v-model:value="nrmf[3]" /></td>
			<td><a-input class="input-box" v-model:value="nrmf[4]" /></td>
			<td><a-input class="input-box" v-model:value="nrmf[5]" /></td>
		</tr>
		<tr>
			<td rowspan="2">粳米</td>
			<td>一级长粒粳米</td>
			<td><a-input class="input-box" v-model:value="yjclgm[0]" /></td>
			<td><a-input class="input-box" v-model:value="yjclgm[1]" /></td>
			<td><a-input class="input-box" v-model:value="yjclgm[2]" /></td>
			<td><a-input class="input-box" v-model:value="yjclgm[3]" /></td>
			<td><a-input class="input-box" v-model:value="yjclgm[4]" /></td>
			<td><a-input class="input-box" v-model:value="yjclgm[5]" /></td>
		</tr>
		<tr>
			<td>一级圆粒粳米</td>
			<td><a-input class="input-box" v-model:value="yjylgm[0]" /></td>
			<td><a-input class="input-box" v-model:value="yjylgm[1]" /></td>
			<td><a-input class="input-box" v-model:value="yjylgm[2]" /></td>
			<td><a-input class="input-box" v-model:value="yjylgm[3]" /></td>
			<td><a-input class="input-box" v-model:value="yjylgm[4]" /></td>
			<td><a-input class="input-box" v-model:value="yjylgm[5]" /></td>
		</tr>
		<tr></tr>
		<tr></tr>
		<tr>
			<td rowspan="3">储备粮</td>
			<td colspan="2">省级储备小麦</td>
			<td><a-input class="input-box" v-model:value="sjcbxm[0]" /></td>
			<td><a-input class="input-box" v-model:value="sjcbxm[1]" /></td>
			<td><a-input class="input-box" v-model:value="sjcbxm[2]" /></td>
			<td><a-input class="input-box" v-model:value="sjcbxm[3]" /></td>
			<td><a-input class="input-box" v-model:value="sjcbxm[4]" /></td>
			<td><a-input class="input-box" v-model:value="sjcbxm[5]" /></td>
		</tr>
		<tr>
			<td colspan="2">省级储备青稞</td>
			<td><a-input class="input-box" v-model:value="sjcbqk[0]" /></td>
			<td><a-input class="input-box" v-model:value="sjcbqk[1]" /></td>
			<td><a-input class="input-box" v-model:value="sjcbqk[2]" /></td>
			<td><a-input class="input-box" v-model:value="sjcbqk[3]" /></td>
			<td><a-input class="input-box" v-model:value="sjcbqk[4]" /></td>
			<td><a-input class="input-box" v-model:value="sjcbqk[5]" /></td>
		</tr>
		<tr>
			<td colspan="2">省级储备菜籽油</td>
			<td><a-input class="input-box" v-model:value="sjcbczy[0]" /></td>
			<td><a-input class="input-box" v-model:value="sjcbczy[1]" /></td>
			<td><a-input class="input-box" v-model:value="sjcbczy[2]" /></td>
			<td><a-input class="input-box" v-model:value="sjcbczy[3]" /></td>
			<td><a-input class="input-box" v-model:value="sjcbczy[4]" /></td>
			<td><a-input class="input-box" v-model:value="sjcbczy[5]" /></td>
		</tr>
		<tr rowspan="3" :model="formState" :rules="rules">
			<td colspan="9" class="remark">
				<a-textarea class="input-box remark-box" v-model:value="formState.desc" placeholder="备注" :rows="3" />
			</td>
		</tr>
	</table>
	<a-space>
		<div class="btn">
			<a-button style="margin-right: 24px" @click="cancelData()">取消</a-button
			><a-button type="primary" @click="confirm()">保存</a-button>
		</div>
	</a-space>
</template>

<script setup>
	import bizGrainPriceCollectApi from '@/api/basic.info/bizGrainPriceCollectApi'
	import { number } from 'echarts'
	const props = defineProps({
		detailsData: {
			type: Object,
			default: () => {}
		}
	})
	const formState = reactive({
		name: '',
		region: undefined,
		date1: undefined,
		delivery: false,
		type: [],
		resource: '',
		desc: ''
	})
	const rules = {
		desc: [
			{
				required: true,
				message: '请输入备注',
				trigger: 'blur'
			}
		]
	}
	const formRef = ref()
	//首页传递过来的数据
	const timeDate = ref('')
	const getcloseData = ref(false)
	const information = ref('')
	const arrList = ref([])
	const remark = ref('')
	const xm = ref([])
	const qk = ref([])
	const ycz = ref([])
	const hd = ref([])
	const ymm = ref([])
	const xiaom = ref([])
	const yjczy = ref([]) //三级分类
	const sjczy = ref([]) //三级分类
	const xzczy = ref([]) //三级分类
	const tyf = ref([]) //三级分类
	const nrmf = ref([]) //三级分类
	const yjclgm = ref([]) //三级分类
	const yjylgm = ref([]) //三级分类
	const sjcbxm = ref([]) //省级
	const sjcbqk = ref([])
	const sjcbczy = ref([])
	const typeObj = computed(() => props.detailsData) //拿出传递过来的数据
	// 查看数据写法
	const getDetailData = () => {
		xm.value = []
		qk.value = []
		ycz.value = []
		hd.value = []
		ymm.value = []
		xiaom.value = []
		yjczy.value = []
		sjczy.value = []
		xzczy.value = []
		tyf.value = []
		nrmf.value = []
		yjclgm.value = []
		yjylgm.value = []
		sjcbxm.value = []
		sjcbqk.value = []
		sjcbczy.value = []
		const id = typeObj.value.id
		console.log(id, 6666)
		bizGrainPriceCollectApi.bizGrainPriceCollectDetail({ id }).then((res) => {
			information.value = res.userCollectPhone
			timeDate.value = res.userCollectDate
			remark.value = res.remark
			arrList.value = res.collectCategoryList
			arrList.value.forEach((item) => {
				if (item.threeLevel === 0 && item.secondLevel === 11 && item.priceType === 1) {
					if (item.price) {
						xm.value[0] = item.price
					}
				} else if (item.priceType === 1 && xm.value.length <= 0) {
					return (xm.value[0] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 11 && item.priceType === 2) {
					if (item.price) {
						xm.value[1] = item.price
					}
				} else if (item.priceType === 2 && xm.value.length <= 1) {
					return (xm.value[1] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 11 && item.priceType === 3) {
					if (item.price) {
						xm.value[2] = item.price
					}
				} else if (item.priceType === 3 && xm.value.length <= 2) {
					return (xm.value[2] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 11 && item.priceType === 4) {
					if (item.price) {
						xm.value[3] = item.price
					}
				} else if (item.priceType === 4 && xm.value.length <= 3) {
					return (xm.value[3] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 11 && item.priceType === 5) {
					if (item.price) {
						xm.value[4] = item.price
					}
				} else if (item.priceType === 5 && xm.value.length <= 4) {
					return (xm.value[4] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 11 && item.priceType === 6) {
					if (item.price) {
						xm.value[5] = item.price
					}
				} else if (item.priceType === 1 && xm.value.length <= 5) {
					return (xm.value[5] = null)
				}

				//青稞数据
				if (item.threeLevel === 0 && item.secondLevel === 12 && item.priceType === 1) {
					if (item.price) {
						qk.value[0] = item.price
					}
				} else if (item.priceType === 1 && qk.value.length <= 0) {
					return (qk.value[0] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 12 && item.priceType === 2) {
					if (item.price) {
						qk.value[1] = item.price
					}
				} else if (item.priceType === 2 && qk.value.length <= 1) {
					return (qk.value[1] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 12 && item.priceType === 3) {
					if (item.price) {
						qk.value[2] = item.price
					}
				} else if (item.priceType === 3 && qk.value.length <= 2) {
					return (qk.value[2] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 12 && item.priceType === 4) {
					if (item.price) {
						qk.value[3] = item.price
					}
				} else if (item.priceType === 4 && qk.value.length <= 3) {
					return (qk.value[3] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 12 && item.priceType === 5) {
					if (item.price) {
						qk.value[4] = item.price
					}
				} else if (item.priceType === 5 && qk.value.length <= 4) {
					return (qk.value[4] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 12 && item.priceType === 6) {
					if (item.price) {
						qk.value[5] = item.price
					}
				} else if (item.priceType === 6 && qk.value.length <= 5) {
					return (qk.value[5] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 12 && item.priceType === 1) {
					if (item.price) {
						qk.value[0] = item.price
					}
				} else if (item.priceType === 1 && qk.value.length <= 0) {
					return (qk.value[0] = null)
				}
				//油菜籽
				if (item.threeLevel === 0 && item.secondLevel === 13 && item.priceType === 2) {
					if (item.price) {
						ycz.value[1] = item.price
					}
				} else if (item.priceType === 2 && ycz.value.length <= 1) {
					return (ycz.value[1] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 13 && item.priceType === 3) {
					if (item.price) {
						ycz.value[2] = item.price
					}
				} else if (item.priceType === 3 && ycz.value.length <= 2) {
					return (ycz.value[2] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 13 && item.priceType === 4) {
					if (item.price) {
						ycz.value[3] = item.price
					}
				} else if (item.priceType === 4 && ycz.value.length <= 3) {
					return (ycz.value[3] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 13 && item.priceType === 5) {
					if (item.price) {
						ycz.value[4] = item.price
					}
				} else if (item.priceType === 5 && ycz.value.length <= 4) {
					return (ycz.value[4] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 13 && item.priceType === 6) {
					if (item.price) {
						ycz.value[5] = item.price
					}
				} else if (item.priceType === 6 && ycz.value.length <= 5) {
					return (ycz.value[5] = null)
				}
				//黄豆

				if (item.threeLevel === 0 && item.secondLevel === 21 && item.priceType === 1) {
					if (item.price) {
						hd.value[0] = item.price
					}
				} else if (item.priceType === 1 && hd.value.length <= 0) {
					return (hd.value[0] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 21 && item.priceType === 2) {
					if (item.price) {
						hd.value[1] = item.price
					}
				} else if (item.priceType === 2 && hd.value.length <= 1) {
					return (hd.value[1] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 21 && item.priceType === 3) {
					if (item.price) {
						hd.value[2] = item.price
					}
				} else if (item.priceType === 3 && hd.value.length <= 2) {
					return (hd.value[2] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 21 && item.priceType === 4) {
					if (item.price) {
						hd.value[3] = item.price
					}
				} else if (item.priceType === 4 && hd.value.length <= 3) {
					return (hd.value[3] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 21 && item.priceType === 5) {
					if (item.price) {
						hd.value[4] = item.price
					}
				} else if (item.priceType === 5 && hd.value.length <= 4) {
					return (hd.value[4] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 21 && item.priceType === 6) {
					if (item.price) {
						hd.value[5] = item.price
					}
				} else if (item.priceType === 6 && hd.value.length <= 5) {
					return (hd.value[5] = null)
				}

				//玉米面
				if (item.threeLevel === 0 && item.secondLevel === 22 && item.priceType === 1) {
					if (item.price) {
						ymm.value[0] = item.price
					}
				} else if (item.priceType === 1 && ymm.value.length <= 0) {
					return (ymm.value[0] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 22 && item.priceType === 2) {
					if (item.price) {
						ymm.value[1] = item.price
					}
				} else if (item.priceType === 2 && ymm.value.length <= 1) {
					return (ymm.value[1] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 22 && item.priceType === 3) {
					if (item.price) {
						ymm.value[2] = item.price
					}
				} else if (item.priceType === 3 && ymm.value.length <= 2) {
					return (ymm.value[2] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 22 && item.priceType === 4) {
					if (item.price) {
						ymm.value[3] = item.price
					}
				} else if (item.priceType === 4 && ymm.value.length <= 3) {
					return (ymm.value[3] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 22 && item.priceType === 5) {
					if (item.price) {
						ymm.value[4] = item.price
					}
				} else if (item.priceType === 5 && ymm.value.length <= 4) {
					return (ymm.value[4] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 22 && item.priceType === 6) {
					if (item.price) {
						ymm.value[5] = item.price
					}
				} else if (item.priceType === 6 && ymm.value.length <= 5) {
					return (ymm.value[5] = null)
				}
				//小米

				if (item.threeLevel === 0 && item.secondLevel === 12 && item.priceType === 1) {
					if (item.price) {
						xiaom.value[0] = item.price
					}
				} else if (item.priceType === 1 && xiaom.value.length <= 0) {
					return (xiaom.value[0] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 12 && item.priceType === 2) {
					if (item.price) {
						xiaom.value[1] = item.price
					}
				} else if (item.priceType === 2 && xiaom.value.length <= 1) {
					return (xiaom.value[1] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 12 && item.priceType === 3) {
					if (item.price) {
						xiaom.value[2] = item.price
					}
				} else if (item.priceType === 3 && xiaom.value.length <= 2) {
					return (xiaom.value[2] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 12 && item.priceType === 4) {
					if (item.price) {
						xiaom.value[3] = item.price
					}
				} else if (item.priceType === 4 && xiaom.value.length <= 3) {
					return (xiaom.value[3] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 12 && item.priceType === 5) {
					if (item.price) {
						xiaom.value[4] = item.price
					}
				} else if (item.priceType === 5 && xiaom.value.length <= 4) {
					return (xiaom.value[4] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 12 && item.priceType === 6) {
					if (item.price) {
						xiaom.value[5] = item.price
					}
				} else if (item.priceType === 6 && xiaom.value.length <= 5) {
					return (xiaom.value[5] = null)
				}
				//省级储备小麦
				if (item.threeLevel === 0 && item.secondLevel === 41 && item.priceType === 1) {
					if (item.price) {
						sjcbxm.value[0] = item.price
					}
				} else if (item.priceType === 1 && sjcbxm.value.length <= 0) {
					return (sjcbxm.value[0] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 41 && item.priceType === 2) {
					if (item.price) {
						sjcbxm.value[1] = item.price
					}
				} else if (item.priceType === 2 && sjcbxm.value.length <= 1) {
					return (sjcbxm.value[1] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 41 && item.priceType === 3) {
					if (item.price) {
						sjcbxm.value[2] = item.price
					}
				} else if (item.priceType === 3 && sjcbxm.value.length <= 2) {
					return (sjcbxm.value[2] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 41 && item.priceType === 4) {
					if (item.price) {
						sjcbxm.value[3] = item.price
					}
				} else if (item.priceType === 4 && sjcbxm.value.length <= 3) {
					return (sjcbxm.value[3] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 41 && item.priceType === 5) {
					if (item.price) {
						sjcbxm.value[4] = item.price
					}
				} else if (item.priceType === 5 && sjcbxm.value.length <= 4) {
					return (sjcbxm.value[4] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 41 && item.priceType === 6) {
					if (item.price) {
						sjcbxm.value[5] = item.price
					}
				} else if (item.priceType === 6 && sjcbxm.value.length <= 5) {
					return (sjcbxm.value[5] = null)
				}
				//省级储备青稞
				if (item.threeLevel === 0 && item.secondLevel === 42 && item.priceType === 1) {
					if (item.price) {
						sjcbqk.value[0] = item.price
					}
				} else if (item.priceType === 1 && sjcbqk.value.length <= 0) {
					return (sjcbqk.value[0] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 42 && item.priceType === 2) {
					if (item.price) {
						sjcbqk.value[1] = item.price
					}
				} else if (item.priceType === 2 && sjcbqk.value.length <= 1) {
					return (sjcbqk.value[1] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 42 && item.priceType === 3) {
					if (item.price) {
						sjcbqk.value[2] = item.price
					}
				} else if (item.priceType === 3 && sjcbqk.value.length <= 2) {
					return (sjcbqk.value[2] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 42 && item.priceType === 4) {
					if (item.price) {
						sjcbqk.value[3] = item.price
					}
				} else if (item.priceType === 4 && sjcbqk.value.length <= 3) {
					return (sjcbqk.value[3] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 42 && item.priceType === 5) {
					if (item.price) {
						sjcbqk.value[4] = item.price
					}
				} else if (item.priceType === 5 && sjcbqk.value.length <= 4) {
					return (sjcbqk.value[4] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 42 && item.priceType === 6) {
					if (item.price) {
						sjcbqk.value[5] = item.price
					}
				} else if (item.priceType === 6 && sjcbqk.value.length <= 5) {
					return (sjcbqk.value[5] = null)
				}
				//省级储备菜籽油
				if (item.threeLevel === 0 && item.secondLevel === 43 && item.priceType === 1) {
					if (item.price) {
						sjcbczy.value[0] = item.price
					}
				} else if (item.priceType === 1 && sjcbczy.value.length <= 0) {
					return (sjcbczy.value[0] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 43 && item.priceType === 2) {
					if (item.price) {
						sjcbczy.value[1] = item.price
					}
				} else if (item.priceType === 2 && sjcbczy.value.length <= 1) {
					return (sjcbczy.value[1] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 43 && item.priceType === 3) {
					if (item.price) {
						sjcbczy.value[2] = item.price
					}
				} else if (item.priceType === 3 && sjcbczy.value.length <= 2) {
					return (sjcbczy.value[2] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 43 && item.priceType === 4) {
					if (item.price) {
						sjcbczy.value[3] = item.price
					}
				} else if (item.priceType === 4 && sjcbczy.value.length <= 3) {
					return (sjcbczy.value[3] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 43 && item.priceType === 5) {
					if (item.price) {
						sjcbczy.value[4] = item.price
					}
				} else if (item.priceType === 5 && sjcbczy.value.length <= 4) {
					return (sjcbczy.value[4] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 43 && item.priceType === 6) {
					if (item.price) {
						sjcbczy.value[5] = item.price
					}
				} else if (item.priceType === 6 && sjcbczy.value.length <= 5) {
					return (sjcbczy.value[5] = null)
				}
				//一级菜籽油

				if (item.threeLevel === 0 && item.secondLevel === 311 && item.priceType === 1) {
					if (item.price) {
						yjczy.value[0] = item.price
					}
				} else if (item.priceType === 1 && yjczy.value.length <= 0) {
					return (yjczy.value[0] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 311 && item.priceType === 2) {
					if (item.price) {
						yjczy.value[1] = item.price
					}
				} else if (item.priceType === 2 && yjczy.value.length <= 1) {
					return (yjczy.value[1] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 311 && item.priceType === 3) {
					if (item.price) {
						yjczy.value[2] = item.price
					}
				} else if (item.priceType === 3 && yjczy.value.length <= 2) {
					return (yjczy.value[2] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 311 && item.priceType === 4) {
					if (item.price) {
						yjczy.value[3] = item.price
					}
				} else if (item.priceType === 4 && yjczy.value.length <= 3) {
					return (yjczy.value[3] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 311 && item.priceType === 5) {
					if (item.price) {
						yjczy.value[4] = item.price
					}
				} else if (item.priceType === 5 && yjczy.value.length <= 4) {
					return (yjczy.value[4] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 311 && item.priceType === 6) {
					if (item.price) {
						yjczy.value[5] = item.price
					}
				} else if (item.priceType === 6 && yjczy.value.length <= 5) {
					return (yjczy.value[5] = null)
				}

				//三级菜籽油
				if (item.threeLevel === 0 && item.secondLevel === 312 && item.priceType === 1) {
					if (item.price) {
						sjczy.value[0] = item.price
					}
				} else if (item.priceType === 1 && sjczy.value.length <= 0) {
					return (sjczy.value[0] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 312 && item.priceType === 2) {
					if (item.price) {
						sjczy.value[1] = item.price
					}
				} else if (item.priceType === 2 && sjczy.value.length <= 1) {
					return (sjczy.value[1] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 312 && item.priceType === 3) {
					if (item.price) {
						sjczy.value[2] = item.price
					}
				} else if (item.priceType === 3 && sjczy.value.length <= 2) {
					return (sjczy.value[2] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 312 && item.priceType === 4) {
					if (item.price) {
						sjczy.value[3] = item.price
					}
				} else if (item.priceType === 4 && sjczy.value.length <= 3) {
					return (sjczy.value[3] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 312 && item.priceType === 5) {
					if (item.price) {
						sjczy.value[4] = item.price
					}
				} else if (item.priceType === 5 && sjczy.value.length <= 4) {
					return (sjczy.value[4] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 312 && item.priceType === 6) {
					if (item.price) {
						sjczy.value[5] = item.price
					}
				} else if (item.priceType === 6 && sjczy.value.length <= 5) {
					return (sjczy.value[5] = null)
				}
				//小榨菜籽油
				if (item.threeLevel === 0 && item.secondLevel === 313 && item.priceType === 1) {
					if (item.price) {
						xzczy.value[0] = item.price
					}
				} else if (item.priceType === 1 && xzczy.value.length <= 0) {
					return (xzczy.value[0] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 313 && item.priceType === 2) {
					if (item.price) {
						xzczy.value[1] = item.price
					}
				} else if (item.priceType === 2 && xzczy.value.length <= 1) {
					return (xzczy.value[1] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 313 && item.priceType === 3) {
					if (item.price) {
						xzczy.value[2] = item.price
					}
				} else if (item.priceType === 3 && xzczy.value.length <= 2) {
					return (xzczy.value[2] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 313 && item.priceType === 4) {
					if (item.price) {
						xzczy.value[3] = item.price
					}
				} else if (item.priceType === 4 && xzczy.value.length <= 3) {
					return (xzczy.value[3] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 313 && item.priceType === 5) {
					if (item.price) {
						xzczy.value[4] = item.price
					}
				} else if (item.priceType === 5 && xzczy.value.length <= 4) {
					return (xzczy.value[4] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 313 && item.priceType === 6) {
					if (item.price) {
						xzczy.value[5] = item.price
					}
				} else if (item.priceType === 6 && xzczy.value.length <= 5) {
					return (xzczy.value[5] = null)
				}
				//特一粉
				if (item.threeLevel === 0 && item.secondLevel === 321 && item.priceType === 1) {
					if (item.price) {
						tyf.value[0] = item.price
					}
				} else if (item.priceType === 1 && tyf.value.length <= 0) {
					return (tyf.value[0] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 321 && item.priceType === 2) {
					if (item.price) {
						tyf.value[1] = item.price
					}
				} else if (item.priceType === 2 && tyf.value.length <= 1) {
					return (tyf.value[1] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 321 && item.priceType === 3) {
					if (item.price) {
						tyf.value[2] = item.price
					}
				} else if (item.priceType === 3 && tyf.value.length <= 2) {
					return (tyf.value[2] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 321 && item.priceType === 4) {
					if (item.price) {
						tyf.value[3] = item.price
					}
				} else if (item.priceType === 4 && tyf.value.length <= 3) {
					return (tyf.value[3] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 321 && item.priceType === 5) {
					if (item.price) {
						tyf.value[4] = item.price
					}
				} else if (item.priceType === 5 && tyf.value.length <= 4) {
					return (tyf.value[4] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 321 && item.priceType === 6) {
					if (item.price) {
						tyf.value[5] = item.price
					}
				} else if (item.priceType === 6 && tyf.value.length <= 5) {
					return (tyf.value[5] = null)
				}

				//牛肉面粉
				if (item.threeLevel === 0 && item.secondLevel === 322 && item.priceType === 1) {
					if (item.price) {
						nrmf.value[0] = item.price
					}
				} else if (item.priceType === 1 && nrmf.value.length <= 0) {
					return (nrmf.value[0] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 322 && item.priceType === 2) {
					if (item.price) {
						nrmf.value[1] = item.price
					}
				} else if (item.priceType === 2 && nrmf.value.length <= 1) {
					return (nrmf.value[1] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 322 && item.priceType === 3) {
					if (item.price) {
						nrmf.value[2] = item.price
					}
				} else if (item.priceType === 3 && nrmf.value.length <= 2) {
					return (nrmf.value[2] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 322 && item.priceType === 4) {
					if (item.price) {
						nrmf.value[3] = item.price
					}
				} else if (item.priceType === 4 && nrmf.value.length <= 3) {
					return (nrmf.value[3] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 322 && item.priceType === 5) {
					if (item.price) {
						nrmf.value[4] = item.price
					}
				} else if (item.priceType === 5 && nrmf.value.length <= 4) {
					return (nrmf.value[4] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 322 && item.priceType === 6) {
					if (item.price) {
						nrmf.value[5] = item.price
					}
				} else if (item.priceType === 6 && nrmf.value.length <= 5) {
					return (nrmf.value[5] = null)
				}
				//一级长粒粳米
				if (item.threeLevel === 0 && item.secondLevel === 331 && item.priceType === 1) {
					if (item.price) {
						yjclgm.value[0] = item.price
					}
				} else if (item.priceType === 1 && yjclgm.value.length <= 0) {
					return (yjclgm.value[0] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 331 && item.priceType === 2) {
					if (item.price) {
						yjclgm.value[1] = item.price
					}
				} else if (item.priceType === 2 && yjclgm.value.length <= 1) {
					return (yjclgm.value[1] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 331 && item.priceType === 3) {
					if (item.price) {
						yjclgm.value[2] = item.price
					}
				} else if (item.priceType === 3 && yjclgm.value.length <= 2) {
					return (yjclgm.value[2] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 331 && item.priceType === 4) {
					if (item.price) {
						yjclgm.value[3] = item.price
					}
				} else if (item.priceType === 4 && yjclgm.value.length <= 3) {
					return (yjclgm.value[3] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 331 && item.priceType === 5) {
					if (item.price) {
						yjclgm.value[4] = item.price
					}
				} else if (item.priceType === 5 && yjclgm.value.length <= 4) {
					return (yjclgm.value[4] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 331 && item.priceType === 6) {
					if (item.price) {
						yjclgm.value[5] = item.price
					}
				} else if (item.priceType === 6 && yjclgm.value.length <= 5) {
					return (yjclgm.value[5] = null)
				}
				//一级圆粒粳米
				if (item.threeLevel === 0 && item.secondLevel === 332 && item.priceType === 1) {
					if (item.price) {
						yjylgm.value[0] = item.price
					}
				} else if (item.priceType === 1 && yjylgm.value.length <= 0) {
					return (yjylgm.value[0] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 332 && item.priceType === 2) {
					if (item.price) {
						yjylgm.value[1] = item.price
					}
				} else if (item.priceType === 2 && yjylgm.value.length <= 1) {
					return (yjylgm.value[1] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 332 && item.priceType === 3) {
					if (item.price) {
						yjylgm.value[2] = item.price
					}
				} else if (item.priceType === 3 && yjylgm.value.length <= 2) {
					return (yjylgm.value[2] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 332 && item.priceType === 4) {
					if (item.price) {
						yjylgm.value[3] = item.price
					}
				} else if (item.priceType === 4 && yjylgm.value.length <= 3) {
					return (yjylgm.value[3] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 332 && item.priceType === 5) {
					if (item.price) {
						yjylgm.value[4] = item.price
					}
				} else if (item.priceType === 5 && yjylgm.value.length <= 4) {
					return (yjylgm.value[4] = null)
				}

				if (item.threeLevel === 0 && item.secondLevel === 332 && item.priceType === 6) {
					if (item.price) {
						yjylgm.value[5] = item.price
					}
				} else if (item.priceType === 6 && yjylgm.value.length <= 5) {
					return (yjylgm.value[5] = null)
				}
			})
		})
	}
	const emits = defineEmits(['getclose']) //声明子级事件
	// 取消事件
	const cancelData = () => {
		emits('getClose', getcloseData.value) //取消事件关闭按钮
	}

	// 保存事件
	const confirm = () => {
		const params = {
			type: '1',
			id: typeObj.value.id,
			remark: remark.value,
			categoryEditParamList: []
		}
		console.log(params, 61345)
		if (xm.value.some((item) => !!item)) {
			xm.value.map((item, index) => {
				item &&
					params.categoryEditParamList.push({
						type: '1',
						secondLevel: '11', //小麦就是11
						firstLevel: '1',
						threeLevel: 0,
						price: item,
						priceType: index + 1
					})
			})
		}
		if (qk.value.some((item) => !!item)) {
			qk.value.map((item, index) => {
				item &&
					params.categoryEditParamList.push({
						type: '1',
						secondLevel: '12',
						firstLevel: '1',
						threeLevel: 0,
						price: item,
						priceType: index + 1
					})
			})
		}
		if (ycz.value.some((item) => !!item)) {
			ycz.value.map((item, index) => {
				item &&
					params.categoryEditParamList.push({
						type: '1',
						secondLevel: '13',
						firstLevel: '1',
						threeLevel: 0,
						price: item,
						priceType: index + 1
					})
			})
		}
		if (hd.value.some((item) => !!item)) {
			hd.value.map((item, index) => {
				item &&
					params.categoryEditParamList.push({
						type: '1',
						secondLevel: '21',
						firstLevel: '2',
						threeLevel: 0,
						price: item,
						priceType: index + 1
					})
			})
		}
		if (ymm.value.some((item) => !!item)) {
			ymm.value.map((item, index) => {
				item &&
					params.categoryEditParamList.push({
						type: '1',
						secondLevel: '22',
						firstLevel: '2',
						threeLevel: 0,
						price: item,
						priceType: index + 1
					})
			})
		}
		if (xiaom.value.some((item) => !!item)) {
			xiaom.value.map((item, index) => {
				item &&
					params.categoryEditParamList.push({
						type: '1',
						secondLevel: '23',
						firstLevel: '2',
						threeLevel: 0,
						price: item,
						priceType: index + 1
					})
			})
		}
		if (yjczy.value.some((item) => !!item)) {
			yjczy.value.map((item, index) => {
				item &&
					params.categoryEditParamList.push({
						type: '1',

						secondLevel: '31',
						firstLevel: '3',
						threeLevel: '311',
						price: item,
						priceType: index + 1
					})
			})
		}
		if (sjczy.value.some((item) => !!item)) {
			sjczy.value.map((item, index) => {
				item &&
					params.categoryEditParamList.push({
						type: '1',

						secondLevel: '31',
						firstLevel: '3',
						threeLevel: '312',
						price: item,
						priceType: index + 1
					})
			})
		}
		if (xzczy.value.some((item) => !!item)) {
			xzczy.value.map((item, index) => {
				item &&
					params.categoryEditParamList.push({
						type: '1',
						secondLevel: '31',
						firstLevel: '3',
						threeLevel: '313',
						price: item,
						priceType: index + 1
					})
			})
		}
		if (tyf.value.some((item) => !!item)) {
			tyf.value.map((item, index) => {
				item &&
					params.categoryEditParamList.push({
						type: '1',

						secondLevel: '32',
						firstLevel: '3',
						threeLevel: '321',
						price: item,
						priceType: index + 1
					})
			})
		}
		if (nrmf.value.some((item) => !!item)) {
			nrmf.value.map((item, index) => {
				item &&
					params.categoryEditParamList.push({
						type: '1',

						secondLevel: '32',
						firstLevel: '3',
						threeLevel: '322',
						price: item,
						priceType: index + 1
					})
			})
		}
		if (yjclgm.value.some((item) => !!item)) {
			yjclgm.value.map((item, index) => {
				item &&
					params.categoryEditParamList.push({
						type: '1',

						secondLevel: '33',
						firstLevel: '3',
						threeLevel: '331',
						price: item,
						priceType: index + 1
					})
			})
		}
		if (yjylgm.value.some((item) => !!item)) {
			yjylgm.value.map((item, index) => {
				item &&
					params.categoryEditParamList.push({
						type: '1',

						secondLevel: '33',
						firstLevel: '3',
						threeLevel: '332',
						price: item,
						priceType: index + 1
					})
			})
		}
		if (sjcbxm.value.some((item) => !!item)) {
			sjcbxm.value.map((item, index) => {
				item &&
					params.categoryEditParamList.push({
						type: '1',
						secondLevel: '41',
						firstLevel: '4',
						price: item,
						priceType: index + 1
					})
			})
		}
		if (sjcbqk.value.some((item) => !!item)) {
			sjcbqk.value.map((item, index) => {
				item &&
					params.categoryEditParamList.push({
						type: '1',
						secondLevel: '42',
						firstLevel: '4',
						threeLevel: 0,
						price: item,
						priceType: index + 1
					})
			})
		}
		if (sjcbczy.value.some((item) => !!item)) {
			sjcbczy.value.map((item, index) => {
				item &&
					params.categoryEditParamList.push({
						type: '1',
						secondLevel: '43',
						firstLevel: '4',
						threeLevel: 0,
						price: item,
						priceType: index + 1
					})
			})
		}
		bizGrainPriceCollectApi.bizGrainPriceCollectSubmitForm({ params }).then((res) => {
			console.log(res, 'aaaa')
		})

		emits('getClose', getcloseData.value)

		console.log(params)
	}

	onMounted(() => {})
	// 监听点击事件更新数据
	watch(
		() => props.detailsData,
		async (newValue, oldvalue) => {
			await nextTick()
			getDetailData()
		},
		{ deep: true, immediate: true }
	)
</script>
<style scoped>
	table {
		/* overflow: hidden; */
		text-align: center;
		border: 1px solid #000;
	}
	td {
		border: 1px solid #000;
	}
	.input-box {
		border: none;
		box-shadow: none;
		text-align: center;
	}
	/* .ant-input:focus {
		outline: none;
		box-shadow: none;
	} */
	.ant-form-item-control-input {
		width: 260px;
	}
	.form-box {
		margin-bottom: 24px;
	}
	.ant-space {
		width: 100%;
		text-align: center;
		padding-left: 30%;
	}
	.remark-box {
		text-align: left;
	}
	/* 取消[type='number']的input的上下箭头 */
	input::-webkit-inner-spin-button {
		-webkit-appearance: none !important;
	}

	input::-webkit-outer-spin-button {
		-webkit-appearance: none !important;
	}

	input[type='number'] {
		-moz-appearance: textfield;
	}
</style>
