<template>
	<view>
		<view class="">
			<view class="search">
				<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>
			<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: 'partner',
						label: '客户/供应商',
						align: 'center',
						width:'180'
					},
					{
						name: 'product',
						label: '物料',
						align: 'center'
					},
					{
						name: 'number',
						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/partner/appointment',
					method: "POST",
					data: {
						partner:that.partner,
					},
					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;
		width: 100%;
	}
	.li{
		width: 100%;
		padding: 10rpx 10rpx;
	}
</style>