From 16cda76553fec9722447ea4282feb6cc5df3ede6 Mon Sep 17 00:00:00 2001
From: 13937891274 <kxc0822>
Date: Mon, 08 Aug 2022 11:37:09 +0800
Subject: [PATCH] 应急预案管理数据对接
---
src/views/contingencyManagement/panManagement/component/openAdd.vue | 54 ++++++++++++++++++++++++++++++++++++++++++++----------
1 files changed, 44 insertions(+), 10 deletions(-)
diff --git a/src/views/contingencyManagement/panManagement/component/openAdd.vue b/src/views/contingencyManagement/panManagement/component/openAdd.vue
index 7e85af7..0bda4be 100644
--- a/src/views/contingencyManagement/panManagement/component/openAdd.vue
+++ b/src/views/contingencyManagement/panManagement/component/openAdd.vue
@@ -87,9 +87,9 @@
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="应急队伍" prop="emergencyTeam">
- <el-input v-model="ruleForm.teamName" placeholder="请选择" class="input-with-select">
+ <el-input v-model="ruleForm.emergencyTeam" placeholder="请选择" class="input-with-select">
<template #append>
- <el-button :icon="Search" @click="daiInpt" />
+ <el-button :icon="Search" @click="daiInpt(0)" />
</template>
</el-input>
</el-form-item>
@@ -131,7 +131,7 @@
</span>
</template>
</el-dialog>
- <CheckTemplate ref="Shows" @SearchUser="onUsers" />
+ <CheckTemplate ref="Shows" @SearchUser="SearchUser" />
<DailogSearchUserManger ref="userRef" @SearchUser="onUser" />
<RegionsDialog ref="openRef" />
</div>
@@ -209,7 +209,12 @@
.getTreedepartment()
.then((res) => {
if (res.data.code == 200) {
- data.value = res.data.data;
+ ruleForm.value = res.data.data;
+ let arr = [];
+ for (let i = 0; i < ruleForm.value.teamList.length; i++) {
+ arr.push(ruleForm.value.teamList[i].userName);
+ }
+ ruleForm.value.userName = arr.toString();
} else {
ElMessage.error(res.data.msg);
}
@@ -316,16 +321,45 @@
const resetForm = (formEl: FormInstance | undefined) => {
isShowDialog.value = false;
if (!formEl) return;
+ ruleForm.value = {
+ name: '', // 预案名称
+ type: '', //预案类型
+ associatedDanger: '', // 危险源关联
+ level: '', // 预案级别
+ authorUid: '', // 编写人
+ authorName: '',
+ authorDeptId: '', // 编写部门
+ releaseDate: '', // 发布实施日期
+ fileList: [
+ {
+ fileUrl: 'url',
+ fileName: 'name',
+ },
+ ],
+ emergencyTeam: '', //应急队伍
+ areaList: [], //区域列表
+ teamList: [
+ ],
+ deptList: [],
+ abolishStatus: false,
+ };
formEl.resetFields();
};
// 应急队伍弹窗
const Shows = ref();
- const daiInpt = () => {
- Shows.value.openDailog();
+ const daiInpt = (data: any) => {
+ Shows.value.openDailog(data);
};
- const onUsers = (e: any) => {
- ruleForm.value.teamId = e[0].id
- ruleForm.value.teamName = e[0].teamName
+ const SearchUser = (e: any) => {
+ let arr = [];
+ for (let i = 0; i < val.length; i++) {
+ arr.push(val[i].realName);
+ ruleForm.value.userList.push({
+ userUid: val[i].uid,
+ userName: val[i].realName,
+ });
+ }
+ ruleForm.value.userName = arr.toString();
};
// 选择区域弹窗
const openRef = ref();
@@ -364,7 +398,7 @@
department,
daiInpt,
Shows,
- onUsers,
+ SearchUser,
submitForm,
openUser,
userRef,
--
Gitblit v1.9.2