add_construction_people.html 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. {extend name="common/base"/}
  2. <!-- 主体 -->
  3. {block name="body"}
  4. <form class="layui-form p-4">
  5. <div style="display:flex;align-items: baseline;">
  6. <h3 class="pb-3">添加施工单位</h3>
  7. <p style="padding-left:3vw;">
  8. 提醒<font style="color: red !important;">*</font>:仅限本单位用户可查看此联系信息(非公开)
  9. </p>
  10. </div>
  11. <table class="layui-table layui-table-form">
  12. <tr>
  13. <td class="layui-td-gray-2">施工单位</td>
  14. <td>
  15. <input type="text" name="construction_unit" value="" autocomplete="off" placeholder="施工单位"
  16. class="layui-input">
  17. </td>
  18. <td class="layui-td-gray-2">施工单位负责人</td>
  19. <td>
  20. <input type="text" name="construction_head" value="" autocomplete="off" placeholder="施工单位负责人"
  21. class="layui-input">
  22. </td>
  23. </tr>
  24. <tr>
  25. <td class="layui-td-gray-2">施工单位负责人电话</td>
  26. <td>
  27. <input type="text" name="construction_phone" value="" autocomplete="off"
  28. placeholder="施工单位负责人电话"
  29. class="layui-input">
  30. </td>
  31. <td class="layui-td-gray-2">施工单位负责人邮箱</td>
  32. <td>
  33. <input type="text" name="construction_email" value="" autocomplete="off"
  34. placeholder="施工单位负责人邮箱" class="layui-input">
  35. </td>
  36. </tr>
  37. </table>
  38. <div class="pt-3">
  39. <input type="hidden" name="id" value="{$project_id}"/>
  40. <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
  41. <button type="reset" class="layui-btn layui-btn-primary">重置</button>
  42. </div>
  43. </form>
  44. {/block}
  45. <!-- /主体 -->
  46. <!-- 脚本 -->
  47. {block name="script"}
  48. <script>
  49. const moduleInit = ['tool', 'tagpicker', 'tinymce', 'oaTool'];
  50. function gouguInit() {
  51. var form = layui.form, tool = layui.tool, oaTool = layui.oaTool;
  52. let b = 1;
  53. //监听提交
  54. form.on('submit(webform)', function (data) {
  55. if(b){
  56. let calling = function (e) {
  57. if (e.code == 0) {
  58. layer.confirm('已经存在施工单位人员,是否替换?', {
  59. btn: ['确定', '取消'] //按钮
  60. }, function () {
  61. tool.post("/admin/project.cost/addconstructionpeople", {data: data.field , type : 2 }, callback);
  62. }, function () {
  63. });
  64. } else if(e.code == 200) {
  65. tool.post("/admin/project.cost/addconstructionpeople",{'data': data.field , 'type' :2 }, callback);
  66. }
  67. }
  68. let callback = function (e) {
  69. layer.msg(e.msg);
  70. parent.layui.userTable.reload();
  71. if (e.code == 0) {
  72. tool.tabRefresh(71);
  73. tool.sideClose(1000);
  74. b = 1
  75. }
  76. }
  77. tool.post("/admin/project.cost/addconstructionpeople", {data:data.field , type : 1 }, calling);
  78. }
  79. b = 0
  80. return false;
  81. });
  82. }
  83. </script>
  84. {/block}
  85. <!-- /脚本 -->