qq_41295110
2025-07-29 d6e85273661b4d96783ebf35ac919b73bbf427d4
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
<template>
    <view class="content">
        <view class="form">
            <view class="form-item">
                <view class="title"><text>*</text>条码:</view>
                <view class="right" style="width: 380rpx;">
                    <input v-model="HBarCode" placeholder="请扫描(或输入)条码" @confirm="getCode(HBarCode)" />
                </view>
                <uni-icons type="scan"
                    style="margin-left: 10rpx;background-color: #3A78FF;padding: 6rpx;color: #fff;border-radius: 100%;"
                    size="20" @click="toScanCode"></uni-icons>
            </view>
            <view class="form-item">
                <view class="title">单据号:</view>
                <view class="righton">
                    <input v-model="baseInfo.HBillNo" disabled />
                </view>
            </view>
            <view class="form-item">
                <view class="title">供应商:</view>
                <view class="righton">
                    <input v-model="baseInfo.HSupName" disabled />
                </view>
            </view>
            <view class="form-item">
                <view class="title">部门:</view>
                <view class="righton">
                    <input v-model="baseInfo.HDeptName" disabled />
                </view>
            </view>
        </view>
 
        <view style="width: 100%;height: 16rpx;background-color: #e5e5e5;"></view>
 
        <view class="list" v-for="(item,index) in listData" :key="index" @tap="toSon(item)">
            <uni-card :title="item.物料代码" :extra="'No. ' + Number(index+1)" style="margin: 10px;">
                <view class="card-detail">
                    <view class="detail">
                        <text>物料名称:</text>{{item.物料名称}}
                    </view>
                    <view class="detail">
                        <text>规格型号:</text>{{item.规格型号}}
                    </view>
                    <view class="detail">
                        <text>订单数量:</text>{{item.数量}}
                    </view>
                </view>
 
            </uni-card>
        </view>
 
        <view class="over" v-if="listData.length == 0">暂无数据</view>
        <view class="over" v-if="listData.length != 0">已到底</view>
    </view>
</template>
 
<script>
    import {
        getUserInfo
    } from "@/utils/auth.js";
    import {
        CommonUtils
    } from "../../utils/common";
    export default {
        data() {
            return {
                userInfo: getUserInfo(),
                serverUrl: uni.getStorageSync('serverUrl') || 'http://47.96.97.237/API',
                HBarCode: '',
                baseInfo: {
                    HBillNo: '',
                    HSupName: '',
                    HDeptName: '',
                    HInterID: '',
                },
                sWhere: '',
                listData: [],
            }
        },
        onLoad() {},
        methods: {
            //扫码
            toScanCode() {
                uni.scanCode({
                    onlyFromCamera: true,
                    success: (res) => {
                        console.log('条码内容:' + res.result);
                        this.HBarCode = res.result
 
                        this.getCode(this.HBarCode)
                    }
                });
            },
            //扫条码处理
            getCode(HBarCode) {
                if (!HBarCode) {
                    uni.showToast({
                        title: '条码不能为空',
                        icon: 'none'
                    })
                } else {
                    CommonUtils.doRequest(
                        "/Cg_POOrderBill/list", {
                            sWhere: ` and 单据号 = '${HBarCode}'`,
                            user: this.userInfo.Czymc
                        },
                        (res) => {
                            console.log('采购订单: ', res)
                            let {data, count} = res.data
                            if(count > 0){
                                this.baseInfo = {
                                    HBillNo: data[0].单据号,
                                    HSupName: data[0].供应商,
                                    HDeptName: data[0].部门,
                                    HInterID: data[0].hmainid,
                                }
                                this.listData = data
                            } else {
                                uni.showToast({
                                    title: res.data.Message,
                                    icon: 'none'
                                })
                            }
                        }
                    )
 
                }
            },
            toSon(item) {
                uni.navigateTo({
                    url: `./generate?OperationType=1&closeType=1&linterid=${this.baseInfo.HInterID}&hmaterid=${item["HMaterID"]}`
                })
            }
        }
    }
</script>
 
<style lang="scss" scoped>
    .form {
        width: 640rpx;
        margin: 20rpx auto;
    }
 
    .form-item {
        display: flex;
        align-items: center;
        font-size: 28rpx;
        padding: 6rpx 0;
 
        .title {
            width: 180rpx;
 
            text {
                color: red;
                font-weight: bold;
            }
        }
 
        .right {
            width: 450rpx;
            border-radius: 22rpx;
            border: 1px solid #acacac;
        }
 
        .righton {
            width: 450rpx;
            border-radius: 22rpx;
            border: 1px solid #e4e4e4;
            background-color: #e4e4e4;
        }
 
        input {
            width: 100%;
            padding: 8rpx 20rpx;
            font-size: 30rpx;
        }
    }
 
    .buttons {
        width: 100%;
        display: flex;
        justify-content: center;
        margin-top: 20rpx;
 
        button {
            border-radius: 50rpx;
            width: 180rpx;
            height: 66rpx;
            line-height: 66rpx;
            font-size: 28rpx;
        }
 
        .btn-a {
            background-color: #acacac;
            color: #fff;
        }
 
        .btn-b {
            background-color: #41a863;
            color: #fff;
        }
 
        .btn-c {
            background-color: #3a78ff;
            color: #fff;
        }
    }
 
    .list {
        width: 100%;
 
        .card-detail {
            width: 100%;
            display: flex;
            flex-wrap: wrap;
            justify-content: space-between;
            line-height: 120%;
 
            .detail {
                // width: 50%;
                font-size: 26rpx;
                margin-bottom: 12rpx;
                color: #555;
                margin-right: 20rpx;
 
                text {
                    color: #999;
                    font-size: 26rpx;
                }
            }
        }
 
        .more {
            color: #888;
            font-size: 24rpx;
            display: flex;
            border-top: 1px solid #eee;
            padding-top: 20rpx;
 
            .part {
                width: 50%;
                text-align: center;
            }
        }
    }
</style>