<template>
	<u-mask class="orderInfoModal" :show="isShow" :mask-click-able="false">
		<view class="order-info-con">
			<scroll-view scroll-y>
			<view class="order-info-main">
				<view class="order-info-list">
					<text class="info-item-tit">销售单号：</text>
					<text class="info-item-txt">{{ (infoData && infoData.salesBillNo) || '--' }}</text>
				</view>
				<view class="order-info-list">
					<text class="info-item-tit">客户名称：</text>
					<text class="info-item-txt">{{infoData&&infoData.buyerNameCurrent?infoData.buyerName?infoData.buyerName==infoData.buyerNameCurrent?infoData.buyerNameCurrent:infoData.buyerNameCurrent+'（'+infoData.buyerName+'）':infoData.buyerNameCurrent:'--' }}</text>
				</view>
				<view class="order-info-list">
					<text class="info-item-tit">客户地址：</text>
					<text
						class="info-item-txt"
						v-if="
							infoData &&
								(infoData.shippingAddressProvinceName || infoData.shippingAddressCityName || infoData.shippingAddressCountyName || infoData.shippingAddress)
						"
					>
						{{ infoData.shippingAddressProvinceName || '' }}{{ infoData.shippingAddressCityName || '' }}{{ infoData.shippingAddressCountyName || ''
						}}{{ infoData.shippingAddress || '' }}
					</text>
					<text class="info-item-txt" v-else>--</text>
				</view>
				<view class="order-info-list">
					<text class="info-item-tit">{{ infoFlag ? '单据来源' : '来源' }}：</text>
					<text class="info-item-txt">{{ (infoData && infoData.sourceTypeDictValue) || '--' }}</text>
				</view>
				<view class="order-info-list">
					<text class="info-item-tit">业务状态：</text>
					<text class="info-item-txt">{{ (infoData && infoData.billStatusDictValue) || '--' }}</text>
				</view>
				<view class="order-info-list">
					<text class="info-item-tit">财务状态：</text>
					<text class="info-item-txt">{{ (infoData && infoData.financialStatusDictValue) || '--' }}</text>
				</view>
				<view v-if="infoFlag">
					<view class="order-info-list">
						<text class="info-item-tit">创建时间：</text>
						<text class="info-item-txt">{{ (infoData && infoData.createDate) || '--' }}</text>
					</view>
					<view class="order-info-list">
						<text class="info-item-tit">审核时间：</text>
						<text class="info-item-txt">{{ (infoData && infoData.auditDate) || '--' }}</text>
					</view>
					<view class="order-info-list">
						<text class="info-item-tit">联系人：</text>
						<text class="info-item-txt">{{ (infoData && infoData.consigneeName) || '--' }}</text>
					</view>
				</view>
					
				<view class="order-info-list">
					<text class="info-item-tit">联系电话：</text>
					<text class="info-item-txt">{{ (infoData && infoData.consigneeTel) || '--' }}</text>
				</view>
				<view class="order-info-list">
					<text class="info-item-tit">联系手机：</text>
					<text class="info-item-txt">{{ (infoData && infoData.consigneeMobile) || '--' }}</text>
				</view>
				<view class="order-info-list" v-if="infoFlag">
					<text class="info-item-tit">价格类型：</text>
					<text class="info-item-txt">{{ (infoData && infoData.priceTypeDictValue) || '--' }}</text>
				</view>
				<view class="order-info-list">
					<text class="info-item-tit">收款方式：</text>
					<text class="info-item-txt">{{ (infoData && infoData.settleStyleSnDictValue) || '--' }}</text>
				</view>
				<view class="order-info-list" v-if="infoFlag">
					<text class="info-item-tit">配送方式：</text>
					<text class="info-item-txt">{{ (infoData && infoData.dispatchTypeDictValue) || '--' }}</text>
				</view>
				<view class="order-info-list" v-if="infoData&&infoData.sourceType!='SALES'">
					<text class="info-item-tit">采购单号：</text>
					<text class="info-item-txt">{{ (infoData && infoData.purchaseBillNo) || '--' }}</text>
				</view>
				<view class="order-info-list" v-if="infoData&&infoData.sourceType!='XPRH_PURCHASE'&&infoData.sourceType!='SALES'&&infoData.billStatus=='FINISH'">
					<text class="info-item-tit">收货状态：</text>
					<text class="info-item-txt">{{ (infoData && infoData.receiptStatusDictValue) || '--' }}</text>
				</view>
				<view class="order-info-list">
					<text class="info-item-tit">业务员：</text>
					<text class="info-item-txt">{{ (infoData && infoData.salesManName) || '--' }}</text>
				</view>
				<view class="order-info-list" v-if="infoFlag">
					<text class="info-item-tit">铺货出库：</text>
					<text class="info-item-txt">{{ (infoData && infoData.distributionFlag)?infoData.distributionFlag==0?'否':'是':'--' }}</text>
				</view>
				<view class="order-info-list">
					<text class="info-item-tit">备注：</text>
					<text class="info-item-txt">{{ (infoData && infoData.remarks) || '--' }}</text>
				</view>
				<view class="order-info-list">
					<text class="info-item-tit">{{ infoFlag ? '开单人' : '制单人' }}：</text>
					<text class="info-item-txt">{{ (infoData && infoData.operatorName) || '--' }}</text>
				</view>
			</view>
			
			</scroll-view>
			<view class="order-info-footer"><view :class="infoFlag?'button-cancel':''" @click="isShow = false">关闭</view></view>
		</view>
	</u-mask>
</template>

<script>
export default {
	props: {
		openModal: {
			//  弹框显示状态
			type: Boolean,
			default: false
		},
		infoData: {
			tyoe: Object,
			default: () => {
				return null;
			}
		},
		infoFlag: {
			type: Boolean,
			default: false
		}
	},
	data() {
		return {
			isShow: this.openModal //  是否打开弹框
		};
	},
	methods: {},
	watch: {
		//  父页面传过来的弹框状态
		openModal(newValue, oldValue) {
			this.isShow = newValue;
		},
		//  重定义的弹框状态
		isShow(newValue, oldValue) {
			if (!newValue) {
				this.$emit('close');
			}
		}
	}
};
</script>

<style lang="scss" scoped>
.orderInfoModal {
	width: 100%;
	height: 100%;
	.order-info-con {
		width: 78%;
		margin: 30% auto 0;
		background-color: #fff;
		border-radius: 24upx;
		.order-info-main {
			padding: 20upx 20upx;
			height:800rpx;
			.order-info-list {
				padding: 20upx 0;
				border-bottom: 1upx solid #e4e7ed;
				.info-item-tit {
					color: #666;
					display: inline-block;
				}
			}
		}
		.order-info-footer {
			text-align: center;
			padding: 20upx 0;
			text-align: center;
			.button-cancel{
				width:160rpx;
				height: 68rpx;
				line-height: 68rpx;
				margin:auto;
				border-radius: 38rpx;
				border:1rpx solid #e4e7ed;
			}
		}	
	}
}
</style>
