<template> 
 | 
  <div class="rk"> 
 | 
    <div class="rk_list"> 
 | 
      <template v-if="list && list.length > 0"> 
 | 
        <div class="rk_list_item" v-for="(item, index) in list" :key="index" @click="clickItem(index)"> 
 | 
          <input type="checkbox" :checked="item.active" /> 
 | 
          <div class="rk_list_item_right"> 
 | 
            <span>{{item.code}}  转库入库</span> 
 | 
            <div class="rk_list_item_right_bottom"> 
 | 
              <span>接收人:{{item.userName}}</span> 
 | 
              <span>入库时间:{{item.dealDate}}</span> 
 | 
            </div> 
 | 
          </div> 
 | 
        </div> 
 | 
      </template> 
 | 
      <NoFound v-else /> 
 | 
    </div> 
 | 
    <div class="rk_zw"></div> 
 | 
    <div class="rk_footer"> 
 | 
      <button class="rk_footer_submit" v-preventReClick @click="submit">确认余留次班</button> 
 | 
    </div> 
 | 
  </div> 
 | 
</template> 
 | 
  
 | 
<script setup lang="ts"> 
 | 
    import { ref, onMounted } from 'vue' 
 | 
    import { useRouter, useRoute } from "vue-router" 
 | 
    import { finishedInBill, finishedDetail } from '@/apis/WorkOrderAPI' 
 | 
    import NoFound from '@/components/common/NotFound.vue' 
 | 
  
 | 
    const router = useRouter() 
 | 
  
 | 
    const route = useRoute() 
 | 
  
 | 
    let list = ref<Array<any>>([]) 
 | 
  
 | 
    // 点击项 
 | 
    const clickItem = (index: number): void => { 
 | 
        list.value[index].active = !list.value[index].active 
 | 
    } 
 | 
  
 | 
    // 获取余留次班 
 | 
    const finishedInBills = () => { 
 | 
        finishedInBill({ 
 | 
            inLocationIds: route.query.id 
 | 
        }).then(res => { 
 | 
            if (res.code === 200) { 
 | 
                // console.log(res) 
 | 
                // let data: any = route.query.ids 
 | 
                // if (data) { 
 | 
                //   let ids: any = data.split(',') 
 | 
                //   if (ids.length > 0) { 
 | 
                //     res.data.forEach((item: any, index: number) => { 
 | 
                //       item.isactive = false 
 | 
                //       ids.forEach((item1: any) => { 
 | 
                //         if (item.id === Number(item1)) { 
 | 
                //           res.data.splice(index, 1) 
 | 
                //         } 
 | 
                //       }) 
 | 
                //     }) 
 | 
                //   } else { 
 | 
                    res.data.forEach((item: any) => { 
 | 
                      item.isactive = false 
 | 
                    }) 
 | 
                //   } 
 | 
                // } 
 | 
                list.value = res.data 
 | 
            } 
 | 
        }) 
 | 
    } 
 | 
  
 | 
    // 提交 
 | 
    const submit = () => { 
 | 
        let ids: any = []; 
 | 
        list.value.forEach((item: any) => { 
 | 
            if (item.active) { 
 | 
                ids.push(item.id) 
 | 
            } 
 | 
        }) 
 | 
        window.sessionStorage.setItem('ids', ids.join(',')) 
 | 
        router.go(-1) 
 | 
    } 
 | 
  
 | 
    onMounted(() => { 
 | 
        finishedInBills() 
 | 
    }) 
 | 
</script> 
 | 
  
 | 
<style lang="scss" scoped> 
 | 
  .rk { 
 | 
    width: 100%; 
 | 
    box-sizing: border-box; 
 | 
    height: 100%; 
 | 
    position: absolute; 
 | 
    background: #F7F7F7; 
 | 
    .rk_list { 
 | 
      .rk_list_notfound { 
 | 
        margin-top: 300px; 
 | 
        display: flex; 
 | 
        align-items: center; 
 | 
        justify-content: center; 
 | 
        img { 
 | 
          width: 80%; 
 | 
        } 
 | 
      } 
 | 
      .rk_list_item { 
 | 
        padding: 30px; 
 | 
        display: flex; 
 | 
        background: white; 
 | 
        border-bottom: 1px solid #F7F7F7; 
 | 
        &:last-child { 
 | 
          border: none; 
 | 
        } 
 | 
        input { 
 | 
          width: 30px; 
 | 
          height: 30px; 
 | 
        } 
 | 
        .rk_list_item_right { 
 | 
          width: 100%; 
 | 
          margin-left: 20px; 
 | 
          display: flex; 
 | 
          flex-direction: column; 
 | 
          justify-content: space-between; 
 | 
          span { 
 | 
            font-size: 30px; 
 | 
            font-weight: 500; 
 | 
            color: #333333; 
 | 
          } 
 | 
          .rk_list_item_right_bottom { 
 | 
            display: flex; 
 | 
            align-items: center; 
 | 
            justify-content: space-between; 
 | 
            margin-top: 24px; 
 | 
            span { 
 | 
              font-size: 24px; 
 | 
              font-weight: 400; 
 | 
              color: #666666; 
 | 
            } 
 | 
          } 
 | 
        } 
 | 
      } 
 | 
    } 
 | 
    .rk_zw { 
 | 
      height: 168px; 
 | 
    } 
 | 
    .rk_footer { 
 | 
      position: fixed; 
 | 
      bottom: 0; 
 | 
      width: 100%; 
 | 
      padding-bottom: 68px; 
 | 
      background: white; 
 | 
      .rk_footer_submit { 
 | 
        width: calc(100% - 60px); 
 | 
        height: 88px; 
 | 
        border: none; 
 | 
        background: $nav-color; 
 | 
        box-shadow: 0 0 12px 0 rgba(0, 0, 0, 0.08); 
 | 
        border-radius: 8px; 
 | 
        font-size: 30px; 
 | 
        font-weight: 500; 
 | 
        color: #FFFFFF; 
 | 
        display: flex; 
 | 
        align-items: center; 
 | 
        justify-content: center; 
 | 
        margin: 0 auto; 
 | 
      } 
 | 
    } 
 | 
  } 
 | 
</style> 
 |