b09d4c254bb0edef7736b8b17d166d89.php 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455
  1. <?php /*a:2:{s:74:"D:\phpstudy_pro\WWW\caiping\app\admin\view\project\appropriation\read.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. .fujian {
  21. display: flex;
  22. }
  23. .fujianimg {
  24. height: auto !important;
  25. }
  26. .fujianimg img {
  27. height: auto !important;
  28. }
  29. .form-title {
  30. background-color: rgb(241, 241, 241);
  31. color: rgb(95, 95, 95);
  32. border-color: rgb(241, 241, 241);
  33. text-align: center;
  34. border-color: #e2e2e2;
  35. }
  36. .filelist{
  37. width: 100%;
  38. overflow: auto;
  39. justify-content:flex-start;
  40. align-content: space-between;
  41. flex-direction: column-reverse;
  42. flex-wrap: wrap;
  43. display: flex;
  44. }
  45. .filelist li{
  46. padding: 0.5vw 0.8vw 0.5vw 0.8vw;
  47. white-space: nowrap;
  48. overflow: hidden;
  49. text-overflow: ellipsis;
  50. display: inline-block;
  51. border-right: 1px solid #e2e2e2;
  52. float: left;
  53. }
  54. .filelist p{
  55. margin: 3px 0 5px 0;
  56. width: 11vw;
  57. overflow: hidden;
  58. text-overflow: ellipsis;
  59. text-align: center;
  60. }
  61. .layui-table th{
  62. text-align: center !important;
  63. font-weight: 500;
  64. }
  65. .layui-anim dd{
  66. text-align: left;
  67. }
  68. .layui-th-gray{
  69. background-color: rgb(241, 241, 241);
  70. }
  71. .layui-table th{
  72. border-color: #e2e2e2
  73. }
  74. .forleft {
  75. text-align: left !important;
  76. }
  77. .footer{
  78. display: none;
  79. }
  80. .layui-btn-group span:last-child{
  81. display: none;
  82. }
  83. </style>
  84. </head>
  85. <body class="main-body">
  86. <!-- 主体 -->
  87. <div class="p-3">
  88. <table class="layui-hide" id="appropriation_add" lay-filter="appropriation_add"></table>
  89. <form class="layui-form p-4">
  90. <table class="layui-table layui-table-form">
  91. <tr>
  92. <th class="layui-th-gray">委托单位</th>
  93. <th colspan="5">
  94. <?php echo htmlentities($detail['entrust_unit_name']); ?>
  95. </th>
  96. <th class="layui-th-gray">是否开票</th>
  97. <th colspan="2">
  98. <input type="radio" name="invoice_status" value="1" title="是" <?php if($detail['invoicing_whether']!=0): ?>checked<?php endif; ?> disabled="disabled">
  99. <input type="radio" name="invoice_status" value="0" title="否" <?php if($detail['invoicing_whether']==0): ?>checked<?php endif; ?> disabled="disabled">
  100. </th>
  101. </tr>
  102. <tr>
  103. <th class="layui-th-gray">发票编号</th>
  104. <th colspan="2">
  105. <input type="text" name="invoicing_num" autocomplete="off" placeholder="请输入发票编号" class="layui-input" value="<?php echo htmlentities($detail['invoicing_num']); ?>" disabled="disabled">
  106. </th>
  107. <th class="layui-th-gray">发票类型</th>
  108. <th colspan="2">
  109. <select name="invoice_type" lay-verify="required" disabled="disabled">
  110. <option value="0"></option>
  111. <option value="1" <?php if($detail['invoice_type']==1): ?>selected<?php endif; ?>>普通发票</option>
  112. <option value="2" <?php if($detail['invoice_type']==2): ?>selected<?php endif; ?>>专用发票</option>
  113. <option value="3" <?php if($detail['invoice_type']==3): ?>selected<?php endif; ?>>电子普票</option>
  114. <option value="4" <?php if($detail['invoice_type']==4): ?>selected<?php endif; ?>>电子专票</option>
  115. </select>
  116. </th>
  117. <th class="layui-th-gray">发票金额</th>
  118. <th colspan="2">
  119. <input type="text" name="invoicing_amount" autocomplete="off" placeholder="请输入发票金额" class="layui-input" value="<?php echo htmlentities($detail['invoicing_amount']); ?>" disabled="disabled">
  120. </th>
  121. </tr>
  122. <tr>
  123. <th colspan="9" class="forleft" style="text-align:left !important;">相关附件
  124. <!--<button class="layui-btn layui-btn-xs layui-btn-normal" style="float: right;" type="button"-->
  125. <!-- id="uploadBtn">上传附件-->
  126. <!--</button>-->
  127. </th>
  128. </tr>
  129. <tr>
  130. <th colspan="9" class="fujianimg" style="padding: 9px 0;">
  131. <div id="filesBox2">
  132. <div class="filelist" id="filesBigBox">
  133. <ul id="filesBox">
  134. <?php echo fileCard($file_array); ?>
  135. </ul>
  136. </div>
  137. <?php if(empty($file_array) || (($file_array instanceof \think\Collection || $file_array instanceof \think\Paginator ) && $file_array->isEmpty())): ?>
  138. <div class="layui-data-none" >暂无附件</div>
  139. <?php endif; ?>
  140. </div>
  141. </th>
  142. </tr>
  143. </table>
  144. </form>
  145. </div>
  146. <!-- /主体 -->
  147. <!-- 底部 -->
  148. <div class="footer">
  149. 逸管工程项目管理系统 © www.yiguanfep.com
  150. <img src="/static/home/images/police.png" alt="" style="width:14.5px;height:16px;">
  151. <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>
  152. <a href="https://beian.miit.gov.cn/#/Integrated/index" onclick="window.open(this.href); return false;">桂ICP备17000971号</a>
  153. </div>
  154. <!-- /底部 -->
  155. <!-- 脚本 -->
  156. <script>
  157. var moduleInit = ['tool', 'oaTool'];
  158. function gouguInit() {
  159. var form = layui.form, tool = layui.tool, oaTool = layui.oaTool, table = layui.table, layer = layui.layer;
  160. var file_ids = [];
  161. var project_ids = [];
  162. layui.pageTable = table.render({
  163. elem: '#appropriation_add',
  164. id: "appropriation_add",
  165. title: '造价项目列表',
  166. url: '/admin/project.appropriation/read?id=' + '<?php echo htmlentities($id); ?>',
  167. totalRow: true,
  168. cellMinWidth: 150,
  169. cols: [
  170. [{
  171. fixed: 'left',
  172. field: 'id',
  173. title: '编号',
  174. align: 'center',
  175. width: 80,
  176. totalRowText: "合计"
  177. }, {
  178. field: 'project_name',
  179. title: '项目名称',
  180. align: 'center',
  181. }, {
  182. field: 'sent_review_amount',
  183. title: '送审服务费',
  184. align: 'center',
  185. totalRow: true,
  186. }, {
  187. field: 'appropriation_amount',
  188. title: '请款金额',
  189. align: 'center',
  190. totalRow: true,
  191. }, {
  192. field: 'refund_amount',
  193. title: '回款金额',
  194. align: 'center',
  195. totalRow: true,
  196. // edit: true
  197. }
  198. ]
  199. ],
  200. css: [
  201. // 对开启了编辑的单元格追加样式
  202. '.layui-table-view th[data-edit]{color: #16B777;}'
  203. ].join(''),
  204. });
  205. table.on('edit(appropriation_add)', function (obj) {
  206. var field = obj.field; // 得到修改的字段
  207. var value = obj.value // 得到修改后的值
  208. var data = obj.data // 得到所在行所有键值
  209. var id = data.id;
  210. // 值的校验
  211. if (value.replace(/\s/g, '') === '') {
  212. layer.tips('值不能为空', this, {tips: 1});
  213. return obj.reedit(); // 重新编辑 -- v2.8.0 新增
  214. }
  215. let callback = function (e) {
  216. let sent_review_amount = 0;
  217. let appropriation_amount = 0;
  218. let refund_amount = 0;
  219. layui.each(layui.table.cache['appropriation_add'], function (index, row) {
  220. sent_review_amount += row.sent_review_amount;
  221. appropriation_amount += row.appropriation_amount;
  222. refund_amount += row.refund_amount
  223. });
  224. // $(".layui-table-total th[data-field=sent_review_amount]").html(sent_review_amount);
  225. // $(".layui-table-total th[data-field=appropriation_amount]").html(appropriation_amount);
  226. // $(".layui-table-total th[data-field=refund_amount]").html(`<div className="layui-table-cell laytable-cell-1-0-4" align="center">${refund_amount}</div>`);
  227. layui.pageTable.reload();
  228. layer.msg(e.msg)
  229. }
  230. tool.post("edit", data, callback)
  231. });
  232. form.on('submit(webform)', function (data) {
  233. let refund_amount = 0;
  234. layui.each(layui.table.cache['appropriation_add'], function (index, row) {
  235. refund_amount += Number(row.refund_amount)
  236. });
  237. data.field.refund_amount = refund_amount;
  238. delete data.field.file;
  239. console.log(data);
  240. let callback = function (e) {
  241. layer.msg(e.msg)
  242. parent.location.reload();
  243. if (e.code == 0) {
  244. tool.sideClose(1000);
  245. }
  246. }
  247. tool.post("/admin/project.appropriation/cc_edit", data.field, callback)
  248. return false;
  249. });
  250. form.on('submit(save)', function (data) {
  251. let callback = function (e) {
  252. layer.msg(e.msg)
  253. parent.location.reload();
  254. if (e.code == 0) {
  255. tool.sideClose(1000);
  256. }
  257. }
  258. tool.post("/admin/project.appropriation/disagree", data.field, callback)
  259. return false;
  260. });
  261. function fileCard(item) {
  262. var host = window.location.host;
  263. var li = '';
  264. if (item.length > 0) {
  265. for (var a = 0; a < item.length; a++) {
  266. let image = ['jpg', 'jpeg', 'png', 'gif'];
  267. let doc = ['doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'txt', 'pdf', 'zip', 'rar', '7z'];
  268. // let down = '<a href="'+item[a].filepath+'" target="_blank" class="layui-btn layui-btn-xs layui-btn-normal" download="'+item[a].name+'">下载</a>';
  269. let down = '<a href="' + item[a]['filepath'] + '" target="_blank" class="layui-btn layui-btn-xs layui-btn-normal" download="' + item[a]['name'] + '">预览</a>';
  270. // 判断元素是否在数组中
  271. let path = '/static/home/images/icon/file.png';
  272. if (image.includes(item[a].fileext)) {
  273. path = item[a].filepath;
  274. down = '<span data-href="' + item[a].filepath + '" class="layui-btn layui-btn-xs layui-btn-normal file-view-img">预览</span>';
  275. } else if (doc.includes(item[a].fileext)) {
  276. path = '/static/home/images/icon/' + item[a].fileext + '.png';
  277. }
  278. if (item[a].fileext == 'pdf') {
  279. down = '<span data-href="' + item[a].filepath + '" class="layui-btn layui-btn-xs layui-btn-normal file-view-pdf">预览</span>';
  280. }
  281. 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 +
  282. '" style="object-fit: contain;" class="file-item"><p title="' + item[a].name + '">' + item[a].name +
  283. '</p><div class="layui-btn-group">' + down +
  284. '<span class="layui-btn layui-btn-xs layui-btn-danger file-del">删除</span></div></li>';
  285. }
  286. return li;
  287. }
  288. }
  289. $('#filesBox').on('click', '.file-del', function () {
  290. let id = $(this).parent().parent().data('id');
  291. layer.confirm('确定要删除该文件吗?', {icon: 3, title: '提示'}, function () {
  292. let callback = function (e){
  293. layer.closeAll();
  294. if (e.hasOwnProperty("msg")) {
  295. layer.msg(e.msg);
  296. }
  297. if(e.code==0){
  298. var index = file_ids.indexOf(id);
  299. if (index > -1) {
  300. file_ids.splice(index, 1);
  301. }
  302. if (file_ids.length == 0) {
  303. $("#filesBox").append('<div id="nofile" class="layui-data-none" >暂无附件</div>');
  304. }
  305. $("#" + id).remove();
  306. }
  307. }
  308. tool.delete("/admin/project.api/delete_file", {id: id}, callback)
  309. });
  310. })
  311. oaTool.addFile({
  312. type: 1,
  313. isSave: true,
  314. ajaxSave: function (res) {
  315. if(file_ids.length<1){
  316. console.log(file_ids.length)
  317. let callback = function (e) {
  318. if (e.hasOwnProperty("msg")) {
  319. layer.msg(e.msg);
  320. } else {
  321. layer.msg('上传成功!')
  322. }
  323. if (e[0].id) {
  324. file_ids.push(e[0].id)
  325. $('#nofile').remove();
  326. $("#filesBox").append(fileCard(e));
  327. }
  328. }
  329. tool.post("/admin/project.api/add_file", {
  330. 'file_id': res.data.id,
  331. }, callback);
  332. }else {
  333. layer.msg('仅可上传一份文件!')
  334. }
  335. }
  336. });
  337. }
  338. </script>
  339. </script>
  340. <!-- /脚本 -->
  341. <!-- <script src="/static/assets/layui/layui.js"></script> -->
  342. <script src="/static/assets/layui/layui.js"></script>
  343. <script src="/static/assets/third_party/echart/echarts.min.js"></script>
  344. <script src="/static/assets/gougu/gouguInit.js"></script>
  345. <script src="https://unpkg.com/pinyin-pro"></script>
  346. <script>
  347. var { pinyin } = pinyinPro;
  348. </script>
  349. <!-- 统计代码 -->
  350. <!-- /统计代码 -->
  351. </body>
  352. </html>