From 94b7cc1f950e68c96d6a4510629d903d4706ca27 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期三, 04 二月 2026 15:52:25 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev_new' into dev_new
---
src/pages/index.vue | 9
src/pages/safeProduction/accidentReportingRecord/view.vue | 223 ++++++++++++
src/api/safeProduction/accidentReportingRecord.js | 35 +
src/pages.json | 21 +
src/pages/safeProduction/accidentReportingRecord/detail.vue | 411 ++++++++++++++++++++++
src/pages/safeProduction/accidentReportingRecord/index.vue | 357 +++++++++++++++++++
6 files changed, 1,056 insertions(+), 0 deletions(-)
diff --git a/src/api/safeProduction/accidentReportingRecord.js b/src/api/safeProduction/accidentReportingRecord.js
new file mode 100644
index 0000000..90a177f
--- /dev/null
+++ b/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
+ })
+}
diff --git a/src/pages.json b/src/pages.json
index 5588424..2e1cabe 100644
--- a/src/pages.json
+++ b/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": "鍗遍櫓浣滀笟瀹℃壒",
diff --git a/src/pages/index.vue b/src/pages/index.vue
index 36c285a..aa08cb3 100644
--- a/src/pages/index.vue
+++ b/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}`,
diff --git a/src/pages/safeProduction/accidentReportingRecord/detail.vue b/src/pages/safeProduction/accidentReportingRecord/detail.vue
new file mode 100644
index 0000000..af7e89b
--- /dev/null
+++ b/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>
diff --git a/src/pages/safeProduction/accidentReportingRecord/index.vue b/src/pages/safeProduction/accidentReportingRecord/index.vue
new file mode 100644
index 0000000..07e42fb
--- /dev/null
+++ b/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>
+
diff --git a/src/pages/safeProduction/accidentReportingRecord/view.vue b/src/pages/safeProduction/accidentReportingRecord/view.vue
new file mode 100644
index 0000000..c696dc3
--- /dev/null
+++ b/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>
--
Gitblit v1.9.3