jiangping
2023-08-21 2837bdd57f72e386bbf9a725e7b3a13e5eb9e930
h5_standard/src/views/productionInspection/selectWorkOrder.vue
@@ -96,7 +96,7 @@
<script setup lang="ts">
    import { reactive, ref, onMounted, onActivated } from "vue"
    import { useRouter } from "vue-router"
    import { useRouter, useRoute } from "vue-router"
    import { gsdate, judgmentPlatform } from '@/utils/utils'
    import { getList, pageCount } from '@/apis/WorkOrderAPI'
    import { model } from '@/interface'
@@ -104,6 +104,7 @@
    import vLableSelection from '@/components/common/LabelSelection.vue'
    const router = useRouter()
    const route = useRoute()
    // 搜索数据接口
    interface form extends model {
@@ -140,23 +141,25 @@
    const refreshing = ref(false)
    // 搜索分类标签
    let tagList: any = reactive([
        {
            id: [0,1],
            name: '待生产',
            num: ''
        },
        {
            id: [2,3],
            name: '生产中',
            num: ''
        },
        {
            id: [4,5,6],
            name: '已完成',
            num: ''
        }
    ])
    let tagList: any = ref([])
    // [
    //     {
    //         id: [0,1],
    //         name: '待生产',
    //         num: ''
    //     },
    //     {
    //         id: [2,3,7],
    //         name: '生产中',
    //         num: ''
    //     },
    //     {
    //         id: [4,5,6],
    //         name: '已完成',
    //         num: ''
    //     }
    // ]
    // 重置
    const reset = () => {
@@ -240,7 +243,7 @@
                    mixParam: form.mixParam,
                    startDate: form.startDate,
                    endDate: form.endDate,
                    statusList: form.statusList.length === 0 ? tagList[0].id : form.statusList
                    statusList: form.statusList.length === 0 ? tagList.value[0].id : form.statusList
                }
            }).then(res => {
                if (refreshing.value) {
@@ -277,16 +280,49 @@
    const pageCounts = () => {
        pageCount({}).then(res => {
            if (res.code === 200) {
                tagList[0].num = String(res.data.startNum)
                tagList[1].num = String(res.data.ingNum)
                tagList[2].num = String(res.data.endNum)
                tagList.value.forEach((item: any) => {
                    if (item.name == '待生产') {
                        item.num = String(res.data.startNum)
                    }
                    if (item.name == '生产中') {
                        item.num = String(res.data.ingNum)
                    }
                    if (item.name == '已完成') {
                        item.num = String(res.data.endNum)
                    }
                })
                // tagList.value[0].num = String(res.data.startNum)
                // tagList.value[1].num = String(res.data.ingNum)
                // tagList.value[2].num = String(res.data.endNum)
            }
        })
    }
    onMounted(() => {
        pageCounts()
        if (route.query.type == '1') {
            tagList.value = [
                {
                    id: [0,1],
                    name: '待生产',
                    num: ''
                },
                {
                    id: [2,3,7],
                    name: '生产中',
                    num: ''
                }
            ]
        } else {
            tagList.value = [
                {
                    id: [2,3,7],
                    name: '生产中',
                    num: ''
                }
            ]
        }
        status.value = judgmentPlatform()
        pageCounts()
    })
    onActivated(() => {