<template>
	<el-container>
		<el-header>
			<div class="right-panel">
				<!-- <el-input v-model="query.name__contains" 
					placeholder="产品名称" 
					clearable 
					style="width: 200px;"
				></el-input> -->
				<el-input v-model="query.batch__contains" 
					placeholder="批次号" 
					clearable 
					style="width: 200px;"
				></el-input>
				<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 type="index" width="50"  fixed="left"/>
				<el-table-column label="批次号" fixed="left">
					<template #default="scope">
						<span>{{ scope.row.data.成品外观内置初检_批次号 }}</span>
					</template>
				</el-table-column>
				<el-table-column label="板号" prop="number" fixed="left">
				</el-table-column>
				<el-table-column label="毛坯长点" align="center" class-name="colorheader1">
					<template #default="scope">
						<span>{{ scope.row.data.成品外观内置初检_缺陷项_毛坯长点?scope.row.data.成品外观内置初检_缺陷项_毛坯长点:0 }}</span>
					</template>
				</el-table-column>
				<el-table-column label="毛坯点多" align="center" class-name="colorheader2">
					<template #default="scope">
						<span>{{ scope.row.data.成品外观内置初检_缺陷项_毛坯点多?scope.row.data.成品外观内置初检_缺陷项_毛坯点多:0 }}</span>
					</template>
				</el-table-column>
				<el-table-column label="扭后点" align="center" class-name="colorheader3">
					<template #default="scope">
						<span>{{ scope.row.data.成品外观内置初检_缺陷项_扭后点?scope.row.data.成品外观内置初检_缺陷项_扭后点:0 }}</span>
					</template>
				</el-table-column>
				<el-table-column label="黑网" align="center" class-name="colorheader4">
					<template #default="scope">
						<span>{{ scope.row.data.成品外观内置初检_缺陷项_黑网?scope.row.data.成品外观内置初检_缺陷项_黑网:0 }}</span>
					</template>
				</el-table-column>
				<el-table-column label="白网" align="center" class-name="colorheader5">
					<template #default="scope">
						<span>{{ scope.row.data.成品外观内置初检_缺陷项_白网?scope.row.data.成品外观内置初检_缺陷项_白网:0 }}</span>
					</template>
				</el-table-column>
				<el-table-column label="小网" align="center" class-name="colorheader6">
					<template #default="scope">
						<span>{{ scope.row.data.成品外观内置初检_缺陷项_小网?scope.row.data.成品外观内置初检_缺陷项_小网:0 }}</span>
					</template>
				</el-table-column>	
				<el-table-column label="花丝" align="center" class-name="colorheader7">
					<template #default="scope">
						<span>{{ scope.row.data.成品外观内置初检_缺陷项_花丝?scope.row.data.成品外观内置初检_缺陷项_花丝:0 }}</span>
					</template>
				</el-table-column>
				<el-table-column label="花朵" align="center" class-name="colorheader1">
					<template #default="scope">
						<span>{{ scope.row.data.成品外观内置初检_缺陷项_花朵?scope.row.data.成品外观内置初检_缺陷项_花朵:0 }}</span>
					</template>
				</el-table-column>
				<el-table-column label="六角" align="center" class-name="colorheader2">
					<template #default="scope">
						<span>{{ scope.row.data.成品外观内置初检_缺陷项_六角?scope.row.data.成品外观内置初检_缺陷项_六角:0 }}</span>
					</template>
				</el-table-column>
				<el-table-column label="六角白点" align="center" class-name="colorheader3">
					<template #default="scope">
						<span>{{ scope.row.data.成品外观内置初检_缺陷项_六角白点?scope.row.data.成品外观内置初检_缺陷项_六角白点:0 }}</span>
					</template>
				</el-table-column>
				<el-table-column label="六角黑点" align="center" class-name="colorheader4">
					<template #default="scope">
						<span>{{ scope.row.data.成品外观内置初检_缺陷项_六角黑点?scope.row.data.成品外观内置初检_缺陷项_六角黑点:0 }}</span>
					</template>
				</el-table-column>
				<el-table-column label="复丝结构" align="center" class-name="colorheader5">
					<template #default="scope">
						<span>{{ scope.row.data.成品外观内置初检_缺陷项_复丝结构?scope.row.data.成品外观内置初检_缺陷项_复丝结构:0 }}</span>
					</template>
				</el-table-column>
				<el-table-column label="炫光" align="center" class-name="colorheader6">
					<template #default="scope">
						<span>{{ scope.row.data.成品外观内置初检_缺陷项_炫光?scope.row.data.成品外观内置初检_缺陷项_炫光:0 }}</span>
					</template>
				</el-table-column>
				<el-table-column label="包边丝" align="center" class-name="colorheader7">
					<template #default="scope">
						<span>{{ scope.row.data.成品外观内置初检_缺陷项_包边丝?scope.row.data.成品外观内置初检_缺陷项_包边丝:0 }}</span>
					</template>
				</el-table-column>
				<el-table-column label="畸变" align="center" class-name="colorheader1">
					<template #default="scope">
						<span>{{ scope.row.data.成品外观内置初检_缺陷项_畸变?scope.row.data.成品外观内置初检_缺陷项_畸变:0 }}</span>
					</template>
				</el-table-column>
				<el-table-column label="炸废" align="center" class-name="colorheader2">
					<template #default="scope">
						<span>{{ scope.row.data.成品外观内置初检_缺陷项_炸废?scope.row.data.成品外观内置初检_缺陷项_炸废:0 }}</span>
					</template>
				</el-table-column>
				<el-table-column label="偏心" align="center" class-name="colorheader3">
					<template #default="scope">
						<span>{{ scope.row.data.成品外观内置初检_缺陷项_偏心?scope.row.data.成品外观内置初检_缺陷项_偏心:0 }}</span>
					</template>
				</el-table-column>
				<el-table-column label="划伤" align="center" class-name="colorheader4">
					<template #default="scope">
						<span>{{ scope.row.data.成品外观内置初检_缺陷项_偏心?scope.row.data.成品外观内置初检_缺陷项_偏心:0 }}</span>
					</template>
				</el-table-column>
				<el-table-column label="腐蚀" align="center" class-name="colorheader5">
					<template #default="scope">
						<span>{{ scope.row.data.成品外观内置初检_缺陷项_腐蚀?scope.row.data.成品外观内置初检_缺陷项_腐蚀:0 }}</span>
					</template>
				</el-table-column>
				<el-table-column label="崩边" align="center" class-name="colorheader6">
					<template #default="scope">
						<span>{{ scope.row.data.成品外观内置初检_缺陷项_崩边?scope.row.data.成品外观内置初检_缺陷项_崩边:0 }}</span>
					</template>
				</el-table-column>
				<el-table-column label="纹路" align="center" class-name="colorheader7">
					<template #default="scope">
						<span>{{ scope.row.data.成品外观内置初检_缺陷项_纹路?scope.row.data.成品外观内置初检_缺陷项_纹路:0 }}</span>
					</template>
				</el-table-column>
				<el-table-column label="平台" align="center" class-name="colorheader1">
					<template #default="scope">
						<span>{{ scope.row.data.成品外观内置初检_缺陷项_平台?scope.row.data.成品外观内置初检_缺陷项_平台:0 }}</span>
					</template>
				</el-table-column>
				<el-table-column label="硌/坑" align="center" class-name="colorheader2">
					<template #default="scope">
						<span>{{ scope.row.data['成品外观内置初检_缺陷项_硌/坑']?scope.row.data['成品外观内置初检_缺陷项_硌/坑']:0 }}</span>
					</template>
				</el-table-column>
				<el-table-column label="麻点" align="center" class-name="colorheader3">
					<template #default="scope">
						<span>{{ scope.row.data.成品外观内置初检_缺陷项_麻点?scope.row.data.成品外观内置初检_缺陷项_麻点:0 }}</span>
					</template>
				</el-table-column>
				<el-table-column label="台阶" align="center" class-name="colorheader4">
					<template #default="scope">
						<span>{{ scope.row.data.成品外观内置初检_缺陷项_台阶?scope.row.data.成品外观内置初检_缺陷项_台阶:0 }}</span>
					</template>
				</el-table-column>
				<el-table-column label="柱面" align="center" class-name="colorheader5">
					<template #default="scope">
						<span>{{ scope.row.data.成品外观内置初检_缺陷项_柱面?scope.row.data.成品外观内置初检_缺陷项_柱面:0 }}</span>
					</template>
				</el-table-column>
				<el-table-column label="污染" align="center" class-name="colorheader6">
					<template #default="scope">
						<span>{{ scope.row.data.成品外观内置初检_缺陷项_污染?scope.row.data.成品外观内置初检_缺陷项_污染:0 }}</span>
					</template>
				</el-table-column>
				<el-table-column label="粗糙度" align="center" class-name="colorheader7">
					<template #default="scope">
						<span>{{ scope.row.data.成品外观内置初检_缺陷项_粗糙度?scope.row.data.成品外观内置初检_缺陷项_粗糙度:0 }}</span>
					</template>
				</el-table-column>
				<el-table-column label="水印" align="center" class-name="colorheader1">
					<template #default="scope">
						<span>{{ scope.row.data.成品外观内置初检_缺陷项_水印?scope.row.data.成品外观内置初检_缺陷项_水印:0 }}</span>
					</template>
				</el-table-column>	
				<el-table-column label="角偏" align="center" class-name="colorheader2">
					<template #default="scope">
						<span>{{ scope.row.data.成品外观内置初检_缺陷项_角偏?scope.row.data.成品外观内置初检_缺陷项_角偏:0 }}</span>
					</template>
				</el-table-column>
				<el-table-column label="备注" align="center" class-name="colorheader3">
					<template #default="scope">
						<span>{{ scope.row.data.成品外观内置初检_缺陷项_备注 }}</span>
					</template>
				</el-table-column>
			</scTable>
		</el-main>
	</el-container>
</template>

<script>
export default {
	name: "statistics_guan",
	data() {
		return {
			params: {
				ordering:'data__成品内外初检_批次号',
				querys:[[{field:"wm",value:0,compare:"isnull"},{field:"data__has_key",compare:"",value:"成品内外初检_批次号"}]],
			},
			query:{
				name__contains:'',
				batch__contains:'',
				last_time__gte:'',
				last_time__lte:'',
			},
			apiObj: this.$API.wpm.wpr.query,
			options:[],
			tableData:[],
		};
	},
	methods: {
		handleQuery(){
			let that = this;
			let querys = [[{field:"wm",value:0,compare:"isnull"},{field:"data__has_key",compare:"",value:"成品内外初检_批次号"}]];
			let obj = {},obj1 = {},obj2 = {},obj3 = {};
			obj.field = 'data__成品内外初检_批次号';
			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';

			obj3.field = 'data__成品内外初检_物料名';
			obj3.value = that.query.name__contains;
			obj3.compare = '';


			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);
			}
			if(that.query.name__contains!==''&&that.query.name__contains!==null){
				querys[0].push(obj3);
			}
			that.params.querys = querys;
			this.$refs.table.queryData(that.params);
		},
		getCountQt(data,type){
			let count_qt = 0,count = 0;
		   
		}
	},
};
</script>

<style scoped>
</style>
