<template>
	<view class="fs-p48">
		<tui-steps :type="2" bold :activeSteps="activeStep" direction="column" :items="list" titleField="stepRemark"></tui-steps>
	</view>
</template>

<script>
import { apiTaskStep } from '@/api/work'
export default {
	data() {
		return {
			activeStep: 0,
			list: []
		}
	},
	onLoad(options) {
		this.getTaskStep(options.problem_no)
	},
	methods: {
		// 获取问题进度
		getTaskStep(problem_no) {
			apiTaskStep({data:{problem_no}}).then(res => {
				this.activeStep = res.data.list.length - 1
				res.data.list.forEach(item => {
					if (item.commitDate) {
						item.descr = item.commitDate + ' ' + item.userName + ' ' + item.eventStatus 
						if (item.taskRejectRemark) {
							item.desct =  '拒绝原因：' + item.taskRejectRemark 
						}
						if (item.staffRejectRemark) {
							item.desct =  '拒绝原因：' + item.staffRejectRemark 
						}
					} else {
						item.descr = '--'
					}
				})
				this.list = res.data.list
			})
		}
	}
}
</script>

<style lang="scss">
page {
	background-color: #FFF;
}
</style>
