| | |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="8"> |
| | | <el-form-item prop="agency.certPath" label="资质证书"> |
| | | <el-upload accept="image/*" :action="state.uploadUrl" :headers="state.header" method="post" :on-success="(res, uploadFile)=>handleAvatarSuccess(res, uploadFile,'证书')" :on-exceed="showTip" :on-preview="handlePictureCardPreview" :limit='state.imgLimit' v-model:file-list="state.certList" list-type="picture-card" :before-upload="picSize" :on-remove="(file, uploadFiles)=>handleRemove(file, uploadFiles,'证书')" > |
| | | <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-row :gutter="30"> |
| | | <el-col :span="8"> |
| | | <el-form-item prop="agency.assetValue" label="固定资产总值"> |
| | | <el-input |
| | | v-model="registerForm.agency.assetValue" |
| | |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="8"> |
| | | <el-form-item prop="agency.reportPath" label="加盖公章的《机构信息上报表》"> |
| | | <el-col :span="24"> |
| | | <el-form-item prop="agency.reportPath" label="加盖公章的《机构信息上报表》(请上传加盖公章的营业执照)"> |
| | | <!-- <el-upload--> |
| | | <!-- v-model:file-list="state.fileList"--> |
| | | <!-- class="upload-demo"--> |
| | |
| | | <!-- </div>--> |
| | | <!-- </template>--> |
| | | <!-- </el-upload>--> |
| | | <el-upload accept="image/*" :action="state.uploadUrl" :headers="state.header" method="post" :on-success="handleAvatarSuccess" :on-exceed="showTip" :on-preview="handlePictureCardPreview" :limit='state.imgLimit' v-model:file-list="state.fileList" list-type="picture-card" :before-upload="picSize" :on-remove="handleRemove" :before-remove="beforeRemove"> |
| | | <el-upload accept="image/*" :action="state.uploadUrl" :headers="state.header" method="post" :on-success="(res, uploadFile)=>handleAvatarSuccess(res, uploadFile,'上报表')" :on-exceed="showTip" :on-preview="handlePictureCardPreview" :limit='state.imgLimit' v-model:file-list="state.fileList" list-type="picture-card" :before-upload="picSize" :on-remove="(file, uploadFiles)=>handleRemove(file, uploadFiles,'上报表')" > |
| | | <el-icon><Plus /></el-icon> |
| | | <template #tip> |
| | | <div class="el-upload__tip">上传jpg/png图片尺寸小于5M,最多可上传1张</div> |
| | |
| | | </el-row> |
| | | <el-row :gutter="30" v-if="state.title == '新增/注册'"> |
| | | <el-col :span="12"> |
| | | <el-form-item prop="password" label="密码"> |
| | | <el-form-item prop="password" label="密码(字母+数字+特殊字符,长度在6-16之间)"> |
| | | <el-input |
| | | v-model.trim="registerForm.password" |
| | | type="password" |
| | |
| | | import { Base64 } from 'js-base64' |
| | | import {getAgencyById} from "../../../api/sysUsers"; |
| | | import Cookies from "js-cookie"; |
| | | import {getInstitutionDetail} from "@/api/backManage/insitution"; |
| | | const emit = defineEmits(["getList"]); |
| | | |
| | | const props = { |
| | |
| | | areaList: [], |
| | | busList: [], |
| | | fileList: [], |
| | | certList: [], |
| | | imgLimit: 1, |
| | | uploadUrl: import.meta.env.VITE_APP_BASE_API + '/system/common/uploadFile', |
| | | header: { |
| | |
| | | regAddress: '', |
| | | business: '', |
| | | reportPath: '', |
| | | certPath: '' |
| | | }, |
| | | username: '', |
| | | phone: '', |
| | |
| | | let param = {} |
| | | if(state.title=='新增/注册') { |
| | | param = { |
| | | phone:value |
| | | phone:value, |
| | | identity: 1 |
| | | } |
| | | }else if(state.title=='编辑'){ |
| | | param = { |
| | | phone:value, |
| | | identity: 1, |
| | | id: state.registerForm.id |
| | | } |
| | | } |
| | |
| | | callback(new Error('请输入密码')) |
| | | }else{ |
| | | if(!verifyPwd(value)){ |
| | | callback(new Error('密码须包含字母、数字、特殊字符(不包括下划线),长度在6-16之间')) |
| | | callback(new Error('密码须包含字母、数字、特殊字符,长度在6-16之间')) |
| | | }else{ |
| | | callback() |
| | | } |
| | |
| | | "agency.regAddress": [{required: true, trigger: "blur", message: "请输入注册地址"}], |
| | | "agency.business": [{required: true, trigger: "blur", message: "请选择申请的法定安全评价业务范围"}], |
| | | "agency.reportPath": [{required: true, trigger: "blur", message: "请上传加盖公章的《机构信息上报表》"}], |
| | | "agency.certPath": [{required: true, trigger: "blur", message: "请上传资质证书"}], |
| | | username: [{ required: true, trigger: "blur", validator: validateUsername }], |
| | | phone: [{ required: true, trigger: "blur", validator: validateUserPhone }], |
| | | password: [{ required: true, trigger: "blur", validator: validatePwd }], |
| | |
| | | // }); |
| | | }) |
| | | const isAbleEdit = ref(false); |
| | | const isReject = ref(false); |
| | | const openDialog=(type, value)=>{ |
| | | state.title = type === 'add' ? '新增/注册' : type ==='edit' ? '编辑' : '查看' ; |
| | | getArea() |
| | | if(type === 'edit' || type == 'view') { |
| | | state.title = type === 'add' ? '新增/注册' : (type ==='edit' || type ==='reject') ? '编辑' : '查看' ; |
| | | getArea() |
| | | if(type === 'edit' || type == 'view' || type ==='reject') { |
| | | state.registerForm.id = value.id |
| | | state.registerForm.username = value.username |
| | | state.registerForm.phone = value.phone |
| | |
| | | } |
| | | } |
| | | getArea() |
| | | |
| | | state.registerForm.phone = info.user.phone |
| | | startPhone.value = info.user.phone |
| | | state.registerForm.agency.business = info.business.split(',').map(Number) |
| | | if(state.registerForm.agency.attribute === 0){ |
| | | state.registerForm.agency.area = [info.city,info.district].filter(item => { return item && item.trim() }) |
| | |
| | | const imgUrl = import.meta.env.VITE_APP_BASE_API + "/" + res.data.reportPath |
| | | state.fileList = imgUrl ? imgUrl.split(',').map(url => {return {url} }) : [] |
| | | } |
| | | if(res.data.certPath) { |
| | | const imgUrl = import.meta.env.VITE_APP_BASE_API + "/" + res.data.certPath |
| | | state.certList = imgUrl ? imgUrl.split(',').map(url => {return {url} }) : [] |
| | | } |
| | | |
| | | |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | |
| | | if(type == 'view'){ |
| | | state.isView = true |
| | | } |
| | | if(type === 'reject'){ |
| | | isReject.value = true; |
| | | } |
| | | } |
| | | dialogVisible.value = true |
| | | console.log('state.registerForm',state.registerForm) |
| | | } |
| | | |
| | | const validKey=(key,obj)=>{ |
| | |
| | | } |
| | | |
| | | const changeAttr=()=>{ |
| | | state.registerForm.agency.area = [] |
| | | state.registerForm.agency.province = '' |
| | | state.registerForm.agency.city = '' |
| | | state.registerForm.agency.district = '' |
| | | getArea() |
| | | } |
| | | |
| | |
| | | }; |
| | | |
| | | |
| | | const handleAvatarSuccess = (res, uploadFile) => { |
| | | const handleAvatarSuccess = (res, uploadFile,type) => { |
| | | if(res.code == 200){ |
| | | state.registerForm.agency.reportPath = res.data.path |
| | | console.log("type",type) |
| | | if(type === '上报表'){ |
| | | state.registerForm.agency.reportPath = res.data.path |
| | | }else { |
| | | state.registerForm.agency.certPath = res.data.path |
| | | } |
| | | |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | |
| | | } |
| | | } |
| | | |
| | | const handleRemove = async (file, uploadFiles) => { |
| | | const res = await delPic({path: state.registerForm.agency.reportPath}) |
| | | const handleRemove = async (file, uploadFiles,type) => { |
| | | let path = ''; |
| | | if(type === '上报表'){ |
| | | path = state.registerForm.agency.reportPath; |
| | | }else { |
| | | path = state.registerForm.agency.certPath; |
| | | } |
| | | const res = await delPic({path: path}) |
| | | if(res.code == 200){ |
| | | ElMessage({ |
| | | type: 'success', |
| | |
| | | proxy.$refs.registerRef.resetFields() |
| | | proxy.$refs.registerRef.clearValidate() |
| | | state.fileList = [] |
| | | state.certList = [] |
| | | loading.value = false |
| | | // router.push("/homePage") |
| | | }).catch(() => {}) |
| | |
| | | }else { |
| | | const {confirmPassword, ...data} = JSON.parse(JSON.stringify(state.registerForm)) |
| | | data.password = Base64.encode(data.password) |
| | | console.log('data',data) |
| | | data.agency.business = data.agency.business.join(',') |
| | | if(isReject.value) { |
| | | data.state = 1; |
| | | } |
| | | // delete data.agency.area |
| | | console.log('data',data) |
| | | editAgency(data).then(res => { |
| | |
| | | type: 'success', |
| | | message: '编辑成功' |
| | | }) |
| | | emit("getList") |
| | | |
| | | dialogVisible.value = false |
| | | state.registerForm.agency.attribute = 0 |
| | | proxy.$refs.registerRef.resetFields() |
| | | proxy.$refs.registerRef.clearValidate() |
| | | state.fileList = [] |
| | | state.certList = [] |
| | | loading.value = false |
| | | |
| | | emit("getList") |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | |
| | | proxy.$refs.registerRef.resetFields() |
| | | proxy.$refs.registerRef.clearValidate() |
| | | state.fileList = [] |
| | | state.certList = [] |
| | | } |
| | | |
| | | defineExpose({ |