From 03e1f933ce9771a7cdacddbff5be7186ba1d4718 Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期四, 05 二月 2026 17:29:02 +0800
Subject: [PATCH] 安全培训考核更正名字错字
---
src/pages/safeProduction/safetyTrainingAssessment/resultDetail.vue | 388 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 388 insertions(+), 0 deletions(-)
diff --git a/src/pages/safeProduction/safetyTrainingAssessment/resultDetail.vue b/src/pages/safeProduction/safetyTrainingAssessment/resultDetail.vue
new file mode 100644
index 0000000..9fd10a1
--- /dev/null
+++ b/src/pages/safeProduction/safetyTrainingAssessment/resultDetail.vue
@@ -0,0 +1,388 @@
+<template>
+ <view class="result-detail">
+ <!-- 椤甸潰澶撮儴 -->
+ <PageHeader title="缁撴灉鏄庣粏"
+ @back="goBack" />
+ <!-- 鍐呭鍖哄煙 -->
+ <view class="content">
+ <!-- 璇剧▼璇︽儏 -->
+ <view class="section">
+ <view class="section-title">璇剧▼璇︽儏</view>
+ <view class="info-list">
+ <view class="info-item">
+ <text class="info-label">璇剧▼缂栧彿</text>
+ <text class="info-value">{{ currentTraining.courseCode || '-' }}</text>
+ </view>
+ <view class="info-item">
+ <text class="info-label">鍩硅鍐呭</text>
+ <text class="info-value">{{ currentTraining.trainingContent || '-' }}</text>
+ </view>
+ <view class="info-item">
+ <text class="info-label">鐘舵��</text>
+ <text class="info-value">
+ <u-tag :type="currentTraining.state === 0 ? 'success' : (currentTraining.state === 1 ? 'warning' : 'info')">
+ {{ currentTraining.state === 0 ? '鏈紑濮�' : (currentTraining.state === 1 ? '杩涜涓�' : '宸茬粨鏉�') }}
+ </u-tag>
+ </text>
+ </view>
+ <view class="info-item">
+ <text class="info-label">鍩硅璁插笀</text>
+ <text class="info-value">{{ currentTraining.trainingLecturer || '-' }}</text>
+ </view>
+ <view class="info-item">
+ <text class="info-label">鍩硅寮�濮嬫椂闂�</text>
+ <text class="info-value">{{ currentTraining.trainingDate + ' ' + currentTraining.openingTime || '-' }}</text>
+ </view>
+ <view class="info-item">
+ <text class="info-label">鍩硅缁撴潫鏃堕棿</text>
+ <text class="info-value">{{ currentTraining.trainingDate + ' ' + currentTraining.endTime || '-' }}</text>
+ </view>
+ <view class="info-item">
+ <text class="info-label">鍩硅鐩爣</text>
+ <text class="info-value">{{ currentTraining.trainingObjectives || '-' }}</text>
+ </view>
+ <view class="info-item">
+ <text class="info-label">鍙傚姞瀵硅薄</text>
+ <text class="info-value">{{ currentTraining.participants || '-' }}</text>
+ </view>
+ <view class="info-item">
+ <text class="info-label">鍩硅鏂瑰紡</text>
+ <text class="info-value">{{ getTrainingModeLabel(currentTraining.trainingMode) || '-' }}</text>
+ </view>
+ <view class="info-item">
+ <text class="info-label">鍩硅鍦扮偣</text>
+ <text class="info-value">{{ currentTraining.placeTraining || '-' }}</text>
+ </view>
+ <view class="info-item">
+ <text class="info-label">璇炬椂</text>
+ <text class="info-value">{{ currentTraining.classHour || '-' }}</text>
+ </view>
+ <view class="info-item">
+ <text class="info-label">璇剧▼瀛﹀垎</text>
+ <text class="info-value">{{ currentTraining.projectCredits || '-' }}</text>
+ </view>
+ <view class="info-item">
+ <text class="info-label">鎶ュ悕浜烘暟</text>
+ <text class="info-value">{{ currentTraining.nums || '-' }}</text>
+ </view>
+ </view>
+ </view>
+ <!-- 璇剧▼璇勪环 -->
+ <view class="section">
+ <view class="section-title">璇剧▼璇勪环</view>
+ <u-form ref="formRef"
+ label-width="90"
+ :model="endform">
+ <u-form-item label="璇勪环浜�">
+ <u-input v-model="endform.assessmentUserName"
+ disabled
+ placeholder="璇烽�夋嫨璇勪环浜�" />
+ </u-form-item>
+ <u-form-item label="璇勪环鏃堕棿">
+ <u-input v-model="endform.assessmentDate"
+ disabled
+ placeholder="璇烽�夋嫨璇勪环鏃堕棿" />
+ </u-form-item>
+ <u-form-item label="鑰冩牳鏂瑰紡">
+ <u-input v-model="endform.assessmentMethod"
+ placeholder="璇疯緭鍏ヨ�冩牳鏂瑰紡" />
+ </u-form-item>
+ <u-form-item label="缁煎悎璇勪环">
+ <u-input v-model="endform.comprehensiveAssessment"
+ placeholder="璇疯緭鍏ユ湰娆¤绋嬬患鍚堣瘎浠�" />
+ </u-form-item>
+ <u-form-item label="鍩硅鎽樿">
+ <u-textarea v-model="endform.trainingAbstract"
+ :rows="4"
+ placeholder="璇疯緭鍏ュ煿璁憳瑕�" />
+ </u-form-item>
+ </u-form>
+ </view>
+ <!-- 鑰冩牳鍒楄〃 -->
+ <view class="section">
+ <view class="section-title">鑰冩牳鍒楄〃</view>
+ <view class="assessment-list">
+ <view v-for="(item, index) in endform.safeTrainingDetailsDtoList"
+ :key="index"
+ class="assessment-item">
+ <view class="assessment-info">
+ <view class="info-row">
+ <text class="label">濮撳悕锛�</text>
+ <text class="value">{{ item.nickName || '-' }}</text>
+ </view>
+ <view class="info-row">
+ <text class="label">鐢佃瘽鍙风爜锛�</text>
+ <text class="value">{{ item.phonenumber || '-' }}</text>
+ </view>
+ </view>
+ <view class="assessment-result">
+ <text class="result-label">鑰冩牳缁撴灉锛�</text>
+ <u-radio-group v-model="endform.safeTrainingDetailsDtoList[index].examinationResults"
+ :key="index"
+ size="default">
+ <u-radio label="鍚堟牸"
+ name="鍚堟牸"></u-radio>
+ <u-radio label="涓嶅悎鏍�"
+ name="涓嶅悎鏍�"></u-radio>
+ </u-radio-group>
+ </view>
+ </view>
+ </view>
+ </view>
+ <!-- 鎻愪氦鎸夐挳 -->
+ <view class="submit-btn">
+ <u-button type="primary"
+ @click="submitForm"
+ :loading="loading">鎻愪氦</u-button>
+ </view>
+ </view>
+ </view>
+</template>
+
+<script setup>
+ import { ref, onMounted } from "vue";
+ import PageHeader from "@/components/PageHeader.vue";
+ import { onLoad } from "@dcloudio/uni-app";
+ import { useDict } from "@/utils/dict";
+ import dayjs from "dayjs";
+ import useUserStore from "@/store/modules/user";
+ import {
+ safeTrainingGet,
+ safeTrainingSave,
+ } from "@/api/safeProduction/safetyTrainingAssessment";
+
+ // 鑾峰彇瀛楀吀鏁版嵁
+ const { safe_training_methods } = useDict("safe_training_methods");
+
+ // 椤甸潰鐘舵��
+ const loading = ref(false);
+ const currentTraining = ref({});
+ const endform = ref({
+ assessmentUserId: "",
+ assessmentUserName: "",
+ assessmentMethod: "",
+ assessmentDate: "",
+ comprehensiveAssessment: "",
+ trainingAbstract: "",
+ safeTrainingFileList: [],
+ safeTrainingDetailsDtoList: [],
+ });
+
+ // 鑾峰彇鍩硅鏂瑰紡鏍囩
+ const getTrainingModeLabel = val => {
+ if (!safe_training_methods || !Array.isArray(safe_training_methods.value)) {
+ return val;
+ }
+ const item = safe_training_methods.value.find(
+ i => String(i.value) === String(val)
+ );
+ return item ? item.label : val;
+ };
+
+ // 杩斿洖涓婁竴椤�
+ const goBack = () => {
+ uni.navigateBack();
+ };
+ // 鎻愪氦琛ㄥ崟
+ const submitForm = () => {
+ // 楠岃瘉鑰冩牳缁撴灉
+ for (let i = 0; i < endform.value.safeTrainingDetailsDtoList.length; i++) {
+ const item = endform.value.safeTrainingDetailsDtoList[i];
+ if (!item.examinationResults) {
+ uni.showToast({
+ title: `璇烽�夋嫨${item.nickName}鐨勮�冩牳缁撴灉`,
+ icon: "none",
+ });
+ return;
+ }
+ }
+
+ loading.value = true;
+ safeTrainingSave(endform.value)
+ .then(res => {
+ loading.value = false;
+ if (res.code === 200) {
+ uni.showToast({ title: "鎻愪氦鎴愬姛", icon: "success" });
+ setTimeout(() => {
+ goBack();
+ }, 500);
+ } else {
+ uni.showToast({ title: res.msg || "鎻愪氦澶辫触", icon: "none" });
+ }
+ })
+ .catch(() => {
+ loading.value = false;
+ uni.showToast({ title: "鎻愪氦澶辫触锛岃閲嶈瘯", icon: "none" });
+ });
+ };
+
+ // 椤甸潰鍔犺浇
+ onLoad(() => {
+ const trainingId = uni.getStorageSync("safetyTrainingResultId");
+ const trainingNums = uni.getStorageSync("safetyTrainingResultNums");
+
+ if (trainingId) {
+ getTrainingDetail(trainingId, trainingNums);
+ }
+ });
+ const userStore = useUserStore();
+ const getuserInfo = () => {
+ const userInfo = {
+ id: "",
+ nickName: "",
+ };
+ userStore.getInfo().then(res => {
+ userInfo.id = res.user.userId;
+ userInfo.nickName = res.user.nickName;
+ endform.value.assessmentUserName = res.user.nickName;
+ endform.value.assessmentUserId = res.user.userId;
+ });
+ return userInfo;
+ };
+
+ // 鑾峰彇鍩硅璇︽儏
+ const getTrainingDetail = (id, trainingNums) => {
+ loading.value = true;
+ safeTrainingGet({ id })
+ .then(res => {
+ loading.value = false;
+ if (res.code === 200) {
+ currentTraining.value = res.data;
+ currentTraining.value.nums = trainingNums;
+
+ endform.value = { ...res.data };
+ // 璁剧疆榛樿鍊�
+ if (!endform.value.assessmentUserId) {
+ getuserInfo();
+ }
+
+ endform.value.assessmentDate = endform.value.assessmentDate
+ ? dayjs(endform.value.assessmentDate).format("YYYY-MM-DD")
+ : dayjs().format("YYYY-MM-DD");
+ endform.value.safeTrainingDetailsDtoList =
+ endform.value.safeTrainingDetailsDtoList || [];
+ } else {
+ uni.showToast({ title: "鑾峰彇璇︽儏澶辫触", icon: "none" });
+ }
+ })
+ .catch(() => {
+ loading.value = false;
+ uni.showToast({ title: "鑾峰彇璇︽儏澶辫触", icon: "none" });
+ });
+ };
+</script>
+
+<style scoped lang="scss">
+ .result-detail {
+ min-height: 100vh;
+ background: #f8f9fa;
+ }
+
+ .content {
+ padding: 16px;
+ }
+
+ .section {
+ background: #fff;
+ border-radius: 8px;
+ padding: 16px;
+ margin-bottom: 16px;
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
+ }
+
+ .section-title {
+ font-size: 16px;
+ font-weight: 600;
+ margin-bottom: 16px;
+ color: #333;
+ }
+
+ .info-list {
+ display: flex;
+ flex-direction: column;
+ gap: 12px;
+ }
+
+ .info-item {
+ display: flex;
+ justify-content: space-between;
+ align-items: flex-start;
+ padding-bottom: 12px;
+ border-bottom: 1px solid #f0f0f0;
+ }
+
+ .info-item:last-child {
+ border-bottom: none;
+ padding-bottom: 0;
+ }
+
+ .info-label {
+ font-size: 14px;
+ color: #666;
+ width: 100px;
+ }
+
+ .info-value {
+ flex: 1;
+ font-size: 14px;
+ color: #333;
+ text-align: right;
+ }
+
+ .assessment-list {
+ display: flex;
+ flex-direction: column;
+ gap: 12px;
+ }
+
+ .assessment-item {
+ background: #f8f9fa;
+ border-radius: 8px;
+ padding: 16px;
+ border: 1px solid #e8e8e8;
+ }
+
+ .assessment-info {
+ margin-bottom: 12px;
+ }
+
+ .info-row {
+ display: flex;
+ align-items: center;
+ margin-bottom: 8px;
+ }
+
+ .info-row:last-child {
+ margin-bottom: 0;
+ }
+
+ .label {
+ font-size: 14px;
+ color: #666;
+ min-width: 80px;
+ }
+
+ .value {
+ font-size: 14px;
+ color: #333;
+ flex: 1;
+ }
+
+ .assessment-result {
+ display: flex;
+ align-items: center;
+ padding-top: 8px;
+ border-top: 1px solid #e8e8e8;
+ }
+
+ .result-label {
+ font-size: 14px;
+ color: #666;
+ min-width: 80px;
+ }
+
+ .submit-btn {
+ margin-top: 24px;
+ margin-bottom: 32px;
+ }
+</style>
\ No newline at end of file
--
Gitblit v1.9.3