worderform.html 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  1. <div class="layui-fluid">
  2. <div class="layui-row layui-col-space15">
  3. <div class="layui-col-md12">
  4. <div class="layui-card">
  5. <div class="layui-card-header">订单信息</div>
  6. <div class="layui-card-body" pad15>
  7. <div class="layui-form layui-form-pane" lay-filter="LAY-worder-worderform-edit">
  8. <input type="hidden" name="id" value="{$worder.id}">
  9. <div class="layui-form-item">
  10. <label class="layui-form-label">分类</label>
  11. <div class="layui-input-block">
  12. <select name="cateid">
  13. {volist name="catelist" id="vo"}
  14. <option value="{$vo.id}" {$worder.cateid==$vo.id ? 'selected' : '' }>{$vo.title}</option>
  15. {/volist}
  16. </select>
  17. </div>
  18. </div>
  19. <div class="layui-form-item">
  20. <label class="layui-form-label"><span style="color:#f90c05;">*</span>劳务公司</label>
  21. <div class="layui-input-block">
  22. <select name="workerid" lay-search lay-verify="required">
  23. <option value="">请选择劳务公司(可搜索)...</option>
  24. {volist name="workerlist" id="vo"}
  25. <option value="{$vo.id}" {$worder.workerid==$vo.id ? 'selected' : '' }>{$vo.title}</option>
  26. {/volist}
  27. </select>
  28. </div>
  29. </div>
  30. <div class="layui-form-item">
  31. <label class="layui-form-label"><span style="color:#f90c05;">*</span>标题</label>
  32. <div class="layui-input-block">
  33. <input type="text" name="title" value="{$worder.title}" lay-verify="required" placeholder="请输入..."
  34. autocomplete="off" class="layui-input">
  35. </div>
  36. </div>
  37. <div class="layui-form-item">
  38. <label class="layui-form-label">标签</label>
  39. <div class="layui-input-block">
  40. <div class="tags" id="tags">
  41. <input type="text" name="" id="inputTags" placeholder="回车生成标签" autocomplete="off">
  42. </div>
  43. </div>
  44. </div>
  45. <div class="layui-form-item">
  46. <label class="layui-form-label">返佣政策</label>
  47. <div class="layui-input-block">
  48. <input type="text" name="otype" value="{$worder.otype}" placeholder="请输入...." autocomplete="off" class="layui-input">
  49. </div>
  50. </div>
  51. <div class="layui-form-item">
  52. <label class="layui-form-label"><span style="color:#f90c05;">*</span>返佣价格</label>
  53. <div class="layui-input-block">
  54. <input type="text" name="wagall" value="{$worder.wagall}" lay-verify="required" placeholder="请输入...."
  55. autocomplete="off" class="layui-input">
  56. </div>
  57. </div>
  58. <div class="layui-form-item">
  59. <label class="layui-form-label">咨询电话</label>
  60. <div class="layui-input-block">
  61. <input type="text" name="telephone" value="{$worder.telephone}" placeholder="请输入..." autocomplete="off" class="layui-input">
  62. </div>
  63. </div>
  64. <div class="layui-form-item" id="LAY-worder-worderform-edit-areapicker">
  65. <label class="layui-form-label"><span style="color:#f90c05;">*</span>省市区</label>
  66. <div class="layui-input-inline">
  67. <select name="province" class="province-selector" data-value="{$worder.province}" lay-filter="province-2"
  68. lay-verify="required">
  69. <option value="">请选择省</option>
  70. </select>
  71. </div>
  72. <div class="layui-input-inline">
  73. <select name="city" class="city-selector" data-value="{$worder.city}" lay-filter="city-2" lay-verify="required">
  74. <option value="">请选择市</option>
  75. </select>
  76. </div>
  77. <div class="layui-input-inline">
  78. <select name="district" class="district-selector" data-value="{$worder.district}" lay-filter="district-2"
  79. lay-verify="required">
  80. <option value="">请选择区</option>
  81. </select>
  82. </div>
  83. </div>
  84. <div class="layui-form-item">
  85. <label class="layui-form-label">岗位介绍</label>
  86. <div class="layui-input-block">
  87. <textarea class="layui-textarea" name="jobdetails" id="jobdetails" placeholder="请输入..." style="display: none" lay-verify="editcontent">
  88. {$worder.jobdetails}
  89. </textarea>
  90. </div>
  91. </div>
  92. <div class="layui-form-item">
  93. <label class="layui-form-label">合作详情</label>
  94. <div class="layui-input-block">
  95. <textarea class="layui-textarea" name="coodetails" id="coodetails" placeholder="请输入..." style="display: none"
  96. lay-verify="editcontent">
  97. {$worder.coodetails}
  98. </textarea>
  99. </div>
  100. </div>
  101. <div class="layui-form-item">
  102. <label class="layui-form-label">排序</label>
  103. <div class="layui-input-block">
  104. <input type="text" name="priority" value="{$worder.priority|default=0}" lay-verify="number" placeholder="请输入排序,倒序值越大越靠前。"
  105. autocomplete="off" class="layui-input">
  106. </div>
  107. </div>
  108. <div class="layui-form-item" pane>
  109. <label class="layui-form-label">状态</label>
  110. <div class="layui-input-block">
  111. <input type="radio" name="status" value="1" title="待修改" {eq name="worder.status|default=1" value="1"}checked{/eq}>
  112. <input type="radio" name="status" value="2" title="待审核" {eq name="worder.status" value="2"}checked{/eq}>
  113. <input type="radio" name="status" value="3" title="未通过" {eq name="worder.status" value="3"}checked{/eq}>
  114. <input type="radio" name="status" value="4" title="已上架" {eq name="worder.status" value="4"}checked{/eq}>
  115. <input type="radio" name="status" value="5" title="已下架" {eq name="worder.status" value="5"}checked{/eq}>
  116. </div>
  117. </div>
  118. <div class="layui-form-item">
  119. <label class="layui-form-label"><span style="color:#f90c05;">*</span>更新时间</label>
  120. <div class="layui-input-block">
  121. <input type="text" name="updatetime" id="updatetime" value="{$worder.updatetime}" lay-verify="required"
  122. placeholder="请选择..." autocomplete="off" class="layui-input">
  123. </div>
  124. </div>
  125. <div class="layui-form-item">
  126. <label class="layui-form-label"><span style="color:#f90c05;">*</span>创建时间</label>
  127. <div class="layui-input-block">
  128. <input type="text" name="createtime" id="createtime" value="{$worder.createtime}" lay-verify="required"
  129. placeholder="请选择..." autocomplete="off" class="layui-input">
  130. </div>
  131. </div>
  132. <div class="layui-form-item">
  133. <label class="layui-form-label">浏览量</label>
  134. <div class="layui-input-block">
  135. <input type="text" name="volume" value="{$worder.volume|default=0}" lay-verify="number" placeholder="请输入..."
  136. autocomplete="off" class="layui-input">
  137. </div>
  138. </div>
  139. <div class="layui-form-item">
  140. <div class="layui-input-block">
  141. <input type="button" lay-submit lay-filter="LAY-worder-worderform-edit-submit" value="确认提交" class="layui-btn">
  142. </div>
  143. </div>
  144. </div>
  145. </div>
  146. </div>
  147. </div>
  148. </div>
  149. </div>
  150. <script>
  151. layui.config({
  152. base: '/static/echoui/' //静态资源所在路径
  153. }).extend({
  154. index: 'lib/index' //主入口模块
  155. }).use(['index', 'form', 'set', 'layedit', 'laydate', 'upload', 'inputTags', 'layarea'], function() {
  156. var $ = layui.$,
  157. setter = layui.setter,
  158. admin = layui.admin,
  159. layedit = layui.layedit,
  160. laydate = layui.laydate,
  161. form = layui.form,
  162. inputTags = layui.inputTags,
  163. upload = layui.upload,
  164. layarea = layui.layarea;
  165. form.render();
  166. inputTags.render({
  167. elem: '#inputTags',
  168. content: {:json_encode($worder.tags)} == null ? [] : {:json_encode($worder.tags)},
  169. aldaBtn: true,
  170. count: 6,
  171. done: function(value) {}
  172. });
  173. laydate.render({
  174. elem: '#updatetime',
  175. type: 'datetime'
  176. });
  177. laydate.render({
  178. elem: '#createtime',
  179. type: 'datetime'
  180. });
  181. layarea.render({
  182. elem: '#LAY-worder-worderform-edit-areapicker',
  183. data: {
  184. province: '福建省',
  185. city: '福州市',
  186. district: '马尾区',
  187. }
  188. });
  189. var jobdetails = layedit.build('jobdetails', {
  190. uploadImage: { url: setter.baseAdminUrl + 'attachment/tplfieldimage', type: 'post' }
  191. });
  192. var coodetails = layedit.build('coodetails', {
  193. uploadImage: { url: setter.baseAdminUrl + 'attachment/tplfieldimage', type: 'post' }
  194. });
  195. form.verify({
  196. editcontent: function(value) {
  197. layedit.sync(jobdetails);
  198. layedit.sync(coodetails);
  199. }
  200. });
  201. form.on('submit(LAY-worder-worderform-edit-submit)', function(obj) {
  202. var index = parent.layer.getFrameIndex(window.name);
  203. admin.req({
  204. url: setter.baseAdminUrl + 'worder/editworder',
  205. data: obj.field,
  206. type: 'post',
  207. done: function(res) {
  208. layer.msg("提交成功", {
  209. icon: 1
  210. });
  211. parent.layui.table.reload('LAY-worder-worderlist-table'); //重载表格
  212. parent.layer.close(index);
  213. }
  214. });
  215. });
  216. $('.echo-attachment-image-list').on('click', '.attachmentdel', function() {
  217. $(this).parent().remove();
  218. });
  219. upload.render({
  220. elem: '.attachment-upload-images',
  221. url: setter.baseAdminUrl + 'attachment/tplfieldimage',
  222. accept: 'images',
  223. exits: 'jpg|png|jpeg',
  224. acceptMime: 'image/*',
  225. size: 2048,
  226. number: 1,
  227. method: 'post',
  228. before: function(obj) {
  229. var item = this.item;
  230. upload_input = $(item).data('input');
  231. upload_amount = $(item).data('amount');
  232. layer.load();
  233. },
  234. done: function(res, index, upload) {
  235. layer.closeAll('loading');
  236. var html = "";
  237. if (upload_amount == 1) {
  238. html += '<div> <input type="hidden" name="' + upload_input + '" value="' + res.data.src + '"> ';
  239. html += '<img src="' + res.data.src + '"></div>';
  240. $("#" + upload_input).html(html);
  241. } else {
  242. html += '<div> <input type="hidden" name="' + upload_input + '[]" value="' + res.data.src + '"> ';
  243. html += '<img src="' + res.data.src +
  244. '"> <button type="button" class="attachmentdel layui-btn layui-btn-primary layui-btn-xs layui-btn-fluid">删除</button></div>';
  245. $("#" + upload_input).append(html);
  246. }
  247. },
  248. error: function(index, upload) {
  249. layer.closeAll('loading');
  250. }
  251. });
  252. });
  253. </script>