|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+<template>
|
|
|
2
|
+ <view>
|
|
|
3
|
+ <view class="device-info-container">
|
|
|
4
|
+ <view class="device-info-wrapper">
|
|
|
5
|
+ <view class="info-title">基本信息</view>
|
|
|
6
|
+ <view class="info-item">
|
|
|
7
|
+ <view class="info-item-left">设备编号</view>
|
|
|
8
|
+ <view class="info-item-value">{{ deviceInfo?.number }}</view>
|
|
|
9
|
+ </view>
|
|
|
10
|
+ <view class="info-item">
|
|
|
11
|
+ <view class="info-item-left">设备名称</view>
|
|
|
12
|
+ <view class="info-item-value">{{ deviceInfo?.name }}</view>
|
|
|
13
|
+ </view>
|
|
|
14
|
+ <view class="info-item">
|
|
|
15
|
+ <view class="info-item-left">服务区</view>
|
|
|
16
|
+ <view class="info-item-value">{{ deviceInfo?.parkName }}</view>
|
|
|
17
|
+ </view>
|
|
|
18
|
+ <view class="info-item">
|
|
|
19
|
+ <view class="info-item-left">设备分类</view>
|
|
|
20
|
+ <view class="info-item-value">{{ deviceInfo?.categoryName }}</view>
|
|
|
21
|
+ </view>
|
|
|
22
|
+ <view class="info-item">
|
|
|
23
|
+ <view class="info-item-left">设备规格</view>
|
|
|
24
|
+ <view class="info-item-value">{{ deviceInfo?.spec }}</view>
|
|
|
25
|
+ </view>
|
|
|
26
|
+ <view class="info-item">
|
|
|
27
|
+ <view class="info-item-left">负责人</view>
|
|
|
28
|
+ <view class="info-item-value">{{ deviceInfo?.manageBy?.realname || deviceInfo?.manageBy?.username }}</view>
|
|
|
29
|
+ </view>
|
|
|
30
|
+ <view class="info-item">
|
|
|
31
|
+ <view class="info-item-left">负责人电话</view>
|
|
|
32
|
+ <view class="info-item-value">{{ deviceInfo?.manageMobile }}</view>
|
|
|
33
|
+ </view>
|
|
|
34
|
+ <view class="info-item">
|
|
|
35
|
+ <view class="info-item-left">供应商名称</view>
|
|
|
36
|
+ <view class="info-item-value">{{ selectedSupplierName }}</view>
|
|
|
37
|
+ </view>
|
|
|
38
|
+ <view class="info-item">
|
|
|
39
|
+ <view class="info-item-left">供应商联系人</view>
|
|
|
40
|
+ <view class="info-item-value">{{ deviceInfo?.supplierContact }}</view>
|
|
|
41
|
+ </view>
|
|
|
42
|
+ <view class="info-item">
|
|
|
43
|
+ <view class="info-item-left">供应商电话</view>
|
|
|
44
|
+ <view class="info-item-value">{{ deviceInfo?.supplierMobile }}</view>
|
|
|
45
|
+ </view>
|
|
|
46
|
+ <view class="info-item">
|
|
|
47
|
+ <view class="info-item-left">维保到期日</view>
|
|
|
48
|
+ <view class="info-item-value">{{ deviceInfo.maintenanceAt ? deviceInfo.maintenanceAt.slice(0, 10) : '' }}</view>
|
|
|
49
|
+ </view>
|
|
|
50
|
+ <view class="info-item">
|
|
|
51
|
+ <view class="info-item-left">状态</view>
|
|
|
52
|
+ <view class="info-item-value">{{ ['', '在用', '维修中', '处置', '处置审核', '维保'][deviceInfo?.status] }}</view>
|
|
|
53
|
+ </view>
|
|
|
54
|
+ <view class="info-item">
|
|
|
55
|
+ <view class="info-item-left">所在位置</view>
|
|
|
56
|
+ <view class="info-item-value">{{ deviceInfo?.position }}</view>
|
|
|
57
|
+ </view>
|
|
|
58
|
+ </view>
|
|
|
59
|
+ </view>
|
|
|
60
|
+ </view>
|
|
|
61
|
+</template>
|
|
|
62
|
+
|
|
|
63
|
+<script lang="ts" setup>
|
|
|
64
|
+import { ref, computed } from 'vue'
|
|
|
65
|
+import { onLoad } from '@dcloudio/uni-app'
|
|
|
66
|
+import { getDeviceInfo, getDeviceSupplierAll } from '@/api/home'
|
|
|
67
|
+
|
|
|
68
|
+const deviceInfo = ref<any>({})
|
|
|
69
|
+const id = ref<string>('')
|
|
|
70
|
+const supplierList = ref<any>([])
|
|
|
71
|
+
|
|
|
72
|
+const selectedSupplierName = computed(() => {
|
|
|
73
|
+ const foundSupplier = supplierList.value.find((supplier: any) => supplier.id === deviceInfo.value?.supplierId)
|
|
|
74
|
+ return foundSupplier ? foundSupplier.name : ''
|
|
|
75
|
+})
|
|
|
76
|
+
|
|
|
77
|
+// 查询设备供应商列表
|
|
|
78
|
+const getSupplierList = async () => {
|
|
|
79
|
+ const res = await getDeviceSupplierAll()
|
|
|
80
|
+ if (res.code === 200) {
|
|
|
81
|
+ supplierList.value = res.data || []
|
|
|
82
|
+ }
|
|
|
83
|
+}
|
|
|
84
|
+
|
|
|
85
|
+onLoad(async (options) => {
|
|
|
86
|
+ id.value = options?.id || ''
|
|
|
87
|
+ const res = await getDeviceInfo(id.value)
|
|
|
88
|
+ if (res.code === 200) {
|
|
|
89
|
+ deviceInfo.value = res.data
|
|
|
90
|
+ // 查询供应商列表
|
|
|
91
|
+ await getSupplierList()
|
|
|
92
|
+ }
|
|
|
93
|
+})
|
|
|
94
|
+</script>
|
|
|
95
|
+
|
|
|
96
|
+<style lang="scss" scoped>
|
|
|
97
|
+.device-info-container {
|
|
|
98
|
+ box-sizing: border-box;
|
|
|
99
|
+ padding: 24rpx;
|
|
|
100
|
+ .device-info-wrapper {
|
|
|
101
|
+ background-color: #fff;
|
|
|
102
|
+ padding: 30rpx;
|
|
|
103
|
+ border-radius: 14rpx;
|
|
|
104
|
+ margin-bottom: 24rpx;
|
|
|
105
|
+ .info-title {
|
|
|
106
|
+ font-size: 32rpx;
|
|
|
107
|
+ color: #1d2129;
|
|
|
108
|
+ font-weight: bold;
|
|
|
109
|
+ margin-bottom: 24rpx;
|
|
|
110
|
+ }
|
|
|
111
|
+ .info-item {
|
|
|
112
|
+ display: flex;
|
|
|
113
|
+ align-items: center;
|
|
|
114
|
+ justify-content: space-between;
|
|
|
115
|
+ border-bottom: 1rpx solid #e5e8ed;
|
|
|
116
|
+ padding: 24rpx 0;
|
|
|
117
|
+ &:first-child {
|
|
|
118
|
+ padding-top: 0;
|
|
|
119
|
+ }
|
|
|
120
|
+ &:last-child {
|
|
|
121
|
+ border-bottom: none;
|
|
|
122
|
+ padding-bottom: 0;
|
|
|
123
|
+ }
|
|
|
124
|
+ .info-item-left {
|
|
|
125
|
+ font-size: 28rpx;
|
|
|
126
|
+ color: #1d2129;
|
|
|
127
|
+ width: 200rpx;
|
|
|
128
|
+ }
|
|
|
129
|
+ .info-item-value {
|
|
|
130
|
+ flex: 1;
|
|
|
131
|
+ font-size: 28rpx;
|
|
|
132
|
+ color: #737880;
|
|
|
133
|
+ display: flex;
|
|
|
134
|
+ justify-content: flex-end;
|
|
|
135
|
+ }
|
|
|
136
|
+ }
|
|
|
137
|
+ }
|
|
|
138
|
+}
|
|
|
139
|
+</style>
|