浏览代码

代码提交

hy 7 年之前
父节点
当前提交
45e6e79b04

+ 22 - 44
frontend/saas-web/app/view/core/form/DataMultiCombo.js

@@ -18,53 +18,31 @@ Ext.define('saas.view.core.form.DataMultiCombo', {
             Ext.Ajax.request({  
                 url : me.dataUrl,
                 timeout: 100000000,  
-                method : 'post',  
-                params : {}  ,
+                async:false,
                 headers:{
                     'Access-Control-Allow-Origin': '*',
-                    'Authorization':  saas.util.State.get('session').token
+                    'Authorization':  saas.util.State.get('session').token,
+                    "Content-Type": 'application/json;charset=UTF-8'
                 },
                 success: function(fp, o){
-                    // if(o.result.error){
-                    //     showError(o.result.error);
-                    // } else {
-                    //     var msg = Ext.getCmp('baseform').ownerCt.ownerCt.down('htmleditor[name=msg]');
-                    //     var imgel=msg.getEl().dom.getElementsByTagName('iframe')[0].contentWindow.document.body;
-                    //     if(imgel.getElementsByTagName('img').length>0){
-                    //       imgel.removeChild(imgel.getElementsByTagName('img')[0]);
-                    //     }
-                    //     //Ext.getCmp('baseform').ownerCt.ownerCt.down('hidden').setValue('../../../'+o.result.path);
-                    //     Ext.getCmp('baseform').ownerCt.setValue(o.result.path);
-                    //     var element = document.createElement("img");
-                    //     element.src = basePath + 'common/download.action?path=' + o.result.path.replace(/\+/g, '%2B');
-                    //     element.style="width:100%;height:100%";            
-                    //     element.title = '&img' + o.result.filepath + ";";
-                    //     msg.setValue('<img src="'+element.src+'" style=width:100%;height:100%;>');
-                    // }
+                    var res = Ext.decode(fp.responseText);
+                    var data = res.data,datas=[];
+                    if(data.length>0){
+                        Ext.each(data, function(item, index){
+                            var o = [];
+                            o[0] = item.name;
+                            o[1] = item.id;
+                            datas.push(o);
+                        });
+                    }else{
+                        saas.util.BaseUtil.showToast('下拉框读取数据为空!');
+                    }
+                    me.datas = datas;
                 },
                 failure: function (response, opts) {
-                    showToast('上传失败: ' + response.responseText);
+                    saas.util.BaseUtil.showToast('上传失败: ' + response.responseText);
                 }
             });
-            me.BaseUtil.request({
-                url: me.dataUrl,
-                params: '',
-                method: 'POST',
-                async:false
-            })
-            .then(function(localJson) {
-                if(localJson.success){
-                }
-            })
-            .catch(function(res) {
-                console.error(res);
-                showToast('保存失败: ' + res.message);
-            });
-
-            // datas: [
-            //     ["已审核", "已审核"],
-            //     ["未审核", "未审核"]
-            // ]
         }
         me.callParent(arguments);
     },
@@ -114,12 +92,12 @@ Ext.define('saas.view.core.form.DataMultiCombo', {
         for (; i < itemsLn; i++) {
             item = items[i];
             var checked = !!value.find(function(v) {
-                return v.value = iem[0];
+                return v.value == item[1];
             });
             menuItem = new Ext.menu.CheckItem({
-                text: item[1],
+                text: item[0],
                 checked: checked,
-                checkValue:item[0],
+                checkValue:item[1],
                 hideOnClick: false,
                 checkHandler: this.onCheckChange,
                 scope: this
@@ -155,8 +133,8 @@ Ext.define('saas.view.core.form.DataMultiCombo', {
                     return d[0] == item;
                 });
                 items[index] = {
-                    text: data[1],
-                    value: data[0]
+                    text: data[0],
+                    value: data[1]
                 }
             }
         })

+ 1 - 1
frontend/saas-web/app/view/core/form/MultiCombo.js

@@ -61,7 +61,7 @@ Ext.define('saas.view.core.form.MultiCombo', {
         for (; i < itemsLn; i++) {
             item = items[i];
             var checked = !!value.find(function(v) {
-                return v.value = iem[0];
+                return v.value == iem[0];
             });
             menuItem = new Ext.menu.CheckItem({
                 text: item[1],

+ 72 - 1
frontend/saas-web/app/view/document/kind/ChildForm.js

@@ -222,7 +222,7 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
         accountinformation:{
             items:[{
                 xtype:'hidden',
-                name:'roleIds',
+                name:'accountId',
                 hidden:true,
             },{
                 xtype:'datamulticombo',
@@ -235,6 +235,8 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
                 xtype:'textfield',
                 fieldLabel: '联系电话',
                 name: 'mobile',
+                readOnly:true,
+                editable:false,
                 allowBlank:true,
                 maxLength: 30,
                 beforeLabelTextTpl: "",
@@ -242,6 +244,8 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
                 xtype:'textfield',
                 fieldLabel: '联系邮件',
                 name: 'email',
+                readOnly:true,
+                editable:false,
                 allowBlank:true,
                 maxLength: 30,
                 beforeLabelTextTpl: "",
@@ -313,6 +317,7 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
                 xtype:'textfield',
                 fieldLabel: '单据前缀',
                 name: 'mn_leadcode',
+                beforeLabelTextTpl: '',
                 allowBlank:false,
                 maxLength: 20
             },{
@@ -384,6 +389,13 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
         var combo = this._combo;
         var params = {};
         var names = belong.columns.map(column => column.dataIndex);
+
+        //账户资料特殊保存逻辑
+        if(me.dataKind=='accountinformation'){
+            me.accountinformation();
+            return;
+        }
+
         Ext.Array.each(names,function(name) {
             if(name){
                 var dataField = form.down('[name='+name+']');
@@ -425,5 +437,64 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
     },
     onCancel:function(){
         this.hide();
+    },
+    accountinformation:function(){
+        var me = this;
+        var belong = this.belong;
+        me.setLoading(true);
+        var form=this.down('form');
+        var combo = this._combo;
+        var params = {};
+        var names = belong.columns.map(column => column.dataIndex);
+
+        Ext.Array.each(names,function(name) {
+            if(name){
+                var dataField = form.down('[name='+name+']');
+                if(dataField&&dataField.value){
+                    params[name] = dataField.value;
+                    params._value = dataField.value;
+                }
+            }
+        });
+
+        //更改参数
+        var o = '';
+        Ext.Array.each(params.roleNames,function(item) {
+            o+=item.value+','
+        });
+        o = o.substring(0,o.length-1);
+
+        var _params = {
+            accountId:Number(params['accountId']),
+            roleIds:o,
+        };
+
+        //保存接口
+        saas.util.BaseUtil.request({
+            url: belong.reqUrl,
+            params: _params,
+            method: 'POST'
+        })
+        .then(function(localJson) {
+            me.setLoading(false);
+            if(localJson.success){
+                saas.util.BaseUtil.showToast('保存成功');
+                var grid = form.ownerCt._parent.lookup('document-kind-Grid');
+                if(grid){
+                    grid.store.load();
+                }
+                if(combo){
+                    combo.store.load(function() {
+                        typeof combo.setValue == 'function' && combo.setValue(params._value);
+                    });
+                }
+                form.ownerCt.close();
+            }
+        })
+        .catch(function(res) {
+            me.setLoading(false);
+            console.error(res);
+            saas.util.BaseUtil.showToast('保存失败: ' + res.message);
+        });
     }
 });

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

@@ -246,6 +246,18 @@ Ext.define('saas.view.document.kind.Kind', {
             reqUrl:'/api/account/role/save',
             updateUrl:'/api/account/role/update',
         },
+        accountinformation:{
+            columns:[{
+                dataIndex:'accountId',
+            },{
+                dataIndex: 'roleNames',
+            },{
+                dataIndex: 'mobile',
+            },{
+                dataIndex: 'email',
+            }],
+            reqUrl:'http://192.168.253.31:8560/api/account/account/bind/roles',
+        },
         warehouse:{
             columns: [{
                 text: '编号',

+ 44 - 238
frontend/saas-web/app/view/sys/baseconfig/FormPanel.js

@@ -10,8 +10,8 @@ Ext.define('saas.view.sys.baseconfig.FormPanel', {
     
     //字段属性
     _idField: 'id',
-    _readUrl:'http://192.168.253.31:8560/api/account/company/read/current',
-    _saveUrl:'http://192.168.253.31:8560/api/account/company/save',
+    _readUrl:'/api/commons/configs/list',
+    _saveUrl:'/api/commons/configs/update',
 
     //基础属性
     frame:true,
@@ -38,46 +38,7 @@ Ext.define('saas.view.sys.baseconfig.FormPanel', {
         },'->']
     },
 
-    items: [{
-        bind:'{id}',
-        xtype: 'hidden',
-        name: 'id',
-        fieldLabel: 'id',
-        allowBlank: true,
-        width:600
-    },{
-        bind:'{name}',
-        xtype: 'textfield',
-        name: 'name',
-        fieldLabel: '公司名称',
-        allowBlank: true,
-        editable:false,
-        readOnly:true,
-        width:600
-    },{
-        bind:'{address}',
-        xtype: 'textfield',
-        name: 'address',
-        fieldLabel: '公司地址',
-        beforeLabelTextTpl : "<font color=\"red\" style=\"position:relative; top:2px;right:2px; font-weight: bolder;\">*</font>",
-        allowBlank: false,
-        width:600
-    },{
-        bind:'{tel}',
-        xtype: 'textfield',
-        name: 'tel',
-        fieldLabel: '电话',
-        beforeLabelTextTpl : "<font color=\"red\" style=\"position:relative; top:2px;right:2px; font-weight: bolder;\">*</font>",
-        allowBlank: false,
-        width:500
-    },{
-        bind:'{fax}',
-        xtype: 'textfield',
-        name: 'fax',
-        fieldLabel: '传真',
-        allowBlank: true,
-        width:500
-    }
+    items: [
     // ,{
     //     bind:'{en_begindate}',
     //     xtype : "datefield", 
@@ -90,30 +51,37 @@ Ext.define('saas.view.sys.baseconfig.FormPanel', {
     //     readOnly:true,
     //     width:500
     // }
-    // ,{ 
-    //     bind:'{en_pricemethod}',
-    //     displayField : "display", 
-    //     editable:false,
-    //     hideTrigger : false, 
-    //     maxLength : 100.0, 
-    //     width:500,
-    //     minValue : null, 
-    //     queryMode : "local", 
-    //     valueField : "value", 
-    //     xtype : "combo",
-    //     value:'WACC',
-    //     store:{
-    //         fields: ['display', 'value'],
-    //         data : [
-    //             {"display":"加权平均法", "value":'WACC'},
-    //             {"display":"先进先出法", "value":'FIFO'}
-    //         ]
-    //     },
-    //     name : "en_pricemethod", 
-    //     beforeLabelTextTpl : "<font color=\"red\" style=\"position:relative; top:2px;right:2px; font-weight: bolder;\">*</font>",
-    //     fieldLabel : "库存计算方式", 
-    //     allowBlank : false, 
-    // }
+    { 
+        bind:'{cucaltor}',
+        displayField : "display", 
+        editable:false,
+        hideTrigger : false, 
+        maxLength : 100.0, 
+        width:500,
+        minValue : null, 
+        queryMode : "local", 
+        valueField : "value", 
+        xtype : "combo",
+        value:'WACC',
+        store:{
+            fields: ['display', 'value'],
+            data : [
+                {"display":"加权平均法", "value":'WACC'},
+                {"display":"先进先出法", "value":'FIFO'}
+            ]
+        },
+        name : "cucaltor", 
+        beforeLabelTextTpl : "<font color=\"red\" style=\"position:relative; top:2px;right:2px; font-weight: bolder;\">*</font>",
+        fieldLabel : "库存计算方式", 
+        allowBlank : false, 
+    },{
+        bind:'{printUrl}',
+        xtype : "textfield", 
+        name : "printUrl",
+        fieldLabel : "打印地址Url", 
+        allowBlank : false, 
+        width:500
+    }
     // ,{  
     //     ignore:true,
     //     bind:'{updateTime}',
@@ -127,185 +95,23 @@ Ext.define('saas.view.sys.baseconfig.FormPanel', {
     //     readOnly:true,
     //     width:500,
     // }
-    ,{
-        xtype: 'form',
-		width:600,
-		frame: false,
-		border: false,
-		minHeight: 22,
-		bodyStyle: 'padding:2px;',
-        layout: 'hbox',
-        items:[{
-            bind:'{signet}',
-            name : "signet", 
-            allowBlank : true, 
-            hidden:true,
-            xtype:'numberfield'
-        },{
-            allowBlank : true, 
-            width:500,
-            fieldLabel:'打印章上传',
-            xtype: 'filefield',
-            emptyText: '请选择图片',
-            buttonText: '',
-            buttonConfig: {
-                iconCls: 'x-fa fa-picture-o',
-            },
-            createFileInput : function() {
-                    var me = this;
-                    me.fileInputEl = me.button.el.createChild({
-                    name: me.getName(),
-                    cls: Ext.baseCSSPrefix + 'form-file-input',
-                    tag: 'input',
-                    type: 'file',
-                    size: 1,
-                    accept:"image/*"
-                }).on('change', me.onFileChange, me);
-            },
-            listeners: {
-                afterrender:function(field,ops){
-                    var fileEl = field.fileInputEl.dom;
-                    fileEl.setAttribute("accept","image/*");
-                },
-                change: function(field){
-                    var form = field.ownerCt.ownerCt;
-                    var myForm = field.ownerCt;
-                    var fileEl = field.fileInputEl.dom;
-                    var fd = new FormData();
-                    fd.append('file', fileEl.files[0]);
-                    form.setLoading(true);
-                    Ext.Ajax.request({
-                        url: 'http://192.168.253.31:8560/api/file/upload',//这里是填写需要跨域访问的URL
-                        cors: true,
-                        useDefaultXhrHeader: false,
-                        method: 'post',
-                        rawData: fd,
-                        headers: {
-                            'Access-Control-Allow-Origin': '*',
-                            'Authorization':  saas.util.State.get('session').token,
-                            //"Content-Type": 'multipart/form-data'  //文件上传的格式, 
-                            "Content-Type":null
-                        },
-                        success: function (response, opts) {
-                            form.setLoading(false);
-                            showToast('上传成功');
-                            var res = Ext.decode(response.responseText);
-                            if(res.success){
-                                var data = res.data;
-                                var name = data.name + "  (" + Ext.util.Format.fileSize(data.size) + ")";
-                                myForm.down('[name=signet]').setValue(data.id);
-                                field.setRawValue(name);
-                            }else{
-                                showToast('上传失败: ' + res.message);
-                            }
-                        },
-                        failure: function (response, opts) {
-                            form.setLoading(false);
-                            var res = Ext.decode(response.responseText);
-                            showToast('上传失败: ' + res.message);
-                        }
-                    });
-                }
-            }
-        },{
-            hidden:true,
-            name:'showSignetPhoto',
-            xtype:'button',
-            iconCls: 'x-fa fa-picture-o'
-        }]
-    },{
-        xtype: 'form',
-		width:600,
-		frame: false,
-		border: false,
-		minHeight: 22,
-		bodyStyle: 'padding:2px;',
-        layout: 'hbox',
-        items:[{
-            bind:'{logoUrl}',
-            name : "logoUrl", 
-            allowBlank : true, 
-            hidden:true,
-            xtype:'numberfield'
-        },{
-            allowBlank : true, 
-            width:500,
-            fieldLabel:'Logo上传',
-            xtype: 'filefield',
-            emptyText: '请选择图片',
-            buttonText: '',
-            buttonConfig: {
-                iconCls: 'x-fa fa-picture-o',
-            },
-            createFileInput : function() {
-                    var me = this;
-                    me.fileInputEl = me.button.el.createChild({
-                    name: me.getName(),
-                    cls: Ext.baseCSSPrefix + 'form-file-input',
-                    tag: 'input',
-                    type: 'file',
-                    size: 1,
-                    accept:"image/*"
-                }).on('change', me.onFileChange, me);
-            },
-            listeners: {
-                change: function(field){
-                    var form = field.ownerCt.ownerCt;
-                    var myForm = field.ownerCt;
-                    var fileEl = field.fileInputEl.dom;
-                    var fd = new FormData();
-                    fd.append('file', fileEl.files[0]);
-                    form.setLoading(true);
-                    Ext.Ajax.request({
-                        url: 'http://192.168.253.31:8560/api/file/upload',//这里是填写需要跨域访问的URL
-                        cors: true,
-                        useDefaultXhrHeader: false,
-                        method: 'post',
-                        rawData: fd,
-                        headers: {
-                            'Access-Control-Allow-Origin': '*',
-                            'Authorization':  saas.util.State.get('session').token,
-                            //"Content-Type": 'multipart/form-data'  //文件上传的格式, 
-                            "Content-Type":null
-                        },
-                        success: function (response, opts) {
-                            form.setLoading(false);
-                            showToast('上传成功');
-                            var res = Ext.decode(response.responseText);
-                            if(res.success){
-                                var data = res.data;
-                                var name = data.name + "  (" + Ext.util.Format.fileSize(data.size) + ")";
-                                myForm.down('[name=logoUrl]').setValue(data.id);
-                                field.setRawValue(name);
-                            }else{
-                                showToast('上传失败: ' + res.message);
-                            }
-                        },
-                        failure: function (response, opts) {
-                            form.setLoading(false);
-                            var res = Ext.decode(response.responseText);
-                            showToast('上传失败: ' + res.message);
-                        }
-                    });
-                }
-            }
-        },{
-            hidden:true,
-            name:'showLogoPhoto',
-            xtype:'button',
-            iconCls: 'x-fa fa-picture-o'
-        }]
-    }],
+    ],
 
     initComponent: function () {
         var me = this,
         viewModel = me.getViewModel();
         var url = me._readUrl;
-        me.BaseUtil.request({url })
+        saas.util.BaseUtil.request({url })
         .then(function(res) {
             if(res.success) {
-                var d = res.data;
-                viewModel.setData(d)
+                var list = res.data.list;
+                if(list.length>0){
+                    var d = {};
+                    Ext.each(list, function(item, index){
+                        d[item.code] = item.data;
+                    });
+                    viewModel.setData(d);
+                }
             }
         })
         .catch(function(response) {

+ 22 - 11
frontend/saas-web/app/view/sys/baseconfig/FormPanelController.js

@@ -30,26 +30,38 @@ Ext.define('saas.view.sys.baseconfig.FormPanelController', {
             showToast('未修改数据,请修改后保存');
             return false;
         }
-        
         viewModel = me.getViewModel();
-        var formData = viewModel.data;
-        formData.en_name = null;
-        formData.updateTime = null;
-        me.BaseUtil.request({
+        var formData = [];
+
+        var items = me.view.getForm().getFields().items;
+        Ext.each(items, function(item, index){
+            formData.push({
+                code:item.name,
+                data:item.value
+            })
+        });
+
+        saas.util.BaseUtil.request({
             url: form._saveUrl,
             params: JSON.stringify(formData),
             method: 'POST',
         })
         .then(function(localJson) {
             if(localJson.success){
-                showToast('保存成功');
+                saas.util.BaseUtil.showToast('保存成功');
                 viewModel = form.getViewModel();
                 var url = form._readUrl;
-                form.BaseUtil.request({url })
+                saas.util.BaseUtil.request({url })
                 .then(function(res) {
                     if(res.success) {
-                        var d = res.data;
-                        viewModel.setData(d)
+                        var list = res.data.list;
+                        if(list.length>0){
+                            var d = {};
+                            Ext.each(list, function(item, index){
+                                d[item.code] = item.data;
+                            });
+                            viewModel.setData(d);
+                        }
                     }
                 })
                 .catch(function(response) {
@@ -59,8 +71,7 @@ Ext.define('saas.view.sys.baseconfig.FormPanelController', {
         })
         .catch(function(res) {
             console.error(res);
-            showToast('保存失败: ' + res.message);
+            saas.util.BaseUtil.showToast('保存失败: ' + res.message);
         });
     }
-
 });

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

@@ -131,18 +131,19 @@ Ext.define('saas.view.sys.config.FormPanel', {
 		border: false,
 		minHeight: 22,
 		bodyStyle: 'padding:2px;',
-        layout: 'hbox',
+        layout: 'vbox',
         items:[{
             bind:'{signet}',
             name : "signet", 
             allowBlank : true, 
             hidden:true,
-            xtype:'numberfield'
+            xtype:'textfield'
         },{
             allowBlank : true, 
             width:500,
             fieldLabel:'打印章上传',
             xtype: 'filefield',
+            name:'signetFilefield',
             emptyText: '请选择图片',
             buttonText: '',
             buttonConfig: {
@@ -184,31 +185,68 @@ Ext.define('saas.view.sys.config.FormPanel', {
                             "Content-Type":null
                         },
                         success: function (response, opts) {
-                            form.setLoading(false);
-                            showToast('上传成功');
+                            saas.util.BaseUtil.showToast('上传成功');
                             var res = Ext.decode(response.responseText);
                             if(res.success){
                                 var data = res.data;
                                 var name = data.name + "  (" + Ext.util.Format.fileSize(data.size) + ")";
-                                myForm.down('[name=signet]').setValue(data.id);
+                                myForm.down('[name=signet]').setValue(data.fullPath);
                                 field.setRawValue(name);
+                                //读取图片
+                                if(data.id){
+                                    var img = myForm.down('[name=SignetPhoto]');
+                                    img.el.dom.src = 'http://192.168.253.31:8560/api/file/download?path='+data.fullPath;
+                                    var showSignetPhoto = form.down('[name=showSignetPhoto]');
+                                    showSignetPhoto.show();
+                                }
                             }else{
-                                showToast('上传失败: ' + res.message);
+                                saas.util.BaseUtil.showToast('上传失败: ' + res.message);
                             }
+                            form.setLoading(false);
                         },
                         failure: function (response, opts) {
                             form.setLoading(false);
                             var res = Ext.decode(response.responseText);
-                            showToast('上传失败: ' + res.message);
+                            saas.util.BaseUtil.showToast('上传失败: ' + res.message);
                         }
                     });
                 }
             }
         },{
-            hidden:true,
+            xtype: 'image',
+            width: 100,
+            height: 100,
+            margin:'5 0 5 150',
+            src:'resources/images/default/basePhoto.png',
+            name:'SignetPhoto',
+        },{
+            margin:'0 0 5 151',
+            xtype:'container',
             name:'showSignetPhoto',
-            xtype:'button',
-            iconCls: 'x-fa fa-picture-o'
+            cls:'x-container-group',
+            hidden:true,
+            items:[{
+                width: 45,
+                height: 24,
+                xtype:'button',
+                text:'查看',
+                handler:function(b){
+                    var form = b.ownerCt.ownerCt.ownerCt;
+                    var img = form.down('[name=SignetPhoto]');
+                    form.lookPic(img);
+                }
+            },{
+                margin:'0 0 0 10',
+                width: 45,
+                height: 24,
+                xtype:'button',
+                text:'下载',
+                handler:function(b){
+                    var form = b.ownerCt.ownerCt.ownerCt;
+                    var path = form.down('[name=signet]').value;
+                    form.downLoad(path);
+                }
+            }]
         }]
     },{
         xtype: 'form',
@@ -217,17 +255,18 @@ Ext.define('saas.view.sys.config.FormPanel', {
 		border: false,
 		minHeight: 22,
 		bodyStyle: 'padding:2px;',
-        layout: 'hbox',
+        layout: 'vbox',
         items:[{
             bind:'{logoUrl}',
             name : "logoUrl", 
             allowBlank : true, 
             hidden:true,
-            xtype:'numberfield'
+            xtype:'textfield'
         },{
             allowBlank : true, 
             width:500,
             fieldLabel:'Logo上传',
+            name:'logoFilefield',
             xtype: 'filefield',
             emptyText: '请选择图片',
             buttonText: '',
@@ -270,31 +309,69 @@ Ext.define('saas.view.sys.config.FormPanel', {
                             "Content-Type":null
                         },
                         success: function (response, opts) {
-                            form.setLoading(false);
-                            showToast('上传成功');
+                            saas.util.BaseUtil.showToast('上传成功');
                             var res = Ext.decode(response.responseText);
                             if(res.success){
                                 var data = res.data;
                                 var name = data.name + "  (" + Ext.util.Format.fileSize(data.size) + ")";
-                                myForm.down('[name=logoUrl]').setValue(data.id);
+                                myForm.down('[name=logoUrl]').setValue(data.fullPath);
                                 field.setRawValue(name);
+                                //读取图片
+                                if(data.id){
+                                    var img = myForm.down('[name=LogoPhoto]');
+                                    img.el.dom.src = 'http://192.168.253.31:8560/api/file/download?path='+data.fullPath;
+                                    var showLogoPhoto = form.down('[name=showLogoPhoto]');
+                                    showLogoPhoto.show();
+                                }
                             }else{
-                                showToast('上传失败: ' + res.message);
+                                saas.util.BaseUtil.showToast('上传失败: ' + res.message);
                             }
+                            form.setLoading(false);
                         },
                         failure: function (response, opts) {
                             form.setLoading(false);
                             var res = Ext.decode(response.responseText);
-                            showToast('上传失败: ' + res.message);
+                            saas.util.BaseUtil.showToast('上传失败: ' + res.message);
                         }
                     });
                 }
             }
         },{
-            hidden:true,
+            xtype: 'image',
+            style:'border:1px solid #f7f7f7;',
+            width: 100,
+            height: 100,
+            margin:'5 0 5 150',
+            src:'resources/images/default/basePhoto.png',
+            name:'LogoPhoto',
+        },{
             name:'showLogoPhoto',
-            xtype:'button',
-            iconCls: 'x-fa fa-picture-o'
+            margin:'0 0 5 151',
+            xtype:'container',
+            cls:'x-container-group',
+            hidden:true,
+            items:[{
+                width: 45,
+                height: 24,
+                xtype:'button',
+                text:'查看',
+                handler:function(b){
+                    var form = b.ownerCt.ownerCt.ownerCt;
+                    var img = form.down('[name=LogoPhoto]');
+                    form.lookPic(img);
+                }
+            },{
+                margin:'0 0 0 10',
+                width: 45,
+                height: 24,
+                xtype:'button',
+                text:'下载',
+                handler:function(b){
+                    var form = b.ownerCt.ownerCt.ownerCt;
+                    var path = form.down('[name=logoUrl]').value;
+                    form.downLoad(path);
+                }
+            }]
         }]
     }],
 
@@ -306,7 +383,9 @@ Ext.define('saas.view.sys.config.FormPanel', {
         .then(function(res) {
             if(res.success) {
                 var d = res.data;
-                viewModel.setData(d)
+                viewModel.setData(d);
+                viewModel.notify();
+                me.load(me);
             }
         })
         .catch(function(response) {
@@ -318,5 +397,92 @@ Ext.define('saas.view.sys.config.FormPanel', {
 
     refresh:function(){
         this.ownerCt.setTitle('参数设置')
+    },
+
+    load:function(form){
+        //打印章
+        var signet = form.down('[name=signet]').value;
+        if(signet&&signet!=''){
+            var img = form.down('[name=SignetPhoto]');
+            img.el.dom.src = 'http://192.168.253.31:8560/api/file/download?path='+signet;
+            // var name = data.name + "  (" + Ext.util.Format.fileSize(data.size) + ")";
+            // myForm.down('[name=signet]').setValue(data.fullPath);
+            // field.setRawValue(name);
+            var showSignetPhoto = form.down('[name=showSignetPhoto]');
+            showSignetPhoto.show();
+        }
+        //Logo
+        var logoUrl = form.down('[name=logoUrl]').value;
+        if(logoUrl&&logoUrl!=''){
+            var img = form.down('[name=LogoPhoto]');
+            img.el.dom.src = 'http://192.168.253.31:8560/api/file/download?path='+logoUrl;
+            var showLogoPhoto = form.down('[name=showLogoPhoto]');
+            showLogoPhoto.show();
+        }
+        //文件名称
+        var viewModel = form.getViewModel();
+        if(viewModel.data.fileInfoList&&viewModel.data.fileInfoList.length!=0){
+            var logo = viewModel.data.fileInfoList[0].logo;
+            var logoName = logo.name + "  (" + Ext.util.Format.fileSize(logo.size) + ")";
+            form.down('[name=logoFilefield]').setRawValue(logoName);
+            var signet = viewModel.data.fileInfoList[0].signet;
+            var signetName = signet.name + "  (" + Ext.util.Format.fileSize(signet.size) + ")";
+            form.down('[name=signetFilefield]').setRawValue(signetName);
+        }
+    },
+
+    lookPic:function(img){
+        var me = this, resizer = me.resizer,
+        imageframe = document.getElementById('ext-image-frame');
+        var src = img.el.dom.src;
+        if (!imageframe) {
+            var el = Ext.DomHelper.append(document.body, '<img id="ext-image-frame" src="' + src +
+                    '" width="500" height="400" style="position:absolute;left:0;top:0px;"/>', true);
+            imageframe = el.dom;
+        } else {
+            imageframe.src = src;
+        }
+        if (!resizer) {
+            resizer = this.resizer = Ext.create('Ext.resizer.Resizer', {
+                target: 'ext-image-frame',
+                pinned: true,
+                width: 410,
+                height: 310,
+                minWidth: 100,
+                minHeight: 80,
+                preserveRatio: true,
+                handles: 'all',
+                dynamic: true,
+                constrainTo:me.getEl()
+            });
+            var resizerEl = resizer.getEl();
+            resizerEl.on('dblclick', function(){
+                resizerEl.hide(true);
+            });
+        }
+        resizer.getEl().center();
+        resizer.getEl().show(true);
+        Ext.DomHelper.applyStyles(imageframe, 'position:absolute;z-index:100;');
+    },
+
+    downLoad:function(path){
+        //ajax 响应下载必须要创建一个form实例
+
+        window.location.href = 'http://192.168.253.31:8560/api/file/download?path='+path;
+
+        // if (!Ext.fly('ext-attach-download')) {  
+		// 	var frm = document.createElement('form');  
+		// 	frm.id = 'ext-attach-download';  
+		// 	frm.name = id;  
+		// 	frm.className = 'x-hidden';
+		// 	document.body.appendChild(frm);
+        // }
+		// Ext.Ajax.request({
+		// 	url: 'http://192.168.253.31:8560/api/file/download?path='+path,  
+		// 	method: 'post',
+		// 	form: Ext.fly('ext-attach-download'),
+		// 	isUpload: true,
+		// 	params: ''
+		// });
     }
 });

+ 7 - 1
frontend/saas-web/app/view/sys/guide/FormPanel.js

@@ -158,8 +158,13 @@ Ext.define('saas.view.sys.guide.FormPanel', {
 
     refresh:function(){
         this.ownerCt.setTitle('新手指引');
-        this.view.store.load();
         //刷新store数据
+        this.view.store.load();
+        //关闭窗口
+        if(this.down('[name=messagebox]')){
+            this.down('[name=messagebox]').updateLayout();
+            this.down('[name=messagebox]').doClose();
+        }
     },
 
     showInformation:function(type,value){
@@ -214,6 +219,7 @@ Ext.define('saas.view.sys.guide.FormPanel', {
         var width = box.width;
 
         var win = form.add(Ext.create('Ext.window.MessageBox', {
+            name:'messagebox',
             msg:message,
             buttonAlign : 'right',
             height:0.5*height,

+ 9 - 0
frontend/saas-web/app/view/sys/manager/FormPanel.scss

@@ -32,6 +32,15 @@
             width:100px !important;
         }
     }
+    .x-img-default{
+        border: 1px solid #bdbdbd !important;
+    }
+    .x-container-group{
+        .x-btn-inner-default-small {
+            margin-bottom: 9px !important;
+            padding: 0 !important; 
+        }
+    }
 }
 .sys-account-datalist{
     .x-grid-body{

二进制
frontend/saas-web/resources/images/default/basePhoto.png


+ 0 - 4
frontend/saas-web/resources/json/navigation.json

@@ -272,10 +272,6 @@
             "text": "收支类别",
             "viewType": "document-kind",
             "leaf": true
-        }, {
-            "text": "用户角色",
-            "viewType": "mainlist",
-            "leaf": true
         }]
     }]
 },{