schangxiang@126.com
2024-12-20 01c3a4658026e9c3ed9daaf1f1b27da368ab11a9
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
<template>
    <view>
        <cu-custom bgColor="bg-white" :isBack="true">
            <block slot="backText">
            </block>
            <block slot="content">盘点</block>
        </cu-custom>
        <view class="flex justify-end align-center padding_right30rpx padding_top12rpx">
            <text class="fontSize12rpx"> 操作人:{{operator}} </text>
        </view>
        <view class="serarch">
            <view style="margin-right: 8px;font-size: 18px;">盘点单号:</view>
            <u-input v-model="orderNo" type="select" placeholder="请选择" height="100" @click="orderVisible = true"></u-input>
        </view>
        <u-select v-model="orderVisible" value-name="id" label-name="orderNo" :list="orderList" @confirm="handlerConfirm"></u-select>
        <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='3' class='font_weight_bold  fontSize36rpx'>盘点单号:</u-col>
                    <u-col :span='8' class='font_weight_bold color_f18202 fontSize36rpx'>{{item.orderNo}}</u-col>
                </u-row>
                <u-row style="margin-top: 10rpx;">
                    <u-col :span='3' class='font_weight_bold  fontSize36rpx'>库位编号:</u-col>
                    <u-col :span='8' class='font_weight_bold color_f18202 fontSize36rpx'>{{item.wareContainerCode}}</u-col>
                </u-row>
                
            </view>
        </view>
        <u-loadmore :status="status"  :load-text="loadText" />
    </view>
</template>
 
<script>
    import ButtonModal from '../../components/buttonModal.vue'
    import ModalCode from '../../components/ModalCode.vue'
    import {getContainerData,getCheckOrderList} from '@/api/check/check.js'
    export default {
        data() {
            return {
                orderNo: '',
                orderList: [],
                orderVisible: false,
                modalshow: false,
                show: false,
                rescode: 0,
                resmessage: "",
                operator: '',
                singlist: [], //物料详情 
                pageNo: 1,
                checkTotal: 0,
                status: "loadmore",
                loadText: {
                    loadmore: '上拉加载更多',
                    loading: '努力加载中',
                    nomore: '已经到底了'
                },
                formQuery: {
                    OrderStatus:1,//计划状态 0-未盘点,1-盘点中,2-已盘点 [Editby shaocx,2023-12-23]
                    OrderId: '',
                    PageNo: 1,
                    PageSize: 10
                }
            };
        },
        components: {
            ButtonModal,
            ModalCode
        },
        //下拉刷新
        onPullDownRefresh() {
            this.singlist = [];
            this.formQuery.PageNo = 1
            this.formQuery.OrderId = ''
            this.orderNo = ''
            this.Status(()=> {
                uni.stopPullDownRefresh(); //停止当前页面下拉刷新
            })
        },
        // 触底事件
        onReachBottom() {
            if(this.checkTotal == this.singlist.length){
                return;
            }
            this.formQuery.PageNo++
            this.Status()
        },
        onLoad() {
            this.operator = JSON.parse(uni.getStorageSync('userInfo')).name;
            this.Status()
            this.getOrderList()
        },
        methods: {
            getOrderList() {
                getCheckOrderList({Status: 1,PageNo: 1,PageSize: 1000}).then(res => {
                    this.orderList = res.data.rows
                    console.log(this.orderList,'orderList')
                })
            },
            //盘点单号
            Status(callback) {
                ////debugger
                this.formQuery.OrderStatus=1;//计划状态 0-未盘点,1-盘点中,2-已盘点 [Editby shaocx,2023-12-23]
                getContainerData(this.formQuery).then((res) => {
                    if (res.data.rows.length == 0 && !callback) {
                        this.status = 'nomore'
                        return;
                    }
                    this.checkTotal = res.data.totalRows;
                    this.singlist.push(...res.data.rows);
                    
                    if(this.checkTotal == this.singlist.length) {
                        this.status = "nomore";
                    }
                    callback && callback();
                    
                })
                
            },
            //跳转
            skip(item) {
                uni.navigateTo({
                    url: `./index?wareContainerCode=${item.wareContainerCode}&orderId=${item.orderId}`
                })
                console.log(2222)
            },
            handlerConfirm(e) {
                this.orderNo = e[0].label
                this.formQuery.OrderId = e[0].value
                this.singlist = []
                this.formQuery.PageNo = 1
                this.Status()
            }
        }
    }
</script>
 
<style lang="scss" scoped>
    // 盘点中
    .inventory {
        border: 1px solid #08cd39;
        border-radius: 40vh;
        color: #08cd39;
        background-color: #e6ffec;
    }
    .serarch {
        width: 98%;
        margin: 10px auto;
        background: #fff;
        padding: 15px;
        box-sizing: border-box;
        display: flex;
        justify-content: flex-start;
        align-items: center;
    }
 
    // 未盘点
    .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;
    }
</style>