From e449a5408265e4bd1f6c66f5be28a42efac444ee Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期日, 20 九月 2026 15:22:46 +0800
Subject: [PATCH] 天津豹鸣app 1.需求修改

---
 src/pages/equipmentManagement/deviceInfo/index.vue |  198 ++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 194 insertions(+), 4 deletions(-)

diff --git a/src/pages/equipmentManagement/deviceInfo/index.vue b/src/pages/equipmentManagement/deviceInfo/index.vue
index 5972626..b7c4190 100644
--- a/src/pages/equipmentManagement/deviceInfo/index.vue
+++ b/src/pages/equipmentManagement/deviceInfo/index.vue
@@ -6,9 +6,18 @@
     <view class="info-card">
       <view class="card-header">
         <text class="card-title">鍩烘湰淇℃伅</text>
-        <text class="device-status">姝e父</text>
+        <text
+          class="device-status"
+          :class="deviceInfo.status === 1 ? 'status-enabled' : 'status-disabled'"
+        >
+          {{ deviceInfo.status === 1 ? '鍚敤' : '鍋滅敤' }}
+        </text>
       </view>
       <view class="card-content">
+        <view class="info-row">
+          <text class="label">璁惧缂栧彿锛�</text>
+          <text class="value">{{ deviceInfo.uniqueCode || '--' }}</text>
+        </view>
         <view class="info-row">
           <text class="label">璁惧鍚嶇О锛�</text>
           <text class="value">{{ deviceInfo.deviceName || '--' }}</text>
@@ -18,12 +27,99 @@
           <text class="value">{{ deviceInfo.deviceModel || '--' }}</text>
         </view>
         <view class="info-row">
-          <text class="label">鐢熶骇鍘傚锛�</text>
-          <text class="value">{{ deviceInfo.supplierName || '--' }}</text>
+          <text class="label">璁惧鍝佺墝锛�</text>
+          <text class="value">{{ deviceInfo.deviceBrand || '--' }}</text>
+        </view>
+        <view class="info-row">
+          <text class="label">璁惧绫诲瀷锛�</text>
+          <text class="value">{{ deviceInfo.type || '--' }}</text>
+        </view>
+        <view class="info-row">
+          <text class="label">鍑哄巶缂栧彿锛�</text>
+          <text class="value">{{ deviceInfo.factoryNumber || '--' }}</text>
+        </view>
+        <view class="info-row">
+          <text class="label">瀛樻斁浣嶇疆锛�</text>
+          <text class="value">{{ deviceInfo.storageLocation || '--' }}</text>
+        </view>
+        <view class="info-row">
+          <text class="label">璐d换浜猴細</text>
+          <text class="value">{{ deviceInfo.responsiblePerson || '--' }}</text>
         </view>
         <view class="info-row">
           <text class="label">鍗曚綅锛�</text>
           <text class="value">{{ deviceInfo.unit || '--' }}</text>
+        </view>
+        <view class="info-row">
+          <text class="label">寤烘。鏃ユ湡锛�</text>
+          <text class="value">{{ formatDate(deviceInfo.filingDate) }}</text>
+        </view>
+      </view>
+    </view>
+
+    <!-- 閲囪喘淇℃伅 -->
+    <view class="info-card">
+      <view class="card-header">
+        <text class="card-title">閲囪喘淇℃伅</text>
+      </view>
+      <view class="card-content">
+        <view class="info-row">
+          <text class="label">渚涘簲鍟嗭細</text>
+          <text class="value">{{ deviceInfo.supplierName || '--' }}</text>
+        </view>
+        <view class="info-row">
+          <text class="label">鍒堕�犲巶鍟嗭細</text>
+          <text class="value">{{ deviceInfo.manufacturer || '--' }}</text>
+        </view>
+        <view class="info-row">
+          <text class="label">璐疆鏃ユ湡锛�</text>
+          <text class="value">{{ formatDate(deviceInfo.purchaseDate) }}</text>
+        </view>
+        <view class="info-row">
+          <text class="label">璧勪骇鍘熷�硷細</text>
+          <text class="value">{{ deviceInfo.originalAssetValue ?? '--' }}</text>
+        </view>
+      </view>
+    </view>
+
+    <!-- 鎶�鏈弬鏁� -->
+    <view class="info-card">
+      <view class="card-header">
+        <text class="card-title">鎶�鏈弬鏁�</text>
+      </view>
+      <view class="card-content">
+        <view class="info-row">
+          <text class="label">涓昏鎶�鏈弬鏁帮細</text>
+          <text class="value">{{ deviceInfo.technicalParameters || '--' }}</text>
+        </view>
+        <view class="info-row">
+          <text class="label">涓昏鐢ㄩ�旓細</text>
+          <text class="value">{{ deviceInfo.mainPurpose || '--' }}</text>
+        </view>
+      </view>
+    </view>
+
+    <!-- 杩愯绠$悊 -->
+    <view class="info-card">
+      <view class="card-header">
+        <text class="card-title">杩愯绠$悊</text>
+      </view>
+      <view class="card-content">
+        <view class="info-row">
+          <text class="label">鍚敤鏃ユ湡锛�</text>
+          <text class="value">{{ formatDate(deviceInfo.activationDate) }}</text>
+        </view>
+        <view class="info-row">
+          <text class="label">棰勮杩愯鏃堕棿锛�</text>
+          <text class="value">{{ formatDate(deviceInfo.planRuntimeTime) }}</text>
+        </view>
+        <view class="info-row">
+          <text class="label">鍚敤鎶樻棫锛�</text>
+          <text class="value">{{ deviceInfo.isDepr === 1 ? '鏄�' : '鍚�' }}</text>
+        </view>
+        <view v-if="deviceInfo.isDepr === 1" class="info-row">
+          <text class="label">姣忓勾鎶樻棫閲戦锛�</text>
+          <text class="value">{{ deviceInfo.annualDepreciationAmount ?? '--' }}</text>
         </view>
       </view>
     </view>
@@ -49,25 +145,94 @@
         </view>
       </view>
     </view>
+
+    <!-- 鎶ヤ慨璁板綍 -->
+    <view class="info-card">
+      <view class="card-header">
+        <text class="card-title">鎶ヤ慨璁板綍</text>
+      </view>
+      <view class="card-content">
+        <view v-if="repairRecords.length === 0" class="empty-tip">鏆傛棤鎶ヤ慨璁板綍</view>
+        <view v-else class="change-record" v-for="(item, index) in repairRecords" :key="index">
+          <view class="record-header">
+            <text class="record-time">{{ formatDate(item.repairTime) }}</text>
+            <text class="record-status" :class="item.status === 1 ? 'status-approved' : 'status-rejected'">
+              {{ item.status === 1 ? '瀹岀粨' : '寰呯淮淇�' }}
+            </text>
+          </view>
+          <view class="record-reason">鎶ヤ慨浜猴細{{ item.repairName || '--' }}銆�缁翠慨浜猴細{{ item.maintenanceName || '--' }}</view>
+          <view class="record-reason">缁翠慨椤圭洰锛歿{ item.machineryCategory || '--' }}</view>
+          <view class="record-reason">鏁呴殰鐜拌薄锛歿{ item.remark || '--' }}</view>
+          <view class="record-reason">缁翠慨缁撴灉锛歿{ item.maintenanceResult || '--' }}</view>
+        </view>
+      </view>
+    </view>
+
+    <!-- 淇濆吇璁板綍 -->
+    <view class="info-card">
+      <view class="card-header">
+        <text class="card-title">淇濆吇璁板綍</text>
+      </view>
+      <view class="card-content">
+        <view v-if="upkeepRecords.length === 0" class="empty-tip">鏆傛棤淇濆吇璁板綍</view>
+        <view v-else class="change-record" v-for="(item, index) in upkeepRecords" :key="index">
+          <view class="record-header">
+            <text class="record-time">{{ formatDate(item.maintenancePlanTime) }}</text>
+            <text class="record-status" :class="item.status === 1 ? 'status-approved' : 'status-rejected'">
+              {{ item.status === 1 ? '瀹岀粨' : '寰呬繚鍏�' }}
+            </text>
+          </view>
+          <view class="record-reason">淇濆吇椤圭洰锛歿{ item.machineryCategory || '--' }}</view>
+          <view class="record-reason">淇濆吇浜猴細{{ item.maintenancePerson || '--' }}銆�褰曞叆浜猴細{{ item.createUserName || '--' }}</view>
+          <view class="record-reason">瀹為檯淇濆吇鏃ユ湡锛歿{ formatDate(item.maintenanceActuallyTime) }}</view>
+        </view>
+      </view>
+    </view>
   </view>
 </template>
 
 <script setup>
 import { ref, reactive } from 'vue'
 import { onLoad } from '@dcloudio/uni-app'
+import dayjs from 'dayjs'
 import PageHeader from '@/components/PageHeader.vue'
 import { getDeviceInfo } from '@/api/equipmentManagement/deviceInfo'
 import { listStatusChangeRecord } from '@/api/device/statusChangeRecord'
+import { getRepairPage } from '@/api/equipmentManagement/repair'
+import { getUpkeepPage } from '@/api/equipmentManagement/upkeep'
+import { unwrapList } from '@/utils/list'
 
 const deviceInfo = reactive({
+  uniqueCode: '',
   deviceName: '',
   deviceModel: '',
+  deviceBrand: '',
+  type: '',
+  factoryNumber: '',
+  storageLocation: '',
+  responsiblePerson: '',
+  filingDate: '',
   supplierName: '',
+  manufacturer: '',
+  purchaseDate: '',
+  originalAssetValue: null,
   unit: '',
+  technicalParameters: '',
+  mainPurpose: '',
+  status: null,
+  activationDate: '',
+  planRuntimeTime: '',
+  isDepr: 2,
+  annualDepreciationAmount: null,
 })
 
 const changeRecords = ref([])
 const recordsLoading = ref(false)
+const repairRecords = ref([])
+const upkeepRecords = ref([])
+
+// 鍚庣鏃ユ湡澶氬甫鏃跺垎绉掞紝杩欓噷缁熶竴鍙樉绀哄埌鏃�
+const formatDate = (d) => (d ? dayjs(d).format('YYYY-MM-DD') : '--')
 
 const statusText = (s) => (s == 1 ? '鍚敤' : '鍋滅敤')
 
@@ -112,6 +277,18 @@
   uni.navigateBack()
 }
 
+// 鎶ヤ慨/淇濆吇鍒楄〃鎺ュ彛鍙彁渚� deviceName 杩囨护锛堜笌绠$悊绔竴鑷达紝鏃� deviceId 缁村害锛�
+const fetchDeviceHistory = async (deviceName) => {
+  if (!deviceName) return
+  const params = { current: -1, size: -1, deviceName }
+  const [repair, upkeep] = await Promise.all([
+    getRepairPage(params).catch(() => null),
+    getUpkeepPage(params).catch(() => null),
+  ])
+  repairRecords.value = unwrapList(repair)
+  upkeepRecords.value = unwrapList(upkeep)
+}
+
 onLoad((options) => {
   const deviceId = options?.deviceId || ''
   if (!deviceId) {
@@ -119,6 +296,9 @@
     return
   }
   fetchDeviceInfo(deviceId)
+    // 灞ュ巻閲岀殑鎶ヤ慨/淇濆吇璁板綍瑕佺瓑鍩烘湰淇℃伅鎷垮埌璁惧鍚嶇О鍚庢墠鑳芥煡
+    .then(() => fetchDeviceHistory(deviceInfo.deviceName))
+    .catch(() => {})
   fetchChangeRecords(deviceId)
 })
 </script>
@@ -161,6 +341,14 @@
   background: #52c41a;
 }
 
+.status-enabled {
+  background: #52c41a;
+}
+
+.status-disabled {
+  background: #bfbfbf;
+}
+
 .card-content {
   padding: 16px 20px;
 }
@@ -176,8 +364,10 @@
 }
 
 .label {
-  width: 88px;
+  /* 銆屼富瑕佹妧鏈弬鏁帮細銆嶆瘮鍘熸潵鏈�闀跨殑鏍囩鏇村锛屾敼鎴愭寜鍐呭鎾戝紑锛岄伩鍏嶆崲琛屾垨鎴柇 */
+  min-width: 88px;
   flex-shrink: 0;
+  white-space: nowrap;
   color: #666666;
   font-size: 14px;
 }

--
Gitblit v1.9.3