From 6e1cb1b850f3536eb91b3247f2b5e6aadf6805c9 Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期二, 03 二月 2026 16:52:43 +0800
Subject: [PATCH] 样式修改
---
src/pages/safeProduction/dangerInvestigation/index.vue | 423 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 423 insertions(+), 0 deletions(-)
diff --git a/src/pages/safeProduction/dangerInvestigation/index.vue b/src/pages/safeProduction/dangerInvestigation/index.vue
new file mode 100644
index 0000000..95c643f
--- /dev/null
+++ b/src/pages/safeProduction/dangerInvestigation/index.vue
@@ -0,0 +1,423 @@
+<template>
+ <view class="sales-accoun">
+ <!-- 浣跨敤閫氱敤椤甸潰澶撮儴缁勪欢 -->
+ <PageHeader title="闅愭偅鎺掓煡涓婃姤"
+ @back="goBack" />
+ <!-- 鎼滅储鍜岀瓫閫夊尯鍩� -->
+ <!-- <view class="search-section">
+ <view class="search-bar">
+ <view class="search-input">
+ <up-input class="search-text"
+ placeholder="璇疯緭鍏ュ嵄闄╂簮鍚嶇О"
+ v-model="customerName"
+ @blur="getList"
+ 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="visitList.length > 0">
+ <view v-for="(item, index) in visitList"
+ :key="index">
+ <view class="ledger-item"
+ :class="{ 'overdue': isOverdue(item.rectifyTime, item.rectifyActualTime) }">
+ <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.hiddenCode }}</text>
+ </view>
+ </view>
+ <up-divider></up-divider>
+ <view class="item-details"
+ @click="viewDetail(item)">
+ <view class="detail-row">
+ <text class="detail-label">闅愭偅鎻忚堪</text>
+ <text class="detail-value">{{ item.hiddenDesc || '-' }}</text>
+ </view>
+ <view class="detail-row">
+ <text class="detail-label">闅愭偅绫诲瀷</text>
+ <text class="detail-value">{{ hidden_danger_type.find(i => String(i.value) === String(item.type))?.label || '-' }}</text>
+ </view>
+ <view class="detail-row">
+ <text class="detail-label">椋庨櫓绛夌骇</text>
+ <u-tag :type="getRiskLevelType(item.riskLevel)">
+ {{ item.riskLevel || '-' }}
+ </u-tag>
+ </view>
+ <view class="detail-row">
+ <text class="detail-label">闅愭偅鍏蜂綋浣嶇疆</text>
+ <text class="detail-value">{{ item.location || '-' }}</text>
+ </view>
+ <view class="detail-row">
+ <text class="detail-label">涓婃姤浜�</text>
+ <text class="detail-value">{{ item.createUserName || '-' }}</text>
+ </view>
+ <view class="detail-row">
+ <text class="detail-label">涓婃姤鏃堕棿</text>
+ <text class="detail-value">{{ item.createTime || '-' }}</text>
+ </view>
+ <view class="detail-row">
+ <text class="detail-label">鏁存敼瀹屾垚鏈熼檺</text>
+ <text class="detail-value">{{ item.rectifyTime || '-' }}</text>
+ </view>
+ <view class="detail-row">
+ <text class="detail-label">鏁存敼璐d换浜�</text>
+ <text class="detail-value">{{ item.rectifyUserName || '-' }}</text>
+ </view>
+ <view class="detail-row">
+ <text class="detail-label">鏁存敼璐d换浜鸿仈绯绘柟寮�</text>
+ <text class="detail-value">{{ item.rectifyUserMobile || '-' }}</text>
+ </view>
+ <view v-if="item.rectifyActualTime"
+ class="detail-row">
+ <text class="detail-label">鏁存敼鍏蜂綋鎺柦</text>
+ <text class="detail-value">{{ item.rectifyMeasures || '-' }}</text>
+ </view>
+ <view v-if="item.rectifyActualTime"
+ class="detail-row">
+ <text class="detail-label">瀹為檯鏁存敼瀹屾垚鏃堕棿</text>
+ <text class="detail-value">{{ item.rectifyActualTime || '-' }}</text>
+ </view>
+ <view v-if="item.verifyTime"
+ class="detail-row">
+ <text class="detail-label">楠屾敹鎰忚</text>
+ <text class="detail-value">{{ item.verifyRemark || '-' }}</text>
+ </view>
+ <view v-if="item.verifyTime"
+ class="detail-row">
+ <text class="detail-label">楠屾敹鏃堕棿</text>
+ <text class="detail-value">{{ item.verifyTime || '-' }}</text>
+ </view>
+ <view v-if="item.verifyTime"
+ class="detail-row">
+ <text class="detail-label">楠屾敹浜�</text>
+ <text class="detail-value">{{ item.verifyUserName || '-' }}</text>
+ </view>
+ <view v-if="item.verifyTime"
+ class="detail-row">
+ <text class="detail-label">楠屾敹缁撴灉</text>
+ <text class="detail-value">{{ item.verifyResult || '-' }}</text>
+ </view>
+ </view>
+ <!-- 鎸夐挳鍖哄煙 -->
+ <view class="action-buttons">
+ <!-- <u-button type="info"
+ size="small"
+ class="action-btn"
+ @click="viewDetail(item)">
+ 鏌ョ湅璇︽儏
+ </u-button> -->
+ <u-button type="warning"
+ size="small"
+ class="action-btn"
+ :disabled="item.isRectify"
+ @click="rectifyVisit(item)">
+ 鏁存敼
+ </u-button>
+ <u-button type="success"
+ size="small"
+ class="action-btn"
+ :disabled="!item.rectifyActualTime"
+ @click="acceptanceVisit(item)">
+ 楠屾敹
+ </u-button>
+ </view>
+ <view class="action-buttons">
+ <u-button type="primary"
+ size="small"
+ class="action-btn"
+ @click="editVisit(item)">
+ 缂栬緫
+ </u-button>
+ <u-button type="info"
+ size="small"
+ class="action-btn"
+ @click="viewFileList(item)">
+ 闄勪欢
+ </u-button>
+ <u-button type="error"
+ size="small"
+ class="action-btn"
+ @click="deleteVisit(item)">
+ 鍒犻櫎
+ </u-button>
+ </view>
+ </view>
+ </view>
+ </view>
+ <view v-else
+ class="no-data">
+ <text>鏆傛棤鎷滆璁板綍</text>
+ </view>
+ <!-- 娴姩鏂板鎸夐挳 -->
+ <view class="fab-button"
+ @click="addVisit">
+ <up-icon name="plus"
+ size="24"
+ color="#ffffff"></up-icon>
+ </view>
+ </view>
+</template>
+
+<script setup>
+ import { ref, onMounted } from "vue";
+
+ import { onShow } from "@dcloudio/uni-app";
+ import PageHeader from "@/components/PageHeader.vue";
+ import {
+ dangerInvestigationListPage,
+ safeHiddenDel,
+ } from "@/api/safeProduction/dangerInvestigation";
+ import useUserStore from "@/store/modules/user";
+ import { useDict } from "@/utils/dict";
+ // 鏇挎崲 toast 鏂规硶
+ defineOptions({ name: "client-visit-index" });
+ const showToast = message => {
+ uni.showToast({
+ title: message,
+ icon: "none",
+ });
+ };
+ const getRiskLevelType = riskLevel => {
+ const typeMap = {
+ 浣庨闄�: "info",
+ 涓�鑸闄�: "info",
+ 杈冨ぇ椋庨櫓: "warning",
+ 閲嶅ぇ椋庨櫓: "error",
+ };
+ return typeMap[riskLevel] || "info";
+ };
+
+ import dayjs from "dayjs";
+
+ const userStore = useUserStore();
+
+ // 妫�鏌ラ殣鎮f槸鍚﹁秴鏈熸湭鏁存敼
+ const isOverdue = (rectifyTime, rectifyActualTime) => {
+ // 濡傛灉宸茬粡鏁存敼瀹屾垚锛屽垯涓嶈秴鏈�
+ if (rectifyActualTime) return false;
+
+ // 濡傛灉娌℃湁鏁存敼鏈熼檺锛屽垯涓嶈秴鏈�
+ if (!rectifyTime) return false;
+
+ const today = dayjs();
+ const deadline = dayjs(rectifyTime);
+
+ // 濡傛灉褰撳墠鏃ユ湡瓒呰繃鏁存敼鏈熼檺锛屽垯瓒呮湡
+ return today.isAfter(deadline, "day");
+ };
+
+ // 鎼滅储鍏抽敭璇�
+ const customerName = ref("");
+
+ // 鎷滆璁板綍鏁版嵁
+ const visitList = ref([]);
+ // 杩斿洖涓婁竴椤�
+ const goBack = () => {
+ uni.navigateBack();
+ };
+ const viewFileList = item => {
+ uni.setStorageSync("dangerInvestigationFileId", item.id);
+ uni.navigateTo({
+ url: "/pages/safeProduction/dangerInvestigation/fileList",
+ });
+ };
+
+ // 鏌ヨ鍒楄〃
+ const getList = () => {
+ showLoadingToast("鍔犺浇涓�...");
+ const params = {
+ current: -1,
+ size: -1,
+ };
+ dangerInvestigationListPage(params)
+ .then(res => {
+ visitList.value = res.records || res.data?.records || [];
+ userStore.getInfo().then(res => {
+ visitList.value.forEach(item => {
+ console.log(item.rectifyUserId, res.user.userId);
+ if (Number(item.rectifyUserId) != Number(res.user.userId)) {
+ item.isRectify = true;
+ } else {
+ item.isRectify = false;
+ }
+ });
+ });
+
+ closeToast();
+ })
+ .catch(() => {
+ closeToast();
+ showToast("鑾峰彇鏁版嵁澶辫触");
+ });
+ };
+
+ // 鏄剧ず鍔犺浇鎻愮ず
+ const showLoadingToast = message => {
+ uni.showLoading({
+ title: message,
+ mask: true,
+ });
+ };
+
+ // 鍏抽棴鎻愮ず
+ const closeToast = () => {
+ uni.hideLoading();
+ };
+
+ // 鏂板闅愭偅
+ const addVisit = () => {
+ uni.setStorageSync("dangerInvestigation", {});
+ uni.navigateTo({
+ url: "/pages/safeProduction/dangerInvestigation/detail",
+ });
+ };
+ // 缂栬緫闅愭偅
+ const editVisit = item => {
+ uni.setStorageSync("dangerInvestigation", item);
+ uni.navigateTo({
+ url: "/pages/safeProduction/dangerInvestigation/detail",
+ });
+ };
+ // 鏁存敼闅愭偅
+ const rectifyVisit = item => {
+ uni.setStorageSync("dangerInvestigation", item);
+ uni.navigateTo({
+ url: "/pages/safeProduction/dangerInvestigation/rectify",
+ });
+ };
+ // 楠屾敹闅愭偅
+ const acceptanceVisit = item => {
+ uni.setStorageSync("dangerInvestigation", item);
+ uni.navigateTo({
+ url: "/pages/safeProduction/dangerInvestigation/acceptance",
+ });
+ };
+ // 鍒犻櫎闅愭偅
+ const deleteVisit = item => {
+ uni.showModal({
+ title: "鍒犻櫎纭",
+ content: `纭畾瑕佸垹闄よ闅愭偅鍚楋紵`,
+ success: res => {
+ if (res.confirm) {
+ deleteClientVisit(item.id);
+ }
+ },
+ });
+ };
+ const { hidden_danger_type } = useDict("hidden_danger_type");
+ // 鍒犻櫎闅愭偅璁板綍
+ const deleteClientVisit = id => {
+ showLoadingToast("鍒犻櫎涓�...");
+ safeHiddenDel([id])
+ .then(() => {
+ closeToast();
+ showToast("鍒犻櫎鎴愬姛");
+ getList();
+ })
+ .catch(() => {
+ closeToast();
+ showToast("鍒犻櫎澶辫触");
+ });
+ };
+ // 鏌ョ湅璇︽儏
+ const viewDetail = item => {
+ uni.setStorageSync("dangerInvestigation", item);
+ uni.navigateTo({
+ url: "/pages/safeProduction/dangerInvestigation/view",
+ });
+ };
+
+ onMounted(() => {
+ getList();
+ });
+
+ onShow(() => {
+ getList();
+ });
+</script>
+
+<style scoped lang="scss">
+ @import "../../../styles/sales-common.scss";
+
+ // 椤甸潰鐗瑰畾鐨勬牱寮忚鐩�
+ .sales-accoun {
+ 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; // 淇濈暀椤甸潰鐗规湁鐨勬枃鏈崲琛屾牱寮�
+ }
+
+ // 鐗瑰畾鐨勬诞鍔ㄦ寜閽牱寮�
+ .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>
+
--
Gitblit v1.9.3