edit.html 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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><input type="text" name="project_number" value="{$detail.project_number}" autocomplete="off"
  10. placeholder="请输入项目编号" class="layui-input" readonly></td>
  11. <td class="layui-td-gray-2">项目名称</td>
  12. <td><input type="text" name="project_name" value="{$detail.project_name}" autocomplete="off"
  13. placeholder="请输入项目名称" class="layui-input" readonly></td>
  14. <td class="layui-td-gray-2">送审单位</td>
  15. <td>
  16. <input type="text" name="commissioning_name" autocomplete="off" readonly value="{$institution}"
  17. lay-verify="required" lay-reqText="请输入送审单位" placeholder="请输入送审单位"
  18. class="layui-input customer-picker">
  19. <input type="hidden" name="commissioning_unit" value="{$detail.commissioning_unit}">
  20. </td>
  21. </tr>
  22. <tr>
  23. <td class="layui-td-gray-2">送审单位联系人</td>
  24. <td>
  25. <select name="commissioning_unit_contact" lay-verify="" lay-reqText="请选择送审单位联系人" >
  26. <option value="">请选择送审单位联系人</option>
  27. {volist name="person" id="v"}
  28. <option value="{$v.id}"{eq name="$detail.commissioning_unit_contact" value="$v.id" } selected="" {/eq}>{$v.nickname}</option>
  29. {/volist}
  30. </select>
  31. </td>
  32. <td class="layui-td-gray-2">送审单位联系人电话</td>
  33. <td><input type="text" name="commissioning_unit_contact_number"
  34. value="{$detail.commissioning_unit_contact_number}"
  35. autocomplete="off" placeholder="请输入送审单位联系人电话" class="layui-input"></td>
  36. <td class="layui-td-gray-2">送审单位作业人<font>*</font></td>
  37. <td>
  38. <select name="commissioning_unit_worker" lay-verify="required" lay-reqText="请选择审批人" >
  39. <option value="">请选择作业人</option>
  40. {volist name="person" id="v"}
  41. <option value="{$v.id}"{eq name="$detail.commissioning_unit_worker" value="$v.id" } selected="" {/eq}>{$v.nickname}</option>
  42. {/volist}
  43. </select>
  44. </td>
  45. </tr>
  46. <tr>
  47. <td class="layui-td-gray-2">送审单位作业人电话</td>
  48. <td><input type="text" name="commissioning_unit_contact_number"
  49. value="{$detail.commissioning_unit_contact_number}"
  50. autocomplete="off" placeholder="请输入送审单位作业人联系电话" class="layui-input"></td>
  51. <td class="layui-td-gray-2">计划时间<font>*</font></td>
  52. <td><input type="text" name="plan_time" lay-verify="required" lay-reqText="请完善计划时间"
  53. value="{$detail.plan_time|time_format=###,'Y-m-d'}" readonly readonly
  54. autocomplete="off" placeholder="请选择" class="layui-input"></td>
  55. <td class="layui-td-gray-2">截至时间<font>*</font></td>
  56. <td><input type="text" name="due_time" lay-verify="required" lay-reqText="请完善截至时间"
  57. value="{$detail.due_time|time_format=###,'Y-m-d'}" readonly readonly
  58. autocomplete="off" placeholder="请选择" class="layui-input"></td>
  59. <td colspan='4'></td>
  60. </tr>
  61. </table>
  62. <div class="py-3">
  63. <input type="hidden" name="id" value="{$detail.id}"/>
  64. {if $detail.status == 3}
  65. <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="edit">接收</button>
  66. {/if}
  67. {if $detail.status == 4}
  68. <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="edit">编辑</button>
  69. {/if}
  70. {if !($detail.status == 5)}
  71. <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">下发项目</button>
  72. {/if}
  73. </div>
  74. </form>
  75. {/block}
  76. <!-- /主体 -->
  77. <!-- 脚本 -->
  78. {block name="script"}
  79. <script>
  80. var moduleInit = ['tool'];
  81. function gouguInit() {
  82. var form = layui.form, tool = layui.tool;
  83. //日期选择
  84. layui.laydate.render({
  85. elem: '#laydate_plan_time' //指定元素
  86. });//日期选择
  87. layui.laydate.render({
  88. elem: '#laydate_due_time' //指定元素
  89. });
  90. let a = 1;
  91. //监听提交
  92. form.on('submit(edit)', function (data) {
  93. if(a){
  94. let callback = function (e) {
  95. layer.msg(e.msg);
  96. if (e.code == 0) {
  97. tool.sideClose(1000);
  98. a = 1
  99. }
  100. }
  101. tool.post("/admin/project.audit_company/edit", data.field, callback);
  102. }
  103. a = 0
  104. return false;
  105. });
  106. form.on('submit(webform)', function (data) {
  107. if(a){
  108. let callback = function (e) {
  109. layer.msg(e.msg);
  110. if (e.code == 0) {
  111. tool.sideClose(1000);
  112. a = 1
  113. }
  114. }
  115. tool.post("/admin/project.audit_company/webform", data.field, callback);
  116. }
  117. a = 0
  118. return false;
  119. });
  120. }
  121. </script>
  122. {/block}
  123. <!-- /脚本 -->