1
huangxiaoqiang
2025-10-24 927ce822017ff8459be84b742d519970ca614096
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
<template>
    <view>
        <!-- <uni-segmented-control :current="current" :values="items" @clickItem="onClickItem">
        </uni-segmented-control> -->
        <view class="content">
            <!-- <view v-if="current === 0" class="headerstyle"> -->
                <view class="itemstyle">
                    <u-sticky>
                        <view style="background-color: #ffffff;">
                            <uni-search-bar @confirm="search" v-model="searchValue"></uni-search-bar>
                        </view>
                    </u-sticky>
                    <uni-forms label-width="50">
                        <uni-forms-item label="出库区域"><uni-data-select v-model="value"
                                :localdata="range"></uni-data-select></uni-forms-item>
                    </uni-forms>
                    <uni-list :border="true">
                        <uni-list-item direction="column" v-for="(item,index) in orderInfo" :key="item.dtlId">
                            <template v-slot:body>
                                <view class="uni-list-box">
                                    <button type="primary" style="position: absolute;right: 1%;" size="mini"
                                        @click="OutBound(item.id)">出库</button>
                                    <view class="uni-content">
                                        <view style="font-size: 18px;">单据编号:{{orderNo}}</view>
                                        <view style="font-size: 18px;">物料编码:{{item.materielCode}}</view>
                                        <view style="font-size: 18px;">物料名称:{{item.materielName}}</view>
                                        <view style="font-size: 18px;">单据数量:{{item.orderQuantity}}</view>
                                        <!-- <view style="font-size: 18px;">已分配数量:{{item.processQty}}</view> -->
                                        <view style="font-size: 18px;">出库数量:{{item.overOutQuantity}}</view>
                                    </view>
                                </view>
                            </template>
                        </uni-list-item>
                    </uni-list>
                </view>
                <u-toast ref="uToast" />
            <!-- </view> -->
        </view>
    </view>
    </view>
</template>
 
<script>
    import {
        config
    } from '../../common/config';
    const innerAudioContext = uni.createInnerAudioContext();
    export default {
        data() {
            return {
                items: ['直接出库'],
                current: 0,
                orderNo: "",
                Id: 0,
                AreaId: "",
                orderIds: [],
                orderInfo: [],
                searchValue: "",
                value:"2",
                label: "",
                range: [],
                orderDetail: {},
                focus: false,
                key: [],
                materielCode: "",
            }
        },
        onShow() {},
        onLoad(res) {
            this.focus = false;
            this.addressFocus = false;
            this.Id = res.Id;
            this.orderNo = res.orderNo;
            this.range = config.OutArea;
            this.getData();
        },
        methods: {
            groupClick(materielCode, id) {
                // window.location="/pages/materielGroup/OutOrderDetail?materielCode="+materielCode+"&id="+id;
                // console.log(materielCode,id)
            },
            search() {
                this.getData();
            },
            getData() {
                var id = this.Id
                var postData = {
                    id: id,
                    searchValue: this.searchValue,
                };
                this.$u.post('/api/InventoryOutboundOrder/GetInventoryOutboundOrderDetail', postData).then((res) => {
                    if (res.status) {
                        this.orderInfo = res.data;
                        // if (this.orderDetail.length > 3) {
                        //     this.loadVisible = true;
                        // }
                    }
                })
            },
            onClickItem(e) {
                this.focus = false;
                this.addressFocus = false;
                if (this.current !== e.currentIndex) {
                    this.current = e.currentIndex;
                    if (this.current == 2) {
                        this.getData();
                    }
                }
            },
            OutBound(id) {
                this.orderIds=[];
                this.orderIds.push(id);
                var postData = {
                    AreaId: this.value,
                    orderIds: this.orderIds
                };
                console.log(postData);
                this.$u.post('/api/InventoryOutboundOrder/GenerateInventoryOutboundTask', postData).then(res => {
                    if (res.status) {
                        this.items = [];
                        uni.$showMsg(res.message);
                        setTimeout(() => {
                            this.addressFocus = false;
                        }, 200);
                    } else {
                        this.$refs.uToast.show({
                            title: res.message,
                            type: "error"
                        })
                    }
                }).catch(err => {
                    this.$refs.uToast.show({
                        title: err.message,
                        type: "error"
                    })
                })
            },
            click(e) {
                if (this.key.find(x => x.id == e.id)) {
                    this.key.map((item, index) => {
                        if (item.id == e.id) {
                            this.key.splice(index, 1);
                        }
                    })
                } else {
                    this.key.push(e.id);
                }
            }
        }
    }
</script>
 
<style lang="scss">
    @import '@/common/uni-ui.scss';
 
    .flex-row {
        display: flex;
        justify-content: space-between;
        /* 左右对齐 */
        align-items: center;
        /* 垂直居中 */
        padding: 10rpx 0;
    }
 
    .label {
        color: #666;
        width: 200rpx;
        /* 固定标签宽度 */
        text-align: left;
    }
 
    .value {
        flex: 1;
        text-align: right;
        color: #333;
        font-weight: bold;
    }
</style>