caipin hace 4 años
padre
commit
e281d255e6

+ 108 - 0
global/gridManager/common.css

@@ -0,0 +1,108 @@
+html, body{
+    width: 100%;
+    overflow-x:hidden;
+    margin: 0;
+    padding: 0;
+}
+.plugin-action{
+    display: inline-block;
+    color: steelblue;
+    margin-right: 10px;
+    cursor: pointer;
+    text-decoration: none;
+}
+.plugin-action:nth-child(1) {
+    margin-right: 0;
+}
+.plugin-action:hover{
+    text-decoration: underline;
+}
+.search-area{
+    padding: 10px 20px;
+    border: 1px solid #ccc;
+    background: #efefef;
+    margin-bottom: 15px;
+}
+.search-area .sa-ele{
+    display: inline-block;
+    margin-right: 20px;
+    font-size: 12px;
+}
+.search-area .sa-ele .se-title{
+    display: inline-block;
+    margin-right: 10px;
+}
+.search-area .sa-ele .se-con{
+    display: inline-block;
+    width:180px;
+    height: 24px;
+    border: 1px solid #ccc;
+    padding: 0 4px;
+    line-height: 24px;
+}
+.search-area .sa-ele .search-action, .search-area .sa-ele .reset-action{
+    display: inline-block;
+    width:80px;
+    height: 26px;
+    border: 1px solid #ccc;
+    background: #e8e8e8;
+    padding: 0 4px;
+    line-height: 26px;
+    text-align: center;
+    cursor: pointer;
+    margin-right: 10px;
+}
+.search-area .sa-ele .search-action:hover, .search-area .sa-ele .reset-action:hover{
+    opacity: 0.7;
+}
+
+.bottom-bar{
+    height: 30px;
+    background: #f8f8f8;
+    padding: 10px;
+    margin-top: 10px;
+}
+.fn-select{
+    width: 100px;
+    height: 28px;
+}
+.fn-code{
+    width: 400px;
+    height: 28px;
+    border: 0;
+    padding: 0 10px;
+}
+.fn-run-info{
+    font-size: 12px;
+    padding: 0 10px;
+}
+.bottom-bar .fn-run-info a{
+    color: #0f88eb;
+    margin: 0;
+}
+.success-info{
+    color: #008800;
+}
+.error-info{
+    color: #880000;
+}
+.bottom-bar button{
+    padding: 5px 20px;
+    margin-right: 10px;
+    border: 1px solid #999;
+}
+.bottom-bar a{
+    font-size: 12px;
+    margin-right: 10px;
+}
+.void-template{
+    height:300px;
+    line-height: 300px;
+    text-align: center;
+    font-size: 24px;
+    color: #ccc;
+}
+.grid-main {
+    height: calc(100vh - 64px - 60px);
+    overflow: auto;
+}

+ 179 - 0
global/gridManager/dashboard/longle.js

@@ -0,0 +1,179 @@
+/*
+ * @description: 
+ * @Author: CP
+ * @Date: 2020-12-28 14:41:49
+ * @FilePath: \cld\global\gridManager\dashboard\longle.js
+ */
+
+// 表格唯一标识
+const gridManagerName = 'test';
+
+const demo1 = {
+    /**
+     * 初始化搜索区域
+     */
+    initSearch: function () {
+        // 渲染下拉框
+        // var typeSelect = document.querySelector('.search-area select[name="type"]');
+        // for(let key in TYPE_MAP) {
+        //     const option = document.createElement('option');
+        //     option.value = key;
+        //     option.innerText = TYPE_MAP[key];
+        //     typeSelect.appendChild(option);
+        // }
+
+        // 绑定搜索事件
+        document.querySelector('.search-action').addEventListener('change', function () {
+            var _query = {
+                
+                year: this.value,
+               
+                // staffId: sid,
+            };
+            console.log(_query);
+            table.GM('setQuery', _query, function () {
+                console.log('setQuery执行成功');
+            });
+        });
+
+        // 绑定重置
+        // document.querySelector('.reset-action').addEventListener('click', function () {
+        //     var now = new Date();
+        //     document.querySelector('[name="kw"]').value = '';
+        //     document.querySelector('[name="categoryId"]').value = '';
+        //     document.querySelector('[name="year"]').value = now.getFullYear();
+        //     document.querySelector('[name="month"]').value = '';
+        //     document.querySelector('[name="staffId"]').value = '';
+        //     document.querySelector('[name="feeType"]').value = '';
+        // });
+    },
+
+    
+
+    /**
+     * 初始化表格
+     */
+    initGM: function () {
+        new window.GridManager(table, {
+            gridManagerName: 'test',
+            width: '100%',
+            height: '520px',
+            // 初始渲染时是否加载数据
+            // firstLoading: false,
+
+            supportAutoOrder: false,
+            // 自动序号配置
+            // autoOrderConfig: {
+            //     // 固定列
+            //     fixed: 'left'
+            // },
+            supportCheckbox: false,
+            // 选择框配置
+            // checkboxConfig: {
+            //     // 使用单选
+            //     // useRadio: true,
+
+            //     // 使用行选中
+            //     // useRowCheck: true,
+
+            //     key: 'id',
+            //     // 复选时最大可选数
+            //     // max: 2,
+
+            //     // 固定列
+            //     fixed: 'left'
+            // },
+
+            // 是否使用无总条数模式
+            // useNoTotalsMode: true,
+            // 是否开启分页
+            supportAjaxPage: false,
+            // 排序模式,single(升降序单一触发) overall(升降序整体触发)
+            sortMode: 'single',
+
+           
+
+            // 右键菜单
+            supportMenu: false,
+           
+            // 禁用缓存
+            disableCache: false,
+            ajaxData: function (settings, params) {
+                // document.querySelector('[name="categoryId"]').value = params.categoryId || "";
+                return '/json/dashboard/software/count?staffId='+sid;
+            },
+
+           
+            emptyTemplate: settings => {
+                return `<div style="text-align: center;">${settings.query.title ? '搜索为空' : '暂无数据'}</div>`;
+            },
+            
+            columnData: [
+                {
+                    key: 'date',
+                    width: '160px',
+                    text: '时间',
+                    
+                    disableMoveRow: true,
+                    // 使用函数返回 dom node
+                    // template: function (title, row) {
+                    //     var titleNode = document.createElement('a');
+                    //     titleNode.setAttribute('href', `/expensesDoc/10`);
+                    //     titleNode.setAttribute('title', title);
+                    //     titleNode.setAttribute('target', '_blank');
+                    //     titleNode.innerText = title;
+                    //     titleNode.title = `点击阅读[${row.title}]`;
+                    //     titleNode.classList.add('plugin-action');
+                    //     return titleNode;
+                    // }
+                }, 
+                {
+                    key: 'lend',
+                    // remind: '报销单,借款,对公汇款,培训班',
+                    width: '160px',
+                    text: '借出',
+                    disableMoveRow: true
+                }, 
+                {
+                    key: 'sale',
+                    width: '160px',
+                    text: '销售',
+                    disableMoveRow: true
+                }, 
+                {
+                    key: 'give',
+                    width: '160px',
+                    text: '赠送',
+                    disableMoveRow: true
+                }, 
+                {
+                    key: 'upgrade',
+                    // width: '140px',
+                    text: '升级',
+                    disableMoveRow: true,
+                    
+                }, 
+                
+                
+            ]
+        }, query => {
+            // 渲染完成后的回调函数
+            // console.log('渲染完成后的回调函数:', query);
+        });
+    },
+
+    /**
+     * 编辑功能
+     */
+    editRowData: function (dom) {
+        window.GridManager.updateRowData('test', 'id', { id: window.parseInt(dom.getAttribute('data-id')), lastDate: new Date().getTime() });
+    }
+};
+
+// GridManager 渲染
+const table = document.querySelector('#feeList');
+
+demo1.initSearch(table);
+demo1.initGM(table);
+//demo1.initFN();
+

+ 429 - 0
global/gridManager/fee/expensesCollect.js

@@ -0,0 +1,429 @@
+/*
+ * @description: 
+ * @Author: CP
+ * @Date: 2020-12-28 14:41:49
+ * @FilePath: \cld\global\gridManager\fee\expensesCollect.js
+ */
+
+// 表格唯一标识
+const gridManagerName = 'test';
+
+
+const demo1 = {
+    /**
+     * 初始化搜索区域
+     */
+    initSearch: function () {
+        // 渲染下拉框
+        // var typeSelect = document.querySelector('.search-area select[name="type"]');
+        // for(let key in TYPE_MAP) {
+        //     const option = document.createElement('option');
+        //     option.value = key;
+        //     option.innerText = TYPE_MAP[key];
+        //     typeSelect.appendChild(option);
+        // }
+
+        // 绑定搜索事件
+        document.querySelector('.search-action').addEventListener('click', function () {
+            var _query = {
+               
+                year: document.querySelector('[name="year"]').value,
+                month: document.querySelector('[name="month"]').value,
+                // expensesType: document.querySelector('[name="expensesType"]').value,
+               
+            };
+            table.GM('setQuery', _query, function () {
+                console.log('setQuery执行成功');
+            });
+        });
+
+        // 绑定重置
+        document.querySelector('.reset-action').addEventListener('click', function () {
+            var now = new Date();
+          
+            document.querySelector('[name="year"]').value = now.getFullYear();
+            document.querySelector('[name="month"]').value = '';
+            // document.querySelector('[name="expensesType"]').value = '';
+            
+        });
+    },
+
+
+
+    /**
+     * 初始化表格
+     */
+    initGM: function () {
+        new window.GridManager(table, {
+            gridManagerName: 'test',
+            width: '100%',
+            height: '100%',
+
+           
+
+            supportAutoOrder: false,
+
+            supportCheckbox: false,
+            // 选择框配置
+            // checkboxConfig: {
+            //     // 使用单选
+            //     // useRadio: true,
+
+            //     // 使用行选中
+            //     // useRowCheck: true,
+
+            //     key: 'id',
+            //     // 复选时最大可选数
+            //     // max: 2,
+
+            //     // 固定列
+            //     fixed: 'left'
+            // },
+
+            // 是否使用无总条数模式
+            // useNoTotalsMode: true,
+            // 是否开启分页
+            supportAjaxPage: false,
+            // 排序模式,single(升降序单一触发) overall(升降序整体触发)
+            sortMode: 'single',
+
+            // supportAdjust: false,
+
+
+
+
+
+            // 右键菜单
+            supportMenu: true,
+            // menuHandler: list => {
+            //     list.unshift({
+            //         content: '自定义菜单',
+            //         line: true,
+            //         onClick: _ => {
+            //             alert(_);
+            //         }
+            //     });
+            //     return list;
+            // },
+
+            // 禁用分割线
+            // disableLine: true,
+
+            // 设置表头的icon图标是否跟随文本
+            // isIconFollowText: true,
+
+            // 组合排序
+            // isCombSorting: true,
+
+            // 合并排序
+            // mergeSort: true,
+
+            // 禁用边框线
+            // disableBorder: true,
+
+            // 行移动
+            // supportMoveRow: true,
+            // moveRowConfig: {
+            //     key: 'priority',
+            //     useSingleMode: true,
+            //     fixed: 'left',
+            //     handler: (list, tableData) => {
+            //         //console.log(list, tableData);
+            //     }
+            // },
+
+            // 禁用缓存
+            disableCache: false,
+            ajaxData: function (settings, params) {
+                // document.querySelector('[name="categoryId"]').value = params.categoryId || "";
+                return '/json/expenses/collect';
+            },
+
+            // 导出配置
+            exportConfig: {
+                fileName: query => {
+                    const date = new Date();
+                    let fileName = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`;
+                    for (let key in query) {
+                        fileName = `${fileName}-${key}=${query[key]}`;
+                    }
+                    return fileName;
+                },
+                suffix: 'xls'
+            },
+            ajaxType: 'GET',
+
+            // 选择事件执行前事件
+            checkedBefore: function (checkedList, isChecked, row) {
+                console.log('checkedBefore==', checkedList, isChecked, row);
+                if (row && row.id === 90) {
+                    alert('该节点在checkedBefore中配置为不可选');
+                }
+                return row && row.id !== 90;
+            },
+
+
+
+            // 执行请求后执行程序
+            // responseHandler: res => {
+            //     res.data.forEach(item => {
+            //         // 用id模拟优先级字段
+            //         item.priority = item.id;
+            //     });
+            //     return res;
+            // },
+
+            // 单行数据渲染时执行程序
+            // rowRenderHandler: (row, index) => {
+            //     // if (row.id === 90) {
+            //     //     row.gm_checkbox = true;
+            //     // }
+
+            //     // 指定第92行不可选中
+            //     if (row.id === 92) {
+            //         // row.gm_checkbox = true;
+            //         row.gm_checkbox_disabled = true;
+            //         row.gm_row_class_name = 'test-row-class';
+            //     }
+            //     return row;
+            // },
+
+            emptyTemplate: settings => {
+                return `<div style="text-align: center;">${settings.query.title ? '搜索为空' : '暂无数据'}</div>`;
+            },
+            // 单个td的hover事件
+            // cellClick: (row, rowIndex, colIndex) => {
+            //     // console.log(row, rowIndex, colIndex);
+            //     return {
+            //         text: '这里有个提示',
+            //         position: 'left'
+            //     };
+            // },
+            // rowHover: (a, b, c) => {
+            //     return {
+            //         text: '这里有个提示',
+            //         position: 'right'
+            //     };
+            // },
+            //  useWordBreak: true,
+            // fullColumn: {
+            //     useFold: true,
+            //     fixed: 'left', // 折叠事件列固定方向
+            //     openState: false,
+            //     bottomTemplate: function(row, index){
+            //         return `
+            //         <p>费用说明</p>
+            //         <pre>${row.explanation}</pre>`;
+            //     }
+            // },
+            columnData: [
+                {
+                    key: 'month',
+                    width: '60px',
+                    fixed: 'left',
+                    align: 'center',
+                    disableMoveRow: true,
+                    disableRowCheck: true,
+                    text: '月/日',
+                },
+                {
+                    key: 'bankCharges',
+                    align: 'center',
+                    width: '120px',
+                    text: '银行手续费',
+                    template: function (title, row) {
+                        if(row.bankCharges==0){
+                            return "";
+                        }
+                        return row.bankCharges;
+                    }
+                },
+                {
+                    key: 'telephoneRate',
+                    align: 'center',
+                    width: '120px',
+                    text: '总部电话费',
+                    template: function (title, row) {
+                        if(row.telephoneRate==0){
+                            return "";
+                        }
+                        return row.telephoneRate;
+                    }
+                },
+                {
+                    key: 'addedTax',
+                    remind: '缴税',
+                    align: 'center',
+                    width: '120px',
+                    text: '增值税',
+                    template: function (title, row) {
+                        if(row.addedTax==0){
+                            return "";
+                        }
+                        return row.addedTax;
+                    },
+                },
+                {
+                    key: 'surcharges',
+                    remind: '缴税',
+                    align: 'center',
+                    width: '120px',
+                    text: '税金附加',
+                    template: function (title, row) {
+                        if(row.surcharges==0){
+                            return "";
+                        }
+                        return row.surcharges;
+                    },
+                },
+                {
+                    key: 'corporateIncomeTax',
+                    remind: '缴税',
+                    align: 'center',
+                    width: '120px',
+                    text: '企业所得税',
+                    template: function (title, row) {
+                        if(row.corporateIncomeTax==0){
+                            return "";
+                        }
+                        return row.corporateIncomeTax;
+                    },
+                },
+                {
+                    key: 'socialSecurity',
+                    remind: '缴税',
+                    align: 'center',
+                    width: '120px',
+                    text: '工会费',
+                    template: function (title, row) {
+                        if(row.socialSecurity==0){
+                            return "";
+                        }
+                        return row.socialSecurity;
+                    },
+                },
+                {
+                    key: 'unionFees',
+                    remind: '缴税',
+                    align: 'center',
+                    width: '120px',
+                    text: '社保',
+                    template: function (title, row) {
+                        if(row.unionFees==0){
+                            return "";
+                        }
+                        return row.unionFees;
+                    },
+                },
+                {
+                    key: 'personalIncomeTax',
+                    remind: '缴税',
+                    align: 'center',
+                    width: '120px',
+                    text: '个税',
+                    template: function (title, row) {
+                        if(row.personalIncomeTax==0){
+                            return "";
+                        }
+                        return row.personalIncomeTax;
+                    },
+                },
+                {
+                    key: 'stampDuty',
+                    remind: '缴税',
+                    align: 'center',
+                    width: '120px',
+                    text: '印花税',
+                    template: function (title, row) {
+                        if(row.stampDuty==0){
+                            return "";
+                        }
+                        return row.stampDuty;
+                    },
+                },{
+                    key: 'payTaxesSubtotal',
+                    remind: '缴税',
+                    align: 'center',
+                    width: '120px',
+                    text: '小计',
+                    template: function (title, row) {
+                        if(row.payTaxesSubtotal==0){
+                            return "";
+                        }
+                        return row.payTaxesSubtotal;
+                    },
+                },
+                {
+                    key: 'bond',
+                    width: '120px',
+                    align: 'center',
+                    text: '保证金',
+                    template: function (title, row) {
+                        if(row.bond==0){
+                            return "";
+                        }
+                        return row.bond;
+                    },
+                },
+                {
+                    key: 'wenku',
+                    align: 'center',
+                    width: '120px',
+                    text: '纵横文库提现',
+                    template: function (title, row) {
+                        if(row.wenku==0){
+                            return "";
+                        }
+                        return row.wenku;
+                    },
+                },
+                {
+                    key: 'other',
+                    align: 'center',
+                    width: '120px',
+                    text: '其他',
+                    template: function (title, row) {
+                        if(row.other==0){
+                            return "";
+                        }
+                        return row.other;
+                    },
+                },
+               
+                {
+                    key: 'subtotal',
+                    text: '合计',
+                    width: '100px',
+                    fixed: 'right',
+                    disableMoveRow: true,
+                    disableRowCheck: true,
+                    template: function (title, row) {
+                        if(row.subtotal==0){
+                            return "";
+                        }
+                        return row.subtotal;
+                    },
+                },
+
+
+            ]
+        }, query => {
+            // 渲染完成后的回调函数
+        });
+    },
+
+    /**
+     * 编辑功能
+     */
+    editRowData: function (dom) {
+        window.GridManager.updateRowData('test', 'id', { id: window.parseInt(dom.getAttribute('data-id')), lastDate: new Date().getTime() });
+    }
+};
+
+// GridManager 渲染
+const table = document.querySelector('#feeList');
+
+demo1.initSearch(table);
+demo1.initGM(table);
+//demo1.initFN();
+

+ 529 - 0
global/gridManager/fee/incomeCollect.js

@@ -0,0 +1,529 @@
+/*
+ * @description: 
+ * @Author: CP
+ * @Date: 2020-12-28 14:41:49
+ * @FilePath: \cld\global\gridManager\fee\incomeCollect.js
+ */
+
+// 表格唯一标识
+const gridManagerName = 'test';
+
+
+const demo1 = {
+    /**
+     * 初始化搜索区域
+     */
+    initSearch: function () {
+        // 渲染下拉框
+        // var typeSelect = document.querySelector('.search-area select[name="type"]');
+        // for(let key in TYPE_MAP) {
+        //     const option = document.createElement('option');
+        //     option.value = key;
+        //     option.innerText = TYPE_MAP[key];
+        //     typeSelect.appendChild(option);
+        // }
+
+        // 绑定搜索事件
+        document.querySelector('.search-action').addEventListener('click', function () {
+            var _query = {
+               
+                year: document.querySelector('[name="year"]').value,
+                month: document.querySelector('[name="month"]').value,
+                // expensesType: document.querySelector('[name="expensesType"]').value,
+               
+            };
+            table.GM('setQuery', _query, function () {
+                console.log('setQuery执行成功');
+            });
+        });
+
+        // 绑定重置
+        document.querySelector('.reset-action').addEventListener('click', function () {
+            var now = new Date();
+          
+            document.querySelector('[name="year"]').value = now.getFullYear();
+            document.querySelector('[name="month"]').value = '';
+            // document.querySelector('[name="expensesType"]').value = '';
+            
+        });
+    },
+
+
+
+    /**
+     * 初始化表格
+     */
+    initGM: function () {
+        new window.GridManager(table, {
+            gridManagerName: 'test',
+            width: '100%',
+            height: '100%',
+
+           
+
+            supportAutoOrder: false,
+
+            supportCheckbox: false,
+            // 选择框配置
+            // checkboxConfig: {
+            //     // 使用单选
+            //     // useRadio: true,
+
+            //     // 使用行选中
+            //     // useRowCheck: true,
+
+            //     key: 'id',
+            //     // 复选时最大可选数
+            //     // max: 2,
+
+            //     // 固定列
+            //     fixed: 'left'
+            // },
+
+            // 是否使用无总条数模式
+            // useNoTotalsMode: true,
+            // 是否开启分页
+            supportAjaxPage: false,
+            // 排序模式,single(升降序单一触发) overall(升降序整体触发)
+            sortMode: 'single',
+
+            // supportAdjust: false,
+
+
+
+
+
+            // 右键菜单
+            supportMenu: true,
+            // menuHandler: list => {
+            //     list.unshift({
+            //         content: '自定义菜单',
+            //         line: true,
+            //         onClick: _ => {
+            //             alert(_);
+            //         }
+            //     });
+            //     return list;
+            // },
+
+            // 禁用分割线
+            // disableLine: true,
+
+            // 设置表头的icon图标是否跟随文本
+            // isIconFollowText: true,
+
+            // 组合排序
+            // isCombSorting: true,
+
+            // 合并排序
+            // mergeSort: true,
+
+            // 禁用边框线
+            // disableBorder: true,
+
+            // 行移动
+            // supportMoveRow: true,
+            // moveRowConfig: {
+            //     key: 'priority',
+            //     useSingleMode: true,
+            //     fixed: 'left',
+            //     handler: (list, tableData) => {
+            //         //console.log(list, tableData);
+            //     }
+            // },
+
+            // 禁用缓存
+            disableCache: false,
+            ajaxData: function (settings, params) {
+                // document.querySelector('[name="categoryId"]').value = params.categoryId || "";
+                return '/json/income/collect';
+            },
+
+            // 导出配置
+            exportConfig: {
+                fileName: query => {
+                    const date = new Date();
+                    let fileName = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`;
+                    for (let key in query) {
+                        fileName = `${fileName}-${key}=${query[key]}`;
+                    }
+                    return fileName;
+                },
+                suffix: 'xls'
+            },
+            ajaxType: 'GET',
+
+            // 选择事件执行前事件
+            checkedBefore: function (checkedList, isChecked, row) {
+                console.log('checkedBefore==', checkedList, isChecked, row);
+                if (row && row.id === 90) {
+                    alert('该节点在checkedBefore中配置为不可选');
+                }
+                return row && row.id !== 90;
+            },
+
+
+
+            // 执行请求后执行程序
+            // responseHandler: res => {
+            //     res.data.forEach(item => {
+            //         // 用id模拟优先级字段
+            //         item.priority = item.id;
+            //     });
+            //     return res;
+            // },
+
+            // 单行数据渲染时执行程序
+            // rowRenderHandler: (row, index) => {
+            //     // if (row.id === 90) {
+            //     //     row.gm_checkbox = true;
+            //     // }
+
+            //     // 指定第92行不可选中
+            //     if (row.id === 92) {
+            //         // row.gm_checkbox = true;
+            //         row.gm_checkbox_disabled = true;
+            //         row.gm_row_class_name = 'test-row-class';
+            //     }
+            //     return row;
+            // },
+
+            emptyTemplate: settings => {
+                return `<div style="text-align: center;">${settings.query.title ? '搜索为空' : '暂无数据'}</div>`;
+            },
+            // 单个td的hover事件
+            // cellClick: (row, rowIndex, colIndex) => {
+            //     // console.log(row, rowIndex, colIndex);
+            //     return {
+            //         text: '这里有个提示',
+            //         position: 'left'
+            //     };
+            // },
+            // rowHover: (a, b, c) => {
+            //     return {
+            //         text: '这里有个提示',
+            //         position: 'right'
+            //     };
+            // },
+            //  useWordBreak: true,
+            // fullColumn: {
+            //     useFold: true,
+            //     fixed: 'left', // 折叠事件列固定方向
+            //     openState: false,
+            //     bottomTemplate: function(row, index){
+            //         return `
+            //         <p>费用说明</p>
+            //         <pre>${row.explanation}</pre>`;
+            //     }
+            // },
+            columnData: [
+                {
+                    key: 'month',
+                    width: '60px',
+                    fixed: 'left',
+                    align: 'center',
+                    disableMoveRow: true,
+                    disableRowCheck: true,
+                    text: '月/日',
+                },
+                {
+                    key: 'bankDepositPrice',
+                    remind: '利息收入',
+                    align: 'center',
+                    width: '120px',
+                    text: '银行存款',
+                    template: function (title, row) {
+                        if(row.bankDepositPrice==0){
+                            return "";
+                        }
+                        return row.bankDepositPrice;
+                    }
+                    // children: [
+                    //     {
+                    //         key: 'username',
+                    //         text: '银行存款',
+                    //         align: 'center',
+                    //     },
+                    //     {
+                    //         key: 'username2',
+                    //         text: '活期理财收益',
+                    //         align: 'center',
+                    //     },
+                    //     {
+                    //         key: 'username3',
+                    //         text: '固定理财收益',
+                    //         align: 'center',
+                    //     },
+                    //     {
+                    //         key: 'username4',
+                    //         text: '个人借款',
+                    //         align: 'center',
+                    //     },
+                    //     {
+                    //         key: 'username5',
+                    //         text: '小计',
+                    //         align: 'center',
+                    //     },
+                    // ],
+                },
+                {
+                    key: 'currentFinancPrice',
+                    remind: '利息收入',
+                    align: 'center',
+                    width: '120px',
+                    text: '活期理财收益',
+                    template: function (title, row) {
+                        if(row.currentFinancPrice==0){
+                            return "";
+                        }
+                        return row.currentFinancPrice;
+                    },
+                },
+                {
+                    key: 'fixedFinancPrice',
+                    remind: '利息收入',
+                    align: 'center',
+                    width: '120px',
+                    text: '固定理财收益',
+                    template: function (title, row) {
+                        if(row.fixedFinancPrice==0){
+                            return "";
+                        }
+                        return row.fixedFinancPrice;
+                    },
+                },
+                {
+                    key: 'personalLoanPrice',
+                    remind: '利息收入',
+                    align: 'center',
+                    width: '120px',
+                    text: '个人借款',
+                    template: function (title, row) {
+                        if(row.personalLoanPrice==0){
+                            return "";
+                        }
+                        return row.personalLoanPrice;
+                    },
+                },
+                {
+                    key: 'interestSubtotalPrice',
+                    remind: '利息收入',
+                    align: 'center',
+                    width: '120px',
+                    text: '小计',
+                    template: function (title, row) {
+                        if(row.interestSubtotalPrice==0){
+                            return "";
+                        }
+                        return row.interestSubtotalPrice;
+                    },
+                },
+                {
+                    key: 'socialSecurity',
+                    remind: '补贴收入',
+                    align: 'center',
+                    width: '120px',
+                    text: '社保',
+                    template: function (title, row) {
+                        if(row.socialSecurity==0){
+                            return "";
+                        }
+                        return row.socialSecurity;
+                    },
+                },
+                {
+                    key: 'finance',
+                    remind: '补贴收入',
+                    align: 'center',
+                    width: '120px',
+                    text: '财政',
+                    template: function (title, row) {
+                        if(row.finance==0){
+                            return "";
+                        }
+                        return row.finance;
+                    },
+                },
+                {
+                    key: 'subsidySubtotal',
+                    remind: '补贴收入',
+                    align: 'center',
+                    width: '120px',
+                    text: '小计',
+                    template: function (title, row) {
+                        if(row.subsidySubtotal==0){
+                            return "";
+                        }
+                        return row.subsidySubtotal;
+                    },
+                },
+                // {
+                //     key: 'typeShow',
+                //     width: '240px',
+                //     text: '补贴收入',
+                //     children: [
+                //         {
+                //             key: 'username',
+                //             text: '社保',
+                //             align: 'center',
+                //         },
+                //         {
+                //             key: 'username2',
+                //             text: '财政',
+                //             align: 'center',
+                //         },
+                //         {
+                //             key: 'username5',
+                //             text: '小计',
+                //             align: 'center',
+                //         },
+                //     ],
+                // },
+                
+                {
+                    key: 'reserveFund',
+                    remind: '借款收回',
+                    align: 'center',
+                    width: '120px',
+                    text: '备用金',
+                    template: function (title, row) {
+                        if(row.reserveFund==0){
+                            return "";
+                        }
+                        return row.reserveFund;
+                    },
+                },
+                {
+                    key: 'privateBorrow',
+                    remind: '借款收回',
+                    align: 'center',
+                    width: '120px',
+                    text: '私人借款',
+                    template: function (title, row) {
+                        if(row.privateBorrow==0){
+                            return "";
+                        }
+                        return row.privateBorrow;
+                    },
+                },
+                {
+                    key: 'loanSubtotal',
+                    remind: '借款收回',
+                    align: 'center',
+                    width: '120px',
+                    text: '小计',
+                    template: function (title, row) {
+                        if(row.loanSubtotal==0){
+                            return "";
+                        }
+                        return row.loanSubtotal;
+                    },
+                },
+                // {
+                //     key: 'priceShow',
+                //     width: '240px',
+                //     text: '借款收回',
+                //     children: [
+                //         {
+                //             key: 'username',
+                //             text: '备用金',
+                //             align: 'center',
+                //         },
+                //         {
+                //             key: 'username2',
+                //             text: '私人借款',
+                //             align: 'center',
+                //         },
+                //         {
+                //             key: 'username5',
+                //             text: '小计',
+                //             align: 'center',
+                //         },
+                //     ],
+                // },
+                {
+                    key: 'zongheng',
+                    width: '120px',
+                    align: 'center',
+                    text: '纵横知道',
+                    template: function (title, row) {
+                        if(row.zongheng==0){
+                            return "";
+                        }
+                        return row.zongheng;
+                    },
+                },
+                {
+                    key: 'returnRemittance',
+                    width: '120px',
+                    text: '退汇',
+                    disableMoveRow: true,
+                    template: function (title, row) {
+                        if(row.returnRemittance==0){
+                            return "";
+                        }
+                        return row.returnRemittance;
+                    },
+                },
+                
+                {
+                    key: 'bond',
+                    text: '保证金',
+                    width: '120px',
+                    disableMoveRow: true,
+                    template: function (title, row) {
+                        if(row.bond==0){
+                            return "";
+                        }
+                        return row.bond;
+                    },
+                },
+                {
+                    key: 'other',
+                    text: '其他',
+                    width: '120px',
+                    disableMoveRow: true,
+                    template: function (title, row) {
+                        if(row.other==0){
+                            return "";
+                        }
+                        return row.other;
+                    },
+                },
+                {
+                    key: 'subtotal',
+                    text: '合计',
+                    width: '100px',
+                    fixed: 'right',
+                    disableMoveRow: true,
+                    disableRowCheck: true,
+                    template: function (title, row) {
+                        if(row.subtotal==0){
+                            return "";
+                        }
+                        return row.subtotal;
+                    },
+                },
+
+
+            ]
+        }, query => {
+            // 渲染完成后的回调函数
+        });
+    },
+
+    /**
+     * 编辑功能
+     */
+    editRowData: function (dom) {
+        window.GridManager.updateRowData('test', 'id', { id: window.parseInt(dom.getAttribute('data-id')), lastDate: new Date().getTime() });
+    }
+};
+
+// GridManager 渲染
+const table = document.querySelector('#feeList');
+
+demo1.initSearch(table);
+demo1.initGM(table);
+//demo1.initFN();
+

+ 378 - 0
global/gridManager/fee/incomeExpenses.js

@@ -0,0 +1,378 @@
+/*
+ * @description: 
+ * @Author: CP
+ * @Date: 2020-12-28 14:41:49
+ * @FilePath: \cld\global\gridManager\fee\incomeExpenses.js
+ */
+
+// 表格唯一标识
+const gridManagerName = 'test';
+
+
+const demo1 = {
+    /**
+     * 初始化搜索区域
+     */
+    initSearch: function () {
+        // 渲染下拉框
+        // var typeSelect = document.querySelector('.search-area select[name="type"]');
+        // for(let key in TYPE_MAP) {
+        //     const option = document.createElement('option');
+        //     option.value = key;
+        //     option.innerText = TYPE_MAP[key];
+        //     typeSelect.appendChild(option);
+        // }
+
+        // 绑定搜索事件
+        document.querySelector('.search-action').addEventListener('click', function () {
+            var _query = {
+                kw: document.querySelector('[name="kw"]').value,
+                year: document.querySelector('[name="year"]').value,
+                month: document.querySelector('[name="month"]').value,
+                expensesType: document.querySelector('[name="expensesType"]').value,
+                accountType: document.querySelector('[name="accountType"]').value,
+                expenditureType: document.querySelector('[name="expenditureType"]').value,
+            };
+            table.GM('setQuery', _query, function () {
+                console.log('setQuery执行成功');
+            });
+        });
+
+        // 绑定重置
+        document.querySelector('.reset-action').addEventListener('click', function () {
+            var now = new Date();
+            document.querySelector('[name="kw"]').value = '';
+            document.querySelector('[name="year"]').value = now.getFullYear();
+            document.querySelector('[name="month"]').value = '';
+            document.querySelector('[name="expensesType"]').value = '';
+            document.querySelector('[name="accountType"]').value = '';
+            document.querySelector('[name="expenditureType"]').value = '';
+        });
+    },
+
+   
+
+    /**
+     * 初始化表格
+     */
+    initGM: function () {
+        new window.GridManager(table, {
+            gridManagerName: 'test',
+            width: '100%',
+            height: '100%',
+            // 初始渲染时是否加载数据
+            // firstLoading: false,
+
+            supportAutoOrder: false,
+            // 自动序号配置
+            // autoOrderConfig: {
+            //     // 固定列
+            //     fixed: 'left'
+            // },
+            supportCheckbox: false,
+            // 选择框配置
+            // checkboxConfig: {
+            //     // 使用单选
+            //     // useRadio: true,
+
+            //     // 使用行选中
+            //     // useRowCheck: true,
+
+            //     key: 'id',
+            //     // 复选时最大可选数
+            //     // max: 2,
+
+            //     // 固定列
+            //     fixed: 'left'
+            // },
+
+            // 是否使用无总条数模式
+            // useNoTotalsMode: true,
+            // 是否开启分页
+            supportAjaxPage: true,
+            // 排序模式,single(升降序单一触发) overall(升降序整体触发)
+            sortMode: 'single',
+
+            // supportAdjust: false,
+            // 是否开启配置功能
+            // supportConfig: false,
+
+            // 是否开启导出
+            // supportExport: false,
+
+            // 是否开启打印
+            // supportPrint: false,
+
+            // 右键菜单
+            supportMenu: true,
+            // menuHandler: list => {
+            //     list.unshift({
+            //         content: '自定义菜单',
+            //         line: true,
+            //         onClick: _ => {
+            //             alert(_);
+            //         }
+            //     });
+            //     return list;
+            // },
+
+            // 禁用分割线
+            // disableLine: true,
+
+            // 设置表头的icon图标是否跟随文本
+            // isIconFollowText: true,
+
+            // 组合排序
+            // isCombSorting: true,
+
+            // 合并排序
+            // mergeSort: true,
+
+            // 禁用边框线
+            // disableBorder: true,
+
+            // 行移动
+            // supportMoveRow: true,
+            // moveRowConfig: {
+            //     key: 'priority',
+            //     useSingleMode: true,
+            //     fixed: 'left',
+            //     handler: (list, tableData) => {
+            //         //console.log(list, tableData);
+            //     }
+            // },
+
+            // 禁用缓存
+            disableCache: false,
+            ajaxData: function (settings, params) {
+                // document.querySelector('[name="categoryId"]').value = params.categoryId || "";
+                return '/json/income/expenses';
+            },
+
+            // 导出配置
+            exportConfig: {
+                fileName: query => {
+                    const date = new Date();
+                    let fileName = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`;
+                    for (let key in query) {
+                        fileName = `${fileName}-${key}=${query[key]}`;
+                    }
+                    return fileName;
+                },
+                suffix: 'xls'
+            },
+            ajaxType: 'GET',
+
+            // 选择事件执行前事件
+            checkedBefore: function (checkedList, isChecked, row) {
+                console.log('checkedBefore==', checkedList, isChecked, row);
+                if (row && row.id === 90) {
+                    alert('该节点在checkedBefore中配置为不可选');
+                }
+                return row && row.id !== 90;
+            },
+
+            // 选择事件执行后事件
+            checkedAfter: function (checkedList, isChecked, row) {
+                console.log('checkedAfter==', checkedList, isChecked, row);
+            },
+
+            // 全选事件执行前事件
+            checkedAllBefore: function (checkedList, isChecked) {
+                console.log('checkedAllBefore==', checkedList, isChecked);
+                //
+                // if (isChecked) {
+                //     alert('不能取消全选');
+                // }
+                // return !isChecked;
+            },
+
+            // 全选事件执行后事件
+            checkedAllAfter: function (checkedList, isChecked) {
+                console.log('checkedAllAfter==', checkedList, isChecked);
+            },
+
+            // 执行排序前事件
+            sortingBefore: function (query) {
+                console.log('sortingBefore', query);
+            },
+
+            // 排行排序后事件
+            sortingAfter: function (query) {
+                console.log('sortingAfter', query);
+            },
+
+            // AJAX请求前事件函数
+            ajaxBeforeSend: function (promise) {
+                console.log('ajaxBeforeSend');
+            },
+            // AJAX成功事件函数
+            ajaxSuccess: function (response) {
+                console.log('ajaxSuccess');
+            },
+
+            // AJAX失败事件函数
+            ajaxError: function (errorInfo) {
+                console.log('ajaxError');
+            },
+
+            // AJAX结束事件函数
+            ajaxComplete: function (complete) {
+                console.log('ajaxComplete');
+            },
+            adjustBefore: eve => {
+                console.log('adjustBefore=>', eve);
+            },
+            adjustAfter: eve => {
+                console.log('adjustAfter=>', eve);
+            },
+
+            // 执行请求后执行程序
+            // responseHandler: res => {
+            //     res.data.forEach(item => {
+            //         // 用id模拟优先级字段
+            //         item.priority = item.id;
+            //     });
+            //     return res;
+            // },
+
+            // 单行数据渲染时执行程序
+            // rowRenderHandler: (row, index) => {
+            //     // if (row.id === 90) {
+            //     //     row.gm_checkbox = true;
+            //     // }
+
+            //     // 指定第92行不可选中
+            //     if (row.id === 92) {
+            //         // row.gm_checkbox = true;
+            //         row.gm_checkbox_disabled = true;
+            //         row.gm_row_class_name = 'test-row-class';
+            //     }
+            //     return row;
+            // },
+
+            emptyTemplate: settings => {
+                return `<div style="text-align: center;">${settings.query.title ? '搜索为空' : '暂无数据'}</div>`;
+            },
+            // 单个td的hover事件
+            // cellClick: (row, rowIndex, colIndex) => {
+            //     // console.log(row, rowIndex, colIndex);
+            //     return {
+            //         text: '这里有个提示',
+            //         position: 'left'
+            //     };
+            // },
+            // rowHover: (a, b, c) => {
+            //     return {
+            //         text: '这里有个提示',
+            //         position: 'right'
+            //     };
+            // },
+            //  useWordBreak: true,
+            // fullColumn: {
+            //     useFold: true,
+            //     fixed: 'left', // 折叠事件列固定方向
+            //     openState: false,
+            //     bottomTemplate: function(row, index){
+            //         return `
+            //         <p>费用说明</p>
+            //         <pre>${row.explanation}</pre>`;
+            //     }
+            // },
+            columnData: [
+                {
+                    key: 'expensesTypeShow',
+                    width: '60px',
+                    text: '类型',
+                    
+                    disableMoveRow: true,
+                    // 使用函数返回 dom node
+                    // template: function (title, row) {
+                    //     var titleNode = document.createElement('a');
+                    //     titleNode.setAttribute('href', `/expensesDoc/10`);
+                    //     titleNode.setAttribute('title', title);
+                    //     titleNode.setAttribute('target', '_blank');
+                    //     titleNode.innerText = title;
+                    //     titleNode.title = `点击阅读[${row.title}]`;
+                    //     titleNode.classList.add('plugin-action');
+                    //     return titleNode;
+                    // }
+                }, 
+                {
+                    key: 'typeShow',
+                    // remind: '报销单,借款,对公汇款,培训班',
+                    
+                    text: '费用类别',
+                    disableMoveRow: true
+                }, 
+                {
+                    key: 'bookSerial',
+                    width: '160px',
+                    text: '单号',
+                    disableMoveRow: true,
+                    // template: function (receiptOrder, row) {
+                    //     var titleNode = document.createElement('a');
+                    //     titleNode.setAttribute('href', `/expensesDoc/${row.ridOld}`);
+                    //     titleNode.setAttribute('receiptOrder', receiptOrder);
+                    //     titleNode.setAttribute('target', '_blank');
+                    //     titleNode.innerText = receiptOrder;
+                    //     titleNode.title = `详情[${row.receiptOrder}]`;
+                    //     return titleNode;
+                    // }
+                }, 
+                {
+                    key: 'priceShow',
+                    width: '150px',
+                    text: '金额',
+                    disableMoveRow: true
+                }, 
+                {
+                    key: 'bankShow',
+                    width: '160px',
+                    text: '到款/支付银行',
+                    disableMoveRow: true,
+                    
+                }, 
+                {
+                    key: 'dateShow',
+                    text: '银行到款/支付时间',
+                    width: '160px',
+                    disableMoveRow: true,
+                }, 
+                
+                {
+                    key: 'inputDate',
+                    width: '160px',
+                    text: '入库时间',
+                    disableMoveRow: true
+                }, 
+                {
+                    key: 'pastDate',
+                    width: '90px',
+                    text: '操作',
+                    disableMoveRow: true
+                }, 
+               
+               
+            ]
+        }, query => {
+            // 渲染完成后的回调函数
+            console.log('渲染完成后的回调函数:', query);
+        });
+    },
+
+    /**
+     * 编辑功能
+     */
+    editRowData: function (dom) {
+        window.GridManager.updateRowData('test', 'id', { id: window.parseInt(dom.getAttribute('data-id')), lastDate: new Date().getTime() });
+    }
+};
+
+// GridManager 渲染
+const table = document.querySelector('#feeList');
+
+demo1.initSearch(table);
+demo1.initGM(table);
+//demo1.initFN();
+

+ 702 - 0
global/gridManager/fee/list.js

@@ -0,0 +1,702 @@
+/*
+ * @description: 
+ * @Author: CP
+ * @Date: 2020-12-28 14:41:49
+ * @FilePath: \cld\global\gridManager\fee\list.js
+ */
+
+// 表格唯一标识
+const gridManagerName = 'test';
+
+// 博文类型
+// const TYPE_MAP = {
+//     '1': 'HTML/CSS',
+//     '2': 'nodeJS',
+//     '3': 'javaScript',
+//     '4': '前端鸡汤',
+//     '5': 'PM Coffee',
+//     '6': '前端框架',
+//     '7': '前端相关'
+// };
+
+// 公开方法列表
+// const GM_PUBLISH_METHOD_MAP = {
+//     init: {
+//         key: 'init',
+//         relyInit: false,
+//         title: '初始化',
+//         code: 'demo1.initGM(document.querySelector("table"));'
+//     },
+//     get: {
+//         key: 'get',
+//         relyInit: true,  // 是否依赖init方法
+//         title: '获取表格的实时配置信息',
+//         code: `GridManager.get('${gridManagerName}');`
+//     },
+//     version: {
+//         key: 'version',
+//         relyInit: false,
+//         title: '获取当前GridManager的版本号',
+//         code: 'GridManager.version;'
+//     },
+//     getLocalStorage: {
+//         key: 'getLocalStorage',
+//         relyInit: true,
+//         title: '获取表格用户记忆',
+//         code: `GridManager.getLocalStorage('${gridManagerName}');`
+//     },
+//     resetLayout: {
+//         key: 'resetLayout',
+//         relyInit: true,
+//         title: '重置表格布局',
+//         code: `GridManager.resetLayout('${gridManagerName}', '800px', '500px');`
+//     },
+//     clear: {
+//         key: 'clear',
+//         relyInit: true,
+//         title: '清除表格记忆数据',
+//         code: `GridManager.clear('${gridManagerName}');`
+//     },
+//     getTableData: {
+//         key: 'getTableData',
+//         relyInit: true,
+//         title: '获取指定tr所使用的数据',
+//         code: `GridManager.getTableData('${gridManagerName}');`
+//     },
+//     getRowData: {
+//         key: 'getRowData',
+//         relyInit: true,
+//         title: '获取指定tr所使用的数据',
+//         code: `GridManager.getRowData('${gridManagerName}', document.querySelector("table[grid-manager=${gridManagerName}] tbody tr"));`
+//     },
+//     updateRowData: {
+//         key: 'updateRowData',
+//         relyInit: true,
+//         title: '更新指定行所使用的数据',
+//         code: `GridManager.updateRowData('${gridManagerName}', 'id', {id: 92, title: 'ccc'});`
+//     },
+//     updateTreeState: {
+//         key: 'updateTreeState',
+//         relyInit: true,
+//         title: '更新树的展开状态',
+//         code: `GridManager.updateTreeState('${gridManagerName}', true);`
+//     },
+//     setSort: {
+//         key: 'setSort',
+//         relyInit: true,
+//         title: '手动设置排序',
+//         code: `GridManager.setSort('${gridManagerName}', {createDate: 'ASC'});`
+//     },
+//     setConfigVisible: {
+//         key: 'setConfigVisible',
+//         relyInit: true,
+//         title: '设置表头配置区域可视状态',
+//         code: `GridManager.setConfigVisible('${gridManagerName}', true);`
+//     },
+//     showTh: {
+//         key: 'showTh',
+//         relyInit: true,
+//         title: '设置列为可视状态',
+//         code: `GridManager.showTh('${gridManagerName}', 'pic');`
+//     },
+//     hideTh: {
+//         key: 'hideTh',
+//         relyInit: true,
+//         title: '设置列为隐藏状态',
+//         code: `GridManager.hideTh('${gridManagerName}', 'pic');`
+//     },
+//     exportGrid: {
+//         key: 'exportGrid',
+//         relyInit: true,
+//         title: '导出指定表格',
+//         code: `GridManager.exportGrid('${gridManagerName}', 'demo中使用的导出').then(res=>{console.log('success')}).catch(err=>{console.error('error', err)});`
+//     },
+//     setQuery: {
+//         key: 'setQuery',
+//         relyInit: true,
+//         title: '更改在生成组件时所配置的参数query',
+//         code: `GridManager.setQuery('${gridManagerName}', {'userName':'baukh','sex':'男'});`
+//     },
+//     setAjaxData: {
+//         key: 'setAjaxData',
+//         relyInit: true,
+//         title: '用于再次配置ajaxData数据',
+//         code: `GridManager.setAjaxData('${gridManagerName}', {data: [{title: '通过setAjaxData动态添加的数据,其它项为空'}], totals: 1});`
+//     },
+//     refreshGrid: {
+//         key: 'refreshGrid',
+//         relyInit: true,
+//         title: '刷新表格',
+//         code: `GridManager.refreshGrid('${gridManagerName}');`
+//     },
+//     renderGrid: {
+//         key: 'renderGrid',
+//         relyInit: true,
+//         title: '渲染表格',
+//         code: `GridManager.renderGrid('${gridManagerName}');`
+//     },
+//     getCheckedTr: {
+//         key: 'getCheckedTr',
+//         relyInit: true,
+//         title: '获取当前选中的行',
+//         code: `GridManager.getCheckedTr('${gridManagerName}');`
+//     },
+//     getCheckedData: {
+//         key: 'getCheckedData',
+//         relyInit: true,
+//         title: '获取选中行的渲染数据',
+//         code: `GridManager.getCheckedData('${gridManagerName}');`
+//     },
+//     setCheckedData: {
+//         key: 'setCheckedData',
+//         relyInit: true,
+//         title: '设置选中的数据',
+//         code: `GridManager.setCheckedData('${gridManagerName}', [GridManager.getTableData('${gridManagerName}')[1]]);`
+//     },
+//     cleanData: {
+//         key: 'cleanData',
+//         relyInit: true,
+//         title: '清除指定表格数据',
+//         code: `GridManager.cleanData('${gridManagerName}');`
+//     },
+//     print: {
+//         key: 'print',
+//         relyInit: true,
+//         title: '打印当前页',
+//         code: `GridManager.print('${gridManagerName}');`
+//     },
+//     showLoading: {
+//         key: 'showLoading',
+//         relyInit: true,
+//         title: '显示加载中',
+//         code: `GridManager.showLoading('${gridManagerName}');`
+//     },
+//     hideLoading: {
+//         key: 'hideLoading',
+//         relyInit: true,
+//         title: '隐藏加载中',
+//         code: `GridManager.hideLoading('${gridManagerName}', 300);`
+//     },
+//     destroy: {
+//         key: 'destroy',
+//         relyInit: true,
+//         title: '消毁指定的GridManager实例',
+//         code: `GridManager.destroy('${gridManagerName}');`
+//     }
+// };
+const demo1 = {
+    /**
+     * 初始化搜索区域
+     */
+    initSearch: function () {
+        // 渲染下拉框
+        // var typeSelect = document.querySelector('.search-area select[name="type"]');
+        // for(let key in TYPE_MAP) {
+        //     const option = document.createElement('option');
+        //     option.value = key;
+        //     option.innerText = TYPE_MAP[key];
+        //     typeSelect.appendChild(option);
+        // }
+
+        // 绑定搜索事件
+        document.querySelector('.search-action').addEventListener('click', function () {
+            var _query = {
+                kw: document.querySelector('[name="kw"]').value,
+                categoryId: document.querySelector('[name="categoryId"]').value,
+                year: document.querySelector('[name="year"]').value,
+                month: document.querySelector('[name="month"]').value,
+                staffId: document.querySelector('[name="staffId"]').value,
+                feeType: document.querySelector('[name="feeType"]').value,
+            };
+            table.GM('setQuery', _query, function () {
+                console.log('setQuery执行成功');
+            });
+        });
+
+        // 绑定重置
+        document.querySelector('.reset-action').addEventListener('click', function () {
+            var now = new Date();
+            document.querySelector('[name="kw"]').value = '';
+            document.querySelector('[name="categoryId"]').value = '';
+            document.querySelector('[name="year"]').value = now.getFullYear();
+            document.querySelector('[name="month"]').value = '';
+            document.querySelector('[name="staffId"]').value = '';
+            document.querySelector('[name="feeType"]').value = '';
+        });
+    },
+
+    /**
+     * 初始化方法区域
+     */
+    // initFN: () => {
+    //     const fnSelect = document.querySelector('.fn-select');
+    //     const fnRun = document.querySelector('.fn-run');
+    //     const fnCode = document.querySelector('.fn-code');
+    //     const fnRunInfo = document.querySelector('.fn-run-info');
+
+    //     // 渲染选择区域, instantiated: 是否已经实例化
+    //     const renderSelect = instantiated => {
+    //         let liStr = '<option value="-1">请选择方法</option>';
+    //         for (let key in GM_PUBLISH_METHOD_MAP) {
+    //             let fn = GM_PUBLISH_METHOD_MAP[key];
+    //             let disabled = !instantiated && fn.relyInit  ? 'disabled' : '';
+    //             liStr = `${liStr}<option value="${key}" ${disabled} title="${fn.title}">${key}</option>`;
+    //         }
+    //         fnSelect.innerHTML = liStr;
+    //     };
+    //     renderSelect(true);
+
+    //     // bind input change event
+    //     fnSelect.addEventListener('change', function () {
+    //         fnCode.value = GM_PUBLISH_METHOD_MAP[this.value].code;
+    //         fnRun.setAttribute('now-fun', this.value);
+    //     });
+
+    //     // bind run event
+    //     fnRun.addEventListener('click', function () {
+    //         if (!fnCode.value) {
+    //             fnRunInfo.innerHTML = '请通过选择方法生成所需要执行的代码';
+    //             return;
+    //         }
+    //         fnRunInfo.innerHTML = '';
+    //         const log = eval(fnCode.value);
+    //         const nowFn = fnRun.getAttribute('now-fun');
+    //         console.group(nowFn);
+    //         console.log(fnCode.value);
+    //         console.log(log);
+    //         console.groupEnd();
+    //         try {
+    //             if (nowFn === 'init') {
+    //                 renderSelect(true);
+    //             }
+    //             if (nowFn === 'destroy') {
+    //                 renderSelect(false);
+    //             }
+
+    //             fnRunInfo.innerHTML = `<span class="success-info">
+    //                 <a href="http://gridmanager.lovejavascript.com/api/index.html#${nowFn}" target="_blank">${nowFn}</a>
+    //                 执行成功, 请打开控制台查看具体信息
+    //             </span>`;
+    //         } catch (e) {
+    //             fnRunInfo.innerHTML = `<span class="error-info">
+    //                 <a href="http://gridmanager.lovejavascript.com/api/index.html#${nowFn}" target="_blank">${nowFn}</a>
+    //                 执行失败, 请打开控制台查看具体信息
+    //             </span>`;
+    //             console.error('执行错误: ', e);
+    //         }
+    //     });
+    // },
+
+    /**
+     * 初始化表格
+     */
+    initGM: function () {
+        new window.GridManager(table, {
+            gridManagerName: 'test',
+            width: '100%',
+            height: '100%',
+            // 初始渲染时是否加载数据
+            // firstLoading: false,
+
+            supportAutoOrder: false,
+            // 自动序号配置
+            // autoOrderConfig: {
+            //     // 固定列
+            //     fixed: 'left'
+            // },
+            supportCheckbox: false,
+            // 选择框配置
+            // checkboxConfig: {
+            //     // 使用单选
+            //     // useRadio: true,
+
+            //     // 使用行选中
+            //     // useRowCheck: true,
+
+            //     key: 'id',
+            //     // 复选时最大可选数
+            //     // max: 2,
+
+            //     // 固定列
+            //     fixed: 'left'
+            // },
+
+            // 是否使用无总条数模式
+            // useNoTotalsMode: true,
+            // 是否开启分页
+            supportAjaxPage: true,
+            // 排序模式,single(升降序单一触发) overall(升降序整体触发)
+            sortMode: 'single',
+
+            // supportAdjust: false,
+            // 是否开启配置功能
+            // supportConfig: false,
+
+            // 是否开启导出
+            // supportExport: false,
+
+            // 是否开启打印
+            // supportPrint: false,
+
+            // 右键菜单
+            supportMenu: true,
+            // menuHandler: list => {
+            //     list.unshift({
+            //         content: '自定义菜单',
+            //         line: true,
+            //         onClick: _ => {
+            //             alert(_);
+            //         }
+            //     });
+            //     return list;
+            // },
+
+            // 禁用分割线
+            // disableLine: true,
+
+            // 设置表头的icon图标是否跟随文本
+            // isIconFollowText: true,
+
+            // 组合排序
+            // isCombSorting: true,
+
+            // 合并排序
+            // mergeSort: true,
+
+            // 禁用边框线
+            // disableBorder: true,
+
+            // 行移动
+            // supportMoveRow: true,
+            // moveRowConfig: {
+            //     key: 'priority',
+            //     useSingleMode: true,
+            //     fixed: 'left',
+            //     handler: (list, tableData) => {
+            //         //console.log(list, tableData);
+            //     }
+            // },
+
+            // 禁用缓存
+            disableCache: false,
+            ajaxData: function (settings, params) {
+                // document.querySelector('[name="categoryId"]').value = params.categoryId || "";
+                return '/json/fee';
+            },
+
+            // 导出配置
+            exportConfig: {
+                fileName: query => {
+                    const date = new Date();
+                    let fileName = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`;
+                    for (let key in query) {
+                        fileName = `${fileName}-${key}=${query[key]}`;
+                    }
+                    return fileName;
+                },
+                suffix: 'xls'
+            },
+            ajaxType: 'GET',
+
+            // 选择事件执行前事件
+            checkedBefore: function (checkedList, isChecked, row) {
+                console.log('checkedBefore==', checkedList, isChecked, row);
+                if (row && row.id === 90) {
+                    alert('该节点在checkedBefore中配置为不可选');
+                }
+                return row && row.id !== 90;
+            },
+
+            // 选择事件执行后事件
+            checkedAfter: function (checkedList, isChecked, row) {
+                console.log('checkedAfter==', checkedList, isChecked, row);
+            },
+
+            // 全选事件执行前事件
+            checkedAllBefore: function (checkedList, isChecked) {
+                console.log('checkedAllBefore==', checkedList, isChecked);
+                //
+                // if (isChecked) {
+                //     alert('不能取消全选');
+                // }
+                // return !isChecked;
+            },
+
+            // 全选事件执行后事件
+            checkedAllAfter: function (checkedList, isChecked) {
+                console.log('checkedAllAfter==', checkedList, isChecked);
+            },
+
+            // 执行排序前事件
+            sortingBefore: function (query) {
+                console.log('sortingBefore', query);
+            },
+
+            // 排行排序后事件
+            sortingAfter: function (query) {
+                console.log('sortingAfter', query);
+            },
+
+            // AJAX请求前事件函数
+            ajaxBeforeSend: function (promise) {
+                console.log('ajaxBeforeSend');
+            },
+            // AJAX成功事件函数
+            ajaxSuccess: function (response) {
+                console.log('ajaxSuccess');
+            },
+
+            // AJAX失败事件函数
+            ajaxError: function (errorInfo) {
+                console.log('ajaxError');
+            },
+
+            // AJAX结束事件函数
+            ajaxComplete: function (complete) {
+                console.log('ajaxComplete');
+            },
+            adjustBefore: eve => {
+                console.log('adjustBefore=>', eve);
+            },
+            adjustAfter: eve => {
+                console.log('adjustAfter=>', eve);
+            },
+
+            // 执行请求后执行程序
+            // responseHandler: res => {
+            //     res.data.forEach(item => {
+            //         // 用id模拟优先级字段
+            //         item.priority = item.id;
+            //     });
+            //     return res;
+            // },
+
+            // 单行数据渲染时执行程序
+            // rowRenderHandler: (row, index) => {
+            //     // if (row.id === 90) {
+            //     //     row.gm_checkbox = true;
+            //     // }
+
+            //     // 指定第92行不可选中
+            //     if (row.id === 92) {
+            //         // row.gm_checkbox = true;
+            //         row.gm_checkbox_disabled = true;
+            //         row.gm_row_class_name = 'test-row-class';
+            //     }
+            //     return row;
+            // },
+
+            emptyTemplate: settings => {
+                return `<div style="text-align: center;">${settings.query.title ? '搜索为空' : '暂无数据'}</div>`;
+            },
+            // 单个td的hover事件
+            // cellClick: (row, rowIndex, colIndex) => {
+            //     // console.log(row, rowIndex, colIndex);
+            //     return {
+            //         text: '这里有个提示',
+            //         position: 'left'
+            //     };
+            // },
+            // rowHover: (a, b, c) => {
+            //     return {
+            //         text: '这里有个提示',
+            //         position: 'right'
+            //     };
+            // },
+            //  useWordBreak: true,
+            fullColumn: {
+                useFold: true,
+                fixed: 'left', // 折叠事件列固定方向
+                openState: false,
+                bottomTemplate: function(row, index){
+                    return `
+                    <p>费用说明</p>
+                    <pre>${row.explanation}</pre>`;
+                }
+            },
+            columnData: [
+                {
+                    key: 'staffName',
+                    width: '60px',
+                    text: '上报人',
+                    
+                    disableMoveRow: true,
+                    // 使用函数返回 dom node
+                    // template: function (title, row) {
+                    //     var titleNode = document.createElement('a');
+                    //     titleNode.setAttribute('href', `/expensesDoc/10`);
+                    //     titleNode.setAttribute('title', title);
+                    //     titleNode.setAttribute('target', '_blank');
+                    //     titleNode.innerText = title;
+                    //     titleNode.title = `点击阅读[${row.title}]`;
+                    //     titleNode.classList.add('plugin-action');
+                    //     return titleNode;
+                    // }
+                }, 
+                {
+                    key: 'Rtype',
+                    // remind: '报销单,借款,对公汇款,培训班',
+                    width: '90px',
+                    text: '费用类型',
+                    disableMoveRow: true
+                }, 
+                {
+                    key: 'sum',
+                    width: '100px',
+                    text: '费用总金额',
+                    disableMoveRow: true
+                }, 
+                {
+                    key: 'categoryValue',
+                    width: '60px',
+                    text: '办事处',
+                    disableMoveRow: true
+                }, 
+                {
+                    key: 'receiptOrder',
+                    width: '140px',
+                    text: '费用单号',
+                    disableMoveRow: true,
+                    template: function (receiptOrder, row) {
+                        var titleNode = document.createElement('a');
+                        titleNode.setAttribute('href', `/expensesDoc/${row.ridOld}`);
+                        titleNode.setAttribute('receiptOrder', receiptOrder);
+                        titleNode.setAttribute('target', '_blank');
+                        titleNode.innerText = receiptOrder;
+                        titleNode.title = `详情[${row.receiptOrder}]`;
+                        return titleNode;
+                    }
+                }, 
+                {
+                    key: 'explanation',
+                    text: '费用说明',
+                    disableMoveRow: true,
+                    // template: function (explanation, row) {
+                    //     var titleNode = document.createElement('pre');
+                    //     titleNode.innerText = explanation;
+                    //     titleNode.title = `点击阅读[${row.explanation}]`;
+                    //     return titleNode;
+                    // }
+                }, 
+                {
+                    key: 'date',
+                    width: '90px',
+                    text: '创建时间',
+                    disableMoveRow: true
+                }, 
+                {
+                    key: 'pastDate',
+                    width: '90px',
+                    text: '审批时间',
+                    disableMoveRow: true
+                }, 
+                {
+                    key: 'statusValue',
+                    width: '90px',
+                    text: '状态',
+                    disableMoveRow: true
+                }, 
+                // {
+                //     key: 'type',
+                //     remind: {
+                //         text: '[HTML/CSS, nodeJS, javaScript, 前端鸡汤, PM Coffee, 前端框架, 前端相关]',
+                //         style: {
+                //             width: '300px',
+                //             'text-align': 'left'
+                //         }
+                //     },
+                //     text: '费用类型',
+                //     align: 'left',
+                //     width: '150px',
+                //     sorting: '',
+                //     disableMoveRow: true,
+                //     // 表头筛选条件, 该值由用户操作后会将选中的值以{key: value}的形式覆盖至query参数内。非必设项
+                //     // filter: {
+                //     //     // 筛选条件列表, 数组对象。格式: [{value: '1', text: 'HTML/CSS'}],在使用filter时该参数为必设项。
+                //     //     option: [
+                //     //         {value: '1', text: 'HTML/CSS'},
+                //     //         {value: '2', text: 'nodeJS'},
+                //     //         {value: '3', text: 'javaScript'},
+                //     //         {value: '4', text: '前端鸡汤'},
+                //     //         {value: '5', text: 'PM Coffee'},
+                //     //         {value: '6', text: '前端框架'},
+                //     //         {value: '7', text: '前端相关'}
+                //     //     ],
+                //     //     // 筛选选中项,字符串, 未存在选中项时设置为''。 在此设置的选中的过滤条件将会覆盖query
+                //     //     selected: '3',
+                //     //     // 否为多选, 布尔值, 默认为false。非必设项
+                //     //     isMultiple: false
+                //     // },
+                //     // template: function (type, row) {
+                //     //     return TYPE_MAP[type];
+                //     // }
+                // }, 
+                // {
+                //     key: 'info',
+                //     remind: 'the info',
+                //     width: '100px',
+                //     text: '费用结算',
+                //     disableMoveRow: true
+                // }, 
+                // {
+                //     key: 'username',
+                //     remind: 'the username',
+                //     align: 'center',
+                //     width: '100px',
+                //     text: '费用所在办事处',
+                //     disableMoveRow: true,
+                //     template: (username, row) => {
+                //         return `<a class="plugin-action" href="https://github.com/baukh789" target="_blank" ${row.id} title="去看看${username}的github">${username}</a>`;
+                //     }
+                // }, 
+                // {
+                //     key: 'createDate',
+                //     width: '130px',
+                //     text: '费用单号',
+                //     sorting: 'DESC',
+                //     align: 'left',
+                //     // 使用函数返回 htmlString
+                //     template: (createDate, row) => {
+                //         return new Date(createDate).toLocaleDateString();
+                //     }
+                // }, 
+                // {
+                //     key: 'lastDate',
+                //     width: '130px',
+                //     text: '最后修改时间',
+                //     merge: 'text',
+                //     sorting: '',
+                //     // 使用函数返回 htmlString
+                //     template: function (lastDate, row) {
+                //         return new Date(lastDate).toLocaleDateString();
+                //     }
+                // },
+                // {
+                //     key: 'priority',
+                //     text: '优先级',
+                //     // fixed: 'right',
+                //     align: 'right',
+                //     width: '100px'
+                // }
+            ]
+        }, query => {
+            // 渲染完成后的回调函数
+            console.log('渲染完成后的回调函数:', query);
+        });
+    },
+
+    /**
+     * 编辑功能
+     */
+    editRowData: function (dom) {
+        window.GridManager.updateRowData('test', 'id', { id: window.parseInt(dom.getAttribute('data-id')), lastDate: new Date().getTime() });
+    }
+};
+
+// GridManager 渲染
+const table = document.querySelector('#feeList');
+
+demo1.initSearch(table);
+demo1.initGM(table);
+//demo1.initFN();
+

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 1 - 0
global/gridManager/gm.css


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 1 - 0
global/gridManager/gm.js


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 293 - 0
protected/cache/categoryCollect/categoryCollect_2004.htmls


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 350 - 0
protected/cache/staffCollect/staffCollect_2004_.htmls


+ 194 - 0
protected/controller/fee/dashboard_controller.php

@@ -0,0 +1,194 @@
+<?php
+/*
+ * @description: 费用管理控制类 @Author: CP @Date: 2020-11-11 17:51:05 @FilePath: \cld\protected\controller\fee\fee_controller.php
+ */
+require "protected/services/software_service.php";
+// require "protected/services/region_service.php";
+// require "protected/services/office_service.php";
+// require "protected/services/staff_service.php";
+require "protected/class/comm_cld.php";
+class dashboard_controller extends DooController {
+	private $softwareService;
+	private $staff;
+	
+	
+	//获得面板软件锁个数
+	public function GetJsonDashboardSoftwareCount(){
+		
+// 		include Doo::conf()->BASE_PATH.'diagnostic/debug.php';
+		// 1.获得参数
+		$data = array (
+				"staffId" => get_args ( 'staffId' ),
+				"categoryId" => get_args ( 'categoryId' ) ?get_args ( 'categoryId' ) :GetDecryptId($this->staff['cid']),
+				"year" => get_args ( 'year' ) ? get_args ( 'year' ):date("Y")
+		);
+		//print_r($data);
+// 		$data = array (
+// 				"staffId" => 94,
+// 				"categoryId" => 3,
+// 				"year" => 2021
+// 		);
+		
+		$data=$this->softwareService->GetSoftwareCount($data);
+		
+		echo json_encode(array(
+				"status"=>"success",
+ 				"totals"=>12,
+				"data"=>$data,
+		));
+
+	}
+	
+	
+	
+	
+	
+	
+	
+	
+	
+	
+	
+	
+	
+	
+	
+	
+	
+	
+	
+	
+	
+	
+	public function beforeRun($resource, $action) {
+		
+		
+		$this->accessAuth ( $resource, $action );
+	}
+	function __construct() {
+		include Doo::conf()->BASE_PATH.'diagnostic/debug.php';
+		$this->session ();
+		$this->softwareService = new software_service ();
+		
+	}
+	
+	// 访问权限-费用管理
+	private function accessAuth($resource, $action) {
+		Doo::loadClass ( 'XDeode' );
+		$XDeode = new XDeode ( 5 );
+		$sid = $XDeode->decode ( $_COOKIE ["staff"] );
+		// 1.单独判断公司汇总的访问权限
+		if ($action == 'companyCategoryCollect') {
+			Doo::loadModel ( "receiptAuthorityManage" );
+			$invoiceCompanyManage = new receiptAuthorityManage ();
+				
+			$icm = $invoiceCompanyManage->getInvoiceCMByStaff ( $sid );
+			if (empty ( $icm ))
+				die ( 'illegal request-无权访问该页面' );
+		}
+	
+		// 2.获得登陆用户信息
+		Doo::loadModel ( 'cld/staff_cld' );
+		$staff = new staff_cld ();
+		$this->staff = $staff->Get ( $sid );
+	
+		// 3.是否有权限访问
+		$accessModular = 'DASHBOARD';
+		if (empty ( $this->staff ['cldAccessArray'] )) {
+			die ( 'illegal request-无权访问费用页面,向总部申请权限' );
+		} else {
+			if (in_array ( "RECEIPTS", $this->staff ['cldAccessArray'] )) {
+				if (Doo::acl ()->isAllowed ( $accessModular, $resource, $action )) {
+					$flag = true;
+				} else {
+					$flag = false;
+				}
+			} else {
+				die ( 'illegal request-无权访问费用页面' );
+			}
+		}
+		if (! $flag)
+			die ( 'illegal request-无权访问费用页面' );
+	}
+	
+	// 登陆判定
+	private function session() {
+		if (isset ( $_COOKIE ["staff"] )) {
+				
+			if (! empty ( $_COOKIE ["staff"] )) {
+	
+				Doo::loadModel ( 'staff' );
+				Doo::loadModel ( 'verify' );
+				$verify = new verify ();
+				$staff = new staff ();
+				Doo::loadModel ( "execute" );
+				$execute = new execute ();
+	
+				$verifyList = $verify->find ( array (
+						'select' => 'staff',
+						'asArray' => true
+				) );
+				$list = array ();
+	
+				// 判断角色的审批权限
+				foreach ( $verifyList as $key => $value ) {
+					$ver = json_decode ( $value ['staff'] );
+						
+					foreach ( $ver as $k => $v ) {
+						if ($v [1] == 'ROLE') {
+							$roleList = json_decode ( $v [3] );
+							foreach ( $roleList as $t => $g ) {
+								$gList = explode ( "_", $g );
+								array_push ( $list, $gList [0] );
+								// print_r($list);
+							}
+						} else
+							array_push ( $list, $v [0] );
+					}
+				}
+	
+				// 判断执行人的审批权限
+				$executeList = $execute->find ( array (
+						'where' => 'mold !="日常收支"',
+						'select' => 'staff',
+						'asArray' => true
+				) );
+				$list2 = array ();
+				foreach ( $executeList as $key => $value ) {
+					$ver = json_decode ( $value ['staff'] );
+						
+					foreach ( $ver as $k => $v ) {
+						array_push ( $list2, $v [0] );
+					}
+				}
+	
+				$eidList = file_get_contents ( "protected/config/execute/execute.ini" );
+				$eidList = array_filter ( explode ( ",", $eidList ) );
+	
+				$this->executeId = array_merge ( $list2, $eidList );
+				// print_r($this->executeId);
+				$this->verifyId = $list;
+				// $this->staff = $staff->getUserByIdList ( $_COOKIE ["staff"] );
+	
+				return "/";
+			}
+		}
+	
+		Doo::loadCore ( 'uri/DooUriRouter' );
+		$router = new DooUriRouter ();
+		$routeRs = $router->execute ( Doo::app ()->route, Doo::conf ()->SUBFOLDER );
+	
+		if ($routeRs ['1'] != "login") {
+			header ( 'Content-Type:text/html;charset=utf-8' );
+			@header ( "Location: /login" );
+		}
+	}
+	
+	
+	
+	
+	
+	
+}
+
+?>

+ 152 - 0
protected/model/cld/accountBook_cld.php

@@ -0,0 +1,152 @@
+<?php
+Doo::loadCore ( 'db/DooModel' );
+class accountBook_cld extends DooModel {
+	public $aid;
+	public $expensesType;
+	public $accountType;
+	public $accountMsg;
+	public $operatingBankType;
+	public $depositMethod;
+	public $receivedPrice;
+	public $receivedMsg;
+	public $receivedBank;
+	public $receivedDate;
+	public $expenditureType;
+	public $expenditureMsg;
+	public $expenditurePrice;
+	public $expenditureBank;
+	public $bookSerial;
+	public $inputDate;
+	public $remarks;
+	public $expenditureDate;
+	
+	public $inputStaff;
+	
+	public $_table = 'CLD_accountBook';
+	public $_primarykey = 'aid';
+	public $_fields = array (
+			'aid',
+			'expensesType',
+			'accountType',
+			'accountMsg',
+			'operatingBankType',
+			'depositMethod',
+			'receivedPrice',
+			'receivedMsg',
+			'receivedBank',
+			'receivedDate',
+			'expenditureType',
+			'expenditureMsg',
+			'expenditurePrice',
+			'expenditureBank',
+			
+			'expenditureDate',
+			
+			'bookSerial',
+			'remarks',
+			'inputDate' ,
+			'inputStaff'
+	);
+	
+	public function GetExpensesType($data=array()){
+		$startYear=$data['year']."-01-01:00.00.00";
+		$endYear=$data['year']."-12-31:23.59.59";
+		if(!empty($data['month'])){
+			$startYear=$data['year']."-".$data['month']."-01:00.00.00";
+			$endYear=$data['year']."-".$data['month']."-31:23.59.59";
+		}
+		
+		$sql=" ((expenditureDate>=? and expenditureDate<= ?) or (receivedDate>=? and receivedDate<= ?))  ";
+		$param=array($startYear,$endYear,$startYear,$endYear);
+		if(!empty($data['expensesType'])){
+			$sql.=" and expensesType=? ";
+			array_push($param, $data['expensesType']);
+		}
+		//获得数据
+		$list = $this->find ( array (
+				'select'=>' *	',
+				'where' => $sql,
+				'param' =>$param,
+				'desc' => 'aid',
+// 				'limit'=>$data['cPage'].','.$data['pSize'],
+				'asArray' => TRUE
+		));
+		
+		return $list;
+	}
+	
+	//费用分页
+	public function GetPage($data=array()){
+	
+		$startYear=$data['year']."-01-01:00.00.00";
+		$endYear=$data['year']."-12-31:23.59.59";
+		if(!empty($data['month'])){
+			$startYear=$data['year']."-".$data['month']."-01:00.00.00";
+			$endYear=$data['year']."-".$data['month']."-31:23.59.59";
+		}
+		//(inputDate>=? and inputDate<= ?) or   $startYear,$endYear,
+		$sql=" ((expenditureDate>=? and expenditureDate<= ?) or (receivedDate>=? and receivedDate<= ?))  ";
+		$param=array($startYear,$endYear,$startYear,$endYear);
+	
+		if(!empty($data['expensesType'])){
+			$sql.=" and expensesType=? ";
+			array_push($param, $data['expensesType']);
+		}
+		
+		if(!empty($data['accountType'])){
+			$sql.=" and accountType=? ";
+			array_push($param, $data['accountType']);
+		}
+		
+		if(!empty($data['expenditureType'])){
+			$sql.=" and expenditureType=? ";
+			array_push($param, $data['expenditureType']);
+		}
+		
+// 		if(!empty($data['staffId'])){
+// 			$sql.=" and staff=? ";
+// 			array_push($param, $data['staffId']);
+// 		}else{
+// 			if(!empty($data['categoryId'])){
+// 				$sql.=" and cid=? ";
+// 				array_push($param, $data['categoryId']);
+// 			}
+// 		}
+	
+		if(!empty($data['feeType'])){
+			$sql.=" and Rtype=? ";
+			array_push($param, $data['feeType']);
+		}
+	
+		if(!empty($data['kw'])){
+			$sql.=" and (bookSerial like ? or receivedPrice like ? or expenditurePrice like ? ) ";
+			array_push($param, "%".$data['kw']."%");
+			array_push($param, "%".$data['kw']."%");
+			array_push($param, "%".$data['kw']."%");
+		}
+	
+		//获得数据
+		$list = $this->find ( array (
+				'select'=>' *	',
+				'where' => $sql,
+				'param' =>$param,
+				'desc' => 'aid',
+				'limit'=>$data['cPage'].','.$data['pSize'],
+				'asArray' => TRUE
+		));
+		
+		
+		
+		$count=$this->count(array (
+				'where' => $sql,
+				'param' =>$param,
+				'asArray' => TRUE
+		));
+	
+		return array("count"=>$count,"list"=>$list);
+	}
+	
+	
+}
+
+?>

+ 145 - 0
protected/model/cld/action_log_cld.php

@@ -0,0 +1,145 @@
+<?php
+
+Doo::loadCore('db/DooModel');
+
+class action_log_cld extends DooModel {
+
+    public $aid;
+    public $updatetime;
+    public $time;
+    public $action;
+    public $sid;
+    public $class;
+   	public $cid;
+    
+   	public $status;
+   	public $districtid;
+   	public $city;
+   	public $province;
+   	public $nature;
+   	public $company;
+   	
+    public $_table = 'CLD_action_log';
+    public $_primarykey = 'aid';
+    public $_fields = array('aid', 'updatetime','time', 'action','sid','class','cid','status','districtid','city','province','nature','company');
+
+    public $iconGenerate="iconGenerate";
+	public $iconReceive="iconReceive";
+	public $iconBorrow="iconBorrow";
+	public $iconSell="iconSell";
+	public $iconUpdate="iconUpdate";
+	public $iconReplace="iconReplace";
+	public $iconRecycle="iconRecycle";
+	public $iconLock="iconLock";
+	public $iconContacts="iconContacts";
+
+	
+	
+	public function GetSoftwareCountByStaffId($staffId,$year){
+	
+		$startYear=$year."-01-01";
+		$endYear=$year."-12-31";
+
+		$sql =" sid=? and (status=4 or status=5 or status=6 or status=7 ) and updatetime>='".$startYear."' and updatetime<='".$endYear."'";
+		
+		$list = $this->find ( array (
+				'where' => $sql,
+				'param' => array (
+						$staffId
+				),
+				'asArray' => TRUE
+		) );
+		
+		return $list;
+	}
+	
+	public function GetSoftwareCountByCategoryId($categoryId,$year){
+	
+		$startYear=$year."-01-01";
+		$endYear=$year."-12-31";
+	
+		$sql =" cid=? and (status=4 or status=5 or status=6 or status=7 ) and updatetime>='".$startYear."' and updatetime<='".$endYear."'";
+	
+		$list = $this->find ( array (
+				'where' => $sql,
+				'param' => array (
+						$categoryId
+				),
+				'asArray' => TRUE
+		) );
+	
+		return $list;
+	}
+	
+	
+	
+	
+	
+	
+	
+	
+	
+	
+	
+	
+	
+	
+    /**
+     * 拷贝日志表到存储
+     */
+	function copyActionLogToBakTable($tableNmae=''){
+		
+		if (empty($tableNmae))
+			return '';
+		
+		$sql = "SELECT table_name FROM information_schema.TABLES WHERE table_name ='".$tableNmae."'" ;
+		$query = Doo::db ()->query ( $sql );
+		$result = $query->fetch ();
+		if (!empty($result))
+			return '';
+		
+		$sql = "create table ".$tableNmae." as (select * from ".$this->_table.")" ;
+		$query = Doo::db ()->query ( $sql );
+	}
+	
+	function delActionLogByAid($aid=''){
+		if (empty($aid))
+			return '';
+		$sql ="DELETE FROM " . $this->_table . " WHERE `aid`>".$aid;
+		$query = Doo::db ()->query ( $sql );
+	}
+	
+    function getClientByCid($cid){
+    	$sql = "select * from " . $this->_table . " as a left join CLD_staff as b on (a.sid=b.sid)  where a.cid= '".$cid."' " ;
+		
+    	$query = Doo::db ()->query ( $sql );
+		
+		$result = $query->fetch ();
+		
+		return $result;
+    }
+    
+	function getClientByStaff($condition,$limit){
+    	
+    	$sql = "select * from " . $this->_table . " as a left join CLD_client as b on (a.cid=b.cid)  where 1 ".$condition." ".$limit ;
+		
+    	$query = Doo::db ()->query ( $sql );
+		
+		$result = $query->fetchAll ();
+		
+		return $result;
+    	
+    }
+    
+    public function getProject(){
+    	
+    	return $this->find ( array ('asc' => 'pid', 'asArray' => TRUE ) );
+    }
+    
+    public function getProjectByIdList($projectid){
+    	return $this->find ( array ('where' => "pid= '".$projectid."'", 'asArray' => TRUE ) );
+    }
+    
+}
+
+?>

+ 313 - 0
protected/model/cld/invoice_cld.php

@@ -0,0 +1,313 @@
+<?php
+Doo::loadCore ( 'db/DooModel' );
+/**
+ * 发票审批相关信息及其操作业务逻辑
+ * @author CP.
+ * @version 1.0
+ * @namespace invoice
+ * @package invoiceModel
+ */
+class invoice_cld extends DooModel {
+	private $INVOICEKEY = "APPROVAL";
+	private $FUZZY = 'FUZZY';
+	private $EXACTLY = "EXACTLY";
+	
+	/**
+	 *
+	 * @var integer $iid 发票ID
+	 */
+	public $iid;
+	public $isid;
+	public $trainId;
+	public $lossIid;
+	public $ipSource;
+	/**
+	 *
+	 * @var integer $status 审批状态
+	 */
+	public $status;
+	/**
+	 *
+	 * @var string $invoiceManage 当前审批组人员
+	 */
+	public $printStatus;
+	public $postStatus;
+	public $invoiceForm;
+	public $invoiceManage;
+	/**
+	 *
+	 * @var string $pendingApprovals 当前需要审批的人
+	 */
+	public $pendingApprovals;
+	/**
+	 *
+	 * @var string $processApprovals 已经审批过的人员
+	 */
+	public $processApprovals;
+	/**
+	 *
+	 * @var string $invoiceSerial 发票单号
+	 */
+	public $invoiceSerial;
+	/**
+	 *
+	 * @var integer $invoicePrice 发票金额
+	 */
+	public $invoicePrice;
+	public $invoiceQuantity;
+	public $invoiceUnitPrice;
+	public $invoiceBalance;
+	
+	/**
+	 * 管理组人员:发票打印,
+	 * @var unknown
+	 */
+	public $moldManage;
+	/**
+	 *
+	 * @var integer $cid 办事处ID
+	 */
+	public $cid;
+	/**
+	 *
+	 * @var string $categoryName 办事处名称
+	 */
+	public $categoryName;
+	/**
+	 *
+	 * @var integer $sid 提交发票人ID
+	 */
+	public $sid;
+	/**
+	 *
+	 * @var string $userName 提交人名字
+	 */
+	public $printer;
+	public $userName;
+	/**
+	 *
+	 * @var string $remark 备注
+	 */
+	public $remark;
+	/**
+	 *
+	 * @var string $invoiceElement 发票内容
+	 */
+	public $invoiceElement;
+	/**
+	 *
+	 * @var string $invoiceType 发票类型
+	 */
+	public $invoiceType;
+	/**
+	 *
+	 * @var string $invoiceTitle 发票抬头
+	 */
+	public $invoiceTitle;
+	/**
+	 *
+	 * @var string $invoiceCompany 开票公司
+	 */
+	public $invoiceCompany;
+	/**
+	 *
+	 * @var string $invoiceNo 发票号
+	 */
+	public $invoiceNo;
+	/**
+	 *
+	 * @var string $TIN 纳税人识别码
+	 */
+	public $TIN;
+	/**
+	 *
+	 * @var string $address 注册地址
+	 */
+	public $address;
+	/**
+	 *
+	 * @var string $phone 电话
+	 */
+	public $phone;
+	/**
+	 *
+	 * @var string $bank 开户银行
+	 */
+	public $bank;
+	/**
+	 *
+	 * @var string $bankAccount 银行账户
+	 */
+	public $bankAccount;
+	/**
+	 *
+	 * @var integer $doPost 邮寄
+	 */
+	public $doPost;
+	/**
+	 *
+	 * @var string $recipients 收件人
+	 */
+	public $recipients;
+	/**
+	 *
+	 * @var string $recipientsPhone 收件人电话
+	 */
+	public $recipientsPhone;
+	/**
+	 *
+	 * @var string $recipientsAddress 收件地址
+	 */
+	public $recipientsAddress;
+	/**
+	 *
+	 * @var string $mailItems 邮寄物品
+	 */
+	public $mailItems;
+	public $mailItemsJson;
+	public $expressCompany;
+	public $expressNumber;
+	public $actualItems;
+	public $poster;
+	public $untreadReason;
+	public $untreadPost;
+	public $untreadCompany;
+	public $untreadNumber;
+	public $untreadItems;
+	public $untreadStatus;
+	public $irid;
+	public $bindTime;
+	/**
+	 *
+	 * @var date $date 提交时间
+	 */
+	public $date;
+	public $isDelete;
+	public $approvalTime;
+	/**
+	 *
+	 * @var date $updateTime 更新时间
+	 */
+	public $updateTime;
+	/**
+	 *
+	 * @var date $printTime 打印时间
+	 */
+	public $printTime;
+	public $postTime;
+	public $settlementType;
+	public $accountingTime;
+	public $parentUntreadIid;
+	public $inheritIid;
+	public $electronicPhone;
+	public $electronicEmail;
+	public $invalid;
+	public $badDebt;
+	public $untreadTime;
+	public $_table = 'CLD_invoice';
+	public $_primarykey = 'iid';
+	public $_fields = array (
+			'iid',
+			'isid',
+			'trainId',
+			'ipSource',
+			'lossIid',
+			'invoiceManage',
+			'pendingApprovals',
+			'processApprovals',
+			'invoiceSerial',
+			'status',
+			'printStatus',
+			'postStatus',
+			'untreadStatus',
+			'invoiceForm',
+			'invoiceQuantity',
+			'invoiceUnitPrice',
+			'invoicePrice',
+			'invoiceBalance',
+			'moldManage',
+			'cid',
+			'categoryName',
+			'irid',
+			'remark',
+			'invoiceElement',
+			'invoiceType',
+			'invoiceTitle',
+			'invoiceCompany',
+			'invoiceNo',
+			'TIN',
+			'address',
+			'phone',
+			'bank',
+			'bankAccount',
+			'doPost',
+			'recipients',
+			'recipientsPhone',
+			'recipientsAddress',
+			'mailItems',
+			'mailItemsJson',
+			'expressCompany',
+			'expressNumber',
+			'actualItems',
+			'untreadReason',
+			'untreadPost',
+			'untreadCompany',
+			'untreadNumber',
+			'untreadItems',
+			'poster',
+			'sid',
+			'userName',
+			'printer',
+			'date',
+			'isDelete',
+			'approvalTime',
+			'updateTime',
+			'printTime',
+			'postTime',
+			'bindTime',
+			'settlementType',
+			'accountingTime',
+			'parentUntreadIid',
+			'inheritIid',
+			'electronicPhone',
+			'electronicEmail',
+			'invalid',
+			'badDebt',
+			'untreadTime' 
+	);
+	
+	/**
+	 * @Description: 根据培训班获得发票
+	 * @author : caipin
+	 */
+	function GetTrainByStatus($trainId,$status=2,$untreadStatus=3) {
+		$sql = "  trainId= ? and status=? and untreadStatus=?  and isDelete=0 ";
+		$list = $this->find ( array (
+				'where' => $sql,
+				'param' => array (
+						$trainId ,
+						$status,
+						$untreadStatus
+				),
+				'asArray' => TRUE 
+		) );
+		return $list;
+	}
+	/**
+	 * @Description: 根据培训班获得发票
+	 * @author : caipin
+	 */
+	function GetTrainByUnFinish($trainId) {
+		$sql = "  trainId= ? and printStatus=1 and (untreadStatus =0 or untreadStatus=3) and isDelete=0  ";
+		$list = $this->find ( array (
+				'where' => $sql,
+				'param' => array (
+						$trainId ,
+				),
+				'asArray' => TRUE
+		) );
+		return $list;
+	}
+}
+
+?>

+ 163 - 0
protected/model/cld/invoice_training_cld.php

@@ -0,0 +1,163 @@
+<?php
+Doo::loadCore ( 'db/DooModel' );
+/**
+ * 发票培训班相关信息及其操作业务逻辑
+ * @author CP.
+ * @version 1.0
+ * @namespace invoice
+ * @package invoiceModel
+ */
+class invoice_training_cld extends DooModel {
+	public $itid;
+	public $bindReceipt;
+	public $status;
+	public $submitStatus;
+	public $trainName;
+	public $cid;
+	public $categoryName;
+	public $creator;
+	public $trainDate;
+	public $invoiceTotal;
+	public $invoiceTotalAmount;
+	public $invoiceArriveAmount;
+	public $arriveSchedule;
+	public $creatorDate;
+	public $settlementStatus;
+	public $_table = 'CLD_invoiceTraining';
+	public $_primarykey = 'itid';
+	public $_fields = array (
+			'itid',
+			'bindReceipt',
+			'status',
+			'submitStatus',
+			'trainName',
+			'cid',
+			'categoryName',
+			'creator',
+			'trainDate',
+			'invoiceTotal',
+			'invoiceTotalAmount',
+			'invoiceArriveAmount',
+			'arriveSchedule',
+			'settlementStatus',
+			'creatorDate' 
+	);
+	
+	/**
+	 * 获得根据办事处,创建人状态获得培训班 @date: 2021年1月21日 上午11:58:52
+	 * @author : caipin
+	 * @param : variable
+	 */
+	function getStatusByCategoryStaff($status, $categoryIdString, $staffId) {
+		$sql = " status=2   ";
+		if ($status == 0) {
+			$sql = " status!=2   ";
+		}
+		$sql .= " and (cid in (?) or creator= ?) ";
+		$list = $this->find ( array (
+				'where' => $sql,
+				'param' => array (
+						$categoryIdString,
+						$staffId 
+				),
+				'asArray' => TRUE 
+		) );
+		return $list;
+	}
+	function getInvoiceTrainingByTodo($select = "", $cid = 0, $sid = 0) {
+		Doo::loadModel ( 'staff' );
+		$staff = new staff ();
+		Doo::loadModel ( 'L_category' );
+		$lCategory = new L_category ();
+		
+		$condition = array (
+				'where' => "(status= 0 or status=1) and ( cid in (" . $cid . ") or creator=" . $sid . " ) ",
+				// 'limit' => 8,
+				'asArray' => TRUE 
+		);
+		if (! empty ( $select ))
+			$condition += array (
+					'select' => $select 
+			);
+		
+		$list = $this->find ( $condition );
+		
+		Doo::loadClass ( 'XDeode' );
+		$XDeode = new XDeode ( 5 );
+		$itid = array ();
+		foreach ( $list as $key => $value ) {
+			$list [$key] ['trainingKey'] = $XDeode->encode ( $value ['itid'] );
+			$detail = $staff->getStaffBySid ( $value ['creator'] );
+			$list [$key] ['staff'] = $detail;
+			$detail = $lCategory->getCategoryById ( $value ['cid'] );
+			$list [$key] ['category'] = $detail;
+			array_push ( $itid, $value ['itid'] );
+		}
+		
+		// 获得开票金额合计 入账金额合计 入账完成度
+		Doo::loadModel ( 'invoice' );
+		$invoice = new invoice ();
+		
+		$invoiceList = $invoiceRecelvablesList = array ();
+		$itidSum = array ();
+		if (! empty ( $itid )) {
+			$itidSql = implode ( ',', $itid );
+			$invoiceList = $invoice->sumOfinvoiceTrain ( $itidSql );
+			
+			// 1.所有培训班发票 收款合计
+			$invoiceRecelvablesList = $invoice->InvoiceTrainIncomesPrice ( $itid );
+			// print_r($invoiceRecelvablesList);
+			// $invoiceRecelvablesList = $invoice->sumOfInvoiceRecelvablesTrain ( $itidSql );
+			
+			// 收款有多个发票绑定,导致收款金额没有统计--TODO
+			// 获得收款扩展部分的金额
+			// id
+			$iidList = $invoice->getInvoiceByTrain ( $itidSql );
+			foreach ( $iidList as $key => $value ) {
+				$idData = explode ( ",", $value ['iid'] );
+				$sum = 0;
+				foreach ( $idData as $item ) {
+					
+					$sum += $invoice->getTrainRP ( $item );
+				}
+				//
+				$itidSum [$value ['trainId']] = $sum;
+			}
+		}
+		// print_r($iidList);
+		// print_r($invoiceRecelvablesList);
+		// print_r($itidSum);
+		
+		foreach ( $list as $key => $value ) {
+			
+			$countInvoice = $invoice->getInvoiceByTrainingCount ( $value ['itid'] );
+			$value ['invoiceTotal'] = $countInvoice;
+			$list [$key] ['invoiceTotal'] = $countInvoice;
+			
+			foreach ( $invoiceList as $k => $v ) {
+				if ($value ['itid'] == $v ['trainId']) {
+					$list [$key] ['invoiceTotalAmount'] = $v ['invoicePrice'];
+					break;
+				}
+			}
+			
+			foreach ( $invoiceRecelvablesList as $i => $o ) {
+				if ($value ['itid'] == $o ['trainId']) {
+					$list [$key] ['invoiceArriveAmount'] = $o ['receivablesPrice'];
+					$list [$key] ['arriveSchedule'] = "0";
+					if ($value ['invoiceTotal'] != 0) {
+						// $list [$key] ['invoiceArriveAmount']+=$itidSum[$value ['itid']];
+						$list [$key] ['arriveSchedule'] = round ( $list [$key] ['invoiceArriveAmount'] / $list [$key] ['invoiceTotalAmount'] * 100, 2 );
+						// $list [$key] ['arriveSchedule'] = round ( $o ['count'] / $value ['invoiceTotal'] * 100, 2 );
+					}
+					
+					break;
+				}
+			}
+		}
+		
+		return $list;
+	}
+}
+
+?>

+ 129 - 0
protected/model/cld/longle_cld.php

@@ -0,0 +1,129 @@
+<?php
+
+Doo::loadCore ( 'db/DooModel' );
+
+class longle_cld extends DooModel {
+	
+	public $lid;
+	public $year;
+	public $cid;
+	public $category;
+	public $status;
+	public $statuslog;
+	public $statusT;
+	public $key_num;
+	public $product;
+	public $alloted_time;
+	public $product_id;
+	public $make_day;
+	public $version;
+	public $responsible;
+	public $client;
+	public $clientid;
+	public $licences;
+	public $SerialNumber;
+	
+	public $AuthorizeStr;
+	public $AuthorizeFile;
+	public $UpdateStr;
+	public $UpdateFile;
+	
+	
+	
+	public $_table = 'CLD_longle';
+	public $_primarykey = 'lid';
+	public $_fields = array ('lid', 'year', 'cid','category','product_id', 'status','statuslog','statusT', 'key_num','SerialNumber','product','alloted_time', 'make_day','version', 'responsible','client','clientid'
+			,'licences' ,'AuthorizeStr','AuthorizeFile','UpdateStr','UpdateFile'
+	);
+	
+	public function getLongleByStatus($year=0,$cid=0,$staff=0,$status=0,$search="",$productW=""){
+		
+		if(empty($search)){
+			$str="( status=".$status." or statuslog like '%".$status."%' )";
+			$str2=" and make_day like '%".$year."%'";
+			$str3=" and cid =".$cid."";
+			$str4=" and product like '%".$productW."%'";
+			$str5=' and responsible="'.$staff.'"';
+			if(empty($productW))
+				$str4="";
+				
+			if($cid==0)
+				$str3="";
+				
+			if($year==0)
+				$str2="";
+
+			if(empty($staff))
+				$str5="";
+
+			if($status==0)
+				$str=" 1 ";
+				
+				//echo $str.$str2.$str3.$str4;
+				
+//			'select * form CLD_longle as a left join CLD_client as b on (a.clientid =b.cid) where ( status=3 or statuslog like "%3%" ) and make_day like "%2015%" and cid =10';
+		//echo  $str.$str2.$str3.$str4.$str5;
+			return $this->find ( array ('where' => $str.$str2.$str3.$str4.$str5, 'desc'=>'make_day', 'asArray' => TRUE ) );
+		}else{
+			return $this->find ( array ('where' => " key_num like '%".$search."%'",'desc'=>'make_day', 'asArray' => TRUE ) );
+		}
+	}
+	
+	public function getLongleReceive($cid,$status,$othercid=""){
+		
+		$str="";
+		if(!empty($othercid))
+			$str= " cid in (".$cid.",".$othercid." )";
+		else 
+			$str= " cid in (".$cid." )";
+			
+		return $this->find ( array ('where' => $str." and (status=".$status." or responsible='') and make_day>='2019-01-01' ", 'asArray' => TRUE ) );
+	}
+	
+	public function getLongleBykeynum($keynum){
+		return $this->find ( array ('where' => " key_num = '".$keynum."'", 'asArray' => TRUE ) );
+	}
+	
+	public function getLongleBykeynum2($keynum){
+		return $this->find ( array ('where' => " key_num like '%".$keynum."%'",'limit'=>'10', 'asArray' => TRUE ) );
+	}
+	
+	public function getLongleByKeyNumDetail($keynum,$SerialNumber=''){
+		return $this->getOne ( array ('where' => " key_num = '".$keynum."' and SerialNumber like '".$SerialNumber."'", 'asArray' => TRUE ) );
+	}
+	
+	public function getLongleByLid($lid){
+		return $this->find ( array ('where' => " lid =".$lid, 'asArray' => TRUE ) );
+	}
+	
+	public function getLongleByClient($clientname){
+		return $this->find ( array ('where' => " client like '".$clientname."'", 'asArray' => TRUE ) );
+	}
+	
+	public function getLongleBySerialNumber($SerialNumber){
+		return $this->getOne ( array ('where' => " SerialNumber like '".$SerialNumber."'", 'asArray' => TRUE ) );
+	}
+	
+	public function getLongleBySerialNumberList($SerialNumber){
+		return $this->find ( array ('where' => " SerialNumber like '".$SerialNumber."'", 'asArray' => TRUE ) );
+	}
+	
+	public function getLongleByClientid($client){
+		return $this->find ( array ('where' => " clientid = '".$client."'", 'asArray' => TRUE ) );
+	}
+	
+//	public function getLongleByRe($cid,$status=1){
+//		
+//	}
+	
+	public function getUser() {
+		return $this->find ( array ('asc' => 'uid', 'asArray' => TRUE ) );
+	}
+
+	public function getUserByIdList($puid){
+		return $this->find ( array ('where' => "uid= '".$puid."'", 'asArray' => TRUE ) );
+	}
+	
+}
+
+?>

+ 67 - 0
protected/model/cld/longle_log_cld.php

@@ -0,0 +1,67 @@
+<?php
+
+Doo::loadCore ( 'db/DooModel' );
+
+class longle_log_cld extends DooModel {
+	
+	public $logid;
+	public $status;
+	public $statusT;
+	public $lid;
+	public $sell_client;
+	public $client;
+	public $clientid;
+	public $responsible;
+	public $operator;
+	public $product_id;
+	public $product;
+	public $category;
+	public $new_key_num;
+	public $mark;
+	public $dateline;
+	
+	public $_table = 'CLD_longlelog';
+	public $_primarykey = 'logid';
+	public $_fields = array ('logid','lid', 'status','statusT', 'sell_client', 'client','clientid','responsible','operator','product_id','product','category','new_key_num','mark','dateline' );
+	
+// 	TODO 2021-01-22年软件锁日志表加入记录时间
+// 	以后的统计时间开始是2021-01-23开始-方法待完成
+	public function GetSoftwareCountByUsername($data){
+		
+		$startYear=$data['year']."-01-01";
+		$endYear=$data['year']."-12-31";
+		
+		"dateline>='".startYear."' and dateline<='".endYear."'";
+		
+		$sql = "  operator = ? and status=? and untreadStatus=?  and isDelete=0 ";
+		$list = $this->find ( array (
+				'where' => $sql,
+				'param' => array (
+						$trainId ,
+						$status,
+						$untreadStatus
+				),
+				'asArray' => TRUE
+		) );
+		return $list;
+	}
+	
+	public function getLongleByLid($lid){
+		return $this->find ( array ('where' => "lid= '".$lid."'", 'desc' => 'logid', 'asArray' => TRUE ) );
+	}
+	
+	public function getLongleByName($name){
+		return $this->find ( array ('where' => "new_key_num= '".$name."'", 'desc' => 'logid', 'asArray' => TRUE ) );
+	}
+	
+	public function getUser() {
+		return $this->find ( array ('asc' => 'uid', 'asArray' => TRUE ) );
+	}
+
+	public function getUserByIdList($puid){
+		return $this->find ( array ('where' => "uid= '".$puid."'", 'asArray' => TRUE ) );
+	}
+	
+}
+
+?>

+ 63 - 0
protected/services/CopyOfinvoice_service.php

@@ -0,0 +1,63 @@
+<?php
+class invoice_service {
+	private $invoiceTraining;
+	private $invoice;
+	private $XDeode;
+	function __construct() {
+		Doo::loadClass ( 'XDeode' );
+		$this->XDeode = new XDeode ( 9 );
+		$this->XDeode5 = new XDeode ( 5 );
+		Doo::loadModel ( 'cld/invoice_training_cld' );
+		$this->invoiceTraining = new invoice_training_cld ();
+		Doo::loadModel ( 'cld/invoice_cld' );
+		$this->invoice = new invoice_cld ();
+	}
+	
+	/* 获得办事处和创建的 培训班发票 */
+	public function getTrainByCategoryStaff($status, $categoryIdString, $staffId) {
+		
+		Doo::loadModel ( 'staff' );
+		$staff = new staff ();
+		Doo::loadModel ( 'L_category' );
+		$lCategory = new L_category ();
+		
+		// 1.获得培训班
+		$list = $this->invoiceTraining->getStatusByCategoryStaff ( $status, $categoryIdString, $staffId );
+		
+		// 2.获得培训班发票总数-
+		foreach ( $list as $key => $value ) {
+			$list [$key] ['trainingKey'] = $this->XDeode5->encode ( $value ['itid'] );
+			$detail = $staff->getStaffBySid ( $value ['creator'] );
+			$list [$key] ['staff'] = $detail;
+			$detail = $lCategory->getCategoryById ( $value ['cid'] );
+			$list [$key] ['category'] = $detail;
+			
+// 			每个培训班发票总数和金额,入账总数
+			$invoiceList = $this->invoice->GetTrainByUnFinish ( $value ['itid'] );
+			
+			$list[$key]['invoiceTotal']=count($invoiceList);
+			$priceTotle=0;
+			$BalancePriceTotle=0;
+			foreach ($invoiceList as $k=>$v){
+				$priceTotle+=$v['invoicePrice'];
+				if($v['status']==2&&$v['untreadStatus']==3){
+					$BalancePriceTotle+=$v['invoiceBalance'];
+				}else{
+					$BalancePriceTotle+=$v['invoicePrice'];
+				}
+				
+			}
+			$list[$key]['invoiceTotalAmount']=$priceTotle;
+			$list[$key]['invoiceArriveAmount']=$priceTotle-$BalancePriceTotle;
+			$list[$key]['arriveSchedule']=0;
+			if($list[$key]['invoiceTotal']!=0){
+				$list[$key]['arriveSchedule']=round ( $list [$key] ['invoiceArriveAmount'] / $list [$key] ['invoiceTotalAmount'] * 100, 2 );
+			}
+			
+		}
+		return $list;
+// 		print_r ( $list );
+// 		die ();
+	}
+}
+?>

+ 447 - 0
protected/services/incomeExpenses_service.php

@@ -0,0 +1,447 @@
+<?php
+class incomeExpenses_service {
+	private $accountBook;
+	private $XDeode;
+	function __construct() {
+		Doo::loadClass ( 'XDeode' );
+		$this->XDeode = new XDeode ( 9 );
+		$this->XDeode5 = new XDeode ( 5 );
+		
+		Doo::loadModel ( 'cld/accountBook_cld' );
+		$this->accountBook = new accountBook_cld ();
+	}
+	
+	// 日常支出汇总
+	public function GetExpensesCollect($parameter = array()) {
+	
+		$data = $this->accountBook->GetExpensesType ( $parameter );
+	
+		$list = array ();
+	
+		// 初始化日
+		if (! empty ( $parameter ['month'] )) {
+				
+			$days = cal_days_in_month(CAL_GREGORIAN, $parameter['month'], $parameter['year']);
+				
+			for($i = 1; $i <= $days; $i ++) {
+				$item = array (
+						"month" => str_pad ( $i, 2, "0", STR_PAD_LEFT ),
+						"bankCharges" => 0,
+						"telephoneRate" => 0,
+						// 缴税
+						"addedTax" => 0,
+						"surcharges" => 0,
+						"corporateIncomeTax" => 0,
+						"socialSecurity" => 0,
+						"unionFees" => 0,
+						"personalIncomeTax" => 0,
+						"stampDuty" => 0,
+						"payTaxesSubtotal" => 0,
+						
+						"bond" => 0,
+						"wenku" => 0,
+						"other" => 0,
+	
+						"subtotal" => 0
+				);
+				array_push ( $list, $item );
+			}
+		} else {
+			// 初始化月份
+			for($i = 1; $i <= 12; $i ++) {
+				$item = array (
+						"month" => str_pad ( $i, 2, "0", STR_PAD_LEFT ),
+						"bankCharges" => 0,
+						"telephoneRate" => 0,
+						// 缴税
+						"addedTax" => 0,
+						"surcharges" => 0,
+						"corporateIncomeTax" => 0,
+						"socialSecurity" => 0,
+						"unionFees" => 0,
+						"personalIncomeTax" => 0,
+						"stampDuty" => 0,
+						"payTaxesSubtotal" => 0,
+						
+						"bond" => 0,
+						"wenku" => 0,
+						"other" => 0,
+	
+						"subtotal" => 0
+				);
+				array_push ( $list, $item );
+			}
+		}
+	
+		foreach ( $list as $k => $v ) {
+			foreach ( $data as $key => $value ) {
+				if (! empty ( $parameter ['month'] )) {
+					$month = date ( "d", strtotime ( $value ['expenditureDate'] ) );
+				}else{
+					$month = date ( "m", strtotime ( $value ['expenditureDate'] ) );
+				}
+				if ($v ["month"] == $month) {
+					
+					// 银行手续费
+					if ($value ['expenditureType'] == 1) {
+						$list [$k] ['bankCharges'] = bcadd ( $list [$k] ['bankCharges'], $value ['expenditurePrice'], 2 );
+					}
+					
+					// 电话费
+					if ($value ['expenditureType'] == 2) {
+						$list [$k] ['telephoneRate'] = bcadd ( $list [$k] ['telephoneRate'], $value ['expenditurePrice'], 2 );
+					}
+					// 缴税
+					if ($value ['expenditureType'] == 3) {
+						if ($value ['expenditureMsg'] == '增值税') {
+							$list [$k] ['addedTax'] = bcadd ( $list [$k] ['addedTax'], $value ['expenditurePrice'], 2 );
+						} elseif ($value ['expenditureMsg'] == '税金附加') {
+							$list [$k] ['surcharges'] = bcadd ( $list [$k] ['surcharges'], $value ['expenditurePrice'], 2 );
+						} elseif ($value ['expenditureMsg'] == '企业所得税') {
+							$list [$k] ['corporateIncomeTax'] = bcadd ( $list [$k] ['corporateIncomeTax'], $value ['expenditurePrice'], 2 );
+						} elseif ($value ['expenditureMsg'] == '工会费') {
+							$list [$k] ['socialSecurity'] = bcadd ( $list [$k] ['socialSecurity'], $value ['expenditurePrice'], 2 );
+						}elseif ($value ['expenditureMsg'] == '社保') {
+							$list [$k] ['unionFees'] = bcadd ( $list [$k] ['unionFees'], $value ['expenditurePrice'], 2 );
+						}elseif ($value ['expenditureMsg'] == '个税') {
+							$list [$k] ['personalIncomeTax'] = bcadd ( $list [$k] ['personalIncomeTax'], $value ['expenditurePrice'], 2 );
+						}elseif ($value ['expenditureMsg'] == '印花税') {
+							$list [$k] ['stampDuty'] = bcadd ( $list [$k] ['stampDuty'], $value ['expenditurePrice'], 2 );
+						}
+					}
+						
+					// 保证金
+					if ($value ['expenditureType'] == 5) {
+						$list [$k] ['bond'] = bcadd ( $list [$k] ['bond'], $value ['expenditurePrice'], 2 );
+					}
+					// 纵横文库提现
+					if ($value ['expenditureType'] == 13) {
+						$list [$k] ['wenku'] = bcadd ( $list [$k] ['wenku'], $value ['expenditurePrice'], 2 );
+					}	
+					// 其他
+					if ($value ['expenditureType'] == 14) {
+						$list [$k] ['other'] = bcadd ( $list [$k] ['other'], $value ['expenditurePrice'], 2 );
+					}
+					
+				}
+			}
+			$list [$k] ['payTaxesSubtotal'] = bcadd ( $list [$k] ['addedTax'] + $list [$k] ['surcharges'] + $list [$k] ['corporateIncomeTax']
+					, $list [$k] ['socialSecurity']+$list [$k] ['unionFees']+$list [$k] ['personalIncomeTax']+$list [$k] ['stampDuty'], 2 );
+				
+			$list [$k] ['subtotal'] = bcadd ( $list [$k] ['payTaxesSubtotal'] + $list [$k] ['bankCharges'] + $list [$k] ['telephoneRate'], $list [$k] ['bond'] + $list [$k] ['wenku'] + $list [$k] ['other'] , 2 );
+		}
+	
+		return $list;
+	}
+	
+	// 日常收入汇总
+	public function GetIncomeCollect($parameter = array()) {
+		
+		$data = $this->accountBook->GetExpensesType ( $parameter );
+		
+		$list = array ();
+		
+		// 初始化日
+		if (! empty ( $parameter ['month'] )) {
+			
+			$days = cal_days_in_month(CAL_GREGORIAN, $parameter['month'], $parameter['year']);
+			
+			for($i = 1; $i <= $days; $i ++) {
+				$item = array (
+						"month" => str_pad ( $i, 2, "0", STR_PAD_LEFT ),
+						// 利息收入
+						"bankDepositPrice" => 0,
+						"currentFinancPrice" => 0,
+						"fixedFinancPrice" => 0,
+						"personalLoanPrice" => 0,
+						"interestSubtotalPrice" => 0,
+						// 补贴收入
+						"socialSecurity" => 0,
+						"finance" => 0,
+						"subsidySubtotal" => 0,
+						// 纵横知道
+						"zongheng" => 0,
+						// 借款收回
+						"reserveFund" => 0,
+						"privateBorrow" => 0,
+						"loanSubtotal" => 0,
+						// 退汇
+						"returnRemittance" => 0,
+						"bond" => 0,
+						"other" => 0,
+				
+						"subtotal" => 0
+				);
+				array_push ( $list, $item );
+			}
+		} else {
+			// 初始化月份
+			for($i = 1; $i <= 12; $i ++) {
+				$item = array (
+						"month" => str_pad ( $i, 2, "0", STR_PAD_LEFT ),
+						// 利息收入
+						"bankDepositPrice" => 0,
+						"currentFinancPrice" => 0,
+						"fixedFinancPrice" => 0,
+						"personalLoanPrice" => 0,
+						"interestSubtotalPrice" => 0,
+						// 补贴收入
+						"socialSecurity" => 0,
+						"finance" => 0,
+						"subsidySubtotal" => 0,
+						// 纵横知道
+						"zongheng" => 0,
+						// 借款收回
+						"reserveFund" => 0,
+						"privateBorrow" => 0,
+						"loanSubtotal" => 0,
+						// 退汇
+						"returnRemittance" => 0,
+						"bond" => 0,
+						"other" => 0,
+						
+						"subtotal" => 0 
+				);
+				array_push ( $list, $item );
+			}
+		}
+		
+		foreach ( $list as $k => $v ) {
+			foreach ( $data as $key => $value ) {
+				if (! empty ( $parameter ['month'] )) {
+					$month = date ( "d", strtotime ( $value ['receivedDate'] ) );
+				}else{
+					$month = date ( "m", strtotime ( $value ['receivedDate'] ) );
+				}
+				if ($v ["month"] == $month) {
+					// 利息收入
+					if ($value ['accountType'] == 1) {
+						if ($value ['accountMsg'] == '银行存款') {
+							$list [$k] ['bankDepositPrice'] = bcadd ( $list [$k] ['bankDepositPrice'], $value ['receivedPrice'], 2 );
+						} elseif ($value ['accountMsg'] == '活期理财收益') {
+							$list [$k] ['currentFinancPrice'] = bcadd ( $list [$k] ['currentFinancPrice'], $value ['receivedPrice'], 2 );
+						} elseif ($value ['accountMsg'] == '固定理财收益') {
+							$list [$k] ['fixedFinancPrice'] = bcadd ( $list [$k] ['fixedFinancPrice'], $value ['receivedPrice'], 2 );
+						} elseif ($value ['accountMsg'] == '个人借款') {
+							$list [$k] ['personalLoanPrice'] = bcadd ( $list [$k] ['personalLoanPrice'], $value ['receivedPrice'], 2 );
+						}
+					}
+					
+					// 补贴收入
+					if ($value ['accountType'] == 2) {
+						if ($value ['accountMsg'] == '社保') {
+							$list [$k] ['socialSecurity'] = bcadd ( $list [$k] ['socialSecurity'], $value ['receivedPrice'], 2 );
+						} elseif ($value ['accountMsg'] == '财政') {
+							$list [$k] ['finance'] = bcadd ( $list [$k] ['finance'], $value ['receivedPrice'], 2 );
+						}
+					}
+					
+					// 纵横知道
+					if ($value ['accountType'] == 3) {
+						$list [$k] ['zongheng'] = bcadd ( $list [$k] ['zongheng'], $value ['receivedPrice'], 2 );
+					}
+					
+					// 借款收回
+					if ($value ['accountType'] == 4) {
+						if ($value ['accountMsg'] == '备用金') {
+							$list [$k] ['reserveFund'] = bcadd ( $list [$k] ['reserveFund'], $value ['receivedPrice'], 2 );
+						} elseif ($value ['accountMsg'] == '私人借款') {
+							$list [$k] ['privateBorrow'] = bcadd ( $list [$k] ['privateBorrowing'], $value ['receivedPrice'], 2 );
+						}
+					}
+					
+					// 退汇
+					if ($value ['accountType'] == 5) {
+						$list [$k] ['returnRemittance'] = bcadd ( $list [$k] ['returnRemittance'], $value ['receivedPrice'], 2 );
+					}
+					
+					// 保证金
+					if ($value ['accountType'] == 8) {
+						$list [$k] ['bond'] = bcadd ( $list [$k] ['bond'], $value ['receivedPrice'], 2 );
+					}
+					
+					// 其他
+					if ($value ['accountType'] == 6) {
+						$list [$k] ['other'] = bcadd ( $list [$k] ['other'], $value ['receivedPrice'], 2 );
+					}
+				}
+			}
+			$list [$k] ['interestSubtotalPrice'] = bcadd ( $list [$k] ['bankDepositPrice'] + $list [$k] ['currentFinancPrice'] + $list [$k] ['fixedFinancPrice'], $list [$k] ['personalLoanPrice'], 2 );
+			$list [$k] ['subsidySubtotal'] = bcadd ( $list [$k] ['socialSecurity'], $list [$k] ['finance'], 2 );
+			$list [$k] ['loanSubtotal'] = bcadd ( $list [$k] ['reserveFund'], $list [$k] ['privateBorrowing'], 2 );
+			
+			$list [$k] ['subtotal'] = bcadd ( $list [$k] ['interestSubtotalPrice'] + $list [$k] ['subsidySubtotal'] + $list [$k] ['loanSubtotal'], $list [$k] ['zongheng'] + $list [$k] ['returnRemittance'] + $list [$k] ['bond'] + $list [$k] ['other'], 2 );
+		}
+		
+		return $list;
+	}
+	
+	// 费用分页
+	public function GetIncomeExpensesPage($data = array()) {
+		// if (!empty($data['categoryId'])){
+		// $data['categoryId']=$this->XDeode->decode($data['categoryId']);
+		// }
+		// if (!empty($data['staffId'])){
+		// $data['staffId']=$this->XDeode->decode($data['staffId']);
+		// }
+		if (empty ( $data ['year'] )) {
+			$data ['year'] = date ( "Y" );
+		}
+		if (! is_numeric ( $data ['pSize'] )) {
+			$data ['pSize'] = 20;
+		}
+		if (! is_numeric ( $data ['cPage'] )) {
+			$data ['cPage'] = 0;
+		} else {
+			$data ['cPage'] = ($data ['cPage'] - 1) * $data ['pSize'];
+		}
+		
+		$data = $this->accountBook->GetPage ( $data );
+		
+		foreach ( $data ['list'] as $key => $value ) {
+			
+			if ($value ['receivedBank'] == '华润银行') {
+				$data ['list'] [$key] ['receivedBank'] = '广发纵横知道';
+			}
+			
+			if ($value ['expensesType'] == 1) {
+				$data ['list'] [$key] ['expensesTypeShow'] = "收入";
+				
+				if ($value ['accountType'] == 1) {
+					$data ['list'] [$key] ['typeShow'] = "利息收入";
+				} elseif ($value ['accountType'] == 2) {
+					$data ['list'] [$key] ['typeShow'] = "补贴收入";
+				} elseif ($value ['accountType'] == 3) {
+					$data ['list'] [$key] ['typeShow'] = "纵横知道";
+				} elseif ($value ['accountType'] == 4) {
+					$data ['list'] [$key] ['typeShow'] = "借款收回";
+				} elseif ($value ['accountType'] == 5) {
+					$data ['list'] [$key] ['typeShow'] = "退汇";
+				} elseif ($value ['accountType'] == 6) {
+					$data ['list'] [$key] ['typeShow'] = "其他";
+				} elseif ($value ['accountType'] == 7) {
+					$data ['list'] [$key] ['typeShow'] = "广发理财";
+				} elseif ($value ['accountType'] == 8) {
+					$data ['list'] [$key] ['typeShow'] = "工行理财";
+				} elseif ($value ['accountType'] == 9) {
+					$data ['list'] [$key] ['typeShow'] = "保证金";
+				} elseif ($value ['accountType'] == 10) {
+					$data ['list'] [$key] ['typeShow'] = "理财收入";
+				} elseif ($value ['accountType'] == 11) {
+					$data ['list'] [$key] ['typeShow'] = "广发存款";
+				} elseif ($value ['accountType'] == 12) {
+					$data ['list'] [$key] ['typeShow'] = "工行存款";
+				} elseif ($value ['accountType'] == 13) {
+					$data ['list'] [$key] ['typeShow'] = "理财";
+					if ($value ['operatingBankType'] == 1) {
+						$data ['list'] [$key] ['typeShow'] .= "(理财账号)";
+					} elseif ($value ['operatingBankType'] == 2) {
+						$data ['list'] [$key] ['typeShow'] .= "(公司账号)";
+					}
+				} elseif ($value ['accountType'] == 14) {
+					$data ['list'] [$key] ['typeShow'] = "存款";
+				}
+				
+				if (! empty ( $value ['accountMsg'] )) {
+					$data ['list'] [$key] ['typeShow'] .= $value ['accountMsg'];
+				}
+				
+				$data ['list'] [$key] ['priceShow'] = $value ['receivedPrice'];
+				$data ['list'] [$key] ['dateShow'] = $value ['receivedDate'];
+				$data ['list'] [$key] ['bankShow'] = $value ['receivedBank'];
+				if ($value ['operatingBankType'] == 1) {
+					$data ['list'] [$key] ['bankShow'] .= $value ['depositMethod'];
+				}
+			} elseif ($value ['expensesType'] == 2) {
+				$data ['list'] [$key] ['expensesTypeShow'] = "支出";
+				$data ['list'] [$key] ['dateShow'] = $value ['expenditureDate'];
+				$data ['list'] [$key] ['bankShow'] = $value ['expenditureBank'];
+				if ($value ['operatingBankType'] == 1) {
+					$data ['list'] [$key] ['bankShow'] .= $value ['depositMethod'];
+				}
+				
+				if ($value ['expensesType'] == 1) {
+					$data ['list'] [$key] ['typeShow'] = "银行手续费";
+				} elseif ($value ['expensesType'] == 2) {
+					$data ['list'] [$key] ['typeShow'] = "总部电话费";
+				} elseif ($value ['expensesType'] == 3) {
+					$data ['list'] [$key] ['typeShow'] = "缴税";
+				} elseif ($value ['expensesType'] == 4) {
+					$data ['list'] [$key] ['typeShow'] = "广发理财";
+				} elseif ($value ['expensesType'] == 5) {
+					$data ['list'] [$key] ['typeShow'] = "保证金";
+				} elseif ($value ['expensesType'] == 6) {
+					$data ['list'] [$key] ['typeShow'] = "工行理财";
+				} elseif ($value ['expensesType'] == 7) {
+					$data ['list'] [$key] ['typeShow'] = "理财支出";
+				} elseif ($value ['expensesType'] == 8) {
+					$data ['list'] [$key] ['typeShow'] = "广发存款";
+				} elseif ($value ['expensesType'] == 9) {
+					$data ['list'] [$key] ['typeShow'] = "工行存款";
+				} elseif ($value ['expensesType'] == 10) {
+					$data ['list'] [$key] ['typeShow'] = "工资";
+				} elseif ($value ['expensesType'] == 11) {
+					$data ['list'] [$key] ['typeShow'] = "理财";
+					if ($value ['operatingBankType'] == 1) {
+						$data ['list'] [$key] ['typeShow'] .= "(理财账号)";
+					} elseif ($value ['operatingBankType'] == 2) {
+						$data ['list'] [$key] ['typeShow'] .= "(公司账号)";
+					}
+				} elseif ($value ['expensesType'] == 12) {
+					$data ['list'] [$key] ['typeShow'] = "存款";
+				} elseif ($value ['expensesType'] == 13) {
+					$data ['list'] [$key] ['typeShow'] = "纵横文库提现";
+				} elseif ($value ['expensesType'] == 14) {
+					$data ['list'] [$key] ['typeShow'] = "其他";
+				}
+				
+				if (! empty ( $value ['expenditureMsg'] )) {
+					$data ['list'] [$key] ['typeShow'] .= $value ['expenditureMsg'];
+				}
+				
+				$data ['list'] [$key] ['priceShow'] = $value ['expenditurePrice'];
+			}
+		}
+		
+		return $data;
+		// // //获得办事处信息
+		// // $office=$this->category->GetAll();
+		// // //获得员工信息
+		// // $staffList=$this->staff->find(array('asArray' => TRUE));
+		
+		// foreach ($data['list'] as $key=>$value){
+		// $data['list'][$key]['ridOld']=$value['rid'];
+		// $data['list'][$key]['rid']=$this->XDeode->encode($value['rid']);
+		// $data['list'][$key]['cid']=$this->XDeode->encode($value['cid']);
+		// $data['list'][$key]['staff']=$this->XDeode->encode($value['staff']);
+		// $data['list'][$key]['categoryValue']="";
+		// $data['list'][$key]['statusValue']=$this->feeStatusValue[$value['status']];
+		// foreach ($office as $k=>$v){
+		// if($v['cid']==$data['list'][$key]['cid']){
+		// $data['list'][$key]['categoryValue']=$v['title'];
+		// }
+		// }
+		// $data['list'][$key]['staffName']="";
+		// foreach ($staffList as $k=>$v){
+		// if($v['sid']==$value['staff']){
+		// $data['list'][$key]['staffName']=$v['username'];
+		// }
+		// }
+		// $data['list'][$key]['Rtype']=$this->feeTypeValue[$value['Rtype']];
+		// if($this->getFeeLoanType($value)){
+		// $data['list'][$key]['Rtype'].="报销单";
+		// }
+		
+		// if($value['pastDate']=="0000-00-00"){
+		// $data['list'][$key]['pastDate']="";
+		// }
+		
+		// if($value['version']==1){
+		// $data['list'][$key]['explanation']=$this->getReceiptVerson1Explanation($value);
+		// }
+		// }
+		
+		// return $data;
+	}
+}
+?>

+ 63 - 0
protected/services/invoice_service.php

@@ -0,0 +1,63 @@
+<?php
+class invoice_service {
+	private $invoiceTraining;
+	private $invoice;
+	private $XDeode;
+	function __construct() {
+		Doo::loadClass ( 'XDeode' );
+		$this->XDeode = new XDeode ( 9 );
+		$this->XDeode5 = new XDeode ( 5 );
+		Doo::loadModel ( 'cld/invoice_training_cld' );
+		$this->invoiceTraining = new invoice_training_cld ();
+		Doo::loadModel ( 'cld/invoice_cld' );
+		$this->invoice = new invoice_cld ();
+	}
+	
+	/* 获得办事处和创建的 培训班发票 */
+	public function getTrainByCategoryStaff($status, $categoryIdString, $staffId) {
+		
+		Doo::loadModel ( 'staff' );
+		$staff = new staff ();
+		Doo::loadModel ( 'L_category' );
+		$lCategory = new L_category ();
+		
+		// 1.获得培训班
+		$list = $this->invoiceTraining->getStatusByCategoryStaff ( $status, $categoryIdString, $staffId );
+		
+		// 2.获得培训班发票总数-
+		foreach ( $list as $key => $value ) {
+			$list [$key] ['trainingKey'] = $this->XDeode5->encode ( $value ['itid'] );
+			$detail = $staff->getStaffBySid ( $value ['creator'] );
+			$list [$key] ['staff'] = $detail;
+			$detail = $lCategory->getCategoryById ( $value ['cid'] );
+			$list [$key] ['category'] = $detail;
+			
+// 			每个培训班发票总数和金额,入账总数
+			$invoiceList = $this->invoice->GetTrainByUnFinish ( $value ['itid'] );
+			
+			$list[$key]['invoiceTotal']=count($invoiceList);
+			$priceTotle=0;
+			$BalancePriceTotle=0;
+			foreach ($invoiceList as $k=>$v){
+				$priceTotle+=$v['invoicePrice'];
+				if($v['status']==2&&$v['untreadStatus']==3){
+					$BalancePriceTotle+=$v['invoiceBalance'];
+				}else{
+					$BalancePriceTotle+=$v['invoicePrice'];
+				}
+				
+			}
+			$list[$key]['invoiceTotalAmount']=$priceTotle;
+			$list[$key]['invoiceArriveAmount']=$priceTotle-$BalancePriceTotle;
+			$list[$key]['arriveSchedule']=0;
+			if($list[$key]['invoiceTotal']!=0){
+				$list[$key]['arriveSchedule']=round ( $list [$key] ['invoiceArriveAmount'] / $list [$key] ['invoiceTotalAmount'] * 100, 2 );
+			}
+			
+		}
+		return $list;
+// 		print_r ( $list );
+// 		die ();
+	}
+}
+?>

+ 857 - 0
protected/services/software_service.php

@@ -0,0 +1,857 @@
+<?php
+class software_service {
+	private $longle_log;
+	private $action_log;
+	
+	private $verify;
+	private $receipt;
+	private $XDeode;
+	private $category;
+	private $staff;
+	function __construct() {
+		Doo::loadModel ( 'cld/longle_log_cld' );
+		$this->longle_log = new longle_log_cld ();
+		Doo::loadModel ( 'cld/action_log_cld' );
+		$this->action_log = new action_log_cld ();
+		
+		Doo::loadModel ( 'cld/receipt_cld' );
+		$this->receipt = new receipt_cld ();
+		Doo::loadClass ( 'XDeode' );
+		$this->XDeode = new XDeode ( 9 );
+		Doo::loadModel ( 'receiptDetail' );
+		Doo::loadModel ( 'cld/category_cld' );
+		$this->category = new category_cld ();
+		Doo::loadModel ( 'cld/traveDate_cld' );
+		$this->traveDate_cld = new traveDate_cld ();
+		Doo::loadModel ( 'cld/staff_cld' );
+		$this->staff = new staff_cld ();
+	}
+	
+	public function ValidRuleSoftwareCount($data = array()){
+		
+	}
+	
+// 	2021-01-2-22开始使用longle_log统计 现在使用action_log来统计
+	public function GetSoftwareCount($data = array()){
+		$list=array();
+		// 		初始化表格
+		$result=array(
+				array("lend"=>0,"sale"=>0,"give"=>0,"upgrade"=>0,"date"=>$data['year']."-12"),
+				array("lend"=>0,"sale"=>0,"give"=>0,"upgrade"=>0,"date"=>$data['year']."-11"),
+				array("lend"=>0,"sale"=>0,"give"=>0,"upgrade"=>0,"date"=>$data['year']."-10"),
+				array("lend"=>0,"sale"=>0,"give"=>0,"upgrade"=>0,"date"=>$data['year']."-09"),
+				array("lend"=>0,"sale"=>0,"give"=>0,"upgrade"=>0,"date"=>$data['year']."-08"),
+				array("lend"=>0,"sale"=>0,"give"=>0,"upgrade"=>0,"date"=>$data['year']."-07"),
+				array("lend"=>0,"sale"=>0,"give"=>0,"upgrade"=>0,"date"=>$data['year']."-06"),
+				array("lend"=>0,"sale"=>0,"give"=>0,"upgrade"=>0,"date"=>$data['year']."-05"),
+				array("lend"=>0,"sale"=>0,"give"=>0,"upgrade"=>0,"date"=>$data['year']."-04"),
+				array("lend"=>0,"sale"=>0,"give"=>0,"upgrade"=>0,"date"=>$data['year']."-03"),
+				array("lend"=>0,"sale"=>0,"give"=>0,"upgrade"=>0,"date"=>$data['year']."-02"),
+				array("lend"=>0,"sale"=>0,"give"=>0,"upgrade"=>0,"date"=>$data['year']."-01"),
+				
+// 				$data['year']."-12"=>array("lend"=>0,"sale"=>0,"give"=>0,"upgrade"=>0,"date"=>$data['year']."-12"),
+// 				$data['year']."-11"=>array("lend"=>0,"sale"=>0,"give"=>0,"upgrade"=>0,"date"=>$data['year']."-11"),
+// 				$data['year']."-10"=>array("lend"=>0,"sale"=>0,"give"=>0,"upgrade"=>0,"date"=>$data['year']."-10"),
+// 				$data['year']."-09"=>array("lend"=>0,"sale"=>0,"give"=>0,"upgrade"=>0,"date"=>$data['year']."-09"),
+// 				$data['year']."-08"=>array("lend"=>0,"sale"=>0,"give"=>0,"upgrade"=>0,"date"=>$data['year']."-08"),
+// 				$data['year']."-07"=>array("lend"=>0,"sale"=>0,"give"=>0,"upgrade"=>0,"date"=>$data['year']."-07"),
+// 				$data['year']."-06"=>array("lend"=>0,"sale"=>0,"give"=>0,"upgrade"=>0,"date"=>$data['year']."-06"),
+// 				$data['year']."-05"=>array("lend"=>0,"sale"=>0,"give"=>0,"upgrade"=>0,"date"=>$data['year']."-05"),
+// 				$data['year']."-04"=>array("lend"=>0,"sale"=>0,"give"=>0,"upgrade"=>0,"date"=>$data['year']."-04"),
+// 				$data['year']."-03"=>array("lend"=>0,"sale"=>0,"give"=>0,"upgrade"=>0,"date"=>$data['year']."-03"),
+// 				$data['year']."-02"=>array("lend"=>0,"sale"=>0,"give"=>0,"upgrade"=>0,"date"=>$data['year']."-02"),
+// 				$data['year']."-01"=>array("lend"=>0,"sale"=>0,"give"=>0,"upgrade"=>0,"date"=>$data['year']."-01"),
+		);
+		
+		if (!empty($data['staffId'])){
+			$list=$this->action_log->GetSoftwareCountByStaffId($data['staffId'],$data['year']);
+		}else{
+			if(!empty($data['categoryId'])){
+				$list=$this->action_log->GetSoftwareCountByCategoryId($data['categoryId'],$data['year']);
+			}else{
+				return $result;
+			}
+		}
+		
+// 		总数统计
+		foreach ($list as $value){
+			$resultKey=date("Y-m", strtotime($value['updatetime']) );
+			foreach ($result as $k=>$v){
+				if($value['status']==4&&$resultKey==$v["date"]){
+					$result[$k]["lend"]=$result[$k]["lend"]+1;
+					break;
+				}elseif ($value['status']==5&&$resultKey==$v["date"]){
+					$result[$k]["sale"]=$result[$k]["sale"]+1;
+					break;
+				}elseif ($value['status']==6&&$resultKey==$v["date"]){
+					$result[$k]["give"]=$result[$k]["give"]+1;
+					break;
+				}elseif ($value['status']==7&&$resultKey==$v["date"]){
+					$result[$k]["upgrade"]=$result[$k]["upgrade"]+1;
+					break;
+				}
+			}
+		}
+		
+		return $result;
+	}
+	
+	// 费用 报销单-创建-参数校验
+	public function ValidRuleReceiptCreate($data = array()) {
+		if (empty ( $data ['verifyId'] )) {
+			die ( 'illegal request-请选择审批组' );
+		}
+		$data ['verifyId'] = $this->XDeode->decode ( $data ['verifyId'] );
+		if (! is_numeric ( $data ['verifyId'] )) {
+			die ( 'illegal request-请选择审批组' );
+		}
+		
+		if (empty ( $data ['officeId'] )) {
+			die ( 'illegal request-请选择办事处' );
+		}
+		$data ['officeId'] = $this->XDeode->decode ( $data ['officeId'] );
+		if (! is_numeric ( $data ['officeId'] )) {
+			die ( 'illegal request-请选择办事处' );
+		}
+		
+		if ($data ['traveData'] == "" && $data ['officeData'] == "" && $data ['trainData'] == "") {
+			die ( 'illegal request-请选择费用类型' );
+		}
+		
+		// 字符串转换Json
+		$hasType = 0;
+		if ($data ['traveData'] != "") {
+			$data ['traveJson'] = json_decode ( $data ['traveData'], true );
+			if ($data ['traveJson'] ['show']) {
+				$hasType ++;
+				// 日期合法性检查
+				
+				//print_r($data ['traveJson']);die;
+			}
+		}
+		if ($data ['officeData'] != "") {
+			$data ['officeJson'] = json_decode ( $data ['officeData'], true );
+			if ($data ['officeJson'] ['show']) {
+				$hasType ++;
+			}
+		}
+		if ($data ['trainData'] != "") {
+			$data ['trainJson'] = json_decode ( $data ['trainData'], true );
+			if ($data ['trainJson'] ['show']) {
+				$hasType ++;
+			}
+		}
+		if ($hasType == 0) {
+			die ( 'illegal request-请选择费用类型' );
+		}
+		
+		return $data;
+	}
+	
+	// 获得费用的细则
+	public function GetAccountItem() {
+		$data = $this->accountItem->GetAll ();
+		$list = array (
+				'daily' => array (),
+				'other' => array (),
+				'trave' => array (),
+				'train' => array () 
+		);
+		foreach ( $data as $value ) {
+			$value ['price'] = 0;
+			if ($value ['category'] == "日常相关费用") {
+				array_push ( $list ['daily'], $value );
+			}
+			if ($value ['category'] == "其他") {
+				array_push ( $list ['other'], $value );
+			}
+			if ($value ['category'] == "内部培训费用") {
+				array_push ( $list ['train'], $value );
+			}
+			if ($value ['category'] == "差旅相关费用") {
+				$value ['remark'] = "";
+				array_push ( $list ['trave'], $value );
+			}
+		}
+		return $list;
+	}
+	
+	// 审批组
+	public function GetVerifyType($subordinate="",$subordinate2="") {
+		$list = $this->verify->getVerifyBySubordinate($subordinate,$subordinate2);
+		return $list;
+	}
+	
+	// 获得报销单
+	public function GetReceipt($receiptId) {
+		$detail = $this->receipt->Get ( $receiptId );
+		$detail ['verify'] = $this->XDeode->encode ( $detail ['verify'] );
+		$detail ['cid'] = $this->XDeode->encode ( $detail ['cid'] );
+		$detail ['receiptId'] = $this->XDeode->encode ( $detail ['rid'] );
+		
+		//费用结算-用于流水
+		$relust = bcsub ( $detail ['sum'], $detail ['loanSum'], 2 );
+		$detail ['relust'] = $relust;
+		$detail ['relustABS'] = abs ( $relust );
+		
+		
+		
+		return $detail;
+	}
+	
+	// 创建报销单
+	public function ReceiptCreate($data, $staff) {
+		$receipt = new receipt_cld ();
+		
+		// 1.办事处相关费用
+		$total = 0;
+		if (! empty ( $data ['officeData'] )) {
+			if ($data ['officeJson'] ['show']) {
+				foreach ( $data ['officeJson'] ['daily'] as $value ) {
+					$total = bcadd ( $total, $value ['price'], 2 );
+				}
+				foreach ( $data ['officeJson'] ['other'] as $value ) {
+					$total = bcadd ( $total, $value ['price'], 2 );
+				}
+			}
+		}
+		// 差旅相关费用
+		if (! empty ( $data ['traveData'] )) {
+			if ($data ['traveJson'] ['show']) {
+				foreach ( $data ['traveJson'] ['trave'] as $value ) {
+					$total = bcadd ( $total, $value ['price'], 2 );
+				}
+			}
+		}
+		// 内部培训费用
+		if (! empty ( $data ['trainData'] )) {
+			if ($data ['trainJson'] ['show']) {
+				foreach ( $data ['trainJson'] ['train'] as $value ) {
+					$total = bcadd ( $total, $value ['price'], 2 );
+				}
+			}
+		}
+		
+		$receipt->officeJson = $data ['officeData'];
+		$receipt->traveJson = $data ['traveData'];
+		$receipt->trainJson = $data ['trainData'];
+		
+		$receipt->remittanceName = $data ['remittanceName'];
+		$receipt->bankName = $data ['bankName'];
+		$receipt->bankNumber = $data ['bankNumber'];
+		$receipt->remittanceBankType = $data ['remittanceBankType'];
+		if ($data ['remittanceBankType'] == 1) {
+			$receipt->coupletNumber = $data ['coupletNumber'];
+		}
+		
+		$receipt->status = 5;
+		$receipt->date = date ( "Y-m-d" );
+		$receipt->staff = $staff ['sid'];
+		$receipt->cid = $data ['officeId'];
+		$receipt->verify = $data ['verifyId'];
+		$receipt->sum = $total;
+		$receipt->receiptOrder = "#B" . date ( "Ymd" ) . mt_rand ( 1000, 9999 );
+		
+		Doo::loadModel ( 'execute' );
+		$execute = new execute ();
+		$executeDetail = $execute->getOne ( array (
+				'where' => 'mold="报销单执行人"',
+				'asArray' => true 
+		) );
+		$receipt->executeCopy = $executeDetail ['staff'];
+		$receipt->version = 1;
+		$rid = $receipt->insert ();
+		
+		// 附件
+		if (! empty ( $data ['enclosurFiles'] )) {
+			Doo::loadModel ( 'enclosur' );
+			$data ['enclosurFiles'] = json_decode ( $data ['enclosurFiles'], true );
+			foreach ( $data ['enclosurFiles'] as $value ) {
+				$enclosur = new enclosur ();
+				$enclosur->name = $value ['path'];
+				$enclosur->rid = $rid;
+				$enclosur->insert ();
+			}
+		}
+		
+		// 创建报销单详情
+		$this->makeReceiptDetailCreate ( $data, $staff, $rid );
+		
+		return "";
+	}
+	
+	// 编辑报销单
+	public function ReceiptEdi($data, $staff) {
+		$receiptId = $this->XDeode->decode ( $data ['receiptId'] );
+		if (! is_numeric ( $receiptId )) {
+			die ( 'illegal request-找不到该报销单-参数不正确' );
+		}
+		$detail = $this->receipt->Get ( $receiptId );
+		if (empty ( $detail )) {
+			die ( 'illegal request-找不到该报销单' );
+		}
+		
+		$receipt = new receipt_cld ();
+		// 1.办事处相关费用
+		$total = 0;
+		if (! empty ( $data ['officeData'] )) {
+			if ($data ['officeJson'] ['show']) {
+				foreach ( $data ['officeJson'] ['daily'] as $value ) {
+					$total = bcadd ( $total, $value ['price'], 2 );
+				}
+				foreach ( $data ['officeJson'] ['other'] as $value ) {
+					$total = bcadd ( $total, $value ['price'], 2 );
+				}
+			}
+		}
+		// 差旅相关费用
+		if (! empty ( $data ['traveData'] )) {
+			if ($data ['traveJson'] ['show']) {
+				foreach ( $data ['traveJson'] ['trave'] as $value ) {
+					$total = bcadd ( $total, $value ['price'], 2 );
+				}
+			}
+		}
+		// 内部培训费用
+		if (! empty ( $data ['trainData'] )) {
+			if ($data ['trainJson'] ['show']) {
+				foreach ( $data ['trainJson'] ['train'] as $value ) {
+					$total = bcadd ( $total, $value ['price'], 2 );
+				}
+			}
+		}
+		
+		$receipt->officeJson = $data ['officeData'];
+		$receipt->traveJson = $data ['traveData'];
+		$receipt->trainJson = $data ['trainData'];
+		
+		$receipt->remittanceName = $data ['remittanceName'];
+		$receipt->bankName = $data ['bankName'];
+		$receipt->bankNumber = $data ['bankNumber'];
+		$receipt->remittanceBankType = $data ['remittanceBankType'];
+		if ($data ['remittanceBankType'] == 1) {
+			$receipt->coupletNumber = $data ['coupletNumber'];
+		}
+		
+		$receipt->cid = $data ['officeId'];
+		if($data ['status']!=4){
+			$receipt->verify = $data ['verifyId'];
+		}
+		
+		$receipt->sum = $total;
+		
+		Doo::loadModel ( 'execute' );
+		$execute = new execute ();
+		$executeDetail = $execute->getOne ( array (
+				'where' => 'mold="报销单执行人"',
+				'asArray' => true 
+		) );
+		$receipt->executeCopy = $executeDetail ['staff'];
+		$receipt->rid = $receiptId;
+		$receipt->update ();
+		
+		// 先删除
+		$receiptDetail = new receiptDetail ();
+		$receiptDetail->delete ( array (
+				'where' => 'rid=' . $receiptId 
+		) );
+		// 新增报销单详情
+		$this->makeReceiptDetailCreate ( $data, $staff, $receiptId );
+		
+		// 附件
+		if (! empty ( $data ['enclosurFiles'] )) {
+			Doo::loadModel ( 'enclosur' );
+			$data ['enclosurFiles'] = json_decode ( $data ['enclosurFiles'], true );
+			foreach ( $data ['enclosurFiles'] as $value ) {
+				$enclosur = new enclosur ();
+				$enclosur->name = $value ['path'];
+				$enclosur->rid = $receiptId;
+				$enclosur->insert ();
+			}
+		}
+		return "";
+	}
+	
+	//更新借款报销单数据
+	public function LoanReceiptEdi($receiptId){
+		$receiptId = $this->XDeode->decode ( $receiptId );
+		if (! is_numeric ( $receiptId )) {
+			die ( 'illegal request-找不到该报销单-参数不正确' );
+		}
+		$detail = $this->receipt->Get ( $receiptId );
+		if (empty ( $detail )) {
+			die ( 'illegal request-找不到该报销单' );
+		}
+		
+		$receipt = new receipt_cld ();
+		if ($detail['status']!=7){
+			$receipt->loanSum = $detail ['sum'];
+		}
+		$receipt->date = date ( "Y-m-d" );
+		$receipt->pastDate = '0000-00-00';
+		$receipt->verifyStaff = '';
+		$receipt->executeStaff = '';
+		$receipt->status = 7;
+		$receipt->version = 1;
+		$receipt->rid = $receiptId;
+		$receipt->update ();
+		
+	}
+	
+	// 获得借款报销单
+	public function GetLoanReceipt($loanReceiptId) {
+		Doo::loadModel ( 'loanReceipt' );
+		$loanReceipt = new loanReceipt ();
+		$loan = $loanReceipt->getOne ( array (
+				'where' => 'rid=' . $loanReceiptId,
+				'desc' => 'rid',
+				'asArray' => true 
+		) );
+		
+		$categoryDetil = $this->category->getOne ( array (
+				'where' => 'cid=' . $loan ['cid'],
+				'asArray' => true 
+		) );
+		$loan ['category'] = $categoryDetil ['title'];
+		$loan ['accountItem'] = json_decode ( $loan ['accountItem'], true );
+		$loan ['loanItem'] = json_decode ( $loan ['loanItem'], true );
+		$loan ['BIGsum'] = $this->num_to_rmb ( $loan ['sum'] );
+		
+		$loan ['verifyList'] = $this->makeVerifyProcess ( $loan ['verify'], $loan ['verifyStaff'] );
+		
+		return $loan;
+	}
+	
+	// 获得差旅日期
+	public function GetTraveDateAll($sid){
+		$traveData=$this->traveDate_cld->GetAllBySid($sid);
+		$data=array();
+		
+		foreach ($traveData as $key=>$value){
+			if(!empty($value['start'])&&!empty($value['end'])){
+				array_push($data, array(strtotime($value['start']),strtotime($value['end'])));
+			}
+		}
+		return $data;
+	}
+	
+	//费用分页
+	public function GetFeePage($data=array()){
+		if (!empty($data['categoryId'])){
+			$data['categoryId']=$this->XDeode->decode($data['categoryId']);
+		}
+		if (!empty($data['staffId'])){
+			$data['staffId']=$this->XDeode->decode($data['staffId']);
+		}
+		if(empty($data['year'])){
+			$data['year']=date ( "Y" );
+		}
+		if(!is_numeric($data['pSize'])){
+			$data['pSize']=20;
+		}
+		if(!is_numeric($data['cPage'])){
+			$data['cPage']=0;
+		}else{
+			$data['cPage']=( $data['cPage']-1) * $data['pSize'];
+		}
+		
+		$data=$this->receipt->GetPage($data);
+		//获得办事处信息
+		$office=$this->category->GetAll();
+		//获得员工信息
+		$staffList=$this->staff->find(array('asArray' => TRUE));
+		
+		foreach ($data['list'] as $key=>$value){
+			$data['list'][$key]['ridOld']=$value['rid'];
+			$data['list'][$key]['rid']=$this->XDeode->encode($value['rid']);
+			$data['list'][$key]['cid']=$this->XDeode->encode($value['cid']);
+			$data['list'][$key]['staff']=$this->XDeode->encode($value['staff']);
+			$data['list'][$key]['categoryValue']="";
+			$data['list'][$key]['statusValue']=$this->feeStatusValue[$value['status']];
+			foreach ($office as $k=>$v){
+				if($v['cid']==$data['list'][$key]['cid']){
+					$data['list'][$key]['categoryValue']=$v['title'];
+				}
+			}
+			$data['list'][$key]['staffName']="";
+			foreach ($staffList as $k=>$v){
+				if($v['sid']==$value['staff']){
+					$data['list'][$key]['staffName']=$v['username'];
+				}
+			}
+			$data['list'][$key]['Rtype']=$this->feeTypeValue[$value['Rtype']];
+			if($this->getFeeLoanType($value)){
+				$data['list'][$key]['Rtype'].="报销单";
+			}
+			
+			if($value['pastDate']=="0000-00-00"){
+				$data['list'][$key]['pastDate']="";
+			}
+			
+			if($value['version']==1){
+				$data['list'][$key]['explanation']=$this->getReceiptVerson1Explanation($value);
+			}
+		}
+		
+		return $data;
+	}
+	
+	private $feeTypeValue=array(
+			0=>"报销单",
+			1=>"借款",
+			2=>"对公汇款",
+			3=>"培训班费用",
+	);
+		
+	private $feeStatusValue=array(
+			1=>"待执行",
+			2=>"审批中",
+			3=>"终止",
+			4=>"撤回",
+			5=>"待提交",
+			6=>"待执行",
+			7=>"待提交",
+			8=>"执行完成",
+			9=>"执行完成",
+			10=>"已锁定",
+	);
+	
+	//获得借款-报销单类型 0借款 1借款报销单
+	private function getFeeLoanType($value){
+		$type=0;
+		if($value['Rtype']==1){
+			if($value['version']==1){
+				$type=1;
+			}else{
+				if(!empty($value['accountItem'])){
+					$type=1;
+				}
+			}
+		}
+		return $type;
+	}
+	
+	//获得新版报销单费用说明
+	private function getReceiptVerson1Explanation($value){
+		$version_1_explanation="";
+		if($value['version']==1){
+			if(!empty($value['officeJson'])){
+				$officeJson=json_decode($value['officeJson'],true);
+				$version_1_explanation.=$officeJson['officeExplain'][0]['officeExplain']."\n";
+			}
+			if(!empty($value['traveJson'])){
+				$traveJson=json_decode($value['traveJson'],true);
+				$version_1_explanation.=$traveJson['traveExplain'][0]['traveExplain']."\n";
+			}
+			if(!empty($value['trainJson'])){
+				$trainJson=json_decode($value['trainJson'],true);
+				$version_1_explanation.=$trainJson['trainExplain'][0]['trainExplain']."\n";
+			}
+		}
+		return $version_1_explanation;
+	}
+	
+	// 获得审批流程
+	private function makeVerifyProcess($verifyId, $verifyStaff) {
+		// 检测编辑状态
+		$verifyList = $this->verify->getOne ( array (
+				'where' => 'vid=' . $verifyId,
+				'asArray' => true 
+		) );
+		$verifyList = json_decode ( $verifyList ['staff'], true ); // status opinion
+		$verifyStaff = json_decode ( $verifyStaff, true );
+		
+		Doo::loadModel ( 'role' );
+		$role = new role ();
+		Doo::loadModel ( 'staff' );
+		$staff = new staff ();
+		
+		$flag = true;
+		$roleKey = 0;
+		$endStaffArray = array ();
+		$roleArrayCopy = array ();
+		foreach ( $verifyList as $k => $v ) {
+			// init verifyStaff
+			
+			if ($v [1] == 'ROLE') {
+				
+				if (! empty ( $verifyStaff )) {
+					$endStaffArray = end ( $verifyStaff );
+					// if ($v[0]==$endStaffArray['nextStaff']){
+					// $roleId=$v[0];
+					// }
+				}
+				
+				$roleVerify = json_decode ( $v [3], true );
+				$roleKey = $k;
+				$roleArray = array ();
+				$rolename = $role->getOne ( array (
+						'where' => 'rid=' . $v [0],
+						'asArray' => true 
+				) );
+				
+				foreach ( $roleVerify as $o => $p ) {
+					$staffID = explode ( '_', $p );
+					$staffInfo = $staff->getOne ( array (
+							'where' => 'sid=' . $staffID [0],
+							'asArray' => true 
+					) );
+					// print_r($staffID);
+					$exp = array (
+							0 => $staffInfo ['sid'],
+							1 => $staffID [1],
+							2 => $staffInfo ['avatar'],
+							'date' => '',
+							'date' => '',
+							'opinion' => '',
+							'status' => '',
+							'rolename' => $rolename ['name'] 
+					);
+					array_push ( $roleArray, $exp );
+				}
+				$roleArrayCopy [$v [0]] = $roleArray;
+				// $verifyList[$k]['roleArray']=$roleArray;
+			}
+			
+			$verifyList [$k] ['date'] = "";
+			$verifyList [$k] ['opinion'] = "";
+			$verifyList [$k] ['status'] = "";
+			if (empty ( $verifyStaff )) {
+				$verifyList [$k] ['date'] = "";
+				$verifyList [$k] ['opinion'] = "";
+				if (($verifyList [0] [0] == $this->staff [0] ['sid']) && $flag) {
+					$verifyList [$k] ['status'] = 4;
+					$flag = false;
+				}
+			} else {
+				
+				foreach ( $verifyStaff as $m => $u ) {
+					if ($v [0] == $m) {
+						$verifyList [$k] ['date'] = $u ['date'];
+						$verifyList [$k] ['opinion'] = $u ['opinion'];
+						$verifyList [$k] ['status'] = $u ['status'];
+						$flag = false;
+						break;
+					}
+				}
+				
+				$endStaffArray = end ( $verifyStaff );
+				if (isset ( $endStaffArray ['ROLE'] )) {
+				} else {
+				}
+			}
+		}
+		
+		$rolename ['name'] = '';
+		
+		if (! empty ( $verifyStaff ))
+			$endStaffArray = end ( $verifyStaff );
+		
+		$KOP = false;
+		foreach ( $roleArrayCopy as $P => $A ) {
+			
+			foreach ( $A as $MKI => $AVL ) {
+				if (! empty ( $verifyStaff )) {
+					// &&$rolename['rid']==$endStaffArray['nextStaff']
+					if ($this->staff [0] ['sid'] == $AVL [0] && isset ( $endStaffArray ['ROLE'] ) && $rolename ['rid'] == $endStaffArray ['nextStaff']) {
+						$button = 4;
+						$roleArrayCopy [$P] [$MKI] ['status'] = 4;
+					}
+					
+					foreach ( $verifyStaff as $m => $u ) {
+						$AVLFK = $AVL [0] . '_R';
+						// echo $AVLFK.'=='.$m;var_dump($AVLFK==$m);echo '<br/>';
+						
+						if (strcmp ( $AVLFK, $m ) == 0) { // &&isset($u['ROLE'])&&$u['ROLE']==1
+							$roleArrayCopy [$P] [$MKI] ['date'] = $u ['date'];
+							$roleArrayCopy [$P] [$MKI] ['opinion'] = $u ['opinion'];
+							$roleArrayCopy [$P] [$MKI] ['status'] = $u ['status'];
+							
+							break;
+						}
+					}
+				} else {
+					
+					if ($this->staff [0] ['sid'] == $AVL [0] && $verifyList [0] [1] == 'ROLE') {
+						$button = 4;
+						$roleArrayCopy [$P] [$MKI] ['status'] = 4;
+					}
+				}
+				// $roleArray[$MKI]['rolename']=$rolename['name'];
+				$KOP = true;
+			}
+		}
+		
+		foreach ( $roleArrayCopy as $k => $v ) {
+			foreach ( $verifyList as $m => $n ) {
+				if ($n [0] == $k) {
+					array_splice ( $verifyList, $m, 1, $v );
+				}
+			}
+		}
+		
+		return $verifyList;
+	}
+	private function makeReceiptDetailCreate($data, $staff, $rid) {
+		
+		// 报销单详情
+		if (! empty ( $data ['officeData'] )) {
+			if ($data ['officeJson'] ['show']) {
+				foreach ( $data ['officeJson'] ['daily'] as $value ) {
+					if ($value ['price'] != 0) {
+						$itemData = array (
+								"staff" => $staff ['sid'],
+								"itemCategory" => $value ['category'],
+								"item" => $value ['name'],
+								"price" => $value ['price'],
+								"date" => date ( "Y-m-d" ),
+								"cid" => $data ['officeId'],
+								"rid" => $rid,
+								"status" => 4 
+						);
+						$this->ReceiptDetailCreate ( $itemData );
+					}
+				}
+				foreach ( $data ['officeJson'] ['other'] as $value ) {
+					if ($value ['price'] != 0) {
+						$itemData = array (
+								"staff" => $staff ['sid'],
+								"itemCategory" => $value ['category'],
+								"item" => $value ['name'],
+								"price" => $value ['price'],
+								"date" => date ( "Y-m-d" ),
+								"cid" => $data ['officeId'],
+								"rid" => $rid,
+								"status" => 4 
+						);
+						$this->ReceiptDetailCreate ( $itemData );
+					}
+				}
+			}
+		}
+		// 差旅相关费用
+		if (! empty ( $data ['traveData'] )) {
+			if ($data ['traveJson'] ['show']) {
+				foreach ( $data ['traveJson'] ['trave'] as $value ) {
+					if ($value ['price'] != 0) {
+						$itemData = array (
+								"staff" => $staff ['sid'],
+								"itemCategory" => $value ['category'],
+								"item" => $value ['name'],
+								"price" => $value ['price'],
+								"date" => date ( "Y-m-d" ),
+								"cid" => $data ['officeId'],
+								"rid" => $rid,
+								"status" => 4 
+						);
+						$this->ReceiptDetailCreate ( $itemData );
+					}
+				}
+			}
+		}
+		// 内部培训费用
+		if (! empty ( $data ['trainData'] )) {
+			if ($data ['trainJson'] ['show']) {
+				foreach ( $data ['trainJson'] ['train'] as $value ) {
+					if ($value ['price'] != 0) {
+						$itemData = array (
+								"staff" => $staff ['sid'],
+								"itemCategory" => $value ['category'],
+								"item" => $value ['name'],
+								"price" => $value ['price'],
+								"date" => date ( "Y-m-d" ),
+								"cid" => $data ['officeId'],
+								"rid" => $rid,
+								"status" => 4 
+						);
+						$this->ReceiptDetailCreate ( $itemData );
+					}
+				}
+			}
+		}
+	}
+	
+	// 新增报销单详情
+	public function ReceiptDetailCreate($data = array()) {
+		$receiptDetail = new receiptDetail ();
+		$receiptDetail->staff = $data ['staff'];
+		$receiptDetail->item = $data ['item'];
+		$receiptDetail->itemCategory = $data ['itemCategory'];
+		$receiptDetail->price = $data ['price'];
+		$receiptDetail->date = $data ['date'];
+		$receiptDetail->cid = $data ['cid'];
+		$receiptDetail->rid = $data ['rid'];
+		$receiptDetail->status = $data ['status'];
+		$receiptDetail->insert ();
+	}
+	public function num_to_rmb($num) {
+		$c1 = "零壹贰叁肆伍陆柒捌玖";
+		$c2 = "分角元拾佰仟万拾佰仟亿";
+		// 精确到分后面就不要了,所以只留两个小数位
+		$num = round ( $num, 2 );
+		// 将数字转化为整数
+		$num = $num * 100;
+		if (strlen ( $num ) > 10) {
+			return "金额太大,请检查";
+		}
+		$i = 0;
+		$c = "";
+		while ( 1 ) {
+			if ($i == 0) {
+				// 获取最后一位数字
+				$n = substr ( $num, strlen ( $num ) - 1, 1 );
+			} else {
+				$n = $num % 10;
+			}
+			// 每次将最后一位数字转化为中文
+			$p1 = substr ( $c1, 3 * $n, 3 );
+			$p2 = substr ( $c2, 3 * $i, 3 );
+			
+			if ($n != '0' || ($n == '0' && ($p2 == '亿' || $p2 == '万' || $p2 == '元'))) {
+				$c = $p1 . $p2 . $c;
+			} else {
+				$c = $p1 . $c;
+			}
+			$i = $i + 1;
+			// 去掉数字最后一位了
+			
+			$num = $num / 10;
+			// echo $num.'</br>';
+			$num = ( int ) $num;
+			// $num =floor($num);
+			// $num = round ( $num, 0, PHP_ROUND_HALF_DOWN );
+			// echo $num.'</br>';
+			// 结束循环
+			if ($num == 0) {
+				break;
+			}
+		}
+		// echo $c.'</br>';
+		$j = 0;
+		$slen = strlen ( $c );
+		while ( $j < $slen ) {
+			// utf8一个汉字相当3个字符
+			$m = substr ( $c, $j, 6 );
+			// 处理数字中很多0的情况,每次循环去掉一个汉字“零”
+			if ($m == '零元' || $m == '零万' || $m == '零亿' || $m == '零零') {
+				$left = substr ( $c, 0, $j );
+				$right = substr ( $c, $j + 3 );
+				$c = $left . $right;
+				$j = $j - 3;
+				$slen = $slen - 3;
+			}
+			$j = $j + 3;
+		}
+		// 这个是为了去掉类似23.0中最后一个“零”字
+		if (substr ( $c, strlen ( $c ) - 3, 3 ) == '零') {
+			$c = substr ( $c, 0, strlen ( $c ) - 3 );
+		}
+		// 将处理的汉字加上“整”
+		if (empty ( $c )) {
+			return "零元整";
+		} else {
+			return $c . "整";
+		}
+	}
+}
+?>

+ 28 - 0
protected/services/staff_service.php

@@ -0,0 +1,28 @@
+<?php
+class staff_service {
+	private $staff;
+	private $XDeode;
+	function __construct() {
+		Doo::loadClass ( 'XDeode' );
+		$this->XDeode = new XDeode ( 9 );
+		Doo::loadModel ( 'cld/staff_cld' );
+		$this->staff = new staff_cld ();
+	}
+	
+	public function GetStaffCategoryId($categoryId=0){
+		
+		if (!is_numeric($categoryId)){
+			$categoryId=$this->XDeode->decode($categoryId);
+		}
+		
+		$list=$this->staff->GetCategoryId($categoryId);
+		
+		return $list;
+	}
+	
+	
+	
+	
+	
+}
+?>

+ 88 - 0
protected/view/fee/incomeExpenses/expenses.html

@@ -0,0 +1,88 @@
+<!-- include '../../comm/header' -->
+<link href="<?= WEB_SITE_GLOBAL ?>gridManager/common.css" rel="stylesheet" type="text/css">
+<link href="<?= WEB_SITE_GLOBAL ?>gridManager/gm.css" rel="stylesheet" type="text/css">
+<script src="<?= WEB_SITE_GLOBAL ?>gridManager/gm.js"></script>
+<style>
+	.collectTable{
+		font-size: 6px;
+			color: #ccc;
+        }
+</style>
+
+<body>
+	<div class="mainLayout">
+		<div class="mainMenu">
+			<div class="menuItem">
+				<a href="#" class="mLogo">CLD</a>
+				<ul>
+					<!-- include '../../admin/menuReceipt' -->
+				</ul>
+			</div>
+		</div>
+		<div class="warpContent">
+			<div class="subMenu fL">
+				<div class="menuItem">
+					<ul>
+						<!-- include '../menu' -->
+					</ul>
+				</div>
+			</div>
+			<div class="adminContent  autoHeight">
+				
+				<legend>
+					支出汇总 <a href="/view/income/collect">收入汇总</a>
+				</legend>
+
+					<section class=" ">
+
+						<div class="saeasideMnav autoHeight">
+
+							<div class="demandCate">
+								<ul class="cateList">
+									<li><select style="width:120px" name="year">
+									{{yearHtml}}
+								</select></li>
+									<li><select style="width:120px" name="month">
+									<option value="">全年</option>
+									<option value="01">1月</option>
+									<option value="02">2月</option>
+									<option value="03">3月</option>
+									<option value="04">4月</option>
+									<option value="05">5月</option>
+									<option value="06">6月</option>
+									<option value="07">7月</option>
+									<option value="08">8月</option>
+									<option value="09">9月</option>
+									<option value="10">10月</option>
+									<option value="11">11月</option>
+									<option value="12">12月</option>
+								</select></li>
+									<li><button class="search-action button stockdemandBtn">点击查询</button></li>
+									<li><button class="reset-action button btn-gray">重置</button></li>
+								</ul>
+							</div>
+						</div>
+					</section>
+
+				
+				<div class="">
+					
+					<div class="saeaList">
+						<!--待审批列表-->
+						<section class="grid-main">
+							<table id="feeList"></table>
+						</section>
+
+
+
+					</div>
+				</div>
+			</div>
+		</div>
+	</div>
+
+
+	<script src="<?= WEB_SITE_GLOBAL ?>gridManager/fee/expensesCollect.js"></script>
+	
+	<!-- <script type="text/javascript">autoFlashHeight();</script> -->
+</body>

+ 112 - 0
protected/view/fee/incomeExpenses/income.html

@@ -0,0 +1,112 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<!-- include '../../comm/header' -->
+<link href="<?= WEB_SITE_GLOBAL ?>gridManager/common.css" rel="stylesheet" type="text/css">
+<link href="<?= WEB_SITE_GLOBAL ?>gridManager/gm.css" rel="stylesheet" type="text/css">
+<script src="<?= WEB_SITE_GLOBAL ?>gridManager/gm.js"></script>
+<style>
+	.collectTable{
+		font-size: 6px;
+			color: #ccc;
+        }
+</style>
+
+<body>
+	<div class="mainLayout">
+		<div class="mainMenu">
+			<div class="menuItem">
+				<a href="#" class="mLogo">CLD</a>
+				<ul>
+					<!-- include '../../admin/menuReceipt' -->
+				</ul>
+			</div>
+		</div>
+		<div class="warpContent">
+			<div class="subMenu fL">
+				<div class="menuItem">
+					<ul>
+						<!-- include '../menu' -->
+					</ul>
+				</div>
+			</div>
+			<div class="adminContent  autoHeight">
+				
+				<legend>
+					收入汇总 <a href="/view/expenses/collect">支出汇总</a>
+				</legend>
+
+					<section class=" ">
+
+						<div class="saeasideMnav autoHeight">
+
+							<div class="demandCate">
+								<ul class="cateList">
+									<li><select style="width:120px" name="year">
+									{{yearHtml}}
+								</select></li>
+									<li><select style="width:120px" name="month">
+									<option value="">全年</option>
+									<option value="01">1月</option>
+									<option value="02">2月</option>
+									<option value="03">3月</option>
+									<option value="04">4月</option>
+									<option value="05">5月</option>
+									<option value="06">6月</option>
+									<option value="07">7月</option>
+									<option value="08">8月</option>
+									<option value="09">9月</option>
+									<option value="10">10月</option>
+									<option value="11">11月</option>
+									<option value="12">12月</option>
+								</select></li>
+									<li><button class="search-action button stockdemandBtn">点击查询</button></li>
+									<li><button class="reset-action button btn-gray">重置</button></li>
+								</ul>
+							</div>
+						</div>
+					</section>
+
+				
+				<div class="">
+					
+					<div class="saeaList">
+						<!--待审批列表-->
+						<section class="grid-main">
+							<table id="feeList"></table>
+						</section>
+
+
+
+					</div>
+				</div>
+			</div>
+		</div>
+	</div>
+
+
+	<script src="<?= WEB_SITE_GLOBAL ?>gridManager/fee/incomeCollect.js"></script>
+	
+	<!-- <script type="text/javascript">autoFlashHeight();</script> -->
+</body>

+ 153 - 0
protected/view/fee/incomeExpenses/list.html

@@ -0,0 +1,153 @@
+<!-- include '../../comm/header' -->
+<link href="<?= WEB_SITE_GLOBAL ?>gridManager/common.css" rel="stylesheet" type="text/css">
+<link href="<?= WEB_SITE_GLOBAL ?>gridManager/gm.css" rel="stylesheet" type="text/css">
+<script src="<?= WEB_SITE_GLOBAL ?>gridManager/gm.js"></script>
+
+
+<body>
+	<div class="mainLayout">
+		<div class="mainMenu">
+			<div class="menuItem">
+				<a href="#" class="mLogo">CLD</a>
+				<ul>
+					<!-- include '../../admin/menuReceipt' -->
+				</ul>
+			</div>
+		</div>
+		<div class="warpContent">
+			<div class="subMenu fL">
+				<div class="menuItem">
+					<ul>
+						<!-- include '../menu' -->
+					</ul>
+				</div>
+			</div>
+			<div class="adminContent adminContentS autoHeight">
+				<div class="librarySide">
+
+					<section class=" ">
+
+						<div class="saeasideMnav autoHeight">
+							<div class="search">
+								<div class="input-append">
+									<input class="" placeholder="单号(不包含#),总金额" type="text" name="kw"
+										style="width: 130px !important;border-radius: 4px;">
+								</div>
+							</div>
+							<div><select style="width:120px" name="year">
+									{{yearHtml}}
+								</select></div>
+							<div><select style="width:120px" name="month">
+									<option value="">全年</option>
+									<option value="01">1月</option>
+									<option value="02">2月</option>
+									<option value="03">3月</option>
+									<option value="04">4月</option>
+									<option value="05">5月</option>
+									<option value="06">6月</option>
+									<option value="07">7月</option>
+									<option value="08">8月</option>
+									<option value="09">9月</option>
+									<option value="10">10月</option>
+									<option value="11">11月</option>
+									<option value="12">12月</option>
+								</select></div>
+							<div class="clearfix">
+								<select class="fL" name="expensesType">
+									<option value="">请选择收入或支出</option>
+									<option value="1">收入</option>
+									<option value="2">支出</option>
+								</select>
+							</div>
+							<div class="clearfix">
+								<select class="fL" name="accountType">
+									<option value="">请选择收入费用类别</option>
+									<option  value='1'>利息收入</option>
+								<option  value='2'>补贴收入</option>
+								<option  value='3'>纵横知道</option>
+								<option  value='4'>借款收回</option>
+								<option  value='5'>退汇</option>
+								<option  value='6'>其他</option>
+								<option  value='7'>广发理财</option>
+								<option  value='9'>工行理财</option>
+								<option  value='8'>保证金</option>
+
+								<option  value='11'>广发存款</option>
+								<option  value='12'>工行存款</option>
+								</select>
+							</div>
+							<div class="clearfix">
+								<select class="fL" name="expenditureType">
+									<option value="">请选择支出费用类别</option>
+									
+								<option  value="1">银行手续费</option>
+								<option  value="2">总部电话费</option>
+								<option  value="3">缴税</option>
+								<option  value="4">广发理财</option>
+								<option  value="4">工行理财</option>
+								<option  value='5'>保证金</option>
+
+							<option  value="8">广发存款</option>
+							<option  value='9'>工行存款</option>
+								</select>
+							</div>
+
+
+							<button class="search-action button stockdemandBtn">点击查询</button>
+							<button class="reset-action">重置</button>
+						</div>
+					</section>
+
+				</div>
+
+				<div class="libraryContent">
+					<legend>
+						<div class="fR"></div>所有收支列表
+					</legend>
+
+					<div class="saeaList">
+						<!--待审批列表-->
+						<section class="grid-main">
+							<table id="feeList"></table>
+						</section>
+
+
+
+					</div>
+				</div>
+			</div>
+		</div>
+	</div>
+
+
+	<script src="<?= WEB_SITE_GLOBAL ?>gridManager/fee/incomeExpenses.js"></script>
+	<script>
+		$(function () {
+			$("select[name=categoryId]").change(function () {
+				let categoryId = $(this).val();
+				let form_data = new FormData();
+				form_data.append("categoryId", categoryId);
+				$.ajax({
+					type: "POST",
+					url: "/json/staff/category",
+					dataType: "json",
+					processData: false,
+					contentType: false,
+					data: form_data
+				}).success(function (data) {
+					console.log(data)
+					let html='<option value="">请选择员工</option>';
+					data.forEach(el => {
+						html+=`<option value="${el.sid_cld}">${el.username}
+									</option>`;
+					});
+
+					$("select[name=staffId]").html(html);
+				}).fail(function (msg) {
+					this.alertDia("获取员工失败");
+				});
+			})
+		})
+	</script>
+	<!-- <script type="text/javascript">autoFlashHeight();</script> -->
+</body>

+ 140 - 0
protected/view/fee/list.html

@@ -0,0 +1,140 @@
+<!-- include '../comm/header' -->
+<link href="<?= WEB_SITE_GLOBAL ?>gridManager/common.css" rel="stylesheet" type="text/css">
+<link href="<?= WEB_SITE_GLOBAL ?>gridManager/gm.css" rel="stylesheet" type="text/css">
+<script src="<?= WEB_SITE_GLOBAL ?>gridManager/gm.js"></script>
+
+
+<body>
+	<div class="mainLayout">
+		<div class="mainMenu">
+			<div class="menuItem">
+				<a href="#" class="mLogo">CLD</a>
+				<ul>
+					<!-- include '../admin/menuReceipt' -->
+				</ul>
+			</div>
+		</div>
+		<div class="warpContent">
+			<div class="subMenu fL">
+				<div class="menuItem">
+					<ul>
+						<!-- include 'menu' -->
+					</ul>
+				</div>
+			</div>
+			<div class="adminContent adminContentS autoHeight">
+				<div class="librarySide">
+
+					<section class=" ">
+
+						<div class="saeasideMnav autoHeight">
+							<div class="search">
+								<div class="input-append">
+									<input class="" placeholder="单号(不包含#),总金额" type="text" name="kw"
+										style="width: 130px !important;border-radius: 4px;">
+								</div>
+							</div>
+							<div><select style="width:120px" name="year">
+									{{yearHtml}}
+								</select></div>
+							<div><select style="width:120px" name="month">
+									<option value="">全年</option>
+									<option value="01">1月</option>
+									<option value="02">2月</option>
+									<option value="03">3月</option>
+									<option value="04">4月</option>
+									<option value="05">5月</option>
+									<option value="06">6月</option>
+									<option value="07">7月</option>
+									<option value="08">8月</option>
+									<option value="09">9月</option>
+									<option value="10">10月</option>
+									<option value="11">11月</option>
+									<option value="12">12月</option>
+								</select></div>
+							<div class="clearfix">
+								<select class="fL" name="categoryId">
+									<option value="">请选择所在办事处</option>
+									<!-- loop office -->
+									<option value="{{office' value.cid}}">{{office' value.title}}</option>
+									<!-- endloop -->
+								</select>
+							</div>
+							<div class="clearfix">
+								<select class="fL" name="staffId">
+									<option value="">请选择员工</option>
+									<!-- loop staffSelect -->
+									<option value="{{staffSelect' value.sid_cld}}">{{staffSelect' value.username}}
+									</option>
+									<!-- endloop -->
+								</select>
+							</div>
+							<div class="clearfix">
+								<select class="fL" name="feeType">
+									<option value="">请选择费用类型</option>
+									<option value="0">报销单</option>
+									<option value="1">借款(借款报销单)</option>
+									<option value="2">对公汇款</option>
+									<option value="3">培训班</option>
+								</select>
+							</div>
+
+
+							<button class="search-action button stockdemandBtn">点击查询</button>
+							<button class="reset-action">重置</button>
+						</div>
+					</section>
+
+				</div>
+
+				<div class="libraryContent">
+					<legend>
+						<div class="fR"></div>所有费用列表
+					</legend>
+
+					<div class="saeaList">
+						<!--待审批列表-->
+						<section class="grid-main">
+							<table id="feeList"></table>
+						</section>
+
+
+
+					</div>
+				</div>
+			</div>
+		</div>
+	</div>
+
+
+	<script src="<?= WEB_SITE_GLOBAL ?>gridManager/fee/list.js"></script>
+	<script>
+		$(function () {
+			$("select[name=categoryId]").change(function () {
+				let categoryId = $(this).val();
+				let form_data = new FormData();
+				form_data.append("categoryId", categoryId);
+				$.ajax({
+					type: "POST",
+					url: "/json/staff/category",
+					dataType: "json",
+					processData: false,
+					contentType: false,
+					data: form_data
+				}).success(function (data) {
+					console.log(data)
+					let html='<option value="">请选择员工</option>';
+					data.forEach(el => {
+						html+=`<option value="${el.sid_cld}">${el.username}
+									</option>`;
+					});
+
+					$("select[name=staffId]").html(html);
+				}).fail(function (msg) {
+					this.alertDia("获取员工失败");
+				});
+			})
+		})
+	</script>
+	<!-- <script type="text/javascript">autoFlashHeight();</script> -->
+</body>