| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379 |
- <!DOCTYPE html>
- <html>
- <head>
- <title>招聘投递</title>
- <#include "../../include/head-file.ftl">
- </head>
- <body>
- <div id="index" class="ms-index" v-cloak>
- <el-header class="ms-header" height="50px">
- <el-col :span=12>
- <@shiro.hasPermission name="tf:recruitmentSubmission:save">
- <el-button type="primary" class="el-icon-plus" size="default" @click="save()">新增</el-button>
- </@shiro.hasPermission>
- <@shiro.hasPermission name="tf:recruitmentSubmission:del">
- <el-button type="danger" class="el-icon-delete" size="default" @click="del(selectionList)" :disabled="!selectionList.length">删除</el-button>
- </@shiro.hasPermission>
- </el-col>
- </el-header>
- <div class="ms-search">
- <el-row>
- <el-form :model="form" ref="searchForm" label-width="120px" size="default">
- <el-row>
- <el-col :span=8>
- <!--姓名-->
- <el-form-item label="姓名" prop="submissionName">
- <el-input
- v-model="form.submissionName"
- :disabled="false"
- :readonly="false"
- :style="{width: '100%'}"
- :clearable="true"
- placeholder="请输入姓名">
- </el-input>
- </el-form-item>
- </el-col>
- <el-col :span=16 style="display: flex;justify-content: end;padding-right: 10px;">
- <el-button type="primary" class="el-icon-search" size="default" @click="currentPage=1;list(true)">搜索</el-button>
- <el-button @click="rest" class="el-icon-refresh" size="default">重置</el-button>
- <ms-search ref="search" @search="search" :search-json="searchJson" :search-key="historyKey"></ms-search>
- </el-col>
- </el-row>
- </el-form>
- </el-row>
- </div>
- <el-main class="ms-container">
- <el-table class="ms-table-pagination" v-loading="loading" ref="multipleTable" border :data="dataList" tooltip-effect="dark" @selection-change="handleSelectionChange">
- <template #empty>
- {{emptyText}}
- </template>
- <el-table-column type="selection" width="40" :selectable="isChecked"></el-table-column>
- <el-table-column label="姓名" align="left" prop="submissionName">
- </el-table-column>
- <el-table-column label="联系电话" align="left" prop="submissionTel">
- </el-table-column>
- <el-table-column label="邮件" align="left" prop="submissionEmail">
- </el-table-column>
- <el-table-column label="招聘ID" align="left" prop="recruitmentId">
- </el-table-column>
- <el-table-column min-width="180" align="center" label="创建时间" prop="createDate"></el-table-column>
- <el-table-column label="操作" width="180" align="center" fixed="right">
- <template #default="scope">
- <@shiro.hasPermission name="tf:recruitmentSubmission:update">
- <el-link type="primary" :underline="false" @click="save(scope.row.id)">编辑</el-link>
- </@shiro.hasPermission>
- <@shiro.hasPermission name="tf:recruitmentSubmission:del">
- <el-link type="primary" :underline="false" @click="del([scope.row])" v-if="scope.row.del!=3">删除</el-link>
- </@shiro.hasPermission>
- </template>
- </el-table-column>
- </el-table>
- <el-pagination
- background
- :page-sizes="[10,20,30,40,50,100]"
- layout="total, sizes, prev, pager, next, jumper"
- :current-page="currentPage"
- :page-size="pageSize"
- :total="total"
- class="ms-pagination"
- @current-change='currentChange'
- @size-change="sizeChange">
- </el-pagination>
- </el-main>
- </div>
- </body>
- </html>
- <script>
- var indexVue = new _Vue({
- el: '#index',
- provide() {
- return {
- searchParent: this //筛选使用
- };
- },
- data:function() {
- return {
- searchJson:[
- {
- "isSearch": "true",
- "action": "and",
- "field": "SUBMISSION_NAME",
- "el": "eq",
- "model": "submissionName",
- "name": "姓名",
- "type": "input"
- },
- {
- "isSearch": "",
- "action": "and",
- "field": "SUBMISSION_TEL",
- "el": "eq",
- "model": "submissionTel",
- "name": "联系电话",
- "type": "input"
- },
- {
- "isSearch": "",
- "action": "and",
- "field": "SUBMISSION_EMAIL",
- "el": "eq",
- "model": "submissionEmail",
- "name": "邮件",
- "type": "input"
- },
- {
- "action":"and",
- "field": "SUBMISSION_FILE",
- "el": "empty",
- "model": "submissionFile",
- "name": "附件",
- "type": "fileupload"
- }, {
- "isSearch": "",
- "action": "and",
- "field": "RECRUITMENT_ID",
- "el": "eq",
- "model": "recruitmentId",
- "name": "招聘ID",
- "type": "input"
- },
- ],
- dataList: [], //招聘投递列表
- selectionList:[],//招聘投递列表选中
- total: 0, //总记录数量
- pageSize: 10, //页面数量
- currentPage:1, //初始页
- manager: ms.manager,
- loading: true,//加载状态
- emptyText:'',//提示文字
- //搜索表单
- form:{
- sqlWhere:null
- },
- //历史记录参数
- historyKey: "tf_recruitment_submission_history"
- }
- },
- watch:{
- },
- methods:{
- isChecked: function(row) {
- if(row.del == 3) {
- return false;
- }
- return true;
- },
- //查询列表
- list: function(isSearch) {
- var that = this;
- var data = {}; //搜索参数
- that.loading = true;
- var page={
- pageNo: that.currentPage,
- pageSize : that.pageSize
- }
- var form = JSON.parse(JSON.stringify(that.form))
- if(isSearch) {
- //删除空字符串
- for (var key in form){
- if(form[key] === undefined || form[key] === null){
- delete form[key]
- }
- }
- form.sqlWhere ? data = Object.assign({}, {sqlWhere: form.sqlWhere}, page) : data = Object.assign({}, form, page)
- } else {
- data = page;
- }
- sessionStorage.setItem(that.historyKey,JSON.stringify({form: form, page: page}));
- ms.http.post(ms.manager+"/tf/recruitmentSubmission/list.do",data).then(
- function(res) {
- if (!res.result||res.data.total <= 0) {
- that.emptyText ="暂无数据"
- that.dataList = [];
- that.total = 0;
- } else {
- that.emptyText = '';
- that.total = res.data.total;
- that.dataList = res.data.rows;
- }
- that.loading = false;
- }).catch(function(err) {
- that.loading = false;
- console.log(err);
- });
- },
- //招聘投递列表选中
- handleSelectionChange:function(val){
- this.selectionList = val;
- },
- //删除
- del: function(row){
- var that = this;
- that.$confirm("此操作将永久删除所选内容, 是否继续", "提示", {
- confirmButtonText: "确认",
- cancelButtonText: "取消",
- type: 'warning'
- }).then(function() {
- ms.http.post(ms.manager+"/tf/recruitmentSubmission/delete.do", row.length?row:[row],{
- headers: {
- 'Content-Type': 'application/json'
- }
- }).then(
- function(res){
- if (res.result) {
- that.$notify({
- title:'成功',
- type: 'success',
- message:"删除成功"
- });
- //删除成功,刷新列表
- that.list();
- }else {
- that.$notify({
- title: "错误",
- message: res.msg,
- type: 'warning'
- });
- }
- });
- }).catch(function(err) {
- //删除如果用户取消会抛出异常,所以需要catch一下
- console.log(err)
- });
- },
- //新增
- save:function(id){
- if(id){
- ms.util.openSystemUrl("/tf/recruitmentSubmission/form.do?id="+id);
- }else {
- ms.util.openSystemUrl("/tf/recruitmentSubmission/form.do");
- }
- },
- //pageSize改变时会触发
- sizeChange:function(pagesize) {
- this.loading = true;
- this.pageSize = pagesize;
- this.list(true);
- },
- //currentPage改变时会触发
- currentChange:function(currentPage) {
- this.loading = true;
- this.currentPage = currentPage;
- this.list(true);
- },
- search:function(data){
- this.form.sqlWhere = JSON.stringify(data);
- this.list(true);
- },
- //重置表单
- rest:function(){
- this.currentPage = 1;
- this.form = {
- sqlWhere:null
- };
- this.$refs.searchForm.resetFields();
- this.list(true);
- },
- // submissionFile删除
- submissionFileHandleRemove: function (file, files) {
- var index = -1;
- index = this.form.submissionFile.findIndex(function (text) {
- return text.uid == file.uid;
- });
- if (index != -1) {
- this.form.submissionFile.splice(index, 1);
- }
- },
- //submissionFile上传超过限制
- submissionFileHandleExceed: function (files, fileList) {
- this.$notify({
- title: '失败',
- message: '当前最多上传1个文件测试',
- type: 'warning'
- });
- },
- //submissionFile预览
- submissionFileHandlePreview: function (file){
- if (file.url.startsWith("http://") || file.url.startsWith("https://")){
- window.open(file.url);
- }else {
- window.open(file.url);
- }
- },
- //submissionFile上传成功
- submissionFileSuccess: function (response, file, fileList) {
- if (response.result) {
- if(!response.data.startsWith("http://") && !response.data.startsWith("https://")) {
- file.url = ms.contextpath + response.data;
- }else{
- file.url = response.data;
- }
- this.form.submissionFile.push({
- url: response.data,
- name: file.name,
- uid: file.uid
- });
- } else {
- // 移除上传附件
- var index = fileList.indexOf(file);
- if (index > -1) {
- fileList.splice(index, 1);
- }
- this.$notify({
- title: '失败',
- message: response.msg,
- type: 'warning'
- });
- }
- },
- // 上传文件错误回调
- submissionFileError: function (err, file, fileList) {
- if (err.message) {
- this.$notify({
- type: 'warning',
- title: '失败',
- message: '文件上传失败:' + JSON.parse(err.message).msg
- });
- } else {
- this.$notify({
- type: 'warning',
- title: '失败',
- message: '文件上传失败'
- });
- }
- },
- },
- mounted:function(){
- var that = this;
- //如果存在历史参数,恢复页面结果
- if(sessionStorage.getItem(this.historyKey) && ms.util.getParameter("isBack") == 'true') {
- var _history = JSON.parse(sessionStorage.getItem(this.historyKey))
- this.form = _history.form;
- this.total = parseInt(_history.total);
- this.currentPage = parseInt(_history.page.pageNo);
- this.pageSize = parseInt(_history.page.pageSize);
- }
- this.list(true);
- },
- created:function(){
- var that = this;
- }
- })
- </script>
- <style scoped>
- #index .ms-container {
- height: calc(100vh - 141px);
- }
- </style>
|