123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300 |
- {extend name="common/base"/}
- {block name="style"}
- <style>
- .footer{
- width: 100%;
- height: 25px;
- text-align: center;
- position: fixed;
- bottom: 0;
- }
-
- .name{
- font-weight: 600;
- color: rgb(95,95,95);
-
- }
- .number-red{
- color: red;
- }
- .number-green{
- color: rgb(11,178,89);
- }
- .yuan{
- padding-right: 2vw;
- }
- .static{
- display: flex;
- }
- </style>
- {/block}
- <!-- 主体 -->
- {block name="body"}
- <div class="p-3">
- <form class="layui-form gg-form-bar border-t border-x">
- <div class="layui-input-inline" style="width:300px;">
- <input type="text" name="keywords" placeholder="请输入委托单位关键字" class="layui-input" autocomplete="off"/>
- </div>
- <div class="layui-input-inline">
- <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="searchform">提交搜索</button>
- </div>
- </form>
- <table class="layui-hide" id="appropriation" lay-filter="appropriation"></table>
- </div>
- <script type="text/html" id="toolbarDemo">
- <div class="layui-btn-container static">
- <div>
- <span class="layui-btn layui-btn-sm " data-title="添加造价项目" lay-event="add">+ 添加请款函</span>
- </div>
- <div>
- <span class="name">评审服务费:</span><span class="number-red">{$sent_review_cost}</span><span class="yuan">元</span>
- <span class="name">已请款:</span><span class="number-green">{$appropriation_amount}</span><span class="yuan">元</span>
- <span class="name">未请款:</span><span class="number-red">{$not_appropriation_amount}</span><span class="yuan">元</span>
- <span class="name">已开票:</span><span class="number-green">{$invoicing_amount}</span><span class="yuan">元</span>
- <span class="name">未开票:</span><span class="number-red">{$not_invoicing_amount}</span><span class="yuan">元</span>
- </div>
- </div>
- </script>
- <script type="text/html" id="barDemo">
- <div class="layui-btn-container">
- <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-normal layui-btn-xs" lay-event="edit">编辑</a>
- </div>
- </div>
- </script>
- {/block}
- <!-- /主体 -->
- <!-- 脚本 -->
- {block name="script"}
- <script>
- const moduleInit = ['tool'];
- function gouguInit() {
- var table = layui.table, tool = layui.tool, form = layui.form;
- var allcount;
- var num_aaa =0;
- layui.pageTable = table.render({
- elem: '#appropriation',
- title: '造价项目列表',
- toolbar: '#toolbarDemo',
- url: '/admin/project.appropriation/datalist_company',
- page: true,
- limit: 20,
- parseData: function(res) { // 数据解析回调函数
- // 在这里可以获取数据总数
- allcount = res.count;
- return {
- code: res.code, // 数据状态码
- msg: res.msg, // 状态信息
- count: res.count, // 数据总数
- data: res.data // 当前页数据
- };
- },
- cols: [
- [
- {fixed: 'left', field: 'id', title: '编号', align: 'center', width: 80,
- templet: function(d){
- return allcount - (d.LAY_NUM-1);
- }
- }, {
- field: 'status',
- title: '项目状态',
- align: 'center',
- width: 100,
- templet: function (item) {
- var html = '';
- if (item.status === 0) {
- html = '<span>立项中</span> ';
- } else if (item.status === 1) {
- html = '<span">审核中</span> ';
- } else if (item.status === 2) {
-
- html = '<span">已通过</span> ';
- } else if (item.status === 3) {
- html = '<span">已驳回</span> ';
- }else if (item.status === -1) {
- html = '<span">立项审核中</span> ';
- }else if (item.status === -2) {
- html = '<span">立项未通过</span> ';
- }
- return html;
- }
- }, {
- field: 'entrust_unit_name',
- title: '委托单位',
- align: 'center',
- width: 100
- }, {
- field: 'appropriation_amount',
- title: '请款金额',
- align: 'center',
- width: 100
- }, {
- field: 'appropriation_time',
- title: '请款时间',
- align: 'center',
- width: 150,
- templet: function (d) {
- if (d.appropriation_time) {
- return layui.util.toDateString(d.appropriation_time * 1000, "yyyy-MM-dd")
- } else {
- return "";
- }
- }
- }, {
- field: 'project_names',
- title: '相关项目',
- align: 'center',
- width: 150
- }, {
- field: 'refund_amount',
- title: '回款金额(元)',
- align: 'center',
- width: 150,
- templet: function (d) {
- if (d.refund_amount) {
- return `<u style="color: green">${d.refund_amount}</u>`
- } else {
- return ""
- }
- }
- }, {
- field: 'refund_time',
- title: '回款时间',
- align: 'center',
- width: 150,
- templet: function (d) {
- if (d.refund_time) {
- return layui.util.toDateString(d.refund_time * 1000, "yyyy-MM-dd")
- } else {
- return "";
- }
- }
- }, {
- field: 'invoicing_amount',
- title: '发票金额',
- align: 'center',
- width: 100,
- templet: function (d) {
- if (d.invoicing_amount) {
- return `<u style="color: green">${d.invoicing_amount}</u>`
- } else {
- return ""
- }
- }
- }, {
- field: 'invoicing_num',
- title: '发票编号',
- align: 'center',
- width: 150
- }, {
- field: 'invoice_status',
- title: '发票状态',
- align: 'center',
- width: 150,
- templet: function (d) {
- var h = "";
- if (d.invoice_status == 1) {
- h = "已开票";
- } else if (d.invoice_status == 0) {
- h = "未开票";
- }
- return h;
- }
- }, {
- field: 'invoice_type',
- title: '发票类型',
- align: 'center',
- width: 100,
- templet: function (d) {
- var h = "";
- if (d.invoice_status == 1) {
- h = "已开票";
- } else if (d.invoice_status == 0) {
- h = "未开票";
- }
- return h;
- }
- }, {
- field: 'invoice_detail',
- title: '请款函',
- align: 'center',
- }, {
- field: 'maker_name',
- title: '创建人名称',
- align: 'center',
- }, {
- fixed: 'right',
- field: 'right',
- title: '操作',
- toolbar: '#barDemo',
- width: 136,
- align: 'center'
- }
- ]
- ],
- done:function () {
- if(num_aaa === 0){
- parent.showhongdian()
- // console.log('2执行了')
- }
- }
- });
- //监听表头工具栏事件
- table.on('toolbar(appropriation)', function (obj) {
- if (obj.event === 'add') {
- tool.side("/admin/project.appropriation/add");
- return false;
- }
- });
- //监听表格行工具事件
- table.on('tool(appropriation)', function (obj) {
- if (obj.event === 'read') {
- tool.side("/admin/project.appropriation/c_read?id=" + obj.data.id);
- return false;
- }else if (obj.event === 'edit'){
- tool.side("/admin/project.appropriation/edit_company?id=" + obj.data.id);
- return false;
- }
- })
- //监听搜索提交
- form.on('submit(searchform)', function (data) {
- layui.pageTable.reload({
- where: {
- keywords: data.field.keywords
- },
- page: {
- curr: 1
- }
- });
- return false;
- });
- }
- </script>
- {/block}
- <!-- /脚本 -->
|