jiangping
2023-08-21 2837bdd57f72e386bbf9a725e7b3a13e5eb9e930
h5_standard/src/views/workOrder/spotCheck.vue
@@ -98,7 +98,7 @@
</template>
<script setup lang="ts">
    import { ref, onMounted } from 'vue'
    import { ref, onMounted, getCurrentInstance, onBeforeUnmount } from 'vue'
    import { useRoute, useRouter } from "vue-router"
    import { queryById, getJdList, createDJ } from '@/apis/WorkOrderAPI'
    import { Toast } from 'vant'
@@ -108,6 +108,7 @@
    const route = useRoute()
    const router = useRouter()
    const { $Bus }  = getCurrentInstance().appContext.config.globalProperties
    // 控制日期显示隐藏
    let timer = ref<boolean>(false)
@@ -239,14 +240,9 @@
                id: route.query.id
            }).then(res => {
                if (res.code === 200) {
                    Toast.success({
                        message: '创建成功',
                        duration: 2000,
                        forbidClick: true
                    })
                    setTimeout(() => {
                        router.go(-1)
                    }, 2000)
                    Toast.success({ message: '创建成功', duration: 2000, forbidClick: true })
                    // $Bus.emit('callback1', '1')
                    setTimeout(() => { router.go(-1) }, 2000)
                }
            })
        } else {
@@ -282,6 +278,10 @@
        queryByIds()
        getJdLists()
    })
    onBeforeUnmount(() => {
        $Bus.all.delete("callback1")
    })
</script>
<style lang="scss" scoped>