<template>
	<view>
		<view class="">
			<view class="search">
				<view class="li">
					<u-search id="search" placeholder="车牌号" v-model="plate_number" @search="getlist"
						:show-action="false" @clear="getlist" :clearabled="false" shape="square"
						></u-search>
				</view>
				<view class="li">
					<u-search id="search" placeholder="客户/供应商" v-model="partner" @search="getlist"
						:show-action="false" @clear="getlist" :clearabled="false" shape="square"
						></u-search>
				</view>
				<view class="li">
					<u-search id="search" placeholder="物料" v-model="product" @search="getlist"
						:show-action="false" @clear="getlist" :clearabled="false" shape="square"
						></u-search>
				</view>
			</view>
			<view class="list" :style="[{height:(pageHeight-60)+'px'}]">
				<zb-table :show-header="true" :columns="column" :stripe="true" :fit="false" :border="true"
					:data="List" :height="(pageHeight-60)+'px'"></zb-table>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		mapGetters,
		mapActions
	} from 'vuex'
	export default {
		data() {
			return {
				column: [{
						name: 'plate_number',
						label: '车牌号',
						fixed: true,
						align: 'center'
					}, {
						name: 'product',
						label: '物料',
						align: 'center'
					},
					{
						name: 'partner',
						label: '客户/供应商',
						align: 'center'
					},
					{
						name: 'link_name',
						label: '当前节点',
						align: 'center'
					},
					{
						name: 'link_time',
						label: '节点执行时长',
						align: 'center'
					}
				],
				List:[],
				partner:'',
				product:'',
				plate_number:''
			}
		},
		onLoad(option) {
			this.getlist()
		},
		computed: {
			...mapGetters(['screenHeight', 'customTabBarHeight', 'naviStatusHeight']),
			pageHeight() {
				return this.screenHeight - this.naviStatusHeight
			},
		},
		methods: {
			getlist(){
				let that=this
				uni.showLoading({
					
				})
				wx.request({
					url: 'http://ykykt.newerp.rokedata.com/ykt/in/appointment',
					method: "POST",
					data: {
						partner:that.partner,
						product:that.product,
						plate_number:that.plate_number
					},
					success(res) {
						console.log('appointment_state', res)
						if (res.data.result.state=='success') {
							that.List=res.data.result.data
							uni.hideLoading()
						} else {
							uni.hideLoading()
							wx.showModal({
								title: '提示',
								content: res.data.result.msg,
								showCancel: false
							})
						}
					}
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.search{
		background-color: #fff;
		display: flex;
	}
	.li{
		padding: 10rpx 10rpx;
	}
</style>