From d033c98f64bdd125fa37ec198b6981fc100d9d5d Mon Sep 17 00:00:00 2001
From: zmj <1493694146@qq.com>
Date: Fri, 24 May 2024 18:00:17 +0800
Subject: [PATCH] add
---
src/views/oa_work/components/reciveReport.vue | 2 +-
src/views/oa_work/edit.vue | 21 ++++++++++++++++++-
2 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/src/views/oa_work/components/reciveReport.vue b/src/views/oa_work/components/reciveReport.vue
index d9f9ab9..6099053 100644
--- a/src/views/oa_work/components/reciveReport.vue
+++ b/src/views/oa_work/components/reciveReport.vue
@@ -25,7 +25,7 @@
-
+
diff --git a/src/views/oa_work/edit.vue b/src/views/oa_work/edit.vue
index cfafe09..e80ce1b 100644
--- a/src/views/oa_work/edit.vue
+++ b/src/views/oa_work/edit.vue
@@ -40,6 +40,11 @@ import Popup from "@/components/popup/index.vue";
import { apiOaWorkAdd, apiOaWorkEdit, apiOaWorkDetail } from "@/api/oa_work";
import { timeFormat } from "@/utils/util";
import type { PropType } from "vue";
+import useUserStore from "@/stores/modules/user";
+
+
+
+
defineProps({
dictData: {
type: Object as PropType>,
@@ -52,6 +57,7 @@ const popupRef = shallowRef>();
const mode = ref("add");
const showDialog = ref(false)
const personnel = ref(null)
+const userStore = useUserStore().userInfo;
// 弹窗标题
const popupTitle = computed(() => {
@@ -92,6 +98,16 @@ const submituser = (e: any) => {
showDialog.value = false
}
+const checkUser = (rule: any, value: any, callback: any) => {
+ if (formData.type_user.split(',').map(Number).includes(userStore.id)) {
+ callback(new Error("接收人员不能包含自己"))
+ }
+ else {
+ callback()
+ }
+}
+
+
// 表单验证
const formRules = reactive({
type: [
@@ -106,7 +122,10 @@ const formRules = reactive({
required: true,
message: "请选择接受人员",
trigger: ["cahnge"],
- },
+ }, {
+ validator: checkUser,
+ trigger: ["cahnge"],
+ }
],
works: [
{