<template>
  <view class="showModel" v-if="speDATA && speDATA.data">
		<view class="showModel__wrap">
			<view class="showModel__header">
			  提示
			</view>
			<view class="content">
				<view class="content-box">
					<view class="icon">
						<text class="red newicon newicon-guanbi1"></text>
					</view>
					<view class="list flex">
						<view>条码：<text class="mar-rig" :class="speDATA.data.urgent==0?'green':'red'">{{speDATA.data.urgent==0?'普':'急'}}</text> {{speDATA.data.scode}}</view>
						<view>{{speDATA.data.speState ? speDATA.data.speState.name : ''}}</view>
					</view>
					<view class="list">检查项目：{{ speDATA.data.specimenDesc || "-" }}</view>
					<view class="list">类型：{{speDATA.data.stype ? speDATA.data.stype.name : ''}} <text v-if="speDATA.data.tubeType">、</text> {{speDATA.data.tubeType && speDATA.data.tubeType.name || ''}}</view>
					<view class="list">患者：{{ speDATA.data.patientName}} <text v-if="speDATA.data.bedNum">（{{speDATA.data.bedNum}}）</text></view>
					<view class="list">{{speDATA.data.sickRoom.dept}}
					<text style="width: 4em;text-align: center;margin-left: 1em;margin-right: 1em;" class="newicon newicon-arrow-right-full"></text>
					{{speDATA.data.checkDept.dept}}</view>
					<view class="list weight">{{speDATA.msg}}</view>
					<view class="list" v-if="speDATA.speVerifyType=='collectDept'
					|| speDATA.speVerifyType=='testDept' || speDATA.speVerifyType=='tubeType'
					|| speDATA.speVerifyType=='urgent'">
						<checkbox-group @change="forceDeptInputBlur">
						  <checkbox value="addConfig" :checked="addConfig" color="#49b856" />{{msg}}
						</checkbox-group>
					</view>
				</view>
			</view>
			<view class="bottom">
				<button class="bottom-btn confirm-btn" @click="confirm">是</button>
				<button class="bottom-btn" @click="cancel">否</button>
			</view>
		</view>
  </view>
</template>

<script>
import {
    get,
    post,
    SM
  } from "../../http/http.js";
export default {
  data() {
    return {
      addConfig:false,
			msg:null,
    };
  },
  props: {
		speDATA:{
			type:Object,
			default:{}
		},
		errorModal:{
			type:Boolean,
			default:false
		},
  },
	watch:{
		errorModal(e){
			console.log(2222,e)
			if(e){
				if(this.speDATA.speVerifyType=='collectDept'){
					this.msg = '增加收取科室'
				}else if(this.speDATA.speVerifyType=='testDept'){
					this.msg = '收取本科室不在提示'
				}else if(this.speDATA.speVerifyType=='tubeType'){
					this.msg = '收取此试管类型不在提示'
				}else if(this.speDATA.speVerifyType=='urgent'){
					this.msg = '记录本次操作，不在提示'
				}
			}
		}
	},
	created(){
	},
  methods: {
		forceDeptInputBlur(e){
			this.addConfig = e.detail.value.length > 0
		},
    confirm(){
			if(this.speDATA.speVerifyType!='collectDept'
			&& this.speDATA.speVerifyType!='testDept' && this.speDATA.speVerifyType!='tubeType'
			&& this.speDATA.speVerifyType!='urgent'){
				this.addConfig = true
			}
			let data = {
				code: this.speDATA.data.scode,
				addConfig: this.addConfig
			}
			console.log(this.addConfig)
			this.$emit('confirm', data)
    },
    cancel(){
      this.$emit('cancel')
    },
  },
};
</script>

<style lang="less" scoped>
.showModel {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.2);
  z-index: 99;

  .showModel__wrap {
    width: 90%;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background-color: #fff;
    border-radius: 12rpx;

    .showModel__header {
      font-size: 36rpx;
      color: #000;
			font-weight: bold;
      height: 84rpx;
      display: flex;
      justify-content: center;
      align-items: center;
    }
		.content{
			background: #FAFBFD;
			border-top: 1px solid #E6E6E6;
			// margin-bottom: 20rpx;
			.content-tip{
				text-align: center;
				padding: 50rpx 0 30rpx 0;
				font-size: 28rpx;
			}
			.content-box{
				padding: 24rpx;
				
				.icon{
					text-align: center;
					.red{
						font-size: 80rpx;
					}
				}
				
				.flex{
					display: flex;
					justify-content: space-between;
				}
				
				.weight{
					font-weight: bold;
				}
				
				.list{
					padding: 20rpx 0;
				}
				
				.content-item{
					width: 80rpx;
					height: 80rpx;
					border-radius: 10rpx;
					border: 1px solid #CCCCCC;
					color: #000;
					font-size: 32rpx;
					// margin: 0 20rpx;
					text-align: center;
				}
			}
		}
		.bottom{
			border-top: 1px solid #ccc;
			display: flex;
			uni-button{
				border-radius: 0 !important;
				background: #fff !important;
			}
			uni-button:after{
				border: none !important;
			}
			.bottom-btn{
				color: #A8A8A8;
				font-size: 30rpx;
				padding: 20rpx 0;
				width: 50%;
				display: flex;
				align-items: center;
				justify-content: center;
			}
			.confirm-btn{
				color: #5DAC6B;
				border-right: 1px solid #ccc;
			}
		}
  }
	.green{
		color: #49B856;
	}
	.mar-rig{
		margin-right: 8rpx;
	}
}
</style>
