| | |
| | | :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> |
| | |
| | | |
| | | 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({ |
| | |
| | | } |
| | | } |
| | | 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 = ''; |
| | |
| | | }; |
| | | const radio1 = ref(''); |
| | | const radio = (event: any) => { |
| | | console.log(event) |
| | | dynamicTags.value[0] = event; |
| | | }; |
| | | onMounted(() => { |
| | |
| | | radio, |
| | | radio1, |
| | | submitForm, |
| | | |
| | | types, |
| | | handleSelectionChange, |
| | | }; |
| | | }, |
| | | }); |
| | |
| | | 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; |
| | |
| | | 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); |
| | |
| | | </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> |
| | |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | <CheckTemplate ref="Shows" @SearchUser="onUsers" /> |
| | | <CheckTemplate ref="Shows" @SearchUser="SearchUser" /> |
| | | <DailogSearchUserManger ref="userRef" @SearchUser="onUser" /> |
| | | <RegionsDialog ref="openRef" /> |
| | | </div> |
| | |
| | | .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); |
| | | } |
| | |
| | | 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(); |
| | |
| | | department, |
| | | daiInpt, |
| | | Shows, |
| | | onUsers, |
| | | SearchUser, |
| | | submitForm, |
| | | openUser, |
| | | userRef, |