hy 6 жил өмнө
parent
commit
26c23fbc22

+ 1 - 1
frontend/saas-web/app/view/purchase/b2b/deviceQuery/DataList.js

@@ -14,7 +14,7 @@ Ext.define('saas.view.purchase.b2b.deviceQuery.DataList', {
                 width: 240,
                 name: 'keyword',
                 xtype: 'textfield',
-                emptyText: '请输入型号/物料名称/品牌搜索',
+                emptyText: '请输入物料名称/型号/规格搜索',
             }],
 
             gridConfig: {

+ 4 - 4
frontend/saas-web/app/view/purchase/b2b/reconciliation/DataList.js

@@ -1,5 +1,5 @@
 /**
- * 平台对账单
+ * 应付对账单
  */
 Ext.define('saas.view.purchase.b2b.reconciliation.DataList', {
     extend: 'saas.view.core.base.BasePanel',
@@ -31,8 +31,8 @@ Ext.define('saas.view.purchase.b2b.reconciliation.DataList', {
                 hiddenTools: true,
                 data: [{}],
                 columns: [{
-                    text : '对账单编号', 
-                    width:150,
+                    text : '应付对账单编号', 
+                    width:170,
                     dataIndex : 'ac_code',
                     cls:'x-querygrid-code-column',
                     renderer:function(v,style,a,b,c){
@@ -43,7 +43,7 @@ Ext.define('saas.view.purchase.b2b.reconciliation.DataList', {
                             var idValue = record.get('id'),
                             codeValue = record.get('ac_code'),
                             id = 'purchase-b2b-reconciliation-formpanel-' + idValue;
-                            saas.util.BaseUtil.openTab('purchase-b2b-reconciliation-formpanel', "平台对账单("+codeValue+")", id, {
+                            saas.util.BaseUtil.openTab('purchase-b2b-reconciliation-formpanel', "应付对账单("+codeValue+")", id, {
                                 initId: idValue
                             });
                         }

+ 1 - 1
frontend/saas-web/app/view/purchase/b2b/reconciliation/FormPanel.js

@@ -8,7 +8,7 @@ Ext.define('saas.view.purchase.b2b.reconciliation.FormPanel', {
     viewName: 'purchase-b2b-reconciliation-formpanel',
 
     //字段属性
-    _title: '平台对账单',
+    _title: '应付对账单',
     _idField: 'id',
     _codeField: 'ac_code',
     _relationColumn: 'pd_puid',

+ 16 - 0
frontend/saas-web/app/view/purchase/b2b/sendQuotation/DataList.js

@@ -149,6 +149,22 @@ Ext.define('saas.view.purchase.b2b.sendQuotation.DataList', {
         }else{
             saas.util.BaseUtil.showErrorToast('请勾选至少一条明细。');
         }
+    },
+    getExtraParams: function(store, op, condition) {
+        var defaultCondition = [{
+            type:'condition',
+            value:"pr_statuscode='ENABLE'"
+        }]
+        if(condition.length&&condition.length>0){
+            condition = condition.concat(defaultCondition);
+        }else{
+            condition = defaultCondition
+        }
+        var obj = {
+            condition:JSON.stringify(condition)
+        };
+
+        return obj;
     }
 });
 

+ 139 - 15
frontend/saas-web/app/view/sale/b2b/RecDataList.js

@@ -7,29 +7,47 @@ Ext.define('saas.view.sale.b2b.RecDataList', {
 
     viewName: 'sale-b2b-recdatalist',
 
-
     // dataUrl: 'http://10.1.80.35:8560/api/sale/saledown/list',
-    dataUrl: '/api/sale/saledown/list',
+    
+    dataUrl: '/api/sale/b2b/apCheck/customer',
 
     initComponent: function() {
         var me = this;
         Ext.apply(this, {
             searchField: [{
+                name:'ar_customer',
                 xtype: 'textfield',
                 emptyText: '请输入客户名称'
             }, {
+                name:'ar_date',
                 xtype: 'condatefield',
                 fieldLabel: '日期',
                 columnWidth: 0.5
             }],
+            toolButtons:[{
+                ignore: true,
+                style:'text-align: center;',
+                xtype:'displayfield',
+                value:'<a href=\"javascript:saas.util.BaseUtil.openTab(\'sale-b2b-reconciliation-datalist\',\'对账列表\',\'maintab-query-salereconciliation\')\">对账详情</a>'
+            }],
             gridConfig: {
+                features : [Ext.create('Ext.grid.feature.Grouping',{
+                    collapsible:false,
+                    showSummaryRow: false,
+                    groupHeaderTpl: '客户名称 : {name} (共:{rows.length}条)'
+                })],
+                listeners:{
+                    boxready:function(){
+                        this.store.group('custName', 'ASC');
+                    }
+                },
                 idField: null,
                 codeField: null,
                 statusCodeField: null,
                 dataUrl: me.dataUrl,
                 caller: null,
-                rootProperty: 'data.list',
-                totalProperty: 'data.total',
+                rootProperty: 'data.content',
+                totalProperty: 'data.totalElement',
                 actionColumn: [],
                 selModel: {
                     type: 'cellmodel'
@@ -37,41 +55,147 @@ Ext.define('saas.view.sale.b2b.RecDataList', {
                 hiddenTools: true,
                 data: [],
                 columns : [{
+                    text:'apId',
+                    dataIndex:'apId',
+                    hidden:true
+                },{
                     text: '客户名称',
-                    dataIndex: 'khmc',
-                    width: 200
+                    dataIndex: 'custName',
+                    hidden:true
                 }, {
+                    text: 'UU',
+                    dataIndex: 'custUU',
+                    hidden:true
+                },{
                     text: '币别',
-                    dataIndex: 'bb',
+                    dataIndex: 'currency',
                 }, {
                     text: '本期应收',
-                    dataIndex: 'bqys'
+                    xtype:'numbercolumn',
+                    dataIndex: 'thisPeriodAmount',
+                    renderer: function (v, m, r) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, false);
+                    }
                 }, {
                     text: '本期发货',
-                    dataIndex: 'bqfh'
+                    xtype:'numbercolumn',
+                    dataIndex: 'thisPeriodSendQty',
+                    renderer: function (v, m, r) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, false);
+                    }
                 }, {
                     text: '本期未对账',
-                    dataIndex: 'bqwdz'
+                    xtype:'numbercolumn',
+                    dataIndex: 'thisPeriodTodoAmount',
+                    renderer: function (v, m, r) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, false);
+                    }
                 }, {
                     text: '本期已对账',
-                    dataIndex: 'bqydz'
+                    xtype:'numbercolumn',
+                    dataIndex: 'thisPeriodDoneAmount',
+                    renderer: function (v, m, r) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, false);
+                    }
                 }, {
                     text: '本期已收',
-                    dataIndex: 'bqys'
+                    xtype:'numbercolumn',
+                    dataIndex: 'thisPeriodReceipt',
+                    renderer: function (v, m, r) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, false);
+                    }
                 }, {
                     text: '应收总额',
-                    dataIndex: 'ysze'
+                    xtype:'numbercolumn',
+                    dataIndex: 'totalAmount',
+                    renderer: function (v, m, r) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, false);
+                    }
                 }, {
                     text: '操作',
-                    dataIndex: 'xx',
+                    dataIndex: 'op',
                     ignore: true,
-                    renderer: function() {
+                    renderer: function(v,m,r) {
                         return '<span style="color: blue;">明细</span>';
+                    },
+                    listeners: {
+                        click: function(tableView, td, row, col, e, record, tr) {
+                            var idValue = record.get('apId'),
+                            id = 'sale-b2b-recformpanel-formpanel-' + idValue;
+                            var ar_date = tableView.ownerCt.ownerCt.down('[name=ar_date]');
+                            saas.util.BaseUtil.openTab('sale-b2b-recformpanel-formpanel', "应收对账单("+idValue+")", id, {
+                                currency:record.get('currency'),
+                                customerUU:record.get('custUU'),
+                                suuorname:record.get('custName'),
+                                fromDate:new Date(ar_date.value.from).getTime(),
+                                endDate:new Date(ar_date.value.to).getTime()
+                            });
+                        }
                     }
                 }]
             }
         });
 
         me.callParent(arguments);
+    },
+
+    /**
+     * 处理部分字段值
+     */
+    getConditionValue: function (field, value) {
+        var me = this,
+            xtypes = field.getXTypes().split('/'),
+            conditionValue;
+        if (me.isContainsAny(xtypes, ['datefield'])) {
+            conditionValue = Ext.Date.format(new Date(from), 'Y-m-d H:i:s');
+        } else if (me.isContainsAny(xtypes, ['conmonthfield'])) {
+            var from = value.from,
+                to = value.to;
+
+            conditionValue = from + ',' + to;
+        } else if (me.isContainsAny(xtypes, ['condatefield'])) {
+            var from = new Date(value.from).getTime(),
+                to = new Date(value.to).getTime();
+
+            conditionValue = {
+                from: from,
+                to: to
+            };
+        } else if (me.isContainsAny(xtypes, ['dbfindtrigger'])) {
+            conditionValue = value;
+        } else if (me.isContainsAny(xtypes, ['combobox', 'combo'])) {
+            conditionValue = value;
+        } else if (me.isContainsAny(xtypes, ['multicombo'])) {
+            conditionValue = value.map ? value.map(function (v) {
+                return v.value;
+            }).join(',') : '';
+        } else {
+            conditionValue = value;
+        }
+
+        return conditionValue;
+    },
+
+
+    getExtraParams: function(store, op, condition) {
+        var ar_customer = this.down('[name=ar_customer]');
+        var searchFilter = {}
+        for(var i = 0; i < condition.length; i++) {
+            var con = condition[i];
+            if(con.type == 'date') {
+                searchFilter.fromDate = con.value.from;
+                searchFilter.endDate = con.value.to;
+            }
+        }
+        if(ar_customer.value&&ar_customer.value!=""){
+            searchFilter.keyword = ar_customer.value
+        }
+        var obj = {
+            count:op.config.limit,
+            page:op.config.page,
+            searchFilter:JSON.stringify(searchFilter)
+        };
+
+        return obj;
     }
 });

+ 314 - 0
frontend/saas-web/app/view/sale/b2b/recformpanel/FormPanel.js

@@ -0,0 +1,314 @@
+Ext.define('saas.view.sale.b2b.recformpanel.FormPanel', {
+    extend: 'Ext.form.Panel',
+    xtype: 'sale-b2b-recformpanel-formpanel',
+    controller: 'sale-b2b-recformpanel-formpanel',
+    viewModel: 'sale-b2b-recformpanel-formpanel',
+    viewName: 'sale-b2b-recformpanel-formpanel',
+    layout:'column',
+
+    //字段属性
+    _title: '应收对账单',
+    _idField: 'id',
+    _codeField: 'ap_code',
+    _relationColumn: 'pd_puid',
+    _readUrl: '/api/sale/b2b/apCheck/getAllByKeywords',
+    tbar: [{ 
+        width:160,
+        xtype: 'textfield',
+        emptyText: '请输入客户名称'
+    }, { 
+        margin:'0 0 0 10',
+        width:100,
+        name:'currencyCombo',
+        xtype: 'combo',
+        displayField: 'display',
+        valueField: 'value',
+        emptyText: '币别',
+        listeners:{
+            expand:function(f){
+                if(f.picker&&f.isExpanded){
+                    f.picker.setHeight(33*f.store.getCount())
+                }
+            }
+        }
+    } ,{
+        margin:'0 0 0 10',
+        name:'date',
+        xtype: 'condatefield',
+        fieldLabel: '日期',
+        width:520,
+    },{
+        margin:'0 0 0 10',
+        xtype: 'button',
+        text: '查询',
+        handler:'query'
+    },{
+        margin:'0 0 0 10',
+        xtype: 'button',
+        text: '确认对账'
+    },'->',{
+        margin:'0 10 0 0',
+        ignore: true,
+        style:'text-align: center;',
+        bodyStyle:'margin-right:10px;',
+        xtype:'displayfield',
+        value:'<a href=\"javascript:saas.util.BaseUtil.openTab(\'sale-b2b-reconciliation-datalist\',\'对账列表\',\'maintab-query-salereconciliation\')\">对账记录</a>'
+    }],
+
+
+    items: [{
+        margin:'10 10 0 0',
+        columnWidth:0.25,
+        bind:'{thisMonthCount}',
+        xtype: "numberfield",
+        name: "thisMonthCount",
+        fieldLabel: "本期应收金额",
+        allowBlank: true,
+        readOnly:true
+    }, {
+        margin:'10 10 0 0',
+        columnWidth:0.25,
+        bind:'{thisMonthTodoCount}',
+        xtype: "numberfield",
+        name: "thisMonthTodoCount",
+        fieldLabel: "本期未对账",
+        allowBlank: true,
+        readOnly:true
+    },{
+        margin:'10 10 0 0',
+        columnWidth:0.25,
+        bind:'{thisPeriodDoneAmount}',
+        xtype: "numberfield",
+        name: "thisPeriodDoneAmount",
+        fieldLabel: "本期已收",
+        allowBlank: true,
+        readOnly:true
+    },{
+        margin:'10 10 0 0',
+        columnWidth:0.25,
+        bind:'{thisPeriodSendAmount}',
+        xtype: "numberfield",
+        name: "thisPeriodSendAmount",
+        fieldLabel: "本期发货",
+        allowBlank: true,
+        readOnly:true
+    },{
+        margin:'10 10 0 0',
+        columnWidth:0.25,
+        bind:'{thisMonthDoneCount}',
+        xtype: "numberfield",
+        name: "thisMonthDoneCount",
+        fieldLabel: "本期已对账",
+        allowBlank: true,
+        readOnly:true
+    },{
+        margin:'10 10 0 0',
+        columnWidth:0.25,
+        bind:'{totalCount}',
+        xtype: "numberfield",
+        name: "totalCount",
+        fieldLabel: "应收总额",
+        allowBlank: true,
+        readOnly:true
+    },   
+    {
+        margin:'20 10 10 10',
+        style:'border:1px solid #abdaff',
+        columnWidth:1,
+        xtype: "grid",
+        height:343,
+        editable:false,
+        bind:'{detailgrid}',
+        plugins: [{
+            ptype: 'gridexporter',
+        }, {
+            ptype: 'menuclipboard'
+        }],
+        selModel: {
+            checkOnly:true,
+            type:'checkboxmodel',
+            hideCheckField:'haveChecked',
+            hideCheckVal:'已对账',
+            listeners:{
+                select:function(selModel,record,c,d){
+                    if(record.get('haveChecked')=='已对账'){
+                        selModel.deselect(record)
+                    }
+                }
+             }
+        },
+        features : [Ext.create('Ext.grid.feature.Grouping',{
+            collapsible:false,
+            showSummaryRow: false,
+            groupHeaderTpl: '客户PO号 : {name} (共:{rows.length}条)'
+        })],
+        columns: [{
+            text: "id",
+            dataIndex: "id",
+            xtype: "numbercolumn",
+            hidden: true
+        },{
+            text: "ad_acid",
+            dataIndex: "ad_acid",
+            xtype: "numbercolumn",
+            hidden: true
+        },{  
+            text: "对账状态",
+            width: 100.0,
+            dataIndex: "haveChecked",
+        }, { 
+            text: "客户PO",
+            width: 140.0,
+            dataIndex: "ordercode",
+        },{
+            text: "验收单号",
+            width: 120.0,
+            dataIndex: "inoutno",
+            ignore: true,
+        }, {
+            text: "发货单",
+            dataIndex: "x",
+            width: 100.0
+        }, {
+            text: "物料编号",
+            dataIndex: "prodcode",
+            width: 150.0
+        }, {
+            text: "物料名称",
+            dataIndex: "prodtitle",
+            width: 200.0
+        }, {
+            text: "规格型号",
+            dataIndex: "prodspec",
+            width: 200.0
+        },{
+            text: "单位",
+            width: 150.0,
+            dataIndex: "produnit",
+            ignore: true
+        },{
+            text: "验收数量",
+            width: 100.0,
+            dataIndex: "thischeckqty",
+            xtype:'numbercolumn',
+            ignore: true,
+            renderer: function (v, m, r) {
+                return saas.util.BaseUtil.numberFormat(v, 0, false);
+            }
+        },{
+            text: "发货数量",
+            xtype:'numbercolumn',
+            width: 100.0,
+            dataIndex: "qty",
+            ignore: true,
+            renderer: function (v, m, r) {
+                return saas.util.BaseUtil.numberFormat(v, 0, false);
+            }
+        },{
+            text: "含税单价",
+            xtype:'numbercolumn',
+            width: 100.0,
+            dataIndex: "orderprice",
+            ignore: true,
+            renderer: function (v, m, r) {
+                return saas.util.BaseUtil.numberFormat(v, 2, false);
+            }
+        },{
+            text: "税率%",
+            xtype:'numbercolumn',
+            width: 100.0,
+            dataIndex: "taxrate",
+            ignore: true,
+            renderer: function (v, m, r) {
+                return saas.util.BaseUtil.numberFormat(v, 2, false);
+            }
+        },{
+            text: "价税合计",
+            xtype:'numbercolumn',
+            width: 100.0,
+            dataIndex: "money",
+            renderer: function (v, m, r) {
+                return saas.util.BaseUtil.numberFormat(v, 2, false);
+            }
+        },{
+            text: "对账人",
+            width: 140.0,
+            dataIndex: "recorder",
+            ignore: true
+        },{
+            text: "对账日期",
+            width: 160.0,
+            dataIndex: "apCheckDate",
+            ignore: true
+        },]
+    }],
+
+    initComponent: function () {
+        var me = this,
+        viewModel = me.getViewModel();
+        var url = me._readUrl;
+        var params = {
+            fromDate:me.fromDate,
+            endDate:me.endDate,
+            currency:me.currency,
+            customerUU:me.customerUU,
+            suuorname:me.suuorname
+        };
+        saas.util.BaseUtil.request({url,params })
+        .then(function(res) {
+            me.setLoading(true);
+            if(res.success) {
+                var mainDate = {};
+                var main = res.data.main;
+                if(main.thisMonthCount){
+                    mainDate.thisMonthCount = main.thisMonthCount.amount
+                }
+                if(main.thisMonthDoneCount){
+                    mainDate.thisMonthDoneCount = main.thisMonthDoneCount.amount
+                }
+                if(main.thisMonthTodoCount){
+                    mainDate.thisMonthTodoCount = main.thisMonthTodoCount.amount
+                }
+                if(main.thisPeriodDoneAmount){
+                    mainDate.thisPeriodDoneAmount = main.thisPeriodDoneAmount.amount
+                }
+                if(main.thisPeriodSendAmount){
+                    mainDate.thisPeriodSendAmount = main.thisPeriodSendAmount.amount
+                }
+                if(main.totalCount){
+                    mainDate.totalCount = main.totalCount.amount
+                }
+                viewModel.setData(mainDate);
+                Ext.each(res.data.items,function(item,index){
+                    if(item.haveChecked==0){
+                        item.haveChecked = null
+                    }
+                    if(item.haveChecked==1){
+                        item.haveChecked = '已对账'
+                    }
+                })
+                viewModel.setData({detailgrid:res.data.items});
+                var o = [];
+                Ext.each(res.data.currencys,function(item,index){
+                    for (var i in item){
+                        var obj = [item[i],item[i]];
+                    }
+                    o.push(obj)
+                })
+                me.down('[name=currencyCombo]').store = Ext.create('Ext.data.ArrayStore', {
+                    fields: ['display', 'value'],
+                    data: o
+                });
+                me.down('[name=currencyCombo]').value = me.currency
+                me.setLoading(false);
+            }
+            me.setLoading(false);
+        })
+        .catch(function(e) {
+            me.setLoading(false);
+            console.error(e);
+        });
+
+        me.callParent(arguments);
+    }
+});

+ 107 - 0
frontend/saas-web/app/view/sale/b2b/recformpanel/FormPanelController.js

@@ -0,0 +1,107 @@
+Ext.define('saas.view.sale.b2b.recformpanel.FormPanelController', {
+    extend: 'saas.view.core.form.FormPanelController',
+    alias: 'controller.sale-b2b-recformpanel-formpanel',
+    init: function (form) {
+        var me = this;
+        this.control({});
+    },
+    query:function(){
+        var me = this.getView(),
+        viewModel = me.getViewModel();
+        var url = me._readUrl;
+        var date = me.down('[name=date]');
+        var currencyCombo = me.down('[name=currencyCombo]');
+        var params = {
+            fromDate:new Date(date.value.from).getTime(),
+            endDate:new Date(date.value.to).getTime(),
+            currency: currencyCombo.value || me.currency,
+            customerUU:me.customerUU,
+            suuorname:me.suuorname
+        };
+        me.setLoading(true);
+        saas.util.BaseUtil.request({url,params })
+        .then(function(res) {
+            if(res.success) {
+                var mainDate = {};
+                var main = res.data.main;
+                if(main.thisMonthCount){
+                    mainDate.thisMonthCount = main.thisMonthCount.amount
+                }
+                if(main.thisMonthDoneCount){
+                    mainDate.thisMonthDoneCount = main.thisMonthDoneCount.amount
+                }
+                if(main.thisMonthTodoCount){
+                    mainDate.thisMonthTodoCount = main.thisMonthTodoCount.amount
+                }
+                if(main.thisPeriodDoneAmount){
+                    mainDate.thisPeriodDoneAmount = main.thisPeriodDoneAmount.amount
+                }
+                if(main.thisPeriodSendAmount){
+                    mainDate.thisPeriodSendAmount = main.thisPeriodSendAmount.amount
+                }
+                if(main.totalCount){
+                    mainDate.totalCount = main.totalCount.amount
+                }
+                viewModel.setData(mainDate);
+                Ext.each(res.data.items,function(item,index){
+                    if(item.haveChecked==0){
+                        item.haveChecked = null
+                    }
+                    if(item.haveChecked==1){
+                        item.haveChecked = '已对账'
+                    }
+                })
+                viewModel.setData({detailgrid:res.data.items});
+                var o = [];
+                Ext.each(res.data.currencys,function(item,index){
+                    for (var i in item){
+                        var obj = [item[i],item[i]];
+                    }
+                    o.push(obj)
+                })
+                // me.down('[name=currencyCombo]').store = Ext.create('Ext.data.ArrayStore', {
+                //     fields: ['display', 'value'],
+                //     data: o
+                // });
+                // me.down('[name=currencyCombo]').value = me.currency
+                me.setLoading(false);
+            }
+            me.setLoading(false);
+        })
+        .catch(function(e) {
+            me.setLoading(false);
+            console.error(e);
+        });
+    },
+    agree:function(){
+        var me = this;
+        var url = '/api/money/apcheck/agree/';
+        me.sendUrl(url)
+    },
+    disagree:function(){
+        var me = this;
+        var url = '/api/money/apcheck/reject/';
+        me.sendUrl(url)
+    },
+    sendUrl:function(url){
+        var me = this;
+        var view = me.getView();
+        var id = me.getViewModel().getData().id;
+        view.setLoading(true);
+        saas.util.BaseUtil.request({
+            url: url + id,
+            params: '',
+            method: 'POST',
+        })
+        .then(function() {
+            view.setLoading(false);
+            //解析参数
+            saas.util.BaseUtil.showSuccessToast('操作成功');
+            me.refresh()
+        })
+        .catch(function(e) {
+            //失败
+            saas.util.BaseUtil.showErrorToast('操作失败: ' + e.message);
+        });
+    }
+});

+ 34 - 0
frontend/saas-web/app/view/sale/b2b/recformpanel/FormPanelModel.js

@@ -0,0 +1,34 @@
+Ext.define('saas.view.sale.b2b.recformpanel.FormPanelModel', {
+    extend: 'saas.view.core.form.FormPanelModel',
+    alias: 'viewmodel.sale-b2b-recformpanel-formpanel',
+
+    data: {
+        id: 0,
+        base: {
+            bindFields: [], // 绑定字段
+            valid: true, // 单据是否合法
+            editable: false, // 单据是否可编辑
+            codeEditable: false, // 单据编号是否可编辑
+        },
+        auditBtnText: '审核', // 审核按钮默认text
+        showAddBtn: false, // 显示新增按钮
+        showSaveBtn: false, // 显示保存按钮
+        showDeleteBtn: false, // 显示删除按钮
+        showCopyBtn: false, // 显示复制按钮
+        showAuditBtn: false, // 显示审核、反审核按钮
+        showPrintBtn: false, // 显示打印按钮
+        configurable: false, // 显示界面设置按钮
+
+        detailBindeFields: [], // 从表绑定列
+        detailStore: null, // 从表store
+    },
+
+    formulas:{
+        showButtons:{
+            bind:'{ac_confirmstatuscode}',
+            get:function(value){
+                return value == 'UNCONFIRM';
+            }
+        }
+    }
+});

+ 190 - 0
frontend/saas-web/app/view/sale/b2b/reconciliation/DataList.js

@@ -0,0 +1,190 @@
+/**
+ * 应收对账单
+ */
+Ext.define('saas.view.sale.b2b.reconciliation.DataList', {
+    extend: 'saas.view.core.base.BasePanel',
+    xtype: 'sale-b2b-reconciliation-datalist',
+
+    viewName: 'sale-b2b-reconciliation-datalist',
+    dataUrl: '/api/sale/b2b/apCheck/info/list',
+    initComponent: function () {
+        var me = this;
+        Ext.apply(this, {
+            searchField: [{
+                width: 240,
+                name: 'ac_vendname',
+                xtype: 'textfield',
+                emptyText: '请输入客户名称',
+            },{
+                width: 240,
+                name: 'ac_vendcode',
+                xtype: 'textfield',
+                emptyText: '请输入对账编号',
+            }, {
+                xtype: 'condatefield',
+                name: 'ac_date',
+                fieldLabel: '日期',
+                columnWidth: 0.5
+            }],
+
+            gridConfig: {
+                dataUrl: me.dataUrl,
+                actionColumn: [],
+                selModel: {
+                    type: 'cellmodel'
+                },
+                rootProperty: 'data.content',
+                totalProperty: 'data.totalElement',
+                hiddenTools: true,
+                data: [{}],
+                columns: [{
+                    text : '应收对账单编号', 
+                    width:170,
+                    dataIndex : 'code',
+                    cls:'x-querygrid-code-column',
+                    renderer:function(v,style,a,b,c){
+                        return '<span class="x-query-link" style="cursor: pointer;color: #3e80f6;border-bottom: 1px solid #3e80f6;">'+v+'</span>';
+                    },
+                    listeners: {
+                        click: function(tableView, td, row, col, e, record, tr) {
+                            var idValue = record.get('id'),
+                            codeValue = record.get('code'),
+                            id = 'sale-b2b-reconciliation-formpanel-' + idValue;
+                            saas.util.BaseUtil.openTab('sale-b2b-reconciliation-formpanel', "应收对账单("+codeValue+")", id, {
+                                initId: idValue
+                            });
+                        }
+                    }
+                },{
+                    text : 'id', 
+                    hidden:true,
+                    dataIndex : 'id', 
+                    xtype : 'numbercolumn',   
+                },{
+                    text : 'ac_b2bid', 
+                    hidden:true,
+                    dataIndex : 'ac_b2bid', 
+                    xtype : 'numbercolumn',   
+                },{
+                    text : 'accountId', 
+                    hidden:true,
+                    dataIndex : 'accountId', 
+                    xtype : 'numbercolumn',     
+                },{
+                    text : 'ac_sendstatus', 
+                    hidden:true,
+                    dataIndex : 'ac_sendstatus'
+                },{
+                    text : '客户编号', 
+                    dataIndex : 'ac_vendcode', 
+                    hidden:true
+                },{
+                    text : '客户名称', 
+                    dataIndex : 'custName', 
+                    width:110
+                },{
+                    text : '对账期间', 
+                    xtype:'datecolumn',
+                    renderer:function(v,m,r){
+                        if(v&&v!=''){
+                            return Ext.Date.format(new Date(r.get('beginDate')),'Y-m-d') + ' --- ' + Ext.Date.format(new Date(r.get('endDate')),'Y-m-d')
+                        }
+                    },
+                    width : 190.0,
+                    dataIndex : 'apDate'
+                },{
+                    text : '币别', 
+                    width : 90.0, 
+                    dataIndex : 'currency', 
+                },{
+                    text : '对账金额', 
+                    dataIndex : 'checkAmount',
+                    xtype:'numbercolumn', 
+                    width : 110.0,
+                    renderer: function (v, m, r) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, false);
+                    }
+                },{
+                    text : '对账人', 
+                    dataIndex : 'recorder', 
+                    width : 110.0,
+                },{
+                    text : '对账日期', 
+                    dataIndex : 'apDate', 
+                    xtype:'datecolumn',
+                    renderer:function(v,m,r){
+                        if(v&&v!=''){
+                           return Ext.Date.format(new Date(v), 'Y-m-d H:i:s');
+                        }
+                    },
+                    width : 160.0,
+                }, {
+                    text : '对账结果',
+                    textAlign: 'center',
+                    dataIndex : 'checkStatus', 
+                }]
+            },
+        });
+        this.callParent(arguments);
+    },
+    /**
+     * 处理部分字段值
+     */
+    getConditionValue: function (field, value) {
+        var me = this,
+            xtypes = field.getXTypes().split('/'),
+            conditionValue;
+        if (me.isContainsAny(xtypes, ['datefield'])) {
+            conditionValue = Ext.Date.format(new Date(from), 'Y-m-d H:i:s');
+        } else if (me.isContainsAny(xtypes, ['conmonthfield'])) {
+            var from = value.from,
+                to = value.to;
+
+            conditionValue = from + ',' + to;
+        } else if (me.isContainsAny(xtypes, ['condatefield'])) {
+            var from = new Date(value.from).getTime(),
+                to = new Date(value.to).getTime();
+
+            conditionValue = {
+                from: from,
+                to: to
+            };
+        } else if (me.isContainsAny(xtypes, ['dbfindtrigger'])) {
+            conditionValue = value;
+        } else if (me.isContainsAny(xtypes, ['combobox', 'combo'])) {
+            conditionValue = value;
+        } else if (me.isContainsAny(xtypes, ['multicombo'])) {
+            conditionValue = value.map ? value.map(function (v) {
+                return v.value;
+            }).join(',') : '';
+        } else {
+            conditionValue = value;
+        }
+
+        return conditionValue;
+    },
+
+
+    getExtraParams: function(store, op, condition) {
+        var ac_vendname = this.down('[name=ac_vendname]');
+        var searchFilter = {}
+        for(var i = 0; i < condition.length; i++) {
+            var con = condition[i];
+            if(con.type == 'date') {
+                searchFilter.fromDate = con.value.from;
+                searchFilter.endDate = con.value.to;
+            }
+        }
+        if(ac_vendname.value&&ac_vendname.value!=""){
+            searchFilter.keyword = ac_vendname.value
+        }
+        var obj = {
+            count:op.config.limit,
+            page:op.config.page,
+            searchFilter:JSON.stringify(searchFilter)
+        };
+
+        return obj;
+    }
+});
+

+ 192 - 0
frontend/saas-web/app/view/sale/b2b/reconciliation/FormPanel.js

@@ -0,0 +1,192 @@
+Ext.define('saas.view.sale.b2b.reconciliation.FormPanel', {
+    extend: 'saas.view.core.form.FormPanel',
+    xtype: 'sale-b2b-reconciliation-formpanel',
+
+    controller: 'sale-b2b-reconciliation-formpanel',
+    viewModel: 'sale-b2b-reconciliation-formpanel',
+
+    viewName: 'sale-b2b-reconciliation-formpanel',
+
+    //字段属性
+    _title: '应收对账单',
+    _idField: 'id',
+    _codeField: 'code',
+    _readUrl: '/api/sale/b2b/apCheck/info',
+    initId: 0,
+    initComponent: function () {
+        Ext.apply(this, {
+            defaultItems: [{
+                xtype: 'hidden',
+                name: 'id',
+                fieldLabel: 'id'
+            },{
+                xtype: 'hidden',
+                name: 'endDate',
+                fieldLabel: 'endDate'
+            },{
+                xtype: 'hidden',
+                name: 'beginDate',
+                fieldLabel: 'beginDate'
+            }, {
+                xtype: "textfield",
+                name: "custName",
+                fieldLabel: "客户名称",
+                allowBlank: true,
+                readOnly:true
+            },  {
+                xtype: "textfield",
+                name: "ac_date",
+                fieldLabel: "对账期间",
+                allowBlank: true,
+                readOnly:true
+            }, {
+                xtype: "datefield",
+                renderer:function(v,m,r){
+                    if(v&&v!=''){
+                       return Ext.Date.format(new Date(v), 'Y-m-d H:i:s');
+                    }
+                },
+                name: "apDate",
+                fieldLabel: "制单日期",
+                allowBlank: true,
+                readOnly:true
+            } ,{
+                xtype: "textfield",
+                name: "recorder",
+                fieldLabel: "制单人",
+                allowBlank: true,
+                readOnly:true
+            }, {
+                xtype: "textfield",
+                name: "checkStatus",
+                fieldLabel: "对账状态",
+                allowBlank: true,
+                readOnly:true
+            },{
+                xtype: "numberfield",
+                name: "checkAmount",
+                fieldLabel: "对账总额",
+                allowBlank: true,
+                readOnly:true
+            },{
+                xtype: "textfield",
+                name: "currency",
+                fieldLabel: "币别",
+                allowBlank: true,
+                readOnly:true
+            },{
+                xtype: "numberfield",
+                name: "rate",
+                fieldLabel: "汇率",
+                allowBlank: true,
+                readOnly:true
+            },   
+            {
+                name: "detailGridField",
+                xtype: "detailGridField",
+                detnoColumn: 'ad_detno',
+                editable:false,
+                allowEmpty: true,
+                columns: [{
+                    text: "id",
+                    dataIndex: "id",
+                    xtype: "numbercolumn",
+                    hidden: true
+                },{
+                    text: "ad_acid",
+                    dataIndex: "ad_acid",
+                    xtype: "numbercolumn",
+                    hidden: true
+                },{  
+                    hidden:true,
+                    text: "采购单号",
+                    width: 150.0,
+                    dataIndex: "orderCode",
+                }, { 
+                    text: "验收单号",
+                    width: 120.0,
+                    dataIndex: "inoutno",
+                },{
+                    text: "物料编号",
+                    width: 120.0,
+                    dataIndex: "prodCode",
+                    ignore: true,
+                },{
+                    text: "物料名称",
+                    dataIndex: "prodTitle",
+                    width: 150.0
+                },{
+                    text: "规格型号",
+                    dataIndex: "prodSpec",
+                    width: 200.0
+                },{
+                    text: "单位",
+                    dataIndex: "prodUnit",
+                    width: 100.0
+                },{
+                    text: "数量",
+                    xtype:'numbercolumn',
+                    width: 150.0,
+                    dataIndex: "checkQty",
+                    ignore: true,
+                    renderer: function (v, m, r) {
+                        return saas.util.BaseUtil.numberFormat(v, 0, false);
+                    }
+                },{
+                    text: "含税单价",
+                    width: 100.0,
+                    dataIndex: "price",
+                    xtype:'numbercolumn',
+                    ignore: true,
+                    renderer: function (v, m, r) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, false);
+                    }
+                },{
+                    text: "税率%",
+                    xtype:'numbercolumn',
+                    width: 100.0,
+                    dataIndex: "taxrate",
+                    ignore: true,
+                    renderer: function (v, m, r) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, false);
+                    }
+                },{
+                    text: "金额",
+                    xtype:'numbercolumn',
+                    width: 100.0,
+                    dataIndex: "amount",
+                    renderer: function (v, m, r) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, false);
+                    }
+                }],
+                initColumns: function() {
+                    // 构造序号列
+                    var me = this,
+                    columns = me.columns,
+                    detnoField = me.detnoColumn;
+            
+                    indexColumn = {
+                        bind: {
+                            text: "{(configurable && isAdmin) ? ('<div class=\"x-sa sa-setting\" style=\"cursor: pointer;\" title=\"列设置\"></div>') : '序号'}"
+                        },
+                        dataIndex : detnoField, 
+                        width : 60, 
+                        xtype : "numbercolumn",
+                        align : 'center',
+                        format:'0',
+                        allowBlank: true,
+                    };
+                    if (detnoField) {
+                        Ext.apply(me, { columns: [indexColumn].concat(columns) });
+                    }
+                }
+            }]
+        });
+        this.callParent();
+    },
+    listeners:{
+        load:function(f){
+            this.getViewModel().setData({ac_date:Ext.Date.format(new Date(this.getViewModel().data.beginDate),'Y-m-d') + ' --- ' + Ext.Date.format(new Date(this.getViewModel().data.endDate),'Y-m-d')})
+        }
+    }
+});

+ 39 - 0
frontend/saas-web/app/view/sale/b2b/reconciliation/FormPanelController.js

@@ -0,0 +1,39 @@
+Ext.define('saas.view.sale.b2b.reconciliation.FormPanelController', {
+    extend: 'saas.view.core.form.FormPanelController',
+    alias: 'controller.sale-b2b-reconciliation-formpanel',
+    init: function (form) {
+        var me = this;
+        this.control({});
+    },
+    agree:function(){
+        var me = this;
+        var url = '/api/money/apcheck/agree/';
+        me.sendUrl(url)
+    },
+    disagree:function(){
+        var me = this;
+        var url = '/api/money/apcheck/reject/';
+        me.sendUrl(url)
+    },
+    sendUrl:function(url){
+        var me = this;
+        var view = me.getView();
+        var id = me.getViewModel().getData().id;
+        view.setLoading(true);
+        saas.util.BaseUtil.request({
+            url: url + id,
+            params: '',
+            method: 'POST',
+        })
+        .then(function() {
+            view.setLoading(false);
+            //解析参数
+            saas.util.BaseUtil.showSuccessToast('操作成功');
+            me.refresh()
+        })
+        .catch(function(e) {
+            //失败
+            saas.util.BaseUtil.showErrorToast('操作失败: ' + e.message);
+        });
+    }
+});

+ 25 - 0
frontend/saas-web/app/view/sale/b2b/reconciliation/FormPanelModel.js

@@ -0,0 +1,25 @@
+Ext.define('saas.view.sale.b2b.reconciliation.FormPanelModel', {
+    extend: 'saas.view.core.form.FormPanelModel',
+    alias: 'viewmodel.sale-b2b-reconciliation-formpanel',
+
+    data: {
+        id: 0,
+        base: {
+            bindFields: [], // 绑定字段
+            valid: true, // 单据是否合法
+            editable: false, // 单据是否可编辑
+            codeEditable: false, // 单据编号是否可编辑
+        },
+        auditBtnText: '审核', // 审核按钮默认text
+        showAddBtn: false, // 显示新增按钮
+        showSaveBtn: false, // 显示保存按钮
+        showDeleteBtn: false, // 显示删除按钮
+        showCopyBtn: false, // 显示复制按钮
+        showAuditBtn: false, // 显示审核、反审核按钮
+        showPrintBtn: false, // 显示打印按钮
+        configurable: false, // 显示界面设置按钮
+
+        detailBindeFields: [], // 从表绑定列
+        detailStore: null, // 从表store
+    }
+});

+ 14 - 0
frontend/saas-web/overrides/grid/column/CheckColumn.js

@@ -34,6 +34,20 @@ Ext.define('saas.override.grid.column.CheckColumn', {
             cellValues.cellRole = me.disabledCls;
             return '<span style="display: none;" class="'+ me.disabledCls +'"></span>'
         }
+        //hideCheckField   hideCheckVal
+        //根据 某个字段  判断该行的checkbox 是否要隐藏 ,后期可拓展
+        if(e.selModel&&e.selModel.hideCheckField){
+            var field = e.selModel.hideCheckField;
+            var checkVal = e.selModel.hideCheckVal;
+            if(a.get(field)==checkVal){
+                cellValues.style = 'display: none;';
+                cellValues.tdCls += ' ' + me.disabledCls;
+                cellValues.innerCls = me.disabledCls;
+                cellValues.classes.push(me.disabledCls);
+                cellValues.cellRole = me.disabledCls;
+                return '<span style="display: none;" class="'+ me.disabledCls +'"></span>'
+            }
+        }
 
         return '<span class="' + cls + '" role="' + me.checkboxAriaRole + '"' + (!me.ariaStaticRoles[me.checkboxAriaRole] ? ' tabIndex="0"' : '') + '></span>';
     }