llj
2025-10-31 a3e399e2c7ee937e4937cfd7d4ddd0212b3dab9b
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
<template>
    <view class="content">
        <view class="infoArea">
            <view class="name">{{infoData.设备名称}}</view>
            <view class="dm">( 代码:{{infoData.设备代码}} )</view>
<!--             <view class="other">
                <view class="half">出厂编号: <text>{{infoData.设备出厂编号}}</text></view>
                <view class="half">出厂日期: <text>{{infoData.设备出厂日期.substr(0,10)}}</text></view>
                <view class="half">设备编码: <text v-if="infoData.设备编码 != 'null'">{{infoData.设备编码}}</text></view>
                <view class="half">设备类型: <text v-if="infoData.设备类型 != 'null'">{{infoData.设备类型}}</text></view>
            </view>
            <view class="other" style="margin-top: 0;">
                <view class="all">设备规格: <text v-if="infoData.设备规格 != 'null'">{{infoData.设备规格}}</text></view>
                <view class="all">设备型号: <text v-if="infoData.设备型号 != 'null'">{{infoData.设备型号}}</text></view>
            </view> -->
            
            <view class="choose">
                <view class="tab" :class="{focus: number == 1}" @tap="number = 1">保养项信息</view>
                <view class="tab" :class="{focus: number == 2}" @tap="number = 2">配件信息</view>
            </view>
        </view>
        
        <view style="width: 100%;height: 200rpx;"></view>
        <view v-if="number == 1">
            <view class="list" v-for="(item,index) in listData1" :key="index">
                <uni-card :title="item.HMaintainItem" :extra="item.HMaintainItemNumber" style="margin: 10px;" @tap="showDetail = showDetail==index?-1:index">
                    <view class="card-detail">
                        <view class="detail" v-if="item.HMaintainPart">
                            <text>保养部位:</text>{{item.HMaintainPart}}
                        </view>
                        <view class="detail" v-if="item.HManagerName">
                            <text>负责人:</text>{{item.HManagerName}}
                        </view>
                        <view class="detail" v-if="item.HManagerNumber">
                            <text>负责人代码:</text>{{item.HManagerNumber}}
                        </view>
                        <view class="detail" v-if="item.HRemark">
                            <text>备注:</text>{{item.HRemark}}
                        </view>
                    </view>
                    <view class="card-detail" v-if="showDetail == index">
                        <view class="detail">
                            <text>具体要求:</text>{{item.HClaim?item.HClaim:'暂无具体要求'}}
                        </view>
                    </view>
                    
                    <view class="morea" v-if="showDetail == index" >
                        <uni-icons type="top" style="color: #888;margin-right: 10rpx;" size="14"></uni-icons>收起
                    </view>
                    <view class="morea" v-if="showDetail != index">
                        <uni-icons type="bottom" style="color: #888;margin-right: 10rpx;" size="14"></uni-icons>查看具体要求
                    </view>
                </uni-card>
            </view>
            
            <view class="over" v-if="listData1.length == 0 ">暂无数据</view>
            <view class="over" v-if="listData1.length != 0 ">已到底</view>
        </view>
 
        <view v-if="number == 2">
            <view class="list" v-for="(item,index) in listData2" :key="index" >
                <uni-card :title="item.HMaterName" :extra="item.HMaterNumber" style="margin: 10px;" @tap="showDetail = showDetail==index?-1:index">
                    <view class="card-detail">
                        <view class="detail" v-if="item.HUnitName">
                            <text>单位名称:</text>{{item.HUnitName}}
                        </view>
                        <view class="detail" v-if="item.HUnitNumber">
                            <text>单位代码:</text>{{item.HUnitNumber}}
                        </view>
                        <view class="detail" v-if="item.HManagerName">
                            <text>负责人:</text>{{item.HManagerName}}
                        </view>
                        <view class="detail" v-if="item.HManagerNumber">
                            <text>负责人代码:</text>{{item.HManagerNumber}}
                        </view>
                        <view class="detail" v-if="item.HQty">
                            <text>实际用量:</text>{{item.HQty}}
                        </view>
                        <view class="detail" v-if="item.HQtyMust">
                            <text>标准用量:</text>{{item.HQtyMust}}
                        </view>
                        <view class="detail" v-if="item.HRemark">
                            <text>备注:</text>{{item.HRemark}}
                        </view>
                    </view>
                </uni-card>
            </view>
            <view class="over" v-if="listData2.length == 0">暂无数据</view>
            <view class="over" v-if="listData2.length != 0">已到底</view>
        </view>
    </view>
</template>
 
<script>
    import { getUserInfo } from "@/utils/auth.js";
    export default {
        data() {
            return {
                userInfo:getUserInfo(),
                serverUrl: uni.getStorageSync('serverUrl')||'http://47.96.97.237/API',
                infoData:{},
                number:1,
                listData1:[],
                listData2:[],
                showDetail:-1,
            }
        },
        onLoad(e) {
            console.log(e)
            uni.setNavigationBarTitle({
                title: e.设备名称
            });
            this.infoData = e
            this.getList(e.HInterID)
        },
        methods: {
            getList(HInterID){
                uni.showLoading({
                    title:'加载中...'
                })
                uni.request({
                    url: this.serverUrl + '/Sb_EquipMaintainBill/Sb_EquipMaintainBillListProjectDetaiNew',
                    data: { "HInterID": HInterID },
                    success: (res) => {
                        if(res.data.count == 1){
                            this.listData1 = res.data.list[0]
                            this.listData2 = res.data.list[1]
                            console.log(1,this.listData1);
                            console.log(2,this.listData2);
                            uni.hideLoading()
                        }else{
                            uni.hideLoading()
                            uni.showToast({
                                title:res.data.Message,
                                icon:'none'
                            })
                        }
                    },
                    fail: (res) => {
                        console.log(res);
                        uni.hideLoading()
                        uni.showToast({
                            title:'接口请求失败',
                            icon:'none'
                        })
                    },
                });
            },
        }
    }
</script>
 
<style lang="scss" scoped>
    .infoArea{
        width: 100%;
        padding-top: 20rpx;
        background-color: #f0f0f0;
        position: fixed;
        top: 0;
        left: 0;
        z-index: 99;
        .name{
            text-align: center;
            font-size: 32rpx;
            font-weight: 600;
            color: #333;
            line-height: 150%;
        }
        .dm{
            text-align: center;
            font-size: 27rpx;
            font-weight: 500;
            color: #333;
        }
        .other{
            display: flex;
            flex-wrap: wrap;
            width: 90%;
            margin: 0 auto;
            margin-top: 12rpx;
            font-size: 27rpx;
            color: #666;
            text{
                font-size: 28rpx;
                color: #333;
                margin-left: 10rpx;
            }
            .half{
                width: 50%;
            }
            .all{
                width: 100%;
            }
        }
        .choose{
            height: 70rpx;
            margin-top: 20rpx;
            padding: 0 30rpx;
            background-color: #fff;
            line-height: 86rpx;
            border-radius: 40rpx 40rpx 0 0;
            border-bottom: 2px solid #eee;
            display: flex;
            .tab{
                margin: 0 20rpx;
                text-align: center;
                font-size: 28rpx;
                color: #666;
            }
            .focus{
                font-size: 30rpx;
                color: #333;
                font-weight: 600;
                border-bottom: 2px solid #3a78ff;
            }
        }
    }
    
    .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;
            }
        }
        
        .morea{
            color: #888;
            font-size: 24rpx;
            padding-top: 10rpx;
            text-align: right;
        }
    }
 
</style>