<template>
	<div class="sel-ship-module">
		<!-- 列表 -->
		<time-axis>
			<!-- 发货 -->
			<!-- <timeaxis-item class="axis-list axis-first ship-goods" bgcolor="none">
				<template v-slot:node>
					<div class="tui-node node-big">
						<div class="node-small"></div>
					</div>
				</template>
				<template v-slot:content>
					<div class="axis-slot-wrap">
						<div class="axis-title">发货</div>
						<div class="axis-det">
							<button class="admin-button-com big blue">自己送</button>
							<button class="admin-button-com big blue">快递送</button>
						</div>
					</div>
				</template>
			</timeaxis-item> -->
			<!-- 打单 -->
			<timeaxis-item class="axis-list axis-first print-order" bgcolor="none">
				<template v-slot:content>
					<div class="axis-slot-wrap">
						<div class="axis-title">打单</div>
						<div class="axis-det">
							<div>{{ orderComData[0].addTime | formatTime }}</div>
                            <card-name :info="orderComData[0].receive" />
                            <div class="btn-wrap-com">
                                <!-- <button class="admin-button-com default">修改</button> -->
                                <!-- <button class="admin-button-com default">明细</button> -->
                                <button class="admin-button-com default" @click="printOrderFn">打印</button>
                            </div>
						</div>
					</div>
				</template>
			</timeaxis-item>
			<!-- 下单 -->
			<timeaxis-item class="axis-list down-order" bgcolor="none">
				<template v-slot:content>
					<div class="axis-slot-wrap">
						<div class="axis-title">{{ orderComData[1].actionName }}</div>
						<div class="axis-det">
							<div>{{ orderComData[1].addTime | formatTime }}</div>
						</div>
					</div>
				</template>
			</timeaxis-item>
		</time-axis>
	</div>
</template>

<script>
import TimeAxis from '@/admin/home/components/plugin/time-axis'
import TimeaxisItem from '@/admin/home/components/plugin/timeaxis-item'
import CardName from './card-name'
// api
import { printOrder } from '@/api/order'
export default {
	name: 'sel-order-module',
	components: {
		TimeAxis,
		TimeaxisItem,
		CardName
	},
	props: {
		query: {
			type: Object,
			default: () => {}
		},
		orderData: {
			type: Object,
			default: () => {}
		},
		orderComData: {
			type: Array,
			default: () => []
		}
	},
	methods: {
		printOrderFn() {
			printOrder({
				id: this.orderData.id,
				option: 1
			}).then(res => {
				this.$util.pageTo({
					url: '/admin/order/ship',
					query: {
						id: this.orderData.id,
						pageStatus: 7
					}
				})
			})
		}
	}
}
</script>

<style lang="scss" scoped>
    // 发货
    .ship-goods {
		.axis-slot-wrap {
			top: -4px !important;
		}
		.axis-det {
			@include disFlex(center, space-between);
			margin-top: 50px;
			margin-bottom: 10px;
			.admin-button-com {
				width: 48%;
			}
		}
    }
	// 打单
	.print-order {
		.axis-det {
            margin-top: 14px;
            & > div {
                margin-top: 20px;
                &:first-child {
                    margin-top: 0;
                }
            }
		}
	}
	// 下单
	.down-order {
		.axis-det {
			margin-top: 14px;
		}
	}
</style>
