From a60d21cdda7df7733050315fc6462a70c273fcb4 Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期三, 04 二月 2026 17:01:02 +0800
Subject: [PATCH] Merge branch 'dev_new' of http://114.132.189.42:9002/r/product-inventory-APP-before into dev_new

---
 src/pages/safeProduction/emergencyPlanReview/index.vue |  373 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 373 insertions(+), 0 deletions(-)

diff --git a/src/pages/safeProduction/emergencyPlanReview/index.vue b/src/pages/safeProduction/emergencyPlanReview/index.vue
new file mode 100644
index 0000000..f575002
--- /dev/null
+++ b/src/pages/safeProduction/emergencyPlanReview/index.vue
@@ -0,0 +1,373 @@
+<template>
+  <view class="emergency-plan-review">
+    <!-- 浣跨敤閫氱敤椤甸潰澶撮儴缁勪欢 -->
+    <PageHeader title="搴旀�ラ妗堝鏍�"
+                @back="goBack" />
+    <!-- 鎼滅储鍜岀瓫閫夊尯鍩� -->
+    <view class="search-section">
+      <view class="search-bar">
+        <view class="search-input">
+          <up-input class="search-text"
+                    placeholder="璇疯緭鍏ュ簲鎬ラ妗堝悕绉�"
+                    v-model="searchForm.planName"
+                    @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="planList.length > 0">
+      <view v-for="(item, index) in planList"
+            :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-title">{{ item.planName }}</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.planCode || '-' }}</text>
+            </view>
+            <view class="detail-row">
+              <text class="detail-label">棰勬绫诲瀷</text>
+              <u-tag :type="getPlanTypeTagType(item.planType)">
+                {{ emergencyPlanTypeLabel(item.planType) }}
+              </u-tag>
+            </view>
+            <view class="detail-row">
+              <text class="detail-label">鍙戝竷鐢熸晥鏃堕棿</text>
+              <text class="detail-value">{{ item.publishTime || '-' }}</text>
+            </view>
+            <view class="detail-row">
+              <text class="detail-label">鏍稿績璐d换浜�</text>
+              <text class="detail-value">{{ item.coreResponsorUserName || '-' }}</text>
+            </view>
+            <view class="detail-row"
+                  v-if="item.remark">
+              <text class="detail-label">澶囨敞</text>
+              <text class="detail-value">{{ item.remark }}</text>
+            </view>
+          </view>
+          <!-- 鎸夐挳鍖哄煙 -->
+          <view class="action-buttons">
+            <u-button type="primary"
+                      size="small"
+                      class="action-btn"
+                      @click="editPlan(item)">
+              缂栬緫
+            </u-button>
+            <u-button type="info"
+                      size="small"
+                      class="action-btn"
+                      @click="viewDetail(item)">
+              鏌ョ湅璇︽儏
+            </u-button>
+            <u-button type="error"
+                      size="small"
+                      class="action-btn"
+                      @click="deletePlan(item)">
+              鍒犻櫎
+            </u-button>
+          </view>
+        </view>
+      </view>
+    </view>
+    <view v-else
+          class="no-data">
+      <text>鏆傛棤搴旀�ラ妗�</text>
+    </view>
+    <!-- 娴姩鏂板鎸夐挳 -->
+    <view class="fab-button"
+          @click="addPlan">
+      <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 {
+    safeContingencyPlanListPage,
+    safeContingencyPlanDel,
+  } from "@/api/safeProduction/emergencyPlanReview";
+  import { useDict } from "@/utils/dict";
+  import useUserStore from "@/store/modules/user";
+
+  // 鏇挎崲 toast 鏂规硶
+  defineOptions({ name: "emergency-plan-review-index" });
+  const showToast = message => {
+    uni.showToast({
+      title: message,
+      icon: "none",
+    });
+  };
+
+  const userStore = useUserStore();
+
+  // 鎼滅储琛ㄥ崟
+  const searchForm = ref({
+    planName: "",
+  });
+
+  // 搴旀�ラ妗堟暟鎹�
+  const planList = ref([]);
+
+  // 搴旀�ラ妗堢被鍨嬮�夐」
+  const { emergency_plan_type } = useDict("emergency_plan_type");
+  const emergencyPlanTypeOptions = computed(
+    () => emergency_plan_type?.value || []
+  );
+
+  // 鑾峰彇棰勬绫诲瀷鏍囩绫诲瀷
+  const getPlanTypeTagType = planType => {
+    const typeMap = {
+      emergency: "warning",
+      fire: "danger",
+      natural: "info",
+      accident: "error",
+    };
+    return typeMap[planType] || "info";
+  };
+
+  // 鑾峰彇棰勬绫诲瀷鏍囩鏂囨湰
+  const emergencyPlanTypeLabel = val => {
+    const item = emergencyPlanTypeOptions.value.find(
+      i => String(i.value) === String(val)
+    );
+    return item ? item.label : val;
+  };
+
+  // 杩斿洖涓婁竴椤�
+  const goBack = () => {
+    uni.navigateBack();
+  };
+  const searchChange = val => {
+    searchForm.value.planName = val;
+    getList();
+  };
+
+  // 鏌ヨ鍒楄〃
+  const getList = () => {
+    showLoadingToast("鍔犺浇涓�...");
+    const params = {
+      current: -1,
+      size: -1,
+      ...searchForm.value,
+    };
+    safeContingencyPlanListPage(params)
+      .then(res => {
+        planList.value = res.records || res.data?.records || [];
+        closeToast();
+      })
+      .catch(() => {
+        closeToast();
+        showToast("鑾峰彇鏁版嵁澶辫触");
+      });
+  };
+
+  // 鏄剧ず鍔犺浇鎻愮ず
+  const showLoadingToast = message => {
+    uni.showLoading({
+      title: message,
+      mask: true,
+    });
+  };
+
+  // 鍏抽棴鎻愮ず
+  const closeToast = () => {
+    uni.hideLoading();
+  };
+
+  // 鏂板搴旀�ラ妗�
+  const addPlan = () => {
+    uni.setStorageSync("emergencyPlan", {});
+    uni.navigateTo({
+      url: "/pages/safeProduction/emergencyPlanReview/detail",
+    });
+  };
+
+  // 缂栬緫搴旀�ラ妗�
+  const editPlan = item => {
+    uni.setStorageSync("emergencyPlan", item);
+    uni.navigateTo({
+      url: "/pages/safeProduction/emergencyPlanReview/detail",
+    });
+  };
+
+  // 鍒犻櫎搴旀�ラ妗�
+  const deletePlan = item => {
+    uni.showModal({
+      title: "鍒犻櫎纭",
+      content: `纭畾瑕佸垹闄よ搴旀�ラ妗堝悧锛焋,
+      success: res => {
+        if (res.confirm) {
+          deleteEmergencyPlan(item.id);
+        }
+      },
+    });
+  };
+
+  // 鍒犻櫎搴旀�ラ妗堣褰�
+  const deleteEmergencyPlan = id => {
+    showLoadingToast("鍒犻櫎涓�...");
+    safeContingencyPlanDel([id])
+      .then(() => {
+        closeToast();
+        showToast("鍒犻櫎鎴愬姛");
+        getList();
+      })
+      .catch(() => {
+        closeToast();
+        showToast("鍒犻櫎澶辫触");
+      });
+  };
+
+  // 鏌ョ湅璇︽儏
+  const viewDetail = item => {
+    uni.setStorageSync("emergencyPlan", item);
+    uni.navigateTo({
+      url: "/pages/safeProduction/emergencyPlanReview/view",
+    });
+  };
+
+  onMounted(() => {
+    getList();
+  });
+
+  onShow(() => {
+    getList();
+  });
+</script>
+
+<style scoped lang="scss">
+  @import "../../../styles/sales-common.scss";
+
+  // 椤甸潰鐗瑰畾鐨勬牱寮忚鐩�
+  .emergency-plan-review {
+    min-height: 100vh;
+    background: #f8f9fa;
+    position: relative;
+  }
+
+  // 鐗瑰畾鐨勫浘鏍囨牱寮�
+  .document-icon {
+    background: #2979ff; // 涓庨攢鍞ā鍧椾繚鎸佷竴鑷寸殑鑳屾櫙鑹�
+  }
+
+  // 鐗规湁鏍峰紡
+  .detail-value {
+    word-break: break-all; // 淇濈暀椤甸潰鐗规湁鐨勬枃鏈崲琛屾牱寮�
+  }
+
+  // 鐗瑰畾鐨勬诞鍔ㄦ寜閽牱寮�
+  .fab-button {
+    background: #2979ff; // 涓庨攢鍞ā鍧椾繚鎸佷竴鑷寸殑鑳屾櫙鑹�
+    box-shadow: 0 4px 16px rgba(41, 121, 255, 0.3); // 涓庨攢鍞ā鍧椾繚鎸佷竴鑷寸殑闃村奖鏁堟灉
+  }
+
+  // 鎿嶄綔鎸夐挳鏍峰紡
+  .action-buttons {
+    display: flex;
+    gap: 12px;
+    padding: 0 0 16px 0;
+    justify-content: space-between;
+  }
+
+  .action-btn {
+    flex: 1;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    gap: 8px;
+  }
+
+  // 鍒楄〃瀹瑰櫒鏍峰紡
+  .plan-list {
+    padding: 20px;
+  }
+
+  // 鍒楄〃椤规牱寮�
+  .plan-item {
+    background: #ffffff;
+    border-radius: 12px;
+    margin-bottom: 16px;
+    overflow: hidden;
+    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
+    padding: 0 16px;
+
+    &:active {
+      transform: scale(0.98);
+      box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
+    }
+  }
+
+  // 椤圭洰澶撮儴鏍峰紡
+  .item-header {
+    padding: 16px 0;
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+  }
+
+  .item-left {
+    display: flex;
+    align-items: center;
+    gap: 8px;
+  }
+
+  .item-title {
+    font-size: 14px;
+    color: #333;
+    font-weight: 500;
+  }
+
+  // 璇︽儏鍖哄煙鏍峰紡
+  .item-details {
+    padding: 16px 0;
+  }
+
+  .detail-row {
+    display: flex;
+    align-items: flex-end;
+    justify-content: space-between;
+    margin-bottom: 8px;
+
+    &:last-child {
+      margin-bottom: 0;
+    }
+  }
+
+  .detail-label {
+    font-size: 12px;
+    color: #777777;
+    min-width: 60px;
+  }
+
+  .detail-value {
+    font-size: 12px;
+    color: #000000;
+    text-align: right;
+    flex: 1;
+    margin-left: 16px;
+  }
+</style>

--
Gitblit v1.9.3