WIDGET-WFL.lview 10.3 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 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256
<?xml version="1.0" encoding="UTF-8"?>

<!--
    $Author:Think
    $Revision: 1.0
    工作流
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application"
          xmlns:s="leaf.plugin.script" trace="true">
    <a:init-procedure>
    </a:init-procedure>
    <a:view template="default" package="leaf.ui.std">
        <a:link id="widget_wfl_node_approve_history_link_id"
                url="${/request/@context_path}/modules/zjwfl/ZJWFL3040/zj_wfl_my_approved_application_history.lview"/>
        <style>
            html, body {
                width: 264px;
                height: 464px;
                margin: 0;
                padding: 0;
            }
            #widget_wfl .label {
                left: 10px;
            }
            #widget_wfl .title {
                padding-left: 10px;
                margin:10px 0;
            }
            #widget_wfl .btns {
                margin: 10px 10px 10px 10px;
            }
            #widget_wfl .search {
                box-sizing: border-box;
                width: 100%;
                height: 22px;
                text-align: right;
                padding: 0 10px;
            }
            #widget_wfl .search .search_box{
                width: 100%;
                right: 0;
                text-align: left;
            }
            #widget_wfl .search .search_box .search_input{
                width:80%;
            }
            #widget_wfl .search .search_box .search_btn{
                position: absolute;
            }
            #widget_wfl .grids {
                margin: 0 10px 0 10px;
            }
            #widget_wfl .grid .grid-foot .page-message .page_message_refresh {
                height: 12px;
                margin-right: 0px;
            }
            #widget_wfl .hls-table tr img {
                height: 14px;
            }
            #widget_wfl .hls-table tr td .listRow1 {
                height: 17px;
                width: 100%;
                margin-bottom: 8px;
            }
            #widget_wfl .hls-table tr td .listRow1 .workflow_info {
                float: left;
                max-width: 160px;
                overflow: hidden;
                line-height: 17px;
                white-space: nowrap;
                text-overflow: ellipsis;
                font-family: PingFangSC-Regular;
                font-size: 12px;
                cursor: pointer;
                color: rgba(75, 80, 90, 0.75);
            }
            #widget_wfl .hls-table tr td .listRow1 .date {
                float: right;
                font-family: PingFangSC-Regular;
                font-size: 12px;
                line-height: 17px;
                color: rgba(75, 80, 90, 0.45);
            }
            #widget_wfl .hls-table tr td .listRow2 {
                height: 14px;
                width: 100%;
                cursor: pointer;
            }
            #widget_wfl .hls-table tr td .listRow2 .submit_name {
                float: left;
                font-family: PingFangSC-Regular;
                font-size: 12px;
                color: #4866CC;
                line-height: 14px;
            }
            #widget_wfl .hls-table tr td .listRow2 .submit_name img {
                margin-right: 8px;
                position: relative;
                top: 1px;
            }
            #widget_wfl .hls-table tr td .listRow2 .goDetail {
                float: right;
                line-height: 14px;
                position: relative;
                top: 1px;
                cursor: pointer;
            }
            #widget_wfl .hls-table tr td .clearFloat {
                clear: both;
                height: 0;
                line-height: 0;
                font-size: 0
            }
            #widget_wfl tbody {
                text-align: center !important;
            }
            #widget_wfl tbody .grid_no_date {
                margin-left: 0 !important;
                position: relative !important;
            }
        </style>
        <script><![CDATA[
        function wfl_grid_renderer(record, index) {
            var html = '';
            html += '<div class="listRow1" onclick="wfl_winOpen_zjwfl5110_wfl_approve(' + record.data.instance_id + ',' + record.data.node_id + ',' + record.data.record_id + ',' + record.data.workflow_id + ',\'' + record.data.record_type + '\')">'
                + '<span class="workflow_info" title="' + record.data['workflow_info'] + '">' + record.data['workflow_info'] + '</span>';
            html += '<span class="date">' + formatDate(record.data['creation_date_format']) + '</span>'
                + '<span class="clearFloat"></span></div>'
                + '<div class="listRow2">'
                + '<span class="submit_name"><img src="${/request/@context_path}/leafresource/images/wfl/user@2x.png"/>' + record.data['submitted_by_name'] + '</span>'
                + '<img class="goDetail" src="${/request/@context_path}/leafresource/images/wfl/right_square@2x.png" />'
                + '<span class="clearFloat"></span></div>';
            return html;
        }
        function wfl_approval_grid_renderer(record, index) {
            var html = '';
            html += '<div class="listRow1" onclick="winOpen_approve_history(' + record.data.instance_id + ',' + record.data.rcpt_record_id + ',' + record.data.approve_record_id + ',\'' + record.data.rcpt_record_type + '\')">'
                + '<span class="workflow_info" title="' + record.data['document_info'] + '">' + record.data['document_info'] + '</span>';
            html += '<span class="date">' + formatDate(record.data['approve_date']) + '</span>'
                + '<span class="clearFloat"></span></div>'
                + '<div class="listRow2">'
                + '<span class="submit_name"><img src="${/request/@context_path}/leafresource/images/wfl/user@2x.png"/>' + record.data['user_name'] + '</span>'
                + '<img class="goDetail" src="${/request/@context_path}/leafresource/images/wfl/right_square@2x.png" />'
                + '<span class="clearFloat"></span></div>';
            return html;
        }
        function formatDate(time) {
            var time = new Date(time).format('yyyy-mm-dd')
            return time;

        }
        function wfl_winOpen_zjwfl5110_wfl_approve(instance_id, node_id, record_id, workflow_id, record_type) {
            var url_type;
            if (record_type == 'NOTICE') {
                url_type = 'NOTICE';
            } else {
                url_type = 'DISPLAY';
            }
            var win = new Leaf.Window({
                id: 'widget_wfl_approve_win',
                url: '${/request/@context_path}/modules/zjwfl/ZJWFL5110/zj_wfl_approve.lview',
                params: {
                    instance_id: instance_id,
                    node_id: node_id,
                    record_id: record_id,
                    workflow_id: workflow_id,
                    record_type: record_type,
                    url_type: url_type
                },
                title: '工作流审批',
                height: 500,
                width: 860,
                fullScreen: true
            });
            win.on('close', function () {
                //query_zjwfl5110_toDoDs();
                location.reload();
            });
        }
        function winOpen_approve_history(instance_id, rcpt_record_id, approve_record_id, rcpt_record_type) {
            var url_type;
            if (rcpt_record_type == 'NOTICE') {
                url_type = 'NOTICE';
            } else {
                url_type = 'DISPLAY_MY_APPROVED';
            }
            var win = new Leaf.Window({
                id: 'node_approve_history_win',
                url: $('widget_wfl_node_approve_history_link_id').getUrl(),
                params: {
                    instance_id: instance_id,
                    rcpt_record_id: rcpt_record_id,
                    approve_record_id: approve_record_id,
                    url_type: url_type
                },
                title: '单据明细',
                fullScreen: true
            });
            win.on('close', function () {
                //query_zjwfl5110_toDoDs();
                location.reload();
            });

        }
        function searchWfl(documentInfo) {
            //代办事项
            var params = {
                any_info: documentInfo,
                workflow_info: documentInfo,
                document_info: documentInfo
            }
            $('zjwfl_zjwfl5110_ds').qpara = params;
            $('zjwfl_zjwfl5110_ds').query();
            //已办事项
            var paramApproved = {
                node_desc: documentInfo,
                document_info: documentInfo
            }
            $('zjwfl_ZJWFL3040_ds').qpara = params;
            $('zjwfl_ZJWFL3040_ds').query();
        }
        ]]></script>
        <a:dataSets>
            <a:dataSet id="zjwfl_zjwfl5110_ds" autoQuery="true" pageSize="5"
                       model="zjwfl.ZJWFL5110.sdic_wfl_instance_node_recipient">
                <a:fields>
                    <a:field name="instance_id"/>
                    <a:field name="node_id"/>
                    <a:field name="record_id"/>
                    <a:field name="workflow_id"/>
                    <a:field name="record_type"/>
                    <a:field name="workflow_info"/>
                    <a:field name="submitted_by_name"/>
                    <a:field name="creation_date_format"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="zjwfl_ZJWFL3040_ds" autoQuery="true" pageSize="5"
                       model="zjwfl.ZJWFL3040.zj_wfl_my_approved_application">
                <a:fields>
                </a:fields>
            </a:dataSet>
        </a:dataSets>
        <a:tabGrid id="widget_wfl" title="审批事项" width="264" height="464"
                   enableSearch="true" searchPrompt="" searchCallback="searchWfl">
            <a:grids>
                <a:grid bindTarget="zjwfl_zjwfl5110_ds" title="待办" gridLineHeight="56">
                    <a:column template="wfl_grid_renderer"/>
                </a:grid>
                <a:grid bindTarget="zjwfl_ZJWFL3040_ds" title="已办" gridLineHeight="56">
                    <a:column template="wfl_approval_grid_renderer"/>
                </a:grid>
            </a:grids>
        </a:tabGrid>
        <a:screenBody style="display:none"></a:screenBody>
    </a:view>
</a:screen>