From 1bda9babdf0316852ee5972690742f63c79595d6 Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期三, 21 一月 2026 16:54:41 +0800
Subject: [PATCH] 用印管理以及知识库部分逻辑修改
---
src/pages/managementMeetings/sealManagement/detail.vue | 330 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 330 insertions(+), 0 deletions(-)
diff --git a/src/pages/managementMeetings/sealManagement/detail.vue b/src/pages/managementMeetings/sealManagement/detail.vue
new file mode 100644
index 0000000..2dd2b55
--- /dev/null
+++ b/src/pages/managementMeetings/sealManagement/detail.vue
@@ -0,0 +1,330 @@
+<template>
+ <view class="client-visit-detail">
+ <PageHeader :title="detailType === 1 ? '鏂板鐭ヨ瘑搴�' : '鐭ヨ瘑搴撹鎯�'"
+ @back="goBack" />
+ <u-form ref="formRef"
+ label-width="90">
+ <!-- 瀹㈡埛淇℃伅 -->
+ <!-- <u-cell-group title="鐭ヨ瘑淇℃伅"> -->
+ <u-form-item label="鐢宠缂栧彿"
+ prop="applicationNum"
+ required
+ border-bottom>
+ <u-input v-model="form.applicationNum"
+ :readonly="readonly"
+ placeholder="璇疯緭鍏ョ敵璇风紪鍙�" />
+ </u-form-item>
+ <u-form-item label="鐢宠鏍囬"
+ prop="title"
+ required
+ border-bottom>
+ <u-input v-model="form.title"
+ :readonly="readonly"
+ placeholder="璇疯緭鍏ョ敵璇锋爣棰�" />
+ </u-form-item>
+ <u-form-item label="鐢ㄥ嵃绫诲瀷"
+ prop="sealType"
+ required
+ border-bottom>
+ <u-input v-model="equipmentname"
+ readonly
+ placeholder="璇烽�夋嫨鐢ㄥ嵃绫诲瀷"
+ @click="showEquipmentSheet = true" />
+ <template v-if="!readonly"
+ #right>
+ <up-icon name="arrow-right"
+ @click="openEquipmentSheet"></up-icon>
+ </template>
+ </u-form-item>
+ <u-form-item label="鐢宠鍘熷洜"
+ prop="reason"
+ border-bottom>
+ <u-textarea v-model="form.reason"
+ type="textarea"
+ rows="4"
+ :disabled="readonly"
+ placeholder="璇疯緭鍏ョ敵璇峰師鍥�" />
+ </u-form-item>
+ <u-form-item label="瀹℃壒浜�"
+ prop="sealType"
+ required
+ border-bottom>
+ <u-input v-model="statusname"
+ readonly
+ placeholder="璇烽�夋嫨瀹℃壒浜�"
+ @click="showStatusSheet = true" />
+ <template v-if="!readonly"
+ #right>
+ <up-icon name="arrow-right"
+ @click="showStatusSheet = true"></up-icon>
+ </template>
+ </u-form-item>
+ <u-form-item label="绱ф�ョ▼搴�"
+ prop="urgency"
+ required
+ border-bottom>
+ <u-radio-group v-model="form.urgency"
+ :disabled="readonly">
+ <u-radio name="normal"
+ label="鏅��"
+ size="16" />
+ <u-radio name="urgent"
+ label="绱ф��"
+ size="16" />
+ <u-radio name="very-urgent"
+ label="鐗规��"
+ size="16" />
+ </u-radio-group>
+ </u-form-item>
+ <!-- </u-cell-group> -->
+ <!-- 鎻愪氦鎸夐挳 -->
+ <view v-if="!readonly"
+ 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-action-sheet :show="showEquipmentSheet"
+ :actions="equipmentOptions"
+ @select="handleEquipmentChange"
+ @close="showEquipmentSheet = false" />
+ <!-- 鐘舵�侀�夋嫨鍣� -->
+ <up-action-sheet :show="showStatusSheet"
+ :actions="userList"
+ @select="onStatusSelect"
+ @close="showStatusSheet = false" />
+ </view>
+</template>
+
+<script setup>
+ // 鏇挎崲 toast 鏂规硶
+ defineOptions({ name: "meeting-settings-detail" });
+ const showToast = message => {
+ uni.showToast({
+ title: message,
+ icon: "none",
+ });
+ };
+
+ import { ref, onMounted, computed } from "vue";
+ import PageHeader from "@/components/PageHeader.vue";
+ import useUserStore from "@/store/modules/user";
+ import { useDict } from "@/utils/dict";
+ import { onLoad } from "@dcloudio/uni-app";
+ import { userListNoPageByTenantId } from "@/api/system/user";
+
+ import { addSealApplication } from "@/api/managementMeetings/sealManagement";
+
+ const userStore = useUserStore();
+
+ // 琛ㄥ崟鏁版嵁
+ const form = ref({
+ applicationNum: "",
+ title: "",
+ sealType: "",
+ reason: "",
+ approveUserId: "",
+ urgency: "normal",
+ status: "pending",
+ });
+ const { knowledge_type } = useDict("knowledge_type");
+ const knowledgeTypeOptions = computed(() => knowledge_type?.value || []);
+ const equipmentOptions = ref([
+ { value: "official", name: "鍏珷" },
+ { value: "contract", name: "鍚堝悓涓撶敤绔�" },
+ { value: "finance", name: "璐㈠姟涓撶敤绔�" },
+ { value: "legal", name: "娉曚汉绔�" },
+ ]);
+ const statusOptions = ref([
+ { value: "high", name: "鏄捐憲鎻愬崌" },
+ { value: "medium", name: "涓�鑸彁鍗�" },
+ { value: "low", name: "杞诲井鎻愬崌" },
+ ]);
+ //// 椤甸潰鐘舵��
+ const loading = ref(false);
+ const formRef = ref(null);
+ const showEquipmentSheet = ref(false);
+ const showStatusSheet = ref(false);
+ const openEquipmentSheet = () => {
+ showEquipmentSheet.value = true;
+ };
+ // 杩斿洖涓婁竴椤�
+ const goBack = () => {
+ uni.navigateBack();
+ };
+ const statusname = ref("");
+ // 鐘舵�侀�夋嫨
+ const onStatusSelect = action => {
+ form.value.approveUserId = action.value;
+ statusname.value = action.name;
+ showStatusSheet.value = false;
+ };
+ const equipmentname = ref("");
+ // 璁惧閰嶇疆閫夋嫨
+ const handleEquipmentChange = val => {
+ form.value.sealType = val.value;
+ equipmentname.value = val.name;
+ showEquipmentSheet.value = false;
+ };
+ // 鎻愪氦琛ㄥ崟
+ const handleSubmit = async () => {
+ if (!form.value.applicationNum) {
+ showToast("璇疯緭鍏ョ敵璇风紪鍙�");
+ return;
+ }
+
+ if (!form.value.title) {
+ showToast("璇疯緭鍏ユ爣棰�");
+ return;
+ }
+
+ if (!form.value.sealType) {
+ showToast("璇烽�夋嫨鐢ㄥ嵃绫诲瀷");
+ return;
+ }
+ if (!form.value.reason) {
+ showToast("璇疯緭鍏ョ敵璇风悊鐢�");
+ return;
+ }
+ if (!statusname.value) {
+ showToast("璇烽�夋嫨瀹℃壒浜�");
+ return;
+ }
+ try {
+ loading.value = true;
+ addSealApplication(form.value).then(res => {
+ if (res.code !== 200) {
+ showToast("淇濆瓨澶辫触锛岃閲嶈瘯");
+ return;
+ }
+ loading.value = false;
+ showToast("淇濆瓨鎴愬姛");
+ setTimeout(() => {
+ goBack();
+ }, 500);
+ });
+ } catch (e) {
+ loading.value = false;
+ console.error("淇濆瓨澶辫触:", e);
+ showToast("淇濆瓨澶辫触锛岃閲嶈瘯");
+ }
+ };
+
+ // 鍒濆鍖栭〉闈㈡暟鎹�
+ const readonly = ref(false);
+ const detailType = ref(1);
+ const knowledgeId = ref("");
+ const userList = ref([]);
+ onLoad(options => {
+ detailType.value = Number(options.detailType);
+ knowledgeId.value = options.id || "";
+
+ // 鏌ョ湅妯″紡璁剧疆鍙
+ if (detailType.value === 3) {
+ readonly.value = true;
+ }
+ userListNoPageByTenantId().then(res => {
+ userList.value = res.data.map(item => ({
+ value: item.userId,
+ name: item.nickName,
+ }));
+ });
+ });
+
+ onMounted(() => {
+ // 浠庢湰鍦板瓨鍌ㄤ腑鑾峰彇鐭ヨ瘑鏁版嵁
+ const knowledgeBase = uni.getStorageSync("knowledgeBase");
+ if (knowledgeBase) {
+ form.value = JSON.parse(JSON.stringify(knowledgeBase));
+ }
+
+ if (detailType.value === 1) {
+ form.value = {
+ applicationNum: "",
+ title: "",
+ sealType: "",
+ reason: "",
+ approveUserId: "",
+ urgency: "normal",
+ status: "pending",
+ };
+ statusname.value = "";
+ equipmentname.value = "";
+ }
+ console.log(form.value, "userList.value");
+
+ if (detailType.value != 1) {
+ equipmentname.value =
+ equipmentOptions.value.find(item => item.value === form.value.sealType)
+ ?.name || "";
+ statusname.value = form.value.approveUserName || "";
+ }
+ });
+</script>
+
+<style scoped lang="scss">
+ @import "@/static/scss/form-common.scss";
+ .client-visit {
+ min-height: 100vh;
+ background: #f8f9fa;
+ padding-bottom: 5rem;
+ }
+
+ .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;
+ }
+
+ .location-icon {
+ color: #1989fa;
+ font-size: 1.2rem;
+ }
+
+ /* 绱ф�ョ▼搴﹀崟閫夋鏍峰紡 */
+ :deep(.u-radio-group) {
+ display: flex;
+ align-items: center;
+ gap: 40rpx;
+ }
+
+ :deep(.u-radio) {
+ display: flex;
+ align-items: center;
+ }
+</style>
\ No newline at end of file
--
Gitblit v1.9.3