<template> 
 | 
    <div class="box"> 
 | 
        <div :class="{ 'content_top': status }" class="content_search"> 
 | 
            <v-Search placeholder="搜索关键字" @searchInput="searchInput" @submit="submit" @reset="reset" :isShow="true"> 
 | 
                <template v-slot:content> 
 | 
                    <div class="Search_item"> 
 | 
                        <div class="Search_item_label">类型</div> 
 | 
                        <div class="Search_item_content"> 
 | 
                            <div class="tag"> 
 | 
                                <div class="tag_item" :class="{'tag_active': item.isActive}" v-for="(item, i) in data" :key="i" @click="changeTag(i)">{{item.name}}</div> 
 | 
                            </div> 
 | 
                        </div> 
 | 
                    </div> 
 | 
                </template> 
 | 
            </v-Search> 
 | 
            <div class="content_search_x"></div> 
 | 
            <v-LableSelection :TagList="tagList" :isShow="true" @change="clickTag"></v-LableSelection> 
 | 
        </div> 
 | 
        <div class="box_h"></div> 
 | 
        <van-pull-refresh v-model="refreshing" @refresh="onRefresh"> 
 | 
            <van-list 
 | 
                v-model:loading="loading" 
 | 
                :finished="finished" 
 | 
                finished-text="没有更多了~" 
 | 
                @load="onLoad"> 
 | 
                <div class="box_list"> 
 | 
                    <div class="box_list_item" v-for="(item, index) in list" :key="index" @click="jump(item)"> 
 | 
                        <div class="box_list_item_icon"> 
 | 
    <!--                        <div class="box_list_item_icon_active"></div>--> 
 | 
                            <img src="@/assets/icon/daiban_ic_daiban@2x.png" alt="" /> 
 | 
    <!--                        <img src="@/assets/icon/daiban_ic_xiaoxi@2x.png" alt="" />--> 
 | 
                        </div> 
 | 
                        <div class="box_list_item_nr"> 
 | 
                            <div class="box_list_item_nr_top"> 
 | 
                                <span>{{item.title}}</span> 
 | 
                                <span>{{item.createTime}}</span> 
 | 
                            </div> 
 | 
                            <div class="box_list_item_nr_bottom"> 
 | 
                                {{item.content}} 
 | 
                            </div> 
 | 
                        </div> 
 | 
                    </div> 
 | 
                </div> 
 | 
            </van-list> 
 | 
        </van-pull-refresh> 
 | 
<!--        <div style="padding: 10px; box-sizing: border-box;">--> 
 | 
<!--            <v-TransverseDiagram :arrs="arrs" />--> 
 | 
<!--        </div>--> 
 | 
  
 | 
<!--        <div style="padding: 10px; box-sizing: border-box;">--> 
 | 
<!--            <v-PieChart :legendData="PieChartLegendData" :seriesData="PieChartSeriesData" />--> 
 | 
<!--        </div>--> 
 | 
  
 | 
<!--        <div style="padding: 10px; box-sizing: border-box;">--> 
 | 
<!--            <v-Histogram :legendData="HistogramLegendData" :seriesData="HistogramSeriesData" :xAxisData="xAxisData" />--> 
 | 
<!--        </div>--> 
 | 
    </div> 
 | 
</template> 
 | 
  
 | 
<script setup lang="ts"> 
 | 
    import { reactive, ref, onMounted, getCurrentInstance } from 'vue' 
 | 
    import { useRouter } from 'vue-router' 
 | 
    import { useStore } from 'vuex' 
 | 
    import { judgmentPlatform } from "@/utils/utils" 
 | 
    import { getList, pageCount } from '@/apis/agencyAPI' 
 | 
    import { model } from '@/interface' 
 | 
    import vSearch from '@/components/common/Search.vue' 
 | 
    import vLableSelection from '@/components/common/LabelSelection.vue' 
 | 
    // import vTransverseDiagram from '@/components/chart/TransverseDiagram.vue' 
 | 
    // import vHistogram from '@/components/chart/Histogram.vue' 
 | 
    // import vPieChart from '@/components/chart/PieChart.vue' 
 | 
  
 | 
    const { proxy }: any = getCurrentInstance() 
 | 
  
 | 
    interface pageVerify extends model { 
 | 
        model?: { 
 | 
            status: number | string, 
 | 
            type: number | string, 
 | 
            mixParam: number | string 
 | 
        } 
 | 
    } 
 | 
  
 | 
    const router = useRouter() 
 | 
    const store = useStore() 
 | 
    let list: any = ref([])    // 列表数据 
 | 
    let one = ref<boolean>(false) 
 | 
    const loading = ref(false) 
 | 
    const finished = ref(false) 
 | 
    const refreshing = ref(false) 
 | 
  
 | 
    let page: any = reactive<pageVerify>({ 
 | 
        capacity: 10, 
 | 
        page: 0, 
 | 
        model: { 
 | 
            status: 0, 
 | 
            type: '', 
 | 
            mixParam: '' 
 | 
        } 
 | 
    }) 
 | 
  
 | 
    let status = ref<boolean>(true)    // 根据平台是否需要设置top 
 | 
  
 | 
    let data: any = ref([ 
 | 
        { 
 | 
            id: 0, 
 | 
            name: '车间领料-待发货', 
 | 
            isActive: false 
 | 
        }, 
 | 
        { 
 | 
            id: 1, 
 | 
            name: '车间领料-待入库', 
 | 
            isActive: false 
 | 
        }, 
 | 
        { 
 | 
            id: 2, 
 | 
            name: '机台备料-待发货', 
 | 
            isActive: false 
 | 
        }, 
 | 
        { 
 | 
            id: 3, 
 | 
            name: '机台备料-待入库', 
 | 
            isActive: false 
 | 
        }, 
 | 
        { 
 | 
            id: 4, 
 | 
            name: '完工入库-待接收', 
 | 
            isActive: false 
 | 
        }, 
 | 
        { 
 | 
            id: 5, 
 | 
            name: '库存转库-待发货', 
 | 
            isActive: false 
 | 
        }, 
 | 
        { 
 | 
            id: 6, 
 | 
            name: '库存转库-待入库', 
 | 
            isActive: false 
 | 
        }, 
 | 
        { 
 | 
            id: 7, 
 | 
            name: '申请审批', 
 | 
            isActive: false 
 | 
        }, 
 | 
        { 
 | 
            id: 8, 
 | 
            name: '客退/返品回厂检验', 
 | 
            isActive: false 
 | 
        } 
 | 
    ]) // 搜索项类型数据 
 | 
  
 | 
    let tagList: any = reactive([ 
 | 
        { 
 | 
            id: 0, 
 | 
            name: '待办', 
 | 
            num: 0 
 | 
        }, 
 | 
        { 
 | 
            id: 1, 
 | 
            name: '已办', 
 | 
            num: 0 
 | 
        } 
 | 
    ])  // 搜索分类标签 
 | 
  
 | 
    const reset = () => { 
 | 
        page.model.mixParam = '' 
 | 
        finished.value = false 
 | 
        page.page = 0 
 | 
        page.model.type = '' 
 | 
        list.value = [] 
 | 
        data.value.forEach((item: any) => { 
 | 
            item.isActive = false 
 | 
        }) 
 | 
        onLoad() 
 | 
    } 
 | 
  
 | 
    const searchInput = (name: string) => {   // 搜索数据 
 | 
        page.model.mixParam = name 
 | 
        finished.value = false 
 | 
        page.page = 0 
 | 
        list.value = [] 
 | 
        onLoad() 
 | 
    } 
 | 
  
 | 
    const clickTag = (id: any): void => {   // 切换分类 
 | 
        page.model.status = id 
 | 
        finished.value = false 
 | 
        page.page = 0 
 | 
        list.value = [] 
 | 
        onLoad() 
 | 
    } 
 | 
  
 | 
    const submit = () => {    // 搜索项点击提交 
 | 
        let isOpen: boolean = true 
 | 
        data.value.forEach((item: any) => { 
 | 
            if (item.isActive) { 
 | 
                isOpen = false 
 | 
                page.model.type = item.id 
 | 
                finished.value = false 
 | 
                page.page = 0 
 | 
                list.value = [] 
 | 
                onLoad() 
 | 
                return 
 | 
            } 
 | 
        }) 
 | 
        if (isOpen) { 
 | 
            isOpen = false 
 | 
            page.model.type = '' 
 | 
            finished.value = false 
 | 
            page.page = 0 
 | 
            list.value = [] 
 | 
            onLoad() 
 | 
        } 
 | 
    } 
 | 
  
 | 
    // 点击切换类型 
 | 
    const changeTag = (i: number): void => { 
 | 
        data.value.forEach((item: any, index: number) => { 
 | 
            if (i === index) { 
 | 
                item.isActive = !item.isActive 
 | 
            } else { 
 | 
                item.isActive = false 
 | 
            } 
 | 
        }) 
 | 
  
 | 
    } 
 | 
  
 | 
    // 调转详情 
 | 
    const jump = (item: any) => { 
 | 
        if ((item.type === 0 || item.type === 2 || item.type === 5) && item.status === 0) {  // 跳转出库(转库单) 
 | 
            router.push({ name: 'issueOperation', query: { id: item.objId, dbid: item.id, type: 7 } }) 
 | 
        } else if ((item.type === 0 || item.type === 2 || item.type === 5) && item.status === 1) { 
 | 
            router.push({ name: 'wTransferDetail', query: { id: item.objId, status: item.status, type: item.type, dbid: item.id } }) 
 | 
            // router.push({ name: 'wTransferDetail', query: { id: item.objId, status: 0, type: item.type, dbid: item.id } }) 
 | 
        } else if ((item.type === 1 || item.type === 4 || item.type === 6) && item.status === 0) {  // 跳转入库(转库单) 
 | 
            if (item.type === 4) {  // 跳转完工入库详情 
 | 
                router.push({ name: 'completionDetails', query: { id: item.objId, dbid: item.id, type: 7, isShow: 1, Type: item.type } }) 
 | 
                return 
 | 
            } 
 | 
            router.push({ name: 'warehousing', query: { id: item.objId, dbid: item.id, type: 7 } }) 
 | 
        } else if ((item.type === 1 || item.type === 4 || item.type === 6) && item.status === 1) { 
 | 
            if (item.type === 4) {  // 跳蛛完工入库详情 
 | 
                router.push({ name: 'completionDetails', query: { id: item.objId, dbid: item.id, type: 7, isShow: 2 } }) 
 | 
                return 
 | 
            } 
 | 
            router.push({ name: 'wTransferDetail', query: { id: item.objId } }) 
 | 
        } else if (item.type === 3 && item.status === 0) {   // 确认备料 
 | 
            router.push({ name: 'orderStock', query: { id: item.objId, dbid: item.id } }) 
 | 
        } else if (item.type === 3 && item.status === 1) {   // 备料(转库单详情) 
 | 
            // router.push({ name: 'wInboundDetail', query: { id: item.objId } }) 
 | 
            router.push({ name: 'wTransferDetail', query: { id: item.objId } }) 
 | 
        } else if (item.type === 9 && item.status === 0) {   // 调整入库(入库单) 
 | 
            router.push({ name: 'warehousing', query: { id: item.objId, dbid: item.id, type: 9 } }) 
 | 
        } else if (item.type === 9 && item.status === 1) { 
 | 
            router.push({ name: 'wInboundDetail', query: { id: item.objId } }) 
 | 
        } 
 | 
    } 
 | 
  
 | 
    // 列表数据 
 | 
    const onLoad = () => { 
 | 
        if (!finished.value && one.value) { 
 | 
            loading.value = true 
 | 
            page.page = page.page + 1 
 | 
            getList(page).then(res => { 
 | 
                loading.value = false 
 | 
                if (refreshing.value) { 
 | 
                    list.value = [] 
 | 
                    refreshing.value = false; 
 | 
                } 
 | 
                if (res.code === 200 && res.data.records && res.data.records.length !== 0) { 
 | 
                    list.value.push(...res.data.records) 
 | 
                } else { 
 | 
                    finished.value = true 
 | 
                } 
 | 
            }).catch(err => { 
 | 
                refreshing.value = false 
 | 
                loading.value = false 
 | 
                finished.value = true 
 | 
            }) 
 | 
        } 
 | 
        one.value = true 
 | 
    } 
 | 
  
 | 
    // 下拉刷新优化页面 
 | 
    const onRefresh = () => { 
 | 
        page.page = 0 
 | 
        finished.value = false; 
 | 
        loading.value = true; 
 | 
        // pageCounts() 
 | 
        store.dispatch('getUpcomingNum') 
 | 
        onLoad() 
 | 
    } 
 | 
  
 | 
    // 统计数量 
 | 
    // const pageCounts = () => { 
 | 
    //     pageCount({}) 
 | 
    //         .then(res => { 
 | 
    //             if (res.code === 200) { 
 | 
    //                 tagList[0].num = res.data.startNum 
 | 
    //                 tagList[1].num = res.data.endNum 
 | 
    //             } 
 | 
    //         }) 
 | 
    // } 
 | 
  
 | 
    onMounted(async () => { 
 | 
        await proxy.$onWait; 
 | 
        onLoad() 
 | 
        // pageCounts() 
 | 
        await store.dispatch('getUpcomingNum') 
 | 
        tagList[0].num = store.state.upcomingNum.d 
 | 
        tagList[1].num = store.state.upcomingNum.y 
 | 
        status.value = judgmentPlatform() 
 | 
    }) 
 | 
  
 | 
// const info = reactive({ 
 | 
//     list: [] 
 | 
// }) 
 | 
// 
 | 
// const arrs = reactive<Array<object>>([ 
 | 
//     { 
 | 
//         id: 1, 
 | 
//         name: 'WL0001 | 物料名称1', 
 | 
//         num: 1000 
 | 
//     }, 
 | 
//     { 
 | 
//         id: 2, 
 | 
//         name: 'WL0001 | 物料名称2', 
 | 
//         num: 900 
 | 
//     }, 
 | 
//     { 
 | 
//         id: 3, 
 | 
//         name: 'WL0001 | 物料名称3', 
 | 
//         num: 800 
 | 
//     }, 
 | 
//     { 
 | 
//         id: 4, 
 | 
//         name: 'WL0001 | 物料名称4', 
 | 
//         num: 700 
 | 
//     } 
 | 
// ]) 
 | 
// 
 | 
// const PieChartLegendData = reactive<Array<{name: string, icon: string}>>([ 
 | 
//     { 
 | 
//         name: '其它问题', 
 | 
//         icon: 'circle', 
 | 
//     }, 
 | 
//     { 
 | 
//         name: '生产问题', 
 | 
//         icon: 'circle', 
 | 
//     }, 
 | 
//     { 
 | 
//         name: '机器问题', 
 | 
//         icon: 'circle', 
 | 
//     }, 
 | 
//     { 
 | 
//         name: '上道工序问题', 
 | 
//         icon: 'circle', 
 | 
//     }, 
 | 
//     { 
 | 
//         name: '管理问题', 
 | 
//         icon: 'circle', 
 | 
//     } 
 | 
// ]) 
 | 
// 
 | 
// const PieChartSeriesData = reactive<Array<any>>([ 
 | 
//     { 
 | 
//         value: 500, 
 | 
//         name: "其它问题", 
 | 
//         itemStyle: { normal: { color: "#BDBDBD" } } 
 | 
//     }, 
 | 
//     { 
 | 
//         value: 42, 
 | 
//         name: "生产问题", 
 | 
//         itemStyle: { normal: { color: "#4275FC" } } 
 | 
//     }, 
 | 
//     { 
 | 
//         value: 175, 
 | 
//         name: "机器问题", 
 | 
//         itemStyle: { normal: { color: "#32CC93" } } 
 | 
//     }, 
 | 
//     { 
 | 
//         value: 145, 
 | 
//         name: "上道工序问题", 
 | 
//         itemStyle: { normal: { color: "#FAC02A" } } 
 | 
//     }, 
 | 
//     { 
 | 
//         value: 342, 
 | 
//         name: "管理问题", 
 | 
//         itemStyle: { normal: { color: "#E46456" } } 
 | 
//     } 
 | 
// ]) 
 | 
// 
 | 
// const HistogramLegendData = reactive<Array<{name: string, icon: string}>>([ 
 | 
//     { 
 | 
//         name: '计划量', 
 | 
//         icon: 'circle', 
 | 
//     }, 
 | 
//     { 
 | 
//         name: '不量数', 
 | 
//         icon: 'circle', 
 | 
//     }, 
 | 
//     { 
 | 
//         name: '合格数', 
 | 
//         icon: 'circle', 
 | 
//     } 
 | 
// ]) 
 | 
// 
 | 
// const HistogramSeriesData = reactive<Array<any>>([ 
 | 
//     { 
 | 
//         name: '计划量', 
 | 
//         type: 'bar', 
 | 
//         stack: 'total', 
 | 
//         zlevel: 1, 
 | 
//         barWidth: 15, 
 | 
//         itemStyle: { 
 | 
//             color: '#4275FC' 
 | 
//         }, 
 | 
//         emphasis: { 
 | 
//             focus: 'series' 
 | 
//         }, 
 | 
//         data: [320, 302, 301, 334, 390, 330, 320, 390, 330, 320] 
 | 
//     }, 
 | 
//     { 
 | 
//         name: '不量数', 
 | 
//         type: 'bar', 
 | 
//         stack: 'total', 
 | 
//         barWidth: 15, 
 | 
//         itemStyle: { 
 | 
//             color: '#E46456' 
 | 
//         }, 
 | 
//         emphasis: { 
 | 
//             focus: 'series' 
 | 
//         }, 
 | 
//         data: [120, 132, 101, 134, 90, 230, 210, 390, 330, 320] 
 | 
//     }, 
 | 
//     { 
 | 
//         name: '合格数', 
 | 
//         type: 'bar', 
 | 
//         stack: 'total', 
 | 
//         barWidth: 15, 
 | 
//         itemStyle: { 
 | 
//             color: '#EFEFEF', 
 | 
//             barBorderRadius: [10, 10, 0, 0] 
 | 
//         }, 
 | 
//         emphasis: { 
 | 
//             focus: 'series' 
 | 
//         }, 
 | 
//         data: [220, 182, 191, 234, 290, 330, 310, 390, 330, 320] 
 | 
//     } 
 | 
// ]) 
 | 
// 
 | 
// const xAxisData = reactive<Array<string>>(['注射', '催脱', '高排', '烧结', '整形', '机加', '外观', '振光', '酸洗', '成品']) 
 | 
</script> 
 | 
  
 | 
<style lang="scss" scoped> 
 | 
.box { 
 | 
    width: 100%; 
 | 
    background: #ffffff; 
 | 
    .content_top { 
 | 
        top: 0 !important; 
 | 
    } 
 | 
    .content_search { 
 | 
        padding: 30px; 
 | 
        background: white; 
 | 
        position: sticky; 
 | 
        top: 88px; 
 | 
        z-index: 9; 
 | 
        .Search_item { 
 | 
            margin-bottom: 40px; 
 | 
            .Search_item_label { 
 | 
                font-size: 30px; 
 | 
                font-weight: 500; 
 | 
                color: #222222; 
 | 
            } 
 | 
            .Search_item_content { 
 | 
                width: 100%; 
 | 
                display: flex; 
 | 
                align-items: center; 
 | 
                justify-content: space-between; 
 | 
                margin-top: 30px; 
 | 
                input { 
 | 
                    width: 100%; 
 | 
                    height: 70px; 
 | 
                    border-radius: 10px; 
 | 
                    padding: 0 20px; 
 | 
                    box-sizing: border-box; 
 | 
                    border: 1px solid #000000; 
 | 
                    color: black; 
 | 
                    font-size: 26px; 
 | 
                } 
 | 
                input::-webkit-input-placeholder { 
 | 
                    color: #999999; 
 | 
                    font-size: 26px; 
 | 
                } 
 | 
                input:-moz-placeholder { 
 | 
                    color: #999999; 
 | 
                    font-size: 26px; 
 | 
                } 
 | 
                input::-moz-placeholder { 
 | 
                    color: #999999; 
 | 
                    font-size: 26px; 
 | 
                } 
 | 
                input:-ms-input-placeholder { 
 | 
                    color: #999999; 
 | 
                    font-size: 26px; 
 | 
                } 
 | 
                .tag { 
 | 
                    width: 100%; 
 | 
                    display: flex; 
 | 
                    flex-wrap: wrap; 
 | 
                    align-items: center; 
 | 
                    justify-content: space-between; 
 | 
                    .tag_active { 
 | 
                        background: $nav-color !important; 
 | 
                        color: #ffffff !important; 
 | 
                    } 
 | 
                    .tag_item { 
 | 
                        width: 49%; 
 | 
                        padding: 20px 0; 
 | 
                        box-sizing: border-box; 
 | 
                        background: #F2F2F2; 
 | 
                        border-radius: 8px; 
 | 
                        font-size: 26px; 
 | 
                        font-weight: 400; 
 | 
                        color: #333333; 
 | 
                        display: flex; 
 | 
                        align-items: center; 
 | 
                        justify-content: center; 
 | 
                        margin-bottom: 18px; 
 | 
                        &:nth-child(4n) { 
 | 
                            margin-right: 0; 
 | 
                        } 
 | 
                    } 
 | 
                } 
 | 
                span { 
 | 
                    font-size: 26px; 
 | 
                    font-weight: 400; 
 | 
                    color: #333333; 
 | 
                } 
 | 
                .Search_item_content_a { 
 | 
                    width: 308px; 
 | 
                    height: 70px; 
 | 
                    background: #F7F7F7; 
 | 
                    border-radius: 8px; 
 | 
                    border: 1px solid #EEEEEE; 
 | 
                    font-size: 26px; 
 | 
                    font-weight: 400; 
 | 
                    color: #B2B2B2; 
 | 
                    display: flex; 
 | 
                    align-items: center; 
 | 
                    justify-content: center; 
 | 
                } 
 | 
            } 
 | 
        } 
 | 
    } 
 | 
    .content_search_x { 
 | 
        height: 24px; 
 | 
    } 
 | 
    .box_h { 
 | 
        height: 20px; 
 | 
        background: #F7F7F7; 
 | 
    } 
 | 
    .box_list { 
 | 
        width: 100%; 
 | 
        padding: 0 30px; 
 | 
        display: flex; 
 | 
        flex-direction: column; 
 | 
        box-sizing: border-box; 
 | 
        .box_list_item { 
 | 
            padding: 30px 0; 
 | 
            display: flex; 
 | 
            border-bottom: 1px solid #E5E5E5; 
 | 
            &:last-child { 
 | 
                border: none; 
 | 
            } 
 | 
            .box_list_item_icon { 
 | 
                flex-shrink: 0; 
 | 
                width: 64px; 
 | 
                height: 64px; 
 | 
                margin-right: 24px; 
 | 
                position: relative; 
 | 
                .box_list_item_icon_active { 
 | 
                    position: absolute; 
 | 
                    right: 0; 
 | 
                    top: 0; 
 | 
                    width: 18px; 
 | 
                    height: 18px; 
 | 
                    border-radius: 50%; 
 | 
                    background: #DE5243; 
 | 
                    border: 2px solid #FFFFFF; 
 | 
                } 
 | 
                img { 
 | 
                    width: 100%; 
 | 
                    height: 100%; 
 | 
                } 
 | 
            } 
 | 
            .box_list_item_nr { 
 | 
                flex: 1; 
 | 
                display: flex; 
 | 
                flex-direction: column; 
 | 
                .box_list_item_nr_top { 
 | 
                    display: flex; 
 | 
                    align-items: center; 
 | 
                    justify-content: space-between; 
 | 
                    span { 
 | 
                        &:first-child { 
 | 
                            width: 450px; 
 | 
                            font-size: 30px; 
 | 
                            font-weight: 500; 
 | 
                            color: #222222; 
 | 
                            overflow:hidden; 
 | 
                            white-space: nowrap; 
 | 
                            text-overflow: ellipsis; 
 | 
                            -o-text-overflow: ellipsis; 
 | 
                        } 
 | 
                        &:last-child { 
 | 
                            flex-shrink: 0; 
 | 
                            font-size: 24px; 
 | 
                            font-weight: 400; 
 | 
                            color: #999999; 
 | 
                            margin-left: 10px; 
 | 
                            overflow:hidden; 
 | 
                            white-space: nowrap; 
 | 
                            text-overflow: ellipsis; 
 | 
                            -o-text-overflow: ellipsis; 
 | 
                        } 
 | 
                    } 
 | 
                } 
 | 
                .box_list_item_nr_bottom { 
 | 
                    font-size: 28px; 
 | 
                    font-weight: 400; 
 | 
                    color: #666666; 
 | 
                    margin-top: 16px; 
 | 
                    word-break: break-all; 
 | 
                } 
 | 
            } 
 | 
        } 
 | 
    } 
 | 
} 
 | 
</style> 
 |