| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278 |
- <!DOCTYPE html>
- <html lang="zh-CN">
- <head>
- <meta charset="UTF-8"/>
- <meta name="viewport"
- content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
- <title>风纪检查详情</title>
- <script src="/js/mp_base/base.js?v=20261127-auth-refresh-v1"></script>
- <style>
- [v-cloak] { display: none !important; }
- :root {
- --line: #e5e7eb;
- --text: #222;
- --muted: #8b95a5;
- --green: #222222;
- --danger: #e5484d;
- }
- * { box-sizing: border-box; }
- body {
- margin: 0;
- color: var(--text);
- background: #f3f4f6;
- font-family: -apple-system, BlinkMacSystemFont, "PingFang SC",
- "Microsoft YaHei", sans-serif;
- }
- #app { min-height: 100vh; }
- .loading-container {
- display: flex;
- min-height: 65vh;
- align-items: center;
- justify-content: center;
- color: var(--muted);
- font-size: 14px;
- }
- .loading-spinner {
- width: 34px;
- height: 34px;
- margin-right: 10px;
- border: 4px solid #e6e8ec;
- border-top-color: var(--green);
- border-radius: 50%;
- animation: spin .9s linear infinite;
- }
- @keyframes spin { to { transform: rotate(360deg); } }
- .page-content { padding: 12px 14px 18px; }
- .error-box {
- margin: 12px 14px;
- padding: 11px 12px;
- color: var(--danger);
- background: #fff0f0;
- border: 1px solid #ffd0d0;
- border-radius: 6px;
- font-size: 14px;
- }
- .form-table, .section-card {
- overflow: hidden;
- margin-bottom: 12px;
- background: #fff;
- border: 1px solid var(--line);
- border-radius: 6px;
- }
- .form-row {
- display: grid;
- grid-template-columns: 96px minmax(0, 1fr);
- min-height: 52px;
- border-bottom: 1px solid var(--line);
- }
- .form-row:last-child { border-bottom: 0; }
- .form-label {
- display: flex;
- align-items: center;
- justify-content: flex-end;
- padding: 10px 12px;
- color: var(--muted);
- background: #fbfbfc;
- border-right: 1px solid var(--line);
- font-size: 14px;
- }
- .form-value {
- display: flex;
- min-width: 0;
- align-items: center;
- padding: 10px 12px;
- font-size: 14px;
- line-height: 1.45;
- word-break: break-all;
- }
- .section-head {
- display: flex;
- min-height: 46px;
- align-items: center;
- justify-content: space-between;
- padding: 0 13px;
- color: #3c4a61;
- background: #fbfbfc;
- border-bottom: 1px solid var(--line);
- font-size: 15px;
- font-weight: 600;
- }
- .section-count { color: var(--muted); font-size: 13px; font-weight: 400; }
- .class-row { border-bottom: 1px solid var(--line); }
- .class-row:last-child { border-bottom: 0; }
- .class-title {
- display: flex;
- min-height: 48px;
- align-items: center;
- justify-content: space-between;
- gap: 10px;
- padding: 10px 13px;
- font-size: 15px;
- font-weight: 600;
- }
- .result-no { color: var(--green); font-size: 13px; font-weight: 400; }
- .result-yes { color: var(--danger); font-size: 13px; font-weight: 400; }
- .violation-list { padding: 0 13px 10px; }
- .violation-item {
- padding: 10px 12px;
- background: #f8f9fa;
- border: 1px solid #eceef1;
- border-radius: 5px;
- }
- .violation-item + .violation-item { margin-top: 8px; }
- .violation-name { font-size: 14px; line-height: 1.45; }
- .violation-meta {
- margin-top: 5px;
- color: var(--muted);
- font-size: 13px;
- line-height: 1.5;
- }
- .violation-score { color: var(--danger); }
- .empty-violation { padding: 0 13px 12px; color: var(--muted); font-size: 13px; }
- .empty-state { padding: 50px 20px; color: #999; text-align: center; }
- </style>
- </head>
- <body>
- <div id="app" v-cloak>
- <div v-if="loading" class="loading-container">
- <div class="loading-spinner"></div><span>加载中...</span>
- </div>
- <div v-else-if="errorMsg" class="error-box">{{ errorMsg }}</div>
- <template v-else-if="record">
- <div class="page-content">
- <div class="form-table">
- <div class="form-row"><div class="form-label">检查时间</div><div class="form-value">{{ record.jcsj }}</div></div>
- <div class="form-row"><div class="form-label">检查类型</div><div class="form-value">{{ record.fjlxmc }}</div></div>
- <div class="form-row"><div class="form-label">责任部门</div><div class="form-value">{{ record.bmmc }}</div></div>
- <div class="form-row"><div class="form-label">检查人员</div><div class="form-value">{{ record.jcryxm }}</div></div>
- <div class="form-row"><div class="form-label">状态</div><div class="form-value">{{ record.statusName }}</div></div>
- <div class="form-row"><div class="form-label">检查班级</div><div class="form-value">{{ record.classCount }} 个</div></div>
- <div class="form-row"><div class="form-label">违纪人数</div><div class="form-value">{{ record.violationCount }} 人</div></div>
- <div class="form-row"><div class="form-label">扣分合计</div><div class="form-value">{{ formatScore(record.jfkf) }}</div></div>
- <div class="form-row"><div class="form-label">检查说明</div><div class="form-value">{{ record.ms || '' }}</div></div>
- </div>
- <div class="section-card">
- <div class="section-head">
- <span>班级检查结果</span>
- <span class="section-count">{{ classList.length }} 个班级</span>
- </div>
- <div v-if="!classList.length" class="empty-state">暂无班级检查结果</div>
- <div v-for="item in classList" :key="item.xjb_fjjcmxid" class="class-row">
- <div class="class-title">
- <span>{{ item.bjmc }}</span>
- <span :class="item.wjrs > 0 ? 'result-yes' : 'result-no'">{{ item.jcjgmc }}</span>
- </div>
- <div v-if="item.violations && item.violations.length" class="violation-list">
- <div v-for="row in item.violations" :key="row.wjjlid" class="violation-item">
- <div class="violation-name">
- {{ row.wjlbmc }}<span v-if="row.xm"> · {{ row.xm }}</span>
- </div>
- <div class="violation-meta">
- <span>{{ row.wjsj }}</span>
- <span v-if="Number(row.bjfk) > 0" class="violation-score"> 扣 {{ formatScore(row.bjfk) }} 分</span>
- </div>
- <div v-if="row.ms" class="violation-meta">{{ row.ms }}</div>
- </div>
- </div>
- <div v-else class="empty-violation">已检查,无违纪</div>
- </div>
- </div>
- </div>
- </template>
- </div>
- <script>
- const PLAY_SERV = "fjjc_mpPlay";
- window.SS.ready(function () {
- window.SS.dom.initializeFormApp({
- el: "#app",
- data() {
- return {
- loading: true,
- errorMsg: "",
- record: null,
- classList: []
- };
- },
- async mounted() {
- if (!(await this.ensureSession()))
- return;
- await this.loadDetail();
- },
- methods: {
- getRequest() {
- return window.request || (typeof request !== "undefined" ? request : null);
- },
- getRecordId() {
- try {
- return new URLSearchParams(window.location.search).get("xjb_fjjcid") || "";
- } catch (_) {
- return "";
- }
- },
- async ensureSession() {
- if (typeof window.ensureMiniProgramSessionFresh !== "function")
- return true;
- try {
- await window.ensureMiniProgramSessionFresh({
- page: "mp_fjjc_detail",
- service: PLAY_SERV,
- force: true
- });
- return true;
- } catch (error) {
- this.errorMsg = error && error.message
- ? error.message
- : "登录状态刷新失败,请返回小程序重新进入";
- this.loading = false;
- return false;
- }
- },
- async postService(url, data) {
- const req = this.getRequest();
- if (!req || typeof req.post !== "function")
- throw new Error("请求组件未加载");
- const response = await req.post(url, data, {loading: false, formData: true});
- const raw = response && response.data !== undefined ? response.data : response;
- if (raw && raw.ssCode !== undefined && Number(raw.ssCode) !== 0)
- throw new Error(raw.ssMsg || "请求失败");
- return raw && raw.ssData !== undefined ? raw.ssData : raw;
- },
- async loadDetail() {
- const id = this.getRecordId();
- if (!id) {
- this.errorMsg = "风纪检查记录编号为空";
- this.loading = false;
- return;
- }
- try {
- const data = await this.postService(
- `/service?ssServ=${PLAY_SERV}&ssDest=data`,
- {xjb_fjjcid: id}
- ) || {};
- this.record = data.record || null;
- this.classList = Array.isArray(data.classList) ? data.classList : [];
- if (!this.record)
- this.errorMsg = "风纪检查记录不存在或已不可查看";
- } catch (error) {
- this.errorMsg = error && error.message
- ? error.message
- : "风纪检查详情加载失败";
- } finally {
- this.loading = false;
- }
- },
- formatScore(value) {
- const number = Number(value);
- if (!Number.isFinite(number))
- return "0";
- return String(Math.round(number * 100) / 100);
- }
- }
- });
- });
- </script>
- </body>
- </html>
|