Эх сурвалжийг харах

采购模块b2b界面使用basepanel

zhuth 6 жил өмнө
parent
commit
ef18a8e027

+ 2 - 1
frontend/saas-web/app/view/core/base/BasePanel.js

@@ -111,10 +111,11 @@ Ext.define('saas.view.core.base.BasePanel', {
             var item = items[i];
             var field = item.name,
             func = item.getCondition,
+            xtypes = item.getXTypes().split('/'),
             value = item.value,
             condition;
 
-            if(value !== undefined && value !== null && value !== ''){
+            if(me.isContainsAny(xtypes, ['fieldcontainer', 'field']) && !item.ignore){
                 if(typeof func == 'function') {
                     condition = {
                         type: 'condition',

+ 3 - 1
frontend/saas-web/app/view/core/base/GridPanel.js

@@ -12,11 +12,12 @@ Ext.define('saas.view.core.base.GridPanel', {
     requires: [
         'Ext.grid.plugin.Exporter'
     ],
-    plugins: [{
+    basePlugins: [{
         ptype: 'gridexporter',
     }, {
         ptype: 'menuclipboard'
     }],
+    extraPlugins: [],
 
     cls:'core-base-gridpanel',
     
@@ -104,6 +105,7 @@ Ext.define('saas.view.core.base.GridPanel', {
             });
 
             Ext.apply(me, {
+                plugins: Ext.Array.merge(me.basePlugins, me.extraPlugins),
                 dockedItems:[{
                     xtype:'toolbar',
                     dock:'top',

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

@@ -2,459 +2,135 @@
  * 器件查询
  */
 Ext.define('saas.view.purchase.b2b.deviceQuery.DataList', {
-    extend: 'Ext.grid.Panel',
+    extend: 'saas.view.core.base.BasePanel',
     xtype: 'purchase-b2b-devicequery-datalist',
-    controller: 'purchase-b2b-devicequery-datalist',
-    viewModel: 'purchase-b2b-devicequery-datalist',
-    autoScroll: true,
-    style:'padding:0;border:1px solid #fff',
-    layout:'fit',
-    dataUrl:'/api/purchase/purchase/device/list',                 
-    deleteUrl:'/api/commons/number/delete/',
 
-    plugins: [{
-        ptype: 'menuclipboard'
-    }],
-
-    tbar: [{
-        width: 240,
-        name: 'mn_name',
-        xtype: 'textfield',
-        allowBlank:true,
-        emptyText : '请输入型号/物料名称/品牌搜索',
-        enableKeyEvents: true,
-        listeners: {
-            keydown: {
-                fn: function(th, e, eOpts) {
-                    if(e.keyCode == 13) {
-                        var grid = th.up('grid');
-                        grid.condition = grid.getConditions();
-                        grid.store.loadPage(1);
-                    }
-                }
-            }
-        },
-        getCondition:function(v){
-            return v;
-        }
-    },{
-        cls:'x-formpanel-btn-blue',
-        xtype:'button',
-        text:'查询',
-        listeners: {
-            click:function(b){
-                var grid = b.ownerCt.ownerCt;
-                grid.condition = grid.getConditions();
-                grid.store.loadPage(1);
-            }
-        }
-    },'->'],
-
-    columns : [{
-        text : 'id', 
-        width : 0, 
-        dataIndex : 'id', 
-        xtype : 'numbercolumn', 
-        hidden:true
-    },{
-        text : '品牌', 
-        width : 150.0, 
-        dataIndex : 'pr_brand', 
-        xtype : '', 
-        renderer:function(val,metaData,record,x,y,store, view){
-            metaData.tdAttr = 'qclass="x-tip" data-qtip="'
-                                + val + '"';
-            return val;
-        }
-    },{
-        text : '名称', 
-        width : 200.0, 
-        dataIndex : 'pr_detail', 
-        xtype : '', 
-        renderer:function(val,metaData,record,x,y,store, view){
-            metaData.tdAttr = 'qclass="x-tip" data-qtip="'
-                                + val + '"';
-            return val;
-        }
-    },{
-        text : '型号', 
-        width : 200.0, 
-        dataIndex : 'pr_orispeccode', 
-        xtype : '', 
-        renderer:function(val,metaData,record,x,y,store, view){
-            metaData.tdAttr = 'qclass="x-tip" data-qtip="'
-                                + val + '"';
-            return val;
-        }
-    },{
-        text : '规格', 
-        width : 200, 
-        dataIndex : 'pr_spec', 
-        xtype : '', 
-        renderer:function(val,metaData,record,x,y,store, view){
-            metaData.tdAttr = 'qclass="x-tip" data-qtip="'
-                                + val + '"';
-            return val;
-        }
-    },{
-        text : '包装', 
-        width : 100, 
-        dataIndex : 'pr_pack', 
-        xtype : '', 
-        renderer:function(val,metaData,record,x,y,store, view){
-            metaData.tdAttr = 'qclass="x-tip" data-qtip="'
-                                + val + '"';
-            return val;
-        }
-    },{
-        text : '供应商', 
-        width : 150.0, 
-        dataIndex : 'pr_vendor', 
-        xtype : '', 
-        renderer:function(val,metaData,record,x,y,store, view){
-            metaData.tdAttr = 'qclass="x-tip" data-qtip="'
-                                + val + '"';
-            return val;
-        }
-    },{
-        text : '库存', 
-        width : 100, 
-        dataIndex : 'pr_qty', 
-        xtype : 'numbercolumn', 
-        renderer: function(v, m, r) {
-            return saas.util.BaseUtil.numberFormat(v, 0, false);
-        },
-    },{
-        hidden:true,
-        text : '梯度', 
-        width : 100.0, 
-        dataIndex : 'pr_level', 
-        xtype : '', 
-    },{
-        hidden:true,
-        text : '大陆交货单价', 
-        width : 200.0, 
-        dataIndex : 'pr_cnprice', 
-        xtype : '', 
-    },{
-        hidden:true,
-        text : '香港交货单价', 
-        width : 200.0, 
-        dataIndex : 'pr_hkprice', 
-        xtype : '', 
-    },{
-        hidden:true,
-        text : '交期', 
-        width : 200.0, 
-        dataIndex : 'pr_leadtime', 
-        xtype : '', 
-    }, 
-    {
-        dataIndex: '',
-        flex: 1
-    }],
-
-    initComponent: function() {
+    viewName: 'purchase-b2b-devicequery-datalist',
+    dataUrl: '/api/purchase/purchase/device/list',
+    initComponent: function () {
         var me = this;
-        if(me.columns){
-            var fields = me.columns.map(column => column.dataIndex);
-            me.columns = me.insertFirstColumn(me.columns);
-            me.store = Ext.create('Ext.data.Store',{
-                fields:fields,
-                autoLoad: true,
-                pageSize: 15,
+        Ext.apply(this, {
+            searchField: [{
+                width: 240,
+                name: 'keyword',
+                xtype: 'textfield',
+                emptyText: '请输入型号/物料名称/品牌搜索',
+            }],
+
+            gridConfig: {
+                dataUrl: me.dataUrl,
+                actionColumn: [],
+                selModel: {
+                    type: 'cellmodel'
+                },
+                rootProperty: 'data.content',
+                totalProperty: 'data.totalElements',
+                hiddenTools: true,
                 data: [],
-                proxy: {
-                    timeout:8000,
-                    type: 'ajax',
-                    headers:{
-                        'Access-Control-Allow-Origin': '*',
-                        "Content-Type": 'application/json;charset=UTF-8'
-                    },
-                    url: me.dataUrl,
-                    actionMethods: {
-                        read: 'GET'
-                    },
-                    reader: {
-                        type: 'json',
-                        rootProperty: 'data.content',
-                        totalProperty: 'data.totalElements',
+                columns: [{
+                    text: 'id',
+                    width: 0,
+                    dataIndex: 'id',
+                    xtype: 'numbercolumn',
+                    hidden: true
+                }, {
+                    text: '品牌',
+                    width: 150.0,
+                    dataIndex: 'pr_brand',
+                    renderer: function (val, metaData, record, x, y, store, view) {
+                        metaData.tdAttr = 'qclass="x-tip" data-qtip="' +
+                            val + '"';
+                        return val;
                     }
-                },
-                listeners: {
-                    beforeload: function (store, op) {
-                        var condition = me.condition;
-                        if (Ext.isEmpty(condition)) {
-                            condition = '';
-                        }
-                        Ext.apply(store.proxy.extraParams, {
-                            type :'component',
-                            keyword :condition==''?' ':condition[0].value,
-                            page: op._page,
-                            count: store.pageSize,
-                            filter: '',
-                            sorting:''
-                        });
+                }, {
+                    text: '名称',
+                    width: 200.0,
+                    dataIndex: 'pr_detail',
+                    renderer: function (val, metaData, record, x, y, store, view) {
+                        metaData.tdAttr = 'qclass="x-tip" data-qtip="' +
+                            val + '"';
+                        return val;
                     }
-                }
-            });
-
-            Ext.apply(me, {
-                dockedItems:[{
-                    xtype: 'pagingtoolbar',
-                    dock: 'bottom',
-                    displayInfo: true,
-                    store: me.store
-                }]
-            });
-        }
-        me.callParent(arguments);
-    },
-
-    onVastDeal:function(url,type){
-        var form = this.ownerCt;
-        var grid = this;
-        var data = grid.getGridSelected(type);
-        if(!data){
-            saas.util.BaseUtil.showErrorToast('请勾选符合条件的行进行操作。');
-            return false;
-        }
-        if(data&&data.length>0){
-            var params = JSON.stringify({baseDTOs:data});
-            saas.util.BaseUtil.request({
-                    url: url,
-                    params: params,
-                    method: 'POST',
-                    async:false
-                })
-                .then(function() {
-                    saas.util.BaseUtil.showSuccessToast('操作成功');
-                    grid.store.load();
-                })
-                .catch(function(e) {
-                    saas.util.BaseUtil.showErrorToast('操作失败: ' + e.message);
-                });
-        }else{
-            saas.util.BaseUtil.showErrorToast('请勾选至少一条明细。');
-        }
-    },
-
-    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);
-
-            grid.ownerCt.el.dom.style.left = '8px';
-            grid.el.dom.style.padding = '0px'
-        },
-        itemClick: function(view,record,a,index,c) {
-            var classList = c.target.classList.value;
-            var grid = this;
-            if(classList.indexOf('fa-pencil')>-1){
-                var form = this.ownerCt;
-                this.dialog = form.getController().getView().add({
-                    xtype: 'sys-maxnumbers-window',
-                    bind: {
-                        title: '修改单据编码规则'
-                    },
-                    _parent:form,
-                    _combo:this,
-                    record:record,
-                    session: true
-                });
-                this.dialog.show();
-            }else if(classList.indexOf('fa-trash-o')>-1){
-                //删除
-                var id = record.get('id');
-                if(id){
-                    saas.util.BaseUtil.request({
-                        url: grid.deleteUrl+id,
-                        method: 'POST',
-                    })
-                    .then(function(localJson) {
-                        if(localJson.success){
-                            //解析参数
-                            saas.util.BaseUtil.showSuccessToast('删除成功');
-                            view.ownerCt.store.load();
-                        }
-                    })
-                    .catch(function(e) {
-                        saas.util.BaseUtil.showErrorToast('删除失败: ' + e.message);
-                    });
-                }
-            }
-        }
-    },
-
-    insertFirstColumn:function(columns){
-        var me=this;
-        return columns;
-    },
-
-    getGridSelected:function(type){
-        var isErrorSelect = false;
-        var checkField = this.statusCodeField;
-        var me = this,
-        items = me.selModel.getSelection(),
-        data = new Array() ;
-        Ext.each(items, function(item, index){
-            if(!Ext.isEmpty(item.data[me.idField])){
-                var o = new Object();
-                if(me.idField){
-                    o['id'] = item.data[me.idField];
-                }
-                if(me.codeField){
-                    o['code'] = item.data[me.codeField];
-                }
-                if(type&&type==item.data[checkField]){
-                    isErrorSelect = true
-                }
-                data.push(o);
-            }
-        });
-        if(isErrorSelect){
-            return false;
-        }
-		return data;
-    },
-
-    /**
-     * 获得过滤条件
-     */
-    getConditions: function() {
-        var me = this,
-        tbar = me.getDockedItems()[0],
-        items = Ext.Array.filter(tbar.items.items, function(item) {
-            return !!item.name;
-        }),
-        conditions = [];
-        for(var i = 0; i < items.length; i++) {
-            var item = items[i];
-            var field = item.name,
-            func = item.getCondition,
-            value = item.value,
-            condition;
-
-            if(value&&value!=''){
-                if(typeof func == 'function') {
-                    condition = {
-                        type: 'condition',
-                        value: func(value)
+                }, {
+                    text: '型号',
+                    width: 200.0,
+                    dataIndex: 'pr_orispeccode',
+                    renderer: function (val, metaData, record, x, y, store, view) {
+                        metaData.tdAttr = 'qclass="x-tip" data-qtip="' +
+                            val + '"';
+                        return val;
                     }
-                }else {
-                    var type = item.fieldType || me.getDefaultFieldType(item),
-                    operation = item.operation || me.getDefaultFieldOperation(item),
-                    conditionValue = me.getConditionValue(item, value);
-        
-                    if(!conditionValue) {
-                        continue;
+                }, {
+                    text: '规格',
+                    width: 200,
+                    dataIndex: 'pr_spec',
+                    renderer: function (val, metaData, record, x, y, store, view) {
+                        metaData.tdAttr = 'qclass="x-tip" data-qtip="' +
+                            val + '"';
+                        return val;
                     }
-                    condition = {
-                        type: type,
-                        field: field,
-                        operation: operation,
-                        value: conditionValue
+                }, {
+                    text: '包装',
+                    width: 100,
+                    dataIndex: 'pr_pack',
+                    renderer: function (val, metaData, record, x, y, store, view) {
+                        metaData.tdAttr = 'qclass="x-tip" data-qtip="' +
+                            val + '"';
+                        return val;
                     }
-                }
-                conditions.push(condition);
-            }
-        }
-
-        return conditions;
-    },
-
-    /**
-     * 只要arr1和arr2中存在相同项即返回真
-     */
-    isContainsAny: function (arr1, arr2) {
-        for (var i = 0; i < arr2.length; i++) {
-            var a2 = arr2[i];
-            if (!!arr1.find(function (a1) {
-                    return a1 == a2
-                })) {
-                return true;
-            }
-        }
-        return false;
-    },
-
-    getDefaultFieldType: function (field) {
-        var me = this,
-            xtypes = field.getXTypes().split('/'),
-            type;
-
-        if (me.isContainsAny(xtypes, ['numberfield'])) {
-            type = 'number';
-        } else if (me.isContainsAny(xtypes, ['datefield', 'condatefield', 'conmonthfield'])) {
-            type = 'date';
-        } else if (me.isContainsAny(xtypes, ['dbfindtrigger'])) {
-            type = 'enum';
-        } else if (me.isContainsAny(xtypes, ['combobox', 'multicombo', 'combo', 'radiofield', 'radio'])) {
-            type = 'enum';
-        } else {
-            type = 'string';
-        }
-
-        return type;
-    },
-
-    getDefaultFieldOperation: function (field) {
-        var me = this,
-            xtypes = field.getXTypes().split('/'),
-            operation;
-
-        if (me.isContainsAny(xtypes, ['numberfield', 'datefield', 'dbfindtrigger'])) {
-            operation = '=';
-        } else if (me.isContainsAny(xtypes, ['condatefield', 'conmonthfield'])) {
-            operation = 'between';
-        } else if (me.isContainsAny(xtypes, ['multidbfindtrigger', 'combobox', 'multicombo', 'combo'])) {
-            operation = 'in';
-        } else {
-            operation = 'like';
-        }
-
-        return operation;
+                }, {
+                    text: '供应商',
+                    width: 150.0,
+                    dataIndex: 'pr_vendor',
+                    renderer: function (val, metaData, record, x, y, store, view) {
+                        metaData.tdAttr = 'qclass="x-tip" data-qtip="' +
+                            val + '"';
+                        return val;
+                    }
+                }, {
+                    text: '库存',
+                    width: 100,
+                    dataIndex: 'pr_qty',
+                    xtype: 'numbercolumn',
+                    renderer: function (v, m, r) {
+                        return saas.util.BaseUtil.numberFormat(v, 0, false);
+                    },
+                }, {
+                    hidden: true,
+                    text: '梯度',
+                    width: 100.0,
+                    dataIndex: 'pr_level',
+                }, {
+                    hidden: true,
+                    text: '大陆交货单价',
+                    width: 200.0,
+                    dataIndex: 'pr_cnprice',
+                }, {
+                    hidden: true,
+                    text: '香港交货单价',
+                    width: 200.0,
+                    dataIndex: 'pr_hkprice',
+                }, {
+                    hidden: true,
+                    text: '交期',
+                    width: 200.0,
+                    dataIndex: 'pr_leadtime',
+                }]
+            },
+        });
+        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 = value.from,
-                to = value.to;
-
-            conditionValue = Ext.Date.format(new Date(from), 'Y-m-d 00:00:00') + ',' + Ext.Date.format(new Date(to), 'Y-m-d 23:59:59');
-        } 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 obj = {
+            type :'component',
+            keyword: condition.length > 0 ? condition[0].value : ' ',
+            page: op._page,
+            count: store.pageSize,
+            filter: '',
+            sorting:''
+        };
+
+        return obj;
+     },
+});

+ 0 - 10
frontend/saas-web/app/view/purchase/b2b/deviceQuery/DataListController.js

@@ -1,10 +0,0 @@
-Ext.define('saas.view.purchase.b2b.deviceQuery.DataListController', {
-    extend: 'saas.view.core.base.BasePanelController',
-    alias: 'controller.purchase-b2b-devicequery-datalist',
-
-    init: function (form) {
-        var me = this;
-        this.control({
-        });
-    }
-});

+ 0 - 4
frontend/saas-web/app/view/purchase/b2b/deviceQuery/DataListlModel.js

@@ -1,4 +0,0 @@
-Ext.define('saas.view.purchase.b2b.deviceQuery.DataListModel', {
-    extend: 'saas.view.core.base.BasePanelModel',
-    alias: 'viewmodel.purchase-b2b-devicequery-datalist'
-});

+ 379 - 607
frontend/saas-web/app/view/purchase/b2b/quotationList/DataList.js

@@ -2,621 +2,370 @@
  * 询价信息查询
  */
 Ext.define('saas.view.purchase.b2b.quotationList.DataList', {
-    extend: 'Ext.grid.Panel',
+    extend: 'saas.view.core.base.BasePanel',
     xtype: 'purchase-b2b-quotationList-datalist',
-    controller: 'purchase-b2b-quotationList-datalist',
-    viewModel: 'purchase-b2b-quotationList-datalist',
-    autoScroll: true,
-    style:'border:1px solid #fff',
-    cls:'x-quotation-main',
-    layout:'fit',
-    
-    dataUrl:'/api/purchase/purchase/inquiry/list',                 
-    quotationListUrl:'/api/commons/number/delete/',
 
-    plugins: [{
-        ptype: 'menuclipboard'
-    },{
-        ptype: 'rowwidget',
-        setupRowData: function(record, rowIndex, rowValues) {
-            var me = this.rowExpander;
-            me.rowBodyFeature = this;
-            rowValues.rowBodyCls = me.recordsExpanded[record.internalId] ? '' : me.rowBodyHiddenCls;
-            if(record.get('qutations')==null){
-                this.rowExpander.expanderColumn.setWidth(0)
-            }else{
-                this.rowExpander.expanderColumn.setWidth(40)
-            }
-        },
-        widget: {
-            frame:true,
-            cls:'x-quotation-detail',
-            xtype: 'grid',
-            plugins: [{
-                ptype: 'menuclipboard'
+    viewName: 'purchase-b2b-quotationList-datalist',
+    dataUrl: '/api/purchase/purchase/inquiry/list',
+
+    initComponent: function () {
+        var me = this;
+        Ext.apply(this, {
+            searchField: [{
+                columnWidth:0.33,
+                name: 'search',
+                xtype: 'textfield',
+                emptyText : '请输入供应商名称/物料编号/品牌/名称/型号'
+            },{
+                columnWidth:0.33,
+                xtype: 'combobox',
+                name: 'quoted',
+                fieldLabel: '报价状态',
+                allowBlank: true,
+                value:1,
+                editable: false,
+                queryMode: 'local',
+                displayField: 'pi_status',
+                valueField: 'pi_statuscode',
+                store: Ext.create('Ext.data.ArrayStore', {
+                    fields: ['pi_statuscode', 'pi_status'],
+                    data: [
+                        [1, "已报价"],
+                        [0, "未报价"]
+                    ]
+                })
+            },{
+                columnWidth:0.33,
+                xtype: 'combobox',
+                name: 'overdue',
+                fieldLabel: '截止状态',
+                allowBlank: true,
+                value:0,
+                editable: false,
+                queryMode: 'local',
+                displayField: 'pi_status',
+                valueField: 'pi_statuscode',
+                store: Ext.create('Ext.data.ArrayStore', {
+                    fields: ['pi_statuscode', 'pi_status'],
+                    data: [
+                        [1, "已截止"],
+                        [0, "未截止"]
+                    ]
+                })
+            },{
+                columnWidth:0.5,
+                xtype: 'condatefield',
+                name: '_date',
+                fieldLabel: '日期',
+                operation: 'between'
             }],
-            bind: {
-                store: '{record.qutations}'
-            },
-            columns: [{
-                text: '供应商名称',
-                dataIndex: 'vendName',
-                width: 175
-            }, {
-                text: '联系电话',
-                dataIndex: 'tel',
-                width: 265
-            }, {
-                text: '替代型号',
-                dataIndex: 'replaceOrispeccode',
-                width: 100,
-            }, {
-                width: 120,
-                text: '交期',
-                dataIndex: 'leadTime'
-            }, {
-                width: 120,
-                text: '税率',
-                dataIndex: 'taxRate'
-            }, {
-                width: 120,
-                text: '梯度/价格',
-                dataIndex: 'replies',
-                renderer:function(val, meta, record,x,y,store, view){
-                    if(val==null||val==''){
-                        return '<div style="text-align: center;color:#34baf6;">暂无</div>';
-                    }
-                    var id = record.id;
-                    var renderName=this.columns[y].dataIndex;
-                    var grid = view.ownerCt;
-                    var columnId;
-                    Ext.Array.each(grid.columns, function(c, index){
-                        if(c.dataIndex=='replies'){
-                            columnId = c.id
+
+            toolButtons: [{
+                ignore: true,
+                style:'text-align: center;',
+                xtype:'displayfield',
+                value:'<a href=\"javascript:saas.util.BaseUtil.openTab(\'purchase-b2b-sendquotation-datalist\',\'发起询价\',\'maintab-query-sendQuotation\')\">立即询价</a>'
+            }],
+
+            gridConfig: {
+                dataUrl: me.dataUrl,
+                actionColumn: [],
+                selModel: {
+                    type: 'cellmodel'
+                },
+                extraPlugins: [{
+                    ptype: 'rowwidget',
+                    setupRowData: function(record, rowIndex, rowValues) {
+                        var me = this.rowExpander;
+                        me.rowBodyFeature = this;
+                        rowValues.rowBodyCls = me.recordsExpanded[record.internalId] ? '' : me.rowBodyHiddenCls;
+                        if(record.get('qutations')==null){
+                            this.rowExpander.expanderColumn.setWidth(0)
+                        }else{
+                            this.rowExpander.expanderColumn.setWidth(40)
                         }
-                    });
-                    if(!view.tip || view.tip.createFrom != renderName) {
-                        view.tip = Ext.create('Ext.tip.ToolTip', {
-                            target: view.el,
-                            delegate: '.x-grid-cell-'+columnId,
-                            trackMouse: true,
-                            createFrom:renderName,
-                            renderTo: Ext.getBody(),	
-                            maxWidth :830,
-                            layout:'anchor',
-                            listeners: {								          
-                                beforeshow: function updateTipBody(tip) {
-                                    var dg = Ext.getCmp('grid-'+id);
-                                    var rowindex = tip.triggerElement.parentNode.rowIndex;
-                                    var rec = Ext.getCmp(grid.id).getStore().getAt(rowindex);
-                                    dg.store.loadData(rec.get('replies'));
-                                    dg.show();
+                    },
+                    widget: {
+                        frame:true,
+                        cls:'x-quotation-detail',
+                        xtype: 'grid',
+                        plugins: [{
+                            ptype: 'menuclipboard'
+                        }],
+                        bind: {
+                            store: '{record.qutations}'
+                        },
+                        columns: [{
+                            text: '供应商名称',
+                            dataIndex: 'vendName',
+                            width: 175
+                        }, {
+                            text: '联系电话',
+                            dataIndex: 'tel',
+                            width: 265
+                        }, {
+                            text: '替代型号',
+                            dataIndex: 'replaceOrispeccode',
+                            width: 100,
+                        }, {
+                            width: 120,
+                            text: '交期',
+                            dataIndex: 'leadTime'
+                        }, {
+                            width: 120,
+                            text: '税率',
+                            dataIndex: 'taxRate'
+                        }, {
+                            width: 120,
+                            text: '梯度/价格',
+                            dataIndex: 'replies',
+                            renderer:function(val, meta, record,x,y,store, view){
+                                if(val==null||val==''){
+                                    return '<div style="text-align: center;color:#34baf6;">暂无</div>';
                                 }
-                            },
-                            items : [Ext.create('Ext.grid.Panel', {
-                                id: 'grid-'+id,
-                                frame:true,
-                                anchor: '100% 100%',
-                                width:205,
-                                store:[],
-                                columns: [{
-                                    text: '分段数量',
-                                    dataIndex: 'lapQty',
-                                    width: 110,
-                                    renderer:function(v,m,rec){
-                                        return '≥' +v
+                                var id = record.id;
+                                var renderName=this.columns[y].dataIndex;
+                                var grid = view.ownerCt;
+                                var columnId;
+                                Ext.Array.each(grid.columns, function(c, index){
+                                    if(c.dataIndex=='replies'){
+                                        columnId = c.id
                                     }
-                                }, {
-                                    text: '分段价格',
-                                    dataIndex: 'price',
-                                    width: 90
-                                }]
-                            })]
-                        });
-                    }
-                    return '<div style="text-align: center;color:#34baf6;">查看报价信息</div>';
-                }
-            }, {
-                width: 200,
-                text: '操作',
-                dataIndex: 'agreed',
-                renderer:function(val, meta, record,x,y,store, view){
-                    var id = record.get('id');
-                    window.sendMessage = function(id,status,refusereason){
-                        var params = {
-                            id:id,
-                            status:status,
-                            refusereason:refusereason
-                        };
-                        Ext.Ajax.request({  
-                            url : '/api/purchase/purchase/inquiry/deal',
-                            timeout: 8000,  
-                            headers:{
-                                'Access-Control-Allow-Origin': '*',
-                                'Authorization':  saas.util.State.get('session').token,
-                                "Content-Type": 'application/json;charset=UTF-8'
-                            },
-                            method: 'POST',
-                            params:JSON.stringify(params),
-                            success: function(response, o){
-                                var res = Ext.decode(response.responseText);
-                                if(res.success){
-                                    Ext.getCmp('main-tab-panel').getActiveTab().items.items[0].store.loadPage(1);
-                                    saas.util.BaseUtil.showSuccessToast('操作成功');
-                                }else{
-                                    saas.util.BaseUtil.showErrorToast('操作失败:'+res.message);
+                                });
+                                if(!view.tip || view.tip.createFrom != renderName) {
+                                    view.tip = Ext.create('Ext.tip.ToolTip', {
+                                        target: view.el,
+                                        delegate: '.x-grid-cell-'+columnId,
+                                        trackMouse: true,
+                                        createFrom:renderName,
+                                        renderTo: Ext.getBody(),	
+                                        maxWidth :830,
+                                        layout:'anchor',
+                                        listeners: {								          
+                                            beforeshow: function updateTipBody(tip) {
+                                                var dg = Ext.getCmp('grid-'+id);
+                                                var rowindex = tip.triggerElement.parentNode.rowIndex;
+                                                var rec = Ext.getCmp(grid.id).getStore().getAt(rowindex);
+                                                dg.store.loadData(rec.get('replies'));
+                                                dg.show();
+                                            }
+                                        },
+                                        items : [Ext.create('Ext.grid.Panel', {
+                                            id: 'grid-'+id,
+                                            frame:true,
+                                            anchor: '100% 100%',
+                                            width:205,
+                                            store:[],
+                                            columns: [{
+                                                text: '分段数量',
+                                                dataIndex: 'lapQty',
+                                                width: 110,
+                                                renderer:function(v,m,rec){
+                                                    return '≥' +v
+                                                }
+                                            }, {
+                                                text: '分段价格',
+                                                dataIndex: 'price',
+                                                width: 90
+                                            }]
+                                        })]
+                                    });
                                 }
-                            },
-                            failure: function (response, opts) {
-                                saas.util.BaseUtil.showErrorToast('操作失败,请重试');
+                                return '<div style="text-align: center;color:#34baf6;">查看报价信息</div>';
                             }
-                        });
-                    };
-
-                    window.checkPrice = function(status,id){
-                        if(status=='0'){
-                            var panel = view.ownerCt.ownerCmp.ownerCt;
-                            var win = Ext.create('Ext.window.Window', {  
-                                renderTo: panel.getEl(),
-                                cls:'x-window-dbfind', 
-                                height: 100,
-                                width: 450,
-                                modal:true,
-                                title: '提示',
-                                bodyPadding: 10,
-                                constrain: true,
-                                closable: true,
-                                layout: {
-                                    type: 'vbox',
-                                    align: 'center'
-                                },
-                                items:[{
-                                    xtype:'panel',
-                                    layout:'hbox',
-                                    items:[{
-                                        margin:'0 10 0 0',
-                                        labelWidth:60,
-                                        xtype : "textfield", 
-                                        name : "refusereason",
-                                        fieldLabel : "拒绝信息"
-                                    },{
-                                        margin:'0 0 0 5',
-                                        xtype:'button',
-                                        text:'确认',
-                                        handler:function(b){
-                                            var refusereason = b.ownerCt.down('[name=refusereason]').value;
-                                            window.sendMessage(id,status,refusereason);
-                                            b.ownerCt.ownerCt.close();
+                        }, {
+                            width: 200,
+                            text: '操作',
+                            dataIndex: 'agreed',
+                            renderer:function(val, meta, record,x,y,store, view){
+                                var id = record.get('id');
+                                window.sendMessage = function(id,status,refusereason){
+                                    var params = {
+                                        id:id,
+                                        status:status,
+                                        refusereason:refusereason
+                                    };
+                                    Ext.Ajax.request({  
+                                        url : '/api/purchase/purchase/inquiry/deal',
+                                        timeout: 8000,  
+                                        headers:{
+                                            'Access-Control-Allow-Origin': '*',
+                                            'Authorization':  saas.util.State.get('session').token,
+                                            "Content-Type": 'application/json;charset=UTF-8'
+                                        },
+                                        method: 'POST',
+                                        params:JSON.stringify(params),
+                                        success: function(response, o){
+                                            var res = Ext.decode(response.responseText);
+                                            if(res.success){
+                                                Ext.getCmp('main-tab-panel').getActiveTab().items.items[0].store.loadPage(1);
+                                                saas.util.BaseUtil.showSuccessToast('操作成功');
+                                            }else{
+                                                saas.util.BaseUtil.showErrorToast('操作失败:'+res.message);
+                                            }
+                                        },
+                                        failure: function (response, opts) {
+                                            saas.util.BaseUtil.showErrorToast('操作失败,请重试');
                                         }
-                                    }]
-                                }]
-                            });
-                            win.show();
-                        }else if(status=='1'){
-                            window.sendMessage(id,status,'');
-                        }
-                    }
-
-                    window.showRefuse = function(msg){
-                        var panel = view.ownerCt.ownerCmp.ownerCt;
-                        var win = Ext.create('Ext.window.Window', {  
-                            renderTo: panel.getEl(),
-                            cls:'x-window-dbfind', 
-                            height: 100,
-                            width: 450,
-                            modal:true,
-                            title: '查看',
-                            bodyPadding: 10,
-                            constrain: true,
-                            closable: true,
-                            layout: {
-                                type: 'vbox',
-                                align: 'center'
-                            },
-                            items:[{
-                                xtype:'panel',
-                                layout:'hbox',
-                                items:[{
-                                    margin:'0 10 0 0',
-                                    labelWidth:60,
-                                    xtype : "displayfield", 
-                                    name : "refusereason",
-                                    fieldLabel : "拒绝信息",
-                                    value:msg
-                                }]
-                            }]
-                        });
-                        win.show();
-                    }
-                    if((!val||val=='')&&val!=0){
-                        //未采纳状态
-                        return '<div style="width:100%;vertical-align: middle;    text-align: center;">'+
-                                    "<input type='button' value='采纳' name='agree' style='border: 1px solid;color:#34baf6;cursor:pointer;background:#fff;' onClick='window.checkPrice(1,"+id+")'>"+
-                                    "<input type='button' value='拒绝' name='disagree' style='margin:0 0 0 20px;border: 1px solid;color:#ff0000;cursor:pointer;background:#fff;' onClick='window.checkPrice(0,"+id+")'>"+
-                                '</div>';
-                    }else if(val==1||val=='1'){
-                        return '<div style="color:#34baf6;width:100%;vertical-align: middle;    text-align: center;">已采纳</div>'
-                    }else if(val==0||val=='0'){
-                        var refusereason = record.get('refusereason');
-                        if(!refusereason||refusereason==''){
-                            return '<div style="color:#ff6c00;width:100%;vertical-align: middle;    text-align: center;">已拒绝</div>'
-                        }else{
-                            return  '<div style="width:100%;vertical-align: middle; text-align: center;">'+
-                                        "<input type='button' value='查看拒绝理由' name='showRefuse' style='border: 1px solid;color:#ff6c00;cursor:pointer;background:#fff;' onClick='window.showRefuse("+refusereason+")'></input>"+
-                                    '</div>';
-                        }
-                    }
-                }
-            }]
-        }
-    }],
-
-    tbar: [{
-        bodyStyle:'padding:0px 10px 0 0',
-        xtype:'panel',
-        layout:'column',
-        height:75,
-        width:'100%',
-        rbar:{style:'padding:0',items:[{
-            xtype:'button',
-            cls:'x-formpanel-btn-blue',
-            text:'查询',
-            listeners: {
-                click:function(b){
-                    var grid = b.ownerCt.ownerCt.ownerCt.ownerCt;
-                    grid.condition = grid.getConditions();
-                    grid.store.loadPage(1);
-                }
-            }
-        },{
-            style:'text-align: center;',
-            xtype:'displayfield',
-            value:'<a href=\"javascript:saas.util.BaseUtil.openTab(\'purchase-sendQuotation-datalist\',\'发起询价\',\'maintab-query-sendQuotation\')\">立即询价</a>'
-        }]},
-        items:[{
-            columnWidth:0.33,
-            name: 'search',
-            xtype: 'textfield',
-            emptyText : '请输入供应商名称/物料编号/品牌/名称/型号',
-            enableKeyEvents: true,
-            getCondition: function (value) {
-                return value;
-            },
-            listeners: {
-                keydown: {
-                    fn: function(th, e, eOpts) {
-                        if(e.keyCode == 13) {
-                            var grid = th.up('grid');
-                            grid.condition = grid.getConditions();
-                            grid.store.loadPage(1);
-                        }
-                    }
-                }
-            }
-        },{
-            columnWidth:0.33,
-            xtype: 'combobox',
-            name: 'quoted',
-            fieldLabel: '报价状态',
-            allowBlank: true,
-            value:1,
-            editable: false,
-            queryMode: 'local',
-            displayField: 'pi_status',
-            valueField: 'pi_statuscode',
-            store: Ext.create('Ext.data.ArrayStore', {
-                fields: ['pi_statuscode', 'pi_status'],
-                data: [
-                    [1, "已报价"],
-                    [0, "未报价"]
-                ]
-            }),
-            getCondition: function (value) {
-                return null
-            }
-        },{
-            columnWidth:0.33,
-            xtype: 'combobox',
-            name: 'overdue',
-            fieldLabel: '截止状态',
-            allowBlank: true,
-            value:0,
-            editable: false,
-            queryMode: 'local',
-            displayField: 'pi_status',
-            valueField: 'pi_statuscode',
-            store: Ext.create('Ext.data.ArrayStore', {
-                fields: ['pi_statuscode', 'pi_status'],
-                data: [
-                    [1, "已截止"],
-                    [0, "未截止"]
-                ]
-            }),
-            getCondition: function (value) {
-                return null
-            }
-        },{
-            margin:'10px 0 0 0',
-            columnWidth:0.5,
-            xtype: 'condatefield',
-            name: '_date',
-            fieldLabel: '日期',
-            operation: 'between'
-        }]
-    }],
-
-    columns : [{
-        text : 'id', 
-        width : 0, 
-        dataIndex : 'id', 
-        xtype : 'numbercolumn', 
-        hidden:true
-    },{
-        text : '物料编号', 
-        width : 200.0, 
-        dataIndex : 'prodCode', 
-        xtype : '', 
-    }, 
-    {
-        text : '品牌', 
-        dataIndex : 'prodBrand', 
-        width : 110.0, 
-        xtype : '', 
-    }, 
-    {
-        text : '名称', 
-        dataIndex : 'prodName', 
-        width : 150.0
-    },{
-        text : '型号', 
-        dataIndex : 'prodOrispeccode',
-        width : 110.0
-    },{
-        text : '规格', 
-        dataIndex : 'prodSpec',
-        width : 110.0
-    },{
-        text : '单位', 
-        dataIndex : 'prodUnit',
-        width : 110.0
-    },{
-        text : '发起时间', 
-        dataIndex : 'startDate',
-        width : 160.0
-    },{
-        text : '截止日期', 
-        dataIndex : 'endDate',
-        width : 160.0
-    },{
-        text : '报价状态', 
-        dataIndex : 'qutations',
-        width : 110.0,
-        renderer:function(val, meta, record,x,y,store, view){
-            if(!val||val==0||val.length==0){
-                return '否'
-            }else{
-                return '是'
-            }
-        }
-    }, {
-        dataIndex: '',
-        flex: 1
-    }],
-
-
-    dbSearchFields: [],
-    condition:'',
-
-    initComponent: function() {
-        var me = this;
-        if(me.columns){
-            var fields = me.columns.map(column => column.dataIndex);
-            me.store = Ext.create('Ext.data.Store',{
-                fields:fields,
-                autoLoad: true,
-                pageSize: 15,
-                proxy: {
-                    timeout:8000,
-                    type: 'ajax',
-                    headers:{
-                        'Access-Control-Allow-Origin': '*',
-                        "Content-Type": 'application/json;charset=UTF-8'
-                    },
-                    url: me.dataUrl,
-                    actionMethods: {
-                        read: 'GET'
-                    },
-                    reader: {
-                        type: 'json',
-                        rootProperty: 'data.content',
-                        totalProperty: 'data.totalElements',
+                                    });
+                                };
+            
+                                window.checkPrice = function(status,id){
+                                    if(status=='0'){
+                                        var panel = view.ownerCt.ownerCmp.ownerCt;
+                                        var win = Ext.create('Ext.window.Window', {  
+                                            renderTo: panel.getEl(),
+                                            cls:'x-window-dbfind', 
+                                            height: 100,
+                                            width: 450,
+                                            modal:true,
+                                            title: '提示',
+                                            bodyPadding: 10,
+                                            constrain: true,
+                                            closable: true,
+                                            layout: {
+                                                type: 'vbox',
+                                                align: 'center'
+                                            },
+                                            items:[{
+                                                xtype:'panel',
+                                                layout:'hbox',
+                                                items:[{
+                                                    margin:'0 10 0 0',
+                                                    labelWidth:60,
+                                                    xtype : "textfield", 
+                                                    name : "refusereason",
+                                                    fieldLabel : "拒绝信息"
+                                                },{
+                                                    margin:'0 0 0 5',
+                                                    xtype:'button',
+                                                    text:'确认',
+                                                    handler:function(b){
+                                                        var refusereason = b.ownerCt.down('[name=refusereason]').value;
+                                                        window.sendMessage(id,status,refusereason);
+                                                        b.ownerCt.ownerCt.close();
+                                                    }
+                                                }]
+                                            }]
+                                        });
+                                        win.show();
+                                    }else if(status=='1'){
+                                        window.sendMessage(id,status,'');
+                                    }
+                                }
+            
+                                window.showRefuse = function(msg){
+                                    var panel = view.ownerCt.ownerCmp.ownerCt;
+                                    var win = Ext.create('Ext.window.Window', {  
+                                        renderTo: panel.getEl(),
+                                        cls:'x-window-dbfind', 
+                                        height: 100,
+                                        width: 450,
+                                        modal:true,
+                                        title: '查看',
+                                        bodyPadding: 10,
+                                        constrain: true,
+                                        closable: true,
+                                        layout: {
+                                            type: 'vbox',
+                                            align: 'center'
+                                        },
+                                        items:[{
+                                            xtype:'panel',
+                                            layout:'hbox',
+                                            items:[{
+                                                margin:'0 10 0 0',
+                                                labelWidth:60,
+                                                xtype : "displayfield", 
+                                                name : "refusereason",
+                                                fieldLabel : "拒绝信息",
+                                                value:msg
+                                            }]
+                                        }]
+                                    });
+                                    win.show();
+                                }
+                                if((!val||val=='')&&val!=0){
+                                    //未采纳状态
+                                    return '<div style="width:100%;vertical-align: middle;    text-align: center;">'+
+                                                "<input type='button' value='采纳' name='agree' style='border: 1px solid;color:#34baf6;cursor:pointer;background:#fff;' onClick='window.checkPrice(1,"+id+")'>"+
+                                                "<input type='button' value='拒绝' name='disagree' style='margin:0 0 0 20px;border: 1px solid;color:#ff0000;cursor:pointer;background:#fff;' onClick='window.checkPrice(0,"+id+")'>"+
+                                            '</div>';
+                                }else if(val==1||val=='1'){
+                                    return '<div style="color:#34baf6;width:100%;vertical-align: middle;    text-align: center;">已采纳</div>'
+                                }else if(val==0||val=='0'){
+                                    var refusereason = record.get('refusereason');
+                                    if(!refusereason||refusereason==''){
+                                        return '<div style="color:#ff6c00;width:100%;vertical-align: middle;    text-align: center;">已拒绝</div>'
+                                    }else{
+                                        return  '<div style="width:100%;vertical-align: middle; text-align: center;">'+
+                                                    "<input type='button' value='查看拒绝理由' name='showRefuse' style='border: 1px solid;color:#ff6c00;cursor:pointer;background:#fff;' onClick='window.showRefuse("+refusereason+")'></input>"+
+                                                '</div>';
+                                    }
+                                }
+                            }
+                        }]
                     }
-                },
-                listeners: {
-                    beforeload: function (store, op) {
-                        var date = Ext.ComponentQuery.query('[name=_date]')[0];
-                        var from = date.value.from || '';
-                        if(!Ext.isDate(from)){
-                            from = new Date(from);
-                            from = from.getTime()
+                }],
+                rootProperty: 'data.content',
+                totalProperty: 'data.totalElements',
+                hiddenTools: true,
+                data: [],
+                columns: [{
+                    text : 'id', 
+                    width : 0, 
+                    dataIndex : 'id', 
+                    xtype : 'numbercolumn', 
+                    hidden:true
+                },{
+                    text : '物料编号', 
+                    width : 200.0, 
+                    dataIndex : 'prodCode', 
+                    xtype : '', 
+                }, {
+                    text : '品牌', 
+                    dataIndex : 'prodBrand', 
+                    width : 110.0, 
+                    xtype : '', 
+                }, {
+                    text : '名称', 
+                    dataIndex : 'prodName', 
+                    width : 150.0
+                },{
+                    text : '型号', 
+                    dataIndex : 'prodOrispeccode',
+                    width : 110.0
+                },{
+                    text : '规格', 
+                    dataIndex : 'prodSpec',
+                    width : 110.0
+                },{
+                    text : '单位', 
+                    dataIndex : 'prodUnit',
+                    width : 110.0
+                },{
+                    text : '发起时间', 
+                    dataIndex : 'startDate',
+                    width : 160.0
+                },{
+                    text : '截止日期', 
+                    dataIndex : 'endDate',
+                    width : 160.0
+                },{
+                    text : '报价状态', 
+                    dataIndex : 'qutations',
+                    width : 110.0,
+                    renderer:function(val, meta, record,x,y,store, view){
+                        if(!val||val==0||val.length==0){
+                            return '否'
                         }else{
-                            from = date.value.from.getTime()
+                            return '是'
                         }
-                        var to = date.value.to || '';
-                        if(!Ext.isDate(to)){
-                            to = new Date(to);
-                            to = to.getTime()
-                        }else{
-                            to = date.value.to.getTime()
-                        }
-                        var search = Ext.ComponentQuery.query('[name=search]')[0].value;
-                        var quoted = Ext.ComponentQuery.query('[name=quoted]')[0].value;
-                        var overdue = Ext.ComponentQuery.query('[name=overdue]')[0].value;
-                        Ext.apply(store.proxy.extraParams, {
-                            keyword :search,//search==''?' ':search,
-                            pageNumber: op._page,
-                            pageSize: store.pageSize,
-                            quoted:quoted,
-                            fromDate:from,
-                            endDate:to,
-                            overdue:overdue
-                        });
                     }
-                }
-            });
-
-            Ext.apply(me, {
-                dockedItems:[{
-                    xtype: '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 / 33);
-
-            store.setPageSize(pageSize);
-
-            grid.ownerCt.el.dom.style.left = '8px';
-            grid.el.dom.style.padding = '0px'
-        },
-        itemClick: function(view,record,a,index,c) {
-        }
-    },
-
-    getGridSelected:function(type){
-        var isErrorSelect = false;
-        var checkField = this.statusCodeField;
-        var me = this,
-        items = me.selModel.getSelection(),
-        data = new Array() ;
-        Ext.each(items, function(item, index){
-            if(!Ext.isEmpty(item.data[me.idField])){
-                var o = new Object();
-                if(me.idField){
-                    o['id'] = item.data[me.idField];
-                }
-                if(me.codeField){
-                    o['code'] = item.data[me.codeField];
-                }
-                if(type&&type==item.data[checkField]){
-                    isErrorSelect = true
-                }
-                data.push(o);
-            }
+            },
         });
-        if(isErrorSelect){
-            return false;
-        }
-		return data;
-    },
-
-    /**
-     * 获得过滤条件
-     */
-    getConditions: function() {
-        var me = this,
-        tbar = me.getDockedItems()[0],
-        items = Ext.Array.filter(tbar.items.items, function(item) {
-            return !!item.name;
-        }),
-        conditions = [];
-        for(var i = 0; i < items.length; i++) {
-            var item = items[i];
-            var field = item.name,
-            func = item.getCondition,
-            value = item.value,
-            condition;
-
-            if(value&&value!=''){
-                if(typeof func == 'function') {
-                    condition = {
-                        type: 'condition',
-                        value: func(value)
-                    }
-                }else {
-                    var type = item.fieldType || me.getDefaultFieldType(item),
-                    operation = item.operation || me.getDefaultFieldOperation(item),
-                    conditionValue = me.getConditionValue(item, value);
-        
-                    if(!conditionValue) {
-                        continue;
-                    }
-                    condition = {
-                        type: type,
-                        field: field,
-                        operation: operation,
-                        value: conditionValue
-                    }
-                }
-                conditions.push(condition);
-            }
-        }
-
-        return conditions;
-    },
-
-    /**
-     * 只要arr1和arr2中存在相同项即返回真
-     */
-    isContainsAny: function (arr1, arr2) {
-        for (var i = 0; i < arr2.length; i++) {
-            var a2 = arr2[i];
-            if (!!arr1.find(function (a1) {
-                    return a1 == a2
-                })) {
-                return true;
-            }
-        }
-        return false;
-    },
-
-    getDefaultFieldType: function (field) {
-        var me = this,
-            xtypes = field.getXTypes().split('/'),
-            type;
-
-        if (me.isContainsAny(xtypes, ['numberfield'])) {
-            type = 'number';
-        } else if (me.isContainsAny(xtypes, ['datefield', 'condatefield', 'conmonthfield'])) {
-            type = 'date';
-        } else if (me.isContainsAny(xtypes, ['dbfindtrigger'])) {
-            type = 'enum';
-        } else if (me.isContainsAny(xtypes, ['combobox', 'multicombo', 'combo', 'radiofield', 'radio'])) {
-            type = 'enum';
-        } else {
-            type = 'string';
-        }
-
-        return type;
-    },
-
-    getDefaultFieldOperation: function (field) {
-        var me = this,
-            xtypes = field.getXTypes().split('/'),
-            operation;
-
-        if (me.isContainsAny(xtypes, ['numberfield', 'datefield', 'dbfindtrigger'])) {
-            operation = '=';
-        } else if (me.isContainsAny(xtypes, ['condatefield', 'conmonthfield'])) {
-            operation = 'between';
-        } else if (me.isContainsAny(xtypes, ['multidbfindtrigger', 'combobox', 'multicombo', 'combo'])) {
-            operation = 'in';
-        } else {
-            operation = 'like';
-        }
-
-        return operation;
+        this.callParent(arguments);
     },
 
     /**
@@ -634,25 +383,48 @@ Ext.define('saas.view.purchase.b2b.quotationList.DataList', {
 
             conditionValue = from + ',' + to;
         } else if (me.isContainsAny(xtypes, ['condatefield'])) {
-            var from = value.from,
-                to = value.to;
+            var from = new Date(value.from).getTime(),
+                to = new Date(value.to).getTime();
 
-            conditionValue = Ext.Date.format(new Date(from), 'Y-m-d 00:00:00') + ',' + Ext.Date.format(new Date(to), 'Y-m-d 23:59:59');
+            conditionValue = {
+                from: from,
+                to: to
+            };
         } else if (me.isContainsAny(xtypes, ['dbfindtrigger'])) {
             conditionValue = value;
         } else if (me.isContainsAny(xtypes, ['combobox', 'combo'])) {
-            conditionValue = '\'' + value + '\'';
+            conditionValue = value;
         } else if (me.isContainsAny(xtypes, ['multicombo'])) {
             conditionValue = value.map ? value.map(function (v) {
-                return '\'' + v.value + '\'';
+                return v.value;
             }).join(',') : '';
         } else {
             conditionValue = value;
         }
 
         return conditionValue;
-    }
+    },
 
-})
+    getExtraParams: function(store, op, condition) {
+        var obj = {
+            keyword: ' ',
+            pageNumber: op._page,
+            pageSize: store.pageSize,
+        };
+
+        for(var i = 0; i < condition.length; i++) {
+            var con = condition[i];
+            if(con.type == 'enum') {
+                obj[con.field] = con.value;
+            }else if(con.type == 'date') {
+                obj.fromDate = con.value.from;
+                obj.endDate = con.value.to;
+            }else {
+                obj.keyword = con.value
+            }
+        }
 
+        return obj;
+     },
+});
 

+ 0 - 5
frontend/saas-web/app/view/purchase/b2b/quotationList/DataListController.js

@@ -1,5 +0,0 @@
-Ext.define('saas.view.purchase.b2b.quotationList.DataListController', {
-    extend: 'saas.view.core.base.BasePanelController',
-    alias: 'controller.purchase-b2b-quotationList-datalist',
-
-});

+ 0 - 4
frontend/saas-web/app/view/purchase/b2b/quotationList/DataListlModel.js

@@ -1,4 +0,0 @@
-Ext.define('saas.view.purchase.b2b.quotationList.DataListModel', {
-    extend: 'saas.view.core.base.BasePanelModel',
-    alias: 'viewmodel.purchase-b2b-quotationList-datalist'
-});

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

@@ -2,378 +2,119 @@
  * 平台对账单
  */
 Ext.define('saas.view.purchase.b2b.reconciliation.DataList', {
-    extend: 'Ext.grid.Panel',
+    extend: 'saas.view.core.base.BasePanel',
     xtype: 'purchase-b2b-reconciliation-datalist',
-    controller: 'purchase-b2b-reconciliation-datalist',
-    viewModel: 'purchase-b2b-reconciliation-datalist',
-    autoScroll: true,
-    frame:true,
-    layout:'fit',
-    dataUrl:'/api/money/apcheck/list',   
-    
-    plugins: [{
-        ptype: 'cellediting',
-        clicksToEdit: 1
-    }, {
-        ptype: 'menuclipboard'
-    }],
 
-    tbar: [{
-        width: 280,
-        name: 'ac_vendname',
-        xtype: 'textfield',
-        emptyText : '请输入供应商名称',
-        enableKeyEvents: true,
-        listeners: {
-            keydown: {
-                fn: function(th, e, eOpts) {
-                    if(e.keyCode == 13) {
-                        var grid = th.up('grid');
-                        grid.condition = grid.getConditions();
-                        grid.store.loadPage(1);
-                    }
-                }
-            }
-        }
-    },{
-        columnWidth:0.5,
-        xtype: 'condatefield',
-        name: 'ac_date',
-        fieldLabel: '日期',
-        operation: 'between'
-    },'->',{
-        xtype:'button',
-        text:'查询',
-        listeners: {
-            click:function(b){
-                var grid = b.ownerCt.ownerCt;
-                grid.condition = grid.getConditions();
-                grid.store.loadPage(1);
-            }
-        }
-    }],
-
-    columns : [{
-        text : '对账单编号', 
-        width:150,
-        dataIndex : 'ac_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>';
-        }
-    },{
-        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 : 'ac_vendname', 
-        width:110
-    },{
-        text : '币别', 
-        width : 90.0, 
-        dataIndex : 'ac_currency', 
-    },{
-        text : '本期应付', 
-        dataIndex : 'ac_thisamount',
-        xtype:'numbercolumn', 
-        width : 110.0,
-    },{
-        text : '本期发货', 
-        dataIndex : 'ac_thissend',
-        xtype:'numbercolumn',
-        width : 110.0,
-    },{
-        text : '本期未对账', 
-        dataIndex : 'ac_thisuncheck', 
-        xtype:'numbercolumn',
-        width : 110.0,
-    },{
-        text : '本期已对账', 
-        dataIndex : 'ac_thischeck', 
-        xtype:'numbercolumn',
-        width : 110.0,
-    },{
-        text : '本期已付', 
-        dataIndex : 'ac_thispay', 
-        xtype:'numbercolumn',
-        width : 110.0,
-    },{
-        text : '应付金额', 
-        dataIndex : 'ac_payamont', 
-        xtype:'numbercolumn',
-        width : 110.0,
-    }],
-
-    dbSearchFields: [],
-    condition:'',
-
-    initComponent: function() {
+    viewName: 'purchase-b2b-reconciliation-datalist',
+    dataUrl: '/api/money/apcheck/list',
+    initComponent: function () {
         var me = this;
-        if(me.columns){
-            var fields = me.columns.map(column => column.dataIndex);
-            me.store = Ext.create('Ext.data.Store',{
-                fields:fields,
-                autoLoad: true,
-                pageSize: 11,
-                data: [],
-                proxy: {
-                    timeout:8000,
-                    type: 'ajax',
-                    url: me.dataUrl,
-                    actionMethods: {
-                        read: 'GET'
-                    },
-                    reader: {
-                        type: 'json',
-                        rootProperty: 'data.list',
-                        totalProperty: 'data.total',
+        Ext.apply(this, {
+            searchField: [{
+                width: 240,
+                name: 'ac_vendname',
+                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.totalElements',
+                hiddenTools: true,
+                data: [{}],
+                columns: [{
+                    text : '对账单编号', 
+                    width:150,
+                    dataIndex : 'ac_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: {
-                        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{
-                                    if(proxy.showPowerMessage){
-                                        saas.util.BaseUtil.showErrorToast('查询失败:' + (response.responseJson?response.responseJson.message:'请求超时'));
-                                    }
-                                }
-                            }
-                        }
-                    }
-                },
-                listeners: {
-                    beforeload: function (store, op) {
-                        var condition = me.condition;
-                        if (Ext.isEmpty(condition)) {
-                            condition = [];
+                        click: function(tableView, td, row, col, e, record, tr) {
+                            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, {
+                                initId: idValue
+                            });
                         }
-                        Ext.apply(store.proxy.extraParams, {
-                            number: op._page,
-                            size: store.pageSize,
-                            condition: JSON.stringify(condition)
-                        });
                     }
-                }
-            });
-
-            Ext.apply(me, {
-                dockedItems:[{
-                    xtype: 'pagingtoolbar',
-                    dock: 'bottom',
-                    displayInfo: true,
-                    store: me.store
+                },{
+                    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 : 'ac_vendname', 
+                    width:110
+                },{
+                    text : '币别', 
+                    width : 90.0, 
+                    dataIndex : 'ac_currency', 
+                },{
+                    text : '本期应付', 
+                    dataIndex : 'ac_thisamount',
+                    xtype:'numbercolumn', 
+                    width : 110.0,
+                },{
+                    text : '本期发货', 
+                    dataIndex : 'ac_thissend',
+                    xtype:'numbercolumn',
+                    width : 110.0,
+                },{
+                    text : '本期未对账', 
+                    dataIndex : 'ac_thisuncheck', 
+                    xtype:'numbercolumn',
+                    width : 110.0,
+                },{
+                    text : '本期已对账', 
+                    dataIndex : 'ac_thischeck', 
+                    xtype:'numbercolumn',
+                    width : 110.0,
+                },{
+                    text : '本期已付', 
+                    dataIndex : 'ac_thispay', 
+                    xtype:'numbercolumn',
+                    width : 110.0,
+                },{
+                    text : '应付金额', 
+                    dataIndex : 'ac_payamont', 
+                    xtype:'numbercolumn',
+                    width : 110.0,
                 }]
-            });
-        }
-        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);
-            grid.ownerCt.el.dom.style.left = '8px';
-            grid.el.dom.style.padding = '0px'
-        },
-        itemClick: function(tableView, record, item, index, e, eOpts) {
-            if(e.target.classList.contains('x-query-link')) {
-                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, {
-                    initId: idValue
-                });
-            }
-        },
-    },
-
-    getGridSelected:function(type){
-        var isErrorSelect = false;
-        var checkField = this.statusCodeField;
-        var me = this,
-        items = me.selModel.getSelection(),
-        data = new Array() ;
-        Ext.each(items, function(item, index){
-            if(!Ext.isEmpty(item.data[me.idField])){
-                var o = new Object();
-                if(me.idField){
-                    o['id'] = item.data[me.idField];
-                }
-                if(me.codeField){
-                    o['code'] = item.data[me.codeField];
-                }
-                if(type&&type==item.data[checkField]){
-                    isErrorSelect = true
-                }
-                data.push(o);
-            }
+            },
         });
-        if(isErrorSelect){
-            return false;
-        }
-		return data;
-    },
-
-    /**
-     * 获得过滤条件
-     */
-    getConditions: function() {
-        var me = this,
-        tbar = me.getDockedItems()[0],
-        items = Ext.Array.filter(tbar.items.items, function(item) {
-            return !!item.name;
-        }),
-        conditions = [];
-        for(var i = 0; i < items.length; i++) {
-            var item = items[i];
-            var field = item.name,
-            func = item.getCondition,
-            value = item.value,
-            condition;
-
-            if(value&&value!=''){
-                if(typeof func == 'function') {
-                    condition = {
-                        type: 'condition',
-                        value: func(value)
-                    }
-                }else {
-                    var type = item.fieldType || me.getDefaultFieldType(item),
-                    operation = item.operation || me.getDefaultFieldOperation(item),
-                    conditionValue = me.getConditionValue(item, value);
-        
-                    if(!conditionValue) {
-                        continue;
-                    }
-                    condition = {
-                        type: type,
-                        field: field,
-                        operation: operation,
-                        value: conditionValue
-                    }
-                }
-                conditions.push(condition);
-            }
-        }
-
-        return conditions;
-    },
-
-    /**
-     * 只要arr1和arr2中存在相同项即返回真
-     */
-    isContainsAny: function (arr1, arr2) {
-        for (var i = 0; i < arr2.length; i++) {
-            var a2 = arr2[i];
-            if (!!arr1.find(function (a1) {
-                    return a1 == a2
-                })) {
-                return true;
-            }
-        }
-        return false;
-    },
-
-    getDefaultFieldType: function (field) {
-        var me = this,
-            xtypes = field.getXTypes().split('/'),
-            type;
-
-        if (me.isContainsAny(xtypes, ['numberfield'])) {
-            type = 'number';
-        } else if (me.isContainsAny(xtypes, ['datefield', 'condatefield', 'conmonthfield'])) {
-            type = 'date';
-        } else if (me.isContainsAny(xtypes, ['dbfindtrigger'])) {
-            type = 'enum';
-        } else if (me.isContainsAny(xtypes, ['combobox', 'multicombo', 'combo', 'radiofield', 'radio'])) {
-            type = 'enum';
-        } else {
-            type = 'string';
-        }
-
-        return type;
-    },
-
-    getDefaultFieldOperation: function (field) {
-        var me = this,
-            xtypes = field.getXTypes().split('/'),
-            operation;
-
-        if (me.isContainsAny(xtypes, ['numberfield', 'datefield', 'dbfindtrigger'])) {
-            operation = '=';
-        } else if (me.isContainsAny(xtypes, ['condatefield', 'conmonthfield'])) {
-            operation = 'between';
-        } else if (me.isContainsAny(xtypes, ['multidbfindtrigger', 'combobox', 'multicombo', 'combo'])) {
-            operation = 'in';
-        } else {
-            operation = 'like';
-        }
-
-        return operation;
-    },
-
-    /**
-     * 处理部分字段值
-     */
-    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 = value.from,
-                to = value.to;
-
-            conditionValue = Ext.Date.format(new Date(from), 'Y-m-d 00:00:00') + ',' + Ext.Date.format(new Date(to), 'Y-m-d 23:59:59');
-        } 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;
+        this.callParent(arguments);
     }
-
-})
-
+});
 

+ 0 - 9
frontend/saas-web/app/view/purchase/b2b/reconciliation/DataListController.js

@@ -1,9 +0,0 @@
-Ext.define('saas.view.purchase.b2b.reconciliation.DataListController', {
-    extend: 'saas.view.core.base.BasePanelController',
-    alias: 'controller.purchase-b2b-reconciliation-datalist',
-
-    onRefresh:function(){
-        var me = this;
-        me.view.items.items[0].store.load();
-    },
-});

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

@@ -1,4 +0,0 @@
-Ext.define('saas.view.purchase.b2b.reconciliation.DataListModel', {
-    extend: 'saas.view.core.base.BasePanelModel',
-    alias: 'viewmodel.purchase-b2b-reconciliation-datalist'
-});

+ 50 - 50
frontend/saas-web/app/view/sale/b2b/Business.js

@@ -12,14 +12,14 @@ Ext.define('saas.view.sale.b2b.Business', {
 
     // dataUrl: 'http://10.1.80.23:8560/api/sale/sale/enterprise/businessChance',
     dataUrl: '/api/sale/sale/enterprise/businessChance',
-    initComponent: function() {
+    initComponent: function () {
         var me = this;
         Ext.apply(this, {
             searchField: [{
                 xtype: 'textfield',
                 name: 'keyword',
                 columnWidth: 0.2,
-                emptyText:'物料编号/名称/型号/品牌'
+                emptyText: '物料编号/名称/型号/品牌'
             }, {
                 xtype: 'condatefield',
                 name: 'date',
@@ -33,9 +33,9 @@ Ext.define('saas.view.sale.b2b.Business', {
                 queryMode: 'local',
                 displayField: 'name',
                 valueField: 'value',
-                emptyText :'未报价',
+                emptyText: '未报价',
                 value: '0',
-                editable:false,
+                editable: false,
                 labelWidth: 80,
                 columnWidth: 0.2,
                 store: Ext.create('Ext.data.ArrayStore', {
@@ -45,26 +45,26 @@ Ext.define('saas.view.sale.b2b.Business', {
                         ["已报价", "1"]
                     ]
                 })
-            // }, {
-            //     xtype: 'combobox',
-            //     name: 'closed',
-            //     fieldLabel: '截止状态',
-            //     queryMode: 'local',
-            //     displayField: 'name',
-            //     valueField: 'value',
-            //     emptyText :'全部',
-            //     editable:false,
-            //     columnWidth: 0.2,
-            //     store: Ext.create('Ext.data.ArrayStore', {
-            //         fields: ['name', 'value'],
-            //         data: [
-            //             ["全部", "all"],
-            //             ["未截止", "0"],
-            //             ["已截止", "1"]
-            //         ]
-            //     })
+                // }, {
+                //     xtype: 'combobox',
+                //     name: 'closed',
+                //     fieldLabel: '截止状态',
+                //     queryMode: 'local',
+                //     displayField: 'name',
+                //     valueField: 'value',
+                //     emptyText :'全部',
+                //     editable:false,
+                //     columnWidth: 0.2,
+                //     store: Ext.create('Ext.data.ArrayStore', {
+                //         fields: ['name', 'value'],
+                //         data: [
+                //             ["全部", "all"],
+                //             ["未截止", "0"],
+                //             ["已截止", "1"]
+                //         ]
+                //     })
             }],
-        
+
             caller: null,
             _formXtype: null,
             _title: null,
@@ -72,7 +72,7 @@ Ext.define('saas.view.sale.b2b.Business', {
             _batchOpenUrl: null,
             _batchCloseUrl: null,
             _batchDeleteUrl: null,
-        
+
             gridConfig: {
                 idField: null,
                 codeField: null,
@@ -89,7 +89,7 @@ Ext.define('saas.view.sale.b2b.Business', {
                 data: [{
 
                 }],
-                columns : [{
+                columns: [{
                     text: '客户名称',
                     dataIndex: 'custName',
                     width: 200
@@ -135,16 +135,16 @@ Ext.define('saas.view.sale.b2b.Business', {
                     text: '报价状态',
                     dataIndex: 'quoted',
                     textAlign: 'center',
-                    renderer:function(val, meta, record,x,y,store, view){
-                        if(val == 0) {
+                    renderer: function (val, meta, record, x, y, store, view) {
+                        if (val == 0) {
                             return '<div style="text-align: center;color: #35BAF6;">未报价</div>';
-                        }else {
+                        } else {
                             var qutations = record.data.qutations;
-                            if(qutations.agreed == null) {
+                            if (qutations.agreed == null) {
                                 return '<div style="text-align: center;color: #FBBC05;">已报价</div>';
-                            }else if(qutations.agreed == 1){
+                            } else if (qutations.agreed == 1) {
                                 return '<div style="text-align: center;color: green;">被采纳</div>';
-                            }else if(qutations.agreed == 0) {
+                            } else if (qutations.agreed == 0) {
                                 return '<div style="text-align: center;color:#ff6c00;">被拒绝</div>';
                             }
                         }
@@ -152,22 +152,22 @@ Ext.define('saas.view.sale.b2b.Business', {
                 }, {
                     text: '操作',
                     dataIndex: 'quoted',
-                    renderer:function(val, meta, record,x,y,store, view){
-                        if(val == 0) {
+                    renderer: function (val, meta, record, x, y, store, view) {
+                        if (val == 0) {
                             return '<div style="text-align: center;color: #35BAF6;cursor: pointer;">点击报价</div>';
-                        }else {
+                        } else {
                             var qutations = record.data.qutations;
-                            if(qutations.agreed == null) {
+                            if (qutations.agreed == null) {
                                 return '<div style="text-align: center;color: #FBBC05;cursor: pointer;">查看报价信息</div>';
-                            }else if(qutations.agreed == 1){
+                            } else if (qutations.agreed == 1) {
                                 return '<div style="text-align: center;color: green;cursor: pointer;">查看报价信息</div>';
-                            }else if(qutations.agreed == 0) {
+                            } else if (qutations.agreed == 0) {
                                 return '<div style="text-align: center;color:#ff6c00;">查看报价信息</div>';
                             }
                         }
                     },
                     listeners: {
-                        click: function(tableView, td, rowIdx, colIdx, e, model, tr) {
+                        click: function (tableView, td, rowIdx, colIdx, e, model, tr) {
                             var dataIndex = this.dataIndex;
                             var record = tableView.store.getAt(rowIdx);
                             var value = record.get(dataIndex);
@@ -177,7 +177,7 @@ Ext.define('saas.view.sale.b2b.Business', {
                     }
                 }],
                 listeners: {
-                    itemmouseenter: function(view, record, item, index, e, eOpts) {
+                    itemmouseenter: function (view, record, item, index, e, eOpts) {
                         var grid = view.up('grid');
                         grid.focusRecord = record;
                     }
@@ -221,33 +221,33 @@ Ext.define('saas.view.sale.b2b.Business', {
         return conditionValue;
     },
 
-    getExtraParams: function(store, op, condition) {
+    getExtraParams: function (store, op, condition) {
         var temp = {};
 
-        for(let x = 0; x < condition.length; x++) {
+        for (let x = 0; x < condition.length; x++) {
             let c = condition[x];
-            if(c.field == 'keyword') {
+            if (c.field == 'keyword') {
                 temp.keyword = c.value;
-            }else if(c.field == 'date') {
+            } else if (c.field == 'date') {
                 temp.fromDate = new Date(c.value.split(',')[0]).getTime();
                 temp.endDate = new Date(c.value.split(',')[1]).getTime();
-            }else if(c.field == 'quoted') {
+            } else if (c.field == 'quoted') {
                 temp.quoted = c.value == 'all' ? null : c.value;
-            }else if(c.field == 'closed') {
+            } else if (c.field == 'closed') {
                 // temp.endDate = c.value == 'all' ? null : (
                 //     c.value == '0' ? 
                 // );
             }
         }
         let obj = {
-            pageNumber: store.exportNumber?store.exportNumber:op._page,
-            pageSize: store.exportPageSize?store.exportPageSize:store.pageSize
+            pageNumber: store.exportNumber ? store.exportNumber : op._page,
+            pageSize: store.exportPageSize ? store.exportPageSize : store.pageSize
         };
-        for(let k in temp) {
-            if(!!temp[k]) {
+        for (let k in temp) {
+            if (!!temp[k]) {
                 obj[k] = temp[k];
             }
         }
         return obj;
-     },
+    },
 });

+ 1 - 1
frontend/saas-web/app/view/sale/b2b/Purchase.js

@@ -91,7 +91,7 @@ Ext.define('saas.view.sale.b2b.Purchase', {
                     width: 100
                 }, {
                     text: '转单状态',
-                    dataIndex: 'sa_trunstatus',
+                    dataIndex: 'sd_trunstatus',
                     width: 100,
                     textAlign: 'center'
                 }, {