<template>
	<view>
		<view class='wrap'>
			<view class='title'>基本信息</view>
			<view class="c-row b-b">
				<view class="title">仓库</view>
				<view class="con-list">
					{{gridList.warehouseName}}
				</view>
			</view>
			<view class="c-row b-b">
				<view class="title">编号</view>
				<view class="con-list">
					{{gridList.qualityNo}}
				</view>
			</view>
			<view class="c-row b-b">
				<view class="title">客户</view>
				<view class="con-list">
					{{gridList.customerName}}({{gridList.customerPhone}})
				</view>
			</view>
			<view class="c-row b-b">
				<view class="title">车牌号</view>
				<view class="con-list">
					<input v-model='gridList.carNumber' placeholder="请输入车牌号"
						placeholder-style="font-size: 12px;" name="input"></input>
				</view>
			</view>
			<view class="c-row b-b">
				<view class="title">货名</view>
				<view class="con-list">
					<input v-model='gridList.goodsName' placeholder="请输入货名，如玉米"
						placeholder-style="font-size: 12px;" disabled name="input"></input>
				</view>
			</view>
		</view>
		
	</view>
</template>

<script>
	import dragButton from "@/components/drag-button/drag-button.vue";
	import {
		mapState
	} from 'vuex';
	let startY = 0,
		moveY = 0,
		pageAtTop = true;
	export default {
		components: {
			dragButton
		},
		data() {
			return {
				inputShow: false,
				modalName: '',
				mycarStyle: '',
				feild: undefined,
				id:0,
				inputContent: '',
				coverTransform: 'translateY(0px)',
				coverTransition: '0s',
				moving: false,
				footprintList: [],
				searchKeyWord:'',
				isVip: false,
				userInfoTmp: [],
				inputStatus: 'none',
				carInfo: [],
				gridCol: 4,
				pageSize:10,
				currentPage:1,
				gridBorder: false,
				headUrl:"../../static/img/myimg/YongHu@3x.png",
				userphone:"",
				username:"请更改昵称",
				gridList: {},
				managementType:'',
				warehouseName: '',
				showTran: true,
				companyId: 1,
				current: 4
			}
		},
		
		onLoad() {
			
		},
		// #ifndef MP
		onNavigationBarButtonTap(e) {
			const index = e.index;
			if (index === 0) {
				this.navTo('/pages/set/set');
			} else if (index === 1) {
				// #ifdef APP-PLUS
				const pages = getCurrentPages();
				const page = pages[pages.length - 1];
				const currentWebview = page.$getAppWebview();
				currentWebview.hideTitleNViewButtonRedDot({
					index
				});
				// #endif
				uni.navigateTo({
					url: '/pages/notice/notice'
				})
			}
		},
		// #endif
		computed: {
			...mapState(['hasLogin', 'userInfo']),
			// 手机号中间4位加*
			starUserphone(){
				let reg = /^(\d{3})\d{4}(\d{4})$/;
				if(this.userphone){
					return this.userphone.replace(reg, "$1****$2");
				}
			}
		},
		onLoad(options){
			console.log(options)
			this.id=options.id
		},
		onShow() {
			var that = this
				this.$api.doRequest('get', '/qualityInspectionManagement/api/getQualityInspection',{
					id:this.id
				}).then(res => {
					if(res.data.data){
						let data = res.data.data
						that.gridList =data
					}
				})
		},
		methods: {
			del(item){
				this.$api.doRequest('get', '/qualityInspectionManagement/api/deleteQualityInspection',{
					id:item.id
				}).then(res => {
					if(res.data.code==200){
						this.$api.msg('删除成功')
					}else{
						this.$api.msg('系统异常，请联系管理员')
					}
				})
			},
			fankui(){
				uni.navigateTo({
					url: `/pages/user/fankui`
				})
			},
			zhibo() {
				uni.navigateTo({
					url: `/pageB/video/broadcast`
				})
			},
			look() {
				uni.navigateTo({
					url: `/pageB/video/look`
				})
			},
			contactUs() {
				const that = this
				uni.makePhoneCall({
					// 手机号
					phoneNumber: '18241771147',
					// 成功回调
					success: (res) => {},
					// 失败回调
					fail: (res) => {}
				});
			},
			loadData() {
				// const that = this
				// if(uni.getStorageSync("PageCur")){
				// 	that.PageCur = uni.getStorageSync("PageCur");
				// }
				// that.userInfoTmp = uni.getStorageSync("userInfo")
				// uni.showLoading({
				// 	title: '正在加载',
				// 	mask:true
				// })
				// that.$api.request('integral', 'getIndexData', failres => {
				// 	that.$api.msg(failres.errmsg)
				// 	uni.hideLoading()
				// }).then(res => {
				// 	let data = res.data
				// 	uni.setStorageSync("message", data.message);
				// 	uni.setStorageSync("task", data.task);
				// 	uni.setStorageSync("contract", data.contract);
				// 	uni.setStorageSync('showTran', data.showTran);
				// 	that.showTran = data.showTran
				// 	that.gridList[4].tips = data.task
				// 	that.gridList[2].tips = data.contract
				// 	that.companyId = data.companyId
				// 	uni.hideLoading()
				// })
			},

			confirm() {
				const that = this
				if (!that.inputContent) {
					that.$api.msg('输入不能为空')
					return
				}
				let obj = {}
				obj[that.feild] = that.inputContent
				that.$api.request('user', 'syncUserInfo', obj).then(res => {
					that.userInfo.nickname = that.inputContent
					that.inputContent = ''
					that.$store.commit('login', that.userInfo)
				})
			},
			cancel() {
				this.inputShow = false
				this.inputStatus = 'none'
				this.genderShow = false
			},
			myAccount() {
				uni.navigateTo({
					url: `/pageA/pages/contract`
				})
			},
			/**
			 * 统一跳转接口,拦截未登录路由
			 * navigator标签现在默认没有转场动画，所以用view
			 */
			navTo(url) {
				if (!this.hasLogin) {
					url = '/pages/public/login';
				}
				uni.navigateTo({
					url
				})
			},
			mycarClick(carNo) {
				this.modalName = null
				uni.navigateTo({
					url: `/pageB/car/mycar_detail?carNo=${carNo}`
				})
			},
			scanCode() {
				uni.scanCode({
					success: function(res) {
						uni.navigateTo({
							url: res.result
						})
					}
				})
			},
			hideModal(e) {
				this.modalName = null
			},
		}
	}
</script>
<style lang='scss' scoped>
	page{
		background:#F5F6FA;
	}
	.c-row {
		display: -webkit-box;
		display: -webkit-flex;
		display: flex;
		-webkit-box-align: center;
		-webkit-align-items: center;
		align-items: center;
		padding: 10rpx 30rpx;
		position: relative;
	
		.title {
			/* color: #9698A2; */
		}
	
		.title-black {
			color: #333;
		}
	}
	
	.con-list {
		-webkit-box-flex: 1;
		-webkit-flex: 1;
		flex: 1;
		display: -webkit-box;
		display: -webkit-flex;
		display: flex;
		-webkit-box-orient: vertical;
		-webkit-box-direction: normal;
		-webkit-flex-direction: column;
		flex-direction: column;
		color: #303133;
		line-height: 40rpx;
		text-align: right;
		padding-right: 20rpx;
		font-size: 12px;
	}
	.wrap{
		background:#fff;margin:10px;border-radius:10px;
		>.title{
			padding:10px 16px;
		}
		.b-b:after{
			border-bottom:1px solid #eee;
		}
	}
</style>


