form.html 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  1. {extend name="../../admin/view/main"}
  2. {block name='content'}
  3. <form action="" class="layui-card layui-form" data-auto="true" method="post">
  4. <div class="layui-card-body">
  5. <input class="layui-input" type="hidden" name="type" required value='2'>
  6. <label class="layui-form-item relative block">
  7. <span class="help-label"><b>岗位名称</b></span>
  8. <input class="layui-input" name="title" placeholder="请输入岗位名称" required value='{$vo.title|default=""}'>
  9. </label>
  10. <label class="layui-form-item relative block">
  11. <span class="help-label"><b>需要人数</b></span>
  12. <input class="layui-input" name="number_person" placeholder="请输入人数" required value='{$vo.number_person|default=""}'>
  13. </label>
  14. <label class="layui-form-item relative block">
  15. <span class="help-label"><b>年龄</b></span>
  16. <input class="layui-input" name="age" placeholder="请输入年龄" required value='{$vo.age|default=""}'>
  17. </label>
  18. <label class="layui-form-item relative block">
  19. <span class="help-label"><b>性别</b></span>
  20. <select name="sex">
  21. <option value="男" {:isset($vo['sex']) && $vo['sex']=='男'?'selected':''}>男</option>
  22. <option value="女" {:isset($vo['sex']) && $vo['sex']=='女'?'selected':''}>女</option>
  23. <option value="不限" {:isset($vo['sex']) && $vo['sex']=='不限'?'selected':''}>不限</option>
  24. </select>
  25. </label>
  26. <label class="layui-form-item relative block">
  27. <span class="help-label"><b>学历</b></span>
  28. <select name="schooling">
  29. <option value="不限" {:isset($vo['schooling']) && $vo['schooling']=='不限'?'selected':''}>不限</option>
  30. <option value="初中及以下" {:isset($vo['schooling']) && $vo['schooling']=='初中及以下'?'selected':''}>初中及以下</option>
  31. <option value="中专/中技" {:isset($vo['schooling']) && $vo['schooling']=='中专/中技'?'selected':''}>中专/中技</option>
  32. <option value="高中" {:isset($vo['schooling']) && $vo['schooling']=='高中'?'selected':''}>高中</option>
  33. <option value="大专" {:isset($vo['schooling']) && $vo['schooling']=='大专'?'selected':''}>大专</option>
  34. <option value="本科" {:isset($vo['schooling']) && $vo['schooling']=='本科'?'selected':''}>本科</option>
  35. <option value="硕士" {:isset($vo['schooling']) && $vo['schooling']=='硕士'?'selected':''}>硕士</option>
  36. <option value="博士" {:isset($vo['schooling']) && $vo['schooling']=='博士'?'selected':''}>博士</option>
  37. </select>
  38. <!-- <input class="layui-input" name="schooling" placeholder="请输入学历" required value='{$vo.schooling|default=""}'>-->
  39. </label>
  40. <div class="layui-col-xs12 relative block">
  41. <span class="color-green font-w7 label-required-prev">地址</span>
  42. <span class="color-desc margin-left-5">(原区域:{$vo.province|default='--'} - {$vo.city|default=''} - {$vo.area|default=''} )</span>
  43. <div class="layui-row layui-col-space10">
  44. <label class="layui-col-xs4"><select class="layui-select" lay-filter="province" name="province"></select></label>
  45. <label class="layui-col-xs4"><select class="layui-select" lay-filter="city" name="city"></select></label>
  46. <label class="layui-col-xs4"><select class="layui-select" lay-filter="area" name="area"></select></label>
  47. </div>
  48. </div>
  49. <label class="layui-form-item relative block">
  50. <span class="help-label"><b>详细地址</b></span>
  51. <input class="layui-input" name="address" placeholder="请输入详细地址" required value='{$vo.address|default=""}'>
  52. </label>
  53. <label class="layui-form-item relative block">
  54. <span class="help-label"><b>经验</b></span>
  55. <input class="layui-input" name="experience" placeholder="请输入经验" value='{$vo.experience|default=""}'>
  56. </label>
  57. <label class="layui-form-item relative block">
  58. <span class="help-label"><b>用工时长</b></span>
  59. <input class="layui-input" name="working_time" placeholder="请输入用工时长" required value='{$vo.working_time|default=""}'>
  60. </label>
  61. <label class="layui-form-item relative block">
  62. <span class="help-label"><b>工作性质</b></span>
  63. <select name="work_nature">
  64. <option value="全职" {:isset($vo['work_nature']) && $vo['work_nature']=='全职'?'selected':''}>全职</option>
  65. <option value="兼职" {:isset($vo['work_nature']) && $vo['work_nature']=='兼职'?'selected':''}>兼职</option>
  66. </select>
  67. </label>
  68. <label class="layui-form-item relative block">
  69. <span class="help-label"><b>必备技能</b></span>
  70. <input class="layui-input" name="necessary_skills" placeholder="请输入必备技能" value='{$vo.necessary_skills|default=""}'>
  71. </label>
  72. <label class="layui-form-item relative block">
  73. <span class="help-label"><b>证书</b></span>
  74. <input class="layui-input" name="certificate" placeholder="请输入" value='{$vo.certificate|default=""}'>
  75. </label>
  76. <label class="layui-form-item relative block">
  77. <span class="help-label"><b>备注</b></span>
  78. <input class="layui-input" name="remark" placeholder="请输入备注" value='{$vo.remark|default=""}'>
  79. </label>
  80. <label class="layui-form-item relative block">
  81. <span class="help-label"><b>联系人姓名</b></span>
  82. <input class="layui-input" name="contact_person" placeholder="请输入联系人姓名" required value='{$vo.contact_person|default=""}'>
  83. </label>
  84. <div class="layui-form-item">
  85. <span class="help-label"><b>联系人头像</b></span>
  86. <table class="layui-table">
  87. <thead>
  88. <tr>
  89. </tr>
  90. <tr>
  91. <td class="text-left padding-0">
  92. <div class="help-images">
  93. <input name="contact_headimg" data-max-width="2048" data-max-height="1024" type="hidden" value="{$vo.contact_headimg|default=''}">
  94. <script>$('[name="contact_headimg"]').uploadOneImage();</script>
  95. </div>
  96. </td>
  97. </tr>
  98. </thead>
  99. </table>
  100. </div>
  101. <label class="layui-form-item relative block">
  102. <span class="help-label"><b>联系人职位</b></span>
  103. <input class="layui-input" name="contact_position" placeholder="请输入联系人职位" value='{$vo.contact_position|default=""}'>
  104. </label>
  105. <label class="layui-form-item relative block">
  106. <span class="help-label"><b>联系人手机号</b></span>
  107. <input class="layui-input" name="contact_phone" placeholder="请输入联系人手机号" required value='{$vo.contact_phone|default=""}'>
  108. </label>
  109. <label class="layui-form-item relative block">
  110. <span class="help-label"><b>联系人邮箱</b></span>
  111. <input class="layui-input" name="contact_email" placeholder="请输入联系人邮箱" required value='{$vo.contact_email|default=""}'>
  112. </label>
  113. <label class="layui-form-item relative block">
  114. <span class="help-label"><b>薪资</b></span>
  115. <div class="layui-row layui-col-space10">
  116. <label class="layui-col-xs4"> <input type="number" class="layui-input" name="salary_start" placeholder="" required value='{$vo.salary_start|default=""}'></label>
  117. <label class="layui-col-xs4"><input type="number" class="layui-input" name="salary_end" placeholder="" required value='{$vo.salary_end|default=""}'></label>
  118. </div>
  119. </label>
  120. <label class="layui-form-item relative block">
  121. <span class="help-label"><b>福利待遇</b></span>
  122. <input class="layui-input" name="welfare_benefits" placeholder="请输入福利待遇" required value='{$vo.welfare_benefits|default=""}'>
  123. </label>
  124. <div class="hr-line-dashed"></div>
  125. {notempty name='vo.id'}<input name='id' type='hidden' value='{$vo.id}'>{/notempty}
  126. <div class="layui-form-item text-center">
  127. <button class="layui-btn" type="submit">保存数据</button>
  128. <button class="layui-btn layui-btn-danger" data-history-back data-confirm="确定要取消编辑吗?" type='button'>取消编辑</button>
  129. </div>
  130. </div>
  131. </form>
  132. <script>
  133. var vo = {:json_encode($vo)};
  134. var salary_end = vo['salary_end'];
  135. var salary_start = vo['salary_start'];
  136. console.log()
  137. if(typeof(salary_end) !== "number"){
  138. if(salary_end.charAt(salary_end.length - 1) === 'K'){
  139. console.log((salary_end.slice(0,salary_end.length - 1)) * 1000);
  140. $('[name="salary_end"]').attr('value', (salary_end.slice(0,salary_end.length - 1)) * 1000);
  141. };
  142. }
  143. if(typeof(salary_start) !== "number"){
  144. if(salary_start.charAt(salary_start.length - 1) === 'K'){
  145. console.log((salary_start.slice(0,salary_start.length - 1)) * 1000);
  146. $('[name="salary_start"]').attr('value', (salary_start.slice(0,salary_start.length - 1)) * 1000);
  147. };
  148. }
  149. </script>
  150. <script>
  151. require(['pcasunzips'], function () {
  152. (function (prov, city, area, refresh) {
  153. new PCAS("province", "city", "area", prov, city, area);
  154. refresh(), form.on('select(province)', refresh), form.on('select(city)', refresh), form.on('select(area)', refresh);
  155. })('{$vo.province|default=""}', '{$vo.city|default=""}', '{$vo.area|default=""}', function (data) {
  156. $('select:not([lay-ignore])').nextAll('div.layui-form-select').remove();
  157. data && data.elem && $(data.elem).trigger('change'), layui.form.render('select');
  158. });
  159. });
  160. $('[data-express-query]').on('click', function () {
  161. (function (code, number) {
  162. $.form.modal('{:url("shop.send/query")}', {code: code, number: number}, '快递追踪查询')
  163. })($('[data-truck-code]').val(), $('[data-truck-number]').val());
  164. });
  165. </script>
  166. <script>
  167. $('input[name="images"]').uploadMultipleImage();
  168. require(['ckeditor'], function () {
  169. window.createEditor('[name=content]', {height: 350})
  170. });
  171. layui.use(['upload', 'element', 'layer'], function() {
  172. var $ = layui.jquery
  173. , upload = layui.upload
  174. , element = layui.element
  175. , layer = layui.layer;
  176. upload.render({
  177. elem: '#test5'
  178. ,url: '' //此处配置你自己的上传接口即可
  179. ,accept: 'video' //视频
  180. ,done: function(res){
  181. layer.msg('上传成功');
  182. console.log(res)
  183. }
  184. });
  185. //演示多文件列表
  186. var uploadListIns = upload.render({
  187. elem: '#testList'
  188. ,elemList: $('#demoList') //列表元素对象
  189. ,url: 'https://httpbin.org/post' //此处用的是第三方的 http 请求演示,实际使用时改成您自己的上传接口即可。
  190. ,accept: 'file'
  191. ,multiple: true
  192. ,number: 3
  193. ,auto: false
  194. ,bindAction: '#testListAction'
  195. ,choose: function(obj){
  196. var that = this;
  197. var files = this.files = obj.pushFile(); //将每次选择的文件追加到文件队列
  198. //读取本地文件
  199. obj.preview(function(index, file, result){
  200. var tr = $(['<tr id="upload-'+ index +'">'
  201. ,'<td>'+ file.name +'</td>'
  202. ,'<td>'+ (file.size/1014).toFixed(1) +'kb</td>'
  203. ,'<td><div class="layui-progress" lay-filter="progress-demo-'+ index +'"><div class="layui-progress-bar" lay-percent=""></div></div></td>'
  204. ,'<td>'
  205. ,'<button class="layui-btn layui-btn-xs demo-reload layui-hide">重传</button>'
  206. ,'<button class="layui-btn layui-btn-xs layui-btn-danger demo-delete">删除</button>'
  207. ,'</td>'
  208. ,'</tr>'].join(''));
  209. //单个重传
  210. tr.find('.demo-reload').on('click', function(){
  211. obj.upload(index, file);
  212. });
  213. //删除
  214. tr.find('.demo-delete').on('click', function(){
  215. delete files[index]; //删除对应的文件
  216. tr.remove();
  217. uploadListIns.config.elem.next()[0].value = ''; //清空 input file 值,以免删除后出现同名文件不可选
  218. });
  219. that.elemList.append(tr);
  220. element.render('progress'); //渲染新加的进度条组件
  221. });
  222. }
  223. ,done: function(res, index, upload){ //成功的回调
  224. var that = this;
  225. //if(res.code == 0){ //上传成功
  226. var tr = that.elemList.find('tr#upload-'+ index)
  227. ,tds = tr.children();
  228. tds.eq(3).html(''); //清空操作
  229. delete this.files[index]; //删除文件队列已经上传成功的文件
  230. return;
  231. //}
  232. this.error(index, upload);
  233. }
  234. ,allDone: function(obj){ //多文件上传完毕后的状态回调
  235. console.log(obj)
  236. }
  237. ,error: function(index, upload){ //错误回调
  238. var that = this;
  239. var tr = that.elemList.find('tr#upload-'+ index)
  240. ,tds = tr.children();
  241. tds.eq(3).find('.demo-reload').removeClass('layui-hide'); //显示重传
  242. }
  243. ,progress: function(n, elem, e, index){ //注意:index 参数为 layui 2.6.6 新增
  244. element.progress('progress-demo-'+ index, n + '%'); //执行进度条。n 即为返回的进度百分比
  245. }
  246. });
  247. });
  248. </script>
  249. {/block}