| | |
| | | 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); |