浏览代码

Merge branch 'stable' of http://39.98.153.250:9080/yudao/yudao-admin-yiqun into stable

xuzhancheng 1 天之前
父节点
当前提交
e0f26dd4b9

+ 3 - 1
yudao-ui-admin-vue3/src/permission.ts

@@ -92,7 +92,9 @@ const whiteList = [
   '/auth-redirect',
   '/bind',
   '/register',
-  '/oauthLogin/gitee'
+  '/oauthLogin/gitee',
+  '/pressure2/qr-report/boiler',
+  '/pressure2/qr-report/pipe'
 ]
 
 // 路由加载前

+ 1 - 1
yudao-ui-admin-vue3/src/router/index.ts

@@ -12,7 +12,7 @@ const router = createRouter({
 })
 
 export const resetRouter = (): void => {
-  const resetWhiteNameList = ['Redirect', 'Login', 'NoFind', 'Root']
+  const resetWhiteNameList = ['Redirect', 'Login', 'NoFind', 'Root', 'BoilerQrReport', 'PipeQrReport']
   router.getRoutes().forEach((route) => {
     const { name } = route
     if (name && !resetWhiteNameList.includes(name as string)) {

+ 20 - 0
yudao-ui-admin-vue3/src/router/modules/remaining.ts

@@ -206,6 +206,26 @@ const remainingRouter: AppRouteRecordRaw[] = [
       noTagsView: true
     }
   },
+  {
+    path: '/pressure2/qr-report/boiler',
+    component: () => import('@/views/pressure2/qrReport/BoilerQrReport.vue'),
+    name: 'BoilerQrReport',
+    meta: {
+      hidden: true,
+      title: '锅炉检验报告',
+      noTagsView: true
+    }
+  },
+  {
+    path: '/pressure2/qr-report/pipe',
+    component: () => import('@/views/pressure2/qrReport/PipeQrReport.vue'),
+    name: 'PipeQrReport',
+    meta: {
+      hidden: true,
+      title: '管道检验报告',
+      noTagsView: true
+    }
+  },
   {
     path: '/sso',
     component: () => import('@/views/Login/Login.vue'),

+ 4 - 4
yudao-ui-admin-vue3/src/views/pressure2/boilerchecker/components/StatusOperationPanel.vue

@@ -249,9 +249,9 @@
                           <el-button
                             :type="
                               OAApprovalResultType[record.result] ||
-                                (record.result === 100
+                                (record.result === 100 || record.result === '100'
                                   ? 'success'
-                                  : record.result === 200
+                                  : record.result === 200 || record.result === '200'
                                     ? 'danger'
                                     : 'default')
                             "
@@ -259,9 +259,9 @@
                             size="small"
                           >{{
                               OAApprovalResultMap[record.result] ||
-                                (record.result === 100
+                                (record.result === 100 || record.result === '100'
                                   ? '通过'
-                                  : record.result === 200
+                                  : record.result === 200 || record.result === '200'
                                     ? '拒绝'
                                     : record.result || '-')
                             }}</el-button

+ 4 - 4
yudao-ui-admin-vue3/src/views/pressure2/pipechecker/components/StatusOperationPanel.vue

@@ -249,9 +249,9 @@
                           <el-button
                             :type="
                               OAApprovalResultType[record.result] ||
-                                (record.result === 100
+                                (record.result === 100 || record.result === '100'
                                   ? 'success'
-                                  : record.result === 200
+                                  : record.result === 200 || record.result === '200'
                                     ? 'danger'
                                     : 'default')
                             "
@@ -259,9 +259,9 @@
                             size="small"
                           >{{
                               OAApprovalResultMap[record.result] ||
-                                (record.result === 100
+                                (record.result === 100 || record.result === '100'
                                   ? '通过'
-                                  : record.result === 200
+                                  : record.result === 200 || record.result === '200'
                                     ? '拒绝'
                                     : record.result || '-')
                             }}</el-button

+ 31 - 0
yudao-ui-admin-vue3/src/views/pressure2/qrReport/BoilerQrReport.vue

@@ -0,0 +1,31 @@
+<template>
+  <QrReportView
+    api-url="/pressure2/platform/equip/boiler/qrCodeReport"
+    report-title="锅炉检验报告"
+    :display-fields="boilerFields"
+  />
+</template>
+
+<script setup lang="ts">
+import QrReportView from './QrReportView.vue'
+
+defineOptions({ name: 'BoilerQrReport' })
+
+const boilerFields: Record<string, string> = {
+  typeName: '设备类别',
+  equipName: '设备名称',
+  equipCode: '设备代码',
+  useRegisterNo: '使用登记证编号',
+  useUnitName: '使用单位',
+  factoryCode: '出厂编号',
+  productNo: '产品编号',
+  reportNo: '报告编号',
+  mainConclusion: '检验结论',
+  nextCheckDate: '下次定期检验日期',
+  nextYearCheckDate: '下次年度检查日期',
+  nextPressureCheckDate: '下次耐压检验日期',
+  checkDate: '检验日期',
+  // checkOrganization: '检验机构',
+  checkTypeName: '检验性质',
+}
+</script>

+ 30 - 0
yudao-ui-admin-vue3/src/views/pressure2/qrReport/PipeQrReport.vue

@@ -0,0 +1,30 @@
+<template>
+  <QrReportView
+    api-url="/pressure2/platform/equip/pipe/qrCodeReport"
+    report-title="管道检验报告"
+    :display-fields="pipeFields"
+  />
+</template>
+
+<script setup lang="ts">
+import QrReportView from './QrReportView.vue'
+
+defineOptions({ name: 'PipeQrReport' })
+
+const pipeFields: Record<string, string> = {
+  typeName: '管道类别',
+  equipCode: '工程号',
+  equipName: '工程名称',
+  useRegisterNo: '使用登记证编号',
+  useUnitName: '使用单位',
+  // pipeLevel: '管道级别',
+  productNo: '产品编号',
+  reportNo: '报告编号',
+  mainConclusion: '检验结论',
+  nextCheckDate: '下次定期检验日期',
+  nextYearCheckDate: '下次年度检查日期',
+  checkDate: '检验日期',
+  // checkOrganization: '检验机构',
+  checkTypeName: '检验性质'
+}
+</script>

+ 159 - 0
yudao-ui-admin-vue3/src/views/pressure2/qrReport/QrReportView.vue

@@ -0,0 +1,159 @@
+<template>
+  <div class="qr-report-container">
+    <div class="qr-report-header">
+      <div class="qr-report-header-title">特种设备检测研究院</div>
+      <div class="qr-report-header-desc">{{ reportTitle }}</div>
+    </div>
+
+    <div class="qr-report-content" v-loading="loading">
+      <div v-if="errorMsg" class="qr-report-error">{{ errorMsg }}</div>
+      <div v-else-if="formData" class="qr-report-table">
+        <div class="table-row" v-for="(label, key) in displayFields" :key="key">
+          <div class="table-cell table-label">{{ label }}:</div>
+          <div class="table-cell table-value">{{ formData[key] || '-' }}</div>
+        </div>
+      </div>
+      <div v-else-if="!loading" class="qr-report-error">暂无报告数据</div>
+    </div>
+  </div>
+</template>
+
+<script setup lang="ts">
+import { ref, onMounted } from 'vue'
+import { useRoute } from 'vue-router'
+import dayjs from 'dayjs'
+
+defineOptions({ name: 'QrReportView' })
+
+interface Props {
+  apiUrl: string
+  reportTitle: string
+  displayFields: Record<string, string>
+}
+
+const props = defineProps<Props>()
+const route = useRoute()
+const loading = ref(false)
+const errorMsg = ref('')
+const formData = ref<Record<string, any> | null>(null)
+
+const baseUrl = import.meta.env.VITE_BASE_URL + import.meta.env.VITE_API_URL
+
+const fetchReport = async () => {
+  const id = route.query.id as string
+  if (!id) {
+    errorMsg.value = '缺少报告 ID 参数'
+    return
+  }
+  loading.value = true
+  try {
+    const res = await fetch(baseUrl + props.apiUrl + '?id=' + encodeURIComponent(id))
+    if (!res.ok) {
+      errorMsg.value = '请求失败:' + res.status
+      return
+    }
+    const json = await res.json()
+    // 处理 yudao CommonResult 包装
+    if (json && json.code === 0 && json.data) {
+      formData.value = json.data
+    } else if (json && json.code === 0) {
+      formData.value = json
+    } else if (json && json.data) {
+      formData.value = json.data
+    } else {
+      formData.value = json
+    }
+  } catch (e: any) {
+    errorMsg.value = '请求异常:' + e.message
+  } finally {
+    loading.value = false
+  }
+}
+
+onMounted(() => {
+  fetchReport()
+})
+</script>
+
+<style scoped>
+.qr-report-container {
+  width: 100%;
+  min-height: 100vh;
+  background-color: #f5f5f5;
+}
+
+.qr-report-header {
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+  align-items: center;
+  gap: 12px;
+  background-color: #26456a;
+  padding: 24px 0;
+  margin-bottom: 20px;
+}
+
+.qr-report-header-title {
+  font-weight: 500;
+  font-size: 18px;
+  color: #fff;
+}
+
+.qr-report-header-desc {
+  font-weight: 500;
+  font-size: 15px;
+  color: #fff;
+}
+
+.qr-report-content {
+  max-width: 720px;
+  margin: 0 auto;
+  padding: 0 16px;
+  box-sizing: border-box;
+}
+
+.qr-report-error {
+  text-align: center;
+  color: #999;
+  padding: 40px 0;
+  font-size: 14px;
+}
+
+.qr-report-table {
+  width: 100%;
+  background-color: #fff;
+  border: 1px solid #d9d9d9;
+}
+
+.table-row {
+  display: flex;
+  border-bottom: 1px solid #d9d9d9;
+}
+
+.table-row:last-child {
+  border-bottom: none;
+}
+
+.table-cell {
+  padding: 14px 16px;
+  font-size: 14px;
+  line-height: 1.6;
+  word-break: break-all;
+}
+
+.table-label {
+  width: 36%;
+  min-width: 140px;
+  background-color: #f7f8fa;
+  color: #333;
+  font-weight: 500;
+  border-right: 1px solid #d9d9d9;
+  flex-shrink: 0;
+}
+
+.table-value {
+  flex: 1;
+  color: #666;
+  background-color: #fff;
+}
+</style>

+ 1 - 1
yudao-ui-admin-vue3/src/views/pressure2/reportArchivingBoiler/detail.vue

@@ -150,7 +150,7 @@ const detailTableSchema = reactive<TableItem[]>([
             <>
               {row.fileType !== 3 && row.countNum > 0 && (
                 <el-button type="primary" link onClick={() => handlePreviewOrder(row)}>
-                  {row.countNum}
+                  预览
                 </el-button>
               )}
               <el-button

+ 1 - 1
yudao-ui-admin-vue3/src/views/pressure2/reportArchivingPipe/detail.vue

@@ -150,7 +150,7 @@ const detailTableSchema = reactive<TableItem[]>([
             <>
               {row.fileType !== 3 && row.countNum > 0 && (
                 <el-button type="primary" link onClick={() => handlePreviewOrder(row)}>
-                  {row.countNum}
+                  预览
                 </el-button>
               )}
               <el-button