<template>
	<el-container>
		<el-header>
			<div class="right-panel">
				<el-input v-model="query.batch__contains" 
				placeholder="批次号" 
				clearable 
				style="width: 200px;"
				></el-input>
				<el-date-picker
					v-model="query.last_time__gte"
					type="date"
					placeholder="开始日期"
					value-format="YYYY-MM-DD"
					clearable
					style="width: 200px; margin: 5px"
				>
				</el-date-picker>
				<el-date-picker
					v-model="query.last_time__lte"
					type="date"
					placeholder="截止日期"
					value-format="YYYY-MM-DD"
					clearable
					style="width: 200px; margin:0"
				>
				</el-date-picker>
				<el-button
					type="primary"
					icon="el-icon-search"
					@click="handleQuery"
				></el-button>
				<el-button
					@click="handleExport"
					class="tables"
					type="primary"
					>导出</el-button
				>
			</div>
		</el-header>
		<el-main class="nopadding">
			<scTable
				ref="table"
				:apiObj="apiObj"
				:params="params"
				:query="query"
				id="exportDiv"
				stripe
			>
				<el-table-column label="产品编号" prop="batch">
				</el-table-column>
				<el-table-column label="10号生产" align="center">
					<el-table-column label="规格">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.产品规格 }}</span>
						</template>
					</el-table-column>
					<el-table-column label="生产数">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.管料成型_count_real }}</span>
						</template>
					</el-table-column>
					<el-table-column label="合格数">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.管料成型_count_ok }}</span>
						</template>
					</el-table-column>
					<el-table-column label="合格率">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.管料成型_合格率 }}</span>
						</template>
					</el-table-column>
					<el-table-column label="条纹">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.管料成型_count_n_tw }}</span>
						</template>
					</el-table-column>
					<el-table-column label="结石">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.管料成型_count_n_js }}</span>
						</template>
					</el-table-column>
					<el-table-column label="气线">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.管料成型_count_n_qx }}</span>
						</template>
					</el-table-column>
					<el-table-column label="断裂">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.管料成型_count_n_dl }}</span>
						</template>
					</el-table-column>
					<el-table-column label="偏壁">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.管料成型_count_n_pb }}</span>
						</template>
					</el-table-column>
					<el-table-column label="大小头">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.管料成型_count_n_dxt }}</span>
						</template>
					</el-table-column>
					
					<el-table-column label="变形椭圆">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.管料成型_count_n_ty }}</span>
						</template>
					</el-table-column>
					<el-table-column label="备注">
							<template #default="scope">
								<span v-if="scope.row.data">{{ scope.row.data.管料成型_备注 }}</span>
							</template>
						</el-table-column>
				</el-table-column>
				<el-table-column label="10号抽检">
					<el-table-column label="抽检数量">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.十车间入库_count }}</span>
						</template>
					</el-table-column>
					<el-table-column label="合格数">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.十车间入库_抽检合格数 }}</span>
						</template>
					</el-table-column>
					<el-table-column label="合格率">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.十车间入库_抽检合格率 }}</span>
						</template>
					</el-table-column>
					<el-table-column label="偏壁">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.十车间入库_count_n_pb }}</span>
						</template>
					</el-table-column>
					<el-table-column label="结石">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.十车间入库_count_n_js }}</span>
						</template>
					</el-table-column>
					<el-table-column label="脏料">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.十车间入库_count_n_zl }}</span>
						</template>
					</el-table-column>
					<el-table-column label="断裂">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.十车间入库_count_n_dl }}</span>
						</template>
					</el-table-column>
					<el-table-column label="椭圆">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.十车间入库_count_n_ty }}</span>
						</template>
					</el-table-column>
					<el-table-column label="炸裂">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.十车间入库_count_n_zl }}</span>
						</template>
					</el-table-column>
					<el-table-column label="锥">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.十车间入库_count_n_z }}</span>
						</template>
					</el-table-column>
					<el-table-column label="大小头">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.十车间入库_count_n_dxt }}</span>
						</template>
					</el-table-column>
					<el-table-column label="划伤">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.十车间入库_count_n_hs }}</span>
						</template>
					</el-table-column>
					<el-table-column label="气线">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.十车间入库_count_n_qx }}</span>
						</template>
					</el-table-column>
					<el-table-column label="炸纹">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.十车间入库_count_n_zw }}</span>
						</template>
					</el-table-column>
					<el-table-column label="其他">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.十车间入库_count_n_qt }}</span>
						</template>
					</el-table-column>
					<el-table-column label="抽检人">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.十车间入库_抽检人 }}</span>
						</template>
					</el-table-column>
				</el-table-column>
				<el-table-column label="8号入库" align="center">
					<el-table-column label="时间">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.十车间入库_日期 }}</span>
						</template>
					</el-table-column>
					<el-table-column label="入库数">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.十车间入库_count }}</span>
						</template>
					</el-table-column>
					<el-table-column label="合格数">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.十车间入库_合格数 }}</span>
						</template>
					</el-table-column>
					<el-table-column label="合格率">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.十车间入库_合格率 }}</span>
						</template>
					</el-table-column>
					<el-table-column label="结石">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.十车间入库_count_n_js }}</span>
						</template>
					</el-table-column>
					<el-table-column label="气线">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.十车间入库_count_n_qx }}</span>
						</template>
					</el-table-column>
					<el-table-column label="断裂">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.十车间入库_count_n_dl }}</span>
						</template>
					</el-table-column>
					<el-table-column label="划伤">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.十车间入库_count_n_hs }}</span>
						</template>
					</el-table-column>
					<el-table-column label="碎">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.十车间入库_count_n_s }}</span>
						</template>
					</el-table-column>
					<el-table-column label="内径小">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.十车间入库_count_n_njx }}</span>
						</template>
					</el-table-column>
					<el-table-column label="其他">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.十车间入库_count_n_qt }}</span>
						</template>
					</el-table-column>
					<el-table-column label="备注">
					</el-table-column>
					<el-table-column label="接收人">
						<template #default="scope">{{ scope.row.data.十车间入库_仓库执行人 }}</template>
					</el-table-column>
				</el-table-column>
				<el-table-column label="退火" align="center">
					<el-table-column label="时间">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.管料退火_日期 }}</span>
						</template>
					</el-table-column>
					<el-table-column label="退火数">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.管料退火_count_use }}</span>
						</template>
					</el-table-column>
					<el-table-column label="合格数">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.管料退火_count_ok }}</span>
						</template>
					</el-table-column>
					<el-table-column label="合格率">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.管料退火_合格率 }}</span>
						</template>
					</el-table-column>
					<el-table-column label="碎">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.管料退火_count_n_s }}</span>
						</template>
					</el-table-column>
					<el-table-column label="其他">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.管料退火_count_n_qt }}</span>
						</template>
					</el-table-column>
					<el-table-column label="退火人">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.管料退火_操作人 }}</span>
						</template>
					</el-table-column>
				</el-table-column>
				<el-table-column label="6号领取" align="center">
					<el-table-column label="领取时间">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.六车间领料_日期 }}</span>
						</template>
					</el-table-column>
					<el-table-column label="领取数">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.六车间领料_count }}</span>
						</template>
					</el-table-column>
					<el-table-column label="交送人">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.六车间领料_仓库执行人 }}</span>
						</template>
					</el-table-column>
					<el-table-column label="领取人">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.六车间领料_车间执行人 }}</span>
						</template>
					</el-table-column>
					<el-table-column label="备注">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.六车间领料_备注 }}</span>
						</template>
					</el-table-column>
				</el-table-column>
				<el-table-column label="开管" align="center">
					<el-table-column label="开槽">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.六车间_开槽_count_real }}</span>
						</template>
					</el-table-column>
					<el-table-column label="合格率">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.六车间_开槽_合格率 }}</span>
						</template>
					</el-table-column>
					<el-table-column label="短">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.六车间_开槽_count_n_d }}</span>
						</template>
					</el-table-column>
					<el-table-column label="少">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.六车间_开槽_count_n_s }}</span>
						</template>
					</el-table-column>
					<el-table-column label="断裂">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.六车间_开槽_count_n_dl }}</span>
						</template>
					</el-table-column>
					<el-table-column label="红锈">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.六车间_开槽_count_n_hx }}</span>
						</template>
					</el-table-column>
					<el-table-column label="开槽前检验不合格">
						<!-- <template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.开槽前检验不合格 }}</span>
						</template> -->
					</el-table-column>
					<el-table-column label="加工日期">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.六车间_开槽_日期 }}</span>
						</template>
					</el-table-column>
					<el-table-column label="操作人">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.六车间_开槽_操作人 }}</span>
						</template>
					</el-table-column>
					<el-table-column label="备注">
						<!-- <template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.备注 }}</span>
						</template> -->
					</el-table-column>
				</el-table-column>
				<el-table-column label="检验" align="center">
					<el-table-column label="检验">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.成品检验_count }}</span>
						</template>
					</el-table-column>
					<el-table-column label="合格率">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.成品检验_合格率 }}</span>
						</template>
					</el-table-column>
					<el-table-column label="划伤">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.成品检验_count_hs }}</span>
						</template>
					</el-table-column>
					<el-table-column label="气线">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.成品检验_count_qx }}</span>
						</template>
					</el-table-column>
					<el-table-column label="炸纹">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.成品检验_count_zw }}</span>
						</template>
					</el-table-column>
					<el-table-column label="偏壁">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.成品检验_count_bp }}</span>
						</template>
					</el-table-column>
					<el-table-column label="弯">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.成品检验_count_w }}</span>
						</template>
					</el-table-column>
					<el-table-column label="大小头">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.成品检验_count_dxt }}</span>
						</template>
					</el-table-column>
					<el-table-column label="结子">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.成品检验_count_jz }}</span>
						</template>
					</el-table-column>
					<el-table-column label="锥">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.成品检验_count_z }}</span>
						</template>
					</el-table-column>
					<el-table-column label="椭">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.成品检验_count_ty }}</span>
						</template>
					</el-table-column>
					<el-table-column label="短">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.成品检验_count_d }}</span>
						</template>
					</el-table-column>
					<el-table-column label="少">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.成品检验_count_s }}</span>
						</template>
					</el-table-column>
					<el-table-column label="多">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.成品检验_count_d }}</span>
						</template>
					</el-table-column>
					<el-table-column label="碎裂">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.成品检验_count_sl }}</span>
						</template>
					</el-table-column>
					<el-table-column label="其他">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.成品检验_count_qt }}</span>
						</template>
					</el-table-column>
					<el-table-column label="日期">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.成品检验_日期 }}</span>
						</template>
					</el-table-column>
					<el-table-column label="操作人">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.成品检验_检验人 }}</span>
						</template>
					</el-table-column>
				</el-table-column>
				<el-table-column label="终检" align="center">
					<el-table-column label="终检">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.成品检验_count }}</span>
						</template>
					</el-table-column>
					<el-table-column label="合格率">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.成品检验_合格率 }}</span>
						</template>
					</el-table-column>
					<el-table-column label="划伤">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.成品检验_count_n_hs }}</span>
						</template>
					</el-table-column>
					<el-table-column label="炸纹">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.成品检验_count_n_zw }}</span>
						</template>
					</el-table-column>
					<el-table-column label="气线">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.成品检验_count_n_qx }}</span>
						</template>
					</el-table-column>
					<el-table-column label="结子">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.成品检验_count_n_jz }}</span>
						</template>
					</el-table-column>
					<el-table-column label="其他">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.成品检验_count_n_qt }}</span>
						</template>
					</el-table-column>
					<el-table-column label="日期">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.成品检验_日期 }}</span>
						</template>
					</el-table-column>
					<el-table-column label="操作人">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.成品检验_检验人 }}</span>
						</template>
					</el-table-column>
				</el-table-column>
				<el-table-column label="领管-终检合格率">
					<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.六车间_批次生产合格率 }}</span>
						</template>
				</el-table-column>
			</scTable>
		</el-main>
	</el-container>
</template>

<script>
export default {
	name: "statistics_guan",
	data() {
		return {
			params: {
				ordering:'-last_time',
				batch__contains:'ZB2',
			},
			query:{
				last_time__gte:'',
				last_time__lte:'',
				
			},
			apiObj: this.$API.wpm.batchst,
			options:[],
			tableData:[],
		};
	},
	methods: {
		handleQuery(){
			this.$refs.table.queryData(this.query);
		},
	},
};
</script>

<style scoped>
</style>
