<!-- 回收申请-->
<template>
    <view id="register">
		<view class="register_li">
			<view class="register_li_min">
				<view></view>
				<view>实验地点：</view>
				<input v-model="form.bottleStorage.location" disabled type="text" >
			</view>
			<view class="register_li_min">
			    <view></view>
				<view>联系人：</view>
				<input v-model="form.bottleStorage.refuseName" disabled  type="text" >
			</view>
			<view class="register_li_min">
			    <view></view>
				<view>联系方式：</view>
				<input v-model="form.bottleStorage.refusePhonen" disabled  type="text" >
			</view>
			<view  class="register_li_min">
				<view></view>
				<view>运输人员：</view>
				<input v-model="form.bottleStorage.driverName" disabled  type="text" >
			</view>
			<view  class="register_li_min">
				<view></view>
				<view>拒收发起时间：</view>
				<input v-model="form.bottleStorage.rejectionApplyTime" disabled  type="text" >
			</view>
			<view v-if="pageType==1" class="register_li_min">
				<view></view>
				<view>同意拒收时间：</view>
				<input v-model="form.bottleStorage.rejectionApplyTime" disabled  type="text" >
			</view>
			<view  class="register_li_min">
				<view></view>
				<view>问题描述：</view>
				<input v-model="form.bottleStorage.rejectionApplyRemark" disabled  type="text" >
			</view>
			<view  class="issue_li" style="border-bottom:0;" @click="lookItem(form.bottleStorage.rejectionApplyImg)">
				<view></view>
				<view>问题照片：</view>
				<view class="issue_img">
					<img v-for="(item,index) in form.bottleStorage.rejectionApplyImg.split(',')"  :src="baseUrl+item">
				</view>
			</view>
		</view>
		<view class="register_li" v-if="listType==0">
			<view class="register_li_min">
				<view></view>
				<view>{{specificationName.airName}}-{{specificationName.configName}}：</view>
				<input v-model="'数量：'+form.detailList.bottleNumber" disabled  type="text" >
			</view>
		</view>
		<view v-if="pageType==0" class="sub_btn" @click="submitForm()">同意拒收</view>
	</view>
</template>

<script>
    import {supplierBacklogDetail,
			supplierBacklogRecycleDetail,
			supplierBacklogIssueDetail,
			supplierBacklogPersonCar,
			supplierBacklogRejection,
			} from '@/api/apiDemo/index.js'
	import { config } from '@/api/request/config.js'
    export default {
        data() {
            return {
				baseUrl:config.base_url,
				pageType:0,//0待处理1已处理
				form:{

				},
				id:'',
				status:'',//gq hs wt
				personList:[],
				personListArr:[],
				carList:[],
				carListArr:[],
				editForm:{
					id:'',
					remark:'2',
				},//配送
				specificationName:{},//回收
            }
        },
       onLoad(option) {
			this.id=JSON.parse(decodeURIComponent(option.item)).id;
			this.pageType=option.status;
       },
        onShow(){
        },
		mounted() {
			this.getInfo();
		},
        methods: {
			lookItem(item){
				let arr=item.split(',')
				let arr2=[]
				arr.forEach(function(item2){
					arr2.push(config.base_url+item2)
				})
				//查看图片
				wx.previewImage({
					urls: arr2, //需要预览的图片http链接列表，多张的时候，url直接写在后面就行了
					current: '', // 当前显示图片的http链接，默认是第一个
					success: function(res) {},
					fail: function(res) {},
					complete: function(res) {},
				})
			},
			//获取详情
			async getInfo(){
			    let _this = this;
				const {data} = await supplierBacklogIssueDetail({id:this.id})
				if(data.code==200){
					let res=data.data
					_this.form=res;
					_this.specificationName=JSON.parse(res.detailList.applyDescribe)
				}
			},
			//同意拒收
			async submitForm(){
				let _this = this;
				_this.editForm.id=_this.id;
				const {data} = await supplierBacklogRejection(_this.editForm);
				if(data.code == 200){
				    uni.showToast({
				        title: '提交成功',
				        icon:"none",
				        mask:true,
				        duration: 2000
				    });
				   setTimeout(function(){
				       uni.redirectTo({
				            url: '/pages_supplier/gasRecycle/gasRecycle'
				        });
				    },2000);
				}

			},
        }
    }
</script>

<style lang="stylus" scoped>
    #register{
        height:auto;
        width:100%;
        display flex;
        flex-direction column;
		padding-bottom: 220rpx;
		.register_li{
			background #fff;
			border-radius:20rpx;
			margin:20rpx 20rpx 0;
			padding:20rpx 0;
			box-sizing: border-box;
			.register_li_min{
				margin:0 26rpx;
				display flex;
				align-items center;
				border-bottom: 1px solid #F5F5F5;
				view{
					line-height:100rpx;
					font-size:28rpx;
				}
				view:nth-child(1){
					color:red;
					line-height:28rpx;
					margin-right: 12rpx;
				}
				view:nth-child(2){
					//width:140rpx;
					font-size: 28rpx;
					font-family: PingFang SC;
					font-weight: 500;
					color: #999999;
				}

				>input{
					flex:1;
					text-align: right;
					font-size: 24rpx;
					font-family: PingFang SC;
					font-weight: 500;
					color: #333333;
				}


			}
			.issue_li{
				margin:34rpx 26rpx 0;
				display flex;
				border-bottom: 1px solid #F5F5F5;
				view:nth-child(1){
					color:red;
					line-height:28rpx;
					margin-right: 12rpx;
				}
				view:nth-child(2){
					width:220rpx;
					font-size: 28rpx;
					font-family: PingFang SC;
					font-weight: 500;
					color: #999999;
				}
				.issue_img{
					display flex;
					justify-content: flex-start;
					flex-wrap: wrap;
					>img{
						width: 150rpx;
						height: 150rpx;
						border-radius: 10rpx;
						margin-right: 20rpx;
						margin-bottom: 20rpx
					}
				}
			}
		}
		/* 按钮 */
		.sub_btn{
			width: 650rpx;
			height: 100rpx;
			background: #0183FA;
			border-radius: 20rpx;
			font-size: 28rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: #FFFFFF;
			line-height: 100rpx;
			text-align: center;
			margin-left: 50rpx;
			position: fixed;
			bottom:30rpx;
			z-index: 1000;
		}
	}
	/deep/.input-value-border{
		display :none !important;
	}
</style>
