777f82e7b8e9ce1b4702e4c49505d4e9.php 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908
  1. <?php /*a:2:{s:76:"D:\phpstudy_pro\WWW\caiping\app\admin\view\project\cost_proprietor\edit.html";i:1724826900;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. margin-bottom: 0 !important;
  22. display: none;
  23. }
  24. .heading th {
  25. text-align: center;
  26. }
  27. .form td {
  28. text-align: center;
  29. }
  30. /* 日志 */
  31. .log_top {
  32. padding-left: 1vw;
  33. }
  34. .log_top span {
  35. margin: 0 0.5vw;
  36. }
  37. /* 1,1,1 */
  38. .log_commentary {
  39. color: rgb(0, 176, 80);
  40. }
  41. .log_company {
  42. color: rgb(255, 33, 0);
  43. }
  44. .log_content {
  45. width: fit-content;
  46. margin: 0.3vw 1.5vw 1vw 1.5vw;
  47. padding: 0.5vw 0vw;
  48. text-indent: 1.2em;
  49. line-height: 2.1vh;
  50. background-color: rgb(255, 255, 255);
  51. border-radius: 0.5vw;
  52. box-shadow: 0.19vw 0.16vw 0.4vw 0.03vw rgba(0, 0, 0, 0.13);
  53. }
  54. .log_content_color {
  55. /* background-color: rgb(250,250,250); */
  56. }
  57. .log_content_img img {
  58. /* width: 10%; */
  59. height: 150px;
  60. border-radius: 0.5vw;
  61. margin: 0.3vw 0;
  62. padding-right: 18px;
  63. padding-bottom: 7px;
  64. padding-left: 2px;
  65. }
  66. .log_item_top {
  67. height: 70%;
  68. overflow: scroll;
  69. }
  70. .log_item_top {
  71. height: 60vh;
  72. }
  73. .log_item_bottom {
  74. display: flex;
  75. /* height: 17vh; */
  76. /* border-top: 1px solid #eee; */
  77. margin: 0 1.5vw;
  78. /* background-color: rgb(250,250,250); */
  79. }
  80. .log_input input {
  81. width: 55vw;
  82. height: 10vh;
  83. border: #eee 1px solid;
  84. }
  85. .log_bottom_img {
  86. /* height: 5vh; */
  87. }
  88. .log_bottom_img img {
  89. height: 4vw;
  90. width: 6vw;
  91. border-radius: 0.5vw;
  92. margin: 0.5vw 0vw 0.5vw 0.3vw;
  93. }
  94. .log_bottom_left {
  95. width: 100%;
  96. margin-top: 1.5vh;
  97. }
  98. .log_bottom_right {
  99. width: 5%;
  100. }
  101. /* 上传图片 */
  102. .layui-upload-drag-self {
  103. background-color: #fbfdff;
  104. border: 1px dashed #c0ccda;
  105. border-radius: 6px;
  106. box-sizing: border-box;
  107. line-height: 4vw;
  108. vertical-align: top;
  109. display: inline-block;
  110. text-align: center;
  111. cursor: pointer;
  112. outline: 0;
  113. margin-right: 13px;
  114. float: left;
  115. }
  116. .layui-input-inlines-self {
  117. position: relative;
  118. margin-left: 90px;
  119. min-height: 36px;
  120. text-align: left;
  121. }
  122. .layui-upload-drag-self .layui-icon {
  123. font-size: 28px;
  124. color: #8c939d
  125. }
  126. .layui-upload-drag-self .img {
  127. position: relative;
  128. height: 148px;
  129. width: 148px;
  130. }
  131. .layui-upload-img {
  132. width: 148px;
  133. height: 148px;
  134. border-radius: 6px;
  135. margin-top: -3px;
  136. margin-left: -2px;
  137. }
  138. .handle {
  139. position: absolute;
  140. width: 148px;
  141. height: 100%;
  142. z-index: 100;
  143. border-radius: 6px;
  144. top: 0;
  145. background: rgba(59, 60, 61, 0.6);
  146. text-align: center;
  147. }
  148. .handle .icon-myself {
  149. z-index: 999;
  150. transition: all .3s;
  151. cursor: pointer;
  152. font-size: 25px;
  153. width: 25px;
  154. color: rgba(255, 255, 255, 0.91);
  155. margin: 0 4px;
  156. }
  157. .log_textarea {
  158. width: 89vw;
  159. height: 8vh;
  160. padding: 0.5vw;
  161. /* margin-right: 2vw; */
  162. margin: 1vw;
  163. }
  164. .log_button_img {
  165. width: 2vw;
  166. }
  167. .log_card {
  168. border: none !important;
  169. }
  170. /* 点击图片放大 */
  171. .content_img img {
  172. max-width: 100%;
  173. cursor: pointer;
  174. }
  175. .overlay {
  176. display: none;
  177. position: fixed;
  178. top: 0;
  179. left: 0;
  180. width: 100%;
  181. height: 100%;
  182. background-color: rgba(0, 0, 0, 0.7);
  183. justify-content: center;
  184. z-index: 1;
  185. }
  186. .overlay img {
  187. margin-top: 4%;
  188. max-width: 90%;
  189. max-height: 90%;
  190. object-fit: contain;
  191. }
  192. .p-4 {
  193. background-color: rgb(255, 255, 255);
  194. }
  195. /*表格*/
  196. #tabniubi {
  197. width: 100%;
  198. margin: 10px 0;
  199. background-color: #fff;
  200. color: #5f5f5f;
  201. }
  202. #tabniubi th {
  203. padding: 9px 15px;
  204. min-height: 20px;
  205. height: 40px;
  206. line-height: 40px;
  207. text-align: center;
  208. /* font-size: 14px; */
  209. border-width: 1px;
  210. border-style: solid;
  211. border-color: #e2e2e2;
  212. font: 14px Helvetica Neue, Helvetica, PingFang SC, Tahoma, Arial, sans-serif;
  213. }
  214. #tabniubi tr:first-child {
  215. padding: 0;
  216. min-height: 0;
  217. line-height: 0;
  218. border-width: 0;
  219. border-style: none;
  220. border-color: #fff;
  221. font-size: 0;
  222. }
  223. #tabniubi tr:first-child th {
  224. padding: 0;
  225. min-height: 0;
  226. line-height: 0;
  227. border-width: 0;
  228. border-style: none;
  229. border-color: #fff;
  230. font-size: 0;
  231. }
  232. .form-title {
  233. background-color: rgb(241, 241, 241);
  234. color: rgb(95, 95, 95);
  235. border-color: rgb(241, 241, 241);
  236. font-weight: 600;
  237. }
  238. .forleft {
  239. text-align: left !important;
  240. }
  241. /* .forright{
  242. text-align:right !important;
  243. } */
  244. .layui-form-select dl dd.layui-this {
  245. background-color: #f8f8f8;
  246. color: rgb(23, 145, 233);
  247. font-weight: 700;
  248. }
  249. .layui-input, .layui-textarea {
  250. /* padding-left: 3.75vw; */
  251. color: #5f5f5f;
  252. }
  253. .upimg {
  254. width: 250px;
  255. height: 250px;
  256. }
  257. .fujianimg img {
  258. height: 5.5vh;
  259. }
  260. .filelist {
  261. width: 100%;
  262. overflow: auto;
  263. justify-content: flex-start;
  264. align-content: space-between;
  265. flex-direction: column-reverse;
  266. flex-wrap: wrap;
  267. display: flex;
  268. }
  269. .filelist li {
  270. padding: 0.5vw 0.8vw 0.5vw 0.8vw;
  271. white-space: nowrap;
  272. overflow: hidden;
  273. text-overflow: ellipsis;
  274. display: inline-block;
  275. border-right: 1px solid #e2e2e2;
  276. float: left;
  277. }
  278. .filelist p {
  279. margin: 3px 0 5px 0;
  280. width: 7vw;
  281. overflow: hidden;
  282. text-overflow: ellipsis;
  283. text-align: center;
  284. }
  285. #filesBox2 li {
  286. padding: 0.5vw 0.8vw 0.5vw 0.8vw;
  287. white-space: nowrap;
  288. overflow: hidden;
  289. text-overflow: ellipsis;
  290. display: inline-block;
  291. border-right: 1px solid #e2e2e2;
  292. float: left;
  293. }
  294. </style>
  295. </head>
  296. <body class="main-body">
  297. <!-- 主体 -->
  298. <form class="layui-form p-4">
  299. <table id="tabniubi" cellpadding="1" cellspacing="1">
  300. <tr>
  301. <th style="width: 10%;height: 0;"></th>
  302. <th style="width: 10%;height: 0;"></th>
  303. <th style="width: 10%;height: 0;"></th>
  304. <th style="width: 10%;height: 0;"></th>
  305. <th style="width: 10%;height: 0;"></th>
  306. <th style="width: 10%;height: 0;"></th>
  307. <th style="width: 10%;height: 0;"></th>
  308. <th style="width: 10%;height: 0;"></th>
  309. <th style="width: 10%;height: 0;"></th>
  310. </tr>
  311. <tr border="1">
  312. <th class="form-title">项目名称 <font style="color: red !important;">*</font></th>
  313. <th colspan="2">
  314. <input type="text" name="project_name" lay-verify="required" lay-reqText="请完善项目名称" value="<?php echo htmlentities($detail['project_name']); ?>"
  315. autocomplete="off" placeholder="请输入项目名称" class="layui-input">
  316. </th>
  317. <th class="form-title">项目编号 <font style="color: red !important;">*</font></th>
  318. <th colspan="2">
  319. <input type="text" name="project_num" lay-verify="required" lay-reqText="请完善项目编号" value="<?php echo htmlentities($detail['project_num']); ?>"
  320. autocomplete="off" placeholder="请输入项目编号" class="layui-input">
  321. </th>
  322. <th class="form-title">工程类别</th>
  323. <th colspan="2">
  324. <input type="text" name="engineering_category" value="<?php echo htmlentities($detail['engineering_category']); ?>" autocomplete="off" placeholder="请输入工程类别"
  325. class="layui-input">
  326. </th>
  327. </tr>
  328. <tr>
  329. <th class="form-title">项目类型<font style="color: red !important;">*</font></th>
  330. <th colspan="2">
  331. <div>
  332. <select name="engineering_type1" lay-verify="required">
  333. <option value="">请选择项目类型</option>
  334. <option value="1" <?php if($detail['engineering_type1'] == '1'): ?> selected <?php endif; ?>>预算</option>
  335. <option value="2"<?php if($detail['engineering_type1'] == '2'): ?> selected <?php endif; ?>>结算</option>
  336. </select>
  337. </div>
  338. </th>
  339. <th class="form-title">——</th>
  340. <th colspan="2">
  341. <div>
  342. <select name="engineering_type2" lay-verify="required">
  343. <option value="">请选择项目类型</option>
  344. <option value="1" <?php if($detail['engineering_type2'] == '1'): ?> selected <?php endif; ?>>审核</option>
  345. <option value="2" <?php if($detail['engineering_type2'] == '2'): ?> selected <?php endif; ?>>编制</option>
  346. </select>
  347. </div>
  348. </th>
  349. </tr>
  350. <tr>
  351. <th class="form-title">项目区域</th>
  352. <th colspan="2">
  353. <div>
  354. <div class="layui-form-item"
  355. style="margin-bottom: 0;display: flex;flex-direction: row;justify-content: space-between;">
  356. <div class="layui-input-inline" style="width: 6.5vw;">
  357. <select id="province" lay-filter="province" name="province"></select>
  358. </div>
  359. <div class="layui-input-inline area" style="width: 6.5vw;">
  360. <select id="city" lay-filter="city" name="city"></select>
  361. </div>
  362. <div class="layui-input-inline area" style="width: 6.5vw;">
  363. <select id="area" lay-filter="area" name="area"></select>
  364. </div>
  365. </div>
  366. </div>
  367. </th>
  368. </tr>
  369. <tr>
  370. <th class="form-title">资金性质</th>
  371. <th>
  372. <input type="radio" name="fiscal_nature" value="财政资金" title="财政资金" lay-filter="tax"
  373. <?php if($detail['fiscal_nature'] == '财政资金'): ?> checked <?php endif; ?> >
  374. <input type="radio" name="fiscal_nature" value="非财政资金" title="非财政资金" lay-filter="tax"
  375. <?php if($detail['fiscal_nature'] == '非财政资金'): ?> checked <?php endif; ?> >
  376. </th>
  377. <th class="form-title entrust_unit">委托单位 <font style="color: red !important;">*</font></th>
  378. <th colspan="2" class="entrust_unit">
  379. <input type="text" name="entrust_unit_name" autocomplete="off" readonly value="<?php echo htmlentities($detail['entrust_unit_name']); ?>" lay-reqText="当地财评委托单位" placeholder="当地财评委托单位" class="layui-input get-entrust">
  380. <input type="hidden" name="entrust_unit" value="<?php echo htmlentities($detail['entrust_unit']); ?>">
  381. </th>
  382. <tr>
  383. <th class="form-title">审批人 <font style="color: red !important;">*</font></th>
  384. <th colspan="2">
  385. <select name="sent_review_approver" lay-verify="required" lay-reqText="请选择审批人">
  386. <option value="">请选择审批人</option>
  387. {dump($person)}
  388. <?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;?>
  389. <option value="<?php echo htmlentities($v['id']); ?>" <?php if($detail['sent_review_approver'] == $v['id']): ?> selected="" <?php endif; ?>><?php echo htmlentities($v['nickname']); ?></option>
  390. <?php endforeach; endif; else: echo "" ;endif; ?>
  391. </select>
  392. </th>
  393. <th colspan="2">
  394. <select name="sent_review_second_approver" lay-reqText="请选择审批人">
  395. <option value="">请选择第二审批人(可选)</option>
  396. {dump($person)}
  397. <?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;?>
  398. <option value="<?php echo htmlentities($v['id']); ?>" <?php if($detail['sent_review_second_approver'] == $v['id']): ?> selected="" <?php endif; if(!isset($detail['sent_review_second_approver'])): ?>name=""<?php endif; ?>><?php echo htmlentities($v['nickname']); ?></option>
  399. <?php endforeach; endif; else: echo "" ;endif; ?>
  400. </select>
  401. </th>
  402. </tr>
  403. <tr>
  404. <th colspan="9" class="forleft">相关附件
  405. <button class="layui-btn layui-btn-xs layui-btn-danger" style="float: right;" type="button"
  406. id="uploadBtn">上传附件
  407. </button>
  408. </th>
  409. </tr>
  410. <tr>
  411. <th colspan="9" class="fujianimg" style="padding: 9px 0;">
  412. <div id="filesBox2">
  413. <div class="filelist" id="filesBigBox">
  414. <ul id="filesBox" style="overflow: scroll;">
  415. <?php echo fileCard($file_array); ?>
  416. </ul>
  417. </div>
  418. <?php if(empty($file_array) || (($file_array instanceof \think\Collection || $file_array instanceof \think\Paginator ) && $file_array->isEmpty())): ?>
  419. <div class="layui-data-none">暂无附件</div>
  420. <?php endif; ?>
  421. </div>
  422. </th>
  423. </tr>
  424. </table>
  425. <div class="py-3">
  426. <input type="hidden" name="id" value="<?php echo htmlentities($detail['id']); ?>"/>
  427. <?php if($detail['proprietor_status']==0): ?>
  428. <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="add">保存</button>
  429. <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="save">提交</button>
  430. <?php endif; ?>
  431. <!-- //审核中-->
  432. <?php if($detail['proprietor_status'] == 1): ?>
  433. <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="withdraw">撤回</button>
  434. <?php endif; ?>
  435. </div>
  436. </form>
  437. <!-- /主体 -->
  438. <!-- 底部 -->
  439. <div class="footer">
  440. 逸管工程项目管理系统 © www.yiguanfep.com
  441. <img src="/static/home/images/police.png" alt="" style="width:14.5px;height:16px;">
  442. <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>
  443. <a href="https://beian.miit.gov.cn/#/Integrated/index" onclick="window.open(this.href); return false;">桂ICP备17000971号</a>
  444. </div>
  445. <!-- /底部 -->
  446. <!-- 脚本 -->
  447. <script>
  448. var moduleInit = ['tool', 'oaTool'];
  449. var province = '';
  450. function Add() {
  451. var input1 = 0, input2 = 0;
  452. input1 = parseInt(document.getElementById("sent_review_amount").value);
  453. input2 = parseInt(document.getElementById("authorize_amount").value);
  454. if (input1 && input2) {
  455. var aa = input2 - input1;
  456. var bb = aa / input1 * 100;
  457. bb = bb.toFixed(2);
  458. $('[name="review_add_reduce_amount"]').val(aa);
  459. $('[name="review_add_reduce_rate"]').val(bb);
  460. $('#review_add_reduce_amount').html(aa);
  461. $('#review_add_reduce_rate').html(bb)
  462. } else {
  463. $('[name="review_add_reduce_amount"]').val('');
  464. $('[name="review_add_reduce_rate"]').val('');
  465. $('#review_add_reduce_amount').html('');
  466. $('#review_add_reduce_rate').html('')
  467. }
  468. // 总审定金额-总送审金额
  469. }
  470. function gouguInit() {
  471. var form = layui.form, tool = layui.tool, oaTool = layui.oaTool;
  472. let adress;
  473. //日期选择
  474. layui.laydate.render({
  475. elem: '#date',
  476. range: ['#start_time', '#end_time'],
  477. rangeLinked: true
  478. });
  479. var selectedNature = $('input[name="fiscal_nature"]:checked').val();
  480. if (selectedNature == "财政资金") {
  481. $(".entrust_unit").show();
  482. $(".review_unit").hide();
  483. } else {
  484. $(".review_unit").show();
  485. $(".entrust_unit").hide();
  486. }
  487. //radio选择
  488. form.on('radio(tax)', function (data) {
  489. if (data.value == "财政资金") {
  490. console.log(1)
  491. $(".entrust_unit").show();
  492. $(".review_unit").hide();
  493. } else {
  494. $(".review_unit").show();
  495. $(".entrust_unit").hide();
  496. }
  497. });
  498. $('.customer-picker').on('click', function () {
  499. let that = $(this);
  500. let callback = function(data){
  501. console.log(data);
  502. $('[name="review_unit"]').val(data.id);
  503. $('[name="review_unit_name"]').val(data.title);
  504. }
  505. oaTool.customerPicker(callback);
  506. });
  507. $('.get-entrust').on('click', function () {
  508. let that = $(this);
  509. let callback = function(data){
  510. console.log(data);
  511. $('[name="entrust_unit"]').val(data.id);
  512. $('[name="entrust_unit_name"]').val(data.title);
  513. }
  514. oaTool.getEntrust(callback);
  515. });
  516. let c = 1;
  517. //监听提交
  518. form.on('submit(add)', function (data) {
  519. if(data.field.fiscal_nature=="财政资金"){
  520. delete data.field.review_unit;
  521. delete data.field.review_unit_name;
  522. if(data.field.entrust_unit==""&&data.field.entrust_unit_name==""){
  523. layer.msg("请选择委托单位")
  524. return false;
  525. }
  526. }else {
  527. delete data.field.entrust_unit;
  528. delete data.field.entrust_unit_name;
  529. if(data.field.review_unit==""&&data.field.review_unit_name==""){
  530. layer.msg("请选择评审单位")
  531. return false;
  532. }
  533. }
  534. if (c) {
  535. let callback = function (e) {
  536. c = 1
  537. layer.msg(e.msg);
  538. if (e.code == 0) {
  539. tool.sideClose(1000);
  540. }
  541. }
  542. var engineering_type1 = '';
  543. if (data.field.engineering_type1 == 1) {
  544. engineering_type1 = '预算';
  545. } else if (data.field.engineering_type1 == 2) {
  546. engineering_type1 = '结算';
  547. }
  548. var engineering_type2 = '';
  549. if (data.field.engineering_type2 == 1) {
  550. engineering_type2 = '审核';
  551. } else if (data.field.engineering_type2 == 2) {
  552. engineering_type2 = '编制';
  553. }
  554. if(engineering_type1!==""&&engineering_type2!==""){
  555. data.field.engineering_type = engineering_type1 + "-" + engineering_type2;
  556. }
  557. tool.post("/admin/project.cost_proprietor/edit", data.field, callback);
  558. }
  559. c = 0
  560. return false;
  561. });
  562. form.on('submit(save)', function (data) {
  563. if(data.field.fiscal_nature=="财政资金"){
  564. if(data.field.entrust_unit==""&&data.field.entrust_unit_name==""){
  565. layer.msg("请选择委托单位")
  566. return false;
  567. }
  568. }else {
  569. if(data.field.review_unit==""&&data.field.review_unit_name==""){
  570. layer.msg("请选择评审单位")
  571. return false;
  572. }
  573. }
  574. if (c) {
  575. let callback = function (e) {
  576. c = 1
  577. layer.msg(e.msg);
  578. if (e.code == 0) {
  579. tool.sideClose(1000);
  580. }
  581. }
  582. var engineering_type1 = '';
  583. if (data.field.engineering_type1 == 1) {
  584. engineering_type1 = '预算';
  585. } else if (data.field.engineering_type1 == 2) {
  586. engineering_type1 = '结算';
  587. }
  588. var engineering_type2 = '';
  589. if (data.field.engineering_type2 == 1) {
  590. engineering_type2 = '审核';
  591. } else if (data.field.engineering_type2 == 2) {
  592. engineering_type2 = '编制';
  593. }
  594. if(engineering_type1!==""&&engineering_type2!==""){
  595. data.field.engineering_type = engineering_type1 + "-" + engineering_type2;
  596. }
  597. tool.post("/admin/project.cost_proprietor/save", data.field, callback);
  598. }
  599. c = 0
  600. return false;
  601. });
  602. let a2 = 1;
  603. form.on('submit(withdraw)', function (data) {
  604. if(a2){
  605. let callback = function (e) {
  606. a2 = 1
  607. layer.msg(e.msg);
  608. if (e.code == 0) {
  609. tool.sideClose(1000);
  610. }
  611. }
  612. if(data.field.engineering_type1!==""&&data.field.engineering_type2!==""){
  613. var engineering_type1 ='';
  614. if(data.field.engineering_type1==1){
  615. engineering_type1 ='预算';
  616. }else if(data.field.engineering_type1==2){
  617. engineering_type1 ='结算';
  618. }else if(data.field.engineering_type1==3){
  619. engineering_type1 ='概算';
  620. }else if(data.field.engineering_type1==4){
  621. engineering_type1 ='决算';
  622. }else if(data.field.engineering_type1==5){
  623. engineering_type1 ='工程总承包(EPC)';
  624. }
  625. var engineering_type2 = '';
  626. if(data.field.engineering_type2==1){
  627. engineering_type2 ='审核';
  628. }else if(data.field.engineering_type2==2) {
  629. engineering_type2 = '编制';
  630. }
  631. if(engineering_type1!==""&&engineering_type2!==""){
  632. data.field.engineering_type = engineering_type1 + "-" + engineering_type2;
  633. }
  634. }
  635. tool.post("/admin/project.cost_proprietor/withdraw", data.field, callback);
  636. }
  637. a2 = 0
  638. return false;
  639. });
  640. oaTool.addFile({
  641. type: 1,
  642. isSave: true,
  643. ajaxSave: function (res) {
  644. let callback = function (e) {
  645. if (e.code == 202) {
  646. layer.msg(e.msg);
  647. } else {
  648. layer.msg('上传成功!');
  649. }
  650. setTimeout(function () {
  651. $("#filesBox").load(location.href + " #filesBox>*", { type: 2 })
  652. }, 500)
  653. }
  654. tool.post("/admin/project.api/add_file", {
  655. 'topic_id': "<?php echo htmlentities($detail['id']); ?>",
  656. 'file_id': res.data.id,
  657. 'file_name': res.data.name,
  658. 'module': 'project'
  659. }, callback);
  660. }
  661. });
  662. $('#filesBox2').on('click', '.file-del', function () {
  663. let id = $(this).parent().parent().data('id');
  664. layer.confirm('确定要删除该文件吗?请慎重', {icon: 3, title: '提示'}, function (index) {
  665. let callback = function (e) {
  666. $("#" + id + "").remove();
  667. layer.closeAll();
  668. layer.msg(e.msg);
  669. $('[lay-filter="webform"]').click();
  670. }
  671. tool.delete("/admin/project.api/delete_file_company", {id: id}, callback);
  672. });
  673. })
  674. layui.use(['form', 'jquery'], function () {
  675. var form = layui.form;
  676. const $ = layui.jquery;
  677. let adress;
  678. $.ajax({
  679. type: "get", //使用get方式
  680. url: "/static/assets/layui/adress.json", //json文件相对于这个HTML的路径
  681. dataType: "json",
  682. async: false,
  683. success: function (data) {
  684. //这个data就是json数据
  685. adress = data
  686. var province = Object.keys(adress)
  687. var proStrs = '<option value="">省</option>';
  688. for (var i = 0; i < province.length; i++) {
  689. proStrs += '<option value="' + province[i] + '">' + province[i] + '</option>';
  690. }
  691. $("#province").html(proStrs);
  692. layui.form.render("select")
  693. },
  694. error: function () {
  695. layer.alert("地址请求失败!! ");
  696. }
  697. });
  698. function getFirstAttr(obj) {
  699. for (var k in obj) return k;
  700. }
  701. function selectOption(selectedProvince, selectedCity = '', selectedArea = '') {
  702. var proStr = '<option value="">省</option>', cityStr = '<option value="">市</option>',
  703. areaStr = '<option value="">县</option>';
  704. var pro = adress[selectedProvince], ci = adress[selectedProvince][selectedCity];
  705. for (var province in adress) {
  706. if (province == selectedProvince) proStr += '<option value="' + province + '" selected>' + province + '</option>';
  707. else proStr += '<option value="' + province + '">' + province + '</option>';
  708. }
  709. $("#province").html(proStr);
  710. for (var city in pro) {
  711. if (city == selectedCity) cityStr += '<option value="' + city + '" selected>' + city + '</option>';
  712. else cityStr += '<option value="' + city + '">' + city + '</option>';
  713. }
  714. $("#city").html(cityStr);
  715. for (var area in ci) {
  716. if (area == "remove") {
  717. continue;
  718. }
  719. if (ci[area] == selectedArea) areaStr += '<option value="' + ci[area] + '" selected>' + ci[area] + '</option>';
  720. else areaStr += '<option value="' + ci[area] + '">' + ci[area] + '</option>';
  721. }
  722. $("#area").html(areaStr);
  723. form.render();
  724. }
  725. /*selectOption(1,2, 3);*/
  726. form.on('select(province)', function (data) {
  727. let thisProvince = data.value;
  728. let thisCity = getFirstAttr(adress[thisProvince]);
  729. selectOption(data.value);
  730. });
  731. form.on('select(city)', function (data) {
  732. selectOption($("#province").val(), data.value, getFirstAttr(data.value));
  733. });
  734. selectOption("<?php echo htmlentities($detail['province']); ?>","<?php echo htmlentities($detail['city']); ?>","<?php echo htmlentities($detail['area']); ?>")
  735. })
  736. }
  737. </script>
  738. <!-- /脚本 -->
  739. <!-- <script src="/static/assets/layui/layui.js"></script> -->
  740. <script src="/static/assets/layui/layui.js"></script>
  741. <script src="/static/assets/third_party/echart/echarts.min.js"></script>
  742. <script src="/static/assets/gougu/gouguInit.js"></script>
  743. <script src="https://unpkg.com/pinyin-pro"></script>
  744. <script>
  745. var { pinyin } = pinyinPro;
  746. </script>
  747. <!-- 统计代码 -->
  748. <!-- /统计代码 -->
  749. </body>
  750. </html>