From 90839ac8191503b8706c97e607f69bfcb2dcb7a3 Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期二, 20 十月 2026 15:36:57 +0800
Subject: [PATCH] feat: 设备保养和巡检优化,项目拆分

---
 src/views/equipmentManagement/upkeep/Form/detailDia.vue |  240 +++++++++++++++++++++++++++++++++++++++---------------------
 1 files changed, 156 insertions(+), 84 deletions(-)

diff --git a/src/views/equipmentManagement/upkeep/Form/detailDia.vue b/src/views/equipmentManagement/upkeep/Form/detailDia.vue
index c80691a..ddf9be4 100644
--- a/src/views/equipmentManagement/upkeep/Form/detailDia.vue
+++ b/src/views/equipmentManagement/upkeep/Form/detailDia.vue
@@ -1,118 +1,190 @@
 <template>
-	<FormDialog
-		v-model="dialogVisitable"
-		title="淇濆吇浠诲姟璇︽儏"
-		width="800px"
-		operation-type="detail"
-		@close="cancel"
-	>
-		<el-descriptions border :column="2">
-			<el-descriptions-item label="璁惧鍚嶇О">
-				{{ detailData.taskName || '--' }}
-			</el-descriptions-item>
-			<el-descriptions-item label="瑙勬牸鍨嬪彿">
-				{{ detailData.deviceModel || '--' }}
-			</el-descriptions-item>
-			<el-descriptions-item label="褰曞叆浜�">
-				{{ detailData.registrant || '--' }}
-			</el-descriptions-item>
-			<el-descriptions-item label="鐧昏鏃堕棿">
-				{{ detailData.registrationDate || '--' }}
-			</el-descriptions-item>
-			<el-descriptions-item label="淇濆吇椤圭洰" :span="2">
-				{{ detailData.machineryCategory || '--' }}
-			</el-descriptions-item>
-			<el-descriptions-item label="淇濆吇浜�">
-				{{ detailData.maintenancePerson || '--' }}
-			</el-descriptions-item>
-			<el-descriptions-item label="浠诲姟棰戠巼">
-				{{ formatFrequencyType(detailData.frequencyType) }}
-			</el-descriptions-item>
-			<el-descriptions-item label="鎵ц鏃堕棿">
-				{{ formatFrequencyDetail(detailData.frequencyDetail) }}
-			</el-descriptions-item>
-			<el-descriptions-item label="瀹氭椂浠诲姟">
-				<el-tag :type="detailData.isActive === 1 ? 'success' : 'info'">
-					{{ detailData.isActive === 1 ? '寮�鍚�' : '鍏抽棴' }}
-				</el-tag>
-			</el-descriptions-item>
-			<el-descriptions-item label="澶囨敞" :span="2">
-				{{ detailData.remarks || '--' }}
-			</el-descriptions-item>
-		</el-descriptions>
+  <FormDialog
+    v-model="dialogVisitable"
+    title="淇濆吇浠诲姟璇︽儏"
+    width="860px"
+    operation-type="detail"
+    @close="cancel"
+  >
+    <el-descriptions border :column="2" label-width="100px">
+      <el-descriptions-item label="璁惧鍚嶇О">
+        {{ detailData.taskName || "--" }}
+      </el-descriptions-item>
+      <el-descriptions-item label="瑙勬牸鍨嬪彿">
+        {{ detailData.deviceModel || "--" }}
+      </el-descriptions-item>
+      <el-descriptions-item label="褰曞叆浜�">
+        {{ detailData.registrant || "--" }}
+      </el-descriptions-item>
+      <el-descriptions-item label="鐧昏鏃堕棿">
+        {{ detailData.registrationDate || "--" }}
+      </el-descriptions-item>
+      <el-descriptions-item label="淇濆吇浜�">
+        {{ detailData.maintenancePerson || "--" }}
+      </el-descriptions-item>
+      <el-descriptions-item label="浠诲姟棰戠巼">
+        {{ formatFrequencyType(detailData.frequencyType) }}
+      </el-descriptions-item>
+      <el-descriptions-item label="鎵ц鏃堕棿">
+        {{ formatFrequencyDetail(detailData.frequencyDetail) }}
+      </el-descriptions-item>
+      <el-descriptions-item label="瀹氭椂浠诲姟">
+        <el-tag :type="detailData.isActive === 1 ? 'success' : 'info'" size="small">
+          {{ detailData.isActive === 1 ? "寮�鍚�" : "鍏抽棴" }}
+        </el-tag>
+      </el-descriptions-item>
+      <el-descriptions-item label="澶囨敞" :span="2">
+        {{ detailData.remarks || "--" }}
+      </el-descriptions-item>
+    </el-descriptions>
 
-		<div v-if="fileList && fileList.length > 0" class="image-section">
-			<div class="image-title">璁惧鍥剧墖锛�</div>
-			<AttachmentUploadImage
-				v-model:fileList="fileList"
-				:disabled="true"
-			/>
-		</div>
-	</FormDialog>
+    <div class="detail-section">
+      <div class="section-title">
+        <span>淇濆吇鍐呭</span>
+        <span class="section-count">鍏� {{ itemCount }} 椤�</span>
+      </div>
+      <div v-if="itemCount" class="item-list">
+        <div
+          v-for="(item, index) in detailData.maintenanceItems"
+          :key="item.id || index"
+          class="item-row"
+        >
+          <span class="item-index">{{ index + 1 }}</span>
+          <div class="item-body">
+            <div class="item-project">{{ item.itemProject || "鏈~鍐欎繚鍏婚」鐩�" }}</div>
+            <div class="item-content">{{ item.itemName }}</div>
+          </div>
+        </div>
+      </div>
+      <el-empty v-else :image-size="48" description="鏆傛棤淇濆吇鍐呭" />
+    </div>
+
+    <div v-if="fileList && fileList.length > 0" class="image-section">
+      <div class="image-title">璁惧鍥剧墖锛�</div>
+      <AttachmentUploadImage v-model:fileList="fileList" :disabled="true" />
+    </div>
+  </FormDialog>
 </template>
 
 <script setup>
 import FormDialog from "@/components/Dialog/FormDialog.vue";
-import { ref } from "vue";
+import { computed, ref } from "vue";
 import { getLedgerById } from "@/api/equipmentManagement/ledger";
-import AttachmentUploadImage from '@/components/AttachmentUpload/image/index.vue';
+import AttachmentUploadImage from "@/components/AttachmentUpload/image/index.vue";
 
 const dialogVisitable = ref(false);
 const detailData = ref({});
 const fileList = ref([]);
+const itemCount = computed(() => detailData.value.maintenanceItems?.length || 0);
 
 const formatFrequencyType = (type) => {
-	const map = {
-		DAILY: "姣忔棩",
-		WEEKLY: "姣忓懆",
-		MONTHLY: "姣忔湀",
-		QUARTERLY: "瀛e害",
-	};
-	return map[type] || "--";
+  const map = {
+    DAILY: "姣忔棩",
+    WEEKLY: "姣忓懆",
+    MONTHLY: "姣忔湀",
+    QUARTERLY: "瀛e害",
+  };
+  return map[type] || "--";
 };
 
 const formatFrequencyDetail = (detail) => {
-	if (!detail) return "--";
-	const replacements = {
-		MON: "鍛ㄤ竴",
-		TUE: "鍛ㄤ簩",
-		WED: "鍛ㄤ笁",
-		THU: "鍛ㄥ洓",
-		FRI: "鍛ㄤ簲",
-		SAT: "鍛ㄥ叚",
-		SUN: "鍛ㄦ棩",
-	};
-	return detail.replace(/MON|TUE|WED|THU|FRI|SAT|SUN/g, match => replacements[match]);
+  if (!detail) return "--";
+  const replacements = {
+    MON: "鍛ㄤ竴",
+    TUE: "鍛ㄤ簩",
+    WED: "鍛ㄤ笁",
+    THU: "鍛ㄥ洓",
+    FRI: "鍛ㄤ簲",
+    SAT: "鍛ㄥ叚",
+    SUN: "鍛ㄦ棩",
+  };
+  return detail.replace(/MON|TUE|WED|THU|FRI|SAT|SUN/g, (match) => replacements[match]);
 };
 
 const openDialog = (row) => {
-	dialogVisitable.value = true;
-	detailData.value = { ...row };
-	fileList.value = [];
+  dialogVisitable.value = true;
+  detailData.value = { ...row };
+  fileList.value = [];
 
-	if (row.taskId) {
-		getLedgerById(row.taskId).then(res => {
-			if (res.code === 200 && res.data) {
-				fileList.value = res.data.storageBlobVOs || [];
-			}
-		});
-	}
+  if (row.taskId) {
+    getLedgerById(row.taskId).then((res) => {
+      if (res.code === 200 && res.data) {
+        fileList.value = res.data.storageBlobVOs || [];
+      }
+    });
+  }
 };
 
 const cancel = () => {
-	dialogVisitable.value = false;
+  dialogVisitable.value = false;
 };
 
 defineExpose({ openDialog });
 </script>
 
 <style scoped>
+.detail-section {
+  margin-top: 16px;
+}
+.section-title {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  margin-bottom: 10px;
+  font-weight: 600;
+  color: #303133;
+}
+.section-count {
+  font-size: 12px;
+  font-weight: normal;
+  color: #909399;
+}
+.item-list {
+  border: 1px solid #ebeef5;
+  border-radius: 4px;
+  overflow: hidden;
+}
+.item-row {
+  display: flex;
+  gap: 12px;
+  padding: 12px 14px;
+  border-bottom: 1px solid #ebeef5;
+}
+.item-row:last-child {
+  border-bottom: none;
+}
+.item-index {
+  flex-shrink: 0;
+  width: 24px;
+  height: 24px;
+  line-height: 24px;
+  text-align: center;
+  border-radius: 50%;
+  background: #ecf5ff;
+  color: #409eff;
+  font-size: 12px;
+}
+.item-body {
+  flex: 1;
+  min-width: 0;
+}
+.item-project {
+  margin-bottom: 4px;
+  font-weight: 600;
+  color: #303133;
+}
+.item-content {
+  line-height: 1.6;
+  color: #606266;
+  white-space: pre-wrap;
+  word-break: break-all;
+}
 .image-section {
-	margin-top: 20px;
+  margin-top: 20px;
 }
 .image-title {
-	font-weight: bold;
-	margin-bottom: 10px;
-	color: #606266;
+  font-weight: bold;
+  margin-bottom: 10px;
+  color: #606266;
 }
 </style>

--
Gitblit v1.9.3