schangxiang@126.com
2024-12-08 df485888ecb9f69c0051fc192b87aec700cc4f89
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
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
<template>
    <view>
        <cu-custom bgColor="bg-white" :isBack="true">
            <block slot="backText"> </block>
            <block slot="content">盘点下发</block>
        </cu-custom>
        <u-form labelPosition="left" label-width="150rpx" :model="checkForm" ref="warehouseRef">
            <u-row class="border_bottom margin_top10rpx  background_fff padding_left25rpx ">
                <u-col span="10">
                    <u-form-item label="盘点单号:" prop="orderNo" class="uFormItem">
                        <u-input v-model.trim="checkForm.orderNo" class="width" :clearable="false" placeholder="请输入单号"
                            @confirm="Status('', 1)"></u-input>
                    </u-form-item>
                </u-col>
                <u-col span="2" @tap="containerFocus">
                    <span class="fontSize15rpx">选择</span>
                    <u-icon name="arrow-right" size="14" class="fontSize15rpx"></u-icon>
                </u-col>
                <view class="boxList" v-show="modalshow" @click="modalshow = false" @touchmove.stop>
                    <view class="innerWrap">
                        <ul v-for="(item, eindex) in wolist" :key="eindex">
                            <li @click="confirm2(eindex)"> {{ item.text }}</li>
                        </ul>
                    </view>
                </view>
            </u-row>
            <u-row class="border_bottom margin_top10rpx  background_fff padding_left25rpx padding_right30rpx">
                <u-col span="12" class="margin_top10rpx">
                    <u-form-item label="盘点阶段:" prop="checkStage" class="uFormItem">
                        <u-input v-model="checkForm.checkStageName" type="select" @click="showLeiBie = true"
                            placeholder="请选择盘点阶段" class="width">
                        </u-input>
                    </u-form-item>
                </u-col>
            </u-row>
        </u-form>
        <!-- <view class="background_fff margin_bottom25rpx margin_top25rpx content-item">
            <u-row>
                <u-col :span="3" style="text-align: center; padding: 25rpx 0" v-for="(item, index) in checklist"
                    :key="index" @click="Status(item.status,2)">
                    <view class="" style="border-right: 1px solid #efefef">
                        <view class="padding_bottom18">
                            {{ item.statusName }}
                        </view>
                        <view class="font_weight_bold fontSize36rpx" :class="item.statusName == '总数量'
                                ? 'col-0d11c9'
                                : item.statusName == '盘点中'
                                    ? 'col-0ece3d'
                                    : item.statusName == '未盘点'
                                        ? 'col-ff9d0b'
                                        : 'col-0589ff'
                            ">
                            {{ item.count }}
                        </view>
                    </view>
                </u-col>
            </u-row>
        </view> -->
        <view>
            <view class="padding15 background_fff margin_bottom10rpx content-item" v-for="(item, index) in singlist"
                :key="index" @click="skip(item)">
                <u-row>
                    <u-col span="1">
                        <text class="flex justify-center align-center circkle06">{{ index + 1 }}</text>
                    </u-col>
                    <u-col :span="8">
                        <text class="font_weight_bold color_f18202 fontSize36rpx"> {{ item.orderNo }} </text>
                        <!-- <text class="subTitle"> {{ item.updatedTime }} </text> -->
                    </u-col>
                    <u-col :span="3">
                        <view class="text_align_center text_dot" :class="item.checkStageName == '初盘开启'
                            ? 'inventory'
                            : item.checkStageName == '复盘开启'
                                ? 'noinventory'
                                : 'haveinventory'
                            ">
                            {{ item.checkStageName }}
                        </view>
                    </u-col>
                </u-row>
                <u-row>
                    <!-- <u-col span="6">
                        <view class="Wb_box">
                            <text class="el_batchNo"> 仓库: </text>
                            <text class="el_batchVal">{{ item.areaName }}</text>
                        </view>
                    </u-col> -->
                    <u-col span="6">
                        <view class="Wb_box">
                            <text class="el_batchNo"> 盘点方式: </text>
                            <text class="el_batchVal">{{ item.checkModeName }}</text>
                        </view>
                    </u-col>
                    <u-col span="6">
                        <view class="Wb_box">
                            <text class="el_batchNo"> 库区: </text>
                            <text class="el_batchVal"> {{ item.areaName }}</text>
                        </view>
                    </u-col>
                </u-row>
 
                <!-- <u-row>
                    <u-col span="6">
                        <view class="Wb_box">
                        <text class="el_batchNo"> 容器总数: </text>
                        <text class="el_batchVal">{{ item.locationCount }}</text></view>
                    </u-col>
                    <u-col span="6">
                        <view class="Wb_box">
                        <text class="el_batchNo"> 物料总数: </text>
                        <text class="el_batchVal"> {{ item.materialCount }}</text></view>
                    </u-col>
                </u-row> -->
 
 
                <!-- <u-row class="fontSize30rpx">
                    <u-col :span="7" style="padding: 18rpx">规则名称:{{ item.ruleName }}</u-col>
                    <u-col :span="5"> 库位数:{{ item.locationCount }} </u-col>
                </u-row>
                <u-row class="fontSize30rpx">
                    <u-col :span="12" class="text-gray" style="padding: 0 20rpx">创建日期:{{ item.updatedTime }}</u-col>
                </u-row>
                <u-row class="fontSize30rpx">
                    <u-col :span="12" class="text-gray" style="padding: 0 20rpx">父盘点单:{{ item.parentId }}</u-col>
                </u-row> -->
            </view>
        </view>
        <u-loadmore :status="status" :load-text="loadText" />
 
        <u-select v-model="showLeiBie" :list="borrowLeiBieList" value-name="id" label-name="value"
            @confirm="confirmLeiBie"></u-select>
    </view>
</template>
 
<script>
import ButtonModal from "../../../components/buttonModal.vue";
import ModalCode from "../../../components/ModalCode.vue";
import { query, Status } from "@/api/check/check.js";
export default {
    data() {
        return {
            renameFocus: false,
            modalshow: false,
            show: false,
            rescode: 0,
            resmessage: "",
            operator: "",
            active: null, //跳转样式
            singlist: [], //物料详情
            checklist: [], //盘点统计
            checkForm: {
                page: 1,
                PageSize: 10,
                orderNo: "",
                checkStage: "",
                CheckStageForPda: true
            },
            checkTotal: 0,
            status: "loadmore",
            loadText: {
                loadmore: "上拉加载更多",
                loading: "努力加载中",
                nomore: "已经到底了",
            },
            showLeiBie: false,
            borrowLeiBieList: [
                {
                    id: 1,
                    value: "初盘开启",
                },
                {
                    id: 4,
                    value: "复盘开启",
                }
            ],
            warehouse: {
                code: "",
                ToolTypeCode: "",
                customerCodeName: "",
                borrowUserName: "",
                taskType: "",
                taskTypeName: "",
                planNo: "",
                remark: "",
                returnTime: "",
            },
            wolist: [],
            modalshow: false
        };
    },
    components: {
        ButtonModal,
        ModalCode,
    },
    //下拉刷新
    onPullDownRefresh() {
        this.$nextTick(function () {
            uni.stopPullDownRefresh(); //停止当前页面下拉刷新
        });
    },
    // 触底事件
    onReachBottom() {
        if (this.checkTotal == this.singlist.length) {
            return;
        }
        this.checkForm.page++;
        this.Status('all');
    },
    onLoad() {
        this.operator = JSON.parse(uni.getStorageSync("userInfo")).name;
        // this.query();
        this.Status('all', 'init');
 
 
    },
    methods: {
        getLeiBieList() {
            // GetWareToolTypeLst().then(res => {
            //     if(res.data.length == 0){
            //         return;
            //     }
            //     this.borrowLeiBieList = res.data;
            // })
        },
        confirmLeiBie(con) {
            console.log(con);
            this.checkForm.checkStage = con[0].value;
            this.checkForm.checkStageName = con[0].label;
            this.Status('', 1);
        },
        //盘点统计
        query() {
            query().then((res) => {
                this.checklist = res.data.list;
                this.checklist.unshift({
                    count: "",
                    status: "",
                    statusName: "总数量",
                });
                this.checklist[0].count = this.checklist.reduce((prev, next) => {
                    return Number(prev) + Number(next.count);
                }, 0);
            });
        },
        //盘点单号
        Status(callback, param) {
            if (callback == "all") {
                if (param == 'init') { //初始化
                    this.checkForm.Status = ''
                }
                Status(this.checkForm).then((res) => {
                    // if (res.data.rows.length == 0 && !callback) {
                    //     this.status = "nomore";
                    //     return;
                    // }
                    this.checkTotal = res.result?.total ?? [];
                    if (res.result.items && res.result.items.length > 0) {
                        this.singlist.push(...res.result.items);
                    }
                    // if (this.checkTotal == this.singlist.length) {
                    //     this.status = "nomore";
                    // }
                    // callback && callback();
                });
            } else {
                if (param == 1) {    // 单号 任务类型入口
                    this.checkForm.page = 1;
                }
                if (param == 2) {// tab切换
                    this.checkForm.Status = callback;
                    this.checkForm.page = 1;
                    this.checkForm.planNo = '';
                    this.checkForm.taskTypeName = '';
                }
 
                this.singlist = []
                Status(this.checkForm).then((res) => {
                    this.checkTotal = res.result?.total ?? [];
                    if (res.result.items && res.result.items.length > 0) {
                        this.singlist.push(...res.result.items);
                    }
                });
            }
        },
        //跳转
        skip(item) {
            uni.navigateTo({
                url: `./check?item=${JSON.stringify(item)}`,
            });
        },
        //类型聚焦事件
        containerFocus() {
            uni.hideKeyboard()
            this.getVehicleType();
            this.modalshow = true
        },
        //类型选择
        confirm2(index) {
            this.checkForm.orderNo = this.wolist[index].text;
            this.Status('', 1);
            // this.checkForm.orderNo = this.wolist[index].id;
        },
 
        //类型
        getVehicleType() {
            Status({
                'page': 1,
                'PageSize': 50,
                'CheckStageForPda': true
            }).then((res) => {
                const dataT = res.result.items;
                if (dataT && dataT.length == 0) {
                    this.rescode = 400
                    this.resmessage = '暂无数据'
                    this.$refs.resmodal.show = true
                    return
                }
                dataT.forEach(item => {
                    item.text = item.orderNo;
                    item.id = item.orderNo;
                })
                this.wolist = dataT
            })
        }
    },
};
</script>
 
<style lang="scss" scoped>
// 盘点中
.inventory {
    border: 1px solid #08cd39;
    border-radius: 40vh;
    color: #08cd39;
    background-color: #e6ffec;
    // width: 60px;
    font-size: 12px;
}
 
// 未盘点
.noinventory {
    border: 1px solid #ff9d0c;
    border-radius: 40vh;
    color: #ff9d0c;
    background-color: #fff7ea;
}
 
// 已盘点
.haveinventory {
    border: 1px solid #0a8cff;
    border-radius: 40vh;
    color: #0a8cff;
    background-color: #e7f5ff;
}
 
.col-0d11c9 {
    color: #0d11c9;
}
 
.col-0ece3d {
    color: #0ece3d;
}
 
.col-ff9d0b {
    color: #ff9d0b;
}
 
.col-0589ff {
    color: #0589ff;
}
 
.content-item {
    width: 98%;
    border-radius: 8rpx;
    margin: 10rpx auto;
}
 
 
.boxList {
    transition: all ease 2s;
    position: fixed;
    bottom: 0;
    left: 0;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    z-index: 999;
    background: rgba(0, 0, 0, 0.6);
 
    .innerWrap {
        max-height: 50%;
        overflow-y: auto;
        background: white;
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
 
        ul {
            padding: 0;
            margin: 0;
 
            li {
                padding: 0;
                margin: 0;
                border-bottom: 1px solid #e4e7ed;
                list-style-type: none;
                display: flex;
                flex-direction: row;
                line-height: 1;
                justify-content: center;
                align-items: center;
                font-size: 13px;
                padding: 14px 0;
                flex-direction: column;
            }
        }
    }
 
}
 
.text_dot{
    font-size: 12px !important;
}
</style>