<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="datetime"
					placeholder="变动时间起"
					value-format="YYYY-MM-DD HH:mm:ss"
					clearable
					style="width: 200px; margin: 5px"
				>
				</el-date-picker>
				<el-date-picker
					v-model="query.last_time__lte"
					type="datetime"
					placeholder="变动时间止"
					value-format="YYYY-MM-DD HH:mm:ss"
					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" min-width="160">
				</el-table-column>
				<el-table-column label="10号生产" align="center" class-name="colorheader1">
					<el-table-column label="规格" class-name="colorheader1">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.产品规格 }}</span>
						</template>
					</el-table-column>
					<el-table-column label="生产数" class-name="colorheader1">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.管料成型_count_real }}</span>
						</template>
					</el-table-column>
					<el-table-column label="合格数" class-name="colorheader1">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.管料成型_count_ok }}</span>
						</template>
					</el-table-column>
					<el-table-column label="合格率" class-name="colorheader1">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.管料成型_合格率 }}</span>
						</template>
					</el-table-column>
					<el-table-column label="不合格数" class-name="colorheader1">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.管料成型_count_notok }}</span>
						</template>
					</el-table-column>
					<el-table-column label="椭圆/弯曲" class-name="colorheader1">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.管料成型_count_n_wq }}</span>
						</template>
					</el-table-column>
					<el-table-column label="条纹" class-name="colorheader1">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.管料成型_count_n_tw }}</span>
						</template>
					</el-table-column>
					<el-table-column label="断裂" class-name="colorheader1">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.管料成型_count_n_dl }}</span>
						</template>
					</el-table-column>
					<el-table-column label="偏壁" class-name="colorheader1">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.管料成型_count_n_pb }}</span>
						</template>
					</el-table-column>
					<el-table-column label="大小头" class-name="colorheader1">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.管料成型_count_n_dxt }}</span>
						</template>
					</el-table-column>
					<el-table-column label="结石" class-name="colorheader1">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.管料成型_count_n_js }}</span>
						</template>
					</el-table-column>
					<el-table-column label="气线" class-name="colorheader1">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.管料成型_count_n_qx }}</span>
						</template>
					</el-table-column>
					<el-table-column label="其他" class-name="colorheader1">
						<template #default="scope">
							<span v-if="scope.row.data">{{ getCountQt(scope.row.data,'管料成型') }}</span>
						</template>
					</el-table-column>
					<el-table-column label="备注" class-name="colorheader1">
							<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号抽检" class-name="colorheader2">
					<el-table-column label="抽检数量" class-name="colorheader2">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.十车间入库_count }}</span>
						</template>
					</el-table-column>
					<el-table-column label="合格数" class-name="colorheader2">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.十车间入库_抽检合格数 }}</span>
						</template>
					</el-table-column>
					<el-table-column label="合格率" class-name="colorheader2">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.十车间入库_抽检合格率 }}</span>
						</template>
					</el-table-column>
					<el-table-column label="不合格数" class-name="colorheader2">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.十车间入库_count_notok }}</span>
						</template>
					</el-table-column>
					<el-table-column label="椭圆/弯曲" class-name="colorheader2">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.十车间入库_count_n_wq }}</span>
						</template>
					</el-table-column>
					<el-table-column label="条纹" class-name="colorheader2">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.十车间入库_count_n_tw }}</span>
						</template>
					</el-table-column>
					<el-table-column label="断裂" class-name="colorheader2">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.十车间入库_count_n_dl }}</span>
						</template>
					</el-table-column>
					<el-table-column label="偏壁" class-name="colorheader2">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.十车间入库_count_n_pb }}</span>
						</template>
					</el-table-column>
					<el-table-column label="大小头" class-name="colorheader2">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.十车间入库_count_n_dxt }}</span>
						</template>
					</el-table-column>
					<el-table-column label="结石" class-name="colorheader2">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.十车间入库_count_n_js }}</span>
						</template>
					</el-table-column>
					<el-table-column label="气线" class-name="colorheader2">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.十车间入库_count_n_qx }}</span>
						</template>
					</el-table-column>
					<el-table-column label="其他" class-name="colorheader2">
						<template #default="scope">
							<span v-if="scope.row.data">{{getCountQt(scope.row.data,'十车间入库')}}</span>
						</template>
					</el-table-column>
					<el-table-column label="抽检人" class-name="colorheader2">
						<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" class-name="colorheader4">
					<el-table-column label="时间" width="160px" class-name="colorheader4">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.管料退火_日期 }}</span>
						</template>
					</el-table-column>
					<el-table-column label="退火数" class-name="colorheader4">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.管料退火_count_use }}</span>
						</template>
					</el-table-column>
					<el-table-column label="合格数" class-name="colorheader4">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.管料退火_count_ok }}</span>
						</template>
					</el-table-column>
					<el-table-column label="合格率" class-name="colorheader4">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.管料退火_合格率 }}</span>
						</template>
					</el-table-column>
					<el-table-column label="不合格数" class-name="colorheader4">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.管料退火_count_notok }}</span>
						</template>
					</el-table-column>
					<el-table-column label="箱中破" class-name="colorheader4">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.管料退火_count_n_xzp }}</span>
						</template>
					</el-table-column>
					<el-table-column label="退火后碎" class-name="colorheader4">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.管料退火_count_n_thhs }}</span>
						</template>
					</el-table-column>
					<el-table-column label="划伤" class-name="colorheader4">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.管料退火_count_n_hs }}</span>
						</template>
					</el-table-column>
					<el-table-column label="结石" class-name="colorheader4">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.管料退火_count_n_js }}</span>
						</template>
					</el-table-column>
					<el-table-column label="气线" class-name="colorheader4">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.管料退火_count_n_qx }}</span>
						</template>
					</el-table-column>
					<el-table-column label="其他" class-name="colorheader4">
						<template #default="scope">
							<span v-if="scope.row.data">{{getCountQt(scope.row.data,'管料退火')}}</span>
						</template>
					</el-table-column>
					<el-table-column label="退火人" class-name="colorheader4">
						<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" class-name="colorheader3">
					<el-table-column label="时间"  width="100px" class-name="colorheader3">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.十车间入库_日期 }}</span>
						</template>
					</el-table-column>
					<el-table-column label="入库数" class-name="colorheader3">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.十车间入库_count }}</span>
						</template>
					</el-table-column>
					<el-table-column label="合格数" class-name="colorheader3">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.十车间入库_count_ok }}</span>
						</template>
					</el-table-column>
					<el-table-column label="合格率" class-name="colorheader3">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.十车间入库_合格率 }}</span>
						</template>
					</el-table-column>
					<el-table-column label="不合格数" class-name="colorheader3">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.十车间入库_count_notok }}</span>
						</template>
					</el-table-column>
					<el-table-column label="椭圆/弯曲" class-name="colorheader3">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.十车间入库_count_n_wq }}</span>
						</template>
					</el-table-column>
					<el-table-column label="条纹" class-name="colorheader3">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.十车间入库_count_n_tw }}</span>
						</template>
					</el-table-column>
					<el-table-column label="断裂" class-name="colorheader3">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.十车间入库_count_n_dl }}</span>
						</template>
					</el-table-column>
					<el-table-column label="偏壁" class-name="colorheader3">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.十车间入库_count_n_pb }}</span>
						</template>
					</el-table-column>
					<el-table-column label="大小头" class-name="colorheader3">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.十车间入库_count_n_dxt }}</span>
						</template>
					</el-table-column>
					<el-table-column label="结石" class-name="colorheader3">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.十车间入库_count_n_js }}</span>
						</template>
					</el-table-column>
					<el-table-column label="气线" class-name="colorheader3">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.十车间入库_count_n_qx }}</span>
						</template>
					</el-table-column>
					<el-table-column label="其他" class-name="colorheader3">
						<template #default="scope">
							<span v-if="scope.row.data">{{getCountQt(scope.row.data,'十车间入库')}}</span>
						</template>
					</el-table-column>
					<el-table-column label="备注" class-name="colorheader3">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.十车间入库_检验备注 }}</span>
						</template>
					</el-table-column>
					<el-table-column label="接收人" class-name="colorheader3">
						<template #default="scope">{{ scope.row.data.十车间入库_备注 }}</template>
					</el-table-column>
				</el-table-column> -->
				<el-table-column label="6号车间" align="center" class-name="colorheader5">
					<el-table-column label="领料" align="center" class-name="colorheader5">
						<el-table-column label="领取时间" width="160px" class-name="colorheader5">
							<template #default="scope">
								<span v-if="scope.row.data">{{ scope.row.data.六车间领料_日期 }}</span>
							</template>
						</el-table-column>
						<el-table-column label="领取数" class-name="colorheader5">
							<template #default="scope">
								<span v-if="scope.row.data">{{ scope.row.data.六车间领料_count }}</span>
							</template>
						</el-table-column>
						<el-table-column label="交送人" class-name="colorheader5">
							<template #default="scope">
								<span v-if="scope.row.data">{{ scope.row.data.六车间领料_仓库执行人 }}</span>
							</template>
						</el-table-column>
						<el-table-column label="领取人" class-name="colorheader5">
							<template #default="scope">
								<span v-if="scope.row.data">{{ scope.row.data.六车间领料_车间执行人 }}</span>
							</template>
						</el-table-column>
						<el-table-column label="备注" class-name="colorheader5">
							<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" class-name="colorheader5">
						<el-table-column label="加工数" class-name="colorheader5">
							<template #default="scope">
								<span v-if="scope.row.data">{{ scope.row.data.六车间_开槽_count_real }}</span>
							</template>
						</el-table-column>
						<el-table-column label="合格率" class-name="colorheader5">
							<template #default="scope">
								<span v-if="scope.row.data">{{ scope.row.data.六车间_开槽_合格率 }}</span>
							</template>
						</el-table-column>
						<el-table-column label="不合格数" class-name="colorheader5">
							<template #default="scope">
								<span v-if="scope.row.data">{{ scope.row.data.六车间_开槽_count_notok }}</span>
							</template>
						</el-table-column>
						<el-table-column label="断裂" class-name="colorheader5">
							<template #default="scope">
								<span v-if="scope.row.data">{{ scope.row.data.六车间_开槽_count_n_dl }}</span>
							</template>
						</el-table-column>
						<el-table-column label="其他" class-name="colorheader5">
							<template #default="scope">
								<span v-if="scope.row.data">{{getCountQt(scope.row.data,'开槽')}}</span>
							</template>
						</el-table-column>
						<el-table-column label="加工日期"  min-width="160" class-name="colorheader5">
							<template #default="scope">
								<span v-if="scope.row.data">{{ scope.row.data.六车间_开槽_日期 }}</span>
							</template>
						</el-table-column>
						<el-table-column label="操作人" class-name="colorheader5">
							<template #default="scope">
								<span v-if="scope.row.data">{{ scope.row.data.六车间_开槽_操作人 }}</span>
							</template>
						</el-table-column>
						<el-table-column label="备注" class-name="colorheader5">
							<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" class-name="colorheader5">
						<el-table-column label="加工数" class-name="colorheader5">
							<template #default="scope">
								<span v-if="scope.row.data">{{ scope.row.data.六车间_倒角_count_real }}</span>
							</template>
						</el-table-column>
						<el-table-column label="合格率" class-name="colorheader5">
							<template #default="scope">
								<span v-if="scope.row.data">{{ scope.row.data.六车间_倒角_合格率 }}</span>
							</template>
						</el-table-column>
						<el-table-column label="不合格数" class-name="colorheader5">
							<template #default="scope">
								<span v-if="scope.row.data">{{ scope.row.data.六车间_倒角_count_notok }}</span>
							</template>
						</el-table-column>
						<el-table-column label="断裂" class-name="colorheader5">
							<template #default="scope">
								<span v-if="scope.row.data">{{ scope.row.data.六车间_倒角_count_n_dl }}</span>
							</template>
						</el-table-column>
						<el-table-column label="其他" class-name="colorheader5">
							<template #default="scope">
								<span v-if="scope.row.data">{{getCountQt(scope.row.data,'倒角')}}</span>
							</template>
						</el-table-column>
						<el-table-column label="加工日期"  min-width="160" class-name="colorheader5">
							<template #default="scope">
								<span v-if="scope.row.data">{{ scope.row.data.六车间_倒角_日期 }}</span>
							</template>
						</el-table-column>
						<el-table-column label="操作人" class-name="colorheader5">
							<template #default="scope">
								<span v-if="scope.row.data">{{ scope.row.data.六车间_倒角_操作人 }}</span>
							</template>
						</el-table-column>
						<el-table-column label="备注" class-name="colorheader5">
							<template #default="scope">
								<span v-if="scope.row.data">{{ scope.row.data.六车间_倒角_备注 }}</span>
							</template>
						</el-table-column>
					</el-table-column>
				</el-table-column>
				<!-- 六车间中检 -->
				<el-table-column label="检验" align="center" class-name="colorheader6">
					<el-table-column label="检验" class-name="colorheader6">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.六车间中检_count }}</span>
						</template>
					</el-table-column>
					<el-table-column label="合格率" class-name="colorheader6">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.六车间中检_合格率 }}</span>
						</template>
					</el-table-column>
					<el-table-column label="不合格数" class-name="colorheader6">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.六车间中检_count_notok }}</span>
						</template>
					</el-table-column>
					<el-table-column label="划伤" class-name="colorheader6">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.六车间中检_count_n_hs }}</span>
						</template>
					</el-table-column>
					<el-table-column label="杂质" class-name="colorheader6">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.六车间中检_count_n_zz }}</span>
						</template>
					</el-table-column>
					<el-table-column label="锥度大" class-name="colorheader6">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.六车间中检_count_n_zdd }}</span>
						</template>
					</el-table-column>
					<el-table-column label="炸纹" class-name="colorheader6">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.六车间中检_count_n_zw }}</span>
						</template>
					</el-table-column>
					<el-table-column label="气泡" class-name="colorheader6">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.六车间中检_count_n_qp }}</span>
						</template>
					</el-table-column>
					<el-table-column label="不亮" class-name="colorheader6">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.六车间中检_count_n_bl }}</span>
						</template>
					</el-table-column>
					<el-table-column label="横纹" class-name="colorheader6">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.六车间中检_count_n_hw }}</span>
						</template>
					</el-table-column>
					<el-table-column label="有皮" class-name="colorheader6">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.六车间中检_count_n_yp }}</span>
						</template>
					</el-table-column>
					<el-table-column label="其他" class-name="colorheader6">
						<template #default="scope">
							<span v-if="scope.row.data">{{getCountQt(scope.row.data,'六车间中检')}}</span>
						</template>
					</el-table-column>
					<el-table-column label="日期" class-name="colorheader6" min-width="160">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.六车间中检_日期 }}</span>
						</template>
					</el-table-column>
					<el-table-column label="操作人" class-name="colorheader6">
						<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" class-name="colorheader7">
					<el-table-column label="终检数" class-name="colorheader7">
						<template #default="scope">
							<span v-if="scope.row.data&&scope.row.data.销售发货_count&&scope.row.data.六车间生产入库_count_notok">{{ scope.row.data.销售发货_count + scope.row.data.六车间生产入库_count_notok }}</span>
						</template>
					</el-table-column>
					<el-table-column label="合格率" class-name="colorheader7">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.六车间生产入库_合格率 }}</span>
						</template>
					</el-table-column>
					<el-table-column label="不合格数" class-name="colorheader7">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.六车间生产入库_count_notok }}</span>
						</template>
					</el-table-column>
					<el-table-column label="划伤" class-name="colorheader7">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.六车间生产入库_count_n_hs }}</span>
						</template>
					</el-table-column>
					<el-table-column label="炸纹" class-name="colorheader7">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.六车间生产入库_count_n_zw }}</span>
						</template>
					</el-table-column>
					<el-table-column label="其他" class-name="colorheader7">
						<template #default="scope">
							<span v-if="scope.row.data">{{getCountQt(scope.row.data,'六车间生产入库')}}</span>
						</template>
					</el-table-column>
					<el-table-column label="日期" class-name="colorheader7" min-width="160">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.六车间生产入库_检验日期 }}</span>
						</template>
					</el-table-column>
					<el-table-column label="操作人" class-name="colorheader7">
						<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__startswith__in:'ZB2,B1',
			},
			query:{
				batch__contains:'',
				last_time__gte:'',
				last_time__lte:'',
				
			},
			apiObj: this.$API.wpm.batchst,
			options:[],
			tableData:[],
		};
	},
	methods: {
		handleQuery(){
			this.$refs.table.queryData(this.query);
		},
		getCountQt(data,type){
			let count_qt = 0,count = 0;
		    if(type=='管料成型'){
				if(data.管料成型_count_notok){
					if (data.管料成型_count_n_wq !== undefined) {
						count += data.管料成型_count_n_wq ;
					}
					if (data.管料成型_count_n_tw !== undefined) {
						count += data.管料成型_count_n_tw ;
					}
					if (data.管料成型_count_n_dl !== undefined) {
						count += data.管料成型_count_n_dl ;
					}
					if (data.管料成型_count_n_pb !== undefined) {
						count += data.管料成型_count_n_pb ;
					}
					if (data.管料成型_count_n_dxt !== undefined) {
						count += data.管料成型_count_n_dxt ;
					}
					if (data.管料成型_count_n_js !== undefined) {
						count += data.管料成型_count_n_js ;
					}
					if (data.管料成型_count_n_qx !== undefined) {
						count += data.管料成型_count_n_qx ;
					}
					count_qt = data.管料成型_count_notok - count;
					return count_qt;
				}
			}else if(type=='十车间入库'){
				if(data.十车间入库_count_notok){
					if (data.十车间入库_count_n_wq !== undefined) {
						count += data.十车间入库_count_n_wq ;
					}
					if (data.十车间入库_count_n_tw !== undefined) {
						count += data.十车间入库_count_n_tw ;
					}
					if (data.十车间入库_count_n_dl !== undefined) {
						count += data.十车间入库_count_n_dl ;
					}
					if (data.十车间入库_count_n_pb !== undefined) {
						count += data.十车间入库_count_n_pb ;
					}
					if (data.十车间入库_count_n_dxt !== undefined) {
						count += data.十车间入库_count_n_dxt ;
					}
					if (data.十车间入库_count_n_js !== undefined) {
						count += data.十车间入库_count_n_js ;
					}
					if (data.十车间入库_count_n_qx !== undefined) {
						count += data.十车间入库_count_n_qx ;
					}
					count_qt = data.十车间入库_count_notok - count;
					return count_qt;
				}
			}else if(type=='十车间入库'){
				if(data.十车间入库_count_notok){
					if (data.十车间入库_count_n_wq !== undefined) {
						count += data.十车间入库_count_n_wq ;
					}
					if (data.十车间入库_count_n_tw !== undefined) {
						count += data.十车间入库_count_n_tw ;
					}
					if (data.十车间入库_count_n_dl !== undefined) {
						count += data.十车间入库_count_n_dl ;
					}
					if (data.十车间入库_count_n_pb !== undefined) {
						count += data.十车间入库_count_n_pb ;
					}
					if (data.十车间入库_count_n_dxt !== undefined) {
						count += data.十车间入库_count_n_dxt ;
					}
					if (data.十车间入库_count_n_js !== undefined) {
						count += data.十车间入库_count_n_js ;
					}
					if (data.十车间入库_count_n_qx !== undefined) {
						count += data.十车间入库_count_n_qx ;
					}
					count_qt = data.十车间入库_count_notok - count;
					return count_qt;
				}
			}else if(type=='管料退火'){
				if(data.管料退火_count_notok){
					if (data.管料退火_count_n_xzp !== undefined) {
						count += data.管料退火_count_n_xzp ;
					}
					if (data.管料退火_count_n_thhs !== undefined) {
						count += data.管料退火_count_n_thhs ;
					}
					if (data.管料退火_count_n_hs !== undefined) {
						count += data.管料退火_count_n_hs ;
					}
					if (data.管料退火_count_n_js !== undefined) {
						count += data.管料退火_count_n_js ;
					}
					if (data.管料退火_count_n_qx !== undefined) {
						count += data.管料退火_count_n_qx ;
					}
					count_qt = data.管料退火_count_notok - count;
					return count_qt;
				}
			}else if(type=='开槽'){
				if(data.六车间_开槽_count_notok){
					if (data.六车间_开槽_count_n_dl !== undefined) {
						count += data.六车间_开槽_count_n_dl ;
					}
					count_qt = data.六车间_开槽_count_notok - count;
					return count_qt;
				}
			}else if(type=='倒角'){
				if(data.六车间_倒角_count_notok){
					if (data.六车间_倒角_count_n_dl !== undefined) {
						count += data.六车间_倒角_count_n_dl ;
					}
					count_qt = data.六车间_倒角_count_notok - count;
					return count_qt;
				}
			}else if(type=='六车间中检'){
				if(data.六车间中检_count_notok){
					if (data.六车间中检_count_n_hs !== undefined) {
						count += data.六车间中检_count_n_hs ;
					}
					if (data.六车间中检_count_n_zz !== undefined) {
						count += data.六车间中检_count_n_zz ;
					}
					if (data.六车间中检_count_n_zdd !== undefined) {
						count += data.六车间中检_count_n_zdd ;
					}
					if (data.六车间中检_count_n_zw !== undefined) {
						count += data.六车间中检_count_n_zw ;
					}
					if (data.六车间中检_count_n_qp !== undefined) {
						count += data.六车间中检_count_n_qp ;
					}
					if (data.六车间中检_count_n_bl !== undefined) {
						count += data.六车间中检_count_n_bl ;
					}
					if (data.六车间中检_count_n_hw !== undefined) {
						count += data.六车间中检_count_n_hw ;
					}
					if (data.六车间中检_count_n_yp !== undefined) {
						count += data.六车间中检_count_n_yp ;
					}
					count_qt = data.六车间中检_count_notok - count;
					return count_qt;
				}
			}else if(type=='六车间生产入库'){
				if(data.六车间生产入库_count_notok){
					if (data.六车间生产入库_count_n_hs !== undefined) {
						count += data.六车间生产入库_count_n_hs ;
					}
					if (data.六车间生产入库_count_n_zw !== undefined) {
						count += data.六车间生产入库_count_n_zw ;
					}
					count_qt = data.六车间生产入库_count_notok - count;
					return count_qt;
				}
			}
		}
	},
};
</script>

<style scoped>
</style>
