index.ftl 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>招聘投递</title>
  5. <#include "../../include/head-file.ftl">
  6. </head>
  7. <body>
  8. <div id="index" class="ms-index" v-cloak>
  9. <el-header class="ms-header" height="50px">
  10. <el-col :span=12>
  11. <@shiro.hasPermission name="tf:recruitmentSubmission:save">
  12. <el-button type="primary" class="el-icon-plus" size="default" @click="save()">新增</el-button>
  13. </@shiro.hasPermission>
  14. <@shiro.hasPermission name="tf:recruitmentSubmission:del">
  15. <el-button type="danger" class="el-icon-delete" size="default" @click="del(selectionList)" :disabled="!selectionList.length">删除</el-button>
  16. </@shiro.hasPermission>
  17. </el-col>
  18. </el-header>
  19. <div class="ms-search">
  20. <el-row>
  21. <el-form :model="form" ref="searchForm" label-width="120px" size="default">
  22. <el-row>
  23. <el-col :span=8>
  24. <!--姓名-->
  25. <el-form-item label="姓名" prop="submissionName">
  26. <el-input
  27. v-model="form.submissionName"
  28. :disabled="false"
  29. :readonly="false"
  30. :style="{width: '100%'}"
  31. :clearable="true"
  32. placeholder="请输入姓名">
  33. </el-input>
  34. </el-form-item>
  35. </el-col>
  36. <el-col :span=16 style="display: flex;justify-content: end;padding-right: 10px;">
  37. <el-button type="primary" class="el-icon-search" size="default" @click="currentPage=1;list(true)">搜索</el-button>
  38. <el-button @click="rest" class="el-icon-refresh" size="default">重置</el-button>
  39. <ms-search ref="search" @search="search" :search-json="searchJson" :search-key="historyKey"></ms-search>
  40. </el-col>
  41. </el-row>
  42. </el-form>
  43. </el-row>
  44. </div>
  45. <el-main class="ms-container">
  46. <el-table class="ms-table-pagination" v-loading="loading" ref="multipleTable" border :data="dataList" tooltip-effect="dark" @selection-change="handleSelectionChange">
  47. <template #empty>
  48. {{emptyText}}
  49. </template>
  50. <el-table-column type="selection" width="40" :selectable="isChecked"></el-table-column>
  51. <el-table-column label="姓名" align="left" prop="submissionName">
  52. </el-table-column>
  53. <el-table-column label="联系电话" align="left" prop="submissionTel">
  54. </el-table-column>
  55. <el-table-column label="邮件" align="left" prop="submissionEmail">
  56. </el-table-column>
  57. <el-table-column label="招聘ID" align="left" prop="recruitmentId">
  58. </el-table-column>
  59. <el-table-column min-width="180" align="center" label="创建时间" prop="createDate"></el-table-column>
  60. <el-table-column label="操作" width="180" align="center" fixed="right">
  61. <template #default="scope">
  62. <@shiro.hasPermission name="tf:recruitmentSubmission:update">
  63. <el-link type="primary" :underline="false" @click="save(scope.row.id)">编辑</el-link>
  64. </@shiro.hasPermission>
  65. <@shiro.hasPermission name="tf:recruitmentSubmission:del">
  66. <el-link type="primary" :underline="false" @click="del([scope.row])" v-if="scope.row.del!=3">删除</el-link>
  67. </@shiro.hasPermission>
  68. </template>
  69. </el-table-column>
  70. </el-table>
  71. <el-pagination
  72. background
  73. :page-sizes="[10,20,30,40,50,100]"
  74. layout="total, sizes, prev, pager, next, jumper"
  75. :current-page="currentPage"
  76. :page-size="pageSize"
  77. :total="total"
  78. class="ms-pagination"
  79. @current-change='currentChange'
  80. @size-change="sizeChange">
  81. </el-pagination>
  82. </el-main>
  83. </div>
  84. </body>
  85. </html>
  86. <script>
  87. var indexVue = new _Vue({
  88. el: '#index',
  89. provide() {
  90. return {
  91. searchParent: this //筛选使用
  92. };
  93. },
  94. data:function() {
  95. return {
  96. searchJson:[
  97. {
  98. "isSearch": "true",
  99. "action": "and",
  100. "field": "SUBMISSION_NAME",
  101. "el": "eq",
  102. "model": "submissionName",
  103. "name": "姓名",
  104. "type": "input"
  105. },
  106. {
  107. "isSearch": "",
  108. "action": "and",
  109. "field": "SUBMISSION_TEL",
  110. "el": "eq",
  111. "model": "submissionTel",
  112. "name": "联系电话",
  113. "type": "input"
  114. },
  115. {
  116. "isSearch": "",
  117. "action": "and",
  118. "field": "SUBMISSION_EMAIL",
  119. "el": "eq",
  120. "model": "submissionEmail",
  121. "name": "邮件",
  122. "type": "input"
  123. },
  124. {
  125. "action":"and",
  126. "field": "SUBMISSION_FILE",
  127. "el": "empty",
  128. "model": "submissionFile",
  129. "name": "附件",
  130. "type": "fileupload"
  131. }, {
  132. "isSearch": "",
  133. "action": "and",
  134. "field": "RECRUITMENT_ID",
  135. "el": "eq",
  136. "model": "recruitmentId",
  137. "name": "招聘ID",
  138. "type": "input"
  139. },
  140. ],
  141. dataList: [], //招聘投递列表
  142. selectionList:[],//招聘投递列表选中
  143. total: 0, //总记录数量
  144. pageSize: 10, //页面数量
  145. currentPage:1, //初始页
  146. manager: ms.manager,
  147. loading: true,//加载状态
  148. emptyText:'',//提示文字
  149. //搜索表单
  150. form:{
  151. sqlWhere:null
  152. },
  153. //历史记录参数
  154. historyKey: "tf_recruitment_submission_history"
  155. }
  156. },
  157. watch:{
  158. },
  159. methods:{
  160. isChecked: function(row) {
  161. if(row.del == 3) {
  162. return false;
  163. }
  164. return true;
  165. },
  166. //查询列表
  167. list: function(isSearch) {
  168. var that = this;
  169. var data = {}; //搜索参数
  170. that.loading = true;
  171. var page={
  172. pageNo: that.currentPage,
  173. pageSize : that.pageSize
  174. }
  175. var form = JSON.parse(JSON.stringify(that.form))
  176. if(isSearch) {
  177. //删除空字符串
  178. for (var key in form){
  179. if(form[key] === undefined || form[key] === null){
  180. delete form[key]
  181. }
  182. }
  183. form.sqlWhere ? data = Object.assign({}, {sqlWhere: form.sqlWhere}, page) : data = Object.assign({}, form, page)
  184. } else {
  185. data = page;
  186. }
  187. sessionStorage.setItem(that.historyKey,JSON.stringify({form: form, page: page}));
  188. ms.http.post(ms.manager+"/tf/recruitmentSubmission/list.do",data).then(
  189. function(res) {
  190. if (!res.result||res.data.total <= 0) {
  191. that.emptyText ="暂无数据"
  192. that.dataList = [];
  193. that.total = 0;
  194. } else {
  195. that.emptyText = '';
  196. that.total = res.data.total;
  197. that.dataList = res.data.rows;
  198. }
  199. that.loading = false;
  200. }).catch(function(err) {
  201. that.loading = false;
  202. console.log(err);
  203. });
  204. },
  205. //招聘投递列表选中
  206. handleSelectionChange:function(val){
  207. this.selectionList = val;
  208. },
  209. //删除
  210. del: function(row){
  211. var that = this;
  212. that.$confirm("此操作将永久删除所选内容, 是否继续", "提示", {
  213. confirmButtonText: "确认",
  214. cancelButtonText: "取消",
  215. type: 'warning'
  216. }).then(function() {
  217. ms.http.post(ms.manager+"/tf/recruitmentSubmission/delete.do", row.length?row:[row],{
  218. headers: {
  219. 'Content-Type': 'application/json'
  220. }
  221. }).then(
  222. function(res){
  223. if (res.result) {
  224. that.$notify({
  225. title:'成功',
  226. type: 'success',
  227. message:"删除成功"
  228. });
  229. //删除成功,刷新列表
  230. that.list();
  231. }else {
  232. that.$notify({
  233. title: "错误",
  234. message: res.msg,
  235. type: 'warning'
  236. });
  237. }
  238. });
  239. }).catch(function(err) {
  240. //删除如果用户取消会抛出异常,所以需要catch一下
  241. console.log(err)
  242. });
  243. },
  244. //新增
  245. save:function(id){
  246. if(id){
  247. ms.util.openSystemUrl("/tf/recruitmentSubmission/form.do?id="+id);
  248. }else {
  249. ms.util.openSystemUrl("/tf/recruitmentSubmission/form.do");
  250. }
  251. },
  252. //pageSize改变时会触发
  253. sizeChange:function(pagesize) {
  254. this.loading = true;
  255. this.pageSize = pagesize;
  256. this.list(true);
  257. },
  258. //currentPage改变时会触发
  259. currentChange:function(currentPage) {
  260. this.loading = true;
  261. this.currentPage = currentPage;
  262. this.list(true);
  263. },
  264. search:function(data){
  265. this.form.sqlWhere = JSON.stringify(data);
  266. this.list(true);
  267. },
  268. //重置表单
  269. rest:function(){
  270. this.currentPage = 1;
  271. this.form = {
  272. sqlWhere:null
  273. };
  274. this.$refs.searchForm.resetFields();
  275. this.list(true);
  276. },
  277. // submissionFile删除
  278. submissionFileHandleRemove: function (file, files) {
  279. var index = -1;
  280. index = this.form.submissionFile.findIndex(function (text) {
  281. return text.uid == file.uid;
  282. });
  283. if (index != -1) {
  284. this.form.submissionFile.splice(index, 1);
  285. }
  286. },
  287. //submissionFile上传超过限制
  288. submissionFileHandleExceed: function (files, fileList) {
  289. this.$notify({
  290. title: '失败',
  291. message: '当前最多上传1个文件测试',
  292. type: 'warning'
  293. });
  294. },
  295. //submissionFile预览
  296. submissionFileHandlePreview: function (file){
  297. if (file.url.startsWith("http://") || file.url.startsWith("https://")){
  298. window.open(file.url);
  299. }else {
  300. window.open(file.url);
  301. }
  302. },
  303. //submissionFile上传成功
  304. submissionFileSuccess: function (response, file, fileList) {
  305. if (response.result) {
  306. if(!response.data.startsWith("http://") && !response.data.startsWith("https://")) {
  307. file.url = ms.contextpath + response.data;
  308. }else{
  309. file.url = response.data;
  310. }
  311. this.form.submissionFile.push({
  312. url: response.data,
  313. name: file.name,
  314. uid: file.uid
  315. });
  316. } else {
  317. // 移除上传附件
  318. var index = fileList.indexOf(file);
  319. if (index > -1) {
  320. fileList.splice(index, 1);
  321. }
  322. this.$notify({
  323. title: '失败',
  324. message: response.msg,
  325. type: 'warning'
  326. });
  327. }
  328. },
  329. // 上传文件错误回调
  330. submissionFileError: function (err, file, fileList) {
  331. if (err.message) {
  332. this.$notify({
  333. type: 'warning',
  334. title: '失败',
  335. message: '文件上传失败:' + JSON.parse(err.message).msg
  336. });
  337. } else {
  338. this.$notify({
  339. type: 'warning',
  340. title: '失败',
  341. message: '文件上传失败'
  342. });
  343. }
  344. },
  345. },
  346. mounted:function(){
  347. var that = this;
  348. //如果存在历史参数,恢复页面结果
  349. if(sessionStorage.getItem(this.historyKey) && ms.util.getParameter("isBack") == 'true') {
  350. var _history = JSON.parse(sessionStorage.getItem(this.historyKey))
  351. this.form = _history.form;
  352. this.total = parseInt(_history.total);
  353. this.currentPage = parseInt(_history.page.pageNo);
  354. this.pageSize = parseInt(_history.page.pageSize);
  355. }
  356. this.list(true);
  357. },
  358. created:function(){
  359. var that = this;
  360. }
  361. })
  362. </script>
  363. <style scoped>
  364. #index .ms-container {
  365. height: calc(100vh - 141px);
  366. }
  367. </style>