WIDGET-CONT-PRJ-PRO.lview 5.56 KB
Newer Older
niminmin's avatar
niminmin committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120
<?xml version="1.0" encoding="UTF-8"?>

<!--
    $Author:
    $Date: 2018/8/2
    $Revision: 1.0
    项目/合同微件
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
    <a:init-procedure/>
    <a:view template="default" package="leaf.ui.std">
        <!--单独微件测试用-->
        <!--<meta name="_csrf" content="${/session/@_csrf.token}"/>
        <meta name="_csrf_header" content="X-CSRF-TOKEN" />
        <script src="${/request/@context_path}/leafresource/js/attach/g2.min.js"></script>-->
        <style>
            html,body{
            width:840px;
            height:456px;
            margin: 0;
            padding: 0;
            color:#000;
            }
            #widget_cont_prj_pro .statusBox{
            display:inline-block;
            height:26px;
            line-height:26px;
            padding:0 10px;
            background: rgba(90,127,255,0.15);
            border-radius: 3.73px;
            font-family: PingFangSC-Regular;
            font-size: 11.93px;
            color: #4866CC;
            letter-spacing: 0;
            text-align: center;
            }
            #widget_cont_prj_pro .icon{
            height:16px;
            cursor:pointer
            }
        </style>
        <script><![CDATA[
        function prj_number_name_renderer(record,index){
            var project_number=record.data["project_number"]||'';
            var name=record.data["name"]||'';
            return '<p>'+ project_number +'</p>' + '<p title="' + name + '">'+ name +'</p>'
        }
        function cont_number_name_renderer(record,index){
            var contract_number=record.data["contract_number"]||'';
            var name=record.data["name"]||'';
            return '<p>'+ contract_number +'</p>' + '<p title="' + name + '">'+ name +'</p>'
        }
        function amount_currency_renderer(record,index){
            var amount = record.data["amount"]||0;
            var currency = record.data["currency"]||'币种不详';
            return '<p>'+ amount +'</p>' + '<p>'+ currency +'</p>'
        }
        function status_renderer(record,index){
            var status=record.data["status"]||'';
            return '<span class="statusBox">'+ status +'</span>'
        }
        function flow_chart_renderer(record,index){
            return '<img src="${/request/@context_path}/leafresource/images/widget/flow-chart.png" class="icon"/>'
        }
            ]]></script>
        <a:dataSets>
            <a:dataSet id="my_cont_pro_ds" autoQuery="true" pageSize="5" model="cont.CON1003.my_cont" >
                <a:fields>
                    <a:field name="bp_name"/>
                    <a:field name="name"/>
                    <a:field name="contract_number"/>
                    <a:field name="amount"/>
                    <a:field name="first_date"/>
                    <a:field name="organization"/>
                    <a:field name="employee_name"/>
                    <a:field name="legal_person"/>
                    <a:field name="currency"/>
                    <a:field name="status"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="my_prj_pro_ds" autoQuery="true" pageSize="5" model="prj.PRJ1101.my_prj" >
                <a:fields>
                    <a:field name="bp_name"/>
                    <a:field name="name"/>
                    <a:field name="project_number"/>
                    <a:field name="amount"/>
                    <a:field name="first_date"/>
                    <a:field name="organization"/>
                    <a:field name="employee_name"/>
                    <a:field name="legal_person"/>
                    <a:field name="currency"/>
                    <a:field name="status"/>
                </a:fields>
            </a:dataSet>
        </a:dataSets>
        <a:tabGrid id="widget_cont_prj_pro" title="项目/合同" width="840" height="476">
            <a:grids>
                <a:grid bindTarget="my_prj_pro_ds" title="我的项目" gridHeaderHeight="40" gridLineHeight="56">
                    <a:column template="prj_number_name_renderer" prompt="项目编号/项目名称" align="left"/>
                    <a:column template="amount_currency_renderer" prompt="金额/币种" align="center"/>
                    <a:column name="first_date" prompt="入库时间" align="center"/>
                    <a:column name="employee_name" prompt="主办人" align="center"/>
                    <a:column name="organization" prompt="部门" align="center"/>
                    <a:column template="status_renderer" prompt="项目状态" align="center"/>
                    <a:column template="flow_chart_renderer" prompt="流程图" align="center"/>
                </a:grid>
                <a:grid bindTarget="my_cont_pro_ds" title="我的合同" gridHeaderHeight="40" gridLineHeight="56">
                    <a:column template="cont_number_name_renderer" prompt="合同编号/合同名称" align="left"/>
                    <a:column template="amount_currency_renderer" prompt="金额/币种" align="center"/>
                    <a:column name="first_date" prompt="入库时间" align="center"/>
                    <a:column name="employee_name" prompt="主办人" align="center"/>
                    <a:column name="organization" prompt="部门" align="center"/>
                    <a:column template="status_renderer" prompt="合同状态" align="center"/>
                    <a:column template="flow_chart_renderer" prompt="流程图" align="center"/>
                </a:grid>
            </a:grids>
        </a:tabGrid>
        <a:screenBody style="display:none"> </a:screenBody>
    </a:view>
</a:screen>