edit_company.html 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. {extend name="common/base"/}
  2. {block name="style"}
  3. <style>
  4. .layui-layer-content {
  5. color: ;
  6. }
  7. .footer{
  8. display: none;
  9. }
  10. </style>
  11. {/block}
  12. {block name="body"}
  13. <form class="layui-form p-4">
  14. <h3 class="pb-3">新建文档</h3>
  15. <table class="layui-table layui-table-form">
  16. <tr>
  17. <td class="layui-td-gray">关联项目<font>*</font></td>
  18. <td>
  19. <input type="text" name="project_name" lay-verify="required" lay-reqText="" placeholder="请输入文档名称" class="layui-input" value="{$project.project_name}" readonly>
  20. <input type="hidden" name="project_id" lay-verify="required" lay-reqText="" placeholder="请输入文档名称" class="layui-input" value="{$project.id}" readonly>
  21. </td>
  22. </tr>
  23. <tr>
  24. <td class="layui-td-gray" style="vertical-align:top;">文档内容<font>*</font></td>
  25. <td colspan="5">
  26. <textarea name="content" placeholder="请输入内容" class="layui-textarea" id="container_content"
  27. style="border:0;padding:0">{$detail.content}</textarea>
  28. </td>
  29. </tr>
  30. </table>
  31. <div class="pt-3">
  32. <input type="hidden" name="id" value="{$detail.id}"/>
  33. <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
  34. <button type="reset" class="layui-btn layui-btn-primary">重置</button>
  35. </div>
  36. </form>
  37. {/block}
  38. <!-- /主体 -->
  39. <!-- 脚本 -->
  40. {block name="script"}
  41. <script>
  42. const moduleInit = ['tool', 'tagpicker', 'tinymce', 'oaTool'];
  43. function gouguInit() {
  44. var form = layui.form, tool = layui.tool, oaTool = layui.oaTool;
  45. //编辑器初始化
  46. var editor = layui.tinymce;
  47. var edit = editor.render({
  48. selector: "#container_content",
  49. height: 500
  50. });
  51. let a = 1;
  52. //监听提交
  53. form.on('submit(webform)', function (data) {
  54. data.field.content = tinyMCE.editors['container_content'].getContent();
  55. if (data.field.content == '') {
  56. layer.msg('请先完善文章内容');
  57. return false;
  58. }
  59. if(a){
  60. let callback = function (e) {
  61. parent.layui.recordTable.reload();
  62. layer.msg(e.msg);
  63. if (e.code == 0) {
  64. tool.tabRefresh(71);
  65. tool.sideClose(1000);
  66. a = 1
  67. }
  68. }
  69. tool.post("/admin/project.record/edit_company", data.field, callback);
  70. }
  71. a = 0
  72. return false;
  73. })
  74. }
  75. </script>
  76. {/block}