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">作业负责人<font>*</font></td>
  30. <td>
  31. <input type="text" name="operate_name" placeholder="请选择项目负责人" readonly class="layui-input picker-one" value="{$operate_name}">
  32. <input type="hidden" name="operate_head" lay-verify="required" readonly lay-reqText="请选择项目负责人" value="{$detail.operate_head}">
  33. </td>
  34. <td class="layui-td-gray">作业成员<span style="color: red">*</span></td>
  35. <td colspan="3">
  36. <input type="text" id="team_admin_names" name="operate_team_names" placeholder="请选择项目成员" readonly class="layui-input picker-more" value="{$operate_team_names}">
  37. <input type="hidden" id="team_admin_ids" name="operate_team" class="layui-input" value="{$detail.operate_team}">
  38. </td>
  39. </tr>
  40. </table>
  41. <div class="py-3">
  42. <input type="hidden" name="id" value="{$detail.id}"/>
  43. <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">保存</button>
  44. <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="pass">分配</button>
  45. </div>
  46. </form>
  47. {/block}
  48. <!-- /主体 -->
  49. <!-- 脚本 -->
  50. {block name="script"}
  51. <script>
  52. var moduleInit = ['tool','employeepicker'];
  53. function gouguInit() {
  54. var form = layui.form, tool = layui.tool,employeepicker = layui.employeepicker;
  55. //日期选择
  56. layui.laydate.render({
  57. elem: '#laydate_plan_time' //指定元素
  58. });//日期选择
  59. layui.laydate.render({
  60. elem: '#laydate_due_time' //指定元素
  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.received/edit", data.field, callback);
  74. }
  75. a = 0
  76. return false;
  77. });
  78. form.on('submit(pass)', 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.received/pass", data.field, callback);
  88. }
  89. a = 0
  90. return false;
  91. });
  92. }
  93. </script>
  94. {/block}
  95. <!-- /脚本 -->