add_sent_review_unit.html 3.3 KB

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