From 28cb179798b87fdc0b87061a7ca4c70a8a2c33db Mon Sep 17 00:00:00 2001 From: 龚焕茏 <2842157468@qq.com> Date: 星期二, 21 五月 2024 18:54:55 +0800 Subject: [PATCH] feat:部门调动增加情况说明、可上传文件 --- src/components/UploadC.vue | 3 ++- src/views/user/departmentExamine/list.vue | 11 +++++++++++ src/views/user/student/list.vue | 33 ++++++++++++++++++++++++++++++--- 3 files changed, 43 insertions(+), 4 deletions(-) diff --git a/src/components/UploadC.vue b/src/components/UploadC.vue index 3a8df6e..38d8cb3 100644 --- a/src/components/UploadC.vue +++ b/src/components/UploadC.vue @@ -43,8 +43,9 @@ uploadUrl: "http://localhost:8085/api/upload/upload", fileTypeList: { 'video': ['mp4', 'avi'], - 'img': ['jgp', 'png', 'jpeg'], + 'img': ['jpg', 'png', 'jpeg'], 'pdf': ['pdf'], + 'file': ['doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'txt', 'png', 'jpg', 'jpge', 'pdf'], } }; }, diff --git a/src/views/user/departmentExamine/list.vue b/src/views/user/departmentExamine/list.vue index 511e447..9dd0732 100644 --- a/src/views/user/departmentExamine/list.vue +++ b/src/views/user/departmentExamine/list.vue @@ -15,6 +15,14 @@ <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"> + <div v-for="item in getUrl(scope.row.attachment)" :key="item.url"> + <el-link 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> @@ -78,6 +86,9 @@ this.search() }, methods: { + getUrl(urlJson) { + return urlJson ? JSON.parse(urlJson) : []; + }, isDeptAdmin() { return sessionStorage.getItem('deptAdmin') !== '1' }, diff --git a/src/views/user/student/list.vue b/src/views/user/student/list.vue index dd4f531..fb67075 100644 --- a/src/views/user/student/list.vue +++ b/src/views/user/student/list.vue @@ -64,7 +64,9 @@ </router-link> <el-button size="mini" @click="status(row)" class="link-left">鐘舵��</el-button> <el-button type="primary" size="mini" @click="transposition(row)" class="link-left">璋冨姩</el-button> - <el-button size="mini" type="danger" @click="deleteUser(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> @@ -72,7 +74,7 @@ @pagination="search"/> <!-- 鐘舵�佸脊绐� --> - <el-dialog :visible.sync="statusVisible" append-to-body :close-on-click-modal="false" :show-close="false" center width="400px"> + <el-dialog :visible.sync="statusVisible" append-to-body :show-close="false" center width="400px"> <el-radio-group v-model="user.condition"> <el-radio label="姝e父">姝e父</el-radio> <el-radio label="鐥呭亣">鐥呭亣</el-radio> @@ -99,6 +101,9 @@ :value="item.id"> </el-option> </el-select> + <el-input type="textarea" maxlength="100" show-word-limit :autosize="{ minRows: 4}" :rows="2" v-model="examine.reason" placeholder="璇疯緭鍏ユ儏鍐佃鏄�" style="margin-top: 30px;"></el-input> + <upload v-show="form.contentType" ref="upload" :fileUrl="form.contentUrl" :fileType="form.contentType" + :fileSizeLimitM="1024" :uploadNum="1" @getUploadUrl="getUploadUrl" @removeFile="removeFile" style="margin-top: 30px;"/> <span slot="footer" class="dialog-footer"> <el-button @click="dialogVisible = false">鍙� 娑�</el-button> <el-button type="primary" @click="submitExamine">纭� 瀹�</el-button> @@ -112,11 +117,26 @@ import Pagination from '@/components/Pagination' import userApi from '@/api/user' import departmentExamineApi from '@/api/departmentExamine' +import Upload from '@/components/UploadC' export default { - components: { Pagination }, + components: { Pagination, Upload }, + computed: { + fileContentUrl: () => { + return this.form ? this.form.contentUrl ? [this.form.contentUrl] : [] : []; + } + }, data () { return { + + form: { + contentType: 'file', + subject: '', + belongType: 2, + contentUrl: [], + attachment: [], + temp: [] + }, user:{}, statusVisible: false, upLoadUrl:'/api/admin/user/import', @@ -135,6 +155,7 @@ departmentId: [], departmentIds: '', nowDepartmentIds: '', + attachment: '' }, title: '閮ㄩ棬璋冨姩', dialogVisible: false, @@ -145,6 +166,12 @@ this.search() }, methods: { + removeFile() { + this.examine.attachment = []; + }, + getUploadUrl(uploadData) { + this.examine.attachment = JSON.stringify(uploadData); + }, submitExamine() { this.examine.departmentIds = this.examine.departmentId.join(',') departmentExamineApi.save(this.examine).then(res => { -- Gitblit v1.8.0