post_select.blade.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  1. @extends('module.layouts.content')
  2. @push('meta')
  3. @endpush
  4. @push('css')
  5. <style >
  6. .op_block{
  7. position: relative;
  8. margin-top: 30px;
  9. }
  10. .draggable_content {
  11. width: 60%;
  12. float: left;
  13. margin: 20px 0 0;
  14. }
  15. .tips{
  16. float: right;
  17. width: 35%;
  18. margin: 20px 0 0;
  19. border: 1px solid #ccc;
  20. }
  21. .tips_body{
  22. padding: 20px;
  23. }
  24. .tips_body p{
  25. line-height: 30px;
  26. margin-bottom: 10px;
  27. font-size: 20px;
  28. }
  29. .draggable_content h2{
  30. line-height: 50px;
  31. text-align: center;
  32. border-bottom: 1px solid #ccc;
  33. }
  34. .draggable_content .select{
  35. border: 1px solid #ccc;
  36. width: 45%;
  37. margin-right: 30px;
  38. float: left;
  39. }
  40. .draggable_content .options{
  41. width: 50%;
  42. float: left;
  43. border: 1px solid #ccc;
  44. }
  45. .list-group{
  46. padding: 20px;
  47. }
  48. .list-group-item{
  49. border-radius: 10px;
  50. border: 1px dashed #0a9fd9;
  51. line-height: 30px;
  52. margin-bottom: 10px;
  53. padding: 10px 30px;
  54. }
  55. .operation{
  56. width: 100%;
  57. float: left;
  58. text-align: center;
  59. margin-top: 30px;
  60. }
  61. .mask {
  62. position: absolute;
  63. top: 0px;
  64. left: 0px;
  65. background-color: #777;
  66. z-index: 9;
  67. filter: alpha(opacity=60);
  68. opacity:0.5;
  69. -moz-opacity:0.5;
  70. }
  71. </style>
  72. @endpush
  73. @push('js')
  74. <link href="{{ theme_asset('app/css/common.css') }}" rel="stylesheet">
  75. <link href="{{theme_asset('app/css/recruit/recruit.css')}}" rel="stylesheet" type="text/css"/>
  76. <link rel="stylesheet" href="{{ theme_asset('app/css/element.css') }}">
  77. @endpush
  78. @section('content')
  79. <div id="app">
  80. <div class="recruit_container clearfix">
  81. <div class="recruit_show_content" style="margin-top: 10px;width: 100%">
  82. <div class="title" style="text-align: center"><h2>晋江市公开招聘第十三批村务(社区)专职工作者择岗系统</h2></div>
  83. <div>
  84. <div class="operation">
  85. <el-button type="success" @click="rand()">生成随机测试数据</el-button> <el-button type="success" @click="enter()">进入指定测试数据</el-button>
  86. </div>
  87. <p style="text-align: center;line-height: 30px">当前测试数据:uid->{{ $info->uid }};recruit_id->{{ $info->recruit_id }};appoint_id->{{ $info->appoint_id }}</p>
  88. </div>
  89. <div role="alert" class="el-message el-message--error" style="position:relative" v-if="status == -1">
  90. <i class="el-message__icon el-icon-error"></i>
  91. <p class="el-message__content">您已放弃择岗</p>
  92. </div>
  93. <div role="alert" class="el-message el-message--success" style="position:relative" v-if="status == 1">
  94. <i class="el-message__icon el-icon-success"></i>
  95. <p class="el-message__content">您已提交择岗意向,请耐心等待结果!</p>
  96. </div>
  97. <div class="op_block clearfix" ref="opblock">
  98. <div class="draggable_content">
  99. <div class="select">
  100. <h2>意向镇(街道)</h2>
  101. <draggable :list="select_list" :disabled="!enabled" class="list-group" ghost-class="ghost" @start="dragging = true" @end="dragging = false" v-bind="dragOptions">
  102. <div class="list-group-item" v-for="element in select_list" :key="element.name" v-text="element.name">
  103. </div>
  104. </draggable>
  105. </div>
  106. <div class="options">
  107. <h2>可选镇(街道)</h2>
  108. <draggable :list="options_list" :disabled="!enabled" class="list-group" ghost-class="ghost" @start="dragging = true" @end="dragging = false" v-bind="dragOptions">
  109. <div class="list-group-item" v-for="element in options_list" :key="element.name" v-text="element.name">
  110. </div>
  111. </draggable>
  112. </div>
  113. </div>
  114. <div class="tips">
  115. <h2 style="text-align: center;line-height: 50px;border-bottom: 1px solid #ccc">
  116. 择岗系统操作说明
  117. </h2>
  118. <div class="tips_body">
  119. <p>
  120. 1.意向选择:请在右侧,按您的意向顺序,将可选镇(街道)中的选项拖曳进意向镇(街道)中。
  121. </p>
  122. <p>
  123. 2.意向排序:鼠标左键单击(点住),拖动排序,完成后松开。
  124. </p>
  125. <p>
  126. 3.意向可选择1个或多个,请根据自身情况选择。
  127. </p>
  128. <p>
  129. 4.每个人有且仅有一次意向选择机会,提交后无法更改,请考虑好后再行提交。
  130. </p>
  131. <p>
  132. 5.放弃择岗后将跳过择岗环节,后续无法再次参加。
  133. </p>
  134. </div>
  135. </div>
  136. <div class="operation" v-if="status == 0">
  137. <el-button type="warning" @click="giveup()">放弃择岗</el-button> <el-button type="success" @click="post()">提交择岗</el-button>
  138. </div>
  139. <div id="mask" class="mask" :style="switch_mask" ></div>
  140. </div>
  141. </div>
  142. </div>
  143. </div>
  144. @endsection
  145. @section('script')
  146. <script src="{{theme_asset('app/js/vue.min.js')}}"></script>
  147. <script src="{{theme_asset('app/js/qs.min.js')}}"></script>
  148. <script src="{{theme_asset('app/js/axios.js')}}"></script>
  149. <script src="{{theme_asset('app/js/Sortable.min.js')}}"></script>
  150. <script src="{{theme_asset('app/js/vuedraggable.umd.min.js')}}"></script>
  151. <script src="{{theme_asset('app/js/element.js')}}"></script>
  152. <script>
  153. let recruit_id = '{{ $info->recruit_id }}';
  154. let appoint_id = '{{ $info->appoint_id }}';
  155. let status = '{{ $info->status }}';
  156. const app = new Vue({
  157. el: '#app',
  158. data: {
  159. enabled: true,
  160. select_list: eval({!! $select_list !!}),
  161. options_list: eval({!! $options_list !!}),
  162. dragging: false,
  163. loading: true,
  164. post_data: {
  165. recruit_id: recruit_id,
  166. appoint_id: appoint_id,
  167. uid: '{{ $info->uid }}'
  168. },
  169. status: status,
  170. switch_mask:{}
  171. },
  172. methods: {
  173. post: function() {
  174. var msg = "您正在提交择岗的操作!";
  175. this.$confirm(msg, '警告', {
  176. confirmButtonText: '确认放弃',
  177. cancelButtonText: '我再想想',
  178. type: 'warning'
  179. }).then(() => {
  180. this.loading = this.$loading({
  181. lock: false,
  182. text: '加载中',
  183. spinner: 'el-icon-loading',
  184. background: 'rgba(0, 0, 0, 0.7)'
  185. });
  186. this.post_data._token = '{{csrf_token()}}';
  187. this.post_data.select = this.select_list;
  188. axios.post("{{route('recruit.comfirm_post')}}",Qs.stringify(this.post_data)).then(response => {
  189. if(response.data.status){
  190. this.$alert(response.data.msg, '提交成功', {
  191. confirmButtonText: '确定',
  192. callback: action => {
  193. window.location.reload();
  194. }
  195. });
  196. }else{
  197. this.$message.error(response.data.msg);
  198. this.loading.close();
  199. return false;
  200. }
  201. });
  202. }).catch(() => {
  203. });
  204. },
  205. giveup: function(){
  206. var msg = "您正在进行放弃择岗的操作!";
  207. this.$confirm(msg, '警告', {
  208. confirmButtonText: '确认放弃',
  209. cancelButtonText: '我再想想',
  210. type: 'warning'
  211. }).then(() => {
  212. this.loading = this.$loading({
  213. lock: false,
  214. text: '加载中',
  215. spinner: 'el-icon-loading',
  216. background: 'rgba(0, 0, 0, 0.7)'
  217. });
  218. this.post_data._token = '{{csrf_token()}}';
  219. axios.post("{{route('recruit.give_up_post')}}",Qs.stringify(this.post_data)).then(response => {
  220. if(response.data.status){
  221. this.$alert(response.data.msg, '提交成功', {
  222. confirmButtonText: '确定',
  223. callback: action => {
  224. window.location.reload();
  225. }
  226. });
  227. }else{
  228. this.$message.error(response.data.msg);
  229. this.loading.close();
  230. return false;
  231. }
  232. });
  233. }).catch(() => {
  234. });
  235. },
  236. showMask: function(){
  237. this.switch_mask.width = '100%';
  238. this.switch_mask.height = '1400px';
  239. },
  240. rand: function(){
  241. let href = location.protocol + '//' + location.host + location.pathname;
  242. window.location.href = href;
  243. },
  244. enter: function(){
  245. this.$prompt('请输入用户ID', '提示', {
  246. confirmButtonText: '确定',
  247. cancelButtonText: '取消',
  248. inputPattern: /^-?\d+$/,
  249. inputErrorMessage: '用户ID不正确'
  250. }).then(({ value }) => {
  251. let href = location.protocol + '//' + location.host + location.pathname + '?uid='+value
  252. window.location.href = href;
  253. }).catch(() => {
  254. });
  255. }
  256. },
  257. computed: {
  258. dragOptions() {
  259. return {
  260. animation: 200,
  261. group: "description",
  262. disabled: false,
  263. ghostClass: "ghost"
  264. };
  265. }
  266. },
  267. created(){
  268. if(this.status == -1){
  269. this.showMask()
  270. }
  271. if(this.status != 0){
  272. this.enabled = false;
  273. }
  274. }
  275. })
  276. </script>
  277. @endsection