Selaa lähdekoodia

Merge remote-tracking branch 'origin/dev' into dev

heqinwei 7 vuotta sitten
vanhempi
commit
94053b069f
23 muutettua tiedostoa jossa 384 lisäystä ja 116 poistoa
  1. 5 0
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/controller/CommonController.java
  2. 2 2
      applications/commons/commons-server/src/main/resources/mapper/HomePageMapper.xml
  3. 3 3
      applications/document/document-server/src/main/resources/mapper/ProductMapper.xml
  4. 4 0
      applications/purchase/purchase-dto/src/main/java/com/usoftchina/saas/purchase/dto/ProdIODetailDTO.java
  5. 4 0
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/po/ProdIODetail.java
  6. 6 2
      applications/purchase/purchase-server/src/main/resources/mapper/ProdIODetailMapper.xml
  7. 5 0
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/impl/SaleServiceImpl.java
  8. 12 0
      base-servers/account/account-dto/src/main/java/com/usoftchina/saas/account/dto/RoleDTO.java
  9. 2 1
      frontend/saas-web/app/view/core/report/ReportPanel.js
  10. 1 0
      frontend/saas-web/app/view/document/bom/BasePanel.js
  11. 1 1
      frontend/saas-web/app/view/home/Home.js
  12. 72 35
      frontend/saas-web/app/view/home/HomeModel.js
  13. 91 0
      frontend/saas-web/app/view/home/charts/ProfitDetail.js
  14. 1 1
      frontend/saas-web/app/view/money/fundtransfer/FormPanel.js
  15. 1 0
      frontend/saas-web/app/view/money/report/RecDetail.js
  16. 4 1
      frontend/saas-web/app/view/purchase/purchaseIn/FormPanel.js
  17. 17 44
      frontend/saas-web/app/view/purchase/purchaseOut/FormPanel.js
  18. 14 12
      frontend/saas-web/app/view/sale/sale/FormPanel.js
  19. 44 5
      frontend/saas-web/app/view/sale/saleIn/FormPanel.js
  20. 20 0
      frontend/saas-web/app/view/sale/saleIn/FormPanelController.js
  21. 44 5
      frontend/saas-web/app/view/sale/saleOut/FormPanel.js
  22. 20 0
      frontend/saas-web/app/view/sale/saleOut/FormPanelController.js
  23. 11 4
      frontend/saas-web/app/view/sys/power/TreePanel.js

+ 5 - 0
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/controller/CommonController.java

@@ -19,6 +19,11 @@ public class CommonController {
         return Result.success();
     }
 
+    @GetMapping("/{caller}/import")
+    public Result importExcel(){
+        return Result.success();
+    }
+
     @GetMapping("/{caller}/print")
     public Result print() {
         return Result.success();

+ 2 - 2
applications/commons/commons-server/src/main/resources/mapper/HomePageMapper.xml

@@ -121,7 +121,7 @@
         select concat('[',five_profit,',',other_profit,']') from (
       (
         #前5数据
-        select group_concat('{"x":"',custname,'","y":',profit,',"z":"',shortname,'"}') five_profit   from (
+        select group_concat('{"x":"',custname,'","y":',profit/10000,',"z":"',shortname,'"}') five_profit   from (
         select sum((ifnull(pd_netprice,0)- ifnull(pd_price,0))*(ifnull(pd_outqty,0) - ifnull(pd_inqty,0))) profit,
         pi_custcode,max(pi_custname) custname,max(ifnull(cu_shortname,'')) shortname  from prodinout left join prodiodetail on pi_id=pd_piid left join customer on cu_id=pi_custid
         where
@@ -130,7 +130,7 @@
         )five_profit_,
 	  (
 	    #其它的数据
-		select concat('{"z":"其它","x":"其它","y":',all_profit - five_profit,'}') other_profit from (
+		select concat('{"z":"其它","x":"其它","y":',(all_profit - five_profit)/10000,'}') other_profit from (
         #总共
         (
         select sum((ifnull(pd_netprice,0)- ifnull(pd_price,0))*(ifnull(pd_outqty,0) - ifnull(pd_inqty,0))) all_profit

+ 3 - 3
applications/document/document-server/src/main/resources/mapper/ProductMapper.xml

@@ -464,7 +464,7 @@
         <result column="pw_amount" property="rc_amount" jdbcType="DOUBLE"/>
     </resultMap>
     <select id="selectReserveCost" resultMap="ProdReserveCostResultMap">
-        select * from productWH tab left join Product on pw_prodcode=pr_code left join warehouse on pw_whid=wh_id
+        select * from productWH tab left join Product on pw_prodid=pr_id left join warehouse on pw_whid=wh_id
         <where>
             <if test="con!=null">
                 ${con}
@@ -478,7 +478,7 @@
     </select>
     <select id="selectReserveCostByIgnoreWarehouse" resultMap="ProdReserveCostResultMap">
         select pr_code,pr_spec,pr_detail,pr_unit,sum(pw_onhand) pw_onhand,sum(pw_amount) pw_amount
-        from productWH tab left join Product on pw_prodcode=pr_code left join warehouse on pw_whid=wh_id
+        from productWH tab left join Product on pw_prodid=pr_id left join warehouse on pw_whid=wh_id
         <where>
             <if test="con!=null">
                 ${con}
@@ -493,7 +493,7 @@
     </select>
     <select id="selectCalculateFields" resultType="string">
         select   ${fields}
-        from productWH tab left join Product on pw_prodcode=pr_code left join warehouse on pw_whid=wh_id
+        from productWH tab left join Product on pw_prodid=pr_id left join warehouse on pw_whid=wh_id
         <where>
             <if test="con != null">
                 ${con}

+ 4 - 0
applications/purchase/purchase-dto/src/main/java/com/usoftchina/saas/purchase/dto/ProdIODetailDTO.java

@@ -87,6 +87,10 @@ public class ProdIODetailDTO extends CommonBaseDTO implements Serializable {
 
     private Long pd_ioid;
 
+    private String iocode;
+
+    private Integer iodetno;
+
     private ProductDTO productDTO;
 
 }

+ 4 - 0
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/po/ProdIODetail.java

@@ -82,6 +82,10 @@ public class ProdIODetail extends CommonBaseEntity implements Serializable {
 
     private Long pd_ioid;
 
+    private String iocode;
+
+    private Integer iodetno;
+
     private ProductDTO productDTO;
 
 }

+ 6 - 2
applications/purchase/purchase-server/src/main/resources/mapper/ProdIODetailMapper.xml

@@ -43,6 +43,8 @@
     <result column="pd_ym" jdbcType="INTEGER" property="pd_ym" />
     <result column="pd_yqty" jdbcType="DOUBLE" property="pd_yqty" />
     <result column="pd_ioid" jdbcType="INTEGER" property="pd_ioid" />
+    <result column="iocode" jdbcType="VARCHAR" property="iocode" />
+    <result column="iodetno" jdbcType="INTEGER" property="iodetno" />
     <association property="productDTO" javaType="com.usoftchina.saas.document.dto.ProductDTO">
       <id column="pr_id" property="id"/>
       <result column="pr_code" property="pr_code"/>
@@ -644,8 +646,10 @@
 
 
   <select id="selectByFK" parameterType="long" resultMap="BaseResultMap">
-    select * from prodiodetail a left join product b on b.pr_id= a.pd_prodid and a.companyid = b.companyid
-    where pd_piid=#{id} order by pd_pdno
+    select pd.*,prod.*,iopd.pd_inoutno iocode,iopd.pd_pdno iodetno from prodiodetail pd
+     left join product prod on prod.pr_id= pd.pd_prodid and pd.companyid = prod.companyid
+     left join prodiodetail iopd on iopd.pd_id = pd.pd_ioid and iopd.companyid = pd.companyid
+    where pd.pd_piid=#{id} order by pd.pd_pdno
   </select>
 
   <delete id="deleteByFK" parameterType="java.lang.Long">

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

@@ -287,6 +287,11 @@ public class SaleServiceImpl implements SaleService{
         if (null != code) {
             throw new BizException(BizExceptionCode.SALE_ALREADY_UNAUDIT);
         }
+        //单据状态为已关闭,无法审核
+        code = saleMapper.validateCloseStatus(id);
+        if (null != code) {
+            throw new BizException(BizExceptionCode.SALE_CLOSE.getCode(),String.format(BizExceptionCode.SALE_CLOSE.getMessage(),"反审核"));
+        }
         //检测出货状态为未出货
         Integer num = saleMapper.checkSendStatus(id);
         if (num > 0) {

+ 12 - 0
base-servers/account/account-dto/src/main/java/com/usoftchina/saas/account/dto/RoleDTO.java

@@ -25,6 +25,18 @@ public class RoleDTO extends CommonBaseDTO implements Serializable{
      * 描述
      */
     private String description;
+    /**
+     * 角色
+     */
+    private Integer type;
+
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
 
     public Long getCompanyId() {
         return companyId;

+ 2 - 1
frontend/saas-web/app/view/core/report/ReportPanel.js

@@ -213,7 +213,7 @@ Ext.define('saas.view.core.report.ReportPanel', {
                                 })
                                 if (type && d) {
                                     if(typeof c.mySummaryRenderer == 'function') {
-                                        c.summaryValue = c.mySummaryRenderer(grid, datas);
+                                        c.summaryValue = c.mySummaryRenderer(grid, c, datas);
                                     }else if (type == 'count') {
                                         c.summaryValue = Ext.util.Format.number(d[name], c.format || '0');
                                     } else if (typeof c.summaryRenderer == 'function') {
@@ -235,6 +235,7 @@ Ext.define('saas.view.core.report.ReportPanel', {
                             });
                             return datas;
                         } catch (e) {
+                            console.log(e);
                             saas.util.BaseUtil.showErrorToast(e.message);
                         }
                     },

+ 1 - 0
frontend/saas-web/app/view/document/bom/BasePanel.js

@@ -51,6 +51,7 @@ Ext.define('saas.view.document.bom.BasePanel', {
     //字段属性
     _formXtype:'document-bom-formpanel',
     _title:'BOM资料',
+    caller:'Bom',
     _deleteUrl:'/api/document/bom/delete',
     _batchOpenUrl:'/api/document/bom/batchOpen',
     _batchCloseUrl:'/api/document/bom/batchClose',

+ 1 - 1
frontend/saas-web/app/view/home/Home.js

@@ -47,7 +47,7 @@ Ext.define('saas.view.home.Home', {
             xtype: 'month-sale',
             padding: '0 0 0 14',
         }, {
-            xtype: 'month-purchase',
+            xtype: 'profit-detail',
             padding: '0 0 0 14',
         }, {
             xtype: 'key-data',

+ 72 - 35
frontend/saas-web/app/view/home/HomeModel.js

@@ -87,41 +87,41 @@ Ext.define('saas.view.home.HomeModel', {
             }
         },
 
-        month_purchase: {
-            model: 'saas.model.chart.DataXY',
-            autoLoad: true,
-            proxy: {
-                type: 'ajax',
-                // url: 'http://192.168.253.58:8920/homePage/purchaseData?sixMonths=false',
-                url: '/api/commons/homePage/purchaseData?sixMonths=false',
-                timeout: 8000,
-                actionMethods: {
-                    read: 'GET'
-                },
-                reader: {
-                    type: 'json',
-                    rootProperty: 'data',
-                },
-                listeners: {
-                    exception: function(proxy, response, operation, eOpts) {
-                        var p = Ext.getCmp('month_purchase');
-                        p && p.setLoading(false);
-                    }
-                }
-            },
-            listeners: {
-                beforeload: function() {
-                    var p = Ext.getCmp('month_purchase');
-                        p && p.setLoading(true);
-                },
-                load: function(s, d) {
-                    var p = Ext.getCmp('month_purchase');
-                        p && p.setLoading(false);
-                    var sum = Ext.util.Format.number(s.sum('y'), '0.00') || 0;
-                    Ext.getCmp('home').getViewModel().set('month_purchase_amount', sum+'')
-                }
-            }
-        },
+        // month_purchase: {
+        //     model: 'saas.model.chart.DataXY',
+        //     autoLoad: true,
+        //     proxy: {
+        //         type: 'ajax',
+        //         // url: 'http://192.168.253.58:8920/homePage/purchaseData?sixMonths=false',
+        //         url: '/api/commons/homePage/purchaseData?sixMonths=false',
+        //         timeout: 8000,
+        //         actionMethods: {
+        //             read: 'GET'
+        //         },
+        //         reader: {
+        //             type: 'json',
+        //             rootProperty: 'data',
+        //         },
+        //         listeners: {
+        //             exception: function(proxy, response, operation, eOpts) {
+        //                 var p = Ext.getCmp('month_purchase');
+        //                 p && p.setLoading(false);
+        //             }
+        //         }
+        //     },
+        //     listeners: {
+        //         beforeload: function() {
+        //             var p = Ext.getCmp('month_purchase');
+        //                 p && p.setLoading(true);
+        //         },
+        //         load: function(s, d) {
+        //             var p = Ext.getCmp('month_purchase');
+        //                 p && p.setLoading(false);
+        //             var sum = Ext.util.Format.number(s.sum('y'), '0.00') || 0;
+        //             Ext.getCmp('home').getViewModel().set('month_purchase_amount', sum+'')
+        //         }
+        //     }
+        // },
 
         month_io: {
             fields: ['x', 'main', 'other'],
@@ -315,5 +315,42 @@ Ext.define('saas.view.home.HomeModel', {
                 }
             } 
         },
+
+        profit_detail: {
+            fields: ['x', 'y', 'z'],
+            autoLoad: true,
+            proxy: {
+                type: 'ajax',
+                // url: 'http://192.168.253.58:8560/api/commons/homePage/monthProfit',
+                url: '/api/commons/homePage/monthProfit',
+                timeout: 8000,
+                // header: {
+                //     Authorization: 'eyJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJnIiwiYXBwSWQiOiJ0cmFkZS1hcHAiLCJ1c2VySWQiOjM4LCJjb21wYW55SWQiOjIxLCJ1c2VyTmFtZSI6ImciLCJyZWFsTmFtZSI6Iue-pCIsImV4cCI6MTU0NjIyNTg5Mn0.oe6BmpVchOlL6PoR7UspHbThFEJ_HLlKTHBpV4P9wSA4YbL2Pv5sAah2U6M2q7nmu0J1DV5WwMaMClI19Us7n-8fSgNeQrl1IsVFO4sf5nSC3SrUJk0sraBq5dLAqONfAIj9qFOuyduL6tXkV2av5IfmikT1uMk8okTJKDtHj8U'
+                // },
+                actionMethods: {
+                    read: 'GET'
+                },
+                reader: {
+                    type: 'json',
+                    rootProperty: 'data',
+                },
+                listeners: {
+                    exception: function(proxy, response, operation, eOpts) {
+                        var p = Ext.getCmp('profit_detail');
+                        p && p.setLoading(false);
+                    }
+                }
+            },
+            listeners: {
+                beforeload: function() {
+                    var p = Ext.getCmp('profit_detail');
+                        p && p.setLoading(true);
+                },
+                load: function(s, d) {
+                    var p = Ext.getCmp('profit_detail');
+                        p && p.setLoading(false);
+                }
+            } 
+        },
     },
 });

+ 91 - 0
frontend/saas-web/app/view/home/charts/ProfitDetail.js

@@ -0,0 +1,91 @@
+Ext.define('saas.view.home.charts.ProfitDetail', {
+    extend: 'saas.view.core.chart.ChartBase',
+    xtype: 'profit-detail',
+
+    id: 'profit_detail',
+
+    bind: {
+        title: '毛利润分析(万元)'
+    },
+
+    initComponent: function() {
+        var me = this;
+
+        Ext.apply(me, {
+            items: [{
+                xtype: 'cartesian',
+                colors: [
+                    '#34BAF6'
+                ],
+                bind: {
+                    insetPadding: '{insetPadding}',
+                    store: '{profit_detail}',
+                },
+                axes: [{
+                    type: 'category',
+                    fields: ['x'],
+                    position: 'bottom',
+                    label: {
+                        fontSize: '12px',
+                        fillStyle: '#485465',
+                    },
+                    style: {
+                        fill: '#F7F8FA',
+                        strokeStyle: 'transparent'
+                    },
+                    renderer: me.onCategoryLabelRender
+                },{
+                    type: 'numeric',
+                    fields: ['y'],
+                    position: 'left',
+                    adjustByMajorUnit: true,
+                    grid: {
+                        even: {
+                            stroke: '#F7F8FA'
+                        },
+                        odd: {
+                            stroke: '#F7F8FA',
+                        }
+                    },
+                    label: {
+                        fontSize: '12px',
+                        fillStyle: '#485465',
+                        textAlign: 'end'
+                    },
+                    style: {
+                        fill: '#fff',
+                        strokeStyle: 'transparent'
+                    },
+                    minimum: 0
+                }],
+                series: [{
+                    type: 'bar',
+                    xField: 'x',
+                    yField: ['y'],
+                    bind: {
+                        style: {
+                            lineWidth: 0,
+                            strokeStyle: 'transparent',
+                            maxBarWidth: '{maxBarWidth}',
+                        },
+                    },
+                    tooltip: {
+                        trackMouse: true,
+                        renderer: me.onBarTipRender
+                    }
+                }]
+            }]
+        });
+
+        me.callParent(arguments);
+    },
+
+    onCategoryLabelRender: function(axis, label, layoutContent, lastLabel) {
+        return label.substr(0,2) + '...';
+    },
+
+    onBarTipRender: function (tooltip, record, item) {
+        tooltip.setHtml(record.get('x') + ': ' + record.get('y') + '万元');
+    },
+
+});

+ 1 - 1
frontend/saas-web/app/view/money/fundtransfer/FormPanel.js

@@ -39,7 +39,7 @@ Ext.define('saas.view.money.fundtransfer.FormPanel', {
         xtype : "detailGridField", 
         storeModel:'saas.model.money.FundTransfer',
         detnoColumn:  'ftd_detno',
-        deleteDetailUrl:'/api/money/fundtransfer/deleteItem',
+        deleteDetailUrl:'/api/money/fundtransfer/deleteDetail',
         columnWidth : 1,
         columns : [
             {

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

@@ -122,6 +122,7 @@ Ext.define('saas.view.money.report.RecDetail', {
                 return Ext.util.Format.number(v, format);
             },
             mySummaryRenderer: function(grid, column, datas) {
+                datas = datas || [];
                 var store = grid.store,
                 dataIndex = column.dataIndex,
                 groupField = store.getGroupField(),

+ 4 - 1
frontend/saas-web/app/view/purchase/purchaseIn/FormPanel.js

@@ -314,18 +314,21 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
             {
                 text : "采购单明细id", 
                 dataIndex : "pd_orderid", 
+                ignore:true,
                 hidden:true
             },
             {
                 text : "采购单号", 
                 dataIndex : "pd_ordercode", 
-                width : 150.0
+                width : 150.0,
+                ignore:true,
             },{
                 text : "采购序号",
                 dataIndex : "pd_orderdetno", 
                 xtype : "numbercolumn",
                 width : 110.0,
                 format: '0',
+                ignore:true,
                 renderer: function(v) {
                     if(v) {
                         return Ext.util.Format.number(v, '0');

+ 17 - 44
frontend/saas-web/app/view/purchase/purchaseOut/FormPanel.js

@@ -67,7 +67,6 @@ Ext.define('saas.view.purchase.purchaseOut.FormPanel', {
     },{
         xtype : "textfield", 
         name : "pi_total", 
-        bind : "{pi_total}", 
         fieldLabel : "总额", 
         allowBlank : true,
         readOnly: true,
@@ -75,14 +74,12 @@ Ext.define('saas.view.purchase.purchaseOut.FormPanel', {
     }, {
         xtype : "hidden", 
         name : "pi_puid", 
-        bind : "{pi_puid}", 
         fieldLabel : "采购单id", 
         allowBlank : true, 
         columnWidth : 0.25
     },{
         xtype : "hidden", 
         name : "pi_pucode", 
-        bind : "{pi_pucode}", 
         fieldLabel : "采购单号", 
         allowBlank : true, 
         columnWidth : 0.25
@@ -177,29 +174,16 @@ Ext.define('saas.view.purchase.purchaseOut.FormPanel', {
                     var format = '0.' + xr.join();
                     return Ext.util.Format.number(v, format);
                 }
-            },            
-            // {
-            //     text : "已转数", 
-            //     dataIndex : "pd_yqty", 
-            //     width : 120.0, 
-            //     xtype : "numbercolumn", 
-            //     format:'0',
-            //     items : null,
-            //     summaryType: 'sum'
-            // },
-            
-            {
+            }, {
                 text : "仓库id", 
                 dataIndex : "pd_whid", 
                 xtype : "numbercolumn",
                 hidden:true
-            },
-            {
+            }, {
                 text : "仓库编号", 
                 dataIndex : "pd_whcode",
                 hidden:true
-            }, 
-            {
+            }, {
                 text : "仓库", 
                 dataIndex : "pd_whname", 
                 width : 150.0, 
@@ -217,8 +201,7 @@ Ext.define('saas.view.purchase.purchaseOut.FormPanel', {
                     valueField : "value", 
                     xtype : "warehouseDbfindTrigger"
                 }
-            },
-            {
+            }, {
                 text : "单价",
                 xtype: 'numbercolumn', 
                 width : 110.0,
@@ -235,7 +218,7 @@ Ext.define('saas.view.purchase.purchaseOut.FormPanel', {
                     var format = '0,000.' + xr.join();
                     return Ext.util.Format.number(v, format);
                 },
-            },{
+            }, {
                 text : "税率", 
                 xtype: 'numbercolumn',
                 dataIndex : "pd_taxrate", 
@@ -255,11 +238,6 @@ Ext.define('saas.view.purchase.purchaseOut.FormPanel', {
                 xtype: 'numbercolumn',
                 dataIndex : "pd_ordertotal", 
                 width : 110.0, 
-                // editor : {
-                //     xtype : "numberfield",
-                //     decimalPrecision: 2,
-                //     editable : false
-                // },
                 renderer : function(v) {
                     var arr = (v + '.').split('.');
                     var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
@@ -279,11 +257,6 @@ Ext.define('saas.view.purchase.purchaseOut.FormPanel', {
                 xtype: 'numbercolumn',
                 dataIndex : "pd_nettotal", 
                 width : 110.0, 
-                // editor : {
-                //     xtype : "numberfield",
-                //     decimalPrecision: 2,
-                //     editable : false
-                // },
                 renderer : function(v) {
                     var arr = (v + '.').split('.');
                     var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
@@ -297,21 +270,21 @@ Ext.define('saas.view.purchase.purchaseOut.FormPanel', {
                     var format = '0,000.' + xr.join();
                     return Ext.util.Format.number(v, format);
                 }
-            },
-            {
-                text : "采购单明细id", 
-                dataIndex : "pd_orderid", 
+            }, {
+                text : "验收明细id", 
+                dataIndex : "pd_ioid", 
                 hidden:true
-            },
-            {
-                text : "采购单号", 
-                dataIndex : "pd_ordercode", 
-                width : 150.0
-            },{
-                text : "采购序号", 
-                dataIndex : "pd_orderdetno", 
+            }, {
+                text : "验收单号", 
+                dataIndex : "iocode", 
+                width : 150.0,
+                ignore:true
+            }, {
+                text : "验收序号", 
+                dataIndex : "iodetno", 
                 xtype : "numbercolumn", 
                 width : 110.0,
+                ignore:true,
                 renderer: function(v) {
                     if(v) {
                         return Ext.util.Format.number(v, '0');

+ 14 - 12
frontend/saas-web/app/view/sale/sale/FormPanel.js

@@ -44,22 +44,15 @@ Ext.define('saas.view.sale.sale.FormPanel', {
                 xtype : "customerDbfindTrigger", 
                 name : "sa_custname", 
                 fieldLabel : "客户名称",
-                allowBlank : false
-            }, {
-                name : "sa_toplace", 
-                xtype : "remotecombo", 
-                fieldLabel : "交货地址", 
-                editable:false,
-                allowBlank : false, 
-                columnWidth : 0.5,
-                storeUrl:'/api/document/customer/getAddressCombo',
-                hiddenBtn:true,//true 则会关闭新增按钮功能
+                allowBlank : false,
                 setValue:function(value){
                     var me = this,bind, valueBind;
+                    var form = me.ownerCt;
+                    var c = form.down('[name=sa_toplace]');
                     if(value&&value!=''){
-                        me.setDisabled(false);
+                        c.setDisabled(false);
                     }else{
-                        me.setDisabled(true);
+                        c.setDisabled(true);
                     }
                     if (me.hasFocus) {
                         bind = me.getBind();
@@ -87,6 +80,15 @@ Ext.define('saas.view.sale.sale.FormPanel', {
                     }
                     return me;
                 }
+            }, {
+                name : "sa_toplace", 
+                xtype : "remotecombo", 
+                fieldLabel : "交货地址", 
+                editable:false,
+                allowBlank : false, 
+                columnWidth : 0.5,
+                storeUrl:'/api/document/customer/getAddressCombo',
+                hiddenBtn:true,//true 则会关闭新增按钮功能
             }, {
                 name : "detailGridField", 
                 xtype : "detailGridField", 

+ 44 - 5
frontend/saas-web/app/view/sale/saleIn/FormPanel.js

@@ -50,6 +50,50 @@ Ext.define('saas.view.sale.saleIn.FormPanel', {
         name : "pi_custname", 
         fieldLabel : "客户名称",
         allowBlank:false,
+        setValue:function(value){
+            var me = this,bind, valueBind;
+            var form = me.ownerCt;
+            var c = form.down('[name=pi_address]');
+            if(value&&value!=''){
+                c.setDisabled(false);
+            }else{
+                c.setDisabled(true);
+            }
+            if (me.hasFocus) {
+                bind = me.getBind();
+                valueBind = bind && bind.value;
+                if (valueBind && valueBind.syncing) {
+                    if ((Ext.isEmpty(value) && Ext.isEmpty(me.value)) || value === me.value) {
+                        return me;
+                    } else if (Ext.isArray(value) && Ext.isArray(me.value) && Ext.Array.equals(value, me.value)) {
+                        return me;
+                    }
+                }
+            } else {
+                me.lastSelectedRecords = null;
+            }
+    
+            if (value != null) {
+                me.doSetValue(value);
+            }
+            else {
+                me.suspendEvent('select');
+                me.valueCollection.beginUpdate();
+                me.pickerSelectionModel.deselectAll();
+                me.valueCollection.endUpdate();
+                me.resumeEvent('select');
+            }
+            return me;
+        }
+    }, {
+        columnWidth : 0.5,
+        name : "pi_address", 
+        xtype : "remotecombo", 
+        fieldLabel : "交货地址", 
+        editable:false,
+        allowBlank : false, 
+        storeUrl:'/api/document/customer/getAddressCombo',
+        hiddenBtn:true,//true 则会关闭新增按钮功能
     }, {
         xtype : "datefield", 
         name : "pi_date", 
@@ -57,11 +101,6 @@ Ext.define('saas.view.sale.saleIn.FormPanel', {
         allowBlank : false, 
         columnWidth : 0.25,
         defaultValue: new Date()
-    }, {
-        xtype : "textfield", 
-        name : "pi_address", 
-        fieldLabel : "交货地址", 
-        columnWidth : 0.5
     }, {
         name : "detailGridField", 
         xtype : "detailGridField", 

+ 20 - 0
frontend/saas-web/app/view/sale/saleIn/FormPanelController.js

@@ -67,6 +67,26 @@ Ext.define('saas.view.sale.saleIn.FormPanelController', {
                     });
 
                 }
+            },
+            'remotecombo[name=pi_address]':{
+                focus:function(f){
+                    //获取客户ID
+                    var pi_custid = f.ownerCt.down('[name=pi_custid]').value;
+                    if(pi_custid&&pi_custid!=""){
+                        Ext.apply(f.store.proxy.extraParams, {
+                            id:pi_custid
+                        });
+                        f.store.load();
+                    }else{
+                        saas.util.BaseUtil.showErrorToast('请先选择客户后在维护交货地址');
+                        f.setDisabled(true);
+                    }
+                },
+                expand:function(f){
+                    if(f.picker&&f.isExpanded){
+                        f.picker.setHeight(33*f.store.getCount())
+                    }
+                }
             }
         });
     }

+ 44 - 5
frontend/saas-web/app/view/sale/saleOut/FormPanel.js

@@ -59,6 +59,50 @@ Ext.define('saas.view.sale.saleout.FormPanel', {
         name : "pi_custname", 
         fieldLabel : "客户名称",
         allowBlank:false,
+        setValue:function(value){
+            var me = this,bind, valueBind;
+            var form = me.ownerCt;
+            var c = form.down('[name=pi_address]');
+            if(value&&value!=''){
+                c.setDisabled(false);
+            }else{
+                c.setDisabled(true);
+            }
+            if (me.hasFocus) {
+                bind = me.getBind();
+                valueBind = bind && bind.value;
+                if (valueBind && valueBind.syncing) {
+                    if ((Ext.isEmpty(value) && Ext.isEmpty(me.value)) || value === me.value) {
+                        return me;
+                    } else if (Ext.isArray(value) && Ext.isArray(me.value) && Ext.Array.equals(value, me.value)) {
+                        return me;
+                    }
+                }
+            } else {
+                me.lastSelectedRecords = null;
+            }
+    
+            if (value != null) {
+                me.doSetValue(value);
+            }
+            else {
+                me.suspendEvent('select');
+                me.valueCollection.beginUpdate();
+                me.pickerSelectionModel.deselectAll();
+                me.valueCollection.endUpdate();
+                me.resumeEvent('select');
+            }
+            return me;
+        }
+    }, {
+        columnWidth : 0.5,
+        name : "pi_address", 
+        xtype : "remotecombo", 
+        fieldLabel : "交货地址", 
+        editable:false,
+        allowBlank : false, 
+        storeUrl:'/api/document/customer/getAddressCombo',
+        hiddenBtn:true,//true 则会关闭新增按钮功能
     }, {
         xtype : "datefield", 
         name : "pi_date", 
@@ -66,11 +110,6 @@ Ext.define('saas.view.sale.saleout.FormPanel', {
         allowBlank : false, 
         columnWidth : 0.25,
         defaultValue: new Date()
-    }, {
-        xtype : "textfield", 
-        name : "pi_address", 
-        fieldLabel : "交货地址", 
-        columnWidth : 0.5
     }, {
         name : "detailGridField", 
         xtype : "detailGridField", 

+ 20 - 0
frontend/saas-web/app/view/sale/saleOut/FormPanelController.js

@@ -59,6 +59,26 @@ Ext.define('saas.view.sale.saleout.FormPanelController', {
                     }) ;   
 
                 }
+            },
+            'remotecombo[name=pi_address]':{
+                focus:function(f){
+                    //获取客户ID
+                    var pi_custid = f.ownerCt.down('[name=pi_custid]').value;
+                    if(pi_custid&&pi_custid!=""){
+                        Ext.apply(f.store.proxy.extraParams, {
+                            id:pi_custid
+                        });
+                        f.store.load();
+                    }else{
+                        saas.util.BaseUtil.showErrorToast('请先选择客户后在维护交货地址');
+                        f.setDisabled(true);
+                    }
+                },
+                expand:function(f){
+                    if(f.picker&&f.isExpanded){
+                        f.picker.setHeight(33*f.store.getCount())
+                    }
+                }
             }
         });
     },

+ 11 - 4
frontend/saas-web/app/view/sys/power/TreePanel.js

@@ -9,7 +9,7 @@ Ext.define('saas.view.sys.power.TreePanel', {
     initComponent: function () {
         var me = this;
         me.store = Ext.create('Ext.data.TreeStore', {
-            fields : ['name', 'id', 'description','code'],
+            fields : ['name', 'id', 'description','code','type'],
             autoLoad:false,
             root : {
                 text : 'Root',
@@ -26,7 +26,7 @@ Ext.define('saas.view.sys.power.TreePanel', {
             width: 28,
             iconCls: 'x-hidden icon x-fa fa-plus',
             getClass: function(v, meta, rec) {
-                if(rec.get('code')=='ROLE_ADMIN'){
+                if(rec.get('type')=='0'){
                     return 'x-hidden icon x-fa fa-key';
                 }else if(rec.get('leaf')){
                      return 'x-hidden icon x-fa fa-pencil';
@@ -43,7 +43,7 @@ Ext.define('saas.view.sys.power.TreePanel', {
             width: 36,
             iconCls: 'x-hidden icon x-fa fa-trash-o',
             getClass: function(v, meta, rec) {
-                if(rec.get('code')=='ROLE_ADMIN'){
+                if(rec.get('type')=='0'){
                     return '';
                 }else if(rec.get('leaf')){
                      return 'x-hidden icon x-fa fa-trash-o';
@@ -90,6 +90,12 @@ Ext.define('saas.view.sys.power.TreePanel', {
                 var grid = view.ownerCt.ownerCt.query('power-grid')[0];
                 grid.initId = id;
                 grid.store.load();
+                if(record.get('type')&&record.get('type')=='0'){
+                    grid.dockedItems.items[1].down('[name=savepower]').setDisabled(true)
+                }
+                if(record.get('type')&&record.get('type')=='1'){
+                    grid.dockedItems.items[1].down('[name=savepower]').setDisabled(false)
+                }
             }
         }
     },
@@ -108,6 +114,7 @@ Ext.define('saas.view.sys.power.TreePanel', {
                     for (let index = 0; index < _data.length; index++) {
                         var o = {
                             code:_data[index].code,
+                            type:_data[index].type,
                             id: _data[index].id,
                             text: _data[index].name,
                             name:_data[index].name,
@@ -151,7 +158,7 @@ Ext.define('saas.view.sys.power.TreePanel', {
         this.dialog.show();
     },
     deleteItem:function(rec){
-        if(rec&&(rec.get('code')=='ROLE_ADMIN'||!rec.get('leaf'))){
+        if(rec&&(rec.get('type')=='0'||!rec.get('leaf'))){
             return;
         }
         var me = this;