3f28098a1bd656ecd7783a8d32ee1ea2.php 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652
  1. <?php /*a:2:{s:70:"D:\phpstudy_pro\WWW\caiping\app\admin\view\project\audit\datalist.html";i:1724557433;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. </style>
  25. </head>
  26. <body class="main-body">
  27. <!-- 主体 -->
  28. <div class="p-3">
  29. <form class="layui-form gg-form-bar border-t border-x">
  30. <div class="layui-input-inline" style="width:300px;">
  31. <input type="text" name="keywords" placeholder="请输入关键字" class="layui-input" autocomplete="off"/>
  32. </div>
  33. <div class="layui-input-inline">
  34. <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="searchform">提交搜索</button>
  35. </div>
  36. </form>
  37. <table class="layui-hide" id="cost_project" lay-filter="cost_project"></table>
  38. </div>
  39. <div id="selectBox" style="display: none;">
  40. <div id="financialSelect"></div>
  41. <button id="c">1111</button>
  42. </div>
  43. <div id="selectBox2" style="display: none;">
  44. <div id="companySelect2"></div>
  45. <button id="cc">1111</button>
  46. </div>
  47. <script type="text/html" id="toolbarDemo">
  48. <div class="layui-btn-container">
  49. </div>
  50. </script>
  51. <!-- /主体 -->
  52. <!-- 底部 -->
  53. <div class="footer">
  54. 逸管工程项目管理系统 © www.yiguanfep.com
  55. <img src="/static/home/images/police.png" alt="" style="width:14.5px;height:16px;">
  56. <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>
  57. <a href="https://beian.miit.gov.cn/#/Integrated/index" onclick="window.open(this.href); return false;">桂ICP备17000971号</a>
  58. </div>
  59. <!-- /底部 -->
  60. <!-- 脚本 -->
  61. <script>
  62. const moduleInit = ['tool'];
  63. var num_aaa =0;
  64. //页面内容初始化的ajax请求
  65. function gouguInit() {
  66. var table = layui.table, tool = layui.tool, form = layui.form;
  67. layui.pageTable = table.render({
  68. elem: '#cost_project',
  69. id: "cost_project",
  70. title: '造价项目列表',
  71. toolbar: '#toolbarDemo',
  72. url: '/admin/project.audit/datalist',//表格数据的获取地址
  73. page: true,
  74. limit: 20,
  75. parseData: function(res) { // 数据解析回调函数 res=>list2
  76. // 在这里可以获取数据总数
  77. allcount = res.count;
  78. return {
  79. code: res.code, // 数据状态码
  80. msg: res.msg, // 状态信息
  81. count: res.count, // 数据总数
  82. data: res.data // 当前页数据
  83. };
  84. },
  85. cols: [
  86. [
  87. {fixed: 'left', field: 'id', title: '编号', align: 'center', width: 100,
  88. templet: function(d){
  89. return allcount - (d.LAY_NUM-1);
  90. }
  91. },
  92. {
  93. field: 'project_status',
  94. title: '项目状态',
  95. align: 'center',
  96. width: 100,
  97. templet: function (item) {
  98. var html = '';
  99. if (item.project_status === 2) {
  100. html = '<span>审批中</span> ';
  101. } else if (item.project_status === 1) {
  102. html = '<span">立项中</span> ';
  103. } else if (item.project_status === 3) {
  104. html = '<span">待接收</span> ';
  105. } else if (item.project_status === 4) {
  106. html = '<span">分配中</span> ';
  107. } else if (item.project_status === 5) {
  108. html = '<span>作业中</span> ';
  109. } else if (item.project_status === 6) {
  110. html = '<span">归档中</span> ';
  111. } else if (item.project_status === 7) {
  112. html = '<span">退审中</span> ';
  113. } else if (item.project_status === 8) {
  114. html = '<span">已归档</span> ';
  115. } else if (item.project_status === 9) {
  116. html = '<span">已退审</span> ';
  117. }
  118. return html;
  119. }
  120. }, {
  121. field: 'audit_status',
  122. title: '审批状态',
  123. align: 'center',
  124. width: 100,
  125. templet: function (item) {
  126. var html = '';
  127. if (item.audit_status === 1) {
  128. num_aaa += 1;
  129. html = '<span class="layui-badge layui-bg-blue">待审核</span> ';
  130. } else if (item.audit_status === 2) {
  131. html = '<span class="layui-badge layui-bg-green">已通过</span> ';
  132. } else if (item.audit_status === 3) {
  133. html = '<span class="layui-badge layui-bg-red">已拒绝</span> ';
  134. }
  135. return html;
  136. }
  137. }, {
  138. field: 'project_name',
  139. title: '项目名称',
  140. align: 'center',
  141. width: 400,
  142. templet: function (d) {
  143. return '<div style="text-align:left">' + d.project_name + '</div>'
  144. }
  145. }, {
  146. field: 'audit_name',
  147. title: '流程名称',
  148. align: 'center',
  149. width: 150
  150. }, {
  151. field: 'else_name',
  152. title: '报告/联系函',
  153. align: 'center',
  154. width: 200
  155. }, {
  156. field: 'engineering_type',
  157. title: '项目类型',
  158. align: 'center',
  159. width: 150
  160. }, {
  161. field: 'sent_review_amount',
  162. title: '送审金额(元)',
  163. align: 'center',
  164. width: 150
  165. }, {
  166. field: 'sponsor',
  167. title: '发起人',
  168. align: 'center',
  169. width: 150
  170. }, {
  171. field: 'sponsor_unit',
  172. title: '发起单位/部门',
  173. align: 'center',
  174. width: 100
  175. }, {
  176. field: 'create_time',
  177. title: '发起时间',
  178. align: 'center',
  179. width: 150,
  180. templet: function (d) {
  181. // console.log(d.create_time)
  182. var date = new Date(d.create_time);
  183. var formatted = date.getFullYear() + '-' + (date.getMonth()+1) + '-' + date.getDate();
  184. return formatted;
  185. }
  186. }, {
  187. field: 'approver_name',
  188. title: '审批人',
  189. align: 'center',
  190. width: 150
  191. }, {
  192. field: 'audit_time',
  193. title: '审批时间',
  194. align: 'center',
  195. width: 100,
  196. templet: function (d) {
  197. if (d.audit_time) {
  198. return layui.util.toDateString(d.audit_time * 1000, "yyyy-MM-dd")
  199. } else {
  200. return "";
  201. }
  202. }
  203. }, {
  204. field: 'remark',
  205. title: '申请原因',
  206. align: 'center',
  207. width: 250,
  208. }, {
  209. field: 'audit_remark',
  210. title: '审批回执',
  211. align: 'center',
  212. width: 250,
  213. }, {
  214. fixed: 'right',
  215. field: 'right',
  216. title: '操作',
  217. width: 136,
  218. align: 'center',
  219. templet: function (item) {
  220. var h = '';
  221. if (item.audit_status === 1) {
  222. h = '<div class="layui-btn-group"> <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="read">查看</a> <a class="layui-btn layui-btn-xs" lay-event="edit">通过</a> <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="overrule">拒绝</a> </div>'
  223. } else {
  224. h = '<div class="layui-btn-group"> <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="read">查看</a></div>'
  225. }
  226. return h;
  227. }
  228. }
  229. ]
  230. ],
  231. done:function () {
  232. if(num_aaa === 0){
  233. parent.showhongdian()
  234. // console.log('2执行了')
  235. }
  236. }
  237. });
  238. let abc = 0;
  239. //监听表格行工具事件
  240. table.on('tool(cost_project)', function (obj) {
  241. var data = obj.data;//data是所点击表格行的数据,有些可能没显示
  242. if (obj.event === 'read') {
  243. if (data.audit_type == 1) {
  244. tool.side('/admin/project.audit/read?id=' + data.project_id);
  245. } else if (data.audit_type == 0){
  246. tool.side('/admin/project.audit/read?id=' + data.project_id);
  247. } else if (data.audit_type == 2) {
  248. tool.side('/admin/project.report/view?id=' + data.else_id);
  249. } else if (data.audit_type == 3) {
  250. tool.side(' /admin/project.contact/view?id=' + data.else_id);
  251. }else {
  252. layer.msg("审核内容不存在!")
  253. }
  254. } else if (obj.event === 'edit') {
  255. layer.confirm("确认是否审批通过?", function (index) {
  256. if (abc == 0) {
  257. let callback = function (e) {
  258. select_Data = [];
  259. abc = 0
  260. layer.msg(e.msg);
  261. setTimeout(function () {
  262. window.location.reload()
  263. layer.close(index);
  264. }, 1000)
  265. }
  266. if (data.audit_type == 0){
  267. if (data.project_status == 2) {
  268. //立项审批2
  269. tool.post("/admin/project.audit/project_edit_first2", {
  270. id: data.id,
  271. else_id: data.else_id,
  272. audit_type: data.audit_type,
  273. project_id: data.project_id,
  274. project_status: data.project_status,
  275. }, callback);
  276. }
  277. }
  278. else if (data.audit_type == 1) {
  279. if (data.project_status == 2) {
  280. //立项审批一
  281. tool.post("/admin/project.audit/project_edit_first", {
  282. id: data.id,
  283. else_id: data.else_id,
  284. audit_type: data.audit_type,
  285. project_id: data.project_id,
  286. project_status: data.project_status,
  287. }, callback);
  288. } else if (data.project_status == 6) {
  289. tool.post("/admin/project.audit/project_edit_second", {
  290. id: data.id,
  291. else_id: data.else_id,
  292. audit_type: data.audit_type,
  293. project_id: data.project_id,
  294. project_status: data.project_status,
  295. }, callback);
  296. } else if (data.project_status == 7) {
  297. //退审审批
  298. tool.post("/admin/project.audit/project_edit_third", {
  299. id: data.id,
  300. else_id: data.else_id,
  301. audit_type: data.audit_type,
  302. project_id: data.project_id,
  303. project_status: data.project_status,
  304. }, callback);
  305. }
  306. } else if (data.audit_type == 2) {
  307. if (data.else_status == 0) {
  308. //报告新建
  309. console.log(1)
  310. tool.post("/admin/project.report/agree_report", {
  311. id: data.id,
  312. else_id: data.else_id,
  313. audit_type: data.audit_type,
  314. project_id: data.project_id,
  315. project_status: data.project_status,
  316. type: 1000,
  317. }, callback);
  318. } else if (data.else_status == 3) {
  319. //报告删除
  320. tool.post("/admin/project.report/agree_delete", {
  321. id: data.id,
  322. else_id: data.else_id,
  323. audit_type: data.audit_type,
  324. project_id: data.project_id,
  325. project_status: data.project_status,
  326. type: 1000,
  327. }, callback);
  328. }
  329. } else if (data.audit_type == 3) {
  330. if (data.else_status == 0) {
  331. //联系函新建
  332. tool.post("/admin/project.contact/agree_contact", {
  333. id: data.id,
  334. else_id: data.else_id,
  335. audit_type: data.audit_type,
  336. project_id: data.project_id,
  337. project_status: data.project_status,
  338. type: 1000,
  339. }, callback);
  340. } else if (data.else_status == 3) {
  341. //联系函删除
  342. tool.post("/admin/project.contact/agree_delete", {
  343. id: data.id,
  344. else_id: data.else_id,
  345. audit_type: data.audit_type,
  346. project_id: data.project_id,
  347. project_status: data.project_status,
  348. type: 1000,
  349. }, callback);
  350. }
  351. }
  352. }
  353. console.log(abc, data.else_status)
  354. abc = 1;
  355. }, function () {
  356. abc = 0;
  357. })
  358. } else if (obj.event === 'overrule') {
  359. var ttxx = layer.prompt({
  360. title: '请输入<span style="color: red">拒绝</span>原因',
  361. formType: 2,
  362. area: ['35vw', '15vw']
  363. }, function (text, index) {
  364. if (text == '') {
  365. layer.msg('请先完善拒绝原因');
  366. return false;
  367. } else {
  368. let callback = function (e) {
  369. layer.msg(e.msg);
  370. setTimeout(function () {
  371. window.location.reload()
  372. layer.close(index);
  373. }, 2000)
  374. }
  375. //审批拒绝2
  376. if (data.audit_type == 0) {
  377. if (data.project_status == 2) {
  378. //立项
  379. tool.post("/admin/project.audit/project_overrule_first2", {
  380. id: data.id,
  381. else_id: data.else_id,
  382. audit_type: data.audit_type,
  383. project_id: data.project_id,
  384. project_status: data.project_status,
  385. audit_remark: text,
  386. }, callback);
  387. }
  388. }
  389. //拒绝一
  390. if (data.audit_type == 1) {
  391. if (data.project_status == 2) {
  392. //立项
  393. tool.post("/admin/project.audit/project_overrule_first", {
  394. id: data.id,
  395. else_id: data.else_id,
  396. audit_type: data.audit_type,
  397. project_id: data.project_id,
  398. project_status: data.project_status,
  399. audit_remark: text,
  400. }, callback);
  401. } else if (data.project_status == 6) {
  402. //归档
  403. tool.post("/admin/project.audit/project_overrule_second", {
  404. id: data.id,
  405. else_id: data.else_id,
  406. audit_type: data.audit_type,
  407. project_id: data.project_id,
  408. project_status: data.project_status,
  409. audit_remark: text,
  410. }, callback);
  411. } else if (data.project_status == 7) {
  412. //退审
  413. tool.post("/admin/project.audit/project_overrule_third", {
  414. id: data.id,
  415. else_id: data.else_id,
  416. audit_type: data.audit_type,
  417. project_id: data.project_id,
  418. project_status: data.project_status,
  419. audit_remark: text,
  420. }, callback);
  421. }
  422. } else if (data.audit_type == 2) {
  423. if (data.else_status == 0) {
  424. //报告新建
  425. tool.post("/admin/project.report/un_report", {
  426. id: data.id,
  427. else_id: data.else_id,
  428. audit_type: data.audit_type,
  429. project_id: data.project_id,
  430. project_status: data.project_status,
  431. audit_remark: text,
  432. type: 1000,
  433. }, callback);
  434. } else if (data.else_status == 3) {
  435. //报告删除
  436. tool.post("/admin/project.report/un_delete", {
  437. id: data.id,
  438. else_id: data.else_id,
  439. audit_type: data.audit_type,
  440. project_id: data.project_id,
  441. project_status: data.project_status,
  442. audit_remark: text,
  443. type: 1000,
  444. }, callback);
  445. }
  446. } else if (data.audit_type == 3) {
  447. if (data.else_status == 0) {
  448. //联系函新建
  449. tool.post("/admin/project.contact/un_contact", {
  450. id: data.id,
  451. else_id: data.else_id,
  452. audit_type: data.audit_type,
  453. project_id: data.project_id,
  454. project_status: data.project_status,
  455. audit_remark: text,
  456. type: 1000,
  457. }, callback);
  458. } else if (data.else_status == 3) {
  459. //联系函删除
  460. tool.post("/admin/project.contact/un_delete", {
  461. id: data.id,
  462. else_id: data.else_id,
  463. audit_type: data.audit_type,
  464. project_id: data.project_id,
  465. project_status: data.project_status,
  466. audit_remark: text,
  467. type: 1000,
  468. }, callback);
  469. }
  470. }
  471. }
  472. })
  473. }
  474. return false;
  475. });
  476. //监听搜索提交,再次进行ajax以更新数据
  477. form.on('submit(searchform)', function (data) {
  478. layui.pageTable.reload({
  479. where: {
  480. keywords: data.field.keywords
  481. },
  482. page: {
  483. curr: 1
  484. }
  485. });
  486. return false;
  487. });
  488. // setTimeout(()=>{
  489. // console.log(num_aaa ,'我是数量')
  490. // if(num_aaa === 0){
  491. // parent.showhongdian()
  492. // console.log('2执行了')
  493. // }
  494. // },1500)
  495. }
  496. </script>
  497. <!-- /脚本 -->
  498. <!-- <script src="/static/assets/layui/layui.js"></script> -->
  499. <script src="/static/assets/layui/layui.js"></script>
  500. <script src="/static/assets/third_party/echart/echarts.min.js"></script>
  501. <script src="/static/assets/gougu/gouguInit.js"></script>
  502. <script src="https://unpkg.com/pinyin-pro"></script>
  503. <script>
  504. var { pinyin } = pinyinPro;
  505. </script>
  506. <!-- 统计代码 -->
  507. <!-- /统计代码 -->
  508. </body>
  509. </html>