<template> 
 | 
    <div class="details"> 
 | 
        <div class="content_list"> 
 | 
            <van-skeleton :loading="loading" title :row="3" :row-width="['100%', '100%', '100%', '100%']" /> 
 | 
            <div class="content_list_item" v-show="!loading"> 
 | 
                <div class="content_list_item_top"> 
 | 
                    <div class="content_list_item_top_left"> 
 | 
                        <span v-if="info.mmodel">{{info.mmodel.name}}</span> 
 | 
                        <div class="content_list_item_top_left_tag" v-if="info.urgent">优先{{info.urgent}}</div> 
 | 
                        <div class="content_list_item_top_left_type" v-if="info.type === 0">正常</div> 
 | 
                        <div class="content_list_item_top_left_type dangerous" v-else-if="info.type === 1">异常</div> 
 | 
                        <div class="content_list_item_top_left_type warning" v-else-if="info.type === 2">返工</div> 
 | 
                    </div> 
 | 
                    <div class="content_list_item_top_right"> 
 | 
                        <span v-if="info.status === 0">已生成</span> 
 | 
                        <span v-if="info.status === 1">已发布</span> 
 | 
                        <span v-if="info.status === 2">已撤回</span> 
 | 
                        <span v-if="info.status === 3">已取消</span> 
 | 
                        <span v-if="info.status === 4">已分配</span> 
 | 
                        <span v-if="info.status === 5">已暂停</span> 
 | 
                        <span v-if="info.status === 6">已完工</span> 
 | 
                        <span v-if="info.status === 7">已入库</span> 
 | 
                        <span v-if="info.status === 8">已关闭</span> 
 | 
<!--                        <span class="warning" v-if="info.status === 0">待发布</span>--> 
 | 
<!--                        <span class="green" v-else-if="info.status === 1 || info.status === 4">生产中</span>--> 
 | 
<!--                        <span class="info" v-else-if="info.status === 6 || info.status === 7 || info.status === 3 || info.status === 8">已完成</span>--> 
 | 
                    </div> 
 | 
                </div> 
 | 
                <div class="content_list_item_content"> 
 | 
                    <div class="content_list_item_content_item"> 
 | 
                        <div class="content_list_item_content_item_label">工序名称:</div> 
 | 
                        <div class="content_list_item_content_item_nr" v-if="info.pmodel">{{info.pmodel.name}}</div> 
 | 
                    </div> 
 | 
                    <div class="content_list_item_content_item"> 
 | 
                        <div class="content_list_item_content_item_label">计划数量:</div> 
 | 
                        <div class="content_list_item_content_item_nr" v-if="info.umodel">{{info.num}}{{info.umodel.name}}</div> 
 | 
                    </div> 
 | 
                    <div class="content_list_item_content_item"> 
 | 
                        <div class="content_list_item_content_item_label">计划日期:</div> 
 | 
                        <div class="content_list_item_content_item_nr">{{info.planDate}}</div> 
 | 
                    </div> 
 | 
                    <div class="content_list_item_content_item"> 
 | 
                        <div class="content_list_item_content_item_label">生产批次:</div> 
 | 
                        <div class="content_list_item_content_item_nr">{{info.batch}}</div> 
 | 
                    </div> 
 | 
                    <div class="content_list_item_content_item"> 
 | 
                        <div class="content_list_item_content_item_label">发布日期:</div> 
 | 
                        <div class="content_list_item_content_item_nr">{{info.createTime}}</div> 
 | 
                    </div> 
 | 
                    <div class="content_list_item_content_item" v-if="info.usermodel"> 
 | 
                        <div class="content_list_item_content_item_label">计划人员:</div> 
 | 
                        <div class="content_list_item_content_item_nr">{{info.usermodel.realname}}</div> 
 | 
                    </div> 
 | 
                </div> 
 | 
            </div> 
 | 
        </div> 
 | 
        <NotFound info="暂未分配工单" v-if="info.workorderList && info.workorderList.length === 0" /> 
 | 
        <template v-else> 
 | 
            <div class="details_timeline" v-for="(item, i) in info.workorderList" :key="i"> 
 | 
                <div class="details_timeline_header"> 
 | 
                    <div class="details_timeline_header_code"> 
 | 
                        <span>工单编号:{{item.code}}</span> 
 | 
                        <span>生产人员:{{proUserStr(item)}}</span> 
 | 
                    </div> 
 | 
                    <span v-if="item.status === 0" class="yellow">已创建</span> 
 | 
                    <span v-if="item.status === 1" class="green">已备料</span> 
 | 
                    <span v-if="item.status === 2">已完工</span> 
 | 
                    <span v-if="item.status === 3" class="purple">已检验</span> 
 | 
                    <span v-if="item.status === 4">已报工</span> 
 | 
                    <span v-if="item.status === 5">已入库</span> 
 | 
                    <span v-if="item.status === 6">已取消</span> 
 | 
                    <!--                <span v-if="item.status === 7">已取消</span>--> 
 | 
                    <!--                <span v-if="item.status === 8">已关闭</span>--> 
 | 
                </div> 
 | 
                <div class="details_timeline_item" v-if="item.produceDate"> 
 | 
                    <div class="activedian"></div> 
 | 
                    <div class="dian active"></div> 
 | 
                    <div class="x"></div> 
 | 
                    <div class="details_timeline_item_zw"></div> 
 | 
                    <div class="details_timeline_item_left"> 
 | 
                        <span class="active_font">产出</span> 
 | 
                        <span>{{item.produceDate}}</span> 
 | 
                    </div> 
 | 
                    <div class="details_timeline_item_right"> 
 | 
                        <div class="item"> 
 | 
                            <div class="item_label">物料:</div> 
 | 
                            <div class="item_nr"> 
 | 
                                <div class="item_nr_item" v-if="item.qualifiedNum !== 0"> 
 | 
                                    <span class="success">[合格品]</span> 
 | 
                                    <span>{{item.qualifiedNum}}{{info.umodel.name}}</span> 
 | 
                                </div> 
 | 
                                <div class="item_nr_item" v-if="item.unqualifiedNum !== 0"> 
 | 
                                    <span class="warning">[不良品]</span> 
 | 
                                    <span>{{item.unqualifiedNum}}{{info.umodel.name}}</span> 
 | 
                                </div> 
 | 
                            </div> 
 | 
                        </div> 
 | 
                    </div> 
 | 
                </div> 
 | 
                <div class="details_timeline_item" v-if="item.materialDate"> 
 | 
                    <div class="activedian" v-if="!item.produceDate"></div> 
 | 
                    <div class="dian" :class="{ 'active': !item.produceDate }"></div> 
 | 
                    <div class="x" :style="{ height: item.materialList.length === 1 ? '2.1rem' :  1.2 * item.materialList.length + 'rem' }"></div> 
 | 
                    <div class="details_timeline_item_zw"></div> 
 | 
                    <div class="details_timeline_item_left"> 
 | 
                        <span :class="{'active_font': !item.produceDate}">投料</span> 
 | 
                        <span>{{item.materialDate}}</span> 
 | 
                    </div> 
 | 
                    <div class="details_timeline_item_right"> 
 | 
                        <div class="item"> 
 | 
                            <div class="item_label">物料:</div> 
 | 
                            <div class="item_nr" v-if="item.materialList && item.materialList.length !== 0"> 
 | 
                                <div class="item_nr_item" v-for="(items, idx) in item.materialList" :key="idx"> 
 | 
                                    <span style="margin: 0;">{{items.name}} / {{items.num}}{{items.unitName}}</span> 
 | 
                                </div> 
 | 
                            </div> 
 | 
                        </div> 
 | 
                    </div> 
 | 
                </div> 
 | 
                <div class="details_timeline_item"> 
 | 
                    <div class="activedian" v-if="!item.materialDate && !item.produceDate"></div> 
 | 
                    <div class="dian" :class="{ 'active': !item.materialDate && !item.produceDate }"></div> 
 | 
                    <div class="details_timeline_item_zw"></div> 
 | 
                    <div class="details_timeline_item_left"> 
 | 
                        <span :class="{'active_font': !item.materialDate && !item.produceDate}">分配</span> 
 | 
                        <span>{{ item.distributeDate }}</span> 
 | 
                    </div> 
 | 
                    <div class="details_timeline_item_right"> 
 | 
                        <div class="item"> 
 | 
                            <div class="item_label">分配数量:</div> 
 | 
                            <div class="item_nr">{{item.planNum}}{{info.umodel.name}}</div> 
 | 
                        </div> 
 | 
                    </div> 
 | 
                </div> 
 | 
            </div> 
 | 
        </template> 
 | 
    </div> 
 | 
</template> 
 | 
  
 | 
<script setup lang="ts"> 
 | 
    import { ref, onMounted, watch } from 'vue' 
 | 
    import { useRoute } from "vue-router" 
 | 
    import { queryByID } from '@/apis/PlanningAPI' 
 | 
    import NotFound from '@/components/common/NotFound.vue' 
 | 
  
 | 
    const route = useRoute() 
 | 
  
 | 
    // 详情数据 
 | 
    let info = ref({}) 
 | 
  
 | 
    let loading = ref<boolean>(true) 
 | 
  
 | 
    // 获取详情 
 | 
    const queryByIDs = () => { 
 | 
        queryByID(route.query.id) 
 | 
            .then(res => { 
 | 
                if (res.code === 200) { 
 | 
                    info.value = res.data 
 | 
                } 
 | 
            }) 
 | 
    } 
 | 
  
 | 
    const proUserStr = (item: any) => { 
 | 
        if (!item.proUserList || item.proUserList.length<1) { 
 | 
            return '-' 
 | 
        } 
 | 
        return item.proUserList.map((user: any) => { return user.proUserDepartName }).join(',') 
 | 
    } 
 | 
  
 | 
    onMounted(() => { 
 | 
        queryByIDs() 
 | 
    }) 
 | 
  
 | 
    watch(() => info.value, (news) => { 
 | 
        if (JSON.stringify(news) !== "{}") { 
 | 
            loading.value = false 
 | 
        } 
 | 
    }, { immediate: true }) 
 | 
</script> 
 | 
  
 | 
<style lang="scss" scoped> 
 | 
.details { 
 | 
    width: 100%; 
 | 
    height: 100%; 
 | 
    position: absolute; 
 | 
    background: #F7F7F7; 
 | 
    .van-skeleton { 
 | 
        padding: 0 !important; 
 | 
    } 
 | 
    .content_list { 
 | 
        width: 100%; 
 | 
        padding: 30px; 
 | 
        background: #ffffff; 
 | 
        display: flex; 
 | 
        flex-direction: column; 
 | 
        box-sizing: border-box; 
 | 
        .content_list_item { 
 | 
            display: flex; 
 | 
            flex-direction: column; 
 | 
            .content_list_item_top { 
 | 
                display: flex; 
 | 
                align-items: center; 
 | 
                justify-content: space-between; 
 | 
                .content_list_item_top_left { 
 | 
                    display: flex; 
 | 
                    align-items: center; 
 | 
                    max-width: 83%; 
 | 
                    span { 
 | 
                        max-width: 400px; 
 | 
                        font-size: 32px; 
 | 
                        font-weight: 500; 
 | 
                        color: #333333; 
 | 
                        overflow: hidden; 
 | 
                        white-space: nowrap; 
 | 
                        text-overflow: ellipsis; 
 | 
                    } 
 | 
                    .dangerous { 
 | 
                        background: $nav-stateColor4 !important; 
 | 
                    } 
 | 
                    .warning { 
 | 
                        background: $nav-stateColor5 !important; 
 | 
                    } 
 | 
                    .content_list_item_top_left_type { 
 | 
                        flex-shrink: 0; 
 | 
                        padding: 5px 10px; 
 | 
                        background: $nav-stateColor2; 
 | 
                        border-radius: 8px; 
 | 
                        font-size: 22px; 
 | 
                        font-weight: 400; 
 | 
                        color: #FFFFFF; 
 | 
                        margin-left: 16px; 
 | 
                        display: flex; 
 | 
                        align-items: center; 
 | 
                        justify-content: center; 
 | 
                    } 
 | 
                    .content_list_item_top_left_tag { 
 | 
                        flex-shrink: 0; 
 | 
                        padding: 5px 10px; 
 | 
                        background: $nav-stateColor4; 
 | 
                        border-radius: 8px; 
 | 
                        font-size: 22px; 
 | 
                        font-weight: 400; 
 | 
                        color: #FFFFFF; 
 | 
                        margin-left: 16px; 
 | 
                        display: flex; 
 | 
                        align-items: center; 
 | 
                        justify-content: center; 
 | 
                    } 
 | 
                } 
 | 
                .content_list_item_top_right { 
 | 
                    font-size: 26px; 
 | 
                    font-weight: 400; 
 | 
                    flex-shrink: 0; 
 | 
                    .warning { 
 | 
                        color: $nav-stateColor5 !important; 
 | 
                    } 
 | 
                    .green { 
 | 
                        color: $nav-stateColor6 !important; 
 | 
                    } 
 | 
                    .info { 
 | 
                        color: $nav-stateColor3 !important; 
 | 
                    } 
 | 
                } 
 | 
            } 
 | 
            .content_list_item_content { 
 | 
                padding: 24px 30px; 
 | 
                background: #F7F7F7; 
 | 
                border-radius: 16px; 
 | 
                display: flex; 
 | 
                flex-wrap: wrap; 
 | 
                justify-content: space-between; 
 | 
                margin-top: 32px; 
 | 
                .content_list_item_content_item { 
 | 
                    width: 50%; 
 | 
                    display: flex; 
 | 
                    margin-top: 24px; 
 | 
                    &:nth-child(1) { 
 | 
                        margin-top: 0 !important; 
 | 
                    } 
 | 
                    &:nth-child(2) { 
 | 
                        margin-top: 0 !important; 
 | 
                    } 
 | 
                    .content_list_item_content_item_label { 
 | 
                        font-size: 24px; 
 | 
                        font-weight: 400; 
 | 
                        color: #666666; 
 | 
                        flex-shrink: 0; 
 | 
                    } 
 | 
                    .content_list_item_content_item_nr { 
 | 
                        font-size: 24px; 
 | 
                        font-weight: 400; 
 | 
                        color: #222222; 
 | 
                        margin-right: 10px; 
 | 
                    } 
 | 
                } 
 | 
            } 
 | 
        } 
 | 
    } 
 | 
    .details_timeline { 
 | 
        padding: 30px; 
 | 
        background: #ffffff; 
 | 
        margin-top: 20px; 
 | 
        .details_timeline_header { 
 | 
            display: flex; 
 | 
            align-items: flex-start; 
 | 
            justify-content: space-between; 
 | 
            .yellow { 
 | 
                color: $nav-stateColor1 !important; 
 | 
            } 
 | 
            .green { 
 | 
                color: $nav-stateColor6 !important; 
 | 
            } 
 | 
            .purple { 
 | 
                color: $nav-color !important; 
 | 
            } 
 | 
            span { 
 | 
                font-size: 26px; 
 | 
                font-weight: 400; 
 | 
                color: #666666; 
 | 
            } 
 | 
            .details_timeline_header_code { 
 | 
                display: flex; 
 | 
                flex-direction: column; 
 | 
                span { 
 | 
                    &:first-child { 
 | 
                        font-size: 28px; 
 | 
                        font-weight: 500; 
 | 
                        color: #222222; 
 | 
                    } 
 | 
                    &:last-child { 
 | 
                        font-size: 22px; 
 | 
                        font-weight: 400; 
 | 
                        color: #777777; 
 | 
                        margin-top: 24px; 
 | 
                    } 
 | 
                } 
 | 
            } 
 | 
        } 
 | 
        .details_timeline_item { 
 | 
            display: flex; 
 | 
            align-items: flex-start; 
 | 
            position: relative; 
 | 
            margin-top: 60px; 
 | 
            &:nth-child(1) { 
 | 
                margin-top: 0 !important; 
 | 
            } 
 | 
            .x { 
 | 
                position: absolute; 
 | 
                top: 30px; 
 | 
                left: 29px; 
 | 
                width: 1PX; 
 | 
                height: 165px; 
 | 
                border-right: 1PX dashed #CCCCCC; 
 | 
            } 
 | 
            .dian { 
 | 
                position: absolute; 
 | 
                top: 22px; 
 | 
                left: 22px; 
 | 
                width: 16px; 
 | 
                height: 16px; 
 | 
                background: #CCCCCC; 
 | 
                border-radius: 50%; 
 | 
            } 
 | 
            .active { 
 | 
                width: 16px; 
 | 
                height: 16px; 
 | 
                background: $nav-color; 
 | 
                z-index: 8; 
 | 
            } 
 | 
            .activedian { 
 | 
                position: absolute; 
 | 
                top: 14px; 
 | 
                left: 14px; 
 | 
                width: 32px; 
 | 
                height: 32px; 
 | 
                background: #E4EBFE; 
 | 
                border-radius: 50%; 
 | 
            } 
 | 
            .details_timeline_item_zw { 
 | 
                width: 100px; 
 | 
            } 
 | 
            .details_timeline_item_left { 
 | 
                display: flex; 
 | 
                flex-direction: column; 
 | 
                width: 150px; 
 | 
                .active_font { 
 | 
                    color: $nav-color !important; 
 | 
                } 
 | 
                span { 
 | 
                    &:nth-child(1) { 
 | 
                        font-size: 30px; 
 | 
                        font-weight: 500; 
 | 
                        color: #333333; 
 | 
                    } 
 | 
                    &:nth-child(2) { 
 | 
                        font-size: 22px; 
 | 
                        font-weight: 400; 
 | 
                        color: #999999; 
 | 
                        margin-top: 16px; 
 | 
                    } 
 | 
                } 
 | 
            } 
 | 
            .details_timeline_item_right { 
 | 
                display: flex; 
 | 
                flex-direction: column; 
 | 
                flex: 1; 
 | 
                margin-left: 30px; 
 | 
                .item { 
 | 
                    display: flex; 
 | 
                    align-items: flex-start; 
 | 
                    margin-top: 24px; 
 | 
                    &:nth-child(1) { 
 | 
                        margin-top: 0 !important; 
 | 
                    } 
 | 
                    .item_label { 
 | 
                        font-size: 26px; 
 | 
                        font-weight: 400; 
 | 
                        color: #666666; 
 | 
                        flex-shrink: 0; 
 | 
                    } 
 | 
                    .item_nr { 
 | 
                        font-size: 26px; 
 | 
                        font-weight: 400; 
 | 
                        color: #333333; 
 | 
                        .item_nr_item { 
 | 
                            display: flex; 
 | 
                            align-items: center; 
 | 
                            margin-bottom: 24px; 
 | 
                            .success { 
 | 
                                color: $nav-stateColor2; 
 | 
                            } 
 | 
                            .warning { 
 | 
                                color: $nav-stateColor5; 
 | 
                            } 
 | 
                            span { 
 | 
                                font-size: 26px; 
 | 
                                font-weight: 400; 
 | 
                                &:last-child { 
 | 
                                    color: #333333; 
 | 
                                    margin-left: 12px; 
 | 
                                } 
 | 
                            } 
 | 
                        } 
 | 
                    } 
 | 
                } 
 | 
            } 
 | 
        } 
 | 
    } 
 | 
} 
 | 
</style> 
 |