| | |
| | | <el-input v-model.trim="userForm.phone" placeholder="手机号" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="是否专家" prop="identityStatus"> |
| | | <el-radio-group v-model="userForm.identityStatus"> |
| | | <el-radio :label="0">是</el-radio> |
| | | <el-radio :label="1">否</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20" v-if="userForm.identityStatus == 0"> |
| | | <el-form-item label="专家类型" prop="identityIds"> |
| | | <el-select v-model="userForm.identityIds" placeholder="专家类型" clearable class="w100" multiple> |
| | | <el-option v-for="item in expData" :key="item.id" :label="item.identity" :value="item.id"> </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="证件类型" prop="idType"> |
| | | <el-select v-model="userForm.idType" placeholder="证件类型" clearable class="w100"> |
| | | <el-option :key="1" label="身份证" :value="1"> </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="证件号码" prop="idSerial"> |
| | | <el-input v-model.trim="userForm.idSerial" placeholder="证件号码" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20" v-if="userForm.identityStatus == 0"> |
| | | <el-form-item label="资质证书" prop=""> |
| | | <el-upload accept="image/*" :action="uploadUrl" :headers="header" method="post" :data="{module: 'accountPath'}" :on-success="handleAvatarSuccess" :on-exceed="showTip" :on-preview="handlePictureCardPreview" :limit='imgLimit' v-model:file-list="fileList" list-type="picture-card" :before-upload="picSize" :on-remove="handleRemove" :before-remove="beforeRemove"> |
| | | <el-icon><Plus /></el-icon> |
| | | <template #tip> |
| | | <div class="el-upload__tip">上传jpg/png图片尺寸小于5M,最多可上传1张</div> |
| | | </template> |
| | | </el-upload> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <template #footer> |
| | |
| | | roleIds: Array<any> |
| | | depId: number | null; |
| | | phone: string; |
| | | identityStatus:number|null; |
| | | identityIds: Array<any> |
| | | pwd: string; |
| | | idType: number | null; |
| | | idSerial: string; |
| | | qualificationAttId: number | null; |
| | | }; |
| | | userFormRules:{}, |
| | | departmentData: Array<DeptData>; |
| | |
| | | roleIds: [], // 关联角色 |
| | | depId: null, // 部门 |
| | | phone: '', // 手机号 |
| | | identityStatus: null, |
| | | identityIds: [], |
| | | idType: 1, |
| | | idSerial: '', |
| | | qualificationAttId: null |
| | | }, |
| | | userFormRules:{ |
| | | name: [{ required: true, message: '请填写用户名', trigger: 'blur' }], |
| | |
| | | roleIds: [{ required: true, message: '请选择用户角色', trigger: 'change' }], |
| | | depId: [{ required: true, message: '请选择部门', trigger: 'change' }], |
| | | phone: [{ required: true, message: '请填写手机号', trigger: 'blur' }], |
| | | identityStatus: [{ required: true, message: '请选择是否为专家', trigger: 'change' }], |
| | | identityIds: [{ required: true, message: '请选择专家类型', trigger: 'change' }], |
| | | idType: [{ required: true, message: '请选择证件类型', trigger: 'blur' }], |
| | | pwd: [{ required: true, message: '请输入账户密码', trigger: 'blur' }], |
| | | }, |
| | | departmentData: [], // 部门数据 |
| | |
| | | roleIds: [], |
| | | depId: null, |
| | | phone: '', |
| | | identityStatus: null, |
| | | identityIds: [], |
| | | idType: 1, |
| | | idSerial: '', |
| | | pwd: '', |
| | | qualificationAttId: null |
| | | }; |
| | | } else { |
| | | state.title = '修改用户'; |
| | | state.isAdd = false |
| | | state.userForm = JSON.parse(JSON.stringify(value)); |
| | | state.userForm.roleIds = JSON.parse(JSON.stringify(value)).roles.map(i=>i.roleId) |
| | | state.userForm.identityIds = JSON.parse(JSON.stringify(value)).userIdentities.map(i=>i.userIdentityId) |
| | | } |
| | | }; |
| | | |
| | |
| | | }); |
| | | return |
| | | } |
| | | if(state.userForm.identityStatus == 1){ |
| | | state.userForm.identityIds = [] |
| | | state.userForm.qualificationAttId = null |
| | | } |
| | | if (state.title === '新增用户') { |
| | | let res = await userApi().addUser(state.userForm); |
| | | if (res.data.code === 100) { |
| | |
| | | }); |
| | | } |
| | | } else { |
| | | const {name, realName, roleIds, depId, phone, idType, idSerial, id, identityStatus, identityIds, qualificationAttId} = state.userForm |
| | | const data = {name, realName, roleIds, depId, phone, idType, idSerial,id, identityStatus, identityIds, qualificationAttId} |
| | | const {name, realName, roleIds, depId, phone, idSerial, id} = state.userForm |
| | | const data = {name, realName, roleIds, depId, phone, idSerial,id} |
| | | let res = await userApi().modUser(data); |
| | | if (res.data.code === 100) { |
| | | ElMessage({ |
| | |
| | | state.userForm.qualificationAttId = res.data.id |
| | | } |
| | | } |
| | | |
| | | // const beforeRemove = (file: {}, fileList: []) => { |
| | | // const result = new Promise((resolve, reject) => { |
| | | // if(!state.isOverSize){ |
| | | // ElMessageBox.confirm('此操作将删除该图片, 是否继续?', '提示', { |
| | | // confirmButtonText: '确定', |
| | | // cancelButtonText: '取消', |
| | | // type: 'warning' |
| | | // }) |
| | | // .then(() => { |
| | | // // console.log(state.workDetail.gbPath,'path') |
| | | // const list = JSON.parse(JSON.stringify(state.form.workDetail.gbPath)) |
| | | // fileList.map((item,index)=>{ |
| | | // if(item.uid === file.uid){ |
| | | // fileList.splice(index,1) |
| | | // state.form.workDetail.gbPath.splice(index,1) |
| | | // // 请求删除接口 |
| | | // deletePic(false,list[index]) |
| | | // } |
| | | // }) |
| | | // }) |
| | | // .catch(() => { |
| | | // reject(false); |
| | | // }); |
| | | // }else{ |
| | | // const list = JSON.parse(JSON.stringify(state.form.workDetail.gbPath)) |
| | | // fileList.map((item,index)=>{ |
| | | // if(item.uid === file.uid){ |
| | | // fileList.splice(index,1) |
| | | // state.form.workDetail.gbPath.splice(index,1) |
| | | // deletePic(true,list[index]) |
| | | // } |
| | | // }) |
| | | // state.isOverSize = false |
| | | // } |
| | | // }); |
| | | // return result; |
| | | // }; |
| | | |
| | | // 页面加载时 |
| | | onMounted(() => { |