Przeglądaj źródła

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

zhuth 7 lat temu
rodzic
commit
eff0675273
25 zmienionych plików z 305 dodań i 440 usunięć
  1. 5 8
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/RecdetailView.java
  2. 1 1
      applications/money/money-server/src/main/resources/mapper/AcountbalanceViewMapper.xml
  3. 1 1
      applications/money/money-server/src/main/resources/mapper/CustomerCheckViewMapper.xml
  4. 1 1
      applications/money/money-server/src/main/resources/mapper/PaydetailViewMapper.xml
  5. 2 2
      applications/money/money-server/src/main/resources/mapper/RecdetailViewMapper.xml
  6. 1 1
      applications/money/money-server/src/main/resources/mapper/VendorAcountViewMapper.xml
  7. 14 0
      applications/purchase/purchase-api/pom.xml
  8. 14 0
      applications/purchase/purchase-api/src/main/java/com/usoftchina/saas/purchase/api/PurchaseService.java
  9. 4 0
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/controller/PurchaseController.java
  10. 1 1
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/PurchaseService.java
  11. 7 1
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/PurchaseServiceImpl.java
  12. 1 1
      applications/purchase/purchase-server/src/main/resources/application.yml
  13. 4 0
      applications/sale/sale-server/pom.xml
  14. 12 7
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/impl/SaleServiceImpl.java
  15. 5 1
      frontend/saas-web/app/view/core/dbfind/DbfindTrigger.js
  16. 86 90
      frontend/saas-web/app/view/core/dbfind/MultiDbfindTrigger.js
  17. 1 1
      frontend/saas-web/app/view/money/report/CustomerCheck.js
  18. 1 1
      frontend/saas-web/app/view/money/report/RecDetail.js
  19. 1 1
      frontend/saas-web/app/view/money/report/VendorCheck.js
  20. 1 1
      frontend/saas-web/app/view/sale/report/Sale.js
  21. 1 1
      frontend/saas-web/app/view/stock/make/FormPanel.js
  22. 7 7
      frontend/saas-web/app/view/stock/make/FormPanelController.js
  23. 5 5
      frontend/saas-web/app/view/sys/config/FormPanel.js
  24. 125 301
      frontend/saas-web/app/view/sys/power/GroupGrid.js
  25. 4 7
      frontend/saas-web/app/view/sys/power/OtherField.js

+ 5 - 8
applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/RecdetailView.java

@@ -25,13 +25,17 @@ public class RecdetailView {
 
     private Double mustpay;
 
-    private Double mustdate;
+    private Date mustdate;
 
     private Double pi_total;
 
     private String pi_remark;
     private Integer companyId;
 
+    public void setMustdate(Date mustdate) {
+        this.mustdate = mustdate;
+    }
+
     public Integer getCompanyId() {
         return companyId;
     }
@@ -104,13 +108,6 @@ public class RecdetailView {
         this.mustpay = mustpay;
     }
 
-    public Double getMustdate() {
-        return mustdate;
-    }
-
-    public void setMustdate(Double mustdate) {
-        this.mustdate = mustdate;
-    }
 
     public Double getPi_total() {
         return pi_total;

+ 1 - 1
applications/money/money-server/src/main/resources/mapper/AcountbalanceViewMapper.xml

@@ -27,7 +27,7 @@
         and  companyId = #{companyId}
       </if>
     </where>
-    order by bankname, date, bankid desc
+    order by bankname asc, date desc, bankid desc
   </select>
 
 </mapper>

+ 1 - 1
applications/money/money-server/src/main/resources/mapper/CustomerCheckViewMapper.xml

@@ -30,7 +30,7 @@
                 and  companyId = #{companyId}
             </if>
         </where>
-        order by pi_date desc
+        order by pi_custname asc, pi_date desc, pi_custcode desc
     </select>
 
 </mapper>

+ 1 - 1
applications/money/money-server/src/main/resources/mapper/PaydetailViewMapper.xml

@@ -29,7 +29,7 @@
         and  companyId = #{companyId}
       </if>
     </where>
-    order by pb_date desc
+    order by pi_vendname asc, pb_date desc,pi_vendcode desc
   </select>
 
 </mapper>

+ 2 - 2
applications/money/money-server/src/main/resources/mapper/RecdetailViewMapper.xml

@@ -13,7 +13,7 @@
     <result column="rb_rdamount" property="rb_rdamount" jdbcType="DOUBLE" />
     <result column="rb_rbdamount" property="rb_rbdamount" jdbcType="DOUBLE" />
     <result column="mustpay" property="mustpay" jdbcType="DOUBLE" />
-    <result column="mustdate" property="mustdate" jdbcType="DOUBLE" />
+    <result column="mustdate" property="mustdate" jdbcType="TIMESTAMP" />
     <result column="pi_total" property="pi_total" jdbcType="DOUBLE" />
     <result column="pi_remark" property="pi_remark" jdbcType="VARCHAR" />
   <result column="companyId" property="companyId" jdbcType="INTEGER" />
@@ -29,6 +29,6 @@
         and  companyId = #{companyId}
       </if>
     </where>
-    order by rb_date desc
+    order by pi_custname asc, rb_date desc, pi_custcode desc
   </select>
 </mapper>

+ 1 - 1
applications/money/money-server/src/main/resources/mapper/VendorAcountViewMapper.xml

@@ -32,6 +32,6 @@
         and  companyId = #{companyId}
       </if>
     </where>
-    order by pi_date desc
+    order by pi_vendname asc, pi_date desc, pi_vendcode desc
   </select>
 </mapper>

+ 14 - 0
applications/purchase/purchase-api/pom.xml

@@ -13,4 +13,18 @@
     <description>purchase server api</description>
 
 
+    <dependencies>
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-openfeign</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.usoftchina.saas</groupId>
+            <artifactId>purchase-dto</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.usoftchina.saas</groupId>
+            <artifactId>core</artifactId>
+        </dependency>
+    </dependencies>
 </project>

+ 14 - 0
applications/purchase/purchase-api/src/main/java/com/usoftchina/saas/purchase/api/PurchaseService.java

@@ -0,0 +1,14 @@
+package com.usoftchina.saas.purchase.api;
+
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+
+@FeignClient("purchase-server")
+public interface PurchaseService {
+
+    @PostMapping("/purchase/getPurchaseCode")
+    public String getPurchaseCode(@RequestBody DocBaseDTO baseDTO);
+
+}

+ 4 - 0
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/controller/PurchaseController.java

@@ -174,4 +174,8 @@ public class PurchaseController {
         return purchaseService.turnProdin(id);
     }
 
+    @PostMapping("/getPurchaseCode")
+    public String getPurchaseCode(@RequestBody DocBaseDTO baseDTO) {
+        return purchaseService.getPurchaseCode(baseDTO);
+    }
 }

+ 1 - 1
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/PurchaseService.java

@@ -136,5 +136,5 @@ public interface PurchaseService extends CommonBaseService<PurchaseMapper, Purch
      */
     Result turnProdin(Long id);
 
-
+    String getPurchaseCode(DocBaseDTO baseDTO);
 }

+ 7 - 1
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/PurchaseServiceImpl.java

@@ -594,7 +594,13 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
         }
         return billCode;
     }
-    
+
+    @Override
+    public String getPurchaseCode(DocBaseDTO baseDTO) {
+       String caller = baseDTO.getName();
+       String code = maxnumberService.getMaxnumber(caller, false).getData();
+       return pushMaxnubmer(code, baseDTO.getId());
+    }
     /** 
     * @Description
     * @Param: [id]

+ 1 - 1
applications/purchase/purchase-server/src/main/resources/application.yml

@@ -47,7 +47,7 @@ eureka:
   client:
     registryFetchIntervalSeconds: 5
     serviceUrl:
-      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@192.168.0.181:8510/eureka/
+      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@localhost:8500/eureka/
 management:
   endpoints:
     web:

+ 4 - 0
applications/sale/sale-server/pom.xml

@@ -88,6 +88,10 @@
             <groupId>com.usoftchina.saas</groupId>
             <artifactId>commons-api</artifactId>
         </dependency>
+        <dependency>
+            <groupId>com.usoftchina.saas</groupId>
+            <artifactId>purchase-api</artifactId>
+        </dependency>
     </dependencies>
 
     <build>

+ 12 - 7
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/impl/SaleServiceImpl.java

@@ -19,6 +19,7 @@ import com.usoftchina.saas.document.entities.Product;
 import com.usoftchina.saas.exception.BizException;
 import com.usoftchina.saas.page.PageDefault;
 import com.usoftchina.saas.page.PageRequest;
+import com.usoftchina.saas.purchase.api.PurchaseService;
 import com.usoftchina.saas.sale.dto.*;
 import com.usoftchina.saas.sale.mapper.*;
 import com.usoftchina.saas.sale.po.Sale;
@@ -62,6 +63,8 @@ public class SaleServiceImpl implements SaleService{
     private ProdInOutService prodInOutService;
     @Autowired
     private CommonService commonService;
+    @Autowired
+    private PurchaseService purchaseService;
 
     @Override
     public PageInfo<SaleList> getListData(@PageDefault(size = 10) PageRequest page, ListReqDTO req) {
@@ -486,7 +489,7 @@ public class SaleServiceImpl implements SaleService{
             //获取物料默认仓库
             Map<String, Object> warehouse = getWareHouseByCode(saleDetail.getSd_prodcode());
             if (null != warehouse) {
-                prodIODetail.setPd_whid(warehouse.get("pr_whid") == null ? 0 : Integer.valueOf(warehouse.get("pr_whid").toString()));
+                prodIODetail.setPd_whid(warehouse.get("pr_whid") == null ? 0 : Long.valueOf(warehouse.get("pr_whid").toString()));
                 prodIODetail.setPd_whcode(warehouse.get("pr_whcode") == null ? null : warehouse.get("pr_whcode").toString());
                 prodIODetail.setPd_whname(warehouse.get("pr_whname") == null ? null : warehouse.get("pr_whname").toString());
             }
@@ -550,10 +553,13 @@ public class SaleServiceImpl implements SaleService{
 
         PurchaseDTO purchase = new PurchaseDTO();
         List<PurchaseDetailDTO> listPurchaseDetail = new ArrayList<PurchaseDetailDTO>();
-
+        DocBaseDTO baseDTO = new DocBaseDTO();
         //销售主表转采购主表
-        Result<String> result = maxnumberService.getMaxnumber(BillCodeSeq.PURCHASE.getCaller(),false);
-        purchase.setPu_code(result.getData());
+       // Result<String> result = maxnumberService.getMaxnumber(BillCodeSeq.PURCHASE.getCaller(),false);
+        baseDTO.setId(0l);
+        baseDTO.setName(BillCodeSeq.PURCHASE.getCaller());
+        String result = purchaseService.getPurchaseCode(baseDTO);
+        purchase.setPu_code(result);
         purchase.setPu_status(Status.UNAUDITED.getDisplay());
         purchase.setPu_statuscode(Status.UNAUDITED.toString());
         purchase.setCompanyId(BaseContextHolder.getCompanyId());
@@ -584,12 +590,11 @@ public class SaleServiceImpl implements SaleService{
             purchaseDetail.setCreateTime(new Date());
             purchaseDetail.setCreatorName(BaseContextHolder.getUserName());
             purchaseDetail.setPd_puid(purchaseId);
-            purchaseDetail.setPd_code(result.getData());
+            purchaseDetail.setPd_code(result);
             listPurchaseDetail.add(purchaseDetail);
         }
         saleMapper.turnPurchaseDetail(listPurchaseDetail);
-        DocBaseDTO baseDTO = new DocBaseDTO();
-        baseDTO.setCode(result.getData());
+        baseDTO.setCode(result);
         baseDTO.setId(Long.valueOf(String.valueOf(purchaseId)));
         baseDTO.setName(BillCodeSeq.PURCHASE.getName());
         return baseDTO;

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

@@ -256,7 +256,11 @@ Ext.define('saas.view.core.dbfind.DbfindTrigger', {
                                     field.setValue(null);
                                     field.lastTriggerValue=null;
                                 }else{
-                                    field.setValue(null);
+                                    if(field.xtype.indexOf('hidden')>-1){
+                                        field.setValue(0);
+                                    }else{
+                                        field.setValue(null);
+                                    }
                                 }    
                             }
                         }

+ 86 - 90
frontend/saas-web/app/view/core/dbfind/MultiDbfindTrigger.js

@@ -31,105 +31,101 @@ Ext.define('saas.view.core.dbfind.MultiDbfindTrigger', {
         };
     	queryString = queryString || '';
     	var me = this;
-    	if(me.lastQueryValue!=queryString){
-    		me.judge(me);
-    		var field=[];
-    		var sfield='';
-            var dbfinds=me.dbfinds;
-            var dbtpls=me.dbtpls;
-    		me.lastQueryValue=queryString;
-            if(queryString.trim()==''){
+        me.judge(me);
+        var field=[];
+        var sfield='';
+        var dbfinds=me.dbfinds;
+        var dbtpls=me.dbtpls;
+        me.lastQueryValue=queryString;
+        if(queryString.trim()==''){
+            me.collapse( );
+        }else{
+            if(!dbfinds||!dbtpls){
                 me.collapse( );
-            }else{
-                if(!dbfinds||!dbtpls){
-                    me.collapse( );
-                }else{                   
-                    //加载tpl模板
-                    if(dbtpls.length>0){
-                        var span="";
-                        var width=0;
-                        for(var i=0;i<dbtpls.length;i++){
-                            if(i==0){
-                                span=span+'<span style="width:'+dbtpls[i].width+'px;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;float:left;">{'+dbtpls[i].field+'}</span>';//display:block;
-                            }else{
-                                span=span+'<span style="padding:0 0 0 20px;width:'+dbtpls[i].width+'px;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;float:left;">{'+dbtpls[i].field+'}</span>';
-                            }
-                            if(dbtpls[i].dbField=="true"){
-                                me.searchFieldArray=dbtpls[i].field;
-                            }
-                            width=width+dbtpls[i].width+20;
-                            field.push(dbtpls[i].field);
-                            sfield=sfield+dbtpls[i].field+',';
+            }else{                   
+                //加载tpl模板
+                if(dbtpls.length>0){
+                    var span="";
+                    var width=0;
+                    for(var i=0;i<dbtpls.length;i++){
+                        if(i==0){
+                            span=span+'<span style="width:'+dbtpls[i].width+'px;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;float:left;">{'+dbtpls[i].field+'}</span>';//display:block;
+                        }else{
+                            span=span+'<span style="padding:0 0 0 20px;width:'+dbtpls[i].width+'px;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;float:left;">{'+dbtpls[i].field+'}</span>';
                         }
-                        me.defaultListConfig.minWidth=width+10;
-                        me.defaultListConfig.maxHeight=210;
-                        me.defaultListConfig.autoScroll=true;
-                        me.searchField=sfield.substring(0,sfield.length-1);
-                        me.tpl=Ext.create('Ext.XTemplate',
-                                '<ul style="padding-left: 0px;"><tpl for=".">',
-                                '<li role="option" class="x-boundlist-item" style="list-style:none;">' ,
-                                '<div style="height:30px;">',
-                                ''+span+'',
-                                '</li>',
-                            '</tpl></ul>'
-                        );
-                        me.store.setFields(field);
-                    }
-                }
-                //加载数据
-                var data,dbCondition=[];
-                if(me.dbfinds){
-                    var dbtplcondition = "";
-                    for (let index = 0; index < dbfinds.length; index++) {
-                        var item = dbfinds[index].from;
-                        if(!dbfinds[index].ignore){
-                            dbtplcondition+= "upper("+item+") like '%"+queryString.toUpperCase()+"%' or ";
+                        if(dbtpls[i].dbField=="true"){
+                            me.searchFieldArray=dbtpls[i].field;
                         }
+                        width=width+dbtpls[i].width+20;
+                        field.push(dbtpls[i].field);
+                        sfield=sfield+dbtpls[i].field+',';
                     }
-                    dbtplcondition = "(" + dbtplcondition.substring(0,dbtplcondition.length-4) + ")";
-                    if(dbtplcondition.length>0){
-                        dbCondition = [{
-                            type: 'condition',
-                            value:dbtplcondition
-                        }];
+                    me.defaultListConfig.minWidth=width+10;
+                    me.defaultListConfig.maxHeight=210;
+                    me.defaultListConfig.autoScroll=true;
+                    me.searchField=sfield.substring(0,sfield.length-1);
+                    me.tpl=Ext.create('Ext.XTemplate',
+                            '<ul style="padding-left: 0px;"><tpl for=".">',
+                            '<li role="option" class="x-boundlist-item" style="list-style:none;">' ,
+                            '<div style="height:30px;">',
+                            ''+span+'',
+                            '</li>',
+                        '</tpl></ul>'
+                    );
+                    me.store.setFields(field);
+                }
+            }
+            //加载数据
+            var data,dbCondition=[];
+            if(me.dbfinds){
+                var dbtplcondition = "";
+                for (let index = 0; index < dbfinds.length; index++) {
+                    var item = dbfinds[index].from;
+                    if(!dbfinds[index].ignore){
+                        dbtplcondition+= "upper("+item+") like '%"+queryString.toUpperCase()+"%' or ";
                     }
                 }
-                //添加默认条件
-                if(me.defaultCondition) {
-                    dbCondition.push({
+                dbtplcondition = "(" + dbtplcondition.substring(0,dbtplcondition.length-4) + ")";
+                if(dbtplcondition.length>0){
+                    dbCondition = [{
                         type: 'condition',
-                        value: me.defaultCondition
-                    });
+                        value:dbtplcondition
+                    }];
                 }
-                Ext.Ajax.request({
-                    url: me.dataUrl,
-                    params: {
-                        number: 1,
-                        size: 10,
-                        condition:JSON.stringify(dbCondition),
-                        page: 1,
-                        start: 0,
-                        limit: 10
-                    },
-                    method: 'GET',
-                    success: function(response, opts) {
-                        data = Ext.decode(response.responseText);
-                        data = data.data?data.data.list:[];
-                        if(data!=null && data.length>0 && me.store && field.length>0){
-                            me.store.loadData(data,false);
-                            me.expand();
-                        }else{
-                            me.store.removeAll();
-                            me.collapse();
-                        }
-                    },
-                    failure: function(response, opts) {}
-                });                
             }
-            return true;
-    	}else{
-    		return false;
-    	}
+            //添加默认条件
+            if(me.defaultCondition) {
+                dbCondition.push({
+                    type: 'condition',
+                    value: me.defaultCondition
+                });
+            }
+            Ext.Ajax.request({
+                url: me.dataUrl,
+                params: {
+                    number: 1,
+                    size: 10,
+                    condition:JSON.stringify(dbCondition),
+                    page: 1,
+                    start: 0,
+                    limit: 10
+                },
+                method: 'GET',
+                success: function(response, opts) {
+                    data = Ext.decode(response.responseText);
+                    data = data.data?data.data.list:[];
+                    if(data!=null && data.length>0 && me.store && field.length>0){
+                        me.store.loadData(data,false);
+                        me.expand();
+                    }else{
+                        me.store.removeAll();
+                        me.collapse();
+                    }
+                },
+                failure: function(response, opts) {}
+            });                
+        }
+        return true;
     },
     onTriggerClick:function(f){
         if(!this.fireEvent('beforetriggerclick', this)) {

+ 1 - 1
frontend/saas-web/app/view/money/report/CustomerCheck.js

@@ -7,7 +7,7 @@ Ext.define('saas.view.money.report.CustomerCheckCheck', {
 
     viewName: 'money-report-customercheck',
 
-    groupField: null,
+    groupField: 'pi_custname',
     listUrl: '/api/money/report/customercheck',
     defaultCondition: null,
     reportTitle: '客户对账单',

+ 1 - 1
frontend/saas-web/app/view/money/report/RecDetail.js

@@ -7,7 +7,7 @@ Ext.define('saas.view.money.report.RecDetail', {
 
     viewName: 'money-report-recdetail',
 
-    groupField: null,
+    groupField: 'pi_custname',
     listUrl: '/api/money/report/recDetail',
     defaultCondition: null,
     reportTitle: '应收账款明细',

+ 1 - 1
frontend/saas-web/app/view/money/report/VendorCheck.js

@@ -7,7 +7,7 @@ Ext.define('saas.view.money.report.VendorCheck', {
 
     viewName: 'money-report-vendorcheck',
 
-    groupField: null,
+    groupField: 'pi_vendname',
     listUrl: '/api/money/report/vendorCheck',
     defaultCondition: null,
     reportTitle: '供应商对账单',

+ 1 - 1
frontend/saas-web/app/view/sale/report/Sale.js

@@ -8,7 +8,7 @@ Ext.define('saas.view.sale.report.Sale', {
     viewName: 'sale-report-sale',
 
     groupField: null,
-    listUrl: '/api/sale/sale/list',
+    listUrl: '/api/sale/report/saleDetail',
     defaultCondition: null,
     reportTitle: '销售明细报表',
     QueryWidth:0.2,

+ 1 - 1
frontend/saas-web/app/view/stock/make/FormPanel.js

@@ -293,7 +293,7 @@ Ext.define('saas.view.stock.make.FormPanel', {
                     minValue:0
                 },
                 listeners:{
-                    edit:'price_change'
+                    // edit:'price_change'
                 },
                 renderer : function(v) {
                     var arr = (v + '.').split('.');

+ 7 - 7
frontend/saas-web/app/view/stock/make/FormPanelController.js

@@ -81,13 +81,13 @@ Ext.define('saas.view.stock.make.FormPanelController', {
     },
 
 
-    price_change:function() {
-        var me = this,
-        viewModel = me.getViewModel(),
-        store = viewModel.get('detail0').detailStore;
-        var sum_qty = store.sum('mm_price');
-        viewModel.set('ma_price',sum_qty);
-    },
+    // price_change:function() {
+    //     var me = this,
+    //     viewModel = me.getViewModel(),
+    //     store = viewModel.get('detail0').detailStore;
+    //     var sum_qty = store.sum('mm_price');
+    //     viewModel.set('ma_price',sum_qty);
+    // },
 
 
      getBomData: function(v) {

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

@@ -199,7 +199,7 @@ Ext.define('saas.view.sys.config.FormPanel', {
                                 if(data.id){
                                     var serverOptions = Ext.manifest.server;
                                     var img = myForm.down('[name=SignetPhoto]');
-                                    img.el.dom.src = serverOptions.basePath + '/api/file/download?path='+data.fullPath;
+                                    img.el.dom.src = serverOptions.basePath.http + '/api/file/download?path='+data.fullPath;
                                     var showSignetPhoto = form.down('[name=showSignetPhoto]');
                                     showSignetPhoto.show();
                                 }
@@ -325,7 +325,7 @@ Ext.define('saas.view.sys.config.FormPanel', {
                                 if(data.id){
                                     var serverOptions = Ext.manifest.server;
                                     var img = myForm.down('[name=LogoPhoto]');
-                                    img.el.dom.src = serverOptions.basePath + '/api/file/download?path='+data.fullPath;
+                                    img.el.dom.src = serverOptions.basePath.http + '/api/file/download?path='+data.fullPath;
                                     var showLogoPhoto = form.down('[name=showLogoPhoto]');
                                     showLogoPhoto.show();
                                 }
@@ -414,7 +414,7 @@ Ext.define('saas.view.sys.config.FormPanel', {
         var signet = form.down('[name=signet]').value;
         if(signet&&signet!=''){
             var img = form.down('[name=SignetPhoto]');
-            img.el.dom.src = serverOptions.basePath + '/api/file/download?path='+signet;
+            img.el.dom.src = serverOptions.basePath.http + '/api/file/download?path='+signet;
             var showSignetPhoto = form.down('[name=showSignetPhoto]');
             showSignetPhoto.show();
         }
@@ -422,7 +422,7 @@ Ext.define('saas.view.sys.config.FormPanel', {
         var logoUrl = form.down('[name=logoUrl]').value;
         if(logoUrl&&logoUrl!=''){
             var img = form.down('[name=LogoPhoto]');
-            img.el.dom.src = serverOptions.basePath + '/api/file/download?path='+logoUrl;
+            img.el.dom.src = serverOptions.basePath.http + '/api/file/download?path='+logoUrl;
             var showLogoPhoto = form.down('[name=showLogoPhoto]');
             showLogoPhoto.show();
         }
@@ -472,7 +472,7 @@ Ext.define('saas.view.sys.config.FormPanel', {
 
     downLoad:function(path){
         var serverOptions = Ext.manifest.server;
-        window.location.href = serverOptions.basePath + '/api/file/download?path='+path;
+        window.location.href = serverOptions.basePath.http + '/api/file/download?path='+path;
         //ajax 响应下载必须要创建一个form实例
         // if (!Ext.fly('ext-attach-download')) {  
 		// 	var frm = document.createElement('form');  

+ 125 - 301
frontend/saas-web/app/view/sys/power/GroupGrid.js

@@ -20,7 +20,14 @@ Ext.define('saas.view.sys.power.GroupGrid', {
         expandTip:null,
 		showSummaryRow: false,
         startCollapsed: false,
-        groupHeaderTpl: '{name}'+'模块'
+        groupHeaderTpl: Ext.create('Ext.XTemplate',
+            '<div>{rows:this.formatName}</div>',
+            {
+                formatName: function(name) {
+                    return name[0].data.moduleName+'模块';
+                }
+            }
+        )
 	})],
     initId:0,
     dataUrl:'/api/account/role/power/resource',
@@ -43,313 +50,127 @@ Ext.define('saas.view.sys.power.GroupGrid', {
      markDirty: false
     },
     trackMouseOver: false,
-    columns: [{
-        header: '单据名称',
-        dataIndex: 'groupName',
-        xtype: '',
-        flex: 2,
-        stopSelection: false,
-        menuDisabled:true,
-    },{
-        header: '查询',
-        dataIndex: 'query',
-        xtype: 'checkcolumn',
-        headerCheckbox: true,
-        menuDisabled:true,
-        flex: 1,
-        stopSelection: false,
-        onTitleElClick:function(a,b,c,d){
-            var me = this;
-            var records = me.ownerCt.ownerCt.store.data.items;
-            var first = 'null',isAllCheck = true;
-            Ext.Array.each(records,function(rec){
-                var data = rec.get('query');
-                if(data!=null&&(typeof data)=='boolean'){
-                    if(first=='null'){
-                        first = data;
-                    }else{
-                        if(first!=data){
-                            isAllCheck = false
-                        }
-                    }
-                    rec.set('query',!data)
-                }
-            });
-            if(isAllCheck){
-                me.setHeaderStatus(!first)
-            }
-        },
-        doUpdateHeaderState: function(e) {
-            return true;
-        }
-    }, {
-        header: '保存',
-        dataIndex: 'add',
-        xtype: 'checkcolumn',
-        headerCheckbox: true,
-        menuDisabled:true,
-        flex: 1,
-        stopSelection: false,
-        onTitleElClick:function(a,b,c,d){
-            var me = this;
-            var records = me.ownerCt.ownerCt.store.data.items;
-            var first = 'null',isAllCheck = true;
-            Ext.Array.each(records,function(rec){
-                var data = rec.get('add');
-                if(data!=null&&(typeof data)=='boolean'){
-                    if(first=='null'){
-                        first = data;
-                    }else{
-                        if(first!=data){
-                            isAllCheck = false
-                        }
-                    }
-                    rec.set('add',!data)
-                }
-            });
-            if(isAllCheck){
-                me.setHeaderStatus(!first)
-            }
-        },
-        doUpdateHeaderState: function(e) {
-            return true;
-        }
-    },{
-        header: '启用/关闭',
-        dataIndex: 'update',
-        xtype: 'checkcolumn',
-        headerCheckbox: true,
-        menuDisabled:true,
-        flex: 1.5,
-        stopSelection: false,
-        onTitleElClick:function(a,b,c,d){
-            var me = this;
-            var records = me.ownerCt.ownerCt.store.data.items;
-            var first = 'null',isAllCheck = true;
-            Ext.Array.each(records,function(rec){
-                var data = rec.get('update');
-                if(data!=null&&(typeof data)=='boolean'){
-                    if(first=='null'){
-                        first = data;
-                    }else{
-                        if(first!=data){
+    columns: {
+        defaults:{
+            onTitleElClick:function(a,b,c,d){
+                var me = this;
+                var dataIndex = this.dataIndex;
+                var records = me.ownerCt.ownerCt.store.data.items;
+                var isAllCheck = true;
+                Ext.Array.each(records,function(rec){
+                    var data = rec.get(dataIndex);
+                    if(data!=null&&(typeof data)=='boolean'){
+                        if(!data){
                             isAllCheck = false
                         }
                     }
-                    rec.set('update',!data)
-                }
-            });
-            if(isAllCheck){
-                me.setHeaderStatus(!first)
-            }
-        },
-        doUpdateHeaderState: function(e) {
-            return true;
-        }
-    }, {
-        header: '删除',
-        dataIndex: 'delete',
-        xtype: 'checkcolumn',
-        headerCheckbox: true,
-        menuDisabled:true,
-        flex: 1,
-        stopSelection: false,
-        onTitleElClick:function(a,b,c,d){
-            var me = this;
-            var records = me.ownerCt.ownerCt.store.data.items;
-            var first = 'null',isAllCheck = true;
-            Ext.Array.each(records,function(rec){
-                var data = rec.get('delete');
-                if(data!=null&&(typeof data)=='boolean'){
-                    if(first=='null'){
-                        first = data;
-                    }else{
-                        if(first!=data){
-                            isAllCheck = false
+                });
+                Ext.Array.each(records,function(rec){
+                    var data = rec.get(dataIndex);
+                    if(data!=null&&(typeof data)=='boolean'){
+                        if(data!=!isAllCheck){
+                            rec.set(dataIndex,!isAllCheck)
                         }
                     }
-                    rec.set('delete',!data)
-                }
-            });
-            if(isAllCheck){
-                me.setHeaderStatus(!first)
-            }
-        },
-        doUpdateHeaderState: function(e) {
-            return true;
-        }
-    }, {
-        header: '审核',
-        dataIndex: 'audit',
-        xtype: 'checkcolumn',
-        headerCheckbox: true,
-        menuDisabled:true,
-        flex: 1,
-        stopSelection: false,
-        onTitleElClick:function(a,b,c,d){
-            var me = this;
-            var records = me.ownerCt.ownerCt.store.data.items;
-            var first = 'null',isAllCheck = true;
-            Ext.Array.each(records,function(rec){
-                var data = rec.get('audit');
-                if(data!=null&&(typeof data)=='boolean'){
-                    if(first=='null'){
-                        first = data;
-                    }else{
-                        if(first!=data){
-                            isAllCheck = false
-                        }
-                    }
-                    rec.set('audit',!data)
-                }
-            });
-            if(isAllCheck){
-                me.setHeaderStatus(!first)
-            }
-        },
-        doUpdateHeaderState: function(e) {
-            return true;
-        }
-    }, {
-        header: '反审核',
-        dataIndex: 'unAudit',
-        xtype: 'checkcolumn',
-        headerCheckbox: true,
-        menuDisabled:true,
-        flex: 1,
-        stopSelection: false,
-        onTitleElClick:function(a,b,c,d){
-            var me = this;
-            var records = me.ownerCt.ownerCt.store.data.items;
-            var first = 'null',isAllCheck = true;
-            Ext.Array.each(records,function(rec){
-                var data = rec.get('unAudit');
-                if(data!=null&&(typeof data)=='boolean'){
-                    if(first=='null'){
-                        first = data;
-                    }else{
-                        if(first!=data){
-                            isAllCheck = false
-                        }
-                    }
-                    rec.set('unAudit',!data)
-                }
-            });
-            if(isAllCheck){
-                me.setHeaderStatus(!first)
-            }
-        },
-        doUpdateHeaderState: function(e) {
-            return true;
-        }
-    }, {
-        header: '导入',
-        dataIndex: 'fileImport',
-        xtype: 'checkcolumn',
-        headerCheckbox: true,
-        menuDisabled:true,
-        flex: 1,
-        stopSelection: false,
-        onTitleElClick:function(a,b,c,d){
-            var me = this;
-            var records = me.ownerCt.ownerCt.store.data.items;
-            var first = 'null',isAllCheck = true;
-            Ext.Array.each(records,function(rec){
-                var data = rec.get('fileImport');
-                if(data!=null&&(typeof data)=='boolean'){
-                    if(first=='null'){
-                        first = data;
-                    }else{
-                        if(first!=data){
-                            isAllCheck = false
-                        }
-                    }
-                    rec.set('fileImport',!data)
-                }
-            });
-            if(isAllCheck){
-                me.setHeaderStatus(!first)
-            }
-        },
-        doUpdateHeaderState: function(e) {
-            return true;
-        }
-    }, {
-        header: '导出',
-        dataIndex: 'fileExport',
-        xtype: 'checkcolumn',
-        headerCheckbox: true,
-        menuDisabled:true,
-        flex: 1,
-        stopSelection: false,
-        onTitleElClick:function(a,b,c,d){
-            var me = this;
-            var records = me.ownerCt.ownerCt.store.data.items;
-            var first = 'null',isAllCheck = true;
-            Ext.Array.each(records,function(rec){
-                var data = rec.get('fileExport');
-                if(data!=null&&(typeof data)=='boolean'){
-                    if(first=='null'){
-                        first = data;
-                    }else{
-                        if(first!=data){
-                            isAllCheck = false
-                        }
-                    }
-                    rec.set('fileExport',!data)
-                }
-            });
-            if(isAllCheck){
-                me.setHeaderStatus(!first)
+                });
+                me.setHeaderStatus(!isAllCheck);
+            },
+            doUpdateHeaderState: function(e) {
+                return true;
             }
         },
-        doUpdateHeaderState: function(e) {
-            return true;
-        }
-    }, {
-        header: '打印',
-        dataIndex: 'print',
-        xtype: 'checkcolumn',
-        headerCheckbox: true,
-        menuDisabled:true,
-        flex: 1,
-        stopSelection: false,
-        onTitleElClick:function(a,b,c,d){
-            var me = this;
-            var records = me.ownerCt.ownerCt.store.data.items;
-            var first = 'null',isAllCheck = true;
-            Ext.Array.each(records,function(rec){
-                var data = rec.get('print');
-                if(data!=null&&(typeof data)=='boolean'){
-                    if(first=='null'){
-                        first = data;
-                    }else{
-                        if(first!=data){
-                            isAllCheck = false
-                        }
-                    }
-                    rec.set('print',!data)
-                }
-            });
-            if(isAllCheck){
-                me.setHeaderStatus(!first)
+        items:[{
+            header: '单据名称',
+            dataIndex: 'groupName',
+            xtype: '',
+            flex: 2,
+            stopSelection: false,
+            menuDisabled:true,
+        },{
+            header: '查询',
+            dataIndex: 'query',
+            xtype: 'checkcolumn',
+            headerCheckbox: true,
+            menuDisabled:true,
+            flex: 1,
+            stopSelection: false,
+        }, {
+            header: '保存',
+            dataIndex: 'add',
+            xtype: 'checkcolumn',
+            headerCheckbox: true,
+            menuDisabled:true,
+            flex: 1,
+            stopSelection: false,
+        },{
+            header: '启用/关闭',
+            dataIndex: 'update',
+            xtype: 'checkcolumn',
+            headerCheckbox: true,
+            menuDisabled:true,
+            flex: 1.5,
+            stopSelection: false,
+        }, {
+            header: '删除',
+            dataIndex: 'delete',
+            xtype: 'checkcolumn',
+            headerCheckbox: true,
+            menuDisabled:true,
+            flex: 1,
+            stopSelection: false,
+        }, {
+            header: '审核',
+            dataIndex: 'audit',
+            xtype: 'checkcolumn',
+            headerCheckbox: true,
+            menuDisabled:true,
+            flex: 1,
+            stopSelection: false,
+        }, {
+            header: '反审核',
+            dataIndex: 'unAudit',
+            xtype: 'checkcolumn',
+            headerCheckbox: true,
+            menuDisabled:true,
+            flex: 1,
+            stopSelection: false,
+        }, {
+            header: '导入',
+            dataIndex: 'fileImport',
+            xtype: 'checkcolumn',
+            headerCheckbox: true,
+            menuDisabled:true,
+            flex: 1,
+            stopSelection: false,
+        }, {
+            header: '导出',
+            dataIndex: 'fileExport',
+            xtype: 'checkcolumn',
+            headerCheckbox: true,
+            menuDisabled:true,
+            flex: 1,
+            stopSelection: false,
+        }, {
+            header: '打印',
+            dataIndex: 'print',
+            xtype: 'checkcolumn',
+            headerCheckbox: true,
+            menuDisabled:true,
+            flex: 1,
+            stopSelection: false,
+        },{
+            text: '其它',
+            flex: 2.7,
+            dataIndex:'other',
+            xtype: 'widgetcolumn',
+            menuDisabled:true,
+            producesHTML: false,
+            widget: {
+                xtype: 'powerotherfield',
+                bind:'{record.other}'
             }
-        },
-        doUpdateHeaderState: function(e) {
-            return true;
-        }
-    },{
-        text: '其它',
-        flex: 2.7,
-        dataIndex:'other',
-        xtype: 'widgetcolumn',
-        menuDisabled:true,
-        producesHTML: false,
-        widget: {
-            xtype: 'powerotherfield',
-            bind:'{record.other}'
-        }
-    }],
+        }]
+    },
 
     initComponent: function () {
         var me = this;
@@ -357,6 +178,7 @@ Ext.define('saas.view.sys.power.GroupGrid', {
         me.store = Ext.create('Ext.data.Store',{
             fields:[
                 {name: 'groupId',type:'int'},
+                {name: 'moduleId',type:'int'},
                 {name: 'groupName',type:'string'},
                 {name: 'moduleName',type:'string'},
                 {name: 'add'},
@@ -376,7 +198,9 @@ Ext.define('saas.view.sys.power.GroupGrid', {
                     return other;
                 }}
             ],
-            groupField:'moduleName',
+            groupDir:'ASC',
+            groupField:'moduleId',
+            clearRemovedOnLoad : true,
             proxy: {
                 timeout:8000,
                 type: 'ajax',

+ 4 - 7
frontend/saas-web/app/view/sys/power/OtherField.js

@@ -2,19 +2,16 @@
  * Created by zhouy on 2018/11/8.
  */
 Ext.define('saas.view.sys.power.OtherField', {
-    extend: 'Ext.form.FieldContainer',
+    extend: 'Ext.form.CheckboxGroup',
     //extend: 'Ext.form.field.Text',
     alias: 'widget.powerotherfield',
-    layout: 'column',
-    defaults:{
-       xtype:'checkbox',
-       columnWidth:1
-    },
+    columns: 1,
+    vertical: true,
     initComponent:function(){
         var me=this;
         me.callParent(arguments);
     },
-    setHtml:function(v){
+    setValue:function(v){
         this.setItems(v);
     },
     setItems:function(v){