| src/api/safeProduction/accidentReportingRecord.js | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/pages.json | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/pages/index.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/pages/safeProduction/accidentReportingRecord/detail.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/pages/safeProduction/accidentReportingRecord/index.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/pages/safeProduction/accidentReportingRecord/view.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/api/safeProduction/accidentReportingRecord.js
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,35 @@ import request from "@/utils/request"; // å页æ¥è¯¢ export function safeAccidentListPage(query) { return request({ url: "/safeAccident/page", method: "get", params: query, }); } export function safeAccidentAdd(query) { return request({ url: '/safeAccident', method: 'post', data: query }) } export function safeAccidentUpdate(query) { return request({ url: '/safeAccident', method: 'put', data: query }) } export function safeAccidentDel(ids) { return request({ url: '/safeAccident/' + ids, method: 'delete', data: ids }) } src/pages.json
@@ -711,6 +711,27 @@ } }, { "path": "pages/safeProduction/accidentReportingRecord/index", "style": { "navigationBarTitleText": "äºæ æ¥åè®°å½", "navigationStyle": "custom" } }, { "path": "pages/safeProduction/accidentReportingRecord/detail", "style": { "navigationBarTitleText": "äºæ æ¥å详æ ", "navigationStyle": "custom" } }, { "path": "pages/safeProduction/accidentReportingRecord/view", "style": { "navigationBarTitleText": "äºæ æ¥å详æ ", "navigationStyle": "custom" } }, { "path": "pages/cooperativeOffice/collaborativeApproval/index8", "style": { "navigationBarTitleText": "å±é©ä½ä¸å®¡æ¹", src/pages/index.vue
@@ -327,6 +327,10 @@ icon: "/static/images/icon/guzhangfenxi@2x.png", label: "åºæ¥é¢æ¡", }, { icon: "/static/images/icon/guzhangfenxi@2x.png", label: "äºæ 䏿¥", }, ]); // åååå ¬åè½æ°æ® const collaborationItems = reactive([ @@ -715,6 +719,11 @@ url: "/pages/safeProduction/emergencyPlanReview/index", }); break; case "äºæ 䏿¥": uni.navigateTo({ url: "/pages/safeProduction/accidentReportingRecord/index", }); break; default: uni.showToast({ title: `ç¹å»äº${item.label}`, src/pages/safeProduction/accidentReportingRecord/detail.vue
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,411 @@ <template> <view class="accident-detail"> <PageHeader :title="isEdit ? 'ç¼è¾äºæ æ¥å' : 'æ°å¢äºæ æ¥å'" @back="goBack" /> <u-form @submit="handleSubmit" ref="formRef" label-width="110"> <!-- äºæ ä¿¡æ¯ --> <u-cell-group title="åºæ¬ä¿¡æ¯"> <u-form-item label="äºæ åç§°" prop="accidentName" required border-bottom> <u-input v-model="form.accidentName" placeholder="请è¾å ¥äºæ åç§°" /> </u-form-item> <u-form-item label="äºæ ç¼ç " prop="accidentCode" required border-bottom> <u-input v-model="form.accidentCode" placeholder="请è¾å ¥äºæ ç¼ç " /> </u-form-item> <u-form-item label="äºæ ç±»å" prop="accidentType" required border-bottom> <u-input v-model="accidentTypeName" placeholder="è¯·éæ©äºæ ç±»å" @click="showTypeSheet" readonly /> <template #right> <up-icon name="arrow-right" @click="showTypeSheet"></up-icon> </template> </u-form-item> <u-form-item label="äºæ ç级" prop="accidentGrade" required border-bottom> <u-input v-model="accidentGradeName" placeholder="è¯·éæ©äºæ ç级" @click="showGradeSheet" readonly /> <template #right> <up-icon name="arrow-right" @click="showGradeSheet"></up-icon> </template> </u-form-item> </u-cell-group> <u-cell-group title="详ç»ä¿¡æ¯"> <u-form-item label="åçæ¶é´" prop="happenTime" required border-bottom> <u-input v-model="form.happenTime" placeholder="è¯·éæ©åçæ¶é´" @click="showTimePicker" readonly /> <template #right> <up-icon name="arrow-right" @click="showTimePicker"></up-icon> </template> </u-form-item> <u-form-item label="äºæ å°ç¹" prop="happenLocation" required border-bottom> <u-input v-model="form.happenLocation" placeholder="请è¾å ¥äºæ å°ç¹" /> </u-form-item> <u-form-item label="ç´æ¥è´¢äº§æå¤±" prop="assetLoss" border-bottom> <u-input v-model="form.assetLoss" placeholder="请è¾å ¥ç´æ¥è´¢äº§æå¤±" type="number" /> <template #right> <view class="unit">å </view> </template> </u-form-item> <u-form-item label="äºæ ç´æ¥åå " prop="accidentCause" border-bottom> <u-textarea v-model="form.accidentCause" placeholder="请è¾å ¥äºæ ç´æ¥åå " :maxlength="200" count :autoHeight="true" /> </u-form-item> <u-form-item label="äºæ æ ¹æ¬åå " prop="rootCause" border-bottom> <u-textarea v-model="form.rootCause" placeholder="请è¾å ¥äºæ æ ¹æ¬åå " :maxlength="200" count :autoHeight="true" /> </u-form-item> <u-form-item label="çäº§å½±åæ åµ" prop="productionLoss" border-bottom> <u-textarea v-model="form.productionLoss" placeholder="请è¾å ¥çäº§å½±åæ åµ" :maxlength="200" count :autoHeight="true" /> </u-form-item> <u-form-item label="ç°åºåºæ¥å¤ç½®æªæ½" prop="handleMeasures" border-bottom> <u-textarea v-model="form.handleMeasures" placeholder="请è¾å ¥ç°åºåºæ¥å¤ç½®æªæ½" :maxlength="200" count :autoHeight="true" /> </u-form-item> <u-form-item label="夿³¨" prop="remark" border-bottom> <u-textarea v-model="form.remark" placeholder="请è¾å ¥å¤æ³¨" :maxlength="200" count :autoHeight="true" /> </u-form-item> </u-cell-group> <!-- æäº¤æé® --> <view class="footer-btns"> <u-button class="cancel-btn" @click="goBack">åæ¶</u-button> <u-button class="sign-btn" type="primary" @click="handleSubmit" :loading="loading">{{ isEdit ? 'ä¿åä¿®æ¹' : 'æäº¤' }}</u-button> </view> </u-form> <!-- äºæ ç±»åéæ©å¨ --> <up-action-sheet :show="typeSheetVisible" :actions="typeOptions" @select="handleTypeSelect" @close="typeSheetVisible = false" title="éæ©äºæ ç±»å" /> <!-- äºæ ççº§éæ©å¨ --> <up-action-sheet :show="gradeSheetVisible" :actions="gradeOptions" @select="handleGradeSelect" @close="gradeSheetVisible = false" title="éæ©äºæ ç级" /> <!-- æ¶é´éæ©å¨ --> <up-datetime-picker :show="timePickerVisible" mode="datetime" v-model="currentTime" @confirm="handleTimeConfirm" @cancel="timePickerVisible = false" title="éæ©åçæ¶é´" /> </view> </template> <script setup> // æ¿æ¢ toast æ¹æ³ defineOptions({ name: "accident-detail" }); const showToast = message => { uni.showToast({ title: message, icon: "none" }); }; import { ref, onMounted } from "vue"; import PageHeader from "@/components/PageHeader.vue"; import { safeAccidentAdd, safeAccidentUpdate, } from "@/api/safeProduction/accidentReportingRecord"; import { onLoad } from "@dcloudio/uni-app"; import { useDict } from "@/utils/dict"; import dayjs from "dayjs"; // è·ååå ¸æ°æ® const { accident_type } = useDict("accident_type"); // è¡¨åæ°æ® const form = ref({ accidentName: "", accidentCode: "", accidentType: "", accidentGrade: "", happenTime: "", happenLocation: "", createUserName: "", createTime: "", assetLoss: "", accidentCause: "", rootCause: "", productionLoss: "", handleMeasures: "", remark: "", }); // 页é¢ç¶æ const loading = ref(false); const formRef = ref(null); const isEdit = ref(false); const currentTime = ref(new Date()); // äºæ ç±»åéæ©å¨ const typeSheetVisible = ref(false); const accidentTypeName = ref(""); const typeOptions = ref([]); const showTypeSheet = () => { typeSheetVisible.value = true; }; const handleTypeSelect = item => { form.value.accidentType = item.value; accidentTypeName.value = item.name; typeSheetVisible.value = false; }; // äºæ ççº§éæ©å¨ const gradeSheetVisible = ref(false); const accidentGradeName = ref(""); const gradeOptions = ref([ { value: "è½»å¾®äºæ ", name: "è½»å¾®äºæ " }, { value: "ä¸è¬äºæ ", name: "ä¸è¬äºæ " }, { value: "è¾å¤§äºæ ", name: "è¾å¤§äºæ " }, { value: "éå¤§äºæ ", name: "éå¤§äºæ " }, ]); const showGradeSheet = () => { gradeSheetVisible.value = true; }; const handleGradeSelect = item => { form.value.accidentGrade = item.value; accidentGradeName.value = item.name; gradeSheetVisible.value = false; }; // æ¶é´éæ©å¨ const timePickerVisible = ref(false); const showTimePicker = () => { timePickerVisible.value = true; }; const handleTimeConfirm = e => { form.value.happenTime = dayjs(e.value).format("YYYY-MM-DD HH:mm:ss"); currentTime.value = e.value; timePickerVisible.value = false; }; // è¿åä¸ä¸é¡µ const goBack = () => { uni.removeStorageSync("accidentReport"); uni.navigateBack(); }; // æäº¤è¡¨å const handleSubmit = async () => { if (!form.value.accidentName) { showToast("请è¾å ¥äºæ åç§°"); return; } if (!form.value.accidentCode) { showToast("请è¾å ¥äºæ ç¼ç "); return; } if (!form.value.accidentType) { showToast("è¯·éæ©äºæ ç±»å"); return; } if (!form.value.accidentGrade) { showToast("è¯·éæ©äºæ ç级"); return; } if (!form.value.happenTime) { showToast("è¯·éæ©åçæ¶é´"); return; } if (!form.value.happenLocation) { showToast("请è¾å ¥äºæ å°ç¹"); return; } try { loading.value = true; // 使ç¨å®å ¨æµ æ·è´ const source = form.value && typeof form.value === "object" ? form.value : {}; const submitData = {}; Object.keys(source).forEach(k => { submitData[k] = source[k]; }); if (isEdit.value) { const { code } = await safeAccidentUpdate(submitData); if (code === 200) { showToast("ä¿®æ¹æå"); setTimeout(() => { goBack(); }, 500); } else { loading.value = false; showToast("ä¿®æ¹å¤±è´¥ï¼è¯·éè¯"); } } else { const { code } = await safeAccidentAdd(submitData); if (code === 200) { showToast("æ°å¢æå"); setTimeout(() => { goBack(); }, 500); } else { loading.value = false; showToast("æ°å¢å¤±è´¥ï¼è¯·éè¯"); } } } catch (e) { loading.value = false; console.error("æäº¤å¤±è´¥:", e); showToast("æäº¤å¤±è´¥ï¼è¯·éè¯"); } }; onLoad(() => { // ç¼è¾äºæ æ¶ï¼ä»æ¬å°åå¨è·åæ°æ® const accidentReport = uni.getStorageSync("accidentReport"); if (accidentReport.id) { form.value = accidentReport; currentTime.value = dayjs(accidentReport.happenTime).toDate(); isEdit.value = true; } else { isEdit.value = false; } }); onMounted(() => { // åå§åäºæ ç±»åé项 typeOptions.value = accident_type?.value.map(item => ({ value: item.value, name: item.label, })) || []; // 设置已éå¼çæ¾ç¤ºææ¬ if (form.value.accidentType) { const typeItem = typeOptions.value.find( item => String(item.value) === String(form.value.accidentType) ); accidentTypeName.value = typeItem ? typeItem.name : ""; } if (form.value.accidentGrade) { const gradeItem = gradeOptions.value.find( item => item.value === form.value.accidentGrade ); accidentGradeName.value = gradeItem ? gradeItem.name : ""; } }); </script> <style scoped lang="scss"> @import "@/static/scss/form-common.scss"; .accident-detail { min-height: 100vh; background: #f8f9fa; padding-bottom: 5rem; } .footer-btns { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; display: flex; justify-content: space-around; align-items: center; padding: 0.75rem 0; box-shadow: 0 -0.125rem 0.5rem rgba(0, 0, 0, 0.05); z-index: 1000; } .cancel-btn { font-weight: 400; font-size: 1rem; color: #666; background: #f5f5f5; border: 1px solid #ddd; width: 45%; height: 2.5rem; border-radius: 2.5rem; } .sign-btn { font-weight: 500; font-size: 1rem; color: #fff; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); border: none; width: 45%; height: 2.5rem; border-radius: 2.5rem; } </style> src/pages/safeProduction/accidentReportingRecord/index.vue
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,357 @@ <template> <view class="accident-report"> <!-- 使ç¨éç¨é¡µé¢å¤´é¨ç»ä»¶ --> <PageHeader title="äºæ 䏿¥è®°å½" @back="goBack" /> <!-- æç´¢åºå --> <view class="search-section"> <view class="search-bar"> <view class="search-input"> <up-input class="search-text" placeholder="请è¾å ¥äºæ åç§°" v-model="accidentName" @change="searchChange" clearable /> </view> <view class="filter-button" @click="getList"> <u-icon name="search" size="24" color="#999"></u-icon> </view> </view> </view> <!-- äºæ è®°å½å表 --> <view class="ledger-list" v-if="accidentList.length > 0"> <view v-for="(item, index) in accidentList" :key="index"> <view class="ledger-item"> <!-- <view class="item-header"> <view class="item-left"> <view class="document-icon"> <up-icon name="file-text" size="16" color="#ffffff"></up-icon> </view> <text class="item-id">äºæ åç§°ï¼{{ item.accidentName }}</text> </view> </view> --> <view class="item-header"> <view class="item-left"> <view class="document-icon"> <up-icon name="file-text" size="16" color="#ffffff"></up-icon> </view> <text class="item-title">äºæ åç§°ï¼{{ item.accidentName }}</text> </view> </view> <up-divider></up-divider> <view class="item-details"> <view class="detail-row"> <text class="detail-label">äºæ ç¼ç </text> <text class="detail-value">{{ item.accidentCode || '-' }}</text> </view> <view class="detail-row"> <text class="detail-label">äºæ ç±»å</text> <text class="detail-value">{{ accidentTypeLabel(item.accidentType) || '-' }}</text> </view> <view class="detail-row"> <text class="detail-label">åçæ¶é´</text> <text class="detail-value">{{ item.happenTime || '-' }}</text> </view> <view class="detail-row"> <text class="detail-label">äºæ å°ç¹</text> <text class="detail-value">{{ item.happenLocation || '-' }}</text> </view> <view class="detail-row"> <text class="detail-label">äºæ ç级</text> <u-tag :type="accidentGradeType(item.accidentGrade)"> {{ item.accidentGrade || '-' }} </u-tag> </view> </view> <!-- æé®åºå --> <view class="action-buttons"> <u-button type="info" size="small" class="action-btn" @click="viewDetail(item)"> æ¥ç详æ </u-button> <u-button type="primary" size="small" class="action-btn" @click="editAccident(item)"> ç¼è¾ </u-button> <u-button type="error" size="small" class="action-btn" @click="deleteAccident(item)"> å é¤ </u-button> </view> </view> </view> </view> <view v-else class="no-data"> <text>ææ äºæ è®°å½</text> </view> <!-- æµ®å¨æ°å¢æé® --> <view class="fab-button" @click="addAccident"> <up-icon name="plus" size="24" color="#ffffff"></up-icon> </view> </view> </template> <script setup> import { ref, onMounted, computed } from "vue"; import { onShow } from "@dcloudio/uni-app"; import PageHeader from "@/components/PageHeader.vue"; import { safeAccidentListPage, safeAccidentDel, } from "@/api/safeProduction/accidentReportingRecord"; import { useDict } from "@/utils/dict"; // æ¿æ¢ toast æ¹æ³ defineOptions({ name: "accident-report-index" }); const showToast = message => { uni.showToast({ title: message, icon: "none", }); }; // åºæ¥é¢æ¡ç±»åé项 const { accident_type } = useDict("accident_type"); const emergencyPlanTypeOptions = computed(() => accident_type?.value || []); // æç´¢å ³é®è¯ const accidentName = ref(""); // äºæ è®°å½æ°æ® const accidentList = ref([]); // è¿åä¸ä¸é¡µ const goBack = () => { uni.navigateBack(); }; const accidentGradeType = val => { switch (val) { case "è½»å¾®äºæ ": return "info"; case "ä¸è¬äºæ ": return "info"; case "è¾å¤§äºæ ": return "warning"; case "éå¤§äºæ ": return "error"; default: return "info"; } }; const accidentGradeOptions = [ { label: "è½»å¾®äºæ ", value: "è½»å¾®äºæ ", }, { label: "ä¸è¬äºæ ", value: "ä¸è¬äºæ ", }, { label: "è¾å¤§äºæ ", value: "è¾å¤§äºæ ", }, { label: "éå¤§äºæ ", value: "éå¤§äºæ ", }, ]; // è·åäºæ ç±»åæ ç¾ const accidentTypeLabel = val => { const item = emergencyPlanTypeOptions.value.find( i => String(i.value) === String(val) ); return item ? item.label : val; }; const searchChange = val => { accidentName.value = val; getList(); }; // æ¥è¯¢å表 const getList = () => { showLoadingToast("å è½½ä¸..."); const params = { current: -1, size: -1, accidentName: accidentName.value, }; safeAccidentListPage(params) .then(res => { accidentList.value = res.records || res.data?.records || []; closeToast(); }) .catch(() => { closeToast(); showToast("è·åæ°æ®å¤±è´¥"); }); }; // æ¾ç¤ºå è½½æç¤º const showLoadingToast = message => { uni.showLoading({ title: message, mask: true, }); }; // å ³éæç¤º const closeToast = () => { uni.hideLoading(); }; // æ°å¢äºæ è®°å½ const addAccident = () => { uni.setStorageSync("accidentReport", {}); uni.navigateTo({ url: "/pages/safeProduction/accidentReportingRecord/detail", }); }; // ç¼è¾äºæ è®°å½ const editAccident = item => { uni.setStorageSync("accidentReport", item); uni.navigateTo({ url: "/pages/safeProduction/accidentReportingRecord/detail", }); }; // å é¤äºæ è®°å½ const deleteAccident = item => { uni.showModal({ title: "å é¤ç¡®è®¤", content: `ç¡®å®è¦å é¤è¯¥äºæ è®°å½åï¼`, success: res => { if (res.confirm) { deleteAccidentRecord(item.id); } }, }); }; // å é¤äºæ è®°å½ const deleteAccidentRecord = id => { showLoadingToast("å é¤ä¸..."); safeAccidentDel([id]) .then(() => { closeToast(); showToast("å 餿å"); getList(); }) .catch(() => { closeToast(); showToast("å é¤å¤±è´¥"); }); }; // æ¥ç详æ const viewDetail = item => { uni.setStorageSync("accidentReport", item); uni.navigateTo({ url: "/pages/safeProduction/accidentReportingRecord/view", }); }; onMounted(() => { getList(); }); onShow(() => { getList(); }); </script> <style scoped lang="scss"> @import "../../../styles/sales-common.scss"; // 页é¢ç¹å®çæ ·å¼è¦ç .accident-report { min-height: 100vh; background: #f8f9fa; position: relative; padding-bottom: 80px; } // ç¹å®ç徿 æ ·å¼ .document-icon { background: #667eea; // ä¿æé¡µé¢ç¹æçèæ¯è² } // ç¹ææ ·å¼ .visit-status { display: flex; align-items: center; } .detail-value { word-break: break-all; // ä¿ç页é¢ç¹æçææ¬æ¢è¡æ ·å¼ white-space: normal; line-height: 1.4; } // ç¹å®çæµ®å¨æé®æ ·å¼ .fab-button { background: #667eea; // ä¿æé¡µé¢ç¹æçèæ¯è² box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3); // ä¿æé¡µé¢ç¹æçé´å½±ææ } .action-buttons { gap: 4px; } .action-buttons { padding: 0 0 10rpx 0; } // è¶ ææªæ´æ¹çéæ£æ ·å¼ .overdue { border-left: 8rpx solid #ff4d4f; background-color: rgba(255, 77, 79, 0.02); } .overdue .item-header { position: relative; padding-left: 20rpx; } .overdue .item-header::after { content: "è¶ æ"; position: absolute; top: 32rpx; right: 20rpx; font-size: 24rpx; font-weight: 500; color: #ff4d4f; background-color: rgba(255, 77, 79, 0.1); padding: 4rpx 16rpx; border-radius: 16rpx; border: 1rpx solid rgba(255, 77, 79, 0.3); } .overdue .detail-row:nth-child(7) .detail-value { color: #ff4d4f; font-weight: 500; } .overdue .detail-row { padding-left: 20rpx; } </style> src/pages/safeProduction/accidentReportingRecord/view.vue
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,223 @@ <template> <view class="accident-view"> <PageHeader title="äºæ æ¥å详æ " @back="goBack" /> <view class="detail-container"> <!-- äºæ åºæ¬ä¿¡æ¯ --> <view class="info-section"> <view class="info-title">åºæ¬ä¿¡æ¯</view> <view class="info-content"> <view class="info-row"> <view class="info-label">äºæ åç§°ï¼</view> <view class="info-value">{{ accidentInfo.accidentName || '-' }}</view> </view> <view class="info-row"> <view class="info-label">äºæ ç¼ç ï¼</view> <view class="info-value">{{ accidentInfo.accidentCode || '-' }}</view> </view> <view class="info-row"> <view class="info-label">äºæ ç±»åï¼</view> <view class="info-value">{{ accidentTypeLabel(accidentInfo.accidentType) || '-' }}</view> </view> <view class="info-row"> <view class="info-label">äºæ ç级ï¼</view> <view class="info-value"> <u-tag :type="getAccidentLevelType(accidentInfo.accidentGrade)"> {{ accidentInfo.accidentGrade || '-' }} </u-tag> </view> </view> </view> </view> <!-- äºæ 详ç»ä¿¡æ¯ --> <view class="info-section"> <view class="info-title">详ç»ä¿¡æ¯</view> <view class="info-content"> <view class="info-row"> <view class="info-label">åçæ¶é´ï¼</view> <view class="info-value">{{ accidentInfo.happenTime || '-' }}</view> </view> <view class="info-row"> <view class="info-label">äºæ å°ç¹ï¼</view> <view class="info-value">{{ accidentInfo.happenLocation || '-' }}</view> </view> <view class="info-row"> <view class="info-label">䏿¥äººï¼</view> <view class="info-value">{{ accidentInfo.createUserName || '-' }}</view> </view> <view class="info-row"> <view class="info-label">䏿¥æ¶é´ï¼</view> <view class="info-value">{{ accidentInfo.createTime || '-' }}</view> </view> <view class="info-row"> <view class="info-label">ç´æ¥è´¢äº§æå¤±ï¼</view> <view class="info-value">{{ accidentInfo.assetLoss || '-' }}<span v-if="accidentInfo.assetLoss">å </span></view> </view> <view class="info-row"> <view class="info-label">䏿¥æ¶é´ï¼</view> <view class="info-value">{{ accidentInfo.createTime || '-' }}</view> </view> <view class="info-row"> <view class="info-label">äºæ ç´æ¥åå ï¼</view> <view class="info-value">{{ accidentInfo.accidentCause || '-' }}</view> </view> <view class="info-row"> <view class="info-label">äºæ æ ¹æ¬åå ï¼</view> <view class="info-value">{{ accidentInfo.rootCause || '-' }}</view> </view> <view class="info-row"> <view class="info-label">çäº§å½±åæ åµï¼</view> <view class="info-value">{{ accidentInfo.productionLoss || '-' }}</view> </view> <view class="info-row"> <view class="info-label">ç°åºåºæ¥å¤ç½®æªæ½ï¼</view> <view class="info-value">{{ accidentInfo.handleMeasures || '-' }}</view> </view> <view class="info-row"> <view class="info-label">夿³¨ï¼</view> <view class="info-value">{{ accidentInfo.remark || '-' }}</view> </view> </view> </view> <!-- äºæ æè¿° --> <view class="info-section" v-if="accidentInfo.accidentDescription"> <view class="info-title">äºæ æè¿°</view> <view class="description-content"> {{ accidentInfo.accidentDescription }} </view> </view> <!-- å¤çæªæ½ --> <view class="info-section" v-if="accidentInfo.handlingMeasures"> <view class="info-title">å¤çæªæ½</view> <view class="description-content"> {{ accidentInfo.handlingMeasures }} </view> </view> </view> </view> </template> <script setup> import { ref, onMounted, computed } from "vue"; import PageHeader from "@/components/PageHeader.vue"; import { onLoad } from "@dcloudio/uni-app"; import { useDict } from "@/utils/dict"; // åºæ¥é¢æ¡ç±»åé项 const { accident_type } = useDict("accident_type"); const emergencyPlanTypeOptions = computed(() => accident_type?.value || []); // è·åäºæ ç±»åæ ç¾ const accidentTypeLabel = val => { const item = emergencyPlanTypeOptions.value.find( i => String(i.value) === String(val) ); return item ? item.label : val; }; // æ¿æ¢ toast æ¹æ³ defineOptions({ name: "accident-view" }); const showToast = message => { uni.showToast({ title: message, icon: "none" }); }; // äºæ ä¿¡æ¯ const accidentInfo = ref({}); // è¿åä¸ä¸é¡µ const goBack = () => { uni.navigateBack(); }; // è·åäºæ ç级æ ç¾ç±»å const getAccidentLevelType = val => { switch (val) { case "è½»å¾®äºæ ": return "info"; case "ä¸è¬äºæ ": return "info"; case "è¾å¤§äºæ ": return "warning"; case "éå¤§äºæ ": return "error"; default: return "info"; } }; onLoad(() => { // 仿¬å°åå¨è·åäºæ ä¿¡æ¯ const accidentReport = uni.getStorageSync("accidentReport"); if (accidentReport) { accidentInfo.value = accidentReport; } }); </script> <style scoped lang="scss"> @import "@/static/scss/form-common.scss"; .accident-view { min-height: 100vh; background: #f8f9fa; padding-bottom: 2rem; } .detail-container { padding: 1rem; } .info-section { background: #fff; border-radius: 0.5rem; margin-bottom: 1rem; box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.05); overflow: hidden; } .info-title { padding: 1rem; font-size: 1rem; font-weight: 500; color: #303133; background: #f5f5f5; border-bottom: 1px solid #e4e7ed; } .info-content { padding: 1rem; } .info-row { display: flex; margin-bottom: 0.75rem; align-items: flex-start; } .info-row:last-child { margin-bottom: 0; } .info-label { width: 240rpx; font-size: 0.875rem; color: #606266; } .info-value { flex: 1; font-size: 0.875rem; color: #303133; word-break: break-all; white-space: normal; line-height: 1.4; } .description-content { padding: 1rem; font-size: 0.875rem; color: #303133; line-height: 1.5; } </style>