开班后可以更换头像

5_7_地图同步
liujun 2024-04-07 17:16:46 +08:00
parent c47536f667
commit ca5c37f73e
3 changed files with 175 additions and 8 deletions

View File

@ -111,7 +111,7 @@
<template v-else-if="row.STATUS === '1'">合格</template> <template v-else-if="row.STATUS === '1'">合格</template>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" width="200"> <el-table-column label="操作" align="center" width="250">
<template slot-scope="{row}"> <template slot-scope="{row}">
<el-button <el-button
v-if="form.CLASS_STATUS === '2' && row.STATUS === '1'" v-if="form.CLASS_STATUS === '2' && row.STATUS === '1'"
@ -120,6 +120,7 @@
size="mini" size="mini"
@click="getUserInfo(row)">查看 @click="getUserInfo(row)">查看
</el-button> </el-button>
<el-button v-if="form.CLASS_STATUS === '1'" icon="el-icon-s-open" type="primary" @click="updatePhoto(row)"></el-button>
<el-button <el-button
v-if="row.STATUS === '0' && form.CLASS_STATUS === '1'" v-if="row.STATUS === '0' && form.CLASS_STATUS === '1'"
type="primary" type="primary"
@ -149,6 +150,7 @@
</div> </div>
<user ref="userInfo" append-to-body/> <user ref="userInfo" append-to-body/>
<user_pdf ref="userPdf" append-to-body/> <user_pdf ref="userPdf" append-to-body/>
<update-photo ref="updatePhoto" append-to-body @getResult="getInformation"/>
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
@ -159,8 +161,9 @@ import axios from 'axios'
import dayjs from 'dayjs' // waves directive import dayjs from 'dayjs' // waves directive
import user from './user.vue' import user from './user.vue'
import User_pdf from './user_pdf.vue' import User_pdf from './user_pdf.vue'
import UpdatePhoto from './updatePhoto.vue'
export default { export default {
components: { User_pdf, Pagination, user }, components: { UpdatePhoto, User_pdf, Pagination, user },
directives: { waves }, directives: { waves },
props: { props: {
title: { title: {
@ -226,6 +229,9 @@ export default {
} }
this.getDic() this.getDic()
}, },
updatePhoto(e) {
this.$refs.updatePhoto.init(e)
},
confirm() { confirm() {
if (!this.peopleList || !this.peopleList.length || this.peopleList.length === 0) { if (!this.peopleList || !this.peopleList.length || this.peopleList.length === 0) {
this.$message.error('没有人员数据') this.$message.error('没有人员数据')
@ -399,9 +405,7 @@ export default {
}) })
}, },
getShowPicture(row) { getShowPicture(row) {
if (row.PHOTO && row.PHOTO !== '' && (row.PHOTO.indexOf('.jpg') >= 0 || row.PHOTO.indexOf('.png') >= 0 || row.PHOTO.indexOf('.jpeg') >= 0)) { return row.PHOTO && row.PHOTO !== ''
return true
}
} }
} }
} }

View File

@ -478,9 +478,7 @@ export default {
}) })
}, },
getShowPicture(row) { getShowPicture(row) {
if (row.PHOTO && row.PHOTO !== '' && (row.PHOTO.indexOf('.jpg') >= 0 || row.PHOTO.indexOf('.png') >= 0 || row.PHOTO.indexOf('.jpeg') >= 0)) { return row.PHOTO && row.PHOTO !== ''
return true
}
} }
} }
} }

View File

@ -0,0 +1,165 @@
<template>
<el-dialog v-loading="loading" :visible.sync="visible" :append-to-body="appendToBody" title="头像更换" width="370px" destroy-on-close >
<upload-img ref="uploadImg" :file-list.sync="fileList" :limit="1"/>
<div slot="footer" class="dialog-footer">
<el-button @click="goBack"> </el-button>
<el-button type="primary" @click="save"> </el-button>
</div>
</el-dialog>
</template>
<script>
import UploadImg from '../../../util/uploadImg/index.vue'
import { upload } from '@/utils/upload'
export default {
components: { UploadImg },
props: {
appendToBody: {
type: Boolean,
default: false
}
},
data() {
return {
visible: false,
heirloom: {},
fileList: [],
loading: false
}
},
methods: {
init(e) {
this.visible = true
this.heirloom = e
console.log(this.heirloom)
},
goBack() {
this.fileList = []
this.visible = false
},
save() {
this.loading = true
const formData = new FormData()
formData.append('PHOTO', this.fileList[0].raw)
formData.append('CLASS_INFO_ID', this.heirloom.CLASS_INFO_ID)
upload(
'/classMessage/uploadPhoto',
formData
).then((data) => {
if (data.code === '0') {
this.$message({
type: 'success',
message: '上传成功!'
})
this.$emit('getResult', this.heirloom)
this.goBack()
} else {
this.$message({
type: 'error',
message: data.errorMessage
})
}
this.loading = false
}).catch((e) => {
this.loading = false
})
}
}
}
</script>
<style lang="scss" scoped>
.name{
width: 120px;
overflow: hidden;//
white-space: nowrap; //
text-overflow: ellipsis;//
}
.red {
width: 660px;
color: #ff0000;
margin-left: 34px;
font-size: 24px;
}
.bg_table {
background: url("../../../../assets/tablebg.jpg") no-repeat bottom center;
background-size: 100%;
width: 660px;
height: 430px;
border: 4px solid #453d3a;
transform: scale(0.5);
transform-origin: top left;
.title {
font-size: 28px;
text-align: center;
margin-top: 34px;
font-weight: bold;
color: #000000;
}
.table {
border-collapse: collapse;
width: 590px;
color: #453d3a;
font-size: 20px;
margin: 34px;
text-align: left;
margin-top: 10px;
.tcenter {
text-align: center
}
.w60 {
width: 100px;
}
.w74 {
width: 148px
}
th, td {
border: 2px solid #453d3a;
text-align: left;
height: 40px;
padding: 0 16px;
box-sizing: border-box;
.textone {
width: 80px;
text-align: justify;
text-align-last: justify;
text-justify: distribute-all-lines;
margin: 0 auto;
}
.text1 {
width: 60px;
text-align: justify;
text-align-last: justify;
text-justify: distribute-all-lines;
margin: 0 auto;
}
.text2 {
width: 50px;
text-align: justify;
text-align-last: justify;
text-justify: distribute-all-lines;
margin: 0 auto;
}
.text {
}
}
}
}
</style>