edit.html 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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">项目名称<font>*</font></td>
  9. <td>
  10. <input type="text" name="project_name" lay-verify="required" readonly lay-reqText="请完善项目名称" value="{$detail.project_name}" autocomplete="off" placeholder="请输入项目名称" class="layui-input">
  11. </td>
  12. <td class="layui-td-gray-2">项目编号<font>*</font></td>
  13. <td>
  14. <input type="text" name="project_num" lay-verify="required" readonly lay-reqText="请完善项目编号" value="{$detail.project_num}" autocomplete="off" placeholder="请输入项目编号" class="layui-input">
  15. </td>
  16. <td class="layui-td-gray-2">项目周期<font>*</font></td>
  17. <td id="date">
  18. <div class="layui-input-inline">
  19. <input type="text" id="start_time" name="project_start_time" readonly lay-verify="required" lay-reqText="请选择开始时间" placeholder="请选择" class="layui-input" value="{$detail.project_start_time|date='Y-m-d'}">
  20. </div>
  21. -
  22. <div class="layui-input-inline">
  23. <input type="text" id="end_time" name="project_end_time" readonly lay-verify="required" lay-reqText="请选择结束时间" placeholder="请选择" class="layui-input" value="{$detail.project_end_time|date='Y-m-d'}">
  24. </div>
  25. </td>
  26. </td>
  27. </tr>
  28. <tr>
  29. <td class="layui-td-gray-2">评审单位<font>*</font></td>
  30. <td>
  31. <input type="text" name="review_unit_name" autocomplete="off" readonly value="{$review_unit_name}" lay-verify="required" lay-reqText="请输入评审单位" placeholder="请输入评审单位" class="layui-input customer-picker">
  32. <input type="hidden" name="review_unit" value="{$detail.review_unit}">
  33. </td>
  34. <td class="layui-td-gray-2">评审单位联系人</td>
  35. <td><input type="text" name="review_head" value="{$detail.review_head}" autocomplete="off"
  36. placeholder="请输入评审单位联系人" class="layui-input"></td>
  37. <td class="layui-td-gray-2">评审单位联系人电话</td>
  38. <td><input type="text" name="review_head_phone" value="{$detail.review_head_phone}"
  39. autocomplete="off" placeholder="请输入评审单位联系人电话" class="layui-input"></td>
  40. </tr>
  41. </table>
  42. <div class="py-3">
  43. <input type="hidden" name="id" value="{$detail.id}"/>
  44. <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">通过</button>
  45. <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="overrule">驳回</button>
  46. </div>
  47. </form>
  48. {/block}
  49. <!-- /主体 -->
  50. <!-- 脚本 -->
  51. {block name="script"}
  52. <script>
  53. var moduleInit = ['tool'];
  54. function gouguInit() {
  55. var form = layui.form, tool = layui.tool;
  56. //日期选择
  57. layui.laydate.render({
  58. elem: '#date',
  59. range: ['#start_time', '#end_time'],
  60. rangeLinked:true
  61. });
  62. let a = 1;
  63. //监听提交
  64. form.on('submit(webform)', function (data) {
  65. if(a){
  66. let callback = function (e) {
  67. layer.msg(e.msg);
  68. if (e.code == 0) {
  69. tool.sideClose(1000);
  70. a = 1
  71. }
  72. }
  73. tool.post("/admin/project.audit/edit", data.field, callback);
  74. }
  75. a = 0
  76. return false;
  77. });
  78. form.on('submit(overrule)', function (data) {
  79. if(a){
  80. let callback = function (e) {
  81. layer.msg(e.msg);
  82. if (e.code == 0) {
  83. tool.sideClose(1000);
  84. a = 1
  85. }
  86. }
  87. tool.post("/admin/project.audit/overrule", data.field, callback);
  88. }
  89. a = 0
  90. return false;
  91. });
  92. }
  93. </script>
  94. {/block}
  95. <!-- /脚本 -->