| | |
| | | <el-dialog title="基本信息" :visible.sync="dialogshowArr[0].show" width="50%" class="baseinfo"> |
| | | <el-container> |
| | | <el-aside width="200px"> |
| | | <el-input v-if="false" v-model="empBaseInfoForm.file" /> |
| | | <el-upload |
| | | class="avatar-uploader" |
| | | action="#" |
| | | accept=".jpg, .jpeg, .png" |
| | | :show-file-list="false" |
| | | auto-upload="false" |
| | | :on-success="handleAvatarSuccess" |
| | | :on-change="handlePictureCardPreview" |
| | | :auto-upload="false" |
| | | > |
| | | <img v-if="empBaseInfoForm.mageUrl" :src="empBaseInfoForm.imageUrl" class="avatar"> |
| | | <i v-else class="el-icon-plus avatar-uploader-icon" /></el-upload></el-aside> |
| | | <img v-if="empBaseInfoImageUrl" :src="empBaseInfoImageUrl" class="avatar"> |
| | | <i v-else class="el-icon-plus avatar-uploader-icon" /> |
| | | </el-upload> |
| | | </el-aside> |
| | | <el-main> <el-form ref="empBaseInfoForm" :model="empBaseInfoForm" :rules="rules" label-position="right" label-width="120px"> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | |
| | | components: { Treeselect, Pagination }, |
| | | data() { |
| | | return { |
| | | empBaseInfoImageUrl: '', |
| | | total: 0, // 总数量 |
| | | queryParams: {}, // 查询参数 |
| | | sort: {}, // 排序 |
| | |
| | | version: '' |
| | | }, |
| | | empBaseInfoForm: { |
| | | imageUrl: '', |
| | | file: null, |
| | | empId: '', |
| | | customerId: '', |
| | | archivesNumb: '', |
| | |
| | | this.isShow(false, 0) |
| | | }, |
| | | methods: { |
| | | // 图片预览 |
| | | handlePictureCardPreview(file) { |
| | | const fileName = file.name |
| | | const regex = /(.jpg|.jpeg|.gif|.png|.bmp)$/ |
| | | if (regex.test(fileName.toLowerCase())) { |
| | | var reader = new FileReader() |
| | | reader.readAsDataURL(file) |
| | | this.empBaseInfoImageUrl = URL.createObjectURL(file.raw) // 获取URL |
| | | } else { |
| | | this.$message.error('请选择图片文件') |
| | | } |
| | | }, |
| | | // 翻页插件翻页方法 |
| | | search() { |
| | | this.fetch({ |
| | |
| | | }, |
| | | calculateSeniority(val) { |
| | | this.empBaseInfoForm.seniority = calculateSeniority(val) |
| | | }, |
| | | handleAvatarSuccess(res, file) { |
| | | this.empBaseInfoForm.imageUrl = URL.createObjectURL(file.raw) |
| | | } |
| | | } |
| | | } |