hy 7 年 前
コミット
f0c5dd0579

+ 2 - 2
frontend/saas-web/app/view/core/dbfind/MultiDbfindGridPanel.js

@@ -114,7 +114,7 @@ Ext.define('saas.view.core.dbfind.MultiDbfindGridPanel', {
                             //点开放大镜的行
                             var mainGrid = grid.dbfindtrigger.column.ownerCt.ownerCt;
                             var rec = mainGrid.selModel.getLastSelected();
-                            Ext.Array.each(selectRecordArr,function(record,index) {
+                            Ext.Array.each(selectRecordArr,function(record,_index) {
                                 Ext.Array.each(dbfinds,function(dbfind) {
                                     if(rec){
                                         var nowRec = mainGrid.store.getData().getByKey(rec.id);
@@ -125,7 +125,7 @@ Ext.define('saas.view.core.dbfind.MultiDbfindGridPanel', {
                                     return f.id==(rec&&rec.id?rec.id:0)
                                 });
                                 rec = mainGrid.store.data.getAt(index+1);
-                                if(!rec&&index!=selectRecordArr.length-1){//添加下一行
+                                if(!rec&&_index!=selectRecordArr.length-1){//添加下一行
                                     var data = {};
                                     data[mainGrid.ownerCt.detnoColumn] = index + 2;
                                     mainGrid.store.insert(index+1, data);

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

@@ -6,9 +6,11 @@ Ext.define('saas.view.core.tab.Controller', {
         var me = this,
         tab = me.getView(),
         viewType = tab.viewType,
+        _config = tab.index,
         viewConfig = tab.viewConfig;
 
         var view = {
+            _config : viewConfig,
             xtype: viewType
         };
         Ext.apply(view, viewConfig);

+ 3 - 0
frontend/saas-web/app/view/document/kind/Kind.js

@@ -21,6 +21,7 @@ Ext.define('saas.view.document.kind.Kind', {
         xtype: 'segmentedbutton',
         reference: 'dataKind',
         value: 'customerkind',
+        name : 'segmentedbutton',
         bind:'{segmented}',
         items: [{
             text: '客户',
@@ -262,6 +263,8 @@ Ext.define('saas.view.document.kind.Kind', {
             reqUrl: '/api/document/warehouse/save',
             delUrl: '/api/document/warehouse/delete'
         }
+    },
+    refresh:function(){
     }
 })
 

+ 4 - 0
frontend/saas-web/app/view/document/kind/KindController.js

@@ -15,6 +15,10 @@ Ext.define('saas.view.document.kind.KindController', {
         }else{
             defaultKind=vm.getData()['dataKind'].value  //类别合并界面
         }
+        if(grid.ownerCt._config){
+            defaultKind = grid.ownerCt._config;
+            vm.setData({'dataKind':{'value':grid.ownerCt._config}});
+        }
         var etc = view.etc[defaultKind];
         var store = vm.getStore(defaultKind);
         store.load();

+ 1 - 1
frontend/saas-web/app/view/document/product/FormPanel.js

@@ -160,7 +160,7 @@ Ext.define('saas.view.document.product.FormPanel', {
         name : "pr_whcode", 
         bind : "{pr_whcode}", 
         fieldLabel : "仓库编号", 
-        allowBlank : true, 
+        allowBlank : false, 
         columnWidth : 0.25, 
     }, {
         xtype : "textfield", 

+ 3 - 2
frontend/saas-web/app/view/main/Navigation.js

@@ -83,7 +83,7 @@ Ext.define('saas.view.main.Navigation', {
                     '<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}">',
+                    '<div class="item-text" title="{text}" data-config="{config}" data-id="{id}" data-text="{text}" data-type="query" data-viewType="{viewType}">',
                     '{text}',
                     '</div>',
                     '<tpl if="{addType}">',
@@ -142,13 +142,14 @@ Ext.define('saas.view.main.Navigation', {
                                     viewType = dataset.viewtype,
                                     type = dataset.type,
                                     text = dataset.text,
+                                    config = dataset.config,
                                     id = dataset.id;
 
                                     var tabTitle = text + '查询',
                                     tabId = 'maintab-' + type + '-' + id;
 
                                     menu.navItem.classList.remove(menu.navView.overItemCls);
-                                    openTab(viewType, tabTitle, tabId);
+                                    openTab(viewType, tabTitle, tabId,config);
                                     menu.hide();
                                 });
                             });

+ 304 - 0
frontend/saas-web/app/view/stock/stockamount/DataList.js

@@ -0,0 +1,304 @@
+/**
+ * Created by zhouy on 2018/10/18.
+ */
+Ext.define('saas.view.stock.stockamount.DataList', {
+    extend: 'Ext.grid.Panel',
+    xtype: 'stock-stockamount-datalist',
+    controller: 'stock-stockamount-datalist',
+    viewModel: 'stock-stockamount-datalist',
+    autoScroll: true,
+    frame:true,
+    layout:'fit',
+    //工具类
+    FormUtil: Ext.create('saas.util.FormUtil'),
+    BaseUtil: Ext.create('saas.util.BaseUtil'),
+    dataUrl:'/api/document/product/ReserveCost',                 
+
+    tbar: [{
+        width: 150,
+        name: 'pr_code',
+        xtype: 'textfield',
+        emptyText : '物料编号'
+    },{
+        width: 150,
+        name: 'pr_detail',
+        xtype: 'textfield',
+        emptyText : '物料名称'
+    },{
+        width: 150,
+        name: 'wh_code',
+        xtype: 'textfield',
+        emptyText : '仓库编号'
+    },{
+        width: 150,
+        name: 'wh_name',
+        xtype: 'textfield',
+        emptyText : '仓库名称'
+    },{
+        cls:'x-formpanel-btn-orange',
+        xtype:'button',
+        text:'查询',
+        listeners: {
+            click:function(b){
+                var grid = b.ownerCt.ownerCt;
+                var tbar = b.ownerCt;
+                grid.condition = '';
+                var items = [];
+                var fields = tbar.items.items.map(f => f.name);
+                Ext.each(fields, function(f, index){
+                    var field = tbar.down('[name='+f+']');
+                    if(field){
+                        items.push(field);
+                    }
+                });
+                grid.condition = grid.getCondition(items);
+                grid.store.loadPage(1);
+            }
+        }
+    },'->'],
+
+    columns : [{
+        text : "物料编号", 
+        width : 150, 
+        dataIndex : "rc_prodCode", 
+        xtype : "", 
+    },{
+        text : "物料名称", 
+        width : 200.0, 
+        dataIndex : "rc_prodDetail", 
+    }, 
+    {
+        text : "物料规格", 
+        dataIndex : "rc_prodSpec", 
+        width : 120.0, 
+    }, 
+    {
+        text : "单位", 
+        dataIndex : "rc_prodUnit", 
+        width : 120.0, 
+    }, 
+    {
+        text : "仓库编号", 
+        dataIndex : "rc_whCode", 
+        width : 0, 
+    }, 
+    {
+        text : "仓库名称", 
+        dataIndex : "rc_whName", 
+        width : 120.0, 
+    }, 
+    {
+        text : "数量", 
+        format:'0,000',
+        xtype:'numbercolumn',
+        dataIndex : "rc_number", 
+        width : 120.0, 
+    }, 
+    {
+        text : "单价", 
+        dataIndex : "rc_price", 
+        width : 120.0, 
+        renderer : function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length>8?8:arr[1].length)).fill('0');
+            var format = '0.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        }
+    }, 
+    {
+        text : "金额", 
+        dataIndex : "rc_amount", 
+        flex : 1.0, 
+        renderer : function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length>2?2:arr[1].length)).fill('0');
+            var format = '0.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        },
+    }],
+
+    dbSearchFields: [],
+    condition:'',
+
+    initComponent: function() {
+        var me = this;
+        if(me.columns){
+            var fields = me.columns.map(column => column.dataIndex);
+            me.store = Ext.create('Ext.data.Store',{
+                fields:fields,
+                autoLoad: true,
+                pageSize: 11,
+                data: [],
+                proxy: {
+                    timeout:8000,
+                    type: 'ajax',
+                    url: me.dataUrl,
+                    actionMethods: {
+                        read: 'GET'
+                    },
+                    reader: {
+                        type: 'json',
+                        rootProperty: 'data.list',
+                        totalProperty: 'data.total',
+                    }
+                },
+                listeners: {
+                    beforeload: function (store, op) {
+                        var condition = me.condition;
+                        if (Ext.isEmpty(condition)) {
+                            condition = "";
+                        }
+                        Ext.apply(store.proxy.extraParams, {
+                            number: op._page,
+                            size: store.pageSize,
+                            condition: JSON.stringify(condition)
+                        });
+                    }
+                }
+            });
+
+            Ext.apply(me, {
+                dockedItems:[{
+                    xtype: 'pagingtoolbar',
+                    dock: 'bottom',
+                    displayInfo: true,
+                    store: me.store
+                }]
+            });
+        }
+        me.callParent(arguments);
+    },
+
+    getGridSelected:function(type){
+        var isErrorSelect = false;
+        var checkField = this.statusCodeField;
+        var me = this,
+        items = me.selModel.getSelection(),
+        data = new Array() ;
+        Ext.each(items, function(item, index){
+            if(!Ext.isEmpty(item.data[me.idField])){
+                var o = new Object();
+                if(me.idField){
+                    o['id'] = item.data[me.idField];
+                }
+                if(me.codeField){
+                    o['code'] = item.data[me.codeField];
+                }
+                if(type&&type==item.data[checkField]){
+                    isErrorSelect = true
+                }
+                data.push(o);
+            }
+        });
+        if(isErrorSelect){
+            return false;
+        }
+		return data;
+    },
+
+    /**
+     * 获得过滤条件
+     */
+    getCondition: function(items) {
+        var me = this,
+        conditions = [];
+
+        for(var i = 0; i < items.length; i++) {
+            var item = items[i];
+            var field = item.name,
+            func = item.getCondition,
+            value = item.value,
+            condition;
+
+            if(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(xtype),
+                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(xtype) {
+        var operation;
+
+        if(Ext.Array.contains(['numberfield'], xtype)) {
+            operation = '=';
+        }else if(Ext.Array.contains(['datefield'], xtype)) {
+            operation = '=';
+        }else if(Ext.Array.contains(['condatefield'], xtype)) {
+            operation = 'between';
+        }else if(Ext.Array.contains(['combobox', 'multicombo', 'combo'], xtype)) {
+            operation = 'in';
+        }else {
+            operation = 'like';
+        }
+
+        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 00:00:00') + ',' + Ext.Date.format(new Date(to), 'Y-m-d 23:59:59');
+        }else if(xtype == 'combobox' || xtype == 'combo') {
+            conditionValue = '\'' + value + '\'';
+        }else if(xtype == 'multicombo') {
+            conditionValue = value.map(function(v) {
+                return '\'' + v.value + '\'';
+            }).join(',');
+        }else {
+            conditionValue = value;
+        }
+
+        return conditionValue;
+    },
+
+    refresh:function(){
+        //debugger
+    }
+
+})
+
+

+ 10 - 0
frontend/saas-web/app/view/stock/stockamount/DataListController.js

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

+ 4 - 0
frontend/saas-web/app/view/stock/stockamount/DataListlModel.js

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

+ 47 - 21
frontend/saas-web/app/view/sys/config/FormPanel.js

@@ -4,25 +4,28 @@ Ext.define('saas.view.sys.config.FormPanel', {
 
     controller: 'sys-config-formpanel',
     viewModel: 'sys-config-formpanel',
+    //工具类
+    FormUtil: Ext.create('saas.util.FormUtil'),
+    BaseUtil: Ext.create('saas.util.BaseUtil'),
     
     //字段属性
     _idField: 'id',
-    _readUrl:'/api/document/vendor/read/',
-    _saveUrl:'/api/document/vendor/save',
+    _readUrl:'/api/commons/enterprise/read',
+    _saveUrl:'/api/commons/enterprise/save',
 
     //基础属性
     frame:true,
     initId: 0,
-    layout: 'column',
+    layout: 'vbox',
     autoScroll: true,
     border: 1,
     bodyPadding: 5,
 
     fieldDefaults: {
-        margin: '0 5 5 0',
+        margin: '0 5 5 30',
         labelAlign: 'right',
         labelWidth: 90,
-        columnWidth: 0.25,
+        width:300,
         blankText: '该字段不能为空'
     },
 
@@ -33,50 +36,60 @@ Ext.define('saas.view.sys.config.FormPanel', {
         frame:true,
         items:['->',{
             text:'保存',
-            handler:function(){
-
-            }
+            formBind:true,
+            name:'save'
         }]
     },
 
     items: [{
+        bind:'{companyId}',
         xtype: 'hidden',
-        name: 'id',
+        name: 'companyId',
         fieldLabel: 'id',
         allowBlank: true,
-        columnWidth: 0.25
+        width:600
     },{
+        bind:'{en_name}',
         xtype: 'textfield',
         name: 'en_name',
         fieldLabel: '公司名称',
-        allowBlank: false,
-        columnWidth: 0.5
+        allowBlank: true,
+        editable:false,
+        readOnly:true,
+        width:600
     },{
+        bind:'{en_address}',
         xtype: 'textfield',
         name: 'en_address',
         fieldLabel: '公司地址',
-        allowBlank: true,
-        columnWidth: 0.5
+        allowBlank: false,
+        width:600
     },{
+        bind:'{en_tel}',
         xtype: 'textfield',
         name: 'en_tel',
         fieldLabel: '电话',
-        allowBlank: true,
+        allowBlank: false,
         columnWidth: 0.25
     },{
+        bind:'{en_fax}',
         xtype: 'textfield',
         name: 'en_fax',
         fieldLabel: '传真',
         allowBlank: true,
         columnWidth: 0.5
     },{
+        bind:'{en_begindate}',
         xtype : "datefield", 
-        name : "en_begindate", 
+        name : "en_begindate",
+        format:'Y-m-d H:i:s', 
         fieldLabel : "开账日期", 
         allowBlank : true, 
         editable:false,
-        columnWidth : 0.25
+        hideTrigger:true,
+        readOnly:true
     },{ 
+        bind:'{en_pricemethod}',
         displayField : "display", 
         editable:false,
         hideTrigger : false, 
@@ -97,6 +110,7 @@ Ext.define('saas.view.sys.config.FormPanel', {
         allowBlank : false, 
         columnWidth : 0.25
     },{  
+        bind:'{en_signet}',
         xtype : "textfield", 
         name : "en_signet", 
         fieldLabel : "打印章上传", 
@@ -104,22 +118,34 @@ Ext.define('saas.view.sys.config.FormPanel', {
         editable:false,
         columnWidth : 0.25
     },{  
+        ignore:true,
+        bind:'{updateTime}',
         xtype : "datefield", 
         name : "updateTime", 
         fieldLabel : "更新时间", 
         allowBlank : true, 
+        hideTrigger:true,
+        format:'Y-m-d H:i:s',
         editable:false,
+        readOnly:true,
         columnWidth : 0.25
     }],
 
     initComponent: function () {
         var me = this,
         viewModel = me.getViewModel();
+        var url = me._readUrl;
+        me.BaseUtil.request({url })
+        .then(function(res) {
+            if(res.success) {
+                var d = res.data;
+                viewModel.setData(d)
+            }
+        })
+        .catch(function(response) {
+            console.error(response);
+        });
 
-        viewModel.set('createTime', Ext.Date.format(new Date(), 'Y-m-d H:i:s'));
-        viewModel.set('updateTime', Ext.Date.format(new Date(), 'Y-m-d H:i:s'));
-        viewModel.setFormulas(o);
-        viewModel.set(statusCodeField, auditTexts.unAuditCode);
         me.callParent(arguments);
     }
 });

+ 28 - 36
frontend/saas-web/app/view/sys/config/FormPanelController.js

@@ -5,6 +5,17 @@ Ext.define('saas.view.sys.config.FormPanelController', {
     BaseUtil: Ext.create('saas.util.BaseUtil'),
     FormUtil: Ext.create('saas.util.FormUtil'),
 
+    init: function (form) {
+        var me = this;
+        this.control({
+            'button[name=save]':{
+                click:function(){
+                    me.onSave();
+                }
+            }
+        });
+    },
+
     onSave: function() {
         var me = this,
         form = this.getView();
@@ -19,50 +30,31 @@ Ext.define('saas.view.sys.config.FormPanelController', {
             showToast('未修改数据,请修改后保存');
             return false;
         }
-        //form里面数据
-        var formData = form.getFormData();
         
-        me.save(formData);
-    },
-
-    save:function(formData){
-        var me = this,
-        form = this.getView(),
-        detailCount = form.detailCount,
-        viewModel = me.getViewModel(),
-        modelData = viewModel.getData();
-
-        var params = {
-            main:formData.main
-        };
-
-        for(var i = 0; i < detailCount; i++) {
-            params['items' + ( i + 1)] = formData['detail' + i];
-        }
-
-        // 只有一个从表时从表字段改为items
-        if(detailCount == 1) {
-            params.items = params.items1;
-            delete params.items1;
-        }
-
+        viewModel = me.getViewModel();
+        var formData = viewModel.data;
+        formData.en_name = null;
+        formData.updateTime = null;
         me.BaseUtil.request({
             url: form._saveUrl,
-            params: JSON.stringify(params),
+            params: JSON.stringify(formData),
             method: 'POST',
         })
         .then(function(localJson) {
             if(localJson.success){
-                var id = localJson.data.id;
-                var code = localJson.data.code;
-                form.initId = id;
-                form.FormUtil.loadData(form);
                 showToast('保存成功');
-
-                var newId = form.xtype + '-' + id;
-                var newTitle = form._title + '(' + code + ')';
-
-                refreshTabTitle(newId, newTitle);
+                viewModel = form.getViewModel();
+                var url = form._readUrl;
+                form.BaseUtil.request({url })
+                .then(function(res) {
+                    if(res.success) {
+                        var d = res.data;
+                        viewModel.setData(d)
+                    }
+                })
+                .catch(function(response) {
+                    console.error(response);
+                });
             }
         })
         .catch(function(res) {

+ 20 - 9
frontend/saas-web/app/view/sys/finish/DataList.js

@@ -7,9 +7,9 @@ Ext.define('saas.view.sys.finish.DataList', {
     autoScroll: true,
     frame:true,
     layout:'fit',
-    dataUrl:'http://192.168.253.31:8920/endProduct/list',
-    endAccount:'http://192.168.253.31:8920/endProduct/endAccount',
-    unEndAccount:'http://192.168.253.31:8920/endProduct/unEndAccount',
+    dataUrl:'/api/commons/endProduct/list',
+    endAccount:'/api/commons/endProduct/endAccount',
+    unEndAccount:'/api/commons/endProduct/unEndAccount',
     tbar: [{
         cls:'x-tbar-display',
         width: 180,
@@ -80,20 +80,31 @@ Ext.define('saas.view.sys.finish.DataList', {
         dataIndex : "id", 
         xtype : "numbercolumn",   
     },{
-        text:'结账',
-        dataIndex : "ml_caller",
-        xtype:'datecolumn',
-        width : 200.0, 
+        text:'结账期间',
+        dataIndex : "ml_keyvalue",
+        xtype:'',
+        width : 160.0, 
     },{
         text : "操作日期", 
         width : 200.0, 
-        dataIndex : "ml_code", 
+        format:'Y-m-d H:i:s',
+        dataIndex : "createTime", 
         xtype:'datecolumn',
     }, 
     {
-        text : "操作", 
+        text : "操作类型", 
         dataIndex : "ml_content", 
         width : 220.0, 
+    },
+    {
+        text : "操作员", 
+        dataIndex : "ml_man", 
+        width : 170.0, 
+    },
+    {
+        text : "结果", 
+        dataIndex : "ml_result", 
+        width : 220.0, 
     }],
 
     condition:'',

+ 5 - 1
frontend/saas-web/resources/json/navigation.json

@@ -106,7 +106,9 @@
         }, {
             "text": "物料收发汇总表"
         }, {
-            "text": "物料库存数量金额表"
+            "text": "物料库存数量金额表",
+            "id":"stock-stockamount-datalist",
+            "viewType": "stock-stockamount-datalist"
         }]
     }]
 }, {
@@ -206,6 +208,7 @@
     }, {
         "text": "辅助资料",
         "items": [{
+            "config":"vendorkind",
             "id":"document-kind",
             "text": "供应商类型",
             "viewType": "document-kind",
@@ -216,6 +219,7 @@
             "viewType": "other-address",
             "leaf": true
         }, {
+            "index":"customer",
             "id":"document-kind",
             "text": "客户类型",
             "viewType": "document-kind",