12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- {extend name="common/base"/}
- {block name="style"}
- <style>
- .layui-layer-content{color: #2d2d2d;}
- </style>
- {/block}
- {block name="body"}
- <form class="layui-form p-4">
- <h3 class="pb-3">新建文档</h3>
- <table class="layui-table layui-table-form">
- <tr>
- <td class="layui-td-gray">文档名称<font>*</font></td>
- <td>
- <input type="text" name="title" lay-verify="required" lay-reqText="请输入文档名称" placeholder="请输入文档名称" class="layui-input" value="{$detail.title}">
- </td>
- <td class="layui-td-gray">关联项目<font>*</font></td>
- <td>
- <select id="projectId" name="type" lay-verify="required">
- <option value="">请选择报告类型</option>
- <option value="0" {eq name="$detail.type" value="0"} selected {/eq}>初审报告</option>
- <option value="1" {eq name="$detail.type" value="1"} selected {/eq}>对数报告</option>
- <option value="2" {eq name="$detail.type" value="2"} selected {/eq}>审定报告</option>
- </select>
- </td>
- </tr>
- <tr>
- <td class="layui-td-gray" style="vertical-align:top;">文档内容<font>*</font></td>
- <td colspan="5">
- <textarea name="content" placeholder="请输入内容" class="layui-textarea" id="container_content" style="border:0;padding:0">{$detail.content}</textarea>
- </td>
- </tr>
- </table>
- <div class="pt-3">
- <input type="hidden" name="id" value="{$detail.id}" />
- <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
- <button type="reset" class="layui-btn layui-btn-primary">重置</button>
- </div>
- </form>
- {/block}
- <!-- /主体 -->
- <!-- 脚本 -->
- {block name="script"}
- <script>
- const moduleInit = ['tool', 'tagpicker', 'tinymce','oaTool'];
- function gouguInit() {
- var form = layui.form,tool=layui.tool,oaTool = layui.oaTool;
- //编辑器初始化
- var editor = layui.tinymce;
- var edit = editor.render({
- selector: "#container_content",
- height: 500
- });
- let a = 1;
- //监听提交
- form.on('submit(webform)', function (data) {
- layer.confirm('<div style="color:red">提交后内容将无法更改,请检查内容是否准确无误!<br>点击”确认“按钮,提交报告</div>', {
- icon: 3,
- title: '提交确认'
- },function () {
- data.field.content = tinyMCE.editors['container_content'].getContent();
- if (data.field.content == '') {
- layer.msg('请先完善文章内容');
- return false;
- }
- if(a){
- let callback = function (e) {
- parent.layui.reportTable.reload();
- layer.msg(e.msg);
- if (e.code == 0) {
- tool.tabRefresh(71);
- tool.sideClose(1000);
- a = 1
- }
- }
- tool.post("/admin/project.report/add", data.field, callback);
- }
-
- })
- a = 0
- return false;
- });
- }
- </script>
- {/block}
|