Pārlūkot izejas kodu

采购验收单+采购验收单查询

rainco 7 gadi atpakaļ
vecāks
revīzija
e4c6dbd25d

+ 12 - 2
frontend/saas-web/app/view/main/MainModel.js

@@ -32,10 +32,20 @@ Ext.define('saas.view.main.MainModel', {
                                         viewType:'purchase-purchase-formpanel',
                                         leaf: true
                                     },{
-                                        id: 'purchaseList',
-                                        text: '采购单列表',
+                                        id: 'purchaseQuery',
+                                        text: '采购单查询',
                                         viewType:'purchase-purchase-querypanel',
                                         leaf: true
+                                    },{
+                                        id: 'purchaseInOrder',
+                                        text: '采购验收单(维护界面)',
+                                        viewType:'purchase-purchaseIn-formpanel',
+                                        leaf: true
+                                    },{
+                                        id: 'purchaseInQuery',
+                                        text: '采购验收单查询',
+                                        viewType:'purchase-purchaseIn-querypanel',
+                                        leaf: true
                                     },{
                                         id: 'list1',
                                         text: '列表界面1',

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

@@ -0,0 +1,137 @@
+Ext.define('saas.view.purchase.purchaseIn.FormController', {
+    extend: 'saas.view.core.form.FormPanelController',
+    alias: 'controller.purchase-purchaseIn-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'
+                        }],
+                        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();
+
+    }
+});

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

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

+ 249 - 0
frontend/saas-web/app/view/purchase/purchaseIn/FormPanel.js

@@ -0,0 +1,249 @@
+Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
+    extend: 'saas.view.core.form.FormPanel',
+    xtype: 'purchase-purchaseIn-formpanel',
+
+    controller: 'purchase-purchaseIn-formcontroller',
+    viewModel: 'purchase-purchaseIn-formmodel',
+    
+    _title:'采购验收单',
+    _codeField: 'pi_inoutno',
+    _statusField: 'pi_statuscode',
+    _idField: 'id',
+    _detnoColumn:  'pd_pdno',
+    _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');
+        }
+    }],
+
+    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 : "pu_vendid", 
+        bind : "{pu_vendid}", 
+        fieldLabel : "供应商ID", 
+        allowBlank : true, 
+        columnWidth : 0.0
+    }, {
+        xtype : "textfield", 
+        name : "pu_vendcode", 
+        bind : "{pu_vendcode}", 
+        fieldLabel : "供应商编号", 
+        hidden:true,
+        allowBlank : true, 
+        columnWidth : 0, 
+    }, {
+        xtype : "dbfindtrigger", 
+        name : "pu_vendname", 
+        bind : "{pu_vendname}", 
+        fieldLabel : "供应商名称", 
+        allowBlank : true, 
+        columnWidth : 0.25
+    },{
+        xtype : "datefield", 
+        name : "pu_date", 
+        bind : "{pu_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, 
+        columnWidth : 0.25
+    }, {
+        xtype : "textfield", 
+        name : "pu_total", 
+        bind : "{pu_total}", 
+        fieldLabel : "单据金额", 
+        allowBlank : true, 
+        columnWidth : 0.25
+    }, {
+        name : "detailGridField", 
+        xtype : "detailGridField", 
+        bind: {
+            store:{
+                data:'{detailGridField}'
+            }
+        },
+        columns : [
+            {
+                text : "序号", 
+                dataIndex : "pdDetno", 
+                width : 80.0, 
+                xtype : "rownumberer"
+            }, {
+                text : "id", 
+                dataIndex : "id", 
+                xtype : "numbercolumn"
+            },
+            {
+                editor : {
+                    displayField : "display", 
+                    editable : true, 
+                    format : "", 
+                    hideTrigger : false, 
+                    maxLength : 100.0, 
+                    minValue : null, 
+                    positiveNum : false, 
+                    queryMode : "local", 
+                    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 : "pd_yqty", 
+                width : 120.0, 
+                xtype : "numbercolumn", 
+                items : null
+            }, 
+            {
+                text : "单价", 
+                dataIndex : "pd_price", 
+                width : 120.0, 
+                xtype : "numbercolumn", 
+                items : null
+            }, 
+            {
+                text : "税率", 
+                dataIndex : "pd_taxrate", 
+                width : 120.0, 
+                xtype : "numbercolumn", 
+                items : null
+            },
+            {
+                text : "含税金额", 
+                dataIndex : "pd_total", 
+                width : 120.0, 
+                xtype : "numbercolumn"
+            }, 
+            {
+                text : "未税金额", 
+                dataIndex : "pd_taxtotal", 
+                xtype : "numbercolumn"
+            },{
+                text : "需求日期", 
+                dataIndex : "pd_delivery", 
+                flex : 1.0, 
+                xtype:'datecolumn',
+                format : "Y-m-d H:i:s", 
+                editor : {
+                    xtype : "datetimefield",
+                    editable : true, 
+                    format : "Y-m-d H:i:s", 
+                    hideTrigger : false
+                }
+            },
+            {
+                text : "关联销售单号", 
+                dataIndex : "pd_salecode", 
+                width : 120.0,
+                flex : 1.0
+            }
+        ]
+    }, {
+        format : "Y-m-d", 
+        xtype : "datetimefield", 
+        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 : "puStatus", 
+        bind : "{puStatus}", 
+        fieldLabel : "单据状态", 
+        allowBlank : true, 
+        columnWidth : 0.25
+    }, {
+        xtype : "hidden", 
+        readOnly : true, 
+        editable : false, 
+        name : "pu_statuscode", 
+        bind : "{pu_statuscode}", 
+        fieldLabel : "单据状态码", 
+        allowBlank : true, 
+        columnWidth : 0.0
+    }]
+});

+ 256 - 0
frontend/saas-web/app/view/purchase/purchaseIn/QueryPanel.js

@@ -0,0 +1,256 @@
+Ext.define('saas.view.purchase.purchaseIn.QueryPanel', {
+    extend: 'saas.view.core.query.QueryPanel',
+    xtype: 'purchase-purchaseIn-querypanel',
+
+    controller: 'purchase-purchaseIn-queryformcontroller',
+    viewModel: 'purchase-purchaseIn-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: 'dbfindtrigger',
+        name: 'pi_inoutno',
+        bind: '{pi_inoutno}',
+        fieldLabel: '单据编号',
+        allowBlank: true,
+        columnWidth: 0.25,
+        dataUrl:'http://192.168.253.41:9480/api/document/vendor/getVendorsByCondition',
+        dbfinds:[{
+            from:'ve_code',to:'pu_code'
+        }],
+        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
+        }]
+    }, {
+        xtype: 'condatefield',
+        name: 'pu_date',
+        bind: '{pu_date}',
+        fieldLabel: '采购日期',
+        allowBlank: true,
+        columnWidth: 0.5
+    }, {
+        xtype: 'dbfindtrigger',
+        name: 'pu_vendcode',
+        bind: '{pu_vendcode}',
+        fieldLabel: '供应商编号',
+        allowBlank: true,
+        columnWidth: 0.25,
+        configUrl: 'resources/json/purchase/vendorColumnsDbfind.json',
+        dataUrl: 'resources/json/purchase/vendorDataDbfind.json'
+    }, {
+        xtype: 'textfield',
+        name: 'pu_vendname',
+        bind: '{pu_vendname}',
+        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,
+        configUrl: 'resources/json/purchase/vendorColumnsDbfind.json',
+        dataUrl: 'resources/json/purchase/vendorDataDbfind.json'
+    }, {
+        xtype: 'textfield',
+        name: 'pr_detail',
+        bind: '{pr_detail}',
+        fieldLabel: '物料名称',
+        allowBlank: true,
+        columnWidth: 0.25
+    }, {
+        xtype: 'combobox',
+        name: 'pr_statuscode',
+       // bind: '{pr_statuscode}',
+        fieldLabel: '审核状态',
+        allowBlank: true,
+        columnWidth: 0.25,
+        queryMode: 'local',
+            displayField: 'pr_status',
+            valueField: 'pr_statuscode',
+        store: Ext.create('Ext.data.ArrayStore', {
+            fields: ['pr_statuscode', 'pr_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'],
+            data: [
+                ["$ALL", "全部"],
+                ["TURNOUT", "已入库"],
+                ["NOOUT", "未入库"],
+                ["PARTOUT", "部分入库"]
+            ]
+        })
+    }],
+    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:'pu_id',
+        _codeField:'pu_code',
+        _title:'采购单',
+        _addXtype:'test-order-formpanel',
+        _baseVastUrl:'http://192.168.253.58:8800/purchase/',
+        _baseColumn: [{
+            text: '序号',
+            width: 80,
+            xtype: 'rownumberer'
+        }, {
+            text: 'id',
+            dataIndex: 'pu_id',
+            width: 100,
+            xtype: 'numbercolumn'
+        }, {
+            text: '单据编号',
+            dataIndex: 'pu_code',
+            width: 120
+        }, {
+            text: '单据状态',
+            dataIndex: 'pu_status',
+            width: 120
+        }, {
+            text: '下单日期',
+            dataIndex: 'pu_indate',
+            xtype:'datecolumn',
+            width: 200
+        },{
+            text: '供应商名称',
+            dataIndex: 'pu_vendname',
+            width: 120
+        },{
+            text: '含税金额',
+            dataIndex: 'pu_taxtotal',
+            xtype:'numbercolumn',
+            width: 120
+        },{
+            text: '金额',
+            dataIndex: 'pu_total',
+            xtype:'numbercolumn',
+            width: 120,
+            flex: 1
+        }],
+        _relativeColumn: [{
+            text: '序号',
+            width: 80,
+            xtype: 'rownumberer'
+        }, {
+            text: 'id',
+            dataIndex: 'pu_id',
+            width: 100,
+            xtype: 'numbercolumn'
+        }, {
+            text: '单据编号',
+            dataIndex: 'pu_code',
+            width: 120
+        }, {
+            text: '单据状态',
+            dataIndex: 'pu_status',
+            width: 120
+        }, {
+            text: '下单日期',
+            dataIndex: 'pu_indate',
+            xtype:'datecolumn',
+            width: 200
+        },{
+            text: '供应商名称',
+            dataIndex: 'pu_vendname',
+            width: 120
+        },{
+            text: '采购序号',
+            dataIndex: 'pd_detno',
+            xtype:'numbercolumn',
+            width: 120
+        },{
+            text: '物料编号',
+            dataIndex: 'pd_prodcode',
+            width: 120
+        },{
+            text: '数量',
+            dataIndex: 'pd_qty',
+            xtype:'numbercolumn',
+            width: 120
+        },{
+            text: '单价',
+            dataIndex: 'pd_price',
+            xtype:'numbercolumn',
+            width: 120
+        },{
+            text: '已转数',
+            dataIndex: 'pd_ytqy',
+            xtype:'numbercolumn',
+            width: 120,
+            flex: 1
+        }]
+    }
+});

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

@@ -0,0 +1,5 @@
+Ext.define('saas.view.purchase.purchaseIn.QueryPanelController', {
+    extend: 'saas.view.core.query.QueryPanelController',
+    alias: 'controller.purchase-purchaseIn-queryformcontroller',
+
+});

+ 9 - 0
frontend/saas-web/app/view/purchase/purchaseIn/QueryPanelModel.js

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