Browse Source

首页卡片列表重写

zhuth 7 years ago
parent
commit
c31c95f43b

+ 8 - 6
frontend/saas-web/app/Application.scss

@@ -256,15 +256,17 @@ body.launching {
 }
 
 .x-grid-header-ct {
-  border-top-color: #ABDAFF;
+  border-top-color: #ABDAFF !important;
+  border-right-color: #ABDAFF !important;
+  border-left-color: #ABDAFF !important;
   border-top-width: 1px;
+  border-right-width: 1px;
+  border-left-width: 1px;
 }
 
-.x-panel-default-outer-border-rl {
-  border-right-color: #ABDAFF !important;
-  border-right-width: 1px !important;
-  border-left-color: #ABDAFF !important;
-  border-left-width: 1px !important;
+.x-panel-default-outer-border-rl,
+.x-panel-default-outer-border-rbl {
+  border-color: #ABDAFF !important;
 }
 
 .x-grid-item-alt {

+ 3 - 31
frontend/saas-web/app/view/core/query/QueryGridPanel.js

@@ -53,7 +53,6 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
     initComponent: function () {
         var me = this;
 
-        console.log(me.idField);
         if(me.idField == 'id') {
             me.idField = '_id';
         }
@@ -120,20 +119,14 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
                         viewModel = queryPanel.getViewModel(),
                         moreQuery = viewModel.get('moreQuery'),
                         condition = queryPanel.getConditions(moreQuery),
-                        defaultCondition1 = queryPanel.defaultCondition,
-                        defaultCondition2 = me.defaultCondition,
+                        defaultCondition = me.defaultCondition,
                         mode = queryPanel.getQueryMode();
 
-                        if(defaultCondition1) {
+                        if(defaultCondition) {
                             condition.push({
                                 type: 'condition',
                                 value: defaultCondition1
                             });
-                        }else if(defaultCondition2) {
-                            condition.push({
-                                type: 'condition',
-                                value: defaultCondition2
-                            });
                         }
                         Ext.apply(store.proxy.extraParams, {
                             number: store.exportNumber?store.exportNumber:op._page,
@@ -166,8 +159,7 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
             dockedItems: [{
                 xtype: 'toolbar',
                 dock: 'top',
-                hidden: me.simpleMode,
-                defaults: { // defaults 将会应用所有的子组件上,而不是父容器
+                defaults: {
                     listeners: {
                         'mouseover':function(){
                             this.showMenu(); 
@@ -213,21 +205,6 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
                 },  {
                     text: '导出',
                     handler: me.onImport,
-                    // menu: {
-                    //     cls:'x-query-menu',
-                    //     width: 80,
-                    //     items: [{
-                    //         text:'导出',
-                    //         handler:function(){
-                    //             me.onExport(this)
-                    //         }
-                    //     }],
-                    //     // listeners: {
-                    //     //     'mouseleave':function(enu){
-                    //     //         this.hide();
-                    //     //     } 
-                    //     // }
-                    // },
                     bind: {
                         hidden: '{!importEnable}'
                     }
@@ -271,11 +248,6 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
         me.callParent(arguments);
     },
     listeners: {
-        afterrender: function(grid) {
-            if(grid.simpleMode) {
-                grid.headerCt.child('gridcolumn[isCheckerHd]').hide();
-            }
-        },
         boxready: function(grid, width, height, eOpts) {
             var store = grid.getStore(),
             gridBodyBox = grid.body.dom.getBoundingClientRect(),

+ 1 - 21
frontend/saas-web/app/view/core/query/QueryPanel.js

@@ -29,22 +29,11 @@ Ext.define('saas.view.core.query.QueryPanel', {
 
     initComponent: function () {
         var me = this;
-        me.initQueryPanel();
-        // me.setQueryFormItems();
+        me.setQueryFormItems();
         me.setQuertGridConfigs();
         me.callParent(arguments);
     },
 
-    initQueryPanel: function() {
-        var me = this;
-        if(me.simpleMode) {
-            me.items[0].hidden = true;
-        }else {
-            me.items[0].hidden = false;
-            me.setQueryFormItems();
-        }
-    },
-
     getQueryForm: function () {
         var me = this,
         queryForm = me.items[0];
@@ -129,7 +118,6 @@ Ext.define('saas.view.core.query.QueryPanel', {
         }
 
         me.queryGridConfig['columns']=columns;
-        me.queryGridConfig['simpleMode'] = me.simpleMode;
         Ext.apply(queryGrid,me.queryGridConfig);
     },
 
@@ -147,10 +135,6 @@ Ext.define('saas.view.core.query.QueryPanel', {
         condition,
         conditions = [];
 
-        if(me.simpleMode) {
-            return conditions;
-        }
-
         if(moreQuery) {
             for(k in moreItems) {
                 var item = Ext.Array.findBy(moreQueryFormItems, function(i) {
@@ -292,10 +276,6 @@ Ext.define('saas.view.core.query.QueryPanel', {
         formData = viewModelData['form'],
         detailModel = false;
 
-        if(me.simpleMode) {
-            return 'DETAIL';
-        }
-
         for(var i = 0; i < formItems.length; i++) {
             var item = formItems[i],
             showDetail = item.showDetail,

+ 7 - 16
frontend/saas-web/app/view/home/InfoCard.js

@@ -41,38 +41,32 @@ Ext.define('saas.view.home.InfoCard', {
                 unship: {
                     title: '待出货销售',
                     color: 'yellow',
-                    viewType: 'sale-sale-querypanel',
-                    condition: 'sale.companyid=' + companyId + ' and sa_statuscode=\'AUDITED\' and exists (select 1 from saledetail detail where sd_id=saledetail.sd_id and  IFNULL(sd_sendqty,0)<ifnull(sd_qty,0) and TO_DAYS(sd_delivery)-TO_DAYS(now())<= 7)'
+                    viewType: 'home-infocardlist-saleout',
                 },
                 unstorage: {
                     title: '待入库采购',
                     color: 'purple',
-                    viewType: 'purchase-purchase-querypanel',
-                    condition: 'purchase.companyId=' + companyId + ' and pu_statuscode=\'AUDITED\' and exists (select 1 from purchasedetail detail where pd_id=purchasedetail.pd_id and IFNULL(pd_acceptqty,0) < ifnull(pd_qty,0) and TO_DAYS(PD_DELIVERY)-TO_DAYS(now()) <= 7)'
+                    viewType: 'home-infocardlist-purchasein',
                 },
                 unpay: {
                     title: '待付款',
                     color: 'red',
-                    viewType: 'purchase-purchasein-querypanel',
-                    condition: 'pi_class in (\'采购验收单\',\'采购验退单\') and prodinout.companyId=' + companyId + ' and TO_DAYS(pi_date+ifnull(ve_promisedays,0))-TO_DAYS(now()) <= 7 and exists (select 1 from subledger where sl_code=pi_inoutno and sl_kind=pi_class and subledger.companyId=' + companyId + ' and ifnull(sl_namount,0)<>0)'
+                    viewType: 'home-infocardlist-payment',
                 },
                 unreceive: {
                     title: '待收款',
                     color: 'pink',
-                    viewType: 'sale-saleout-querypanel',
-                    condition: 'pi_class in (\'出货单\',\'销售退货单\') and prodinout.companyId=' + companyId + ' and TO_DAYS(pi_date+ifnull(cu_promisedays,0))-TO_DAYS(now()) <= 7 and exists (select 1 from subledger where sl_code=pi_inoutno and sl_kind=pi_class and subledger.companyId=' + companyId + ' and ifnull(sl_namount,0)<>0)'
+                    viewType: 'home-infocardlist-recment',
                 },
                 unauditcheck: {
                     title: '未审核验收',
                     color: 'blue',
-                    viewType: 'purchase-purchasein-querypanel',
-                    condition: 'pi_statuscode<>\'AUDITED\' and pi_class in (\'采购验收单\',\'采购验退单\') and prodinout.companyId=' + companyId
+                    viewType: 'home-infocardlist-unauditcheckin',
                 },
                 unauditship: {
                     title: '未审核出货',
                     color: 'default',
-                    viewType: 'sale-saleout-querypanel',
-                    condition: 'pi_statuscode<>\'AUDITED\' and pi_class in (\'出货单\',\'销售退货单\') and prodinout.companyId=' + companyId
+                    viewType: 'home-infocardlist-unauditsaleout',
                 }
             },
             userCls: 'x-info-card ' + me.userCls,
@@ -147,10 +141,7 @@ Ext.define('saas.view.home.InfoCard', {
                 itemSelector: 'div.x-box',
                 listeners: {
                     itemclick: function(th, record, item, index, e, eOpts) {
-                        saas.util.BaseUtil.openTab(record.get('viewType'), record.get('title'), record.get('id'), {
-                            simpleMode: true,
-                            defaultCondition: record.get('condition')
-                        });
+                        saas.util.BaseUtil.openTab(record.get('viewType'), record.get('title'), record.get('id'));
                     }
                 }
             });

+ 6 - 1
frontend/saas-web/app/view/home/charts/MonthPurchase.js

@@ -27,12 +27,13 @@ Ext.define('saas.view.home.charts.MonthPurchase', {
                     position: 'bottom',
                     label: {
                         fontSize: '12px',
-                        fillStyle: '#485465'
+                        fillStyle: '#485465',
                     },
                     style: {
                         fill: '#F7F8FA',
                         strokeStyle: 'transparent'
                     },
+                    renderer: me.onCategoryLabelRender
                 },{
                     type: 'numeric',
                     fields: ['y'],
@@ -79,6 +80,10 @@ Ext.define('saas.view.home.charts.MonthPurchase', {
         me.callParent(arguments);
     },
 
+    onCategoryLabelRender: function(axis, label, layoutContent, lastLabel) {
+        return label.substr(0,2) + '...';
+    },
+
     onBarTipRender: function (tooltip, record, item) {
         tooltip.setHtml(record.get('x') + ': ' + record.get('y') + '万元');
     },

+ 212 - 0
frontend/saas-web/app/view/home/infoCardList/InfoList.js

@@ -0,0 +1,212 @@
+Ext.define('saas.view.home.infoCardList.InfoList', {
+    extend: 'Ext.grid.Panel',
+    xtype: 'home-infocardlist-infolist',
+
+    cls: 'x-infocardlist',
+
+    //基础属性
+    border: 1,
+    loadMask: true,
+    showIndex: true,
+    columnWidth: 1.0,
+    showRowNum: true,
+
+    codeField: '',
+    columns: [],
+    condition: '1=1',
+
+    initComponent: function () {
+        var me = this,
+        listUrl = me.listUrl,
+        condition = me.initCondition(me.condition);
+
+        if(me.idField == 'id') {
+            me.idField = '_id';
+        }
+
+        Ext.apply(me, {
+            actions: {
+                copy: {
+                    iconCls: 'x-fa fa-copy',
+                    text: '复制单元格',
+                    handler: function() {
+                        me.onCopy(me.selectedData);
+                    }
+                }
+            },
+            viewConfig: {
+                deferEmptyText: false,
+                emptyText: '无数据',
+                listeners: {
+                    itemcontextmenu: function(view, rec, node, index, e) {
+                        e.stopEvent();
+                        me.getContextMenu().show().setLocalXY(e.getXY());
+                        me.selectedData = e.target.innerText;
+                        return false;
+                    }
+                }
+            },
+            columns: me.initColumns(),
+            store: Ext.create('Ext.data.Store', {
+                fields: me.getFields(),
+                autoLoad: true,
+                pageSize: 15,
+                data: [],
+                proxy: {
+                    type: 'ajax',
+                    url: listUrl,
+                    timeout: 8000,
+                    actionMethods: {
+                        read: 'GET'
+                    },
+                    reader: {
+                        type: 'json',
+                        rootProperty: 'data.list',
+                        totalProperty: 'data.total',
+                    },
+                    listeners: {
+                        exception: function(proxy, response, operation, eOpts) {
+                            if(operation.success) {
+                                if(response.timedout) {
+                                    saas.util.BaseUtil.showErrorToast('请求超时');
+                                }
+                            }else {
+                                if(response.timedout) {
+                                    saas.util.BaseUtil.showErrorToast('请求超时');
+                                }else{
+                                    saas.util.BaseUtil.showErrorToast('查询失败:' + response.responseJson.message);
+                                }
+                            }
+                        }
+                    }
+                },
+                listeners: {
+                    beforeload: function (store, op) {
+                        var conditions = [{
+                            type: 'condition',
+                            value: condition
+                        }];
+
+                        Ext.apply(store.proxy.extraParams, {
+                            number: store.exportNumber?store.exportNumber:op._page,
+                            size: store.exportPageSize?store.exportPageSize:store.pageSize,
+                            mode: 'DETAIL',
+                            condition: JSON.stringify(conditions)
+                        });
+    
+                    },
+                    load: function(store, records, successful, operation, eOpts) {
+                        var datas = [];
+
+                        Ext.Array.each(records, function(r, i) {
+                            var d = Object.assign({}, r.data, { _id: r.data.id, id: Ext.id() });
+                            datas.push(d);
+                        });
+
+                        store.loadData(datas, false);
+                        me.reconfigure(store, me.initColumns());
+                    }
+                }
+            }),
+            dockedItems: [{
+                xtype: 'pagingtoolbar',
+                cls: 'core-query-pagingtoolbar',
+                dock: 'bottom',
+                displayInfo: true,
+                store: me.store
+            }]
+        });
+        me.callParent(arguments);
+    },
+    listeners: {
+        boxready: function(grid, width, height, eOpts) {
+            var store = grid.getStore(),
+            gridBodyBox = grid.body.dom.getBoundingClientRect(),
+            gridBodyBoxHeight = gridBodyBox.height;
+
+            var pageSize = Math.floor(gridBodyBoxHeight / 32);
+
+            store.setPageSize(pageSize);
+        },
+        itemClick: function(tableView, record, item, index, e, eOpts) {
+            var grid = tableView.up('grid');
+
+            if(!grid.fireEvent('beforeopendetail', grid, record)) {
+                return false;
+            }
+
+            var idField = grid.idField,
+            codeField = grid.codeField,
+            detailTitle = grid.detailTitle,
+            detailXType = grid.detailXType;
+
+            if(e.target.parentElement.classList.contains('x-code-column')) {
+                var idValue = record.get(idField),
+                codeValue = record.get(codeField),
+                id = detailXType + '-' + idValue;
+                saas.util.BaseUtil.openTab(detailXType, detailTitle+"("+codeValue+")", id, {
+                    initId: idValue
+                });
+            }
+        },
+    },
+
+    initCondition: function(condition) {
+        var companyId = saas.util.BaseUtil.getCurrentUser().companyId;
+        return condition.replace('#{companyId}', companyId);;
+    },
+
+    initColumns: function() {
+        var me = this,
+        columns = me.listColumns;
+
+        Ext.Array.each(columns, function(c) {
+            if(c.dataIndex == me.codeField) {
+                Ext.applyIf(c, {
+                    tdCls: 'x-code-column'
+                });
+            }
+        });
+
+        return columns;
+    },
+    getFields: function() {
+        var me = this;
+
+        return me.columns.filter(function(c) {
+            return !!c.dataIndex;
+        }).map(function(c) {
+            return c.dataIndex;
+        });
+    },
+
+    getContextMenu: function() {
+        var me = this;
+
+        return me.contextMenu || (me.contextMenu = me.add({
+            xtype: 'menu',
+            items: [
+                // Actions can be converted into MenuItems
+                '@copy',
+            ]
+        }));
+    },
+
+    onCopy: function(text) {
+		var target = Ext.DomHelper.append(document.body, {
+			tag: 'textarea',
+			style: 'opacity: 0;position: absolute;top: -10000px;right: 0;',
+			html: text
+		});
+		target.focus();
+		target.select();
+	    document.execCommand('Copy');
+	    target.blur();
+	    document.body.removeChild(target);
+    },
+    
+    refresh: function() {
+        var me = this;
+        me.store.reload();
+    }
+});

+ 14 - 0
frontend/saas-web/app/view/home/infoCardList/InfoList.scss

@@ -0,0 +1,14 @@
+.x-infocardlist {
+    .x-grid-header-ct {
+        border-top-color: #ABDAFF !important;
+    }
+
+    .x-code-column {
+
+        .x-grid-cell-inner {
+            text-decoration: underline;
+            color: #3E80F6;
+            cursor: pointer;
+        }
+    }
+}

+ 130 - 0
frontend/saas-web/app/view/home/infoCardList/Payment.js

@@ -0,0 +1,130 @@
+/**
+ * 待付款
+ */
+Ext.define('saas.view.home.infoCardList.Payment', {
+    extend: 'saas.view.home.infoCardList.InfoList',
+    xtype: 'home-infocardlist-payment',
+
+    listUrl: '/api/purchase/prodinout/list',
+    idField: 'id',
+    codeField: 'pi_inoutno',
+    // detailTitle: '采购验收单',
+    // detailXType: 'purchase-purchasein-formpanel',
+    condition: 'pi_class in (\'采购验收单\',\'采购验退单\') and prodinout.companyId=#{companyId} and TO_DAYS(pi_date+ifnull(ve_promisedays,0))-TO_DAYS(now()) <= 7 and exists (select 1 from subledger where sl_code=pi_inoutno and sl_kind=pi_class and subledger.companyId=#{companyId} and ifnull(sl_namount,0)<>0)',
+    listColumns: [{
+        text: 'id',
+        dataIndex: 'pu_id',
+        xtype: 'numbercolumn',
+        hidden: true
+    }, {
+        text: '单据编号',
+        dataIndex: 'pi_inoutno',
+        width: 150
+    }, {
+        text: '单据类型',
+        dataIndex: 'pd_piclass',
+        width: 0
+    }, {
+        text: '单据日期',
+        dataIndex: 'pi_date',
+        xtype: 'datecolumn',
+        width: 110
+    }, {
+        text: '供应商编号',
+        dataIndex: 'pi_vendcode',
+        width: 0
+    }, {
+        text: '供应商名称',
+        dataIndex: 'pi_vendname',
+        width: 150
+    }, {
+        text: '审核状态',
+        align: 'center',
+        dataIndex: 'pi_status',
+        width: 90
+    }, {
+        text: '序号',
+        dataIndex: 'pd_pdno',
+        width: 80
+    }, {
+        text: '相关单号',
+        dataIndex: 'pd_ordercode',
+        width: 150
+    }, {
+        text: '物料编号',
+        dataIndex: 'pd_prodcode',
+        width: 150
+    }, {
+        text: '物料名称',
+        dataIndex: 'pr_detail',
+        width: 200
+    }, {
+        text: '物料规格',
+        dataIndex: 'pr_spec',
+        width: 150
+    }, {
+        text: '单位',
+        dataIndex: 'pr_unit',
+        width: 80
+    }, {
+        text: '数量',
+        dataIndex: 'pd_inqty',
+        xtype: 'numbercolumn',
+        width: 110,
+        renderer: function (v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
+            var format = '0,000.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        },
+    }, {
+        text: '仓库',
+        dataIndex: 'pd_whname',
+        width: 150
+    }, {
+        text: '单价',
+        dataIndex: 'pd_orderprice',
+        xtype: 'numbercolumn',
+        renderer: function (v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length)).fill('0');
+            var format = '0,000.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        },
+        width: 110
+    }, {
+        text: '税率',
+        dataIndex: 'pd_taxrate',
+        xtype: 'numbercolumn',
+        width: 80,
+        renderer: function (v) {
+            return Ext.util.Format.number(v, '0');
+        },
+    }, {
+        text: '金额',
+        dataIndex: 'pd_total',
+        xtype: 'numbercolumn',
+        width: 110,
+        renderer: function (v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+            var format = '0,000.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        },
+    }],
+    listeners: {
+        beforeopendetail: function(grid, record) {
+            var pi_class = record.get('pi_class'),
+            detailTitle = '采购验收单',
+            detailXType = 'purchase-purchasein-formpanel';
+
+            if(pi_class == '采购验退单') {
+                detailTitle = '采购验退单';
+                detailXType = 'purchase-purchaseout-formpanel';
+            }
+            grid.detailTitle = detailTitle;
+            grid.detailXType = detailXType;
+            return true;
+        }
+    }
+});

+ 118 - 0
frontend/saas-web/app/view/home/infoCardList/PurchaseIn.js

@@ -0,0 +1,118 @@
+/**
+ * 待入库采购
+ */
+Ext.define('saas.view.home.infoCardList.PurchaseIn', {
+    extend: 'saas.view.home.infoCardList.InfoList',
+    xtype: 'home-infocardlist-purchasein',
+
+    listUrl: '/api/purchase/purchase/list',
+    idField: 'pu_id',
+    codeField: 'pu_code',
+    detailTitle: '采购订单',
+    detailXType: 'purchase-purchase-formpanel',
+    condition: 'purchase.companyId=#{companyId} and pu_statuscode=\'AUDITED\' and exists (select 1 from purchasedetail detail where pd_id=purchasedetail.pd_id and IFNULL(pd_acceptqty,0) < ifnull(pd_qty,0) and TO_DAYS(PD_DELIVERY)-TO_DAYS(now()) <= 7)',
+    listColumns: [{
+        text: 'id',
+        dataIndex: 'pu_id',
+        width: 0,
+        hidden: true
+    }, {
+        text: '采购单号',
+        dataIndex: 'pu_code',
+        width: 150
+    }, {
+        text: '单据日期',
+        dataIndex: 'pu_date',
+        xtype: 'datecolumn',
+        width: 110
+    }, {
+        text: '供应商名称',
+        dataIndex: 'pu_vendname',
+        width: 150
+    }, {
+        text: '审核状态',
+        align: 'center',
+        dataIndex: 'pu_status',
+        width: 90
+    }, {
+        text: '业务状态',
+        align: 'center',
+        dataIndex: 'pu_acceptstatus',
+        width: 90
+    }, {
+        text: '序号',
+        dataIndex: 'pd_detno',
+        xtype: 'numbercolumn',
+        width: 80,
+        renderer: function (v) {
+            return Ext.util.Format.number(v, '0');
+        }
+    }, {
+        text: '物料编号',
+        dataIndex: 'pd_prodcode',
+        width: 150
+    }, {
+        text: '物料名称',
+        dataIndex: 'pr_detail',
+        width: 200
+    }, {
+        text: '物料规格',
+        dataIndex: 'pr_spec',
+        width: 150
+    }, {
+        text: '单位',
+        dataIndex: 'pr_unit',
+        width: 80
+    }, {
+        text: '采购数量',
+        dataIndex: 'pd_qty',
+        xtype: 'numbercolumn',
+        width: 110,
+        renderer: function (v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
+            var format = '0,000.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        },
+    }, {
+        text: '需求日期',
+        dataIndex: 'pd_delivery',
+        xtype: 'datecolumn',
+        width: 110
+    }, {
+        text: '单价',
+        dataIndex: 'pd_price',
+        xtype: 'numbercolumn',
+        width: 110,
+        renderer: function (v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length > 8 ? 8 : arr[1].length)).fill('0');
+            var format = '0,000.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        }
+    }, {
+        text: '税率',
+        dataIndex: 'pd_taxrate',
+        xtype: 'numbercolumn',
+        width: 80,
+        renderer: function (v) {
+            return Ext.util.Format.number(v, '0');
+        },
+    }, {
+        text: '金额',
+        dataIndex: 'pd_total',
+        xtype: 'numbercolumn',
+        width: 110,
+        renderer: function (v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+            var format = '0,000.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        }
+    }, {
+        text: '备注',
+        dataIndex: 'pd_remark',
+        width: 250
+    }]
+
+});

+ 139 - 0
frontend/saas-web/app/view/home/infoCardList/Recment.js

@@ -0,0 +1,139 @@
+/**
+ * 待收款
+ */
+Ext.define('saas.view.home.infoCardList.Recment', {
+    extend: 'saas.view.home.infoCardList.InfoList',
+    xtype: 'home-infocardlist-recment',
+
+    listUrl: '/api/sale/prodinout/list',
+    idField: 'id',
+    codeField: 'pi_inoutno',
+    // detailTitle: '出货单',
+    // detailXType: 'sale-saleout-formpanel',
+    condition: 'pi_class in (\'出货单\',\'销售退货单\') and prodinout.companyId=#{companyId} and TO_DAYS(pi_date+ifnull(cu_promisedays,0))-TO_DAYS(now()) <= 7 and exists (select 1 from subledger where sl_code=pi_inoutno and sl_kind=pi_class and subledger.companyId=#{companyId} and ifnull(sl_namount,0)<>0)',
+    listColumns: [{
+        text: 'id',
+        dataIndex: 'id',
+        hidden:true,
+        xtype: 'numbercolumn'
+    }, {
+        text: '出货单号',
+        dataIndex: 'pi_inoutno',
+        width: 150
+    }, {
+        text: '单据日期',
+        dataIndex: 'pi_date',
+        xtype:'datecolumn',
+        width: 110
+    },{
+        text: '客户名称',
+        dataIndex: 'pi_custname',
+        width: 250
+    }, {
+        text: '单据状态',
+        align: 'center',
+        dataIndex: 'pi_status',
+        width: 90
+    }, {
+        text: '明细序号',
+        dataIndex: 'pd_pdno',
+        xtype: 'numbercolumn',
+        width: 100,
+        renderer : function(v) {
+            var format = '0'
+            return Ext.util.Format.number(v, format);
+        }
+    }, {
+        text: '关联销售单号',
+        dataIndex: 'pd_ordercode',
+        width: 150
+    }, {
+        text: '订单序号',
+        dataIndex: 'pd_orderdetno',
+        xtype:'numbercolumn',
+        width: 100,
+        renderer : function(v) {
+            var format = '0'
+            return Ext.util.Format.number(v, format);
+        }
+    }, {
+        text: '物料编号',
+        dataIndex: 'pd_prodcode',
+        width: 150
+    }, {
+        text: '物料名称',
+        dataIndex: 'pr_detail',
+        width: 150
+    }, {
+        text: '出货数量',
+        dataIndex: 'pd_outqty',
+        xtype:'numbercolumn',
+        width: 110,
+        renderer : function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
+            var format = '0.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        }
+    }, {
+        text: '销售单价',
+        dataIndex: 'pd_sendprice',
+        xtype:'numbercolumn',
+        width: 110,
+        renderer : function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length > 8 ? 8 : arr[1].length)).fill('0');
+            var format = '0.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        }
+    }, {
+        text: '金额',
+        dataIndex: 'pd_ordertotal',
+        xtype:'numbercolumn',
+        width: 110,
+        renderer : function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
+            var format = '0.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        }
+    }, {
+        text: '税率',
+        dataIndex: 'pd_taxrate',
+        xtype:'numbercolumn',
+        width: 80,
+        renderer : function(v) {
+            return Ext.util.Format.number(v, '0');
+        }
+    }, {
+        text: '成本单价',
+        dataIndex: 'pd_price',
+        xtype:'numbercolumn',
+        width: 110,
+        renderer : function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+            var format = '0.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        }
+    }, {
+        text: '备注',
+        dataIndex: 'pd_remark',
+        width: 250
+    }],
+    listeners: {
+        beforeopendetail: function(grid, record) {
+            var pi_class = record.get('pi_class'),
+            detailTitle = '出货单',
+            detailXType = 'sale-saleout-formpanel';
+
+            if(pi_class == '销售退货单') {
+                detailTitle = '销售退货单';
+                detailXType = 'sale-salein-formpanel';
+            }
+            grid.detailTitle = detailTitle;
+            grid.detailXType = detailXType;
+            return true;
+        }
+    }
+});

+ 118 - 0
frontend/saas-web/app/view/home/infoCardList/SaleOut.js

@@ -0,0 +1,118 @@
+/**
+ * 待出货销售
+ */
+Ext.define('saas.view.home.infoCardList.SaleOut', {
+    extend: 'saas.view.home.infoCardList.InfoList',
+    xtype: 'home-infocardlist-saleout',
+
+    listUrl: '/api/sale/sale/list',
+    idField: 'sa_id',
+    codeField: 'sa_code',
+    detailTitle: '销售订单',
+    detailXType: 'sale-sale-formpanel',
+    condition: 'sale.companyid=#{companyId} and sa_statuscode=\'AUDITED\' and exists (select 1 from saledetail detail where sd_id=saledetail.sd_id and  IFNULL(sd_sendqty,0)<ifnull(sd_qty,0) and TO_DAYS(sd_delivery)-TO_DAYS(now())<= 7)',
+    listColumns: [{
+        text: 'id',
+        dataIndex: 'sa_id',
+        hidden: true,
+        xtype: 'numbercolumn'
+    }, {
+        text: '单据编号',
+        dataIndex: 'sa_code',
+        width: 200
+    }, {
+        text: '单据状态',
+        align: 'center',
+        dataIndex: 'sa_status',
+        width: 120
+    }, {
+        text: '单据日期',
+        dataIndex: 'sa_date',
+        xtype: 'datecolumn',
+        width: 200
+    }, {
+        text: '客户名称',
+        dataIndex: 'sa_custname',
+        width: 120
+    }, {
+        text: '明细序号',
+        dataIndex: 'sd_detno',
+        xtype: 'numbercolumn',
+        width: 120,
+        renderer: function (v) {
+            return Ext.util.Format.number(v, '0');
+        }
+    }, {
+        text: '物料编号',
+        dataIndex: 'sd_prodcode',
+        width: 120
+    }, {
+        text: '物料名称',
+        dataIndex: 'pr_detail',
+        width: 120
+    }, {
+        text: '物料规格',
+        dataIndex: 'pr_spec',
+        width: 120
+    }, {
+        text: '数量',
+        dataIndex: 'sd_qty',
+        xtype: 'numbercolumn',
+        width: 120,
+        renderer: function (v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
+            var format = '0.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        },
+    }, {
+        text: '单价',
+        dataIndex: 'sd_price',
+        xtype: 'numbercolumn',
+        width: 120,
+        renderer: function (v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length > 8 ? 8 : arr[1].length)).fill('0');
+            var format = '0,000.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        },
+    }, {
+        text: '已转数',
+        dataIndex: 'sd_yqty',
+        xtype: 'numbercolumn',
+        width: 120,
+        renderer: function (v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
+            var format = '0.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        },
+    }, {
+        text: '已出货数',
+        dataIndex: 'sd_sendqty',
+        xtype: 'numbercolumn',
+        width: 120,
+        renderer: function (v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
+            var format = '0.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        },
+    }, {
+        text: '已审核采购单数',
+        dataIndex: 'sd_pdqty',
+        xtype: 'numbercolumn',
+        width: 180,
+        renderer: function (v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
+            var format = '0.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        },
+    }, {
+        text: '备注',
+        dataIndex: 'sd_remark',
+        width: 250
+    }],
+
+});

+ 130 - 0
frontend/saas-web/app/view/home/infoCardList/UnauditCheckIn.js

@@ -0,0 +1,130 @@
+/**
+ * 未审核验收
+ */
+Ext.define('saas.view.home.infoCardList.UnauditCheckIn', {
+    extend: 'saas.view.home.infoCardList.InfoList',
+    xtype: 'home-infocardlist-unauditcheckin',
+
+    listUrl: '/api/purchase/prodinout/list',
+    idField: 'id',
+    codeField: 'pi_inoutno',
+    // detailTitle: '采购验收单',
+    // detailXType: 'purchase-purchasein-formpanel',
+    condition: 'pi_statuscode<>\'AUDITED\' and pi_class in (\'采购验收单\',\'采购验退单\') and prodinout.companyId=#{companyId}',
+    listColumns: [{
+        text: 'id',
+        dataIndex: 'pu_id',
+        xtype: 'numbercolumn',
+        hidden: true
+    }, {
+        text: '单据编号',
+        dataIndex: 'pi_inoutno',
+        width: 150
+    }, {
+        text: '单据类型',
+        dataIndex: 'pd_piclass',
+        width: 0
+    }, {
+        text: '单据日期',
+        dataIndex: 'pi_date',
+        xtype: 'datecolumn',
+        width: 110
+    }, {
+        text: '供应商编号',
+        dataIndex: 'pi_vendcode',
+        width: 0
+    }, {
+        text: '供应商名称',
+        dataIndex: 'pi_vendname',
+        width: 150
+    }, {
+        text: '审核状态',
+        align: 'center',
+        dataIndex: 'pi_status',
+        width: 90
+    }, {
+        text: '序号',
+        dataIndex: 'pd_pdno',
+        width: 80
+    }, {
+        text: '相关单号',
+        dataIndex: 'pd_ordercode',
+        width: 150
+    }, {
+        text: '物料编号',
+        dataIndex: 'pd_prodcode',
+        width: 150
+    }, {
+        text: '物料名称',
+        dataIndex: 'pr_detail',
+        width: 200
+    }, {
+        text: '物料规格',
+        dataIndex: 'pr_spec',
+        width: 150
+    }, {
+        text: '单位',
+        dataIndex: 'pr_unit',
+        width: 80
+    }, {
+        text: '数量',
+        dataIndex: 'pd_inqty',
+        xtype: 'numbercolumn',
+        width: 110,
+        renderer: function (v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
+            var format = '0,000.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        },
+    }, {
+        text: '仓库',
+        dataIndex: 'pd_whname',
+        width: 150
+    }, {
+        text: '单价',
+        dataIndex: 'pd_orderprice',
+        xtype: 'numbercolumn',
+        renderer: function (v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length)).fill('0');
+            var format = '0,000.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        },
+        width: 110
+    }, {
+        text: '税率',
+        dataIndex: 'pd_taxrate',
+        xtype: 'numbercolumn',
+        width: 80,
+        renderer: function (v) {
+            return Ext.util.Format.number(v, '0');
+        },
+    }, {
+        text: '金额',
+        dataIndex: 'pd_total',
+        xtype: 'numbercolumn',
+        width: 110,
+        renderer: function (v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+            var format = '0,000.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        },
+    }],
+    listeners: {
+        beforeopendetail: function(grid, record) {
+            var pi_class = record.get('pi_class'),
+            detailTitle = '采购验收单',
+            detailXType = 'purchase-purchasein-formpanel';
+
+            if(pi_class == '采购验退单') {
+                detailTitle = '采购验退单';
+                detailXType = 'purchase-purchaseout-formpanel';
+            }
+            grid.detailTitle = detailTitle;
+            grid.detailXType = detailXType;
+            return true;
+        }
+    }
+});

+ 139 - 0
frontend/saas-web/app/view/home/infoCardList/UnauditSaleOut.js

@@ -0,0 +1,139 @@
+/**
+ * 未审核出货
+ */
+Ext.define('saas.view.home.infoCardList.UnauditSaleOut', {
+    extend: 'saas.view.home.infoCardList.InfoList',
+    xtype: 'home-infocardlist-unauditsaleout',
+
+    listUrl: '/api/sale/prodinout/list',
+    idField: 'id',
+    codeField: 'pi_inoutno',
+    // detailTitle: '出货单',
+    // detailXType: 'sale-saleout-formpanel',
+    condition: 'pi_statuscode<>\'AUDITED\' and pi_class in (\'出货单\',\'销售退货单\') and prodinout.companyId=#{companyId}',
+    listColumns: [{
+        text: 'id',
+        dataIndex: 'id',
+        hidden:true,
+        xtype: 'numbercolumn'
+    }, {
+        text: '出货单号',
+        dataIndex: 'pi_inoutno',
+        width: 150
+    }, {
+        text: '单据日期',
+        dataIndex: 'pi_date',
+        xtype:'datecolumn',
+        width: 110
+    },{
+        text: '客户名称',
+        dataIndex: 'pi_custname',
+        width: 250
+    }, {
+        text: '单据状态',
+        align: 'center',
+        dataIndex: 'pi_status',
+        width: 90
+    }, {
+        text: '明细序号',
+        dataIndex: 'pd_pdno',
+        xtype: 'numbercolumn',
+        width: 100,
+        renderer : function(v) {
+            var format = '0'
+            return Ext.util.Format.number(v, format);
+        }
+    }, {
+        text: '关联销售单号',
+        dataIndex: 'pd_ordercode',
+        width: 150
+    }, {
+        text: '订单序号',
+        dataIndex: 'pd_orderdetno',
+        xtype:'numbercolumn',
+        width: 100,
+        renderer : function(v) {
+            var format = '0'
+            return Ext.util.Format.number(v, format);
+        }
+    }, {
+        text: '物料编号',
+        dataIndex: 'pd_prodcode',
+        width: 150
+    }, {
+        text: '物料名称',
+        dataIndex: 'pr_detail',
+        width: 150
+    }, {
+        text: '出货数量',
+        dataIndex: 'pd_outqty',
+        xtype:'numbercolumn',
+        width: 110,
+        renderer : function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
+            var format = '0.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        }
+    }, {
+        text: '销售单价',
+        dataIndex: 'pd_sendprice',
+        xtype:'numbercolumn',
+        width: 110,
+        renderer : function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length > 8 ? 8 : arr[1].length)).fill('0');
+            var format = '0.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        }
+    }, {
+        text: '金额',
+        dataIndex: 'pd_ordertotal',
+        xtype:'numbercolumn',
+        width: 110,
+        renderer : function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
+            var format = '0.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        }
+    }, {
+        text: '税率',
+        dataIndex: 'pd_taxrate',
+        xtype:'numbercolumn',
+        width: 80,
+        renderer : function(v) {
+            return Ext.util.Format.number(v, '0');
+        }
+    }, {
+        text: '成本单价',
+        dataIndex: 'pd_price',
+        xtype:'numbercolumn',
+        width: 110,
+        renderer : function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+            var format = '0.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        }
+    }, {
+        text: '备注',
+        dataIndex: 'pd_remark',
+        width: 250
+    }],
+    listeners: {
+        beforeopendetail: function(grid, record) {
+            var pi_class = record.get('pi_class'),
+            detailTitle = '出货单',
+            detailXType = 'sale-saleout-formpanel';
+
+            if(pi_class == '销售退货单') {
+                detailTitle = '销售退货单';
+                detailXType = 'sale-salein-formpanel';
+            }
+            grid.detailTitle = detailTitle;
+            grid.detailXType = detailXType;
+            return true;
+        }
+    }
+});