5c37242e2cc1dd55c0f27f2a25ee7230.php 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376
  1. <?php /*a:2:{s:66:"D:\phpstudy_pro\WWW\caiping\app\admin\view\project\report\add.html";i:1723541257;s:59:"D:\phpstudy_pro\WWW\caiping\app\admin\view\common\base.html";i:1723541257;}*/ ?>
  2. <!DOCTYPE html>
  3. <html>
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <meta name="renderer" content="webkit">
  7. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  8. <meta name="360-site-verification" content="a7c876fae8b6e3175a52ea9f19543f51" />
  9. <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=0">
  10. <script src="/static/dist/xm-select.js"></script>
  11. <link rel="mobile-prefetch" href=""/>
  12. <title><?php echo get_system_config('web','admin_title'); ?></title>
  13. <meta name="keywords" content="<?php echo get_system_config('web','keywords'); ?>"/>
  14. <meta name="description" content="<?php echo get_system_config('web','desc'); ?>"/>
  15. <link rel="stylesheet" href="/static/assets/gougu/css/gougu.css?v=<?php echo get_system_config('web','version'); ?>" media="all">
  16. <style>
  17. .footer{
  18. display: none;
  19. }
  20. #fileBox li{
  21. display: flex;
  22. flex-wrap: wrap;
  23. flex-direction: column;
  24. }
  25. .layui-table th{
  26. text-align: center !important;
  27. font-weight: 500;
  28. }
  29. .layui-anim dd{
  30. text-align: left;
  31. }
  32. .layui-th-gray{
  33. background-color: rgb(241, 241, 241);
  34. }
  35. .layui-table th{
  36. border-color: #e2e2e2
  37. }
  38. .fujian p{
  39. margin: 3px 0 5px 0;
  40. width: 11vw;
  41. overflow: hidden;
  42. text-overflow: ellipsis;
  43. text-align: center;
  44. }
  45. .fujian{
  46. width: auto;
  47. overflow: auto;
  48. justify-content:flex-start;
  49. align-content: space-between;
  50. flex-direction: column-reverse;
  51. flex-wrap: wrap;
  52. display: flex;
  53. }
  54. .fujian li{
  55. padding: 0.5vw 0.8vw 0.5vw 0.8vw;
  56. white-space: nowrap;
  57. overflow: hidden;
  58. text-overflow: ellipsis;
  59. display: inline-block;
  60. border-right: 1px solid #e2e2e2;
  61. float: left;
  62. }
  63. .layui-btn-group{
  64. display: flex;
  65. justify-content: center;
  66. }
  67. </style>
  68. </head>
  69. <body class="main-body">
  70. <!-- 主体 -->
  71. <form class="layui-form p-4">
  72. <h3 class="pb-3">新建报告</h3>
  73. <table class="layui-table layui-table-form">
  74. <tr>
  75. <th class="layui-th-gray-2" style="background-color: rgb(241, 241, 241);">报告名称 <font style="color: red !important;">*</font></th>
  76. <th colspan="5">
  77. <input type="text" name="title" lay-verify="required" lay-reqText="请输入报告名称"
  78. placeholder="请输入报告名称" class="layui-input" value="">
  79. </th>
  80. <th class="layui-th-gray">报告类型 <font style="color: red !important;">*</font></th>
  81. <th colspan="2">
  82. <select id="projectId" name="type" lay-verify="required">
  83. <option value="">请选择报告类型</option>
  84. <option value="0">初审报告</option>
  85. <option value="1">对数报告</option>
  86. <option value="2">审定报告</option>
  87. </select>
  88. </th>
  89. </tr>
  90. <tr>
  91. <th class="layui-th-gray" style="vertical-align:top;">报告内容 <font style="color: red !important;">*</font></th>
  92. <th colspan="8">
  93. <textarea name="content" placeholder="请输入内容" class="layui-textarea" id="container_content"
  94. style="border:0;padding:0"></textarea>
  95. </th>
  96. </tr>
  97. <tr>
  98. <th class="layui-th-gray">一级审核人 <font style="color: red !important;">*</font></th>
  99. <th colspan="2">
  100. <select name="first" lay-verify="required" lay-reqText="请选择审批人">
  101. <option value="">请选择审核人</option>
  102. <?php if(is_array($people) || $people instanceof \think\Collection || $people instanceof \think\Paginator): $i = 0; $__LIST__ = $people;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
  103. <option value="<?php echo htmlentities($vo['id']); ?>"><?php echo htmlentities($vo['nickname']); ?></option>
  104. <?php endforeach; endif; else: echo "" ;endif; ?>
  105. </select>
  106. </th>
  107. <th class="layui-th-gray">二级审核人</th>
  108. <th colspan="2">
  109. <select name="second">
  110. <option value="">请选择审核人,可空</option>
  111. <?php if(is_array($people) || $people instanceof \think\Collection || $people instanceof \think\Paginator): $i = 0; $__LIST__ = $people;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
  112. <option value="<?php echo htmlentities($vo['id']); ?>"><?php echo htmlentities($vo['nickname']); ?></option>
  113. <?php endforeach; endif; else: echo "" ;endif; ?>
  114. </select>
  115. </th>
  116. <th class="layui-th-gray">三级审核人</th>
  117. <th colspan="2">
  118. <select name="third">
  119. <option value="">请选择审核人,可空</option>
  120. <?php if(is_array($people) || $people instanceof \think\Collection || $people instanceof \think\Paginator): $i = 0; $__LIST__ = $people;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
  121. <option value="<?php echo htmlentities($vo['id']); ?>"><?php echo htmlentities($vo['nickname']); ?></option>
  122. <?php endforeach; endif; else: echo "" ;endif; ?>
  123. </select>
  124. </th>
  125. </tr>
  126. <tr>
  127. <th class="layui-th-gray">四级审核人</th>
  128. <th colspan="2">
  129. <select name="fourth" lay-reqText="请选择审批人">
  130. <option value="">请选择审核人</option>
  131. <?php if(is_array($people) || $people instanceof \think\Collection || $people instanceof \think\Paginator): $i = 0; $__LIST__ = $people;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
  132. <option value="<?php echo htmlentities($vo['id']); ?>"><?php echo htmlentities($vo['nickname']); ?></option>
  133. <?php endforeach; endif; else: echo "" ;endif; ?>
  134. </select>
  135. </th>
  136. <th class="layui-th-gray">五级级审核人</th>
  137. <th colspan="2">
  138. <select name="fifth">
  139. <option value="">请选择审核人,可空</option>
  140. <?php if(is_array($people) || $people instanceof \think\Collection || $people instanceof \think\Paginator): $i = 0; $__LIST__ = $people;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
  141. <option value="<?php echo htmlentities($vo['id']); ?>"><?php echo htmlentities($vo['nickname']); ?></option>
  142. <?php endforeach; endif; else: echo "" ;endif; ?>
  143. </select>
  144. </th>
  145. </tr>
  146. </table>
  147. <div class="pt-3">
  148. <input type="hidden" name="id" value=""/>
  149. <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
  150. <button type="reset" class="layui-btn layui-btn-primary">重置</button>
  151. </div>
  152. </form>
  153. <div class="layui-card border-y">
  154. <div class="layui-card-header" style="height:45px;border: 1px solid #e2e2e2;">
  155. <div class="layui-row">
  156. <div class="layui-col-md6">
  157. <strong>项目附件</strong>
  158. </div>
  159. <div class="layui-col-md6" style="text-align:right">
  160. <button type="button" class="layui-btn layui-btn-danger layui-btn-sm" id="uploadBtn">上传附件</button>
  161. </div>
  162. </div>
  163. </div>
  164. <div class="layui-row p-2 fujian" id="fileBox">
  165. <div class="layui-data-none">暂无附件</div>
  166. </div>
  167. </div>
  168. <!-- /主体 -->
  169. <!-- 底部 -->
  170. <div class="footer">
  171. 逸管工程项目管理系统 © www.yiguanfep.com
  172. <img src="/static/home/images/police.png" alt="" style="width:14.5px;height:16px;">
  173. <a href="https://beian.mps.gov.cn/#/query/websearch?code=45030202000160 " rel="\&quot;noreferrer'target=\”blank\&quot;" onclick="window.open(this.href); return false;">桂公网安备45030202000160号</a>
  174. <a href="https://beian.miit.gov.cn/#/Integrated/index" onclick="window.open(this.href); return false;">桂ICP备17000971号</a>
  175. </div>
  176. <!-- /底部 -->
  177. <!-- 脚本 -->
  178. <script>
  179. const moduleInit = ['tool', 'tagpicker', 'tinymce', 'oaTool','employeepicker'];
  180. function gouguInit() {
  181. var form = layui.form, tool = layui.tool, oaTool = layui.oaTool,employeepicker = layui.employeepicker;
  182. var file_id = null;
  183. //编辑器初始化
  184. var editor = layui.tinymce;
  185. var edit = editor.render({
  186. selector: "#container_content",
  187. height: 500
  188. });
  189. let a = 1;
  190. //监听提交
  191. form.on('submit(webform)', function (data) {
  192. data.field.content = tinyMCE.editors['container_content'].getContent();
  193. if (data.field.content == '') {
  194. layer.msg('请先完善文章内容');
  195. return false;
  196. }
  197. if(a){
  198. let callback = function (e) {
  199. parent.layui.reportTable.reload();
  200. layer.msg(e.msg);
  201. if (e.code == 0) {
  202. tool.tabRefresh(71);
  203. tool.sideClose(1000);
  204. } a = 1
  205. }
  206. data.field.file = file_id;
  207. data.field.project_id = '<?php echo htmlentities($project_id); ?>';
  208. // console.log(data.field)
  209. tool.post("/admin/project.report/add_company", data.field, callback);
  210. }
  211. a = 0
  212. return false;
  213. });
  214. function fileCard(item){
  215. var host = window.location.host;
  216. var li = '';
  217. if(item.length>0){
  218. for(var a=0;a<item.length;a++){
  219. let image = ['jpg','jpeg','png','gif'];
  220. let doc = ['doc','docx','xls','xlsx','ppt','pptx','txt','pdf','zip','rar','7z'];
  221. // let down = '<a href="'+item[a].filepath+'" target="_blank" class="layui-btn layui-btn-xs layui-btn-normal" download="'+item[a].name+'">下载</a>';
  222. let down ='<a href="' + item[a]['filepath'] + '" target="_blank" class="layui-btn layui-btn-xs layui-btn-normal" download="' + item[a]['name'] + '">预览</a>';
  223. // 判断元素是否在数组中
  224. let path='/static/home/images/icon/file.png';
  225. if (image.includes(item[a].fileext)) {
  226. path=item[a].filepath;
  227. down = '<span data-href="'+item[a].filepath+'" class="layui-btn layui-btn-xs layui-btn-normal file-view-img">预览</span>';
  228. } else if (doc.includes(item[a].fileext)){
  229. path='/static/home/images/icon/'+item[a].fileext+'.png';
  230. }
  231. if(item[a].fileext == 'pdf'){
  232. down = '<span data-href="'+item[a].filepath+'" class="layui-btn layui-btn-xs layui-btn-normal file-view-pdf">预览</span>';
  233. }
  234. li += '<li id="'+item[a].id+'" data-id="'+item[a].id+'" data-title="'+item[a].name+'" data-ext="'+item[a].fileext+'"><img src="'+path+'" alt="'+item[a].filename+
  235. '" style="object-fit: contain;" class="file-item"><p title="'+item[a].name+'">'+item[a].name+
  236. '</p><div class="layui-btn-group">'+ down +
  237. '<span class="layui-btn layui-btn-xs layui-btn-danger file-del">删除</span></div></li>';
  238. }
  239. return li;
  240. }
  241. }
  242. var emptyCard = ' <div class="layui-data-none">暂无附件</div>'
  243. $('#fileBox').on('click','.file-del',function(){
  244. layer.confirm('确定要删除该文件吗?', { icon: 3, title: '提示' }, function (index) {
  245. layer.closeAll();
  246. file_id = null;
  247. $('#' + file_id).remove();
  248. $("#fileBox").html(emptyCard);
  249. let callback = function (e) {
  250. layer.closeAll();
  251. file_id = null;
  252. layer.msg(e.msg);
  253. $('#' + file_id).remove();
  254. $("#fileBox").html(emptyCard);
  255. }
  256. // tool.delete("/admin/project.report/delete_file", {id:file_id}, callback);
  257. });
  258. })
  259. oaTool.addFile({
  260. type: 1,
  261. isSave: true,
  262. ajaxDelete: function (file_id) {
  263. let callback = function (e) {
  264. layer.msg(e.msg);
  265. var emptyCard = ' <div class="layui-data-none">暂无附件</div>'
  266. file_id = null;
  267. if (e.code == 0) {
  268. $('#fileItem' + file_id).remove();
  269. $("#fileBox").html(emptyCard);
  270. }
  271. }
  272. tool.delete("/admin/project.report/delete_file", {id: file_id}, callback);
  273. },
  274. ajaxSave: function (res) {
  275. let callback = function (e) {
  276. layer.msg('上传成功');
  277. $("#fileBox").html(fileCard(e));
  278. file_id = res.data.id
  279. }
  280. tool.post("/admin/project.report/add_file_company", {
  281. 'file': res.data.id,
  282. }, callback);
  283. }
  284. });
  285. }
  286. </script>
  287. <!-- /脚本 -->
  288. <!-- <script src="/static/assets/layui/layui.js"></script> -->
  289. <script src="/static/assets/layui/layui.js"></script>
  290. <script src="/static/assets/third_party/echart/echarts.min.js"></script>
  291. <script src="/static/assets/gougu/gouguInit.js"></script>
  292. <script src="https://unpkg.com/pinyin-pro"></script>
  293. <script>
  294. var { pinyin } = pinyinPro;
  295. </script>
  296. <!-- 统计代码 -->
  297. <!-- /统计代码 -->
  298. </body>
  299. </html>