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/acceptance.vue | 376 +++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 376 insertions(+), 0 deletions(-)
diff --git a/src/pages/safeProduction/dangerInvestigation/acceptance.vue b/src/pages/safeProduction/dangerInvestigation/acceptance.vue
new file mode 100644
index 0000000..e9caa35
--- /dev/null
+++ b/src/pages/safeProduction/dangerInvestigation/acceptance.vue
@@ -0,0 +1,376 @@
+<template>
+ <view class="danger-investigation-acceptance">
+ <PageHeader title="闅愭偅楠屾敹"
+ @back="goBack" />
+ <view class="section">
+ <view class="section-title">闅愭偅淇℃伅</view>
+ <view class="info-item">
+ <text class="info-label">闅愭偅缂栧彿</text>
+ <text class="info-value">{{ form.hiddenCode || '-' }}</text>
+ </view>
+ <view class="info-item">
+ <text class="info-label">闅愭偅绫诲瀷</text>
+ <text class="info-value">{{ hidden_danger_type.find(i => String(i.value) === String(form.type))?.label || '-' }}</text>
+ </view>
+ <view class="info-item">
+ <text class="info-label">椋庨櫓绛夌骇</text>
+ <text class="info-value">{{ form.riskLevel || '-' }}</text>
+ </view>
+ <view class="info-item">
+ <text class="info-label">闅愭偅鎻忚堪</text>
+ <text class="info-value">{{ form.hiddenDesc || '-' }}</text>
+ </view>
+ <view class="info-item">
+ <text class="info-label">闅愭偅鍏蜂綋浣嶇疆</text>
+ <text class="info-value">{{ form.location || '-' }}</text>
+ </view>
+ <view class="info-item">
+ <text class="info-label">涓婃姤浜�</text>
+ <text class="info-value">{{ form.createUserName || '-' }}</text>
+ </view>
+ <view class="info-item">
+ <text class="info-label">涓婃姤鏃堕棿</text>
+ <text class="info-value">{{ form.createTime || '-' }}</text>
+ </view>
+ <view class="info-item">
+ <text class="info-label">鏁存敼瀹屾垚鏈熼檺</text>
+ <text class="info-value">{{ form.rectifyTime || '-' }}</text>
+ </view>
+ <view class="info-item">
+ <text class="info-label">鏁存敼璐d换浜�</text>
+ <text class="info-value">{{ form.rectifyUserName || '-' }}</text>
+ </view>
+ <view class="info-item">
+ <text class="info-label">鏁存敼璐d换浜鸿仈绯绘柟寮�</text>
+ <text class="info-value">{{ form.rectifyUserMobile || '-' }}</text>
+ </view>
+ <view class="info-item">
+ <text class="info-label">鏁存敼鍏蜂綋鎺柦</text>
+ <text class="info-value">{{ form.rectifyMeasures || '-' }}</text>
+ </view>
+ <view class="info-item">
+ <text class="info-label">瀹為檯鏁存敼瀹屾垚鏃堕棿</text>
+ <text class="info-value">{{ form.rectifyActualTime || '-' }}</text>
+ </view>
+ </view>
+ <u-form @submit="handleSubmit"
+ ref="formRef"
+ label-width="110">
+ <!-- 楠屾敹淇℃伅 -->
+ <u-cell-group title="楠屾敹淇℃伅">
+ <u-form-item label="楠屾敹鏃堕棿"
+ prop="verifyTime"
+ border-bottom>
+ <u-input v-model="form.verifyTime"
+ placeholder="璇烽�夋嫨楠屾敹鏃堕棿"
+ disabled />
+ </u-form-item>
+ <u-form-item label="楠屾敹浜�"
+ prop="verifyUserName"
+ border-bottom>
+ <u-input v-model="form.verifyUserName"
+ disabled
+ placeholder="璇疯緭鍏ラ獙鏀朵汉" />
+ </u-form-item>
+ <u-form-item label="楠屾敹缁撴灉"
+ prop="verifyResult"
+ required
+ border-bottom>
+ <u-input v-model="verifyResultName"
+ placeholder="璇烽�夋嫨楠屾敹缁撴灉"
+ @click="showVerifyResultSheet"
+ readonly />
+ <template #right>
+ <up-icon name="arrow-right"
+ @click="showVerifyResultSheet"></up-icon>
+ </template>
+ </u-form-item>
+ <u-form-item label="楠屾敹鎰忚"
+ prop="verifyRemark"
+ required
+ border-bottom>
+ <u-textarea v-model="form.verifyRemark"
+ 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">鎻愪氦楠屾敹</u-button>
+ </view>
+ </u-form>
+ <!-- 鏃堕棿閫夋嫨鍣� -->
+ <up-datetime-picker :show="showTime"
+ v-model="currentTime"
+ @confirm="onTimeConfirm"
+ @cancel="showTime = false"
+ mode="date" />
+ <!-- 楠屾敹缁撴灉閫夋嫨鍣� -->
+ <up-action-sheet :show="verifyResultSheetVisible"
+ :actions="verifyResultOptions"
+ @select="handleVerifyResultSelect"
+ title="閫夋嫨楠屾敹缁撴灉" />
+ </view>
+</template>
+
+<script setup>
+ // 鏇挎崲 toast 鏂规硶
+ defineOptions({ name: "danger-investigation-acceptance" });
+ const showToast = message => {
+ uni.showToast({
+ title: message,
+ icon: "none",
+ });
+ };
+
+ import { ref, onMounted } from "vue";
+ import PageHeader from "@/components/PageHeader.vue";
+ import { safeHiddenUpdate } from "@/api/safeProduction/dangerInvestigation";
+ import useUserStore from "@/store/modules/user";
+ import dayjs from "dayjs";
+ import { onLoad } from "@dcloudio/uni-app";
+ import { useDict } from "@/utils/dict";
+
+ const { hidden_danger_type } = useDict("hidden_danger_type");
+ const userStore = useUserStore();
+
+ // 琛ㄥ崟鏁版嵁
+ const form = ref({
+ id: "",
+ hiddenCode: "",
+ hiddenDesc: "",
+ location: "",
+ rectifyTime: "",
+ rectifyActualTime: "",
+ rectifyResult: "",
+ verifyTime: "",
+ verifyRemark: "",
+ verifyResult: "",
+ });
+
+ // 椤甸潰鐘舵��
+ const loading = ref(false);
+ const formRef = ref(null);
+
+ // 鏃堕棿鐩稿叧
+ const currentTime = ref(Date.now());
+ const showTime = ref(false);
+
+ // 楠屾敹缁撴灉閫夋嫨鍣�
+ const verifyResultSheetVisible = ref(false);
+ const verifyResultName = ref("");
+ const verifyResultOptions = ref([
+ { value: "閫氳繃", name: "閫氳繃" },
+ { value: "涓嶉�氳繃", name: "涓嶉�氳繃" },
+ ]);
+ const showVerifyResultSheet = () => {
+ verifyResultSheetVisible.value = true;
+ };
+ const handleVerifyResultSelect = item => {
+ form.value.verifyResult = item.value;
+ verifyResultName.value = item.name;
+ verifyResultSheetVisible.value = false;
+ };
+
+ // 杩斿洖涓婁竴椤�
+ const goBack = () => {
+ // 杩斿洖鏃舵竻闄ゆ湰鍦板瓨鍌ㄧ殑鏁版嵁
+ uni.removeStorageSync("dangerInvestigation");
+ uni.navigateBack();
+ };
+
+ // 鏄剧ず鏃堕棿閫夋嫨鍣�
+ const showTimePicker = () => {
+ showTime.value = true;
+ };
+
+ // 纭鏃堕棿閫夋嫨
+ const onTimeConfirm = e => {
+ form.value.verifyTime = dayjs(e.value).format("YYYY-MM-DD");
+ currentTime.value = e.value;
+ showTime.value = false;
+ };
+
+ // 鎻愪氦琛ㄥ崟
+ const handleSubmit = async () => {
+ if (!form.value.verifyRemark) {
+ showToast("璇疯緭鍏ラ獙鏀舵剰瑙�");
+ return;
+ }
+
+ if (!form.value.verifyResult) {
+ 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];
+ });
+ console.log("submitData", submitData);
+
+ const { code } = await safeHiddenUpdate(submitData);
+ if (code === 200) {
+ showToast("楠屾敹鎻愪氦鎴愬姛");
+ setTimeout(() => {
+ goBack();
+ }, 500);
+ } else {
+ loading.value = false;
+ showToast("楠屾敹鎻愪氦澶辫触锛岃閲嶈瘯");
+ }
+ } catch (e) {
+ loading.value = false;
+ console.error("鎻愪氦澶辫触:", e);
+ showToast("鎻愪氦澶辫触锛岃閲嶈瘯");
+ }
+ };
+
+ onLoad(() => {
+ // 浠庢湰鍦板瓨鍌ㄨ幏鍙栭殣鎮f暟鎹�
+ const dangerInvestigation = uni.getStorageSync("dangerInvestigation");
+ if (dangerInvestigation && dangerInvestigation.id) {
+ form.value = dangerInvestigation;
+ console.log("form.value", form.value);
+ } else {
+ showToast("鏆傛棤闅愭偅鏁版嵁");
+ }
+ });
+
+ // 鍒濆鍖栭〉闈㈡暟鎹�
+ const initPageData = () => {
+ // 璁剧疆榛樿楠屾敹鏃堕棿涓哄綋鍓嶆椂闂�
+ if (!form.value.verifyTime) {
+ form.value.verifyTime = dayjs().format("YYYY-MM-DD");
+ currentTime.value = Date.now();
+ }
+ // 璁剧疆宸查�夐獙鏀剁粨鏋滅殑鏄剧ず鏂囨湰
+ if (form.value.verifyResult) {
+ verifyResultName.value =
+ verifyResultOptions.value.find(
+ item => item.value === form.value.verifyResult
+ )?.name || "";
+ }
+ // 璁剧疆楠屾敹浜�
+ if (!form.value.verifyUserName) {
+ userStore.getInfo().then(res => {
+ form.value.verifyUserId = res.user.userId;
+ form.value.verifyUserName = res.user.nickName;
+ });
+ }
+ console.log("form.value", form.value);
+ };
+
+ onMounted(() => {
+ initPageData();
+ });
+</script>
+
+<style scoped lang="scss">
+ @import "@/static/scss/form-common.scss";
+ .danger-investigation-acceptance {
+ min-height: 100vh;
+ background-color: #f8f9fa;
+ padding-bottom: 160rpx;
+ }
+ .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 2.5rem 2.5rem 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 2.5rem 2.5rem 2.5rem;
+ }
+
+ .section {
+ background-color: #ffffff;
+ margin-bottom: 16px;
+ overflow: hidden;
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
+ }
+
+ .section-title {
+ font-size: 16px;
+ font-weight: 600;
+ color: #333333;
+ padding: 16px 16px 12px;
+ border-bottom: 1px solid #f0f0f0;
+ }
+
+ .info-item {
+ display: flex;
+ padding: 14px 16px;
+ border-bottom: 1px solid #f8f8f8;
+ align-items: flex-start;
+ }
+
+ .info-item:last-child {
+ border-bottom: none;
+ }
+
+ .info-label {
+ font-size: 14px;
+ color: #666666;
+ min-width: 80px;
+ flex-shrink: 0;
+ line-height: 22px;
+ }
+
+ .info-value {
+ font-size: 14px;
+ color: #333333;
+ flex: 1;
+ line-height: 22px;
+ text-align: right;
+ }
+
+ .multi-line {
+ text-align: left;
+ word-break: break-all;
+ line-height: 1.6;
+ }
+
+ .remark-item {
+ padding-bottom: 16px;
+ }
+</style>
\ No newline at end of file
--
Gitblit v1.9.3