jiangping
2023-08-17 6365ab0a976afdd247742c9b3dca15deb3a7a7a1
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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
<template>
    <div class="rework">
        <div class="rework_list">
            <div class="rework_list_item" @click="show = true">
                <span>检验申请类型</span>
                <div class="rework_list_item_right">
                    <span :class="form.typeName ? 'black' : ''">{{form.typeName ? form.typeName : '点击选择'}}</span>
                    <van-icon name="arrow" size="20" color="#999999" />
                </div>
            </div>
            <div class="rework_list_item" @click="openDH = true">
                <span>客返单号</span>
                <div class="rework_list_item_right">
                    <span :class="form.singleName ? 'black' : ''">{{form.singleName ? form.singleName : '点击选择客返单号'}}</span>
                    <van-icon name="arrow" size="20" color="#999999" />
                </div>
            </div>
            <div class="rework_list_item">
                <span>客返客户</span>
                <div class="rework_list_item_right">
                    <span class="black">{{form.clientName}}</span>
                </div>
            </div>
            <div class="rework_list_item">
                <span>退回原因</span>
                <div class="rework_list_item_right">
                    <input type="text" v-model="form.reason" placeholder="请输入退回原因" />
                </div>
            </div>
        </div>
        <div class="rework_qd">
            <div class="rework_qd_title">
                <div class="x"></div>
                <span>退回工装清单(1)</span>
            </div>
            <van-swipe-cell>
                <div class="rework_qd_item">
                    <div class="rework_qd_item_i">
                        <span class="black">LK0001:</span><span class="black">10件</span>
                    </div>
                    <div class="rework_qd_item_i">
                        <span>物料信息:</span><span>花键2993 | 21E8-002-2993-H1</span>
                    </div>
                    <div class="rework_qd_item_i">
                        <span>批次号:</span><span>PC-20220719-0001</span>
                    </div>
                </div>
                <template #right>
                    <van-button style="height: 100%;" square type="danger" text="删除" />
                </template>
            </van-swipe-cell>
        </div>
        <div class="rework_footer">
            <div class="rework_footer_add" @click="open">扫码添加工装</div>
            <div style="width: 22px;"></div>
            <button class="rework_footer_submit">提交</button>
        </div>
        <v-ScanCode
            :openCode="openCode"
            :infos="['请扫描工装码']"
            @closePopup="closePopup"
            @onDecode="onDecode">
        </v-ScanCode>
        <!--    类型    -->
        <van-popup v-model:show="show" position="bottom" round :style="{ height: '45%' }">
            <van-picker
                title="请选择类型"
                :columns="columns"
                @confirm="onConfirm"
                @cancel="onCancel"
            />
        </van-popup>
        <!--    单号    -->
        <van-popup v-model:show="openDH" position="bottom" round :style="{ height: '45%' }">
            <van-picker
                title="请选择单号"
                :columns="columns3"
                @confirm="onConfirm3"
                @cancel="onCancel3"
            />
        </van-popup>
    </div>
</template>
 
<script setup lang="ts">
    import { ref, reactive } from 'vue'
 
    // 表单数据
    let form = reactive({
        type: '',
        typeName: '',
        clientName: '客户',
        single: '',
        singleName: '',
        reason: ''
    })
 
    // 类型
    const columns = [{ text: '工序返工', id: 1 },{ text: '客退返工', id: 2 },{ text: '客返返修', id: 3 }]
 
    // 单号
    const columns3 = ['杭州', '宁波', '温州', '绍兴', '湖州', '嘉兴', '金华']
 
    let show = ref<boolean>(false)
 
    let openDH = ref<boolean>(false)
 
    let openCode = ref<boolean>(false)
 
    // 类型确认
    const onConfirm = (value: any) => {
        form.type = value.id
        form.typeName = value.text
        show.value = false
    };
 
    const onCancel = () => {
        show.value = false
    }
 
    const onConfirm3 = (value: any) => {
        form.single = value.id
        form.singleName = value.text
        openDH.value = false
    };
 
    const onCancel3 = () => {
        openDH.value = false
    }
 
    const closePopup = (): void => {
        openCode.value = false
    }
 
    const onDecode = (data: string[]): void => {
        console.log(data)
        openCode.value = false
    }
 
    const open = (): void => {
        openCode.value = true
    }
</script>
 
<style lang="scss" scoped>
    .rework {
        width: 100%;
        height: 100%;
        position: absolute;
        .rework_list {
            display: flex;
            flex-direction: column;
            background: white;
            margin-top: 20px;
            .rework_list_item {
                display: flex;
                align-items: center;
                justify-content: space-between;
                height: 98px;
                padding: 0 30px;
                border-bottom: 1PX solid #E5E5E5;
                &:last-child {
                    border: none;
                }
                span {
                    font-size: 30px;
                    font-weight: 400;
                    color: #222222;
                    flex-shrink: 0;
                }
                .rework_list_item_right {
                    display: flex;
                    align-items: center;
                    span {
                        font-size: 28px;
                        font-weight: 400;
                        color: #999999;
                    }
                    .black {
                        color: black !important;
                    }
                    input {
                        width: 230px;
                        font-size: 28px;
                        border: none;
                    }
                    input::-webkit-input-placeholder { /* WebKit browsers */
                        font-size: 28px;
                        font-weight: 400;
                        color: #B2B2B2;
                    }
                }
            }
        }
        .rework_qd {
            margin-top: 40px;
            .rework_qd_title {
                display: flex;
                align-items: center;
                padding: 0 30px 30px 30px;
                span {
                    font-size: 32px;
                    font-weight: 500;
                    color: #222222;
                }
                .x {
                    width: 8px;
                    height: 30px;
                    background: #4275FC;
                    border-radius: 2px;
                    margin-right: 12px;
                }
            }
            .rework_qd_item {
                background: #ffffff;
                padding: 30px;
                display: flex;
                flex-direction: column;
                .rework_qd_item_i {
                    display: flex;
                    align-items: center;
                    margin-bottom: 30px;
                    &:last-child {
                        margin-bottom: 0!important;
                    }
                    .black {
                        font-size: 30px!important;
                        font-weight: 400!important;
                        color: #222222!important;
                    }
                    span {
                        &:first-child {
                            font-size: 26px;
                            font-weight: 400;
                            color: #666666;
                        }
                        &:last-child {
                            font-size: 26px;
                            font-weight: 400;
                            color: #333333;
                        }
                    }
                }
            }
        }
        .rework_footer {
            width: calc(100% - 60px);
            position: fixed;
            bottom: 0;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 30px 68px 30px;
            .rework_footer_add {
                flex: 1;
                height: 88px;
                font-size: 30px;
                font-weight: 500;
                color: $nav-color;
                background: #FFFFFF;
                box-shadow: 0 0 12px 0 rgba(0,0,0,0.0800);
                border-radius: 8px;
                display: flex;
                align-items: center;
                justify-content: center;
            }
            .rework_footer_submit {
                flex: 1;
                height: 88px;
                font-size: 30px;
                font-weight: 500;
                color: #ffffff;
                background: $nav-color;
                box-shadow: 0 0 12px 0 rgba(0,0,0,0.0800);
                border-radius: 8px;
                display: flex;
                align-items: center;
                justify-content: center;
                border: none;
            }
        }
    }
</style>