Browse Source

问题办理过程,问题涉及人员及领导不能为同一人

master
buaixuexideshitongxue 3 weeks ago
parent
commit
e0732b29bc
  1. 95
      src/components/negative/verify.vue

95
src/components/negative/verify.vue

@ -1551,6 +1551,37 @@
<file-list v-model:files="form.files" :removeEnable="true" />
</el-form-item>
</el-form>
<!-- <el-dialog-->
<!-- v-model="showSamePersonDialog"-->
<!-- title="提示"-->
<!-- width="420px"-->
<!-- align-center-->
<!-- :close-on-click-modal="false"-->
<!-- >-->
<!-- <div class="same-person-dialog">-->
<!-- <div class="icon-wrap">-->
<!-- <el-icon size="48">-->
<!-- <Warning />-->
<!-- </el-icon>-->
<!-- </div>-->
<!-- <div class="content">-->
<!-- <p class="title">人员选择冲突</p>-->
<!-- <p class="desc">-->
<!-- 涉及人员与涉及领导不能为同一人请重新选择-->
<!-- </p>-->
<!-- </div>-->
<!-- </div>-->
<!-- <template #footer>-->
<!-- <el-button type="primary" @click="showSamePersonDialog = false">-->
<!-- 我知道了-->
<!-- </el-button>-->
<!-- </template>-->
<!-- </el-dialog>-->
</template>
<script lang="ts" setup>
import { BASE_PATH } from "@/api/request";
@ -1566,6 +1597,7 @@ import {
} from "@/enums/dictEnums";
import useCatchStore from "@/stores/modules/catch";
import { getConfinementListAll } from "@/api/work/confinement";
import {Warning} from "@element-plus/icons-vue";
//
const catchSotre = useCatchStore();
const dict = catchSotre.getDicts([
@ -1669,7 +1701,7 @@ async function getFormData() {
negative.value.blames.forEach((item) => {
fileConfinement(item.confinementId, "Id");
});
}
if (negative.value.blameLeaders) {
negative.value.blameLeaders.forEach((item) => {
@ -1881,6 +1913,7 @@ function handleResult12337(item) {
const formRef = ref(null);
const showSamePersonDialog = ref(false);
async function validate() {
//
if (form.value.accountabilityTarget === AccountabilityTarget.PERSONAL) {
@ -1903,6 +1936,29 @@ async function validate() {
);
}
}
//
const blameIdCodes = form.value.blames
.filter(item => item.type === BlameType.PERSONAL && item.blameIdCode)
.map(item => item.blameIdCode);
const leaderIdCodes = form.value.blameLeaders
.filter(item => item.leadIdCode)
.map(item => item.leadIdCode);
const duplicates = blameIdCodes.filter(idCode =>
leaderIdCodes.includes(idCode)
);
if (duplicates.length > 0) {
const duplicatePerson = form.value.blames.find(item =>
item.blameIdCode === duplicates[0]
);
if (duplicatePerson) {
// showSamePersonDialog.value = true;
throw new Error(`涉及人员【${duplicatePerson.blameName}】与涉及领导不能为同一人`);
}
}
return form.value;
}
@ -1938,4 +1994,41 @@ p {
margin: 0;
line-height: 1.4;
}
.same-person-dialog {
display: flex;
flex-direction: column;
align-items: center;
padding: 8px 0 12px;
}
.icon-wrap {
display: flex;
align-items: center;
justify-content: center;
width: 72px;
height: 72px;
border-radius: 50%;
background-color: rgba(230, 162, 60, 0.12);
color: #e6a23c;
margin-bottom: 12px;
}
.content {
text-align: center;
}
.content .title {
font-size: 18px;
font-weight: 600;
color: #303133;
margin-bottom: 6px;
}
.content .desc {
font-size: 14px;
color: #606266;
line-height: 1.6;
}
</style>

Loading…
Cancel
Save