Mr.Shi
2023-08-11 6e19ef63c0a87588abd76c04ab228a73e3060ea4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
<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>