From b154944a23194d0dcac889585e1436f988ecd19f Mon Sep 17 00:00:00 2001 From: 龚焕茏 <2842157468@qq.com> Date: 星期三, 22 五月 2024 15:22:00 +0800 Subject: [PATCH] feat:用户状况新增审核 --- src/api/user.js | 2 src/views/user/departmentExamine/list.vue | 10 +- src/api/UserConditionExamine.js | 9 + src/views/user/student/list.vue | 42 ++++--- src/router.js | 12 ++ src/views/user/UserConditionExamine/list.vue | 180 ++++++++++++++++++++++++++++++++++++ 6 files changed, 231 insertions(+), 24 deletions(-) diff --git a/src/api/UserConditionExamine.js b/src/api/UserConditionExamine.js new file mode 100644 index 0000000..759eafb --- /dev/null +++ b/src/api/UserConditionExamine.js @@ -0,0 +1,9 @@ +import { get,post } from '@/utils/request' + +export default { + list: query => post('/api/admin/userCondition/examine/list', query), + save: query => post('/api/admin/userCondition/examine/save', query), + audit: query => post('/api/admin/userCondition/examine/audit', query), + delete: id => post('/api/admin/userCondition/examine/delete/' + id), + getDeptList: id => post('/api/admin/userCondition/list'), +} diff --git a/src/api/user.js b/src/api/user.js index 14bc64c..0716aeb 100644 --- a/src/api/user.js +++ b/src/api/user.js @@ -19,5 +19,5 @@ selectByUserName: query => post('/api/admin/user/selectByUserName', query), addMeetin:query => post('/api/admin/video/add', query), delMeetin:query => post('/api/admin/video/clear', query), - setStatus:query => post('/api/admin/user/setStatus', query) + setStatus:query => post('/api/admin/userCondition/examine/save', query) } diff --git a/src/router.js b/src/router.js index 8428af1..86a80d1 100644 --- a/src/router.js +++ b/src/router.js @@ -78,6 +78,12 @@ meta: { title: '璋冨姩瀹℃牳', noCache: true } }, { + path: 'UserConditionExamine/list', + component: () => import('@/views/user/UserConditionExamine/list'), + name: 'UserConditionExamineList', + meta: { title: '鐘舵�佸鏍�', noCache: true } + }, + { path: 'tag/list', component: () => import('@/views/user/tag/list'), name: 'TagAdminPageList', @@ -484,6 +490,12 @@ name: 'departmentExamineList', meta: { title: '璋冨姩瀹℃牳', noCache: true } }, + { + path: 'UserConditionExamine/list', + component: () => import('@/views/user/UserConditionExamine/list'), + name: 'UserConditionExamineList', + meta: { title: '鐘舵�佸鏍�', noCache: true } + }, ] }, { diff --git a/src/views/user/UserConditionExamine/list.vue b/src/views/user/UserConditionExamine/list.vue new file mode 100644 index 0000000..72fc162 --- /dev/null +++ b/src/views/user/UserConditionExamine/list.vue @@ -0,0 +1,180 @@ +<template> + <div class="app-container"> + <el-form :model="queryParam" ref="queryForm" :inline="true"> + <el-form-item label="鐢ㄦ埛鍚嶏細"> + <el-input v-model="queryParam.userName"></el-input> + </el-form-item> + <el-form-item> + <div style="display: flex"> + <el-button type="primary" @click="search()">鏌ヨ</el-button> + </div> + </el-form-item> + </el-form> + + <el-table v-loading="listLoading" :data="tableData" border fit highlight-current-row style="width: 100%"> + <el-table-column prop="userName" label="鐢ㄦ埛" /> + <el-table-column prop="targetCondition" label="鐢宠鐘舵��" /> + <el-table-column prop="sourceCondition" label="褰撳墠鐘舵��" /> + <el-table-column prop="reason" label="璋冨姩鍘熷洜" show-overflow-tooltip/> + <el-table-column prop="attachment" label="闄勪欢" show-overflow-tooltip> + <template slot-scope="scope"> + <div v-for="item in getUrl(scope.row.attachment)" :key="item.url"> + <el-link :underline="false" type="primary" :href="'/api/upload/download?url=' + item.url +'&fileName=' + item.name" >{{ item.name }}</el-link> + </div> + </template> + </el-table-column> + <el-table-column prop="result" label="瀹℃牳缁撴灉" width="90px" align="center"> + <template slot-scope="{row}"> + <el-tag :type="row.result === '瀹℃牳閫氳繃' ? 'success' : row.result === '瀹℃牳椹冲洖' ? 'danger' : 'info'">{{row.result}}</el-tag> + </template> + </el-table-column> + <el-table-column prop="remark" label="瀹℃牳鎰忚" show-overflow-tooltip /> + <el-table-column prop="createUserName" label="鍒涘缓浜�" /> + <el-table-column prop="createTime" label="鍒涘缓鏃堕棿" width="160px" /> + <el-table-column label="鎿嶄綔" align="center" v-if="!deptAdmin()"> + <template slot-scope="{row}"> + <el-button v-if="row.result === '寰呭鏍�'" type="primary" size="mini" @click="transposition(row)" class="link-left">瀹℃牳</el-button> + <el-popconfirm title="纭鍒犻櫎" @confirm="deleteUser(row)"> + <el-button slot="reference" size="mini" type="danger" class="link-left">鍒犻櫎</el-button> + </el-popconfirm> + </template> + </el-table-column> + </el-table> + <pagination v-show="total > 0" :total="total" :page.sync="queryParam.pageIndex" :limit.sync="queryParam.pageSize" + @pagination="search" /> + + <!-- 瀹℃牳寮圭獥 --> + <el-dialog :visible.sync="statusVisible" append-to-body :show-close="false" center width="400px"> + <el-radio-group v-model="user.result"> + <el-radio label="瀹℃牳閫氳繃">閫氳繃</el-radio> + <el-radio label="瀹℃牳椹冲洖">椹冲洖</el-radio> + </el-radio-group> + <el-input type="textarea" maxlength="100" show-word-limit :autosize="{ minRows: 4 }" :rows="2" + v-model="user.remark" placeholder="璇疯緭鍏ュ鏍告剰瑙�" style="margin-top: 30px;"></el-input> + <span slot="footer" class="dialog-footer"> + <el-button type="primary" @click="statusConfirm">纭� 瀹�</el-button> + <el-button @click="statusVisible = false">鍙� 娑�</el-button> + </span> + </el-dialog> + </div> +</template> + +<script> +import UserConditionExamineApi from '@/api/UserConditionExamine' +import Pagination from '@/components/Pagination' +import { mapGetters, mapState } from 'vuex' + +export default { + components: { Pagination }, + data() { + return { + user: {}, + statusVisible: false, + fileList: [], + queryParam: { + userName: '', + role: 1, + pageIndex: 1, + pageSize: 10 + }, + listLoading: true, + tableData: [], + total: 0, + } + }, + created() { + this.search() + }, + methods: { + getUrl(urlJson) { + return urlJson ? JSON.parse(urlJson) : []; + }, + deptAdmin() { + return sessionStorage.getItem('deptAdmin') === '1' + }, + transposition(user) { + this.statusVisible = true; + this.user = { ...user }; + }, + statusConfirm() { + if (this.user.result === "寰呭鏍�") { + this.$message.error("璇烽�夋嫨瀹℃牳缁撴灉") + return + } + UserConditionExamineApi.audit(this.user).then(res => { + if (res.code === 1) { + this.$message.success("鎿嶄綔鎴愬姛") + this.statusVisible = false; + this.search() + } else { + this.$message.error("鎿嶄綔澶辫触") + } + }) + }, + search() { + this.listLoading = true + UserConditionExamineApi.list(this.queryParam).then(data => { + const re = data.response + this.tableData = re.list + this.total = re.total + this.queryParam.pageIndex = re.pageNum + this.listLoading = false + }) + }, + changeStatus(row) { + let _this = this + userApi.changeStatus(row.id).then(re => { + if (re.code === 1) { + row.status = re.response + _this.$message.success(re.message) + } else { + _this.$message.error(re.message) + } + }) + }, + deleteUser(row) { + let _this = this + UserConditionExamineApi.delete(row.id).then(re => { + if (re.code === 1) { + _this.search() + _this.$message.success(re.message) + } else { + _this.$message.error(re.message) + } + }) + }, + levelFormatter(row, column, cellValue, index) { + return this.enumFormat(this.levelEnum, cellValue) + }, + sexFormatter(row, column, cellValue, index) { + return this.enumFormat(this.sexEnum, cellValue) + }, + statusFormatter(status) { + return this.enumFormat(this.statusEnum, status) + }, + statusTagFormatter(status) { + return this.enumFormat(this.statusTag, status) + }, + statusBtnFormatter(status) { + return this.enumFormat(this.statusBtn, status) + } + }, + computed: { + ...mapGetters('enumItem', [ + 'enumFormat' + ]), + ...mapState('enumItem', { + sexEnum: state => state.user.sexEnum, + statusEnum: state => state.user.statusEnum, + statusTag: state => state.user.statusTag, + statusBtn: state => state.user.statusBtn, + levelEnum: state => state.user.levelEnum + }) + } +} +</script> +<style lang="scss" scoped> +.upload-demo { + margin-left: 5px; +} +</style> diff --git a/src/views/user/departmentExamine/list.vue b/src/views/user/departmentExamine/list.vue index 9bd7341..4d7b64b 100644 --- a/src/views/user/departmentExamine/list.vue +++ b/src/views/user/departmentExamine/list.vue @@ -12,9 +12,9 @@ </el-form> <el-table v-loading="listLoading" :data="tableData" border fit highlight-current-row style="width: 100%"> - <el-table-column prop="userName" label="鐢ㄦ埛鍚�" /> - <el-table-column prop="departmentName" label="閮ㄩ棬鍚嶇О" /> - <el-table-column prop="nowDepartmentName" label="鍘熼儴闂ㄥ悕绉�" /> + <el-table-column prop="userName" label="鐢ㄦ埛" /> + <el-table-column prop="departmentName" label="璋冨姩閮ㄩ棬" /> + <el-table-column prop="nowDepartmentName" label="鍘熼儴闂�" /> <el-table-column prop="reason" label="璋冨姩鍘熷洜" show-overflow-tooltip/> <el-table-column prop="attachment" label="闄勪欢" show-overflow-tooltip> <template slot-scope="scope"> @@ -97,8 +97,8 @@ this.user = { ...user }; }, statusConfirm() { - if (this.user.result === null) { - this.$message.error("璇烽�夋嫨鐘舵��") + if (this.user.result === "寰呭鏍�") { + this.$message.error("璇烽�夋嫨瀹℃牳缁撴灉") return } departmentExamineApi.audit(this.user).then(res => { diff --git a/src/views/user/student/list.vue b/src/views/user/student/list.vue index 35740e3..38fcd86 100644 --- a/src/views/user/student/list.vue +++ b/src/views/user/student/list.vue @@ -20,7 +20,6 @@ :file-list="fileList" :before-upload="beforeAvatarUpload"> <el-button type="primary">瀵煎叆</el-button> - <!-- <div slot="tip" class="el-upload__tip">鍙兘涓婁紶Excel鏂囦欢</div>--> </el-upload> </div> </el-form-item> @@ -40,7 +39,6 @@ <el-tag :type="row.condition == '姝e父' || row.condition == null ? 'success' : 'warning'">{{ row.condition ? row.condition : '姝e父' }}</el-tag> </template> </el-table-column> - <el-table-column prop="conditionDetail" label="鍏蜂綋鎯呭喌" :show-overflow-tooltip="true"/> <el-table-column prop="sex" label="鎬у埆" width="60px;" :formatter="sexFormatter"/> <el-table-column prop="phone" label="鎵嬫満鍙�" width="120"/> <el-table-column prop="createTime" label="鍒涘缓鏃堕棿" width="160px"/> @@ -75,13 +73,14 @@ <!-- 鐘舵�佸脊绐� --> <el-dialog :visible.sync="statusVisible" append-to-body :show-close="false" center width="400px"> - <el-radio-group v-model="user.condition"> + <el-radio-group v-model="conditionExamine.targetCondition"> <el-radio label="姝e父">姝e父</el-radio> <el-radio label="鐥呭亣">鐥呭亣</el-radio> <el-radio label="鍑哄樊">鍑哄樊</el-radio> <el-radio label="鍏朵粬">鍏朵粬</el-radio> </el-radio-group> - <el-input type="textarea" maxlength="100" show-word-limit :autosize="{ minRows: 4}" :rows="2" v-model="user.conditionDetail" placeholder="璇疯緭鍏ヨ缁嗘儏鍐�" style="margin-top: 30px;"></el-input> + <el-input type="textarea" maxlength="100" show-word-limit :autosize="{ minRows: 4}" :rows="2" v-model="conditionExamine.reason" placeholder="璇疯緭鍏ヨ缁嗘儏鍐�" style="margin-top: 30px;"></el-input> + <upload :fileUrl="conditionExamine.contentUrl" :fileSizeLimitM="1024" :uploadNum="1" @getUploadUrl="getConditionUploadAttachmentUrl" @removeFile="removeConditionAttachmentFile" style="margin-top: 30px;"/> <span slot="footer" class="dialog-footer"> <el-button type="primary" @click="statusConfirm">纭� 瀹�</el-button> <el-button @click="statusVisible = false">鍙� 娑�</el-button> @@ -148,6 +147,15 @@ contentUrl: [], attachment: '' }, + conditionExamine: { + userId: '', + targetCondition: '', + sourceCondition: '', + reason: '', + result: 0, + contentUrl: [], + attachment: '' + }, title: '閮ㄩ棬璋冨姩', dialogVisible: false, deptList: [] @@ -167,6 +175,14 @@ getUploadAttachmentUrl(uploadData) { this.examine.attachment = JSON.stringify(uploadData); this.examine.contentUrl = uploadData; + }, + removeConditionAttachmentFile(fileList, fileName) { + this.conditionExamine.attachment = JSON.stringify(fileList.filter(item => item.name !== fileName)); + this.conditionExamine.contentUrl = fileList.filter(item => item.name !== fileName); + }, + getConditionUploadAttachmentUrl(uploadData) { + this.conditionExamine.attachment = JSON.stringify(uploadData); + this.conditionExamine.contentUrl = uploadData; }, submitExamine() { this.examine.departmentIds = this.examine.departmentId.join(',') @@ -195,14 +211,15 @@ }, status(user) { this.statusVisible = true; - this.user = { ...user }; + this.conditionExamine.sourceCondition = user.condition ? user.condition : '0'; + this.conditionExamine.userId = user.id }, statusConfirm() { - if (this.user.condition === null) { + if (this.conditionExamine.targetCondition === null) { this.$message.error("璇烽�夋嫨鐘舵��") return } - userApi.setStatus(this.user).then(res => { + userApi.setStatus(this.conditionExamine).then(res => { if (res.code === 1) { this.$message.success("鎿嶄綔鎴愬姛") this.statusVisible = false; @@ -231,17 +248,6 @@ this.$message.warning('鏂囦欢鏍煎紡涓嶅锛屼粎闄恱ls鍜寈lsx') return false } - // console.log(file) - // const isJPG = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'; - // // const isLt2M = file.size / 1024 / 1024 < 2; - // - // if (!isJPG) { - // this.$message.error('涓婁紶鏂囦欢鍙兘鏄疎xcel!'); - // } - // // if (!isLt2M) { - // // this.$message.error('涓婁紶澶村儚鍥剧墖澶у皬涓嶈兘瓒呰繃 2MB!'); - // // } - // return isJPG ; }, search () { this.listLoading = true -- Gitblit v1.8.0