From 16cda76553fec9722447ea4282feb6cc5df3ede6 Mon Sep 17 00:00:00 2001
From: 13937891274 <kxc0822>
Date: 星期一, 08 八月 2022 11:37:09 +0800
Subject: [PATCH] 应急预案管理数据对接
---
src/components/checkTemplate/index.vue | 27 ++++++--
src/views/contingencyManagement/panManagement/component/openAdd.vue | 54 ++++++++++++++---
src/views/contingencyManagement/contingency/component/addEmergencyPersonnel.vue | 77 +------------------------
3 files changed, 68 insertions(+), 90 deletions(-)
diff --git a/src/components/checkTemplate/index.vue b/src/components/checkTemplate/index.vue
index 15734ac..2fe655e 100644
--- a/src/components/checkTemplate/index.vue
+++ b/src/components/checkTemplate/index.vue
@@ -26,10 +26,10 @@
:data="tableData"
ref="multipleTableRef"
style="width: 100%;margin-top:20px"
- @cell-click="radio"
+ @selection-change="handleSelectionChange"
>
- <el-table-column width="55">
- <template #default="scope">
+ <el-table-column type="selection" width="55" v-if="types==0">
+ <template #default="scope" v-if="types!=0">
<el-radio-group v-model="radio1">
<el-radio :label="scope.row.id" @click="radio(scope.row)" size="large">{{ null }}</el-radio>
</el-radio-group>
@@ -92,10 +92,12 @@
export default defineComponent({
setup(props, { emit }) {
+ const types=ref()
const dialogVisible = ref<boolean>(false);
- const openDailog = () => {
+ const openDailog = (type:any) => {
+ types.value=type
dialogVisible.value = true;
- onSubmit();
+ // onSubmit();
};
// 搜索条件
const listQuery = reactive({
@@ -123,10 +125,17 @@
}
}
const submitForm = () => {
- let obj = JSON.parse(JSON.stringify(dynamicTags.value));
- emit('SearchUser', obj[0]);
+ if(types.value==0){
+ emit('SearchUser',dynamicTags.value,types.value);
+ }
+ else {
+ emit('SearchUser',dynamicTags.value[0],types.value);
+ }
dialogVisible.value = false;
};
+ const handleSelectionChange = (val:any) => {
+ dynamicTags.value=val
+ }
// 重置
const submitReset = () => {
listQuery.searchParams.teamName = '';
@@ -157,6 +166,7 @@
};
const radio1 = ref('');
const radio = (event: any) => {
+ console.log(event)
dynamicTags.value[0] = event;
};
onMounted(() => {
@@ -192,7 +202,8 @@
radio,
radio1,
submitForm,
-
+ types,
+ handleSelectionChange,
};
},
});
diff --git a/src/views/contingencyManagement/contingency/component/addEmergencyPersonnel.vue b/src/views/contingencyManagement/contingency/component/addEmergencyPersonnel.vue
index 43bde1d..11c76db 100644
--- a/src/views/contingencyManagement/contingency/component/addEmergencyPersonnel.vue
+++ b/src/views/contingencyManagement/contingency/component/addEmergencyPersonnel.vue
@@ -154,78 +154,6 @@
emit('myAdd', ruleForm.value);
formEl.resetFields();
}
- // const submitForm = async (title: string, formEl: FormInstance | undefined) => {
- // if (title == '新建应急队伍人员') {
- // if (!formEl) return;
- // await formEl.validate((valid, fields) => {
- // if (valid) {
- // isShowDialog.value = false;
- // contingencyApi()
- // .addEmergencyTeamPersonnel(ruleForm.value)
- // .then((res) => {
- // if (res.data.code == 200) {
- // ElMessage({
- // showClose: true,
- // message: res.data.msg,
- // type: 'success',
- // });
- // emit('myAdd', true);
- // } else {
- // ElMessage({
- // showClose: true,
- // message: res.data.msg,
- // type: 'error',
- // });
- // emit('myAdd', true);
- // }
- // formEl.resetFields();
- // });
- // } else {
- // console.log('error submit!', fields);
- // }
- // });
- // }
- // else if (title == '修改应急队伍人员') {
- // if (!formEl) return;
- // await formEl.validate((valid, fields) => {
- // if (valid) {
- // isShowDialog.value = false;
- // contingencyApi()
- // .editEmergencyTeam(ruleForm.value)
- // .then((res) => {
- // if (res.data.code == 200) {
- // ElMessage({
- // showClose: true,
- // message: '修改成功',
- // type: 'success',
- // });
- // emit('myAdd', true);
- // } else {
- // ElMessage({
- // showClose: true,
- // message: res.data.msg,
- // type: 'error',
- // });
- // emit('myAdd', true);
- // }
- // formEl.resetFields();
- // });
- // } else {
- // console.log('error submit!', fields);
- // }
- // });
- // formEl.resetFields();
- // ruleForm.value = {
- // teamId: '',
- // userUid: 1,
- // gender: '',
- // jobNumber: '', // 人员工号
- // name: '', // 人员名称
- // phone: '', // 手机号码
- // position: '', // 职位
- // };
- // }
- // }
const submitForm = async (title: string, formEl: FormInstance | undefined) => {
if (title == '新建应急队伍人员') {
if (!formEl) return;
@@ -332,6 +260,11 @@
const onUser = (e:any) => {
ruleForm.value.userUid=e[0].uid
ruleForm.value.userName=e[0].realName
+ ruleForm.value.gender=e[0].sex
+ ruleForm.value.name=e[0].username
+ ruleForm.value.jobNumber=e[0].jobNumber
+ ruleForm.value.phone=e[0].phone
+ ruleForm.value.position=e[0].position
};
//全屏
const full = ref(false);
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