<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="params"
				id="exportDiv"
				stripe
				>
					<el-table-column label="产品编号" prop="batch" min-width="160">
					</el-table-column>
					<el-table-column label="7号车间生产" prop="7号车间生产" align="center" class-name="colorheader2">
						<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="实际重量/KG" class-name="colorheader2">
						</el-table-column>
						<el-table-column label="合格重量/KG" class-name="colorheader2">
						</el-table-column> -->
						<el-table-column label="应出数" class-name="colorheader2">
							<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="colorheader2">
							<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="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_n_zw }}</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_zt }}</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_qp }}</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_zz }}</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_b }}</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,'7车间') }}</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.棒料成型_备注 }}</span>
							</template>
						</el-table-column>
					</el-table-column>
					<el-table-column label="8号车间中检" prop="8号车间中检" align="center" class-name="colorheader3">
						<el-table-column label="时间" class-name="colorheader3" 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="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.七车间入库_count">{{ scope.row.data.七车间入库_count-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.七车间入库_合格率 }}</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_zw }}</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_zt }}</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_qp }}</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_b }}</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,'8车间') }}</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.七车间入库_仓库执行人 }}</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>
					<el-table-column label="6号车间加工" prop="6号车间加工" align="center" class-name="colorheader4">
						<el-table-column label="领棒日期" class-name="colorheader4" 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="colorheader4">
							<template #default="scope">
								<span v-if="scope.row.data">{{ scope.row.data.六车间领料_count }}</span>
							</template>
						</el-table-column>
						<!-- 平头 -->
						<el-table-column label="平头" class-name="colorheader4">
							<el-table-column label="接收数" class-name="colorheader4">
								<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="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.六车间_平头_合格率 }}</span>
								</template>
							</el-table-column>
							
							<el-table-column label="加工日期" class-name="colorheader4" 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="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="粘头" class-name="colorheader4">
							<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.六车间_粘铁头_合格率 }}</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" 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="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="粗中细" class-name="colorheader4">
							<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.六车间_粗中细磨_合格率 }}</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_d }}</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_w }}</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_yp }}</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_dl }}</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" 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="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="抛光" class-name="colorheader4">
							<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_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.六车间_抛光_合格率 }}</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_dl }}</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_qp }}</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" 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="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="开槽" class-name="colorheader4">
							<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_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.六车间_开槽_合格率 }}</span>
								</template>
							</el-table-column>
							<el-table-column label="加工日期" class-name="colorheader4" 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="colorheader4">
								<template #default="scope">
									<span v-if="scope.row.data">{{ scope.row.data.六车间_开槽_操作人 }}</span>
								</template>
							</el-table-column>
						</el-table-column>
						<!-- 6车间自己的检验 -->
						<el-table-column label="检测" class-name="colorheader4">
							<el-table-column label="接收数" class-name="colorheader4">
								<template #default="scope">
									<span v-if="scope.row.data">{{ scope.row.data.六车间中检_count }}</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_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_zw }}</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_zdd }}</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_qp }}</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_bl }}</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" 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="colorheader4">
								<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="colorheader5">
						<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.六车间生产入库_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_yp }}</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_d }}</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_hs }}</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_zw }}</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="日期" class-name="colorheader5" 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="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="发货检验数" 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="6号领取加工-发货合格率" class-name="colorheader6">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.六车间_批次发货合格率 }}</span>
						</template>
					</el-table-column>
					<el-table-column label="7号生产-发货合格率" class-name="colorheader7">
						<template #default="scope">
							<span v-if="scope.row.data">{{ scope.row.data.七车间_批次发货合格率 }}</span>
						</template>
					</el-table-column>
				</scTable>
		</el-main>
	</el-container>
</template>

<script>
function deepCopy(obj) {
	return JSON.parse(JSON.stringify(obj));
}
export default {
	name: "chart",
	data() {
		return {
			params: {
				ordering:'-data__棒料成型_小日期',
				querys : [[{field:"data__has_key",compare:"",value:"棒料成型_日期"}]]
			},
			query:{
				batch__contains:'',
				last_time__gte:'',
				last_time__lte:'',
			},
			apiObj: this.$API.wpm.batchstquery,
			options:[],
			tableData:[],
		};
	},
	methods: {
		handleQuery(){
			let that = this;
			let querys = [[{field:"data__has_key",compare:"",value:"棒料成型_日期"}],];
			let obj = {},obj1 = {},obj2 = {};
			obj.field = 'batch__contains';
			obj.value = that.query.batch__contains;
			obj.compare = '';
			obj1.field = 'last_time';
			obj1.value = that.query.last_time__gte;
			obj1.compare = 'gte';
			obj2.field = 'last_time';
			obj2.value = that.query.last_time__lte;
			obj2.compare = 'lte';
			if(that.query.batch__contains!==''&&that.query.batch__contains!==null){
				querys[0].push(obj);
			}
			if(that.query.last_time__gte!==''&&that.query.last_time__gte!==null){
				querys[0].push(obj1);
			}
			if(that.query.last_time__lte!==''&&that.query.last_time__lte!==null){
				querys[0].push(obj2);
			}
			let params = {};
			params.querys = querys;
			this.$refs.table.queryData(params);
		},
		getCountQt(data,type){
			let count_qt = 0,count = 0;
		    if(type=='7车间'){
				if(data.棒料成型_count_notok){
					if (data.棒料成型_count_n_zw !== undefined) {
						count += data.棒料成型_count_n_zw ;
					}
					if (data.棒料成型_count_n_zt !== undefined) {
						count += data.棒料成型_count_n_zt ;
					}
					if (data.棒料成型_count_n_tw !== undefined) {
						count += data.棒料成型_count_n_tw ;
					}
					if (data.棒料成型_count_n_qp !== undefined) {
						count += data.棒料成型_count_n_qp ;
					}
					if (data.棒料成型_count_n_zz !== undefined) {
						count += data.棒料成型_count_n_zz ;
					}
					if (data.棒料成型_count_n_b !== undefined) {
						count += data.棒料成型_count_n_b ;
					}
					count_qt = data.棒料成型_count_notok - count;
					return count_qt;
				}
			}else if(type=='8车间'){
				if(data.七车间入库_count_notok){
					if (data.七车间入库_count_n_zw !== undefined) {
						count += data.七车间入库_count_n_zw ;
					}
					if (data.七车间入库_count_n_zt !== undefined) {
						count += data.七车间入库_count_n_zt ;
					}
					if (data.七车间入库_count_n_tw !== undefined) {
						count += data.七车间入库_count_n_tw ;
					}
					if (data.七车间入库_count_n_qp !== undefined) {
						count += data.七车间入库_count_n_qp ;
					}
					if (data.七车间入库_count_n_b !== undefined) {
						count += data.七车间入库_count_n_b ;
					}
					count_qt = data.七车间入库_count_notok - count;
					return count_qt;
				}
			}else if(type=='粗中细磨'){
				if(data.六车间_粗中细磨_count_notok){
					if (data.六车间_粗中细磨_count_n_d !== undefined) {
						count += data.六车间_粗中细磨_count_n_d ;
					}
					if (data.六车间_粗中细磨_count_n_w !== undefined) {
						count += data.六车间_粗中细磨_count_n_w ;
					}
					if (data.六车间_粗中细磨_count_n_yp !== undefined) {
						count += data.六车间_粗中细磨_count_n_yp ;
					}
					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_dl !== undefined) {
						count += data.六车间_抛光_count_n_dl ;
					}
					if (data.六车间_抛光_count_n_qp !== undefined) {
						count += data.六车间_抛光_count_n_qp ;
					}
					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 ;
					}
					if (data.六车间中检_count_n_zdd !== undefined) {
						count += data.六车间中检_count_n_zdd ;
					}
					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_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_yp !== undefined) {
						count += data.六车间生产入库_count_n_yp ;
					}
					if (data.六车间生产入库_count_n_d !== undefined) {
						count += data.六车间生产入库_count_n_d ;
					}
					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>

