Browse Source

Merge branch 'dev' of ssh://10.10.100.21/source/saas-platform into dev

zhoudw 7 years ago
parent
commit
4d425e0352
31 changed files with 2084 additions and 260 deletions
  1. 4 4
      frontend/saas-web/app/util/QueryUtil.js
  2. 1 1
      frontend/saas-web/app/view/core/dbfind/DbfindGridPanel.js
  3. 10 7
      frontend/saas-web/app/view/core/dbfind/DbfindTrigger.js
  4. 37 39
      frontend/saas-web/app/view/core/query/QueryGridPanel.js
  5. 192 8
      frontend/saas-web/app/view/core/query/QueryPanel.js
  6. 4 3
      frontend/saas-web/app/view/core/query/QueryPanelController.js
  7. 5 0
      frontend/saas-web/app/view/core/query/QueryPanelModel.js
  8. 2 3
      frontend/saas-web/app/view/core/tab/Controller.js
  9. 0 29
      frontend/saas-web/app/view/main/MainController.js
  10. 248 112
      frontend/saas-web/app/view/main/Navigation.js
  11. 2 2
      frontend/saas-web/app/view/purchase/purchase/FormController.js
  12. 9 7
      frontend/saas-web/app/view/purchase/purchase/FormPanel.js
  13. 23 40
      frontend/saas-web/app/view/purchase/purchase/QueryPanel.js
  14. 1 0
      frontend/saas-web/app/view/purchase/purchase/QueryPanelController.js
  15. 2 2
      frontend/saas-web/app/view/purchase/purchaseIn/FormController.js
  16. 3 1
      frontend/saas-web/app/view/purchase/purchaseIn/FormPanel.js
  17. 2 2
      frontend/saas-web/app/view/purchase/purchaseOut/FormController.js
  18. 3 0
      frontend/saas-web/app/view/purchase/purchaseOut/FormPanel.js
  19. 158 0
      frontend/saas-web/app/view/sale/sale/FormController.js
  20. 5 0
      frontend/saas-web/app/view/sale/sale/FormModel.js
  21. 270 0
      frontend/saas-web/app/view/sale/sale/FormPanel.js
  22. 206 0
      frontend/saas-web/app/view/sale/sale/QueryPanel.js
  23. 116 0
      frontend/saas-web/app/view/sale/sale/QueryPanelController.js
  24. 5 0
      frontend/saas-web/app/view/sale/sale/QueryPanelModel.js
  25. 158 0
      frontend/saas-web/app/view/sale/saleIn/FormController.js
  26. 5 0
      frontend/saas-web/app/view/sale/saleIn/FormModel.js
  27. 267 0
      frontend/saas-web/app/view/sale/saleIn/FormPanel.js
  28. 206 0
      frontend/saas-web/app/view/sale/saleIn/QueryPanel.js
  29. 116 0
      frontend/saas-web/app/view/sale/saleIn/QueryPanelController.js
  30. 5 0
      frontend/saas-web/app/view/sale/saleIn/QueryPanelModel.js
  31. 19 0
      frontend/saas-web/overrides/i18n.js

+ 4 - 4
frontend/saas-web/app/util/QueryUtil.js

@@ -25,15 +25,15 @@ Ext.define('saas.util.QueryUtil', {
             }
         }
         if(Mode=="MAIN"){
-            grid._Mode = Mode;
-            grid.reconfigure(grid.store, grid._baseColumn);
+            grid.Mode = Mode;
+            grid.reconfigure(grid.store, grid.baseColumn);
             grid.store.loadPage(1);
         }else{
             //若明细字段含明细字段注意切换数据源 grid.reconfigure(store, columns);
             //关联viewName = 关联viewName+"-RelativeGrid" selModel
             //grid.selModel = '';
-            grid._Mode = Mode;
-            grid.reconfigure(grid.store, grid._relativeColumn);
+            grid.Mode = Mode;
+            grid.reconfigure(grid.store, grid.relativeColumn);
             grid.store.loadPage(1);
         }
     },

+ 1 - 1
frontend/saas-web/app/view/core/dbfind/DbfindGridPanel.js

@@ -1,7 +1,6 @@
 Ext.define('saas.view.core.dbfind.DbfindGridPanel', {
     extend: 'Ext.grid.Panel',
     xtype: 'dbfindgridpanel',
-    GridUtil: Ext.create('saas.util.GridUtil'),
     BaseUtil: Ext.create('saas.util.BaseUtil'),
     dataUrl: '',
     dbSearchFields: [],
@@ -105,6 +104,7 @@ Ext.define('saas.view.core.dbfind.DbfindGridPanel', {
         },
         itemClick: function(view,record) {
             var me = this;
+            debugger;
             var dbfinds = me.dbfinds;
             if(dbfinds&&dbfinds.length>0){
                 if(me.belong=='grid'){

+ 10 - 7
frontend/saas-web/app/view/core/dbfind/DbfindTrigger.js

@@ -6,8 +6,6 @@ Ext.define('saas.view.core.dbfind.DbfindTrigger', {
     displayField: 'dispaly',
     valueField: 'value',
     triggerCls: 'x-form-search-trigger',
-    GridUtil: Ext.create('saas.util.GridUtil'),
-    BaseUtil: Ext.create('saas.util.BaseUtil'),
     minChars:1, // 设置用户输入字符多少时触发查询
     tpl: '',
     enableKeyEvents:true,
@@ -99,20 +97,25 @@ Ext.define('saas.view.core.dbfind.DbfindTrigger', {
     },
     onTriggerClick:function(f){
         //判断dbfindtrigger归属
-        var form = f.judge(f);//form
-        var win = form.getController().getView().add(Ext.create('Ext.window.Window', {   
+        // var form = f.judge(f);//form
+        var panel = f.up('core-tab-panel');
+        var panelEl = panel.getEl();
+        var box = panelEl.getBox();
+        var height = box.height;
+        var width = box.width;
+        var win = panel.add(Ext.create('Ext.window.Window', {   
             trigger:f,
             belong:f.ownerCt,  
             modal:true,
-            height: '80%',
-            width: '80%',
+            height: height * 0.8,
+            width: width * 0.8,
             title: '查找',
             scrollable: true,
             bodyPadding: 10,
             constrain: true,
             closable: true,
             layout:'fit',
-            renderTo:Ext.getCmp('main-tab-panel').getActiveTab().getEl(),
+            renderTo:panel.getEl(),
             items:[{
                 xtype:'dbfindgridpanel',
                 columns: f.dbColumns,

+ 37 - 39
frontend/saas-web/app/view/core/query/QueryGridPanel.js

@@ -7,19 +7,21 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
     GridUtil: Ext.create('saas.util.GridUtil'),
     BaseUtil: Ext.create('saas.util.BaseUtil'),
     //字段属性
-    _baseColumn: [],
-    _relativeColumn: [],
-    _idField:'',
-    _codeField:'',
-    _title:'',
-    _addXtype:'',
-    _baseVastUrl:'',
+    baseColumn: [],
+    relativeColumn: [],
+
+    idField:'',
+    codeField:'',
+    addTitle:'',
+    addXtype:'',
+    baseVastUrl:'',
+    queryMode: 'MAIN',
+    defaultCondition: '',
 
     //基础属性
     border: 1,
     anchor: '100% 70%',
     loadMask: true,
-    frame: true,
     showIndex: true,
     columnWidth: 1.0,
     showRowNum: true,
@@ -36,7 +38,7 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
                 data: [],
                 proxy: {
                     type: 'ajax',
-                    url: me._baseVastUrl+'list',
+                    url: me.baseVastUrl+'list',
                     actionMethods: {
                         read: 'GET'
                     },
@@ -48,29 +50,22 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
                 },
                 listeners: {
                     beforeload: function (store, op) {
-                        var condition = '',
-                        queryForm = me.ownerCt.down('form'),
-                        condition = me.QueryUtil.getFormCondition(queryForm),
-                        mode = me._Mode,
-                        defaultCondition = me._defaultCondition;
-                        if(defaultCondition){
-                            if (Ext.isEmpty(condition)) {
-                                condition = defaultCondition + ' and '+condition;
-                            }else{
-                                condition = defaultCondition;
-                            }
-                        }
-                        if (Ext.isEmpty(condition)) {
-                            condition = " 1=1 ";
-                        }
-                        if(!mode){
-                            mode='MAIN';
+                        var queryPanel = me.up('core-query-querypanel'),
+                        condition = queryPanel.getConditions(),
+                        defaultCondition = me.defaultCondition,
+                        mode = queryPanel.getQueryMode();
+
+                        if(defaultCondition) {
+                            condition.push({
+                                type: 'condition',
+                                value: defaultCondition
+                            });
                         }
                         Ext.apply(store.proxy.extraParams, {
                             number: op._page,
                             size: store.pageSize,
                             mode:mode,
-                            keyword: condition
+                            condition: JSON.stringify(condition)
                         });
     
                     }
@@ -79,6 +74,9 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
             dockedItems: [{
                 xtype: 'toolbar',
                 dock: 'top',
+                style: {
+                    borderTop: 'none'
+                },
                 defaults: { // defaults 将会应用所有的子组件上,而不是父容器
                     listeners: {
                         'mouseover':function(){
@@ -185,15 +183,15 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
         itemdblClick: function (tableView, record, item, index, e, eOpts) {
             var grid = tableView.up('grid'),
                 mainTab = Ext.getCmp('main-tab-panel'),
-                idValue = record.get(grid._idField),
-                codeValue = record.get(grid._codeField),
+                idValue = record.get(grid.idField),
+                codeValue = record.get(grid.codeField),
                 id = grid.xtype + idValue;
                 existingItem = mainTab.down('[id=' + id + ']');
             if (!existingItem) {
                 var form = {
-                    xtype:grid._addXtype,
+                    xtype:grid.addXtype,
                     id,
-                    title:grid._title+"("+codeValue+")",
+                    title:grid.addTitle+"("+codeValue+")",
                     initId:idValue
                 };
                 mainTab.setActiveTab(mainTab.add(form));
@@ -215,9 +213,9 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
             existingItem = mainTab.down('[id=' + id + ']');
         if (!existingItem) {
             var form = {
-                xtype:grid._addXtype,
+                xtype:grid.addXtype,
                 id,
-                title:'新增'+grid._title
+                title:'新增'+grid.addTitle
             };
             mainTab.setActiveTab(mainTab.add(form));
         }
@@ -256,7 +254,7 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
         if(data&&data.length>0){
             var params = JSON.stringify({baseDTOs:data});
             me.BaseUtil.request({
-                    url: me._baseVastUrl+type,
+                    url: me.baseVastUrl+type,
                     params: params,
                     method: 'POST',
                     async:false
@@ -281,13 +279,13 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
             items = me.selModel.getSelection(),
             data = new Array() ;
             Ext.each(items, function(item, index){
-                if(!Ext.isEmpty(item.data[me._idField])&&!Ext.isEmpty(item.data[me._codeField])){
+                if(!Ext.isEmpty(item.data[me.idField])&&!Ext.isEmpty(item.data[me.codeField])){
                     var o = new Object();
-                    if(me._idField){
-                        o['id'] = item.data[me._idField];
+                    if(me.idField){
+                        o['id'] = item.data[me.idField];
                     }
-                    if(me._codeField){
-                        o['code'] = item.data[me._codeField];
+                    if(me.codeField){
+                        o['code'] = item.data[me.codeField];
                     }
                     data.push(o);
                 }

+ 192 - 8
frontend/saas-web/app/view/core/query/QueryPanel.js

@@ -7,7 +7,10 @@ Ext.define('saas.view.core.query.QueryPanel', {
 
     layout: 'anchor',
     autoScroll: true,
+    border: 1,
+    bodyPadding: 5,
     margin: '0',
+    
     items: [{
         anchor: '100% 30%',
         reference: 'queryform',
@@ -20,36 +23,217 @@ Ext.define('saas.view.core.query.QueryPanel', {
 
     initComponent: function () {
         var me = this;
-        me.setQueryItems(me.queryFormItems);
+        me.setQueryFormItems();
         me.setQuertGridConfigs();
         me.callParent(arguments);
     },
 
     getQueryForm: function () {
         var me = this,
-            refs = me.getReferences();
+        queryForm = me.items[0];
 
-        return refs['queryform'];
+        return queryForm;
     },
 
     getQueryGrid: function () {
         var me = this,
-            refs = me.getReferences();
+        queryGrid = me.items[1];
 
-        return refs['querygrid'];
+        return queryGrid;
     },
 
-    setQueryItems: function (items) {
+    /**
+     * 解析查询字段并处理一些初始化配置
+     */
+    setQueryFormItems: function () {
         var me = this,
-        queryForm = me.items[0];
+        items = me.queryFormItems,
+        queryForm = me.getQueryForm(),
+        viewModel = me.getViewModel();
+
+        Ext.Array.each(items, function(item) {
+            var bind = item.bind,
+            name = item.name,
+            ignore = item.ignore,
+            defaultValue = item.defaultValue,
+            showDetail = item.showDetail,
+            shwoDetailFunc = item.shwoDetailFunc;
+
+            // 设置model绑定
+            if(!ignore) {
+                if(bind) {
+                    if(!Ext.isString(bind)) {
+                        bind = name;
+                        Ext.apply(bind, {
+                            value: '{form.' + bind + '}'
+                        });
+                    }else {
+                        bind = bind.replace(/[{|}]/g, '');
+                        item.bind = '{form.' + bind + '}';
+                    }
+                }else {
+                    bind = name;
+                    item.bind = '{form.' + bind + '}';
+                }
+                // 设置默认值
+                if(defaultValue) {
+                    viewModel.set('form.' + bind, defaultValue);
+                }
+                // 设置关联列表
+                if(showDetail) {
+                    var fields = viewModel.get('showDetailFields');
+                    fields.push(bind);
+                    viewModel.set('showDetailFields', fields);
+                }
+            }
+        });
+
         queryForm.items = items;
     },
 
     setQuertGridConfigs: function() {
         var me = this,
         queryGrid = me.items[1];
-        me.queryGridConfig['columns']=me.queryGridConfig._baseColumn || [];
+        me.queryGridConfig['columns']=me.queryGridConfig.baseColumn || [];
         Ext.apply(queryGrid,me.queryGridConfig);
+    },
+
+    /**
+     * 获得过滤条件
+     */
+    getConditions: function() {
+        var me = this,
+        formItems = me.queryFormItems,
+        viewModel = me.getViewModel(),
+        viewModelData = viewModel.getData(),
+        bindItems = viewModelData['form'],
+        condition,
+        conditions = [];
+
+        for(k in bindItems) {
+            var item = Ext.Array.findBy(formItems, function(i) {
+                return i.name == k;
+            });
+            var field = item.name,
+            func = item.getCondition,
+            value = bindItems[k],
+            condition;
+
+            if(typeof func == 'function') {
+                condition = {
+                    type: 'condition',
+                    value: func(value)
+                }
+            }else {
+                var xtype = item.xtype || 'textfield',
+                type = item.fieldType || me.getDefaultFieldType(xtype),
+                operation = item.operation || me.getDefaultFieldOperation(type),
+                conditionValue = me.getConditionValue(xtype, value);
+    
+                if(!conditionValue) {
+                    continue;
+                }
+                condition = {
+                    type: type,
+                    field: field,
+                    operation: operation,
+                    value: conditionValue
+                }
+            }
+            conditions.push(condition);
+        }
+
+        return conditions;
+    },
+
+    getDefaultFieldType: function(xtype) {
+        var type;
+
+        if(Ext.Array.contains(['numberfield'], xtype)) {
+            type = 'number';
+        }else if(Ext.Array.contains(['datefield', 'condatefield'], xtype)) {
+            type = 'date';
+        }else if(Ext.Array.contains(['combobox', 'multicombo', 'combo', 'radiofield', 'radio'], xtype)) {
+            type = 'enum';
+        }else {
+            type = 'string';
+        }
+
+        return type;
+    },
+
+    getDefaultFieldOperation: function(type) {
+        var operation;
+
+        if(type == 'string') {
+            operation = 'like';
+        }else if(type == 'number') {
+            operation = '=';
+        }else if(type == 'date') {
+            operation = '=';
+        }else if(type == 'enum') {
+            operation = 'in';
+        }
+
+        return operation;
+    },
+
+    /**
+     * 处理部分字段值
+     */
+    getConditionValue: function(xtype, value) {
+        var conditionValue;
+        if(xtype == 'datefield') {
+            conditionValue = Ext.Date.format(new Date(from), 'Y-m-d h:i:s');
+        }else if(xtype == 'condatefield') {
+            var from = value.from,
+            to = value.to;
+
+            conditionValue = Ext.Date.format(new Date(from), 'Y-m-d h:i:s') + ',' + Ext.Date.format(new Date(to), 'Y-m-d h:i:s');
+        }else if(xtype == 'multicombo') {
+            conditionValue = value.map(function(v) {
+                return '\'' + v.value + '\'';
+            }).join(',');
+        }else {
+            conditionValue = value;
+        }
+
+        return conditionValue;
+    },
+
+    /**
+     * 获得是否是关联列表模式
+     */
+    getQueryMode: function() {
+        var me = this,
+        formItems = me.queryFormItems,
+        viewModel = me.getViewModel(),
+        viewModelData = viewModel.getData(),
+        formData = viewModelData['form'],
+        showDetailFields = viewModelData['showDetailFields'],
+        detailModel;
+
+        detailModel = !!Ext.Array.findBy(showDetailFields, function(name) {
+            var item = Ext.Array.findBy(formItems, function(i) {
+                var b = i.bind, bname;
+                if(!Ext.isString(b)) {
+                    bname = b.value.replace(/[{|}]/g, '').split('.')[1];
+                }else {
+                    bname = b.replace(/[{|}]/g, '').split('.')[1];
+                }
+                return bname == name;
+            });
+            if(!item) {
+                return false;
+            }
+            var isShowDetail = item.isShowDetail || function(value) {
+                return !!value;
+            }
+            var value = formData[name];
+            return isShowDetail(value);
+        });
+
+        return detailModel ? 'DETAIL' : 'MAIN';
     }
 
 });

+ 4 - 3
frontend/saas-web/app/view/core/query/QueryPanelController.js

@@ -28,8 +28,9 @@ Ext.define('saas.view.core.query.QueryPanelController', {
     },
     onQuery: function (btn) {
         var me = this,
-        queryForm = btn.ownerCt.ownerCt,
-        grid = queryForm.ownerCt.down('grid');
-        grid.QueryUtil.turnRelativeGrid(grid,queryForm);
+        queryPanel = me.getView(),
+        queryGrid = queryPanel.down('core-query-querygridpanel');
+
+        queryGrid.store.loadPage(1);
     }
 });

+ 5 - 0
frontend/saas-web/app/view/core/query/QueryPanelModel.js

@@ -1,4 +1,9 @@
 Ext.define('saas.view.core.query.QueryPanelModel', {
     extend: 'Ext.app.ViewModel',
     alias: 'viewmodel.core-query-querypanel',
+
+    data: {
+        form: {}, // 查询字段记录
+        showDetailFields: [], // 关联列表切换字段
+    }
 });

+ 2 - 3
frontend/saas-web/app/view/core/tab/Controller.js

@@ -5,11 +5,10 @@ Ext.define('saas.view.core.tab.Controller', {
     init: function() {
         var me = this,
         tab = me.getView(),
-        tabConfig = tab.tabViewConfig,
-        viewtype = tabConfig.viewtype;
+        viewType = tab.viewType;
 
         tab.add({
-            xtype:viewtype
+            xtype: viewType
         });
     },
 

+ 0 - 29
frontend/saas-web/app/view/main/MainController.js

@@ -7,35 +7,6 @@ Ext.define('saas.view.main.MainController', {
 
     alias: 'controller.main',
 
-    setActiveTab: function(dataset) {
-        var me = this,
-        refs = me.getReferences(),
-        mainTab = refs.mainTabPanel,
-        // existingItem = mainTab.child(type),
-        newView,
-        type = dataset.type,
-        title = dataset.text,
-        tabTitle = title + (type == 'form' ? '' : '查询'),
-        id = dataset.id,
-        tabId = 'maintab-' + type + '-' + id,
-        existingItem = mainTab.down('[id=' + tabId + ']'),
-        lastView = mainTab.getActiveTab();
-
-        if (!existingItem) {
-            existingItem = Ext.create('saas.view.core.tab.Panel', {
-                id: tabId,
-                title: tabTitle,
-                tabViewConfig: dataset
-            });
-            Ext.suspendLayouts();
-            mainTab.setActiveTab(mainTab.add(existingItem));
-            Ext.resumeLayouts(true);
-        }else {
-            mainTab.setActiveTab(existingItem);
-        }
-        
-    },
-
     onToggleNavigationSize: function () {
         var me = this,
         refs = me.getReferences(),

+ 248 - 112
frontend/saas-web/app/view/main/Navigation.js

@@ -8,10 +8,10 @@ Ext.define('saas.view.main.Navigation', {
     navCollapsed: false,
     cls: 'x-navpanel',
 
-    initComponent: function() {
+    initComponent: function () {
         var me = this;
         var view = new Ext.DataView({
-            store : Ext.create('Ext.data.Store', {
+            store: Ext.create('Ext.data.Store', {
                 fields: ['text', 'iconCls'],
                 data: [{
                     text: '采购',
@@ -19,49 +19,176 @@ Ext.define('saas.view.main.Navigation', {
                     items: [{
                         text: '制单',
                         items: [{
-                            id: 'purchase',
-                            text: '采购单',
-                            addType:'purchase-purchase-formpanel',
-                            viewType: 'purchase-purchase-querypanel'
+                                id: 'purchase',
+                                text: '采购单',
+                                addType: 'purchase-purchase-formpanel',
+                                viewType: 'purchase-purchase-querypanel'
+                            }, {
+                                id: 'purchaseIn',
+                                text: '采购验收单',
+                                addType: 'purchase-purchaseIn-formpanel',
+                                viewType: 'purchase-purchaseIn-querypanel'
+                            }, {
+                                id: 'purchaseOut',
+                                text: '采购验退单',
+                                addType: 'purchase-purchaseOut-formpanel',
+                                viewType: 'purchase-purchaseOut-querypanel'
+                            }, {
+                                id: 'inquiry',
+                                text: '采购询价单',
+                                addType: 'purchase-inquiry-formpanel',
+                                viewType: 'purchase-inquiry-querypanel'
+                            }
+                            // ,{
+                            //     id: 'form1',
+                            //     text: '测试-采购单明细界面',
+                            //     addType: 'test-order-formpanel'
+                            // }, {
+                            //     id: 'myform',
+                            //     text: '测试-明细界面',
+                            //     addType: 'test-myform-formpanel'
+                            // }, {
+                            //     id: 'myquerytest',
+                            //     text: '测试-采购单查询界面',
+                            //     viewType: 'test-query-querypanel',
+                            // }
+                        ]
+                    }, {
+                        text: '报表',
+                        items: [{
+                            text: '采购明细表'
                         }, {
-                            id: 'purchaseIn',
-                            text: '采购验收单',
-                            addType:'purchase-purchaseIn-formpanel',
-                            viewType: 'purchase-purchaseIn-querypanel'
-                        },{
-                            id: 'purchaseOut',
-                            text: '采购验退单',
-                            addType:'purchase-purchaseOut-formpanel',
-                            viewType: 'purchase-purchaseOut-querypanel'
-                        },{
-                            id: 'form1',
-                            text: '测试-采购单明细界面',
-                            addType: 'test-order-formpanel'
+                            text: '采购付款一览表'
+                        }]
+                    }]
+                }, {
+                    text: '销售',
+                    iconCls: 'x-fa fa-shopping-cart',
+                    items: [{
+                        text: '制单',
+                        items: [{
+                            id: 'sale',
+                            text: '销售订单',
+                            addType: 'sale-sale-formpanel',
+                            viewType: 'sale-sale-querypanel'
+                        }, {
+                            id: 'saleOut',
+                            text: '销售出货单',
+                            addType: 'sale-saleOut-formpanel',
+                            viewType: 'sale-saleOut-querypanel'
                         }, {
-                            id: 'myform',
-                            text: '测试-明细界面',  
-                            addType: 'test-myform-formpanel'
+                            id: 'saleIn',
+                            text: '销售退货单',
+                            addType: 'sale-saleIn-formpanel',
+                            viewType: 'sale-saleIn-querypanel'
                         }, {
-                            id: 'myquerytest',
-                            text: '测试-采购单查询界面',
-                            viewType: 'test-query-querypanel',
+                            id: 'saleToPur',
+                            text: '以销定购',
+                            addType: 'sale-saleToPur-formpanel',
+                            viewType: 'sale-saleToPur-querypanel'
                         }]
                     }, {
                         text: '报表',
                         items: [{
-                            text: '采购明细表'
+                            text: '销售明细表'
                         }, {
-                            text: '采购付款一览表'
+                            text: '销售收款一览表'
+                        }, {
+                            text: '销售利润表'
+                        }]
+                    }]
+                }, {
+                    text: '库存',
+                    iconCls: 'x-fa fa-shopping-cart',
+                    items: [{
+                        text: '制单',
+                        items: [{
+                            id: 'appropriationInOut',
+                            text: '调拨单',
+                            addType: 'stock-appropriationInOut-formpanel',
+                            viewType: 'stock-appropriationInOut-querypanel'
+                        }, {
+                            id: 'make',
+                            text: '制造单',
+                            addType: 'stock-make-formpanel',
+                            viewType: 'stock-make-querypanel'
+                        }, {
+                            id: 'otherIn',
+                            text: '其它入库单',
+                            addType: 'stock-otherIn-formpanel',
+                            viewType: 'stock-otherIn-querypanel'
+                        }, {
+                            id: 'otherOut',
+                            text: '其它出库单',
+                            addType: 'stock-otherOut-formpanel',
+                            viewType: 'stock-otherOut-querypanel'
+                        }, {
+                            id: 'inventory',
+                            text: '盘点单',
+                            addType: 'stock-inventory-formpanel',
+                            viewType: 'stock-inventory-querypanel'
+                        }]
+                    }, {
+                        text: '报表',
+                        items: [{
+                            text: '物料出入库明细表'
+                        }, {
+                            text: '物料收发汇总表'
+                        }, {
+                            text: '物料库存数量金额表'
                         }]
                     }]
-                },{
+                }, {
+                    text: '资金',
+                    iconCls: 'x-fa fa-shopping-cart',
+                    items: [{
+                        text: '制单',
+                        items: [{
+                            id: 'payBalance',
+                            text: '付款单',
+                            addType: 'money-payBalance-formpanel',
+                            viewType: 'money-payBalance-querypanel'
+                        }, {
+                            id: 'recBbalance',
+                            text: '收款单',
+                            addType: 'money-recBbalance-formpanel',
+                            viewType: 'money-recBbalance-querypanel'
+                        }, {
+                            id: 'verification',
+                            text: '核销单',
+                            addType: 'money-verification-formpanel',
+                            viewType: 'money-verification-querypanel'
+                        }, {
+                            id: 'othReceipts',
+                            text: '其它收支单',
+                            addType: 'money-othReceipts-formpanel',
+                            viewType: 'money-othReceipts-querypanel'
+                        }, {
+                            id: 'fundTransfer',
+                            text: '资金转存',
+                            addType: 'money-fundTransfer-formpanel',
+                            viewType: 'money-fundTransfer-querypanel'
+                        }]
+                    }, {
+                        text: '报表',
+                        items: [{
+                            text: '供应商对账单'
+                        }, {
+                            text: '应付账款明细表'
+                        }, {
+                            text: '客户对账单'
+                        }, {
+                            text: '应收款明细表'
+                        }, {
+                            text: '资金账户余额表'
+                        }]
+                    }]
+                }, {
                     text: '资料',
                     iconCls: 'x-fa fa-book',
-                    items: [
-                        {
+                    items: [{
                             text: '基础资料',
-                            items: [
-                                {
+                            items: [{
                                     text: '客户资料',
                                     viewType: 'mainlist',
                                     leaf: true
@@ -105,8 +232,7 @@ Ext.define('saas.view.main.Navigation', {
                         },
                         {
                             text: '辅助资料',
-                            items: [
-                                {
+                            items: [{
                                     text: '客户类别',
                                     viewType: 'document-kind',
                                     leaf: true
@@ -161,22 +287,22 @@ Ext.define('saas.view.main.Navigation', {
                     ]
                 }]
             }),
-            tpl : new Ext.XTemplate('<ul class="x-navlist">',
+            tpl: new Ext.XTemplate('<ul class="x-navlist">',
                 '<tpl for=".">',
                 '<li class="x-navitem">',
-                    '<div class="x-navitem-body">',
-                        '<div class="nav-inner-wrap" style="margin-left: 0px;">',
-                        '<div class="nav-inner-icon {iconCls}"></div>',
-                        '<div class="nav-inner-text">{text}</div>',
-                    '</div>',
+                '<div class="x-navitem-body">',
+                '<div class="nav-inner-wrap" style="margin-left: 0px;">',
+                '<div class="nav-inner-icon {iconCls}"></div>',
+                '<div class="nav-inner-text">{text}</div>',
+                '</div>',
                 '</li>',
                 '</tpl>',
-            '</ul>'),
+                '</ul>'),
             trackOver: true,
-            overItemCls : 'x-navitem-over',
-            selectedClass : 'x-navitem-selected',
-            singleSelect : true,
-            itemSelector : '.x-navitem',
+            overItemCls: 'x-navitem-over',
+            selectedClass: 'x-navitem-selected',
+            singleSelect: true,
+            itemSelector: '.x-navitem',
             listeners: {
                 itemmouseenter: me.showNavMenu,
                 itemmouseleave: me.hideNavMenu,
@@ -193,98 +319,108 @@ Ext.define('saas.view.main.Navigation', {
         me.callParent();
     },
 
-    clickNavMenu: function(view, record, item, index, e, eOpts) {
+    clickNavMenu: function (view, record, item, index, e, eOpts) {
         var me = this;
         this.showNavMenu(view, record, item, index, e, eOpts);
     },
 
-    showNavMenu: function(view, record, item, index, e, eOpts) {
+    showNavMenu: function (view, record, item, index, e, eOpts) {
         var recData = record.data,
-        menuItems = recData.items || [],
-        itemBox = item.getBoundingClientRect(),
-        pos = [itemBox.left + itemBox.width, itemBox.top],
-        id = recData.id,
-        menuId = 'navMenu-' + id,
-        menu = Ext.getCmp(menuId);
+            menuItems = recData.items || [],
+            itemBox = item.getBoundingClientRect(),
+            pos = [itemBox.left + itemBox.width, itemBox.top],
+            id = recData.id,
+            menuId = 'navMenu-' + id,
+            menu = Ext.getCmp(menuId);
 
-        if(!menu) {
+        if (!menu) {
             var view = new Ext.DataView({
-                store : Ext.create('Ext.data.Store', {
-                   fields: ['id', 'text', 'addType', 'viewType'],
-                   data: menuItems
+                store: Ext.create('Ext.data.Store', {
+                    fields: ['id', 'text', 'addType', 'viewType'],
+                    data: menuItems
                 }),
                 tpl: new Ext.XTemplate('<div class="x-navitem-menu">',
                     '<div class="nav-menu-body">',
-                        '<tpl for=".">',
-                        '<div class="menu">',
-                            '<h3 class="menu-title">{text}</h3>',
-                            '<div class="menu-content">',
-                                '<tpl for="items">',
-                                '<div class="menuitem">',
-                                    '<div class="item-text" title="{text}" data-id="{id}" data-text="{text}" data-type="query" data-viewType="{viewType}">',
-                                        '{text}',
-                                    '</div>',
-                                    '<tpl if="{addType}">',
-                                    '<div class="item-icon" data-id="{id}" data-text="{text}" data-type="form" data-viewType="{addType}">新增</div>',
-                                    '</tpl>',
-                                '</div>',
-                                '</tpl>',
-                            '</div>',
-                        '</div>',
-                        '</tpl>',
+                    '<tpl for=".">',
+                    '<div class="menu">',
+                    '<h3 class="menu-title">{text}</h3>',
+                    '<div class="menu-content">',
+                    '<tpl for="items">',
+                    '<div class="menuitem">',
+                    '<div class="item-text" title="{text}" data-id="{id}" data-text="{text}" data-type="query" data-viewType="{viewType}">',
+                    '{text}',
                     '</div>',
-                '</div>'),
+                    '<tpl if="{addType}">',
+                    '<div class="item-icon" data-id="{id}" data-text="{text}" data-type="form" data-viewType="{addType}">新增</div>',
+                    '</tpl>',
+                    '</div>',
+                    '</tpl>',
+                    '</div>',
+                    '</div>',
+                    '</tpl>',
+                    '</div>',
+                    '</div>'),
                 trackOver: true,
-                overItemCls : 'menuitem-over',
-                selectedClass : 'menuitem-selected',
-                singleSelect : true,
-                itemSelector : 'menu',
+                overItemCls: 'menuitem-over',
+                selectedClass: 'menuitem-selected',
+                singleSelect: true,
+                itemSelector: 'menu',
                 listeners: {
-                    boxready: function(view, width, height, eOpts) {
+                    boxready: function (view, width, height, eOpts) {
                         var menu = view.up('menu'),
-                        menuView = view.el.dom.getElementsByClassName('x-navitem-menu')[0],
-                        menuBox = menuView.getBoundingClientRect(),
-                        menuViewWidth = menuBox.width,
-                        menuViewHeight = menuBox.height,
-                        menuItem = menuView.getElementsByClassName('menuitem');
-                        
+                            menuView = view.el.dom.getElementsByClassName('x-navitem-menu')[0],
+                            menuBox = menuView.getBoundingClientRect(),
+                            menuViewWidth = menuBox.width,
+                            menuViewHeight = menuBox.height,
+                            menuItem = menuView.getElementsByClassName('menuitem');
+
                         menu.setWidth(menuViewWidth);
                         menu.setHeight(menuViewHeight);
                         menu.updateLayout();
 
-                        view.el.dom.addEventListener('mouseleave', function(e) {
+                        view.el.dom.addEventListener('mouseleave', function (e) {
                             var ex = e.clientX,
-                            ey = e.clientY,
-                            box = menuView.getBoundingClientRect();
+                                ey = e.clientY,
+                                box = menuView.getBoundingClientRect();
 
-                            if(ey <= box.top || ex >= (box.left + box.width) || ey >= (box.top + box.height) || (ex <= box.left && ey >= (box.top + 64))) {
+                            if (ey <= box.top || ex >= (box.left + box.width) || ey >= (box.top + box.height) || (ex <= box.left && ey >= (box.top + 64))) {
                                 menu.hide();
                             }
                         });
 
-                        Ext.Array.each(menuItem, function(mi) {
+                        Ext.Array.each(menuItem, function (mi) {
                             var menuItemText = mi.getElementsByClassName('item-text');
                             var menuItemIcon = mi.getElementsByClassName('item-icon');
 
-                            Ext.Array.each(menuItemText, function(item) {
-                                item.addEventListener('click', function(e) {
+                            Ext.Array.each(menuItemText, function (item) {
+                                item.addEventListener('click', function (e) {
                                     var target = e.target,
-                                    dataset = target.dataset;
-                                    mainView = Ext.getCmp('mainView'),
-                                    controller = mainView.getController();
+                                    dataset = target.dataset,
+                                    viewType = dataset.viewtype,
+                                    type = dataset.type,
+                                    text = dataset.text,
+                                    id = dataset.id;
+
+                                    var tabTitle = text + (type == 'form' ? '' : '查询'),
+                                    tabId = 'maintab-' + type + '-' + id;
         
-                                    controller.setActiveTab(dataset);
+                                    openTab(viewType, tabTitle, tabId);
                                     menu.hide();
                                 });
                             });
-                            Ext.Array.each(menuItemIcon, function(item) {
-                                item.addEventListener('click', function(e) {
+                            Ext.Array.each(menuItemIcon, function (item) {
+                                item.addEventListener('click', function (e) {
                                     var target = e.target,
-                                    dataset = target.dataset;
-                                    mainView = Ext.getCmp('mainView'),
-                                    controller = mainView.getController();
+                                    dataset = target.dataset,
+                                    viewType = dataset.viewtype,
+                                    type = dataset.type,
+                                    text = dataset.text,
+                                    id = dataset.id;
+
+                                    var tabTitle = text + (type == 'form' ? '' : '查询'),
+                                    tabId = 'maintab-' + type + '-' + id;
         
-                                    controller.setActiveTab(dataset);
+                                    openTab(viewType, tabTitle, tabId);
                                     menu.hide();
                                 });
                             });
@@ -305,17 +441,17 @@ Ext.define('saas.view.main.Navigation', {
         menu.showAt(pos);
     },
 
-    hideNavMenu: function(view, record, item, index, e, eOpts) {
+    hideNavMenu: function (view, record, item, index, e, eOpts) {
         var recData = record.data,
-        cx = e.browserEvent.clientX,
-        cy = e.browserEvent.clientY,
-        itemBox = item.getBoundingClientRect(),
-        id = recData.id,
-        menuId = 'navMenu-' + id,
-        menu = Ext.getCmp(menuId);
+            cx = e.browserEvent.clientX,
+            cy = e.browserEvent.clientY,
+            itemBox = item.getBoundingClientRect(),
+            id = recData.id,
+            menuId = 'navMenu-' + id,
+            menu = Ext.getCmp(menuId);
 
-        if(cx <= itemBox.left || cy <= itemBox.top || cy >= (itemBox.top + itemBox.height)) {
-            if(menu) {
+        if (cx <= itemBox.left || cy <= itemBox.top || cy >= (itemBox.top + itemBox.height)) {
+            if (menu) {
                 menu.hide();
             }
         }

+ 2 - 2
frontend/saas-web/app/view/purchase/purchase/FormController.js

@@ -14,7 +14,7 @@ Ext.define('saas.view.purchase.purchase.FormController', {
             'dbfindtrigger[name=pu_vendcode]':{
                 beforerender:function(f){
                     Ext.apply(f,{
-                        dataUrl:'http://192.168.253.41:9480/api/document/vendor/getVendorsByCondition',
+                        dataUrl:'http://192.168.0.181:8570/api/document/vendor/getVendorsByCondition',
                         dbfinds:[{
                             from:'ve_code',to:'pu_vendcode'
                         },{
@@ -66,7 +66,7 @@ Ext.define('saas.view.purchase.purchase.FormController', {
                 beforerender:function(f){
                     Ext.apply(f,{
                         conditionCode:'pr_code',
-                        dataUrl:'http://192.168.253.41:9480/api/document/product/getProductsByCondition',
+                        dataUrl:'http://192.168.0.181:8570/api/document/product/getProductsByCondition',
                         dbfinds:[{
                             from:'pr_code',to:'pd_prodcode'
                         }],

+ 9 - 7
frontend/saas-web/app/view/purchase/purchase/FormPanel.js

@@ -5,6 +5,8 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
     controller: 'purchase-purchase-formcontroller',
     viewModel: 'purchase-purchase-formmodel',
     
+    caller:'Purchase',
+    
      //字段属性
      _title:'采购单',
      _idField: 'id',
@@ -13,17 +15,17 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
      _statusCodeField: 'pu_statuscode',
      _detnoColumn:  'pd_detno',
      _relationColumn: 'pd_puid',
-     _readUrl:'http://192.168.253.228:8800/purchase/read/',
-     _saveUrl:'http://192.168.253.228:8800/purchase/save',
-     _auditUrl:'http://192.168.253.228:8800/purchase/audit',
-     _deleteUrl:'http://192.168.253.228:8800/purchase/delete/',
-     _deleteDetailUrl:'http://192.168.253.228:8800/purchase/deleteItem/',
+     _readUrl:'http://192.168.0.181:8560/api/purchase/purchase/read/',
+     _saveUrl:'http://192.168.0.181:8560/api/purchase/purchase/save',
+     _auditUrl:'http://192.168.0.181:8560/api/purchase/purchase/audit',
+     _deleteUrl:'http://192.168.0.181:8560/api/purchase/purchase/delete/',
+     _deleteDetailUrl:'http://192.168.0.181:8560/api/purchase/purchase/deleteItem/',
      _turnInUrl:'http://192.168.253.228:8800/purchase/turnProdin/',
-     initId:76,
+     initId:0,
  
      toolBtns: [{
          xtype: 'button',
-         text: '转验收单按钮',
+         text: '转采购验收单',
          handler: 'turnIn'
      }],
 

+ 23 - 40
frontend/saas-web/app/view/purchase/purchase/QueryPanel.js

@@ -4,69 +4,57 @@ Ext.define('saas.view.purchase.purchase.QueryPanel', {
 
     controller: 'purchase-purchase-querypanel',
     viewModel: 'purchase-purchase-querypanel',
+
     viewName: 'purchase-purchase-formpanel',
-    _baseVastUrl: 'http://192.168.253.58:8800/purchase/',
-    _idField: 'pu_id',
-    _codeField: 'pu_code',
+    
     queryFormItems: [{
         xtype: 'hidden',
         name: 'pu_id',
         bind: '{pu_id}',
         fieldLabel: 'ID',
         allowBlank: true,
-        columnWidth: 0
+        getCondition: function(value) {
+            return 'pu_id=' + value;
+        }
     }, {
         xtype: 'textfield',
         name: 'pu_code',
         bind: '{pu_code}',
-        fieldLabel: '单据编号',
-        allowBlank: true,
-        columnWidth: 0.25
+        fieldLabel: '单据编号'
     }, {
         xtype: 'condatefield',
         name: 'pu_date',
         bind: '{pu_date}',
         fieldLabel: '采购日期',
-        allowBlank: true,
-        columnWidth: 0.5
+        columnWidth: 0.5,
+        operation: 'between'
     }, {
         xtype: 'dbfindtrigger',
         name: 'pu_vendcode',
         bind: '{pu_vendcode}',
-        fieldLabel: '供应商编号',
-        allowBlank: true,
-        columnWidth: 0.25
+        fieldLabel: '供应商编号'
     }, {
         xtype: 'textfield',
         name: 'pu_vendname',
         bind: '{pu_vendname}',
-        fieldLabel: '供应商名称',
-        allowBlank: true,
-        columnWidth: 0.25
+        fieldLabel: '供应商名称'
     }, {
         xtype: 'dbfindtrigger',
-        name: 'pd_prodcode#pd_prodcode',
-        //#pr_detail
+        name: 'pd_prodcode',
         bind: '{pd_prodcode}',
         fieldLabel: '物料编号',
-        fieldMode: 'DETAIL',
-        queryType: 'VAG',
-        allowBlank: true,
-        columnWidth: 0.25
+        showDetail: true
     }, {
         xtype: 'textfield',
         name: 'pr_detail',
         bind: '{pr_detail}',
         fieldLabel: '物料名称',
-        allowBlank: true,
-        columnWidth: 0.25
+        showDetail: true
     }, {
         xtype: 'combobox',
         name: 'pu_statuscode',
        // bind: '{pu_statuscode}',
         fieldLabel: '审核状态',
-        allowBlank: true,
-        columnWidth: 0.25,
         queryMode: 'local',
         displayField: 'pu_status',
         valueField: 'pu_statuscode',
@@ -84,8 +72,6 @@ Ext.define('saas.view.purchase.purchase.QueryPanel', {
         name: 'pu_acceptstatuscode',
         bind: '{pu_acceptstatuscode}',
         fieldLabel: '入库状态',
-        allowBlank: true,
-        columnWidth: 0.25,
         datas: [
             ["TURNIN", "已入库"],
             ["UNTURNIN", "未入库"],
@@ -96,30 +82,27 @@ Ext.define('saas.view.purchase.purchase.QueryPanel', {
         xtype: 'textfield',
         name: 'pu_buyername',
         bind: '{pu_buyername}',
-        fieldLabel: '采购员',
-        allowBlank: true
+        fieldLabel: '采购员'
     }, {
         xtype: 'textfield',
         name: 'pu_total',
         bind: '{pu_total}',
-        fieldLabel: '金额',
-        allowBlank: true
+        fieldLabel: '金额'
     }, {
         xtype: 'condatefield',
         name: 'pu_delivery',
         bind: '{pu_delivery}',
         fieldLabel: '交货日期',
-        allowBlank: true,
         columnWidth: 1
     }],
     queryGridConfig: {
-        _idField: 'pu_id',
-        _codeField: 'pu_code',
-        _title: '采购单',
-        _defaultCondition:'',
-        _addXtype: 'purchase-purchase-formpanel',
-        _baseVastUrl: 'http://localhost:8800/purchase/',
-        _baseColumn: [{
+        idField: 'pu_id',
+        codeField: 'pu_code',
+        addTitle: '采购单',
+        addXtype: 'purchase-purchase-formpanel',
+        defaultCondition:'',
+        baseVastUrl: 'http://192.168.253.58:8800/purchase/',
+        baseColumn: [{
             text: '序号',
             width: 80,
             xtype: 'rownumberer'
@@ -157,7 +140,7 @@ Ext.define('saas.view.purchase.purchase.QueryPanel', {
             width: 120,
             flex: 1
         }],
-        _relativeColumn: [{
+        relativeColumn: [{
             text: '序号',
             width: 80,
             xtype: 'rownumberer'

+ 1 - 0
frontend/saas-web/app/view/purchase/purchase/QueryPanelController.js

@@ -63,6 +63,7 @@ Ext.define('saas.view.purchase.purchase.QueryPanelController', {
                         dataUrl:'http://192.168.253.41:9480/api/document/product/getProductsByCondition',
                         dbfinds:[{
                             from:'pr_code',to:'pd_prodcode',
+                        }, {
                             from:'pr_detail',to:'pr_detail'
                         }],
                         dbtpls:[{

+ 2 - 2
frontend/saas-web/app/view/purchase/purchaseIn/FormController.js

@@ -14,7 +14,7 @@ Ext.define('saas.view.purchase.purchaseIn.FormController', {
             'dbfindtrigger[name=pu_vendcode]':{
                 beforerender:function(f){
                     Ext.apply(f,{
-                        dataUrl:'http://192.168.253.41:9480/api/document/vendor/getVendorsByCondition',
+                        dataUrl:'http://192.168.0.181:8570/api/document/vendor/getVendorsByCondition',
                         dbfinds:[{
                             from:'ve_code',to:'pu_vendcode'
                         },{
@@ -66,7 +66,7 @@ Ext.define('saas.view.purchase.purchaseIn.FormController', {
                 beforerender:function(f){
                     Ext.apply(f,{
                         conditionCode:'pr_code',
-                        dataUrl:'http://192.168.253.41:9480/api/document/product/getProductsByCondition',
+                        dataUrl:'http://192.168.0.181:8570/api/document/product/getProductsByCondition',
                         dbfinds:[{
                             from:'pr_id',to:'pd_prodid'                          
                         },{

+ 3 - 1
frontend/saas-web/app/view/purchase/purchaseIn/FormPanel.js

@@ -4,7 +4,9 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
 
     controller: 'purchase-purchaseIn-formcontroller',
     viewModel: 'purchase-purchaseIn-formmodel',
+    caller:'PurchaseIn',
     
+     //字段属性
     _title:'采购验收单',
     _idField: 'id',
     _codeField: 'pi_inoutno',
@@ -23,7 +25,7 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
 
     toolBtns: [{
         xtype: 'button',
-        text: '转验退单按钮',
+        text: '转采购验退单',
         handler: 'turnOut'
     }],
 

+ 2 - 2
frontend/saas-web/app/view/purchase/purchaseOut/FormController.js

@@ -14,7 +14,7 @@ Ext.define('saas.view.purchase.purchaseOut.FormController', {
             'dbfindtrigger[name=pu_vendcode]':{
                 beforerender:function(f){
                     Ext.apply(f,{
-                        dataUrl:'http://192.168.253.41:9480/api/document/vendor/getVendorsByCondition',
+                        dataUrl:'http://192.168.0.181:8570/api/document/vendor/getVendorsByCondition',
                         dbfinds:[{
                             from:'ve_code',to:'pu_vendcode'
                         },{
@@ -66,7 +66,7 @@ Ext.define('saas.view.purchase.purchaseOut.FormController', {
                 beforerender:function(f){
                     Ext.apply(f,{
                         conditionCode:'pr_code',
-                        dataUrl:'http://192.168.253.41:9480/api/document/product/getProductsByCondition',
+                        dataUrl:'http://192.168.0.181:8570/api/document/product/getProductsByCondition',
                         dbfinds:[{
                             from:'pr_id',to:'pd_prodid'                          
                         },{

+ 3 - 0
frontend/saas-web/app/view/purchase/purchaseOut/FormPanel.js

@@ -5,6 +5,9 @@ Ext.define('saas.view.purchase.purchaseOut.FormPanel', {
     controller: 'purchase-purchaseOut-formcontroller',
     viewModel: 'purchase-purchaseOut-formmodel',
     
+    caller:'PurchaseOut',
+    
+    //字段属性
     _title:'采购验退单',
     _idField: 'id',
     _codeField: 'pi_inoutno',

+ 158 - 0
frontend/saas-web/app/view/sale/sale/FormController.js

@@ -0,0 +1,158 @@
+Ext.define('saas.view.sale.sale.FormController', {
+    extend: 'saas.view.core.form.FormPanelController',
+    alias: 'controller.sale-sale-formcontroller',
+    init: function (form) {
+        var me = this;
+        this.control({
+            /**放大镜新增demo*/
+            "field[name=combo]":{
+                beforerender:function(f){
+                    f.addHandler=me.addCombo;
+                }
+            },
+            //放大镜赋值关系 以及 tpl模板
+            'dbfindtrigger[name=sa_custcode]':{
+                beforerender:function(f){
+                    Ext.apply(f,{
+                        dataUrl:'http://192.168.0.181:8570/api/document/customer/getCustomerByCondition',
+                        dbfinds:[{
+                            from:'cu_id',to:'sa_custid'
+                        },{
+                            from:'cu_code',to:'sa_custcode'
+                        },{
+                            from:'cu_name',to:'sa_custname'
+                        }],
+                        dbtpls:[{
+                            field:'cu_code',width:100
+                        },{
+                            field:'cu_name',width:100
+                        }],
+                        dbColumns:[{
+                            conditionCode:'cu_id',
+                            "text": "客户ID",
+                            "flex": 0,
+                            "dataIndex": "cu_id",
+                            "width": 0,
+                            "xtype": "",
+                            "items": null
+                        },{
+                            conditionCode:'cu_code',
+                            "text": "客户编号",
+                            "flex": 1,
+                            "dataIndex": "cu_code",
+                            "width": 100,
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            conditionCode:'cu_name',
+                            "text": "客户名称",
+                            "flex": 1,
+                            "dataIndex": "cu_name",
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            conditionCode:'cu_type',
+                            "text": "客户类型",
+                            "flex": 0,
+                            "dataIndex": "cu_type",
+                            "width": 200,
+                            "xtype": "",
+                            "items": null
+                        }]
+                    }) ;   
+
+                }
+            },
+            //放大镜赋值关系 以及 tpl模板
+            'dbfindtrigger[name=pd_prodcode]':{
+                beforerender:function(f){
+                    Ext.apply(f,{
+                        conditionCode:'pr_code',
+                        dataUrl:'http://192.168.0.181:8570/api/document/product/getProductsByCondition',
+                        dbfinds:[{
+                            from:'pr_code',to:'sd_prodcode'
+                        }],
+                        dbtpls:[{
+                            field:'pr_code',width:100
+                        },{
+                            field:'pr_detail',width:100
+                        }],
+                        dbColumns:[{
+                            "text": "物料ID",
+                            "flex": 0,
+                            "dataIndex": "pr_id",
+                            "width": 0,
+                            "xtype": "",
+                            "items": null
+                        },{
+                            "text": "物料编号",
+                            "flex": 1,
+                            "dataIndex": "pr_code",
+                            "width": 100,
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            "text": "物料名称",
+                            "flex": 1,
+                            "dataIndex": "pr_detail",
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            "text": "物料规格",
+                            "flex": 0,
+                            "dataIndex": "pr_spec",
+                            "width": 200,
+                            "xtype": "",
+                            "items": null
+                        }]
+                    }) ;   
+
+                }
+            }
+        });
+
+    },
+    addCombo:function(){
+        var combo=this.ownerCmp;
+        Ext.create('Ext.window.Window',{
+            layout:'vbox',
+            bodyPadding: 15,
+            width:500,
+            items:[{
+                fieldLabel:'实际值',
+                xtype:'textfield'
+            },{
+                fieldLabel:'显示值',
+                xtype:'textfield'
+            }],
+            buttons:[{
+                text:'确认',
+                handler:function(b){
+                    combo.setValue('ok');
+                    b.up('window').close();
+                }
+            }],
+            renderTo:this.ownerCmp.ownerCt.getEl()
+        }).show();
+
+    },
+
+    turnOut: function() {
+        var me = this,
+        form = me.getView(),
+        id = form.getForm().findField(form._idField);
+        form.BaseUtil.request({
+            url: form._turnOutUrl+id.value,
+            method: 'GET',
+        })
+        .then(function(res) {
+            var localJson = new Ext.decode(res.responseText);
+            if(localJson.success){
+                Ext.Msg.alert('提示','转单成功');
+            }
+        })
+        .catch(function() {
+            Ext.Msg.alert('提示','转单失败');
+        });
+     }
+});

+ 5 - 0
frontend/saas-web/app/view/sale/sale/FormModel.js

@@ -0,0 +1,5 @@
+Ext.define('saas.view.sale.sale.FormModel', {
+    extend: 'saas.view.core.form.FormPanelModel',
+    alias: 'viewmodel.sale-sale-formmodel',
+
+});

+ 270 - 0
frontend/saas-web/app/view/sale/sale/FormPanel.js

@@ -0,0 +1,270 @@
+Ext.define('saas.view.sale.sale.FormPanel', {
+    extend: 'saas.view.core.form.FormPanel',
+    xtype: 'sale-sale-formpanel',
+
+    controller: 'sale-sale-formcontroller',
+    viewModel: 'sale-sale-formmodel',
+    
+    caller:'Sale',
+    
+     //字段属性
+     _title:'销售订单',
+     _idField: 'id',
+     _codeField: 'sa_code',
+     _statusField: 'sa_status',
+     _statusCodeField: 'sa_statuscode',
+     _detnoColumn:  'sd_detno',
+     _relationColumn: 'sd_puid',
+     _readUrl:'',
+     _saveUrl:'',
+     _auditUrl:'',
+     _deleteUrl:'',
+     _deleteDetailUrl:'',
+     _turnInUrl:'',
+     _turnOutUrl:'',
+     initId:0,
+ 
+     toolBtns: [{
+         xtype: 'button',
+         text: '转出货单',
+         handler: 'turnIn'
+     }],
+
+    defaultItems: [{
+        xtype: 'hidden',
+        name: 'id',
+        bind: '{id}',
+        fieldLabel: 'id',
+        allowBlank: true,
+        columnWidth: 0
+    }, {
+        xtype : 'hidden', 
+        name : 'sa_cudid', 
+        bind : '{sa_cudid}', 
+        fieldLabel : '客户ID', 
+        allowBlank : true, 
+        columnWidth : 0
+    }, {
+        xtype : 'textfield', 
+        name : 'sa_code', 
+        bind : '{sa_code}', 
+        fieldLabel : '销售单号', 
+        allowBlank : true, 
+        columnWidth : 0.25
+    }, {
+        xtype : 'hidden', 
+        name : 'sa_cucode', 
+        bind : '{sa_cucode}', 
+        fieldLabel : '客户编号', 
+        allowBlank : true, 
+        columnWidth : 0, 
+    }, {
+        xtype : "dbfindtrigger", 
+        name : "sa_cuname", 
+        bind : "{sa_cuname}", 
+        fieldLabel : "客户名称", 
+        allowBlank : true, 
+        columnWidth : 0.25
+    },{
+        xtype : "datefield", 
+        name : "sa_recorddate", 
+        bind : "{sa_recorddate}", 
+        fieldLabel : "订单日期", 
+        allowBlank : false, 
+        columnWidth : 0.25
+    }, {
+        xtype : "textfield", 
+        name : "sa_recorder", 
+        bind : "{sa_recorder}", 
+        fieldLabel : "录入人", 
+        allowBlank : true, 
+        readOnly:true,
+        columnWidth : 0.25
+    }, {
+        xtype : "textfield", 
+        name : "sa_total", 
+        bind : "{sa_total}", 
+        fieldLabel : "单据金额", 
+        allowBlank : true, 
+        columnWidth : 0.25
+    },{
+        xtype : 'textfield', 
+        name : 'sa_sendstatus', 
+        bind : '{sa_sendstatus}', 
+        fieldLabel : '出货状态', 
+        allowBlank : true, 
+        readOnly:true,
+        columnWidth : 0.25
+     }
+     //, {
+    //     xtype : "textfield", 
+    //     name : "sa_toplace", 
+    //     bind : "{sa_toplace}", 
+    //     fieldLabel : "交货地址", 
+    //     allowBlank : true, 
+    //     columnWidth : 0.5
+    // }
+    // , {
+    //     xtype : "textfield", 
+    //     name : "sa_remark", 
+    //     bind : "{sa_remark}", 
+    //     fieldLabel : "备注", 
+    //     allowBlank : true, 
+    //     columnWidth : 1
+    // }
+    ,{
+        name : "detailGridField", 
+        xtype : "detailGridField", 
+        columnWidth : 1,
+        columns : [
+            {
+                text : "序号", 
+                dataIndex : "sd_detno", 
+                width : 100, 
+                xtype : "numbercolumn",
+                align : 'center',
+                format:'0',
+                summaryType: 'count',
+                summaryRenderer: function(value, summaryData, dataIndex) {
+                    return Ext.String.format('合计: {0}条', value);
+                },
+            }, {
+                text : "id", 
+                dataIndex : "id", 
+                xtype : "numbercolumn"
+            },
+            {
+                text : "物料编号", 
+                width : 200.0, 
+                dataIndex : "sd_prodcode", 
+                xtype : "", 
+                items : null,
+                editor : {
+                    displayField : "display", 
+                    editable : true, 
+                    format : "", 
+                    hideTrigger : false, 
+                    maxLength : 100.0, 
+                    minValue : null, 
+                    positiveNum : false, 
+                    queryMode : "local", 
+                    store : null, 
+                    valueField : "value", 
+                    xtype : "dbfindtrigger"
+                }
+            },
+            {
+                text : "名称", 
+                dataIndex : "pr_detail",
+                ignore:true
+            },
+            {
+                text : "规格", 
+                dataIndex : "pr_spec",
+                ignore:true
+            },
+            {
+                text : "数量", 
+                dataIndex : "sd_qty", 
+                editor : {
+                    xtype : "numberfield"
+                },
+                width : 120.0, 
+                xtype : "numbercolumn", 
+                format:'0',
+                items : null,
+                summaryType: 'sum'
+            },
+            {
+                text : "单价", 
+                editor : {
+                    xtype : "numberfield"
+                },
+                format:'0,000.00',
+                dataIndex : "sd_price", 
+                width : 120.0, 
+                xtype : "numbercolumn",
+                items : null,
+                summaryType: 'sum'
+            }, 
+            {
+                text : "税率", 
+                editor : {
+                    xtype : "numberfield"
+                },
+                dataIndex : "sd_taxrate", 
+                width : 120.0, 
+                xtype : "numbercolumn", 
+                items : null
+            },
+            {
+                text : "含税金额", 
+                dataIndex : "sd_total", 
+                width : 120.0, 
+                xtype : "numbercolumn"
+            }, 
+            {
+                text : "未税金额", 
+                dataIndex : "sd_nettotal", 
+                xtype : "numbercolumn"
+            },{
+                text : "交货日期", 
+                dataIndex : "sd_delivery", 
+                flex : 1.0, 
+                xtype:'datecolumn',
+                format : "Y-m-d H:i:s", 
+                editor : {
+                    xtype : "datefield",
+                    editable : true, 
+                    format : "Y-m-d H:i:s", 
+                    hideTrigger : false
+                }
+            },
+            {
+                text : "已转数", 
+                dataIndex : "sd_yqty", 
+                editor : {
+                    xtype : "numberfield"
+                },
+                width : 120.0, 
+                xtype : "numbercolumn", 
+                format:'0',
+                items : null,
+                summaryType: 'sum'
+            },
+        ]
+    }, {
+        format : "Y-m-d", 
+        xtype : "datefield", 
+        name : "createTime", 
+        bind : "{createTime}", 
+        fieldLabel : "创建时间", 
+        allowBlank : true, 
+        columnWidth : 0.25
+    }, {
+        xtype : "datefield", 
+        name : "updateTime", 
+        bind : "{updateTime}", 
+        fieldLabel : "更新时间", 
+        allowBlank : true, 
+        columnWidth : 0.25
+    }, {
+        xtype : "textfield", 
+        readOnly : true, 
+        editable : false, 
+        name : "sa_status", 
+        bind : "{sa_status}", 
+        fieldLabel : "单据状态", 
+        allowBlank : true, 
+        columnWidth : 0.25
+    }, {
+        xtype : "hidden", 
+        readOnly : true, 
+        editable : false, 
+        name : "sa_statuscode", 
+        bind : "{sa_statuscode}", 
+        fieldLabel : "单据状态码", 
+        allowBlank : true, 
+        columnWidth : 0.0
+    }]
+});

+ 206 - 0
frontend/saas-web/app/view/sale/sale/QueryPanel.js

@@ -0,0 +1,206 @@
+Ext.define('saas.view.sale.sale.QueryPanel', {
+    extend: 'saas.view.core.query.QueryPanel',
+    xtype: 'sale-sale-querypanel',
+
+    controller: 'sale-sale-querypanel',
+    viewModel: 'sale-sale-querypanel',
+    viewName: 'sale-sale-formpanel',
+    _idField: 'sa_id',
+    _codeField: 'sa_code',
+    queryFormItems: [{
+        xtype: 'hidden',
+        name: 'sa_id',
+        bind: '{sa_id}',
+        fieldLabel: 'ID',
+        allowBlank: true,
+        columnWidth: 0
+    }, {
+        xtype: 'textfield',
+        name: 'sa_code',
+        bind: '{sa_code}',
+        fieldLabel: '单据编号',
+        allowBlank: true,
+        columnWidth: 0.25
+    }, {
+        xtype: 'condatefield',
+        name: 'sa_recorddate',
+        bind: '{sa_recorddate}',
+        fieldLabel: '单据日期',
+        allowBlank: true,
+        columnWidth: 0.5
+    }, {
+        xtype: 'dbfindtrigger',
+        name: 'sa_custcode',
+        bind: '{sa_custcode}',
+        fieldLabel: '客户编号',
+        allowBlank: true,
+        columnWidth: 0.25
+    }, {
+        xtype: 'textfield',
+        name: 'sa_custname',
+        bind: '{sa_custname}',
+        fieldLabel: '客户名称',
+        allowBlank: true,
+        columnWidth: 0.25
+    }, {
+        xtype: 'dbfindtrigger',
+        name: 'pd_prodcode#pd_prodcode',
+        bind: '{pd_prodcode}',
+        fieldLabel: '物料编号',
+        fieldMode: 'DETAIL',
+        queryType: 'VAG',
+        allowBlank: true,
+        columnWidth: 0.25
+    }, {
+        xtype: 'textfield',
+        name: 'pr_detail',
+        bind: '{pr_detail}',
+        fieldLabel: '物料名称',
+        allowBlank: true,
+        columnWidth: 0.25
+    }, {
+        xtype: 'combobox',
+        name: 'sa_statuscode',
+        bind: '{sa_statuscode}',
+        fieldLabel: '审核状态',
+        allowBlank: true,
+        columnWidth: 0.25,
+        queryMode: 'local',
+        displayField: 'sa_status',
+        valueField: 'sa_statuscode',
+        editable:false,
+        store: Ext.create('Ext.data.ArrayStore', {
+        fields: ['sa_statuscode', 'sa_status'],
+        data: [
+            ["$ALL", "全部"],
+            ["AUDITED", "已审核"],
+            ["UNAUDITED", "未审核"]
+        ]
+        })
+    }, {
+        xtype: 'multicombo',
+        name: 'sa_sendstatuscode',
+        bind: '{sa_sendstatuscode}',
+        fieldLabel: '出库状态',
+        allowBlank: true,
+        columnWidth: 0.25,
+        datas: [
+            ["TURNOUT", "已出库"],
+            ["UNTURNOUT", "未出库"],
+            ["PARTOUT", "部分出库"]
+        ]
+    }],
+    moreQueryFormItems: [{
+        xtype: 'textfield',
+        name: 'pu_buyername',
+        bind: '{pu_buyername}',
+        fieldLabel: '采购员',
+        allowBlank: true
+    }],
+    queryGridConfig: {
+        _idField: 'sa_id',
+        _codeField: 'sa_code',
+        _title: '销售订单',
+        _defaultCondition:'',
+        _addXtype: 'sale-sale-formpanel',
+        _baseVastUrl: 'http://192.168.0.181:8560/api/sale/sale/',
+        _baseColumn: [{
+            text: '序号',
+            width: 80,
+            xtype: 'rownumberer'
+        }, {
+            text: 'id',
+            dataIndex: 'sa_id',
+            width: 100,
+            xtype: 'numbercolumn'
+        }, {
+            text: '单据编号',
+            dataIndex: 'sa_code',
+            width: 120
+        }, {
+            text: '单据状态',
+            dataIndex: 'sa_status',
+            width: 120
+        }, {
+            text: '单据日期',
+            dataIndex: 'sa_recorddate',
+            xtype: 'datecolumn',
+            width: 200
+        }, {
+            text: '客户名称',
+            dataIndex: 'sa_cuname',
+            width: 120
+        }, {
+            text: '金额',
+            dataIndex: 'sa_total',
+            xtype: 'numbercolumn',
+            width: 120
+        }],
+        _relativeColumn: [{
+            text: '序号',
+            width: 80,
+            xtype: 'rownumberer'
+        }, {
+            text: 'id',
+            dataIndex: 'sa_id',
+            width: 100,
+            xtype: 'numbercolumn'
+        }, {
+            text: '单据编号',
+            dataIndex: 'sa_code',
+            width: 120
+        }, {
+            text: '单据状态',
+            dataIndex: 'sa_status',
+            width: 120
+        }, {
+            text: '下单日期',
+            dataIndex: 'sa_recorddate',
+            xtype: 'datecolumn',
+            width: 200
+        }, {
+            text: '客户名称',
+            dataIndex: 'sa_cuname',
+            width: 120
+        }, {
+            text: '明细序号',
+            dataIndex: 'sd_detno',
+            xtype: 'numbercolumn',
+            width: 120
+        }, {
+            text: '物料编号',
+            dataIndex: 'sd_prodcode',
+            width: 120
+        }, {
+            text: '数量',
+            dataIndex: 'sd_qty',
+            xtype: 'numbercolumn',
+            width: 120
+        }, {
+            text: '单价',
+            dataIndex: 'sd_price',
+            xtype: 'numbercolumn',
+            width: 120
+        }, {
+            text: '已转数',
+            dataIndex: 'sd_ytqy',
+            xtype: 'numbercolumn',
+            width: 120
+        }, {
+            text: '已出货数',
+            dataIndex: 'sd_sendqty',
+            xtype: 'numbercolumn',
+            width: 120
+        }, {
+            text: '已审核采购单数',
+            dataIndex: 'sd_pdqty',
+            xtype: 'numbercolumn',
+            width: 120
+        }, {
+            text: '备注',
+            dataIndex: 'sd_remark',
+            width: 250,
+            flex: 1
+        }]
+    }
+});

+ 116 - 0
frontend/saas-web/app/view/sale/sale/QueryPanelController.js

@@ -0,0 +1,116 @@
+Ext.define('saas.view.sale.sale.QueryPanelController', {
+    extend: 'saas.view.core.query.QueryPanelController',
+    alias: 'controller.sale-sale-querypanel',
+    init: function (form) {
+        var me = this;
+        this.control({
+            //放大镜赋值关系 以及 tpl模板
+            'dbfindtrigger[name=sa_custcode]':{
+                beforerender:function(f){
+                    Ext.apply(f,{
+                        dataUrl:'http://192.168.0.181:8570/api/document/customer/getCustomerByCondition',
+                        dbfinds:[{
+                            from:'cu_id',to:'sa_custid'
+                        },{
+                            from:'cu_code',to:'sa_custcode'
+                        },{
+                            from:'cu_name',to:'sa_custname'
+                        }],
+                        dbtpls:[{
+                            field:'cu_code',width:100
+                        },{
+                            field:'cu_name',width:100
+                        }],
+                        dbColumns:[{
+                            conditionCode:'cu_id',
+                            "text": "客户ID",
+                            "flex": 0,
+                            "dataIndex": "cu_id",
+                            "width": 0,
+                            "xtype": "",
+                            "items": null
+                        },{
+                            conditionCode:'cu_code',
+                            "text": "客户编号",
+                            "flex": 1,
+                            "dataIndex": "cu_code",
+                            "width": 100,
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            conditionCode:'cu_name',
+                            "text": "客户名称",
+                            "flex": 1,
+                            "dataIndex": "cu_name",
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            conditionCode:'cu_type',
+                            "text": "客户类型",
+                            "flex": 0,
+                            "dataIndex": "cu_type",
+                            "width": 200,
+                            "xtype": "",
+                            "items": null
+                        }]
+                    }) ;   
+
+                }
+            },
+            //放大镜赋值关系 以及 tpl模板
+            'dbfindtrigger[name=pd_prodcode]':{
+                beforerender:function(f){
+                    Ext.apply(f,{
+                        conditionCode:'pr_code',
+                        dataUrl:'http://192.168.253.41:9480/api/document/product/getProductsByCondition',
+                        dbfinds:[{
+                            from:'pr_code',to:'sd_prodcode'
+                        }],
+                        dbtpls:[{
+                            field:'pr_code',width:100
+                        },{
+                            field:'pr_detail',width:100
+                        }],
+                        dbColumns:[{
+                            "text": "物料ID",
+                            "flex": 0,
+                            "dataIndex": "pr_id",
+                            "width": 0,
+                            "xtype": "",
+                            "items": null
+                        },{
+                            "text": "物料编号",
+                            "flex": 1,
+                            "dataIndex": "pr_code",
+                            "width": 100,
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            "text": "物料名称",
+                            "flex": 1,
+                            "dataIndex": "pr_detail",
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            "text": "物料规格",
+                            "flex": 0,
+                            "dataIndex": "pr_spec",
+                            "width": 200,
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            "text": "物料单位",
+                            "flex": 0,
+                            "dataIndex": "pr_unit",
+                            "width": 200,
+                            "xtype": "",
+                            "items": null
+                        }]
+                    }) ;   
+
+                }
+            }
+        });
+
+    }
+});

+ 5 - 0
frontend/saas-web/app/view/sale/sale/QueryPanelModel.js

@@ -0,0 +1,5 @@
+Ext.define('saas.view.sale.sale.QueryPanelModel', {
+    extend: 'saas.view.core.query.QueryPanelModel',
+    alias: 'viewmodel.sale-sale-querypanel'
+
+});

+ 158 - 0
frontend/saas-web/app/view/sale/saleIn/FormController.js

@@ -0,0 +1,158 @@
+Ext.define('saas.view.sale.sale.FormController', {
+    extend: 'saas.view.core.form.FormPanelController',
+    alias: 'controller.sale-sale-formcontroller',
+    init: function (form) {
+        var me = this;
+        this.control({
+            /**放大镜新增demo*/
+            "field[name=combo]":{
+                beforerender:function(f){
+                    f.addHandler=me.addCombo;
+                }
+            },
+            //放大镜赋值关系 以及 tpl模板
+            'dbfindtrigger[name=sa_custcode]':{
+                beforerender:function(f){
+                    Ext.apply(f,{
+                        dataUrl:'http://192.168.0.181:8570/api/document/customer/getCustomerByCondition',
+                        dbfinds:[{
+                            from:'cu_id',to:'sa_custid'
+                        },{
+                            from:'cu_code',to:'sa_custcode'
+                        },{
+                            from:'cu_name',to:'sa_custname'
+                        }],
+                        dbtpls:[{
+                            field:'cu_code',width:100
+                        },{
+                            field:'cu_name',width:100
+                        }],
+                        dbColumns:[{
+                            conditionCode:'cu_id',
+                            "text": "客户ID",
+                            "flex": 0,
+                            "dataIndex": "cu_id",
+                            "width": 0,
+                            "xtype": "",
+                            "items": null
+                        },{
+                            conditionCode:'cu_code',
+                            "text": "客户编号",
+                            "flex": 1,
+                            "dataIndex": "cu_code",
+                            "width": 100,
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            conditionCode:'cu_name',
+                            "text": "客户名称",
+                            "flex": 1,
+                            "dataIndex": "cu_name",
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            conditionCode:'cu_type',
+                            "text": "客户类型",
+                            "flex": 0,
+                            "dataIndex": "cu_type",
+                            "width": 200,
+                            "xtype": "",
+                            "items": null
+                        }]
+                    }) ;   
+
+                }
+            },
+            //放大镜赋值关系 以及 tpl模板
+            'dbfindtrigger[name=pd_prodcode]':{
+                beforerender:function(f){
+                    Ext.apply(f,{
+                        conditionCode:'pr_code',
+                        dataUrl:'http://192.168.0.181:8570/api/document/product/getProductsByCondition',
+                        dbfinds:[{
+                            from:'pr_code',to:'sd_prodcode'
+                        }],
+                        dbtpls:[{
+                            field:'pr_code',width:100
+                        },{
+                            field:'pr_detail',width:100
+                        }],
+                        dbColumns:[{
+                            "text": "物料ID",
+                            "flex": 0,
+                            "dataIndex": "pr_id",
+                            "width": 0,
+                            "xtype": "",
+                            "items": null
+                        },{
+                            "text": "物料编号",
+                            "flex": 1,
+                            "dataIndex": "pr_code",
+                            "width": 100,
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            "text": "物料名称",
+                            "flex": 1,
+                            "dataIndex": "pr_detail",
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            "text": "物料规格",
+                            "flex": 0,
+                            "dataIndex": "pr_spec",
+                            "width": 200,
+                            "xtype": "",
+                            "items": null
+                        }]
+                    }) ;   
+
+                }
+            }
+        });
+
+    },
+    addCombo:function(){
+        var combo=this.ownerCmp;
+        Ext.create('Ext.window.Window',{
+            layout:'vbox',
+            bodyPadding: 15,
+            width:500,
+            items:[{
+                fieldLabel:'实际值',
+                xtype:'textfield'
+            },{
+                fieldLabel:'显示值',
+                xtype:'textfield'
+            }],
+            buttons:[{
+                text:'确认',
+                handler:function(b){
+                    combo.setValue('ok');
+                    b.up('window').close();
+                }
+            }],
+            renderTo:this.ownerCmp.ownerCt.getEl()
+        }).show();
+
+    },
+
+    turnOut: function() {
+        var me = this,
+        form = me.getView(),
+        id = form.getForm().findField(form._idField);
+        form.BaseUtil.request({
+            url: form._turnOutUrl+id.value,
+            method: 'GET',
+        })
+        .then(function(res) {
+            var localJson = new Ext.decode(res.responseText);
+            if(localJson.success){
+                Ext.Msg.alert('提示','转单成功');
+            }
+        })
+        .catch(function() {
+            Ext.Msg.alert('提示','转单失败');
+        });
+     }
+});

+ 5 - 0
frontend/saas-web/app/view/sale/saleIn/FormModel.js

@@ -0,0 +1,5 @@
+Ext.define('saas.view.sale.sale.FormModel', {
+    extend: 'saas.view.core.form.FormPanelModel',
+    alias: 'viewmodel.sale-sale-formmodel',
+
+});

+ 267 - 0
frontend/saas-web/app/view/sale/saleIn/FormPanel.js

@@ -0,0 +1,267 @@
+Ext.define('saas.view.sale.sale.FormPanel', {
+    extend: 'saas.view.core.form.FormPanel',
+    xtype: 'sale-sale-formpanel',
+
+    controller: 'sale-sale-formcontroller',
+    viewModel: 'sale-sale-formmodel',
+    
+    caller:'Sale',
+    
+     //字段属性
+     _title:'销售订单',
+     _idField: 'id',
+     _codeField: 'sa_code',
+     _statusField: 'sa_status',
+     _statusCodeField: 'sa_statuscode',
+     _detnoColumn:  'sd_detno',
+     _relationColumn: 'sd_puid',
+     _readUrl:'',
+     _saveUrl:'',
+     _auditUrl:'',
+     _deleteUrl:'',
+     _deleteDetailUrl:'',
+     _turnInUrl:'',
+     _turnOutUrl:'',
+     initId:0,
+ 
+     toolBtns: [{
+         xtype: 'button',
+         text: '转出货单',
+         handler: 'turnIn'
+     }],
+
+    defaultItems: [{
+        xtype: 'hidden',
+        name: 'id',
+        bind: '{id}',
+        fieldLabel: 'id',
+        allowBlank: true,
+        columnWidth: 0
+    }, {
+        xtype : "textfield", 
+        name : "sa_code", 
+        bind : "{sa_code}", 
+        fieldLabel : "销售单号", 
+        allowBlank : true, 
+        columnWidth : 0.25
+    }, {
+        xtype : "hidden", 
+        name : "sa_cudid", 
+        bind : "{sa_cudid}", 
+        fieldLabel : "客户ID", 
+        allowBlank : true, 
+        columnWidth : 0.0
+    }, {
+        xtype : "textfield", 
+        name : "sa_cucode", 
+        bind : "{sa_cucode}", 
+        fieldLabel : "客户编号", 
+        hidden:true,
+        allowBlank : true, 
+        columnWidth : 0, 
+    }, {
+        xtype : "dbfindtrigger", 
+        name : "sa_cuname", 
+        bind : "{sa_cuname}", 
+        fieldLabel : "客户名称", 
+        allowBlank : true, 
+        columnWidth : 0.25
+    },{
+        xtype : "datefield", 
+        name : "sa_recorddate", 
+        bind : "{sa_recorddate}", 
+        fieldLabel : "订单日期", 
+        allowBlank : false, 
+        columnWidth : 0.25
+    }, {
+        xtype : "textfield", 
+        name : "sa_recorder", 
+        bind : "{sa_recorder}", 
+        fieldLabel : "录入人", 
+        allowBlank : true, 
+        readOnly:true,
+        columnWidth : 0.0
+    }, {
+        xtype : "textfield", 
+        name : "sa_toplace", 
+        bind : "{sa_toplace}", 
+        fieldLabel : "交货地址", 
+        allowBlank : true, 
+        columnWidth : 0.25
+    }, {
+        xtype : "textfield", 
+        name : "sa_total", 
+        bind : "{sa_total}", 
+        fieldLabel : "单据金额", 
+        allowBlank : true, 
+        columnWidth : 0.25
+    }, {
+        xtype : "textfield", 
+        name : "sa_remark", 
+        bind : "{sa_remark}", 
+        fieldLabel : "备注", 
+        allowBlank : true, 
+        columnWidth : 1
+    },{
+        xtype : "textfield", 
+        name : "sa_sendstatus", 
+        bind : "{sa_sendstatus}", 
+        fieldLabel : "出货状态", 
+        allowBlank : true, 
+        readOnly:true,
+        columnWidth : 0
+    }, {
+        name : "detailGridField", 
+        xtype : "detailGridField", 
+        columns : [
+            {
+                text : "序号", 
+                dataIndex : "sd_detno", 
+                width : 100, 
+                xtype : "numbercolumn",
+                align : 'center',
+                format:'0',
+                summaryType: 'count',
+                summaryRenderer: function(value, summaryData, dataIndex) {
+                    return Ext.String.format('合计: {0}条', value);
+                },
+            }, {
+                text : "id", 
+                dataIndex : "id", 
+                xtype : "numbercolumn"
+            },
+            {
+                text : "物料编号", 
+                width : 200.0, 
+                dataIndex : "sd_prodcode", 
+                xtype : "", 
+                items : null,
+                editor : {
+                    displayField : "display", 
+                    editable : true, 
+                    format : "", 
+                    hideTrigger : false, 
+                    maxLength : 100.0, 
+                    minValue : null, 
+                    positiveNum : false, 
+                    queryMode : "local", 
+                    store : null, 
+                    valueField : "value", 
+                    xtype : "dbfindtrigger"
+                }
+            },
+            {
+                text : "名称", 
+                dataIndex : "pr_detail",
+                ignore:true
+            },
+            {
+                text : "规格", 
+                dataIndex : "pr_spec",
+                ignore:true
+            },
+            {
+                text : "数量", 
+                dataIndex : "sd_qty", 
+                editor : {
+                    xtype : "numberfield"
+                },
+                width : 120.0, 
+                xtype : "numbercolumn", 
+                format:'0',
+                items : null,
+                summaryType: 'sum'
+            },
+            {
+                text : "单价", 
+                editor : {
+                    xtype : "numberfield"
+                },
+                format:'0,000.00',
+                dataIndex : "sd_price", 
+                width : 120.0, 
+                xtype : "numbercolumn",
+                items : null,
+                summaryType: 'sum'
+            }, 
+            {
+                text : "税率", 
+                editor : {
+                    xtype : "numberfield"
+                },
+                dataIndex : "sd_taxrate", 
+                width : 120.0, 
+                xtype : "numbercolumn", 
+                items : null
+            },
+            {
+                text : "含税金额", 
+                dataIndex : "sd_total", 
+                width : 120.0, 
+                xtype : "numbercolumn"
+            }, 
+            {
+                text : "未税金额", 
+                dataIndex : "sd_nettotal", 
+                xtype : "numbercolumn"
+            },{
+                text : "交货日期", 
+                dataIndex : "sd_delivery", 
+                flex : 1.0, 
+                xtype:'datecolumn',
+                format : "Y-m-d H:i:s", 
+                editor : {
+                    xtype : "datefield",
+                    editable : true, 
+                    format : "Y-m-d H:i:s", 
+                    hideTrigger : false
+                }
+            },
+            {
+                text : "已转数", 
+                dataIndex : "sd_yqty", 
+                editor : {
+                    xtype : "numberfield"
+                },
+                width : 120.0, 
+                xtype : "numbercolumn", 
+                format:'0',
+                items : null,
+                summaryType: 'sum'
+            },
+        ]
+    }, {
+        format : "Y-m-d", 
+        xtype : "datefield", 
+        name : "createTime", 
+        bind : "{createTime}", 
+        fieldLabel : "创建时间", 
+        allowBlank : true, 
+        columnWidth : 0.25
+    }, {
+        xtype : "datefield", 
+        name : "updateTime", 
+        bind : "{updateTime}", 
+        fieldLabel : "更新时间", 
+        allowBlank : true, 
+        columnWidth : 0.25
+    }, {
+        xtype : "textfield", 
+        readOnly : true, 
+        editable : false, 
+        name : "sa_status", 
+        bind : "{sa_status}", 
+        fieldLabel : "单据状态", 
+        allowBlank : true, 
+        columnWidth : 0.25
+    }, {
+        xtype : "hidden", 
+        readOnly : true, 
+        editable : false, 
+        name : "sa_statuscode", 
+        bind : "{sa_statuscode}", 
+        fieldLabel : "单据状态码", 
+        allowBlank : true, 
+        columnWidth : 0.0
+    }]
+});

+ 206 - 0
frontend/saas-web/app/view/sale/saleIn/QueryPanel.js

@@ -0,0 +1,206 @@
+Ext.define('saas.view.sale.sale.QueryPanel', {
+    extend: 'saas.view.core.query.QueryPanel',
+    xtype: 'sale-sale-querypanel',
+
+    controller: 'sale-sale-querypanel',
+    viewModel: 'sale-sale-querypanel',
+    viewName: 'sale-sale-formpanel',
+    _idField: 'sa_id',
+    _codeField: 'sa_code',
+    queryFormItems: [{
+        xtype: 'hidden',
+        name: 'sa_id',
+        bind: '{sa_id}',
+        fieldLabel: 'ID',
+        allowBlank: true,
+        columnWidth: 0
+    }, {
+        xtype: 'textfield',
+        name: 'sa_code',
+        bind: '{sa_code}',
+        fieldLabel: '单据编号',
+        allowBlank: true,
+        columnWidth: 0.25
+    }, {
+        xtype: 'condatefield',
+        name: 'sa_recorddate',
+        bind: '{sa_recorddate}',
+        fieldLabel: '单据日期',
+        allowBlank: true,
+        columnWidth: 0.5
+    }, {
+        xtype: 'dbfindtrigger',
+        name: 'sa_custcode',
+        bind: '{sa_custcode}',
+        fieldLabel: '客户编号',
+        allowBlank: true,
+        columnWidth: 0.25
+    }, {
+        xtype: 'textfield',
+        name: 'sa_custname',
+        bind: '{sa_custname}',
+        fieldLabel: '客户名称',
+        allowBlank: true,
+        columnWidth: 0.25
+    }, {
+        xtype: 'dbfindtrigger',
+        name: 'pd_prodcode#pd_prodcode',
+        bind: '{pd_prodcode}',
+        fieldLabel: '物料编号',
+        fieldMode: 'DETAIL',
+        queryType: 'VAG',
+        allowBlank: true,
+        columnWidth: 0.25
+    }, {
+        xtype: 'textfield',
+        name: 'pr_detail',
+        bind: '{pr_detail}',
+        fieldLabel: '物料名称',
+        allowBlank: true,
+        columnWidth: 0.25
+    }, {
+        xtype: 'combobox',
+        name: 'sa_statuscode',
+        bind: '{sa_statuscode}',
+        fieldLabel: '审核状态',
+        allowBlank: true,
+        columnWidth: 0.25,
+        queryMode: 'local',
+        displayField: 'sa_status',
+        valueField: 'sa_statuscode',
+        editable:false,
+        store: Ext.create('Ext.data.ArrayStore', {
+        fields: ['sa_statuscode', 'sa_status'],
+        data: [
+            ["$ALL", "全部"],
+            ["AUDITED", "已审核"],
+            ["UNAUDITED", "未审核"]
+        ]
+        })
+    }, {
+        xtype: 'multicombo',
+        name: 'sa_sendstatuscode',
+        bind: '{sa_sendstatuscode}',
+        fieldLabel: '出库状态',
+        allowBlank: true,
+        columnWidth: 0.25,
+        datas: [
+            ["TURNOUT", "已出库"],
+            ["UNTURNOUT", "未出库"],
+            ["PARTOUT", "部分出库"]
+        ]
+    }],
+    moreQueryFormItems: [{
+        xtype: 'textfield',
+        name: 'pu_buyername',
+        bind: '{pu_buyername}',
+        fieldLabel: '采购员',
+        allowBlank: true
+    }],
+    queryGridConfig: {
+        _idField: 'sa_id',
+        _codeField: 'sa_code',
+        _title: '销售订单',
+        _defaultCondition:'',
+        _addXtype: 'sale-sale-formpanel',
+        _baseVastUrl: 'http://192.168.0.181:8560/api/sale/sale/',
+        _baseColumn: [{
+            text: '序号',
+            width: 80,
+            xtype: 'rownumberer'
+        }, {
+            text: 'id',
+            dataIndex: 'sa_id',
+            width: 100,
+            xtype: 'numbercolumn'
+        }, {
+            text: '单据编号',
+            dataIndex: 'sa_code',
+            width: 120
+        }, {
+            text: '单据状态',
+            dataIndex: 'sa_status',
+            width: 120
+        }, {
+            text: '单据日期',
+            dataIndex: 'sa_recorddate',
+            xtype: 'datecolumn',
+            width: 200
+        }, {
+            text: '客户名称',
+            dataIndex: 'sa_cuname',
+            width: 120
+        }, {
+            text: '金额',
+            dataIndex: 'sa_total',
+            xtype: 'numbercolumn',
+            width: 120
+        }],
+        _relativeColumn: [{
+            text: '序号',
+            width: 80,
+            xtype: 'rownumberer'
+        }, {
+            text: 'id',
+            dataIndex: 'sa_id',
+            width: 100,
+            xtype: 'numbercolumn'
+        }, {
+            text: '单据编号',
+            dataIndex: 'sa_code',
+            width: 120
+        }, {
+            text: '单据状态',
+            dataIndex: 'sa_status',
+            width: 120
+        }, {
+            text: '下单日期',
+            dataIndex: 'sa_recorddate',
+            xtype: 'datecolumn',
+            width: 200
+        }, {
+            text: '客户名称',
+            dataIndex: 'sa_cuname',
+            width: 120
+        }, {
+            text: '明细序号',
+            dataIndex: 'sd_detno',
+            xtype: 'numbercolumn',
+            width: 120
+        }, {
+            text: '物料编号',
+            dataIndex: 'sd_prodcode',
+            width: 120
+        }, {
+            text: '数量',
+            dataIndex: 'sd_qty',
+            xtype: 'numbercolumn',
+            width: 120
+        }, {
+            text: '单价',
+            dataIndex: 'sd_price',
+            xtype: 'numbercolumn',
+            width: 120
+        }, {
+            text: '已转数',
+            dataIndex: 'sd_ytqy',
+            xtype: 'numbercolumn',
+            width: 120
+        }, {
+            text: '已出货数',
+            dataIndex: 'sd_sendqty',
+            xtype: 'numbercolumn',
+            width: 120
+        }, {
+            text: '已审核采购单数',
+            dataIndex: 'sd_pdqty',
+            xtype: 'numbercolumn',
+            width: 120
+        }, {
+            text: '备注',
+            dataIndex: 'sd_remark',
+            width: 250,
+            flex: 1
+        }]
+    }
+});

+ 116 - 0
frontend/saas-web/app/view/sale/saleIn/QueryPanelController.js

@@ -0,0 +1,116 @@
+Ext.define('saas.view.sale.sale.QueryPanelController', {
+    extend: 'saas.view.core.query.QueryPanelController',
+    alias: 'controller.sale-sale-querypanel',
+    init: function (form) {
+        var me = this;
+        this.control({
+            //放大镜赋值关系 以及 tpl模板
+            'dbfindtrigger[name=sa_custcode]':{
+                beforerender:function(f){
+                    Ext.apply(f,{
+                        dataUrl:'http://192.168.0.181:8570/api/document/customer/getCustomerByCondition',
+                        dbfinds:[{
+                            from:'cu_id',to:'sa_custid'
+                        },{
+                            from:'cu_code',to:'sa_custcode'
+                        },{
+                            from:'cu_name',to:'sa_custname'
+                        }],
+                        dbtpls:[{
+                            field:'cu_code',width:100
+                        },{
+                            field:'cu_name',width:100
+                        }],
+                        dbColumns:[{
+                            conditionCode:'cu_id',
+                            "text": "客户ID",
+                            "flex": 0,
+                            "dataIndex": "cu_id",
+                            "width": 0,
+                            "xtype": "",
+                            "items": null
+                        },{
+                            conditionCode:'cu_code',
+                            "text": "客户编号",
+                            "flex": 1,
+                            "dataIndex": "cu_code",
+                            "width": 100,
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            conditionCode:'cu_name',
+                            "text": "客户名称",
+                            "flex": 1,
+                            "dataIndex": "cu_name",
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            conditionCode:'cu_type',
+                            "text": "客户类型",
+                            "flex": 0,
+                            "dataIndex": "cu_type",
+                            "width": 200,
+                            "xtype": "",
+                            "items": null
+                        }]
+                    }) ;   
+
+                }
+            },
+            //放大镜赋值关系 以及 tpl模板
+            'dbfindtrigger[name=pd_prodcode]':{
+                beforerender:function(f){
+                    Ext.apply(f,{
+                        conditionCode:'pr_code',
+                        dataUrl:'http://192.168.253.41:9480/api/document/product/getProductsByCondition',
+                        dbfinds:[{
+                            from:'pr_code',to:'sd_prodcode'
+                        }],
+                        dbtpls:[{
+                            field:'pr_code',width:100
+                        },{
+                            field:'pr_detail',width:100
+                        }],
+                        dbColumns:[{
+                            "text": "物料ID",
+                            "flex": 0,
+                            "dataIndex": "pr_id",
+                            "width": 0,
+                            "xtype": "",
+                            "items": null
+                        },{
+                            "text": "物料编号",
+                            "flex": 1,
+                            "dataIndex": "pr_code",
+                            "width": 100,
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            "text": "物料名称",
+                            "flex": 1,
+                            "dataIndex": "pr_detail",
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            "text": "物料规格",
+                            "flex": 0,
+                            "dataIndex": "pr_spec",
+                            "width": 200,
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            "text": "物料单位",
+                            "flex": 0,
+                            "dataIndex": "pr_unit",
+                            "width": 200,
+                            "xtype": "",
+                            "items": null
+                        }]
+                    }) ;   
+
+                }
+            }
+        });
+
+    }
+});

+ 5 - 0
frontend/saas-web/app/view/sale/saleIn/QueryPanelModel.js

@@ -0,0 +1,5 @@
+Ext.define('saas.view.sale.sale.QueryPanelModel', {
+    extend: 'saas.view.core.query.QueryPanelModel',
+    alias: 'viewmodel.sale-sale-querypanel'
+
+});

+ 19 - 0
frontend/saas-web/overrides/i18n.js

@@ -0,0 +1,19 @@
+var basePath = '';
+
+function openTab(xtype, title, id) {
+    var mainTab = Ext.getCmp('main-tab-panel');
+    var panel = Ext.getCmp(id);
+    if(!panel) {
+        panel = Ext.create('saas.view.core.tab.Panel', {
+            id: id,
+            title: title,
+            viewType: xtype
+        });
+
+        Ext.suspendLayouts();
+        mainTab.setActiveTab(mainTab.add(panel));
+        Ext.resumeLayouts(true);
+    }else {
+        mainTab.setActiveTab(panel);
+    }
+}