相关方班级培训,新增班级名称修改功能

pet_li_6.6
liujun 2024-04-17 17:43:29 +08:00
parent b91d712a99
commit 66f708e4e6
4 changed files with 191 additions and 8 deletions

View File

@ -0,0 +1,170 @@
<template>
<div>
<el-dialog :visible.sync="visible" :append-to-body="appendToBody" title="修改班级名称" width="700px" destroy-on-close >
<el-form ref="form" :model="form" label-width="110px">
<el-form-item label="班级名称" prop="CLASS_NAME">
<el-input
id="CLASS_NAME"
ref="CLASS_NAME"
v-model="form.CLASS_NAME"
style="width: 400px;"
maxlength="255"
placeholder="这里输入班级名称..."
title="班级名称"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="close"> </el-button>
<el-button type="primary" @click="confirm"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import vueQr from 'vue-qr'
import { requestFN } from '@/utils/request'
export default {
components: { vueQr },
props: {
appendToBody: {
type: Boolean,
default: false
}
},
data() {
return {
visible: false,
qrCodeStr: '',
form: {
CLASS_NAME: '',
CLASS_MESSAGE_ID: ''
}
}
},
methods: {
init(row) {
this.visible = true
this.form.CLASS_MESSAGE_ID = row.CLASS_MESSAGE_ID
},
close() {
this.visible = false
this.form = {
CLASS_NAME: '',
CLASS_MESSAGE_ID: ''
}
},
confirm() {
this.loading = true
if (!this.form.CLASS_NAME || this.form.CLASS_NAME === '') {
this.$message.error('请输入班级名称')
return
}
requestFN('/classMessage/changeName', this.form).then((data) => {
this.$message.success('保存成功')
this.visible = false
this.close()
this.$emit('getResult')
}).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>

View File

@ -1,5 +1,5 @@
<template> <template>
<el-dialog v-loading="loading" :visible.sync="visible" :title="title" :before-close="close" width="70%"> <el-dialog v-loading="loading" :visible.sync="visible" :title="title" :before-close="close" width="70%" top="50px">
<el-form ref="form" :rules="rules" :model="form" label-width="110px"> <el-form ref="form" :rules="rules" :model="form" label-width="110px">
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :span="12"> <el-col :span="12">
@ -81,6 +81,7 @@
:data="peopleList" :data="peopleList"
:row-key="getRowKey" :row-key="getRowKey"
:header-cell-style="{'font-weight': 'bold','color': '#000'}" :header-cell-style="{'font-weight': 'bold','color': '#000'}"
height="500px"
tooltip-effect="dark" tooltip-effect="dark"
border border
fit fit

View File

@ -73,10 +73,17 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" width="200"> <el-table-column label="操作" align="center" width="200">
<template slot-scope="{row}"> <template slot-scope="{row}">
<el-button type="primary" icon="el-icon-edit" size="mini" @click="handleEdit(row.CLASS_MESSAGE_ID)"></el-button> <el-row>
<el-button v-show=" row.CLASS_STATUS === '0'" type="danger" icon="el-icon-delete" size="mini" @click="handleDelete(row.CLASS_MESSAGE_ID)"></el-button> <el-col :span="24">
<el-button v-show=" row.CLASS_STATUS === '1'" type="primary" size="mini" @click="uploadExcel(row)"></el-button> <el-button type="primary" icon="el-icon-edit" size="mini" @click="handleEdit(row.CLASS_MESSAGE_ID)"></el-button>
<el-button v-if="false" v-show="del" type="danger" icon="el-icon-delete" size="mini" @click="handleDelete(row.CLASS_MESSAGE_ID)"></el-button> <el-button v-show=" row.CLASS_STATUS === '0'" type="danger" icon="el-icon-delete" size="mini" @click="handleDelete(row.CLASS_MESSAGE_ID)"></el-button>
<el-button v-show=" row.CLASS_STATUS === '1'" type="primary" size="mini" @click="uploadExcel(row)"></el-button>
</el-col>
<el-col v-if="row.CLASS_STATUS === '0'" :span="24" style="margin-top: 10px">
<el-button v-show=" row.CLASS_STATUS === '0'" type="primary" icon="el-icon-edit" size="mini" @click="changeName(row)"></el-button>
</el-col>
</el-row>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -90,6 +97,7 @@
<edit ref="edit" :title="title" :is-show="isShow" @getResult = "getList"/> <edit ref="edit" :title="title" :is-show="isShow" @getResult = "getList"/>
<init-class ref="initClass" :title="title" :is-show="isShow" @getResult = "getList"/> <init-class ref="initClass" :title="title" :is-show="isShow" @getResult = "getList"/>
<upload-excel ref="uploadExcel" title="上传" append-to-body @getChoose="getFile"/> <upload-excel ref="uploadExcel" title="上传" append-to-body @getChoose="getFile"/>
<change-name ref="changeName" @getResult = "getList"/>
</div> </div>
</template> </template>
<script> <script>
@ -100,8 +108,9 @@ import edit from './edit.vue'
import { upload } from '@/utils/upload' import { upload } from '@/utils/upload'
import uploadExcel from '../../../../components/uploadExcel/index.vue' import uploadExcel from '../../../../components/uploadExcel/index.vue'
import InitClass from './initClass.vue' import InitClass from './initClass.vue'
import ChangeName from './changeName.vue'
export default { export default {
components: { InitClass, uploadExcel, Pagination, edit }, components: { ChangeName, InitClass, uploadExcel, Pagination, edit },
directives: { waves }, directives: { waves },
data() { data() {
return { return {
@ -201,7 +210,7 @@ export default {
requestFN( requestFN(
'/classMessage/delete', '/classMessage/delete',
{ {
CLASSMESSAGE_ID: id CLASS_MESSAGE_ID: id
} }
).then(() => { ).then(() => {
this.$message({ this.$message({
@ -336,6 +345,9 @@ export default {
}, },
uploadExcel(row) { uploadExcel(row) {
this.$refs.uploadExcel.init(row) this.$refs.uploadExcel.init(row)
},
changeName(row) {
this.$refs.changeName.init(row)
} }
} }
} }

View File

@ -166,7 +166,7 @@ export default {
downloadPdf(dom, '相关方安全告知培训合格证') downloadPdf(dom, '相关方安全告知培训合格证')
}, },
getShowPicture(row) { getShowPicture(row) {
if (row.PHOTO && row.PHOTO !== '' && (row.PHOTO.indexOf('.jpg') >= 0 || row.PHOTO.indexOf('.png') >= 0 || row.PHOTO.indexOf('.jpeg') >= 0)) { if (row.PHOTO) {
return true return true
} }
}, },