Browse Source

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

zhoudw 7 years ago
parent
commit
aa1004fe20

+ 11 - 1
frontend/saas-web/app/view/main/MainModel.js

@@ -28,7 +28,6 @@ Ext.define('saas.view.main.MainModel', {
                                     {
                                         id: 'purchaseOrder',
                                         text: '采购单(维护界面)',
-                                        //viewType: 'purchase-list-gridpanel',
                                         viewType:'purchase-purchase-formpanel',
                                         leaf: true
                                     },{
@@ -47,6 +46,17 @@ Ext.define('saas.view.main.MainModel', {
                                         viewType:'purchase-purchaseIn-querypanel',
                                         leaf: true
                                     },{
+                                        id: 'purchaseOutOrder',
+                                        text: '采购验退单(维护界面)',
+                                        viewType:'purchase-purchaseOut-formpanel',
+                                        leaf: true
+                                    },{
+                                        id: 'purchaseOutQuery',
+                                        text: '采购验退单查询',
+                                        viewType:'purchase-purchaseOut-querypanel',
+                                        leaf: true
+                                    },
+                                    {
                                         id: 'list1',
                                         text: '列表界面1',
                                         viewType: 'purchase-list-gridpanel1',

+ 62 - 46
frontend/saas-web/app/view/purchase/purchase/FormPanel.js

@@ -5,26 +5,28 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
     controller: 'purchase-purchase-formcontroller',
     viewModel: 'purchase-purchase-formmodel',
     
-    _title:'采购单',
-    _codeField: 'pu_ode',
-    _statusField: 'pu_status',
-    _statusCodeField: 'pu_statuscode',
-    _idField: 'id',
-    _detnoColumn:  'pd_detno',
-    _dataModelUrl:'http://192.168.253.58:8800/purchase/read/',
-    _saveUrl:'http://192.168.253.58:8800/purchase/save',
-    _auditUrl:'http://192.168.253.58:8800/purchase/audit',
-    _deleteUrl:'http://192.168.253.58:8800/purchase/delete/',
-    _deleteDetailUrl:'http://192.168.253.58:8800/purchase/deleteItem/',
-    initId:0,
-
-    toolBtns: [{
-        xtype: 'button',
-        text: '转单按钮',
-        handler: function() {
-            console.log('11');
-        }
-    }],
+     //字段属性
+     _title:'采购单',
+     _idField: 'id',
+     _codeField: 'pu_code',
+     _statusField: 'pu_status',
+     _statusCodeField: 'pu_statuscode',
+     _detnoColumn:  'pd_detno',
+     _relationColumn: 'pd_puid',
+     _readUrl:'http://192.168.253.58:8800/purchase/read/',
+     _saveUrl:'http://192.168.253.58:8800/purchase/save',
+     _auditUrl:'http://192.168.253.58:8800/purchase/audit',
+     _deleteUrl:'http://192.168.253.58:8800/purchase/delete/',
+     _deleteDetailUrl:'http://192.168.253.58:8800/purchase/deleteItem/',
+     initId:0,
+ 
+     toolBtns: [{
+         xtype: 'button',
+         text: '转单按钮',
+         handler: function() {
+             console.log('11');
+         }
+     }],
 
     defaultItems: [{
         xtype: 'hidden',
@@ -108,23 +110,29 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
     }, {
         name : "detailGridField", 
         xtype : "detailGridField", 
-        bind: {
-            store:{
-                data:'{detailGridField}'
-            }
-        },
         columns : [
             {
                 text : "序号", 
-                dataIndex : "pdDetno", 
-                width : 80.0, 
-                xtype : "rownumberer"
+                dataIndex : "pd_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 : "pd_prodcode", 
+                xtype : "", 
+                items : null,
                 editor : {
                     displayField : "display", 
                     editable : true, 
@@ -137,39 +145,47 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
                     store : null, 
                     valueField : "value", 
                     xtype : "dbfindtrigger"
-                }, 
-                text : "物料编号", 
-                width : 200.0, 
-                dataIndex : "pd_prodcode", 
-                xtype : "", 
-                items : null
+                }
             },
             {
-                text : "单位", 
-                editor : {
-                    xtype : "textfield"
-                }, 
-                dataIndex : "pd_unit", 
-                width : 120.0, 
-                xtype : "", 
-                items : null
-            }, 
+                text : "名称", 
+                dataIndex : "pr_detail",
+                ignore:true
+            },
+            {
+                text : "规格", 
+                dataIndex : "pr_spec",
+                ignore:true
+            },
             {
                 text : "数量", 
                 dataIndex : "pd_yqty", 
+                editor : {
+                    xtype : "numberfield"
+                },
                 width : 120.0, 
                 xtype : "numbercolumn", 
-                items : null
+                format:'0',
+                items : null,
+                summaryType: 'sum'
             }, 
             {
                 text : "单价", 
+                editor : {
+                    xtype : "numberfield"
+                },
+                format:'0,000.00',
                 dataIndex : "pd_price", 
                 width : 120.0, 
-                xtype : "numbercolumn", 
-                items : null
+                xtype : "numbercolumn",
+                items : null,
+                summaryType: 'sum'
             }, 
             {
                 text : "税率", 
+                editor : {
+                    xtype : "numberfield"
+                },
                 dataIndex : "pd_taxrate", 
                 width : 120.0, 
                 xtype : "numbercolumn", 

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

@@ -88,7 +88,7 @@ Ext.define('saas.view.purchase.purchase.QueryPanel', {
         columnWidth: 0.25,
         datas: [
             ["TURNIN", "已入库"],
-            ["NOIN", "未入库"],
+            ["UNTURNIN", "未入库"],
             ["PARTIN", "部分入库"]
         ]
     }],

+ 1 - 5
frontend/saas-web/app/view/purchase/purchase/QueryPanelModel.js

@@ -1,9 +1,5 @@
 Ext.define('saas.view.purchase.purchase.QueryPanelModel', {
     extend: 'saas.view.core.query.QueryPanelModel',
-    alias: 'viewmodel.purchase-purchase-querypanel',
+    alias: 'viewmodel.purchase-purchase-querypanel'
 
-    data: {
-       // pu_total: '3333',
-        //pu_code: '4'
-    }
 });

+ 56 - 85
frontend/saas-web/app/view/purchase/purchaseIn/FormPanel.js

@@ -6,17 +6,18 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
     viewModel: 'purchase-purchaseIn-formmodel',
     
     _title:'采购验收单',
+    _idField: 'id',
     _codeField: 'pi_inoutno',
     _statusField: 'pu_status',
     _statusCodeField: 'pu_statuscode',
-    _idField: 'id',
     _detnoColumn:  'pd_pdno',
-    _dataModelUrl:'http://192.168.253.58:8800/purchase/read/',
+    _relationColumn: 'pd_piid',
+    _readUrl:'http://192.168.253.58:8800/purchase/read/',
     _saveUrl:'http://192.168.253.58:8800/purchase/save',
     _auditUrl:'http://192.168.253.58:8800/purchase/audit',
     _deleteUrl:'http://192.168.253.58:8800/purchase/delete/',
     _deleteDetailUrl:'http://192.168.253.58:8800/purchase/deleteItem/',
-    initId:0,
+    initId:11,
 
     toolBtns: [{
         xtype: 'button',
@@ -44,95 +45,80 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
         xtype : "textfield", 
         name : "pi_class", 
         bind : "{pi_class}", 
-        fieldLabel : "类型", 
+        fieldLabel : "单据类型", 
         readOnly:true,
         allowBlank : true, 
         columnWidth : 0.25
     }, {
         xtype : "hidden", 
-        name : "pu_vendid", 
-        bind : "{pu_vendid}", 
+        name : "pi_vendid", 
+        bind : "{pi_vendid}", 
         fieldLabel : "供应商ID", 
         allowBlank : true, 
         columnWidth : 0.0
     }, {
         xtype : "textfield", 
-        name : "pu_vendcode", 
-        bind : "{pu_vendcode}", 
+        name : "pi_vendcode", 
+        bind : "{pi_vendcode}", 
         fieldLabel : "供应商编号", 
         hidden:true,
         allowBlank : true, 
         columnWidth : 0, 
     }, {
         xtype : "dbfindtrigger", 
-        name : "pu_vendname", 
-        bind : "{pu_vendname}", 
+        name : "pi_vendname", 
+        bind : "{pi_vendname}", 
         fieldLabel : "供应商名称", 
         allowBlank : true, 
         columnWidth : 0.25
     },{
         xtype : "datefield", 
-        name : "pu_date", 
-        bind : "{pu_date}", 
-        fieldLabel : "采购日期", 
+        name : "pi_date", 
+        bind : "{pi_date}", 
+        fieldLabel : "单据日期", 
         allowBlank : false, 
         columnWidth : 0.25
-    }, {
-        xtype : "hidden", 
-        name : "pu_buyerid", 
-        bind : "{pu_buyerid}", 
-        fieldLabel : "采购员ID", 
-        allowBlank : true, 
-        columnWidth : 0.0
-    }, {
-        xtype : "textfield", 
-        name : "pu_buyercode", 
-        bind : "{pu_buyercode}", 
-        fieldLabel : "采购员编号", 
-        allowBlank : true, 
-        hidden:true,
-        columnWidth : 0
-    }, {
-        xtype : "dbfindtrigger", 
-        name : "pu_buyername", 
-        bind : "{pu_buyername}", 
-        fieldLabel : "采购员名称", 
-        allowBlank : true, 
-        columnWidth : 0.25
-    }, {
+    },{
         xtype : "textfield", 
-        name : "pu_shipaddresscode", 
-        bind : "{pu_shipaddresscode}", 
-        fieldLabel : "交货地址", 
-        allowBlank : true, 
+        name : "pi_total", 
+        bind : "{pi_total}", 
+        fieldLabel : "总额", 
+        allowBlank : true,
+        readOnly: true,
         columnWidth : 0.25
     }, {
         xtype : "textfield", 
-        name : "pu_total", 
-        bind : "{pu_total}", 
-        fieldLabel : "单据金额", 
+        name : "pi_pucode", 
+        bind : "{pi_pucode}", 
+        fieldLabel : "采购单号", 
         allowBlank : true, 
         columnWidth : 0.25
     }, {
         name : "detailGridField", 
         xtype : "detailGridField", 
-        bind: {
-            store:{
-                data:'{detailGridField}'
-            }
-        },
         columns : [
             {
                 text : "序号", 
                 dataIndex : "pd_pdno", 
-                width : 80.0, 
-                xtype : "rownumberer"
+                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 : "pd_prodcode", 
+                xtype : "", 
+                items : null,
                 editor : {
                     displayField : "display", 
                     editable : true, 
@@ -145,35 +131,34 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
                     store : null, 
                     valueField : "value", 
                     xtype : "dbfindtrigger"
-                }, 
-                text : "物料编号", 
-                width : 200.0, 
-                dataIndex : "pd_prodcode", 
-                xtype : "", 
-                items : null
+                }
             },
             {
-                text : "单位", 
-                editor : {
-                    xtype : "textfield"
-                }, 
-                dataIndex : "pd_unit", 
-                width : 120.0, 
-                xtype : "", 
-                items : null
+                text : "名称", 
+                dataIndex : "pr_detail",
+                ignore:true
+            },
+            {
+                text : "规格", 
+                dataIndex : "pr_spec",
+                ignore:true
             }, 
             {
                 text : "数量", 
                 dataIndex : "pd_inqty", 
+                editor : {
+                    xtype : "numberfield"
+                },
                 width : 120.0, 
                 xtype : "numbercolumn", 
-                items : null
+                format:'0',
+                items : null,
+                summaryType: 'sum'
             }, 
             {
                 text : "仓库", 
                 dataIndex : "pd_whname", 
                 width : 120.0, 
-                xtype : "numbercolumn", 
                 items : null,
                 editor : {
                     displayField : "display", 
@@ -216,21 +201,7 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
             {
                 text : "采购单号", 
                 dataIndex : "pd_ordercode", 
-                width : 120.0,
-                flex : 1.0,
-                editor : {
-                    displayField : "display", 
-                    editable : true, 
-                    format : "", 
-                    hideTrigger : false, 
-                    maxLength : 100.0, 
-                    minValue : null, 
-                    positiveNum : false, 
-                    queryMode : "local", 
-                    store : null, 
-                    valueField : "value", 
-                    xtype : "dbfindtrigger"
-                }
+                width : 120.0
             },{
                 text : "采购序号", 
                 dataIndex : "pd_orderdetno", 
@@ -257,8 +228,8 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
         xtype : "textfield", 
         readOnly : true, 
         editable : false, 
-        name : "pu_status", 
-        bind : "{pu_status}", 
+        name : "pi_status", 
+        bind : "{pi_status}", 
         fieldLabel : "单据状态", 
         allowBlank : true, 
         columnWidth : 0.25
@@ -266,8 +237,8 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
         xtype : "hidden", 
         readOnly : true, 
         editable : false, 
-        name : "pu_statuscode", 
-        bind : "{pu_statuscode}", 
+        name : "pi_statuscode", 
+        bind : "{pi_statuscode}", 
         fieldLabel : "单据状态码", 
         allowBlank : true, 
         columnWidth : 0.0

+ 57 - 56
frontend/saas-web/app/view/purchase/purchaseIn/QueryPanel.js

@@ -23,29 +23,29 @@ Ext.define('saas.view.purchase.purchaseIn.QueryPanel', {
         columnWidth: 0.25
     }, {
         xtype: 'condatefield',
-        name: 'pu_date',
-        bind: '{pu_date}',
-        fieldLabel: '采购日期',
+        name: 'pi_date',
+        bind: '{pi_date}',
+        fieldLabel: '单据日期',
         allowBlank: true,
         columnWidth: 0.5
     }, {
         xtype: 'textfield',
-        name: 'pu_vendcode',
-        bind: '{pu_vendcode}',
+        name: 'pi_vendcode',
+        bind: '{pi_vendcode}',
         fieldLabel: '供应商编号',
         allowBlank: true,
         hidden:true,
         columnWidth: 0.25
     }, {
         xtype: 'textfield',
-        name: 'pu_vendname',
-        bind: '{pu_vendname}',
+        name: 'pi_vendname',
+        bind: '{pi_vendname}',
         fieldLabel: '供应商名称',
         allowBlank: true,
         columnWidth: 0.25
     }, {
         xtype: 'dbfindtrigger',
-        name: 'pd_prodcode#pd_prodcode',
+        name: 'pd_prodcode',
         bind: '{pd_prodcode}',
         fieldLabel: '物料编号',
         fieldMode: 'DETAIL',
@@ -55,48 +55,29 @@ Ext.define('saas.view.purchase.purchaseIn.QueryPanel', {
         columnWidth: 0.25
     }, {
         xtype: 'dbfindtrigger',
-        name: 'pr_detail',
+        name: 'pr_detail#pd_prodcode',
         bind: '{pr_detail}',
         fieldLabel: '物料名称',
         allowBlank: true,
         columnWidth: 0.25
     }, {
         xtype: 'combobox',
-        name: 'pr_statuscode',
-       // bind: '{pr_statuscode}',
+        name: 'pi_statuscode',
+        bind: '{pi_statuscode}',
         fieldLabel: '审核状态',
         allowBlank: true,
         columnWidth: 0.25,
         queryMode: 'local',
-        displayField: 'pr_status',
-        valueField: 'pr_statuscode',
+        displayField: 'pi_status',
+        valueField: 'pi_statuscode',
         store: Ext.create('Ext.data.ArrayStore', {
-            fields: ['pr_statuscode', 'pr_status'],
+            fields: ['pi_statuscode', 'pi_status'],
             data: [
                 ["$ALL", "全部"],
                 ["AUDITED", "已审核"],
                 ["UNAUDITED", "未审核"]
             ]
         })
-    }, {
-        xtype: 'combobox',
-        name: 'pu_acceptstatuscode',
-        bind: '{pu_acceptstatuscode}',
-        fieldLabel: '入库状态',
-        allowBlank: true,
-        columnWidth: 0.25,
-        queryMode: 'local',
-        displayField: 'pu_acceptstatus',
-        valueField: 'pu_acceptstatuscode',
-        store: Ext.create('Ext.data.ArrayStore', {
-            fields: ['pu_acceptstatuscode', 'pu_acceptstatus'],
-            datas: [
-                ["$ALL", "全部"],
-                ["TURNOUT", "已入库"],
-                ["NOOUT", "未入库"],
-                ["PARTOUT", "部分入库"]
-            ]
-        })
     }],
     moreQueryFormItems: [{
         xtype: 'textfield',
@@ -130,67 +111,77 @@ Ext.define('saas.view.purchase.purchaseIn.QueryPanel', {
             xtype: 'rownumberer'
         }, {
             text: 'id',
-            dataIndex: 'pu_id',
+            dataIndex: 'pi_id',
             width: 100,
             xtype: 'numbercolumn'
         }, {
             text: '单据编号',
-            dataIndex: 'pu_code',
+            dataIndex: 'pi_inoutno',
             width: 120
         }, {
             text: '单据状态',
-            dataIndex: 'pu_status',
+            dataIndex: 'pi_status',
             width: 120
         }, {
             text: '下单日期',
-            dataIndex: 'pu_indate',
+            dataIndex: 'pi_date',
             xtype:'datecolumn',
             width: 200
+        },{
+            text: '采购单号',
+            dataIndex: 'pi_pucode',
+            width: 200
         },{
             text: '供应商名称',
-            dataIndex: 'pu_vendname',
+            dataIndex: 'pi_vendname',
             width: 120
         },{
             text: '含税金额',
-            dataIndex: 'pu_taxtotal',
+            dataIndex: 'pi_total',
             xtype:'numbercolumn',
             width: 120
         },{
-            text: '金额',
-            dataIndex: 'pu_total',
+            text: '不含税金额',
+            dataIndex: 'pi_nettotal',
             xtype:'numbercolumn',
             width: 120,
             flex: 1
         }],
         _relativeColumn: [{
-            text: '序号',
-            width: 80,
-            xtype: 'rownumberer'
+            text : "序号", 
+            dataIndex : "pd_pdno", 
+            width : 100, 
+            xtype : "numbercolumn",
+            align : 'center'
         }, {
             text: 'id',
             dataIndex: 'pu_id',
-            width: 100,
+            width: 0,
             xtype: 'numbercolumn'
         }, {
             text: '单据编号',
-            dataIndex: 'pu_code',
+            dataIndex: 'pd_inoutno',
             width: 120
         }, {
             text: '单据状态',
-            dataIndex: 'pu_status',
+            dataIndex: 'pi_status',
             width: 120
         }, {
             text: '下单日期',
-            dataIndex: 'pu_indate',
+            dataIndex: 'pi_date',
             xtype:'datecolumn',
             width: 200
         },{
             text: '供应商名称',
-            dataIndex: 'pu_vendname',
+            dataIndex: 'pi_vendname',
+            width: 120
+        },{
+            text: '采购单号',
+            dataIndex: 'pd_ordercode',
             width: 120
         },{
             text: '采购序号',
-            dataIndex: 'pd_detno',
+            dataIndex: 'pd_orderdetno',
             xtype:'numbercolumn',
             width: 120
         },{
@@ -198,18 +189,28 @@ Ext.define('saas.view.purchase.purchaseIn.QueryPanel', {
             dataIndex: 'pd_prodcode',
             width: 120
         },{
-            text: '数量',
-            dataIndex: 'pd_qty',
+            text: '验收数量',
+            dataIndex: 'pd_inqty',
             xtype:'numbercolumn',
             width: 120
         },{
-            text: '单价',
-            dataIndex: 'pd_price',
+            text: '采购单价',
+            dataIndex: 'pd_orderprice',
+            xtype:'numbercolumn',
+            width: 120
+        },{
+            text: '金额',
+            dataIndex: 'pd_total',
             xtype:'numbercolumn',
             width: 120
         },{
-            text: '已转数',
-            dataIndex: 'pd_ytqy',
+            text: '税率',
+            dataIndex: 'pd_taxrate',
+            xtype:'numbercolumn',
+            width: 120
+        },{
+            text: '成本单价',
+            dataIndex: 'pd_price',
             xtype:'numbercolumn',
             width: 120,
             flex: 1

+ 1 - 5
frontend/saas-web/app/view/purchase/purchaseIn/QueryPanelModel.js

@@ -1,9 +1,5 @@
 Ext.define('saas.view.purchase.purchaseIn.QueryPanelModel', {
     extend: 'saas.view.core.query.QueryPanelModel',
-    alias: 'viewmodel.purchase-purchaseIn-queryformmodel',
+    alias: 'viewmodel.purchase-purchaseIn-queryformmodel'
 
-    data: {
-       // pu_total: '3333',
-        //pu_code: '4'
-    }
 });

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

@@ -0,0 +1,147 @@
+Ext.define('saas.view.purchase.purchaseOut.FormController', {
+    extend: 'saas.view.core.form.FormPanelController',
+    alias: 'controller.purchase-purchaseOut-formcontroller',
+    init: function (form) {
+        var me = this;
+        this.control({
+            /**放大镜新增demo*/
+            "field[name=combo]":{
+                beforerender:function(f){
+                    f.addHandler=me.addCombo;
+                }
+            },
+            //放大镜赋值关系 以及 tpl模板
+            'dbfindtrigger[name=pu_vendcode]':{
+                beforerender:function(f){
+                    Ext.apply(f,{
+                        dataUrl:'http://192.168.253.41:9480/api/document/vendor/getVendorsByCondition',
+                        dbfinds:[{
+                            from:'ve_code',to:'pu_vendcode'
+                        },{
+                            from:'ve_name',to:'pu_vendname'
+                        }],
+                        dbtpls:[{
+                            field:'ve_code',width:100
+                        },{
+                            field:'ve_name',width:100
+                        }],
+                        dbColumns:[{
+                            conditionCode:'ve_id',
+                            "text": "供应商ID",
+                            "flex": 0,
+                            "dataIndex": "ve_id",
+                            "width": 0,
+                            "xtype": "",
+                            "items": null
+                        },{
+                            conditionCode:'ve_code',
+                            "text": "供应商编号",
+                            "flex": 1,
+                            "dataIndex": "ve_code",
+                            "width": 100,
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            conditionCode:'ve_name',
+                            "text": "供应商名称",
+                            "flex": 1,
+                            "dataIndex": "ve_name",
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            conditionCode:'ve_type',
+                            "text": "供应商类型",
+                            "flex": 0,
+                            "dataIndex": "ve_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:'pd_prodcode',
+                            from:'pr_unit',to:'pd_unit'
+                        }],
+                        dbtpls:[{
+                            field:'pr_code',width:100
+                        },{
+                            field:'pr_detail',width:100
+                        },{
+                            field:'pr_unit',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
+                        }]
+                    }) ;   
+
+                }
+            }
+        });
+
+    },
+    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();
+
+    }
+});

+ 7 - 0
frontend/saas-web/app/view/purchase/purchaseOut/FormModel.js

@@ -0,0 +1,7 @@
+Ext.define('saas.view.purchase.purchaseOut.FormModel', {
+    extend: 'saas.view.core.form.FormPanelModel',
+    alias: 'viewmodel.purchase-purchaseOut-formmodel',
+    data: {
+        pi_class: '采购验退单'
+     }
+});

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

@@ -0,0 +1,246 @@
+Ext.define('saas.view.purchase.purchaseOut.FormPanel', {
+    extend: 'saas.view.core.form.FormPanel',
+    xtype: 'purchase-purchaseOut-formpanel',
+
+    controller: 'purchase-purchaseOut-formcontroller',
+    viewModel: 'purchase-purchaseOut-formmodel',
+    
+    _title:'采购验退单',
+    _idField: 'id',
+    _codeField: 'pi_inoutno',
+    _statusField: 'pu_status',
+    _statusCodeField: 'pu_statuscode',
+    _detnoColumn:  'pd_pdno',
+    _relationColumn: 'pd_piid',
+    _readUrl:'http://192.168.253.58:8800/purchase/read/',
+    _saveUrl:'http://192.168.253.58:8800/purchase/save',
+    _auditUrl:'http://192.168.253.58:8800/purchase/audit',
+    _deleteUrl:'http://192.168.253.58:8800/purchase/delete/',
+    _deleteDetailUrl:'http://192.168.253.58:8800/purchase/deleteItem/',
+    initId:11,
+
+    toolBtns: [{
+        xtype: 'button',
+        text: '转单按钮',
+        handler: function() {
+            console.log('11');
+        }
+    }],
+
+    defaultItems: [{
+        xtype: 'hidden',
+        name: 'id',
+        bind: '{id}',
+        fieldLabel: 'id',
+        allowBlank: true,
+        columnWidth: 0
+    }, {
+        xtype : "textfield", 
+        name : "pi_inoutno", 
+        bind : "{pi_inoutno}", 
+        fieldLabel : "验退单号", 
+        allowBlank : true, 
+        columnWidth : 0.25
+    },{
+        xtype : "textfield", 
+        name : "pi_class", 
+        bind : "{pi_class}", 
+        fieldLabel : "单据类型", 
+        readOnly:true,
+        allowBlank : true, 
+        columnWidth : 0.25
+    }, {
+        xtype : "hidden", 
+        name : "pi_vendid", 
+        bind : "{pi_vendid}", 
+        fieldLabel : "供应商ID", 
+        allowBlank : true, 
+        columnWidth : 0.0
+    }, {
+        xtype : "textfield", 
+        name : "pi_vendcode", 
+        bind : "{pi_vendcode}", 
+        fieldLabel : "供应商编号", 
+        hidden:true,
+        allowBlank : true, 
+        columnWidth : 0, 
+    }, {
+        xtype : "dbfindtrigger", 
+        name : "pi_vendname", 
+        bind : "{pi_vendname}", 
+        fieldLabel : "供应商名称", 
+        allowBlank : true, 
+        columnWidth : 0.25
+    },{
+        xtype : "datefield", 
+        name : "pi_date", 
+        bind : "{pi_date}", 
+        fieldLabel : "单据日期", 
+        allowBlank : false, 
+        columnWidth : 0.25
+    },{
+        xtype : "textfield", 
+        name : "pi_total", 
+        bind : "{pi_total}", 
+        fieldLabel : "总额", 
+        allowBlank : true,
+        readOnly: true,
+        columnWidth : 0.25
+    }, {
+        xtype : "textfield", 
+        name : "pi_pucode", 
+        bind : "{pi_pucode}", 
+        fieldLabel : "采购单号", 
+        allowBlank : true, 
+        columnWidth : 0.25
+    }, {
+        name : "detailGridField", 
+        xtype : "detailGridField", 
+        columns : [
+            {
+                text : "序号", 
+                dataIndex : "pd_pdno", 
+                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 : "pd_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 : "pd_outqty", 
+                editor : {
+                    xtype : "numberfield"
+                },
+                width : 120.0, 
+                xtype : "numbercolumn", 
+                format:'0',
+                items : null,
+                summaryType: 'sum'
+            }, 
+            {
+                text : "仓库", 
+                dataIndex : "pd_whname", 
+                width : 120.0, 
+                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 : "pd_orderprice", 
+                width : 120.0, 
+                xtype : "numbercolumn", 
+                items : null
+            }, 
+           {
+                text : "含税金额", 
+                dataIndex : "pd_total", 
+                width : 120.0, 
+                xtype : "numbercolumn"
+            }, {
+                text : "税率", 
+                dataIndex : "pd_taxrate", 
+                width : 120.0, 
+                xtype : "numbercolumn", 
+                items : null
+            },
+            {
+                text : "未税金额", 
+                dataIndex : "pd_nettotal", 
+                xtype : "numbercolumn"
+            },
+            {
+                text : "采购单号", 
+                dataIndex : "pd_ordercode", 
+                width : 120.0
+            },{
+                text : "采购序号", 
+                dataIndex : "pd_orderdetno", 
+                xtype : "numbercolumn",
+                flex:1
+            }
+        ]
+    }, {
+        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 : "pi_status", 
+        bind : "{pi_status}", 
+        fieldLabel : "单据状态", 
+        allowBlank : true, 
+        columnWidth : 0.25
+    }, {
+        xtype : "hidden", 
+        readOnly : true, 
+        editable : false, 
+        name : "pi_statuscode", 
+        bind : "{pi_statuscode}", 
+        fieldLabel : "单据状态码", 
+        allowBlank : true, 
+        columnWidth : 0.0
+    }]
+});

+ 219 - 0
frontend/saas-web/app/view/purchase/purchaseOut/QueryPanel.js

@@ -0,0 +1,219 @@
+Ext.define('saas.view.purchase.purchaseOut.QueryPanel', {
+    extend: 'saas.view.core.query.QueryPanel',
+    xtype: 'purchase-purchaseOut-querypanel',
+
+    controller: 'purchase-purchaseOut-queryformcontroller',
+    viewModel: 'purchase-purchaseOut-queryformmodel',
+    _baseVastUrl:'http://192.168.253.58:8800/purchase/',
+    _idField:'pi_id',
+    _codeField:'pi_inoutno',
+    queryFormItems: [{
+        xtype: 'hidden',
+        name: 'pi_id',
+        bind: '{pi_id}',
+        fieldLabel: 'ID',
+        allowBlank: true,
+        columnWidth: 0
+    }, {
+        xtype: 'textfield',
+        name: 'pi_inoutno',
+        bind: '{pi_inoutno}',
+        fieldLabel: '单据编号',
+        allowBlank: true,
+        columnWidth: 0.25
+    }, {
+        xtype: 'condatefield',
+        name: 'pi_date',
+        bind: '{pi_date}',
+        fieldLabel: '单据日期',
+        allowBlank: true,
+        columnWidth: 0.5
+    }, {
+        xtype: 'textfield',
+        name: 'pi_vendcode',
+        bind: '{pi_vendcode}',
+        fieldLabel: '供应商编号',
+        allowBlank: true,
+        hidden:true,
+        columnWidth: 0.25
+    }, {
+        xtype: 'textfield',
+        name: 'pi_vendname',
+        bind: '{pi_vendname}',
+        fieldLabel: '供应商名称',
+        allowBlank: true,
+        columnWidth: 0.25
+    }, {
+        xtype: 'dbfindtrigger',
+        name: 'pd_prodcode',
+        bind: '{pd_prodcode}',
+        fieldLabel: '物料编号',
+        fieldMode: 'DETAIL',
+        queryType:'VAG',
+        hidden:true,
+        allowBlank: true,
+        columnWidth: 0.25
+    }, {
+        xtype: 'dbfindtrigger',
+        name: 'pr_detail#pd_prodcode',
+        bind: '{pr_detail}',
+        fieldLabel: '物料名称',
+        allowBlank: true,
+        columnWidth: 0.25
+    }, {
+        xtype: 'combobox',
+        name: 'pi_statuscode',
+        bind: '{pi_statuscode}',
+        fieldLabel: '审核状态',
+        allowBlank: true,
+        columnWidth: 0.25,
+        queryMode: 'local',
+        displayField: 'pi_status',
+        valueField: 'pi_statuscode',
+        store: Ext.create('Ext.data.ArrayStore', {
+            fields: ['pi_statuscode', 'pi_status'],
+            data: [
+                ["$ALL", "全部"],
+                ["AUDITED", "已审核"],
+                ["UNAUDITED", "未审核"]
+            ]
+        })
+    }],
+    moreQueryFormItems: [{
+        xtype: 'textfield',
+        name: 'pu_buyername',
+        bind: '{pu_buyername}',
+        fieldLabel: '采购员',
+        allowBlank: true
+    }, {
+        xtype: 'textfield',
+        name: 'pu_total',
+        bind: '{pu_total}',
+        fieldLabel: '金额',
+        allowBlank: true
+    }, {
+        xtype: 'condatefield',
+        name: 'pu_delivery',
+        bind: '{pu_delivery}',
+        fieldLabel: '交货日期',
+        allowBlank: true,
+        columnWidth: 1
+    }],
+    queryGridConfig: {
+        _idField:'pi_id',
+        _codeField:'pi_inoutno',
+        _title:'采购验退单',
+        _addXtype:'test-order-formpanel',
+        _baseVastUrl:'http://192.168.253.58:8800/purchase/',
+        _baseColumn: [{
+            text: '序号',
+            width: 80,
+            xtype: 'rownumberer'
+        }, {
+            text: 'id',
+            dataIndex: 'pi_id',
+            width: 100,
+            xtype: 'numbercolumn'
+        }, {
+            text: '单据编号',
+            dataIndex: 'pi_inoutno',
+            width: 120
+        }, {
+            text: '单据状态',
+            dataIndex: 'pi_status',
+            width: 120
+        }, {
+            text: '下单日期',
+            dataIndex: 'pi_date',
+            xtype:'datecolumn',
+            width: 200
+        },{
+            text: '采购单号',
+            dataIndex: 'pi_pucode',
+            width: 200
+        },{
+            text: '供应商名称',
+            dataIndex: 'pi_vendname',
+            width: 120
+        },{
+            text: '含税金额',
+            dataIndex: 'pi_total',
+            xtype:'numbercolumn',
+            width: 120
+        },{
+            text: '不含税金额',
+            dataIndex: 'pi_nettotal',
+            xtype:'numbercolumn',
+            width: 120,
+            flex: 1
+        }],
+        _relativeColumn: [{
+            text : "序号", 
+            dataIndex : "pd_pdno", 
+            width : 100, 
+            xtype : "numbercolumn",
+            align : 'center'
+        }, {
+            text: 'id',
+            dataIndex: 'pu_id',
+            width: 0,
+            xtype: 'numbercolumn'
+        }, {
+            text: '单据编号',
+            dataIndex: 'pd_inoutno',
+            width: 120
+        }, {
+            text: '单据状态',
+            dataIndex: 'pi_status',
+            width: 120
+        }, {
+            text: '下单日期',
+            dataIndex: 'pi_date',
+            xtype:'datecolumn',
+            width: 200
+        },{
+            text: '供应商名称',
+            dataIndex: 'pi_vendname',
+            width: 120
+        },{
+            text: '采购单号',
+            dataIndex: 'pd_ordercode',
+            width: 120
+        },{
+            text: '采购序号',
+            dataIndex: 'pd_orderdetno',
+            xtype:'numbercolumn',
+            width: 120
+        },{
+            text: '物料编号',
+            dataIndex: 'pd_prodcode',
+            width: 120
+        },{
+            text: '验退数量',
+            dataIndex: 'pd_outqty',
+            xtype:'numbercolumn',
+            width: 120
+        },{
+            text: '采购单价',
+            dataIndex: 'pd_orderprice',
+            xtype:'numbercolumn',
+            width: 120
+        },{
+            text: '金额',
+            dataIndex: 'pd_total',
+            xtype:'numbercolumn',
+            width: 120
+        },{
+            text: '税率',
+            dataIndex: 'pd_taxrate',
+            xtype:'numbercolumn',
+            width: 120
+        },{
+            text: '成本单价',
+            dataIndex: 'pd_price',
+            xtype:'numbercolumn',
+            width: 120,
+            flex: 1
+        }]
+    }
+});

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

@@ -0,0 +1,115 @@
+Ext.define('saas.view.purchase.purchaseOut.QueryPanelController', {
+    extend: 'saas.view.core.query.QueryPanelController',
+    alias: 'controller.purchase-purchaseOut-queryformcontroller',
+    init: function (form) {
+        var me = this;
+        this.control({
+            //放大镜赋值关系 以及 tpl模板
+            'dbfindtrigger[name=pu_vendname]':{
+                beforerender:function(f){
+                    Ext.apply(f,{
+                        dataUrl:'http://192.168.253.41:9480/api/document/vendor/getVendorsByCondition',
+                        dbfinds:[{
+                            from:'ve_code',to:'pu_vendcode'
+                        },{
+                            from:'ve_name',to:'pu_vendname'
+                        }],
+                        dbtpls:[{
+                            field:'ve_code',width:100
+                        },{
+                            field:'ve_name',width:100
+                        }],
+                        dbColumns:[{
+                            conditionCode:'ve_id',
+                            "text": "供应商ID",
+                            "flex": 0,
+                            "dataIndex": "ve_id",
+                            "width": 0,
+                            "xtype": "",
+                            "items": null
+                        },{
+                            conditionCode:'ve_code',
+                            "text": "供应商编号",
+                            "flex": 1,
+                            "dataIndex": "ve_code",
+                            "width": 100,
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            conditionCode:'ve_name',
+                            "text": "供应商名称",
+                            "flex": 1,
+                            "dataIndex": "ve_name",
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            conditionCode:'ve_type',
+                            "text": "供应商类型",
+                            "flex": 0,
+                            "dataIndex": "ve_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:'pd_prodcode',
+                            from:'pr_unit',to:'pd_unit'
+                        }],
+                        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
+                        }]
+                    }) ;   
+
+                }
+            }
+        });
+
+    }
+});

+ 4 - 0
frontend/saas-web/app/view/purchase/purchaseOut/QueryPanelModel.js

@@ -0,0 +1,4 @@
+Ext.define('saas.view.purchase.purchaseOut.QueryPanelModel', {
+    extend: 'saas.view.core.query.QueryPanelModel',
+    alias: 'viewmodel.purchase-purchaseOut-queryformmodel'
+});