comjobsform.html 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479
  1. <style type="text/css">
  2. .amap-sug-result{
  3. z-index:999999999;
  4. }
  5. #pickerInput{
  6. z-index: 999999;
  7. position: absolute;
  8. right: 30px;
  9. top: 20px;
  10. width: 200px;
  11. }
  12. </style>
  13. <div class="layui-fluid">
  14. <div class="layui-row layui-col-space15">
  15. <div class="layui-col-md12">
  16. <div class="layui-card">
  17. <div class="layui-card-header">招聘信息</div>
  18. <div class="layui-card-body" pad15>
  19. <div class="layui-form layui-form-pane" lay-filter="LAY-comjobs-comjobsform-edit">
  20. <input type="hidden" name="id" value="{$comjobs.id}">
  21. <div class="layui-form-item">
  22. <label class="layui-form-label"><span style="color:#f90c05;">*</span>劳务公司</label>
  23. <div class="layui-input-block">
  24. <select name="workerid" lay-search lay-verify="required">
  25. <option value="">请选择劳务公司(可搜索)...</option>
  26. {volist name="workerlist" id="vo"}
  27. <option value="{$vo.id}" {$comjobs.workerid==$vo.id ? 'selected' : '' }>{$vo.title}</option>
  28. {/volist}
  29. </select>
  30. </div>
  31. </div>
  32. <div class="layui-form-item">
  33. <label class="layui-form-label"><span style="color:#f90c05;">*</span>招聘标题</label>
  34. <div class="layui-input-block">
  35. <input type="text" name="title" value="{$comjobs.title}" lay-verify="required" placeholder="请输入..."
  36. autocomplete="off" class="layui-input">
  37. </div>
  38. </div>
  39. <div class="layui-form-item" id="video-box">
  40. <input type="hidden" id="old_video" value="{$comjobs.video}" name="old_video"/>
  41. <input type="hidden" id="new_video" value="" name="new_video"/>
  42. <label class="layui-form-label">小视频</label>
  43. <div class="layui-input-inline">
  44. <button type="submit" class="layui-btn" id="add_video" ><i class="layui-icon"></i>选择视频</button>
  45. </div>
  46. <video id="videoid" width="320" height="240" controls="controls" >
  47. <source id="show_video" src="{$comjobs.video}" type="video/mp4" />
  48. </video>
  49. </div>
  50. <div class="layui-form-item">
  51. <label class="layui-form-label"><span style="color:#f90c05;">*</span>岗位类型</label>
  52. <div class="layui-input-block">
  53. <select name="cateid" lay-search lay-verify="required">
  54. <option value="">请选择岗位类型(可搜索)...</option>
  55. {volist name="catelist" id="vo"}
  56. <option value="{$vo.id}" {$comjobs.cateid==$vo.id ? 'selected' : '' }>{$vo.title}</option>
  57. {/volist}
  58. </select>
  59. </div>
  60. </div>
  61. <div class="layui-form-item" id="LAY-comjobs-comjobsform-edit-areapicker">
  62. <label class="layui-form-label"><span style="color:#f90c05;">*</span>省市区</label>
  63. <div class="layui-input-inline">
  64. <select name="province" class="province-selector" data-value="{$comjobs.province}" lay-filter="province-2"
  65. lay-verify="required">
  66. <option value="">请选择省</option>
  67. </select>
  68. </div>
  69. <div class="layui-input-inline">
  70. <select name="city" class="city-selector" data-value="{$comjobs.city}" lay-filter="city-2" lay-verify="required">
  71. <option value="">请选择市</option>
  72. </select>
  73. </div>
  74. <div class="layui-input-inline">
  75. <select name="district" class="district-selector" data-value="{$comjobs.district}" lay-filter="district-2"
  76. lay-verify="required">
  77. <option value="">请选择区</option>
  78. </select>
  79. </div>
  80. </div>
  81. <div class="layui-form-item">
  82. <label class="layui-form-label"><span style="color:#f90c05;">*</span>详细地址</label>
  83. <div class="layui-input-block">
  84. <input type="text" name="address" value="{$comjobs.address}" lay-verify="required" placeholder="请输入..."
  85. autocomplete="off" class="layui-input">
  86. </div>
  87. </div>
  88. <div class="layui-form-item">
  89. <label class="layui-form-label"><span style="color:#f90c05;">*</span>经纬度</label>
  90. <div class="layui-input-inline">
  91. <input type="text" name="longitude" value="{$comjobs.longitude}" lay-verify="required" placeholder="经度"
  92. autocomplete="off" class="layui-input">
  93. </div>
  94. <div class="layui-input-inline">
  95. <input type="text" name="latitude" value="{$comjobs.latitude}" lay-verify="required" placeholder="纬度"
  96. autocomplete="off" class="layui-input">
  97. </div>
  98. <div id="maplocation" style="width:500px;height:500px;display: none;">
  99. <input id="pickerInput" class="layui-input" placeholder="输入关键字选取地点"/>
  100. </div>
  101. <button style="float: left;" type="button" class="layui-btn" id="layuiadmin-map-lnglat">选择地理位置</button>
  102. </div>
  103. <div class="layui-form-item">
  104. <label class="layui-form-label">招聘标签</label>
  105. <div class="layui-input-block">
  106. {volist name="welfarelist" id="vo"}
  107. <input type="checkbox" name="tags[]" value="{$vo.name}" title="{$vo.name}"
  108. {if condition="!$comjobs->isEmpty() && in_array($vo['name'],$comjobs['tags'])"}
  109. checked
  110. {/if}
  111. />
  112. {/volist}
  113. </div>
  114. </div>
  115. <div class="layui-form-item">
  116. <label class="layui-form-label">任职要求</label>
  117. <div class="layui-input-block">
  118. <textarea name="requirement" placeholder="请输入..." rows="6" class="layui-textarea">{$comjobs.requirement}</textarea>
  119. </div>
  120. </div>
  121. <div class="layui-form-item">
  122. <label class="layui-form-label">职位详情</label>
  123. <div class="layui-input-block">
  124. <textarea name="comdetails" placeholder="请输入..." rows="6" class="layui-textarea">{$comjobs.comdetails}</textarea>
  125. </div>
  126. </div>
  127. <div class="layui-form-item">
  128. <label class="layui-form-label">环境照片</label>
  129. <div class="layui-input-block">
  130. <div class="layui-upload">
  131. <button type="button" class="layui-btn attachment-upload-images" data-input="picall" data-amount="9">上传图片</button>
  132. <div class="layui-inline layui-word-aux"> 最佳尺寸:750px*375px </div>
  133. <div class="layui-upload-list echo-attachment-image-list" id="picall">
  134. {volist name="comjobs.picall" id="vo"}
  135. <div>
  136. <input type="hidden" name="picall[]" value="{$vo}">
  137. <img src="{$vo}"> <button type="button" class="attachmentdel layui-btn layui-btn-primary layui-btn-xs layui-btn-fluid">删除</button>
  138. </div>
  139. {/volist}
  140. </div>
  141. </div>
  142. </div>
  143. </div>
  144. <div class="layui-form-item">
  145. <label class="layui-form-label">企业介绍</label>
  146. <div class="layui-input-block">
  147. <textarea name="companydetails" placeholder="请输入..." rows="6" class="layui-textarea">{$comjobs.companydetails}</textarea>
  148. </div>
  149. </div>
  150. <div class="layui-form-item" pane>
  151. <label class="layui-form-label">招聘类型</label>
  152. <div class="layui-input-block">
  153. <input type="radio" name="recruitment_cate" value="1" title="普通招聘" {eq name="comjobs.recruitment_cate|default=1" value="1"}checked{/eq}>
  154. <input type="radio" name="recruitment_cate" value="2" title="悬赏聘" {eq name="comjobs.recruitment_cate" value="2"}checked{/eq}>
  155. </div>
  156. </div>
  157. <div class="layui-form-item">
  158. <label class="layui-form-label">返佣金额</label>
  159. <div class="layui-input-block">
  160. <input type="text" name="retmoney" value="{$comjobs.retmoney}" placeholder="请输入...."
  161. autocomplete="off" class="layui-input">
  162. </div>
  163. </div>
  164. <div class="layui-form-item">
  165. <label class="layui-form-label">招聘人数</label>
  166. <div class="layui-input-block">
  167. <input type="number" name="recruit_num" value="{$comjobs.recruit_num|default=1}" placeholder="请输入...."
  168. autocomplete="off" class="layui-input">
  169. </div>
  170. </div>
  171. <div class="layui-form-item">
  172. <label class="layui-form-label"><span style="color:#f90c05;">*</span>招工年龄</label>
  173. <div class="layui-input-block">
  174. <input type="text" name="agegroup" value="{$comjobs.agegroup|default=''}" placeholder="请输入...."
  175. autocomplete="off" class="layui-input" lay-verify="required">
  176. </div>
  177. </div>
  178. <div class="layui-form-item">
  179. <label class="layui-form-label">学历</label>
  180. <div class="layui-input-block">
  181. <select name="education">
  182. <option value="">请选择学历...</option>
  183. {volist name="educationlist" id="vo"}
  184. <option value="{$vo.name}" {$comjobs.education==$vo.name ? 'selected' : '' }>{$vo.name}</option>
  185. {/volist}
  186. </select>
  187. </div>
  188. </div>
  189. <div class="layui-form-item">
  190. <label class="layui-form-label">用工时间</label>
  191. <div class="layui-input-block">
  192. {volist name="emptimelist" id="vo"}
  193. <input type="checkbox" name="emp_time[]" value="{$vo.name}" title="{$vo.name}"
  194. {if condition="!$comjobs->isEmpty() && !empty($comjobs['emp_time']) && in_array($vo['name'],$comjobs['emp_time'])"}
  195. checked
  196. {/if}
  197. />
  198. {/volist}
  199. </div>
  200. </div>
  201. <div class="layui-form-item" pane>
  202. <label class="layui-form-label">薪资类型</label>
  203. <div class="layui-input-block">
  204. <input type="radio" name="wtype" value="1" title="按月" {eq name="comjobs.wtype|default=1" value="1"}checked{/eq}>
  205. <input type="radio" name="wtype" value="2" title="按时" {eq name="comjobs.wtype" value="2"}checked{/eq}>
  206. <input type="radio" name="wtype" value="3" title="按件" {eq name="comjobs.wtype" value="3"}checked{/eq}>
  207. <input type="radio" name="wtype" value="4" title="按项目" {eq name="comjobs.wtype" value="4"}checked{/eq}>
  208. <input type="radio" name="wtype" value="5" title="其他" {eq name="comjobs.wtype" value="5"}checked{/eq}>
  209. </div>
  210. </div>
  211. <div class="layui-form-item">
  212. <label class="layui-form-label">薪酬</label>
  213. <div class="layui-input-block">
  214. <input type="text" name="zwagall" value="{$comjobs.zwagall}" placeholder="请输入...."
  215. autocomplete="off" class="layui-input">
  216. </div>
  217. </div>
  218. <div class="layui-form-item">
  219. <label class="layui-form-label"><span style="color:#f90c05;">*</span>咨询电话</label>
  220. <div class="layui-input-block">
  221. <input type="text" name="telephone" value="{$comjobs.telephone}" lay-verify="required" placeholder="请输入..." autocomplete="off" class="layui-input">
  222. </div>
  223. </div>
  224. <div class="layui-form-item">
  225. <label class="layui-form-label">补充说明</label>
  226. <div class="layui-input-block">
  227. <textarea name="remark" placeholder="请输入..." class="layui-textarea">{$comjobs.remark}</textarea>
  228. </div>
  229. </div>
  230. <div class="layui-form-item" pane>
  231. <label class="layui-form-label">状态</label>
  232. <div class="layui-input-block">
  233. <input type="radio" name="status" value="1" title="待修改" {eq name="comjobs.status|default=1" value="1"}checked{/eq}>
  234. <input type="radio" name="status" value="2" title="待审核" {eq name="comjobs.status" value="2"}checked{/eq}>
  235. <input type="radio" name="status" value="3" title="已上架" {eq name="comjobs.status" value="3"}checked{/eq}>
  236. <input type="radio" name="status" value="4" title="已停招" {eq name="comjobs.status" value="4"}checked{/eq}>
  237. <input type="radio" name="status" value="5" title="已下架" {eq name="comjobs.status" value="5"}checked{/eq}>
  238. </div>
  239. </div>
  240. <div class="layui-form-item" pane>
  241. <label class="layui-form-label">急聘</label>
  242. <div class="layui-input-block">
  243. <input type="radio" name="is_worry" value="0" title="否" {eq name="comjobs.is_worry|default=0" value="0"}checked{/eq}>
  244. <input type="radio" name="is_worry" value="1" title="是" {eq name="comjobs.is_worry" value="1"}checked{/eq}>
  245. </div>
  246. </div>
  247. <div class="layui-form-item">
  248. <label class="layui-form-label">推荐</label>
  249. <div class="layui-input-block">
  250. <select name="priority">
  251. <option value="0" {$comjobs.priority===0 ? 'selected' : '' }>不推荐</option>
  252. <option value="1" {$comjobs.priority===1 ? 'selected' : '' }>推荐一</option>
  253. <option value="2" {$comjobs.priority===2 ? 'selected' : '' }>推荐二</option>
  254. <option value="3" {$comjobs.priority===3 ? 'selected' : '' }>推荐三</option>
  255. <option value="4" {$comjobs.priority===4 ? 'selected' : '' }>推荐四</option>
  256. <option value="5" {$comjobs.priority===5 ? 'selected' : '' }>推荐五</option>
  257. <option value="6" {$comjobs.priority===6 ? 'selected' : '' }>推荐六</option>
  258. <option value="7" {$comjobs.priority===7 ? 'selected' : '' }>推荐七</option>
  259. <option value="8" {$comjobs.priority===8 ? 'selected' : '' }>推荐八</option>
  260. <option value="9" {$comjobs.priority===9 ? 'selected' : '' }>推荐九</option>
  261. </select>
  262. <div class="layui-form-mid layui-word-aux">推荐值值越大越靠前</div>
  263. </div>
  264. </div>
  265. <div class="layui-form-item">
  266. <label class="layui-form-label"><span style="color:#f90c05;">*</span>更新时间</label>
  267. <div class="layui-input-block">
  268. <input type="text" name="updatetime" id="updatetime" value="{$comjobs.updatetime}" lay-verify="required"
  269. placeholder="请选择..." autocomplete="off" class="layui-input">
  270. </div>
  271. </div>
  272. <div class="layui-form-item">
  273. <label class="layui-form-label"><span style="color:#f90c05;">*</span>创建时间</label>
  274. <div class="layui-input-block">
  275. <input type="text" name="createtime" id="createtime" value="{$comjobs.createtime}" lay-verify="required"
  276. placeholder="请选择..." autocomplete="off" class="layui-input">
  277. </div>
  278. </div>
  279. <div class="layui-form-item">
  280. <label class="layui-form-label">浏览量</label>
  281. <div class="layui-input-block">
  282. <input type="text" name="volume" value="{$comjobs.volume|default=0}" lay-verify="number" placeholder="请输入..."
  283. autocomplete="off" class="layui-input">
  284. </div>
  285. </div>
  286. <div class="layui-form-item">
  287. <div class="layui-input-block">
  288. <input type="button" lay-submit lay-filter="LAY-comjobs-comjobsform-edit-submit" value="确认提交" class="layui-btn">
  289. </div>
  290. </div>
  291. </div>
  292. </div>
  293. </div>
  294. </div>
  295. </div>
  296. </div>
  297. <script>
  298. layui.config({
  299. base: '/static/echoui/' //静态资源所在路径
  300. }).extend({
  301. index: 'lib/index' //主入口模块
  302. }).use(['index', 'form', 'set', 'layedit', 'laydate', 'upload', 'inputTags', 'layarea'], function() {
  303. var $ = layui.$,
  304. setter = layui.setter,
  305. admin = layui.admin,
  306. layedit = layui.layedit,
  307. laydate = layui.laydate,
  308. form = layui.form,
  309. inputTags = layui.inputTags,
  310. upload = layui.upload,
  311. layarea = layui.layarea;
  312. var video_time;
  313. form.render();
  314. inputTags.render({
  315. elem: '#inputTags',
  316. content: {:json_encode($comjobs.tags)} == null ? [] : {:json_encode($comjobs.tags)},
  317. aldaBtn: true,
  318. count: 6,
  319. done: function(value) {}
  320. });
  321. layarea.render({
  322. elem: '#LAY-comjobs-comjobsform-edit-areapicker',
  323. data: {
  324. province: '福建省',
  325. city: '福州市',
  326. district: '马尾区',
  327. }
  328. });
  329. laydate.render({
  330. elem: '#enddate',
  331. type: 'date',
  332. format: 'yyyy-MM-dd'
  333. });
  334. laydate.render({
  335. elem: '#updatetime',
  336. type: 'datetime'
  337. });
  338. laydate.render({
  339. elem: '#createtime',
  340. type: 'datetime'
  341. });
  342. upload.render({
  343. elem: '#add_video'
  344. ,url: setter.baseWorkerUrl + 'comjobs/upload_video' //改成您自己的上传接口
  345. ,accept: 'video' //视频
  346. ,done: function(res){
  347. var src = res.data.src;
  348. sourceDom = $("<source src=\""+ src +"\">");
  349. // $("#video-box video").append(sourceDom);
  350. document.getElementById("videoid").src=src ;
  351. document.getElementById("videoid").play();
  352. var timer = setTimeout(function(){
  353. video_time = document.getElementById("videoid").duration;//视频时长
  354. if(Math.ceil(video_time) > 15){
  355. layer.msg('上传视频不能超过15秒', {icon: 2});
  356. $("#add_video").css('cssText','background-color:#e81313');
  357. }else{
  358. layer.msg('上传成功');
  359. $("#add_video").css('cssText','background-color:#009688');
  360. $("#new_video").val(src);
  361. }
  362. clearTimeout(timer);
  363. },1000);
  364. }
  365. });
  366. var map = new AMap.Map('maplocation', {
  367. center:[119.4556,25.98939],//地图中心位置
  368. zoom: 12,
  369. });
  370. $('#layuiadmin-map-lnglat').on('click', function() {
  371. var index = layer.open({
  372. type: 1,
  373. title: '点击获取地址坐标',
  374. area: ['500px', '550px'],
  375. content: $('#maplocation'),
  376. success: function() {
  377. //var map = new AMap.Map("maplocation", { resizeEnable: true });
  378. map.on('click', function(e) {
  379. $('input[name="longitude"]').val(e.lnglat.getLng());
  380. $('input[name="latitude"]').val(e.lnglat.getLat());
  381. layer.close(index);
  382. });
  383. }
  384. });
  385. });
  386. var auto = new AMap.Autocomplete({ input: "pickerInput" });
  387. var placeSearch = new AMap.PlaceSearch({ map: map });
  388. window.select = function (e) {
  389. console.log(e);
  390. placeSearch.setCity(e.poi.adcode);
  391. placeSearch.search(e.poi.name);
  392. };
  393. AMap.event.addListener(auto, "select", select);
  394. form.on('submit(LAY-comjobs-comjobsform-edit-submit)', function(obj) {
  395. if(video_time)
  396. {
  397. if(Math.ceil(video_time) >15)
  398. {
  399. layer.msg('视频不能超过15秒');
  400. return false;
  401. }
  402. }
  403. var index = parent.layer.getFrameIndex(window.name);
  404. admin.req({
  405. url: setter.baseAdminUrl + 'comjobs/editcomjobs',
  406. data: obj.field,
  407. type: 'post',
  408. done: function(res) {
  409. layer.msg("提交成功", {
  410. icon: 1
  411. });
  412. parent.layui.table.reload('LAY-comjobs-comjobslist-table'); //重载表格
  413. parent.layer.close(index);
  414. }
  415. });
  416. });
  417. $('.echo-attachment-image-list').on('click', '.attachmentdel', function() {
  418. $(this).parent().remove();
  419. });
  420. upload.render({
  421. elem: '.attachment-upload-images',
  422. url: setter.baseAdminUrl + 'attachment/tplfieldimage',
  423. accept: 'images',
  424. exits: 'jpg|png|jpeg',
  425. acceptMime: 'image/*',
  426. size: 2048,
  427. number: 1,
  428. method: 'post',
  429. before: function(obj) {
  430. var item = this.item;
  431. upload_input = $(item).data('input');
  432. upload_amount = $(item).data('amount');
  433. layer.load();
  434. },
  435. done: function(res, index, upload) {
  436. layer.closeAll('loading');
  437. var html = "";
  438. if (upload_amount == 1) {
  439. html += '<div> <input type="hidden" name="' + upload_input + '" value="' + res.data.src + '"> ';
  440. html += '<img src="' + res.data.src + '"></div>';
  441. $("#" + upload_input).html(html);
  442. } else {
  443. html += '<div> <input type="hidden" name="' + upload_input + '[]" value="' + res.data.src + '"> ';
  444. html += '<img src="' + res.data.src +
  445. '"> <button type="button" class="attachmentdel layui-btn layui-btn-primary layui-btn-xs layui-btn-fluid">删除</button></div>';
  446. $("#" + upload_input).append(html);
  447. }
  448. },
  449. error: function(index, upload) {
  450. layer.closeAll('loading');
  451. }
  452. });
  453. });
  454. </script>