| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409 |
- <!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=20261119-fjyrjc"></script>
- <style>
- [v-cloak] { display: none !important; }
- :root {
- --line: #e5e7eb;
- --text: #222;
- --muted: #8b95a5;
- --green: #19a463;
- --danger: #e5484d;
- --danger-soft: #fff0f0;
- }
- * { 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: 38px;
- height: 38px;
- 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); } }
- .error-box,
- .submit-hint {
- margin: 12px 14px 0;
- padding: 12px;
- border-radius: 6px;
- line-height: 1.55;
- font-size: 14px;
- }
- .error-box,
- .submit-hint {
- color: var(--danger);
- background: var(--danger-soft);
- border: 1px solid #ffd0d0;
- }
- .page-content { padding: 12px 14px 16px; }
- .form-table {
- overflow: hidden;
- background: #fff;
- border: 1px solid var(--line);
- border-radius: 6px;
- }
- .form-row {
- display: grid;
- grid-template-columns: 92px minmax(0, 1fr);
- min-height: 58px;
- 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: 12px;
- color: var(--muted);
- background: #fbfbfc;
- border-right: 1px solid var(--line);
- font-size: 15px;
- }
- .form-value {
- display: flex;
- align-items: center;
- min-width: 0;
- padding: 10px 12px;
- font-size: 15px;
- }
- .select-cell,
- .select-cell > .ss-select-container { width: 100%; min-width: 0; }
- .native-textarea {
- width: 100%;
- min-height: 100px;
- padding: 10px 0;
- color: var(--text);
- background: #fff;
- border: 0;
- outline: none;
- resize: vertical;
- font: inherit;
- font-size: 15px;
- }
- .native-textarea::placeholder { color: #b4bbc6; }
- .description-row .form-value { padding: 0; align-items: stretch; }
- .description-cell {
- position: relative;
- width: 100%;
- min-height: 110px;
- }
- .description-cell .native-textarea {
- min-height: 110px;
- padding: 12px 76px 12px 12px;
- }
- .pms-attachment-button {
- position: absolute;
- top: 0;
- right: 0;
- bottom: 0;
- width: 64px;
- display: flex;
- align-items: center;
- justify-content: center;
- flex-direction: column;
- gap: 5px;
- padding: 0;
- color: #666;
- background: #f0f0f0;
- border: 0;
- border-left: 1px solid #ddd;
- border-radius: 0;
- font: inherit;
- font-size: 13px;
- cursor: pointer;
- z-index: 1;
- }
- .pms-attachment-button:disabled { color: #aaa; background: #f5f5f5; }
- .pms-attachment-button .common-icon { font-size: 18px; }
- .attachment-modal {
- position: fixed;
- z-index: 9999;
- inset: 0;
- display: flex;
- flex-direction: column;
- background: #fff;
- }
- .attachment-modal-head {
- display: flex;
- height: 48px;
- align-items: center;
- justify-content: space-between;
- padding: 0 14px;
- border-bottom: 1px solid var(--line);
- font-size: 16px;
- font-weight: 700;
- }
- .attachment-close {
- padding: 8px 4px 8px 14px;
- color: var(--green);
- background: transparent;
- border: 0;
- font: inherit;
- font-size: 15px;
- }
- .attachment-frame { flex: 1; width: 100%; border: 0; }
- </style>
- </head>
- <body>
- <div id="app" v-cloak>
- <div v-if="loading" class="loading-container">
- <div class="loading-spinner"></div><span>加载中...</span>
- </div>
- <template v-else>
- <div v-if="errorMsg" class="error-box">{{ errorMsg }}</div>
- <div v-if="submitHint" class="submit-hint">{{ submitHint }}</div>
- <div class="page-content">
- <div class="form-table">
- <div class="form-row">
- <div class="form-label">违纪时间</div>
- <div class="form-value">
- <div class="select-cell">
- <ss-datetime-picker
- v-model="form.wjsj"
- mode="datetime"
- min-date="2020-01-01"
- max-date="2035-12-31"
- placeholder="请选择违纪时间"
- />
- </div>
- </div>
- </div>
- <div class="form-row">
- <div class="form-label">班级</div>
- <div class="form-value">
- <div class="select-cell">
- <ss-select
- v-model="form.bjid"
- cb="bj"
- placeholder=""
- empty-option
- searchable
- clearable
- @change="onClassChange"
- />
- </div>
- </div>
- </div>
- <div class="form-row">
- <div class="form-label">学员</div>
- <div class="form-value">
- <div class="select-cell">
- <ss-select
- :key="'student-' + form.bjid"
- v-model="form.fzryid"
- :cb="form.bjid ? 'xyByBj' : ''"
- :filter="{bjid: form.bjid}"
- :disabled="!form.bjid"
- placeholder=""
- empty-option
- searchable
- clearable
- />
- </div>
- </div>
- </div>
- <div class="form-row">
- <div class="form-label">违纪类别</div>
- <div class="form-value">
- <div class="select-cell">
- <ss-select
- v-model="form.wjlbm"
- cb="fjyrwjlb"
- placeholder=""
- empty-option
- searchable
- clearable
- />
- </div>
- </div>
- </div>
- <div class="form-row description-row">
- <div class="form-label">描述</div>
- <div class="form-value">
- <div class="description-cell">
- <textarea
- v-model="form.ms"
- class="native-textarea"
- maxlength="500"
- placeholder=""
- ></textarea>
- <button class="pms-attachment-button" type="button"
- :disabled="attachmentLoading"
- :aria-label="form.fjid ? '管理附件' : '添加附件'"
- @click="openAttachment">
- <ss-common-icon class="common-icon-paper-clip"></ss-common-icon>
- <span>{{ attachmentLoading ? '处理中' : '附件' }}</span>
- </button>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div v-if="attachmentVisible" class="attachment-modal">
- <div class="attachment-modal-head">
- <span>附件管理</span>
- <button class="attachment-close" type="button" @click="closeAttachment">关闭</button>
- </div>
- <iframe class="attachment-frame" :src="attachmentUrl"></iframe>
- </div>
- </template>
- </div>
- <script>
- window.SS.ready(function () {
- window.SS.dom.initializeFormApp({
- el: "#app",
- data() {
- const params = new URLSearchParams(window.location.search);
- return {
- loading: false,
- errorMsg: "",
- submitHint: "",
- attachmentVisible: false,
- attachmentLoading: false,
- attachmentUrl: "",
- form: {
- wjxzm: 1,
- wjsj: params.get("wjsj") || "",
- bjid: params.get("bjid") || "",
- fzryid: params.get("fzryid") || "",
- wjlbm: params.get("wjlbm") || "",
- ms: params.get("ms") || "",
- fjid: params.get("fjid") || ""
- }
- };
- },
- async mounted() {
- if (!this.form.wjsj)
- this.form.wjsj = this.formatNow();
- window.__mpObjInpGetFormData = () => {
- const form = this.form;
- let message = "";
- if (!form.wjsj) message = "请选择违纪时间";
- else if (!form.bjid) message = "请选择班级";
- else if (!form.fzryid) message = "请选择学员";
- else if (!form.wjlbm) message = "请选择违纪类别";
- return {
- valid: !message,
- message,
- data: {
- wjxzm: 1,
- wjsj: form.wjsj,
- bjid: form.bjid,
- fzryid: form.fzryid,
- wjlbm: form.wjlbm,
- ms: String(form.ms || "").trim(),
- fjid: form.fjid
- }
- };
- };
- this.loading = true;
- try {
- if (typeof window.ensureMiniProgramSessionFresh === "function") {
- await window.ensureMiniProgramSessionFresh({
- page: "mp_fjyrjc_inp",
- service: "fjyrjc_lr_zj",
- force: true
- });
- }
- } catch (error) {
- this.errorMsg = error && error.message
- ? error.message
- : "登录状态刷新失败";
- } finally {
- this.loading = false;
- }
- },
- beforeUnmount() {
- try {
- delete window.__mpObjInpGetFormData;
- } catch (_) {}
- },
- methods: {
- getRequest() {
- return window.request || (typeof request !== "undefined" ? request : null);
- },
- onClassChange() {
- this.form.fzryid = "";
- },
- async openAttachment() {
- if (this.attachmentLoading) return;
- this.attachmentLoading = true;
- try {
- if (!this.form.fjid) {
- const req = this.getRequest();
- if (!req || typeof req.post !== "function") throw new Error("请求组件未加载");
- const response = await req.post(
- "/service?ssServ=makeAttCms&wdConfirmationCaptchaService=0",
- {name: "fjid", ssNrObjName: "fjyrjc", ssNrObjId: ""},
- {loading: false, formData: true}
- );
- const raw = response && response.data !== undefined ? response.data : response;
- const candidate = raw && typeof raw === "object"
- ? (raw.data ?? raw.ssData ?? raw.result)
- : raw;
- const fjid = String(candidate == null ? "" : candidate).trim();
- if (!/^\d+$/.test(fjid)) throw new Error("附件初始化失败");
- this.form.fjid = fjid;
- }
- const query = "&nrid=T-" + encodeURIComponent(this.form.fjid)
- + "&objectId=" + encodeURIComponent(this.form.fjid)
- + "&objectName=fjid&mode=edit&callback=";
- this.attachmentUrl =
- "/service?ssServ=regCms&ssDest=cmsEdit&wdConfirmationCaptchaService=0" + query;
- this.attachmentVisible = true;
- } catch (error) {
- this.showToast(error.message || "附件初始化失败", "fail");
- } finally {
- this.attachmentLoading = false;
- }
- },
- closeAttachment() {
- this.attachmentVisible = false;
- },
- formatNow() {
- const d = new Date();
- const pad = v => String(v).padStart(2, "0");
- return d.getFullYear() + "-" + pad(d.getMonth() + 1) + "-"
- + pad(d.getDate()) + " " + pad(d.getHours()) + ":"
- + pad(d.getMinutes()) + ":" + pad(d.getSeconds());
- },
- showToast(message, type) {
- const toastType = type === "success" ? "success" : "error";
- if (window.wx && window.wx.miniProgram && window.wx.miniProgram.showToast) {
- window.wx.miniProgram.showToast({title: message, icon: toastType});
- } else if (window.SS && window.SS.dom && window.SS.dom.showToast) {
- window.SS.dom.showToast({message, type: toastType});
- }
- }
- }
- });
- });
- </script>
- </body>
- </html>
|