<template>
	<view class="pdca-page">
		<uni-segmented-control
		  :current="current"
			:values="items"
			@clickItem="onClickItem"
			style-type="text"
			active-color="#3377FF" />
		<view class="content">
			<scroll-view class="scroll-y" scroll-y="true">
        <one-textarea
          v-if="current === 0"
          :defaultPlanValue="'99999'"
         />
				 <do-and-check
					 v-if="current === 1"
					/>
				<view v-if="current === 2">
						选项卡3的内容
				</view>
				<one-textarea
          v-if="current === 3"
          title="对策处置（Action）"
          label="对策处置"
          :defaultactionValue="'123'"
         />
			</scroll-view>
			<view class="fixed-buttom-btn">
				<view class="btn-text cancle">
					<text>取消</text>
				</view>
				<view class="btn-text">
					<text>确定</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	// 改善任务PDCA
	import uniSegmentedControl from "@/components/uni-segmented-control/uni-segmented-control.vue"
	import oneTextarea from './pdca-components/one-textarea.vue'
	import doAndCheck from './pdca-components/do-and-check.vue'

	export default {
		data() {
			return {
				items: ['改善计划(P)', '执行过程(D)', '改善确认(C)', '对策处置(A)'],
        current: 1,
			}
		},
		created() {
			uni.setNavigationBarTitle({
				title: '改善计划'
			});
		},
		methods: {
			onClickItem(e) {
				if (this.current !== e.currentIndex) {
					this.current = e.currentIndex;
				}
			}
		},
		components: {
			uniSegmentedControl,
			oneTextarea,
			doAndCheck
		}
	}
</script>

<style lang="less">
	.pdca-page {
		height: 100%;

		.content {
			height: calc(100% - 141.5rpx);

			.scroll-y {
				height: 100%;
			}
		}
	}
</style>
