<template>
	<view>
		<view class="card" v-for="(item,index) in list" :key="index" @tap="firstInspectionInfo(item.plan_id,item)">
			<view class="card-left">
				<view class="card-up-list">
					<view class="card-up-list-list">
						<view>物料名称:</view><text>{{item.product_name}}</text>
					</view>
					<view class="card-right">
						<image class="glass-cion" v-if="item.check==0" src="../../static/search.png"></image>
						<image class="sh-cion" v-if="item.check==1" src="../../static/dsh.png"></image>
						<image class="sh-cion" v-if="item.check==2" src="../../static/ysh.png"></image>
					</view>
				</view>
				<view class="card-up-list">
					<view class="card-up-list-list">
						<view>物料编号:</view><text>{{item.product_number}}</text>
					</view>
				</view>
				<view class="card-up-list">
					<view class="card-up-list-list">
						<view>生产日期:</view><text>{{item.production}}{{item.week}}</text>
					</view>
				</view>
				<view class="card-dow-list">
					<view class="card-up-list-list">
						<view>班次:</view>
						<text v-if="item.frequency==0">夜班</text>
						<text v-if="item.frequency==1">白班</text>
					</view>
					<view class="card-up-list-list">
						<view>产线:</view><text>{{item.line_title}}</text>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		firstCheckLists
	} from "../../api/user.js";
	export default {
		onLoad() {
			this.bindData();
		},
		data() {
			return {
				list: []
			};
		},
		methods: {
			bindData() {
				firstCheckLists({type:4}).then(res => {
					this.list = res;
				})
			},
			firstInspectionInfo(plan_id,item) {
				console.log("id",plan_id)
				uni.navigateTo({
					url: `../hardwareList/hardwareList?plan_id=${plan_id}&planInfo=${encodeURIComponent(JSON.stringify(item))}`,
					success: res => {},
					fail: () => {},
					complete: () => {}
				});
			}
		}
	}
</script>

<style lang="scss">
	@import "./index.scss";
</style>
