13937891274
2022-08-08 16cda76553fec9722447ea4282feb6cc5df3ede6
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);