045bcac66460eb374854e4b72636eb49.php 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560
  1. <?php /*a:2:{s:64:"D:\phpstudy_pro\WWW\caiping\app\admin\view\project\cost\add.html";i:1724761931;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. width: 100%;
  19. height: 25px;
  20. text-align: center;
  21. position: fixed;
  22. bottom: 0;
  23. }
  24. .form-title{
  25. background-color: rgb(241, 241, 241);
  26. color: rgb(95, 95, 95);
  27. border-color: rgb(241, 241, 241);
  28. text-align: center;
  29. border-color: #e2e2e2;
  30. }
  31. .filelist{
  32. width: 100%;
  33. overflow: auto;
  34. justify-content:flex-start;
  35. align-content: space-between;
  36. /* flex-direction: column-reverse; */
  37. flex-wrap: wrap;
  38. display: flex;
  39. }
  40. .filelist li{
  41. padding: 0.5vw 0.7vw 0.5vw 0.7vw;
  42. white-space: nowrap;
  43. overflow: hidden;
  44. text-overflow: ellipsis;
  45. display: inline-block;
  46. border-right: 1px solid #e2e2e2;
  47. }
  48. .filelist p{
  49. margin: 3px 0 5px 0;
  50. width: 8vw;
  51. text-align: center;
  52. overflow: hidden;
  53. text-overflow: ellipsis;
  54. }
  55. .filelist img{
  56. width: 95px;
  57. height: 95px;
  58. }
  59. .form-title {
  60. background-color: rgb(241, 241, 241);
  61. color: rgb(95, 95, 95);
  62. border-color: rgb(241, 241, 241);
  63. font-weight: 600;
  64. }
  65. #tabniubi {
  66. width: 100%;
  67. margin: 10px 0;
  68. background-color: #fff;
  69. color: #5f5f5f;
  70. }
  71. #tabniubi th {
  72. padding: 9px 15px;
  73. min-height: 20px;
  74. height: 40px;
  75. line-height: 40px;
  76. text-align: center;
  77. /* font-size: 14px; */
  78. border-width: 1px;
  79. border-style: solid;
  80. border-color: #e2e2e2;
  81. font: 14px Helvetica Neue, Helvetica, PingFang SC, Tahoma, Arial, sans-serif;
  82. }
  83. #tabniubi tr:first-child {
  84. padding: 0;
  85. min-height: 0;
  86. line-height: 0;
  87. border-width: 0;
  88. border-style: none;
  89. border-color: #fff;
  90. font-size: 0;
  91. }
  92. #tabniubi tr:first-child th {
  93. padding: 0;
  94. min-height: 0;
  95. line-height: 0;
  96. border-width: 0;
  97. border-style: none;
  98. border-color: #fff;
  99. font-size: 0;
  100. }
  101. .forleft {
  102. text-align: left !important;
  103. }
  104. .xm-input{
  105. padding-left: 0 !important;
  106. }
  107. .xm-search{
  108. display: flex;
  109. justify-content: flex-end;
  110. }
  111. </style>
  112. </head>
  113. <body class="main-body">
  114. <!-- 主体 -->
  115. <form class="layui-form p-4">
  116. <h3 class="pb-3">新建造价项目</h3>
  117. <table id="tabniubi" cellpadding="1" cellspacing="1">
  118. <tr>
  119. <th style="width: 10%;height: 0;"></th>
  120. <th style="width: 10%;height: 0;"></th>
  121. <th style="width: 10%;height: 0;"></th>
  122. <th style="width: 10%;height: 0;"></th>
  123. <th style="width: 10%;height: 0;"></th>
  124. <th style="width: 10%;height: 0;"></th>
  125. <th style="width: 10%;height: 0;"></th>
  126. <th style="width: 10%;height: 0;"></th>
  127. <th style="width: 10%;height: 0;"></th>
  128. </tr>
  129. <tr border="1">
  130. <th class="form-title">项目名称 <font style="color: red !important;">*</font></th>
  131. <th colspan="2">
  132. <input type="text" name="project_name" lay-verify="required" lay-reqText="请完善项目名称" value="" autocomplete="off" placeholder="请输入项目名称" class="layui-input">
  133. </th>
  134. <th class="form-title">项目编号 <font style="color: red !important;">*</font></th>
  135. <th colspan="2">
  136. <input type="text" name="project_num" lay-verify="required" lay-reqText="请完善项目编号" value="" autocomplete="off" placeholder="请输入项目编号" class="layui-input">
  137. </th>
  138. <th class="form-title">项目周期 <font style="color: red !important;">*</font></th>
  139. <th id="date" colspan="2">
  140. <div class="layui-input-inline" style="width: 47%;display: inline-flex;">
  141. <input type="text" id="start_time" name="project_start_time" readonly lay-verify="required" lay-reqText="请选择开始时间" placeholder="请选择" class="layui-input" value="">
  142. </div>
  143. -
  144. <div class="layui-input-inline" style="width: 47%;display: inline-flex;">
  145. <input type="text" id="end_time" name="project_end_time" readonly lay-verify="required" lay-reqText="请选择结束时间" placeholder="请选择" class="layui-input" value="">
  146. </div>
  147. </th>
  148. </tr>
  149. <tr>
  150. <th class="form-title">工程类型 <font style="color: red !important;">*</font></th>
  151. <th colspan="2">
  152. <div>
  153. <select name="engineering_type1" lay-verify="required" lay-filter="aihao">
  154. <option value="0"></option>
  155. <option value="1">预算</option>
  156. <option value="2">结算</option>
  157. <option value="3">概算</option>
  158. <option value="4">决算</option>
  159. <option value="5">工程总承包(EPC)</option>
  160. </select>
  161. </div>
  162. </th>
  163. <th class="form-title" style="text-align: center;">——</th>
  164. <th colspan="2">
  165. <div>
  166. <select name="engineering_type2" lay-verify="required" lay-filter="aihao">
  167. <option value=""></option>
  168. <option value="1">审核</option>
  169. <option value="2">编制</option>
  170. </select>
  171. </div>
  172. </th>
  173. <th class="form-title">送审金额 <font style="color: red !important;">*</font></th>
  174. <th colspan="2">
  175. <input type="text" id="sent_review_amount" name="sent_review_amount" autocomplete="off" placeholder="请输入送审金额" class="layui-input">
  176. </th>
  177. </tr>
  178. <!-- 添加送审业主-->
  179. <tr>
  180. <th class="form-title">送审业主 <font style="color: red !important;">*</font></th>
  181. <th colspan="2">
  182. <!-- 送审单位负责人-->
  183. <select name="sent_review_head" lay-reqText="请选择送审业主">
  184. <option value="">请选择送审业主(暂时不选)</option>
  185. <?php if(is_array($person) || $person instanceof \think\Collection || $person instanceof \think\Paginator): $i = 0; $__LIST__ = $person;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?>
  186. <option value="<?php echo htmlentities($v['id']); ?>"><?php echo htmlentities($v['nickname']); ?></option>
  187. <?php endforeach; endif; else: echo "" ;endif; ?>
  188. </select>
  189. </th>
  190. </tr>
  191. <tr>
  192. <th class="form-title">评审单位 <font style="color: red !important;">*</font></th>
  193. <th colspan="2">
  194. <input type="text" name="review_unit_name" autocomplete="off" readonly value="" lay-verify="required" lay-reqText="请输入评审单位" placeholder="请输入评审单位" class="layui-input customer-picker">
  195. <input type="hidden" name="review_unit" value="">
  196. </th>
  197. <th class="form-title">审批人 <font style="color: red !important;">*</font></th>
  198. <th colspan="2">
  199. <select name="entrust_approver" lay-verify="required" lay-reqText="请选择审批人">
  200. <option value="">请选择审批人</option>
  201. <?php if(is_array($person) || $person instanceof \think\Collection || $person instanceof \think\Paginator): $i = 0; $__LIST__ = $person;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?>
  202. <option value="<?php echo htmlentities($v['id']); ?>"><?php echo htmlentities($v['nickname']); ?></option>
  203. <?php endforeach; endif; else: echo "" ;endif; ?>
  204. </select>
  205. </th>
  206. <th colspan="2">
  207. <select name="entrust_second_approver" lay-reqText="请选择审批人">
  208. <option value="">请选择第二审批人(可选)</option>
  209. <?php if(is_array($person) || $person instanceof \think\Collection || $person instanceof \think\Paginator): $i = 0; $__LIST__ = $person;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?>
  210. <option value="<?php echo htmlentities($v['id']); ?>"><?php echo htmlentities($v['nickname']); ?></option>
  211. <?php endforeach; endif; else: echo "" ;endif; ?>
  212. </select>
  213. </th>
  214. </tr>
  215. <tr>
  216. <th colspan="9" class="forleft">相关附件
  217. <button class="layui-btn layui-btn-xs layui-btn-danger" style="float: right;" type="button"
  218. id="uploadBtn">上传附件
  219. </button>
  220. </th>
  221. </tr>
  222. <tr>
  223. <th colspan="9" class="fujianimg" >
  224. <div id="filesBox2">
  225. <div class="filelist" id="filesBigBox">
  226. <ul id="filesBox">
  227. <div id="nofile" class="layui-data-none">暂无附件</div>
  228. </ul>
  229. </div>
  230. </div>
  231. </th>
  232. </tr>
  233. </table>
  234. <div class="pt-3">
  235. <input type="hidden" name="id" value="0"/>
  236. <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">保存</button>
  237. <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="save">提交</button>
  238. <button type="reset" class="layui-btn layui-btn-primary">重置</button>
  239. </div>
  240. </form>
  241. <!-- /主体 -->
  242. <!-- 底部 -->
  243. <div class="footer">
  244. 逸管工程项目管理系统 © www.yiguanfep.com
  245. <img src="/static/home/images/police.png" alt="" style="width:14.5px;height:16px;">
  246. <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>
  247. <a href="https://beian.miit.gov.cn/#/Integrated/index" onclick="window.open(this.href); return false;">桂ICP备17000971号</a>
  248. </div>
  249. <!-- /底部 -->
  250. <!-- 脚本 -->
  251. <script>
  252. var moduleInit = ['tool','oaTool'];
  253. function gouguInit() {
  254. var form = layui.form, tool = layui.tool, oaTool = layui.oaTool;
  255. var file_ids= [];
  256. //日期选择
  257. layui.laydate.render({
  258. elem: '#date',
  259. range: ['#start_time', '#end_time'],
  260. rangeLinked:true
  261. });
  262. let reviewtest;
  263. $('.customer-picker').on('click', function () {
  264. let that = $(this);
  265. let callback = function(data){
  266. console.log(data);
  267. $('[name="review_unit"]').val(data.id);
  268. $('[name="review_unit_name"]').val(data.title);
  269. $('[name="review_head_phone"]').val(data.mobile);
  270. $.ajax({
  271. url: '/admin/project.cost/getemployeelist',
  272. type: 'post',
  273. data: {"id": data.id},
  274. dataType: "json",
  275. async: false,
  276. success: function (msg) {
  277. reviewtest = msg
  278. let str ='<option value="0">无指定人选</option>';
  279. if(data.leader_id!==0){
  280. str = `<option value=${data.leader_id}>${data.nickname}</option>`;
  281. }
  282. for (let i of msg) {
  283. if(data.nickname === i.nickname){
  284. continue
  285. }
  286. //组装数据
  287. str += `<option value='${i.id}'>${i.nickname}</option>`;
  288. }
  289. console.log(msg)
  290. //jquery赋值方式
  291. $("#review_head").html(str);
  292. //重新渲染生效
  293. form.render();
  294. }
  295. });
  296. }
  297. oaTool.customerPicker(callback);
  298. });
  299. form.on('select(reviewselect)', function (data) {
  300. for (let i = 0; i < reviewtest.length; i++){
  301. if (reviewtest[i].id.toString() === data.value){
  302. $('[name="review_head_phone"]').val(reviewtest[i].mobile);
  303. }
  304. }
  305. return false;
  306. });
  307. let f = 1;
  308. //监听提交
  309. form.on('submit(webform)', function (data) {
  310. if(f){
  311. let callback = function (e) {
  312. layer.msg(e.msg);
  313. if (e.code == 0) {
  314. tool.sideClose(1000);
  315. f = 1
  316. }
  317. }
  318. //概算、决算、工程总承包(EPC)
  319. var engineering_type1 ='';
  320. if(data.field.engineering_type1==1){
  321. engineering_type1 ='预算';
  322. }else if(data.field.engineering_type1==2){
  323. engineering_type1 ='结算';
  324. }else if(data.field.engineering_type1==3){
  325. engineering_type1 ='概算';
  326. }else if(data.field.engineering_type1==4){
  327. engineering_type1 ='决算';
  328. }else if(data.field.engineering_type1==5){
  329. engineering_type1 ='工程总承包(EPC)';
  330. }
  331. var engineering_type2 = '';
  332. if(data.field.engineering_type2==1){
  333. engineering_type2 ='审核';
  334. }else if(data.field.engineering_type2==2) {
  335. engineering_type2 = '编制';
  336. }
  337. if(engineering_type1!==""&&engineering_type2!==""){
  338. data.field.engineering_type = engineering_type1 + "-" + engineering_type2;
  339. }
  340. data.field.file_ids = file_ids;
  341. // console.log("???");
  342. tool.post("/admin/project.cost/add", data.field, callback);
  343. }
  344. f = 0
  345. return false;
  346. });
  347. form.on('submit(save)', function (data) {
  348. if(f){
  349. let callback = function (e) {
  350. layer.msg(e.msg);
  351. if (e.code == 0) {
  352. tool.sideClose(1000);
  353. f = 1
  354. }
  355. }
  356. var engineering_type1 ='';
  357. if(data.field.engineering_type1==1){
  358. engineering_type1 ='预算';
  359. }else if(data.field.engineering_type1==2){
  360. engineering_type1 ='结算';
  361. }else if(data.field.engineering_type1==3){
  362. engineering_type1 ='概算';
  363. }else if(data.field.engineering_type1==4){
  364. engineering_type1 ='决算';
  365. }else if(data.field.engineering_type1==5){
  366. engineering_type1 ='工程总承包(EPC)';
  367. }
  368. var engineering_type2 = '';
  369. if(data.field.engineering_type2==1){
  370. engineering_type2 ='审核';
  371. }else if(data.field.engineering_type2==2) {
  372. engineering_type2 = '编制';
  373. }
  374. if(engineering_type1!==""&&engineering_type2!==""){
  375. data.field.engineering_type = engineering_type1 + "-" + engineering_type2;
  376. }
  377. data.field.file_ids = file_ids;
  378. // console.log("!!!");
  379. tool.post("/admin/project.cost/save", data.field, callback);
  380. }
  381. f = 0
  382. return false;
  383. });
  384. //上传文件数组
  385. function fileCard(item){
  386. var host = window.location.host;
  387. var li = '';
  388. if(item.length>0){
  389. for(var a=0;a<item.length;a++){
  390. let image = ['jpg','jpeg','png','gif'];
  391. let doc = ['doc','docx','xls','xlsx','ppt','pptx','txt','pdf','zip','rar','7z'];
  392. // let down = '<a href="'+item[a].filepath+'" target="_blank" class="layui-btn layui-btn-xs layui-btn-normal" download="'+item[a].name+'">下载</a>';
  393. let down ='<a href="' + item[a]['filepath'] + '" target="_blank" class="layui-btn layui-btn-xs layui-btn-normal" download="' + item[a]['name'] + '">预览</a>';
  394. // 判断元素是否在数组中
  395. let path='/static/home/images/icon/file.png';
  396. if (image.includes(item[a].fileext)) {
  397. path=item[a].filepath;
  398. down = '<span data-href="'+item[a].filepath+'" class="layui-btn layui-btn-xs layui-btn-normal file-view-img">预览</span>';
  399. } else if (doc.includes(item[a].fileext)){
  400. path='/static/home/images/icon/'+item[a].fileext+'.png';
  401. }
  402. if(item[a].fileext == 'pdf'){
  403. down = '<span data-href="'+item[a].filepath+'" class="layui-btn layui-btn-xs layui-btn-normal file-view-pdf">预览</span>';
  404. }
  405. 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+
  406. '" style="object-fit: contain;" class="file-item"><p title="'+item[a].name+'">'+item[a].name+
  407. '</p><div class="layui-btn-group">'+ down +
  408. '<span class="layui-btn layui-btn-xs layui-btn-danger file-del">删除</span></div></li>';
  409. }
  410. return li;
  411. }
  412. }
  413. $('#filesBox').on('click','.file-del',function(){
  414. let id = $(this).parent().parent().data('id');
  415. layer.confirm('确定要删除该文件吗?', { icon: 3, title: '提示' }, function () {
  416. layer.closeAll();
  417. var index = file_ids.indexOf(id);
  418. if (index > -1) {
  419. file_ids.splice(index, 1);
  420. }
  421. if(file_ids.length == 0){
  422. $("#filesBox").append('<div id="nofile" class="layui-data-none" >暂无附件</div>');
  423. }
  424. console.log(file_ids);
  425. $("#" + id).remove();
  426. });
  427. })
  428. oaTool.addFile({
  429. type: 1,
  430. isSave: true,
  431. ajaxSave: function (res) {
  432. let callback = function (e) {
  433. if (e.hasOwnProperty("msg")) {
  434. layer.msg(e.msg);
  435. }else{
  436. layer.msg('上传成功!')
  437. }
  438. $('#nofile').remove();
  439. $("#filesBox").append(fileCard(e));
  440. file_ids.push(e[0].id)
  441. }
  442. tool.post("/admin/project.api/add_file", {
  443. 'file_id': res.data.id,
  444. }, callback);
  445. }
  446. });
  447. }
  448. </script>
  449. <!-- /脚本 -->
  450. <!-- <script src="/static/assets/layui/layui.js"></script> -->
  451. <script src="/static/assets/layui/layui.js"></script>
  452. <script src="/static/assets/third_party/echart/echarts.min.js"></script>
  453. <script src="/static/assets/gougu/gouguInit.js"></script>
  454. <script src="https://unpkg.com/pinyin-pro"></script>
  455. <script>
  456. var { pinyin } = pinyinPro;
  457. </script>
  458. <!-- 统计代码 -->
  459. <!-- /统计代码 -->
  460. </body>
  461. </html>