Browse Source

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

guq 7 years ago
parent
commit
2fa0a91947
33 changed files with 780 additions and 147 deletions
  1. 1 1
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/ProdInOutServiceImpl.java
  2. 2 2
      applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/service/impl/ProdInOutServiceImpl.java
  3. 13 14
      base-servers/auth/auth-dto/src/main/java/com/usoftchina/saas/auth/dto/AuthDTO.java
  4. 1 1
      base-servers/auth/auth-server/src/main/java/com/usoftchina/saas/auth/controller/AuthController.java
  5. 6 0
      frontend/saas-web/Readme.md
  6. 10 2
      frontend/saas-web/app/util/FormUtil.js
  7. 2 14
      frontend/saas-web/app/view/core/base/GridPanel.js
  8. 2 2
      frontend/saas-web/app/view/core/dbfind/MultiDbfindGridPanel.js
  9. 1 1
      frontend/saas-web/app/view/core/dbfind/MultiDbfindTrigger.js
  10. 39 7
      frontend/saas-web/app/view/core/form/FormPanel.js
  11. 13 8
      frontend/saas-web/app/view/core/form/FormPanelController.js
  12. 1 0
      frontend/saas-web/app/view/core/form/FormPanelModel.js
  13. 43 10
      frontend/saas-web/app/view/core/form/field/DetailGridField.js
  14. 1 1
      frontend/saas-web/app/view/document/bom/FormController.js
  15. 1 1
      frontend/saas-web/app/view/document/customer/FormController.js
  16. 1 1
      frontend/saas-web/app/view/document/kind/KindModel.js
  17. 2 2
      frontend/saas-web/app/view/document/product/FormController.js
  18. 2 2
      frontend/saas-web/app/view/document/vendor/FormController.js
  19. 2 2
      frontend/saas-web/app/view/purchase/purchase/FormPanel.js
  20. 0 66
      frontend/saas-web/app/view/purchase/purchase/FormPanelController.js
  21. 1 1
      frontend/saas-web/app/view/purchase/purchaseIn/FormPanel.js
  22. 1 1
      frontend/saas-web/app/view/purchase/purchaseIn/FormPanelController.js
  23. 1 1
      frontend/saas-web/app/view/purchase/purchaseOut/FormPanel.js
  24. 1 1
      frontend/saas-web/app/view/purchase/purchaseOut/FormPanelController.js
  25. 1 1
      frontend/saas-web/app/view/stock/appropriationInOut/FormPanel.js
  26. 1 1
      frontend/saas-web/app/view/stock/appropriationInOut/FormPanelController.js
  27. 1 1
      frontend/saas-web/app/view/stock/otherIn/FormPanel.js
  28. 1 1
      frontend/saas-web/app/view/stock/otherIn/FormPanelController.js
  29. 1 1
      frontend/saas-web/app/view/stock/otherOut/FormPanel.js
  30. 1 1
      frontend/saas-web/app/view/stock/otherOut/FormPanelController.js
  31. 354 0
      frontend/saas-web/app/view/sys/maxnumbers/DataList.js
  32. 250 0
      frontend/saas-web/app/view/sys/messagelog/DataList.js
  33. 23 0
      frontend/saas-web/resources/json/navigation.json

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

@@ -82,7 +82,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         if (null == con) {
             con = "1=1";
         }
-        if (null == req || StringUtils.isEmpty(req.getMode()) || "Main".equals(req.getMode())) {
+        if (null == req || StringUtils.isEmpty(req.getMode()) || "MAIN".equals(req.getMode())) {
               list = prodInOutListMapper.selectProdInOutListByCondition(con,companyId);
         } else {
               list = prodInOutListMapper.selectProdInOutBycondition(con,companyId);

+ 2 - 2
applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/service/impl/ProdInoutServiceImpl.java → applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/service/impl/ProdInOutServiceImpl.java

@@ -34,7 +34,7 @@ import org.springframework.util.StringUtils;
 import java.util.*;
 
 @Service
-public class ProdInoutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper, ProdInOut> implements ProdInOutService {
+public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper, ProdInOut> implements ProdInOutService {
 
     @Autowired
     private ProdIODetailMapper prodIODetailMapper;
@@ -75,7 +75,7 @@ public class ProdInoutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         if (null == con) {
             con = "1=1";
         }
-        if (null == req || StringUtils.isEmpty(req.getMode()) || "Main".equals(req.getMode())) {
+        if (null == req || StringUtils.isEmpty(req.getMode()) || "MAIN".equals(req.getMode())) {
             list = prodInOutListMapper.selectProdInOutListByCondition(con,companyId);
         } else {
             list = prodInOutListMapper.selectProdInOutBycondition(con,companyId);

+ 13 - 14
base-servers/auth/auth-dto/src/main/java/com/usoftchina/saas/auth/dto/AuthDTO.java

@@ -1,9 +1,8 @@
 package com.usoftchina.saas.auth.dto;
 
-import com.usoftchina.saas.account.dto.CompanyBaseDTO;
+import com.usoftchina.saas.account.dto.AccountDTO;
 
 import java.io.Serializable;
-import java.util.List;
 
 /**
  * @author yingp
@@ -11,37 +10,37 @@ import java.util.List;
  */
 public class AuthDTO implements Serializable{
     private TokenDTO token;
-    private List<CompanyBaseDTO> companies;
+    private AccountDTO account;
 
     public AuthDTO() {
     }
 
-    public AuthDTO(TokenDTO token, List<CompanyBaseDTO> companies) {
+    public AuthDTO(TokenDTO token, AccountDTO account) {
         this.token = token;
-        this.companies = companies;
+        this.account = account;
     }
 
-    public TokenDTO getToken() {
-        return token;
+    public AccountDTO getAccount() {
+        return account;
     }
 
-    public void setToken(TokenDTO token) {
-        this.token = token;
+    public void setAccount(AccountDTO account) {
+        this.account = account;
     }
 
-    public List<CompanyBaseDTO> getCompanies() {
-        return companies;
+    public TokenDTO getToken() {
+        return token;
     }
 
-    public void setCompanies(List<CompanyBaseDTO> companies) {
-        this.companies = companies;
+    public void setToken(TokenDTO token) {
+        this.token = token;
     }
 
     @Override
     public String toString() {
         return "AuthDTO{" +
                 "token=" + token +
-                ", companies=" + companies +
+                ", account=" + account +
                 '}';
     }
 }

+ 1 - 1
base-servers/auth/auth-server/src/main/java/com/usoftchina/saas/auth/controller/AuthController.java

@@ -62,7 +62,7 @@ public class AuthController {
             JwtInfo info = new JwtInfo(appId, companyId, accountDTO.getId(), accountDTO.getUsername());
             TokenVO tokenVO = JwtHelper.generateToken(info, privateKeyPath, expire);
             TokenDTO tokenDTO = BeanMapper.map(tokenVO, TokenDTO.class);
-            return Result.success(new AuthDTO(tokenDTO, accountDTO.getCompanies()));
+            return Result.success(new AuthDTO(tokenDTO, accountDTO));
         }
         return Result.error(result.getCode(), result.getMessage());
     }

+ 6 - 0
frontend/saas-web/Readme.md

@@ -93,6 +93,8 @@ viewModel: view.core.form.FormPanelModel
 | detnoColumn | 序号列,配置该项后无需再columns定义序号列 | √ | "pud_detno" |
 | columns[i].ignore | 是否忽略,为真时在调用保存方法时不会取到该列值 | x | true |
 | deleteDetailUrl | 删除明细接口 | √ | "/api/purchase/purchase/deleteItem" |
+| allowBlank | 是否必填列 | x | true |
+| isValid | 自定义校验规则,传入value,返回boolean | x | function(v) { return v > 10; } |
 - 需要根据columns在models文件夹下添加storeModel对应的Model
 
 ---
@@ -156,5 +158,9 @@ deleteDetailUrl 配置调整 formpanel.form->formpanel.detailGridField
 
 主从表从表配置detnoColumn属性说明变更
 
+- 2018-10-31 11:50:22
+
+从表必填配置说明allowBlamk、isValid
+
 
 

+ 10 - 2
frontend/saas-web/app/util/FormUtil.js

@@ -74,7 +74,10 @@ Ext.define('saas.util.FormUtil', {
                                 });
 
                                 //必填
-                                if(c.logic=='necessaryField'){
+                                Ext.applyIf(c, {
+                                    allowBlank: true
+                                });
+                                if(!c.allowBlank){
                                     c.cls = 'x-grid-necessary';
                                 }
 
@@ -182,7 +185,12 @@ Ext.define('saas.util.FormUtil', {
                         grid.add10EmptyRow();
                     });
                     if(code){
-                        viewModel.set(form._codeField,code);
+                        var o = {};
+                        o[form._codeField] = code;
+
+                        form.setFormData({
+                            main: o
+                        });
                     }
                 }
             }).catch(function() {

+ 2 - 14
frontend/saas-web/app/view/core/base/GridPanel.js

@@ -197,26 +197,14 @@ Ext.define('saas.view.core.base.GridPanel', {
             }
         }
     },
-
-    getCondition: function(f,conditionExpression){
-        var condition = '';
-        if((f.xtype == 'checkbox' || f.xtype == 'radio')&&f.logic){
-            
-        }else if(f.xtype=='textfield'&&f.value!=''){
-            condition=conditionExpression.replace(new RegExp("\\{0}","g"), f.value);
-        }
-        if(condition.length>0){
-            condition+= ' AND ';
-        }
-        return condition;
-    },
-
+    
     insertFirstColumn:function(columns){
         var me=this;
         if(columns.length>0 && columns[0].xtype!='actioncolumn'){
             return Ext.Array.insert(columns,0,[{
                 xtype:'actioncolumn',
                 width:70,
+                dataIndex:'actioncolumn',
                 text:'操作',
                 items: [{
                     tooltip: '编辑',

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

@@ -23,7 +23,7 @@ Ext.define('saas.view.core.dbfind.MultiDbfindGridPanel', {
                     var selectRecordArr = selModel.view.ownerCt.selectRecordArr;
                     var index = -1;
                     index = selectRecordArr.findIndex(function(f){
-                        return f.id==record.id
+                        return f.id==id
                     });
                     if(index>-1){
                         selectRecordArr.splice(index,1);
@@ -115,7 +115,7 @@ Ext.define('saas.view.core.dbfind.MultiDbfindGridPanel', {
                                     }
                                 });
                                 var index = mainGrid.store.data.items.findIndex(function(f){
-                                    return f.id==rec.id
+                                    return f.id==(rec&&rec.id?rec.id:0)
                                 });
                                 rec = mainGrid.store.data.getAt(index+1);
                             });

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

@@ -103,7 +103,7 @@ Ext.define('saas.view.core.dbfind.MultiDbfindTrigger', {
         //判断dbfindtrigger归属
         f.judge(f);
         var panel = f.up('core-tab-panel'),panelEl;
-        if(f.ownerCt.ownerCt.id.indexOf('window-')>-1){
+        if(!f.column&&f.ownerCt.ownerCt.id.indexOf('window-')>-1){
             panelEl = f.ownerCt.ownerCt.getEl();
         }else{
             panelEl = panel.getEl()

+ 39 - 7
frontend/saas-web/app/view/core/form/FormPanel.js

@@ -100,7 +100,9 @@ Ext.define('saas.view.core.form.FormPanel', {
                     xtype: 'button',
                     text: '保存',
                     handler: 'onSave',
-                    formBind: true
+                    bind: {
+                        disabled: '{!base.valid}'
+                    }
                 }, {
                     xtype: 'button',
                     text: '删除',
@@ -112,16 +114,39 @@ Ext.define('saas.view.core.form.FormPanel', {
                     xtype: 'button',
                     bind: {
                         text: '{auditBtnText}',
+                        disabled: '{!base.valid}',
                         hidden:'{!showAuditBtn}'
                     },
                     handler: "auditBtnClick",
 
                 }]))
-            }]
+            }],
+            listeners: {
+                validitychange: function() {
+                    me.isValid();
+                }
+            },
         });
         me.callParent(arguments);
     },
 
+    isValid: function() {
+        var me = this;
+        var viewModel = me.getViewModel();
+        var valid = me.getForm().isValid();
+        var detailGrids = me.query('detailGridField');
+
+        for(var i = 0; i < detailGrids.length; i++) {
+            var g = detailGrids[i];
+            if(!g.isValid()) {
+                valid = false;
+                break;
+            }
+        }
+        viewModel.set('base.valid', valid);
+        return valid;
+    },
+
     /**
      * 一些初始化viewModel的方法
      */
@@ -157,7 +182,7 @@ Ext.define('saas.view.core.form.FormPanel', {
     addItems: function (items) {
         var me = this;
         me.setBindFields(items);
-        return this.add(items);
+        return me.add(items);
     },
 
     /**
@@ -207,10 +232,10 @@ Ext.define('saas.view.core.form.FormPanel', {
 
     setFormData: function (formData) {
         var me = this,
-            main = formData.main,
-            detailCount = me.detailCount,
-            viewModel = me.getViewModel(),
-            viewData = viewModel.getData();
+        main = formData.main,
+        detailCount = me.detailCount,
+        viewModel = me.getViewModel(),
+        viewData = viewModel.getData();
 
         viewModel.setData(main);
 
@@ -223,6 +248,8 @@ Ext.define('saas.view.core.form.FormPanel', {
                 store.loadData(detailData);
             }
         }
+
+        me.isValid();
     },
 
     /**
@@ -241,6 +268,11 @@ Ext.define('saas.view.core.form.FormPanel', {
                 defaultValue = item.defaultValue;
 
             if (xtype == 'detailGridField') {
+                item.listeners = item.listeners || {};
+                item.listeners.validChange = function() {
+                    me.isValid();
+                }
+
                 return;
             }
 

+ 13 - 8
frontend/saas-web/app/view/core/form/FormPanelController.js

@@ -51,12 +51,14 @@ Ext.define('saas.view.core.form.FormPanelController', {
         var me = this,
         form = this.getView();
 
-        if(form.getForm().wasDirty==false){
-            showToast('未修改数据,请修改后保存');
+        var valid = form.isValid();
+        if(!valid) {
+            showToast('表单校验有误,请检查');
             return false;
         }
-        if(form.getForm().wasValid==false){
-            showToast('表单校验有误,请检查');
+
+        if(form.getForm().wasDirty==false){
+            showToast('未修改数据,请修改后保存');
             return false;
         }
         //form里面数据
@@ -110,15 +112,18 @@ Ext.define('saas.view.core.form.FormPanelController', {
         detailCount = form.detailCount,
         viewModel = me.getViewModel(),
         modelData = viewModel.getData();
+
+        var valid = form.isValid();
+
+        if(!valid) {
+            showToast('表单校验有误,请检查');
+            return false;
+        }
         
         if(form.getForm().wasDirty==false){
             showToast('未修改数据,请修改后保存');
             return false;
         }
-        if(form.getForm().wasValid==false){
-            showToast('表单校验有误,请检查');
-            return false;
-        }
         //form里面数据
         var formData = form.getFormData();
         var params = {

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

@@ -6,6 +6,7 @@ Ext.define('saas.view.core.form.FormPanelModel', {
         id: 0,
         base: {
             bindFields: [], // 绑定字段
+            valid: true, // 单据是否合法
             editable: true, // 单据是否可编辑
             codeEditable: false, // 单据编号是否可编辑
         },

+ 43 - 10
frontend/saas-web/app/view/core/form/field/DetailGridField.js

@@ -49,6 +49,9 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
                 emptyText: '<div style="width: 100%; text-align: center; cursor: pointer; color: green;" class="fa fa-plus" title="新增行" onclick="addRows(\'' + me.id + '\')"></div>',
             },
             listeners: {
+                edit: function() {
+                    me.fireEvent('validChange');
+                },
                 itemmouseenter: function(view, record, item, index, e, eOpts) {
                     if(!view.up('detailGridField').editable) {
                         return;
@@ -100,6 +103,7 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
             xtype : "numbercolumn",
             align : 'center',
             format:'0',
+            allowBlank: true,
             summaryType: 'count',
             locked:true,
             lockable: false,
@@ -115,11 +119,6 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
             },
         };
 
-        Ext.Array.each(columns, function(c) {
-            Ext.applyIf(c, {
-                allowBlank: true
-            });
-        });
         if (detnoField) {
             Ext.apply(me, { columns: [indexColumn].concat(columns) });
         }
@@ -193,6 +192,7 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
         var data = {};
         data[detnoColumn] = detno + 1;
         store.insert(store.indexOf(selectedRecord) + 1, data);
+        me.fireEvent('validChange');
     },
 
     deleteDetail: function(v) {
@@ -229,6 +229,7 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
         }else{
             store.remove(selectedRecord);
         }
+        me.fireEvent('validChange');
     },
 
     swapUp: function() {
@@ -280,6 +281,7 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
             //聚焦目标行
             me.selModel.select(to);
         }
+        me.fireEvent('validChange');
     },
     setGridDisabled: function(able) {
         var me = this,
@@ -294,19 +296,50 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
             }
         });
     },
+
+    /**
+     * 判断grid数据是否合法
+     */
     isValid: function() {
         var me = this,
-        columns = me.columns;
+        columns = me.columns,
+        dirtyData = me.getDirtyData(),
+        valid = true;
 
         // 判断列必填
-        Ext.Array.each(columns, function(c) {
+        a:
+        for(var i = 0; i < columns.length; i++) {
+            var c = columns[i];
+            var cname = c.dataIndex;
             var allowBlank = c.allowBlank;
-            if(!allowBlank) {
-                
+            var isValid = c.isValid;
+            
+            b:
+            for(var j = 0; j < dirtyData.length; j++) {
+                var d = dirtyData[j];
+                var value = d[cname];
+
+                if(typeof isValid == 'function') {
+                    if(!isValid(value)) {
+                        valid = false;
+                        break a;
+                    }
+                }
+                if(!allowBlank) {
+                    if(!value) {
+                        valid = false;
+                        break a;
+                    }
+                }
             }
-        });
+        }
+
+        return valid;
     },
 
+    /**
+     * 获得已修改的数据
+     */
     getDirtyData: function() {
         var me = this,
         store = me.getStore(),

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

@@ -28,10 +28,10 @@ Ext.define('saas.view.document.bom.FormController', {
         })
         .then(function(localJson) {
             if(localJson.success){
-                showToast('启用成功');
                 form.initId = localJson.data.id;
                 form.FormUtil.loadData(form);
                 viewModel.set('base.editable', false);
+                showToast('启用成功');
             }
         })
         .catch(function(res) {

+ 1 - 1
frontend/saas-web/app/view/document/customer/FormController.js

@@ -51,10 +51,10 @@ Ext.define('saas.view.document.customer.FormController', {
         })
         .then(function(localJson) {
             if(localJson.success){
-                showToast('禁用成功');
                 form.initId = localJson.data.id;
                 form.FormUtil.loadData(form);
                 viewModel.set('base.editable', false);
+                showToast('禁用成功');
             }
         })
         .catch(function(res) {

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

@@ -234,7 +234,7 @@ Ext.define('saas.view.document.kind.KindModel', {
                 }
             }
         },
-        productunit: {
+        productunit: {    
             fields:[
                 {name: 'id', type: 'int'},
                 {name: 'pu_name',  type: 'string'}

+ 2 - 2
frontend/saas-web/app/view/document/product/FormController.js

@@ -146,10 +146,10 @@ Ext.define('saas.view.document.product.FormController', {
         })
         .then(function(localJson) {
             if(localJson.success){
-                showToast('启用成功');
                 form.initId = localJson.data.id;
                 form.FormUtil.loadData(form);
                 viewModel.set('base.editable', false);
+                showToast('启用成功');
             }
         })
         .catch(function(res) {
@@ -169,10 +169,10 @@ Ext.define('saas.view.document.product.FormController', {
         })
         .then(function(localJson) {
             if(localJson.success){
-                showToast('禁用成功');
                 form.initId = localJson.data.id;
                 form.FormUtil.loadData(form);
                 viewModel.set('base.editable', false);
+                showToast('禁用成功');
             }
         })
         .catch(function(res) {

+ 2 - 2
frontend/saas-web/app/view/document/vendor/FormController.js

@@ -27,10 +27,10 @@ Ext.define('saas.view.document.vendor.FormController', {
         })
         .then(function(localJson) {
             if(localJson.success){
-                showToast('启用成功');
                 form.initId = localJson.data.id;
                 form.FormUtil.loadData(form);
                 viewModel.set('base.editable', false);
+                showToast('启用成功');
             }
         })
         .catch(function(res) {
@@ -50,10 +50,10 @@ Ext.define('saas.view.document.vendor.FormController', {
         })
         .then(function(localJson) {
             if(localJson.success){
-                showToast('禁用成功');
                 form.initId = localJson.data.id;
                 form.FormUtil.loadData(form);
                 viewModel.set('base.editable', false);
+                showToast('禁用成功');
             }
         })
         .catch(function(res) {

+ 2 - 2
frontend/saas-web/app/view/purchase/purchase/FormPanel.js

@@ -103,7 +103,7 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
                 dataIndex : "pd_prodcode", 
                 xtype : "", 
                 items : null,
-                logic : 'necessaryField',
+                allowBlank : false,
                 editor : {
                     displayField : "display", 
                     editable : true, 
@@ -115,7 +115,7 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
                     queryMode : "local", 
                     store : null, 
                     valueField : "value", 
-                    xtype : "dbfindtrigger"
+                    xtype : "multidbfindtrigger"
                 }
             },
             {

+ 0 - 66
frontend/saas-web/app/view/purchase/purchase/FormPanelController.js

@@ -74,72 +74,6 @@ Ext.define('saas.view.purchase.purchase.FormPanelController', {
 
                 }
             },
-            // 从表-物料编号
-            'dbfindtrigger[name=pd_prodcode]':{
-                beforerender:function(f){
-                    Ext.apply(f,{
-                        //数据接口
-                        dataUrl: '/api/document/product/list',
-                        addXtype: 'document-product-formpanel',
-                        addTitle: '物料资料',
-                        //放大镜赋值设置
-                        dbfinds:[{
-                            from:'pr_code',to:'pd_prodcode'
-                        }, {
-                            from:'pr_unit',to:'pd_unit'
-                        }, {
-                            from: 'pr_detail', to: 'pr_detail'
-                        }],
-                        //联想查询条件
-                        dbCondition:"CONCAT(pr_code, pr_detail) like '{0}%'",
-                        //联想设置
-                        dbtpls:[{
-                            field:'pr_code',width:100
-                        },{
-                            field:'pr_detail',width:100
-                        }],
-                        //窗口字段设置
-                        dbSearchFields:[{
-                            emptyText:'输入物料编号或物料名称',
-                            xtype : "textfield", 
-                            name : "search", 
-                            conditionExpression:"CONCAT(pr_code, pr_detail) like '{0}%'",
-                            allowBlank : true, 
-                            columnWidth : 0.25
-                        }],
-                        //窗口列设置
-                        dbColumns:[{
-                            "text": "物料ID",
-                            "flex": 0,
-                            "dataIndex": "pr_id",
-                            "width": 0,
-                            "xtype": "",
-                            "items": null
-                        },{
-                            "text": "物料编号",
-                            "flex": 1,
-                            "dataIndex": "pr_code",
-                            "width": 100,
-                            "xtype": "",
-                            "items": null
-                        }, {
-                            "text": "物料名称",
-                            "flex": 1,
-                            "dataIndex": "pr_detail",
-                            "xtype": "",
-                            "items": null
-                        }, {
-                            "text": "物料规格",
-                            "flex": 0,
-                            "dataIndex": "pr_spec",
-                            "width": 200,
-                            "xtype": "",
-                            "items": null
-                        }]
-                    }) ;   
-
-                }
-            },
             //从表多选放大镜赋值关系 以及 tpl模板
             'multidbfindtrigger[name=pd_prodcode]':{
                 beforerender:function(f){

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

@@ -140,7 +140,7 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
                     queryMode : "local", 
                     store : null, 
                     valueField : "value", 
-                    xtype : "dbfindtrigger"
+                    xtype : "multidbfindtrigger"
                 }
             },
             {

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

@@ -69,7 +69,7 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanelController', {
                 }
             },
             //放大镜赋值关系 以及 tpl模板
-            'dbfindtrigger[name=pd_prodcode]':{
+            'multidbfindtrigger[name=pd_prodcode]':{
                 beforerender:function(f){
                     Ext.apply(f,{
                         dataUrl:'/api/document/product/list',

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

@@ -132,7 +132,7 @@ Ext.define('saas.view.purchase.purchaseOut.FormPanel', {
                     queryMode : "local", 
                     store : null, 
                     valueField : "value", 
-                    xtype : "dbfindtrigger"
+                    xtype : "multidbfindtrigger"
                 }
             },
             {

+ 1 - 1
frontend/saas-web/app/view/purchase/purchaseOut/FormPanelController.js

@@ -68,7 +68,7 @@ Ext.define('saas.view.purchase.purchaseOut.FormPanelController', {
                 }
             },
             //放大镜赋值关系 以及 tpl模板
-            'dbfindtrigger[name=pd_prodcode]':{
+            'multidbfindtrigger[name=pd_prodcode]':{
                 beforerender:function(f){
                     Ext.apply(f,{
                         dataUrl:'/api/document/product/list',

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

@@ -136,7 +136,7 @@ Ext.define('saas.view.stock.appropriationInOut.FormPanel', {
                     queryMode : "local", 
                     store : null, 
                     valueField : "value", 
-                    xtype : "dbfindtrigger"
+                    xtype : "multidbfindtrigger"
                 }
             },
             {

+ 1 - 1
frontend/saas-web/app/view/stock/appropriationInOut/FormPanelController.js

@@ -115,7 +115,7 @@ Ext.define('saas.view.stock.appropriationInOut.FormPanelController', {
                 }
             },            
             //放大镜赋值关系 以及 tpl模板
-            'dbfindtrigger[name=pd_prodcode]':{
+            'multidbfindtrigger[name=pd_prodcode]':{
                 beforerender:function(f){
                     Ext.apply(f,{
                         dataUrl:'/api/document/product/list',

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

@@ -134,7 +134,7 @@ Ext.define('saas.view.stock.otherIn.FormPanel', {
                     queryMode : "local", 
                     store : null, 
                     valueField : "value", 
-                    xtype : "dbfindtrigger"
+                    xtype : "multidbfindtrigger"
                 }
             },
             {

+ 1 - 1
frontend/saas-web/app/view/stock/otherIn/FormPanelController.js

@@ -114,7 +114,7 @@ Ext.define('saas.view.stock.otherIn.FormPanelController', {
                 }
             },
             //放大镜赋值关系 以及 tpl模板
-            'dbfindtrigger[name=pd_prodcode]': {
+            'multidbfindtrigger[name=pd_prodcode]': {
                 beforerender: function (f) {
                     Ext.apply(f, {
                         dataUrl: '/api/document/product/list',

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

@@ -131,7 +131,7 @@ Ext.define('saas.view.stock.otherOut.FormPanel', {
                     queryMode: "local",
                     store: null,
                     valueField: "value",
-                    xtype: "dbfindtrigger"
+                    xtype: "multidbfindtrigger"
                 }
             },
             {

+ 1 - 1
frontend/saas-web/app/view/stock/otherOut/FormPanelController.js

@@ -111,7 +111,7 @@ Ext.define('saas.view.stock.otherOut.FormPanelController', {
                 }
             },            
             //放大镜赋值关系 以及 tpl模板
-            'dbfindtrigger[name=pd_prodcode]':{
+            'multidbfindtrigger[name=pd_prodcode]':{
                 beforerender:function(f){
                     Ext.apply(f,{
                         dataUrl:'/api/document/product/list',

+ 354 - 0
frontend/saas-web/app/view/sys/maxnumbers/DataList.js

@@ -0,0 +1,354 @@
+/**
+ * Created by zhouy on 2018/10/18.
+ */
+Ext.define('saas.view.sys.maxnumbers.DataList', {
+    extend: 'Ext.grid.Panel',
+    xtype: 'sys-maxnumbers-datalist',
+    autoScroll: true,
+    frame:true,
+    layout:'fit',
+    dataUrl:'http://192.168.253.31:8920/number/list',
+    saveUrl:'http://192.168.253.31:8920/number/save',
+    deleteUrl:'http://192.168.253.31:8920/number/delete/',
+
+    tbar: [{
+        width: 150,
+        name: 'mn_caller',
+        xtype: 'textfield',
+        emptyText : '单据Caller'
+    },{
+        width: 150,
+        name: 'mn_leadcode',
+        xtype: 'textfield',
+        emptyText : '单据前缀'
+    },{
+        cls:'x-formpanel-btn-orange',
+        xtype:'button',
+        text:'查询',
+        listeners: {
+            click:function(b){
+                var grid = b.ownerCt.ownerCt;
+                var tbar = b.ownerCt;
+                grid.condition = '';
+                var items = [];
+                var fields = tbar.items.items.map(f => f.name);
+                Ext.each(fields, function(f, index){
+                    var field = tbar.down('[name='+f+']');
+                    if(field){
+                        items.push(field);
+                    }
+                });
+                grid.condition = grid.getCondition(items);
+                grid.store.loadPage(1);
+            }
+        }
+    },'->',{
+        cls:'x-formpanel-btn-blue',
+        xtype:'button',
+        text:'新增',
+        listeners: {
+            click: 'onAdd'
+        }
+    }],
+
+    columns : [{
+        text : "id", 
+        width : 0, 
+        dataIndex : "id", 
+        xtype : "numbercolumn", 
+    },{
+        text : "单据caller", 
+        width : 200.0, 
+        dataIndex : "mn_caller", 
+        xtype : "", 
+    }, 
+    {
+        text : "单据前缀", 
+        dataIndex : "mn_leadcode", 
+        width : 120.0, 
+        xtype : "", 
+    }, 
+    {
+        text : "单据规则", 
+        dataIndex : "mn_rule", 
+        width : 220.0, 
+        xtype : "", 
+    },{
+        text : "规则长度", 
+        dataIndex : "mn_number", 
+        width : 120.0, 
+        xtype : "", 
+    }],
+
+    dbSearchFields: [],
+    condition:'',
+
+    initComponent: function() {
+        var me = this;
+        if(me.columns){
+            var fields = me.columns.map(column => column.dataIndex);
+            me.columns = me.insertFirstColumn(me.columns);
+            me.store = Ext.create('Ext.data.Store',{
+                fields:fields,
+                autoLoad: true,
+                pageSize: 11,
+                data: [],
+                proxy: {
+                    timeout:8000,
+                    type: 'ajax',
+                    url: me.dataUrl,
+                    actionMethods: {
+                        read: 'GET'
+                    },
+                    reader: {
+                        type: 'json',
+                        rootProperty: 'data.list',
+                        totalProperty: 'data.total',
+                    }
+                },
+                listeners: {
+                    beforeload: function (store, op) {
+                        var condition = me.condition;
+                        if (Ext.isEmpty(condition)) {
+                            condition = "";
+                        }
+                        Ext.apply(store.proxy.extraParams, {
+                            number: op._page,
+                            size: store.pageSize,
+                            condition: JSON.stringify(condition)
+                        });
+                    }
+                }
+            });
+
+            Ext.apply(me, {
+                dockedItems:[{
+                    xtype: 'pagingtoolbar',
+                    dock: 'bottom',
+                    displayInfo: true,
+                    emptyMsg: "暂无数据",
+                    store: me.store,
+                    displayMsg: '显示{0}到{1}条数据,共有{2}条',
+                    beforePageText: "当前第",
+                    afterPageText: "页,共{0}页"
+                }]
+            });
+        }
+        me.callParent(arguments);
+    },
+
+    onVastDeal:function(url,type){
+        var form = this.ownerCt;
+        var grid = this;
+        var data = grid.getGridSelected(type);
+        if(!data){
+            showToast('请勾选符合条件的行进行操作。');
+            return false;
+        }
+        if(data&&data.length>0){
+            var params = JSON.stringify({baseDTOs:data});
+            form.BaseUtil.request({
+                    url: url,
+                    params: params,
+                    method: 'POST',
+                    async:false
+                })
+                .then(function() {
+                    showToast('操作成功');
+                    grid.store.load();
+                })
+                .catch(function(response) {
+                    showToast('操作失败');
+                });
+        }else{
+            showToast('请勾选至少一条明细。');
+        }
+    },
+
+    listeners:{
+        itemClick: function(view,record,a,index,c) {
+            var classList = c.target.classList.value;
+            var form = view.ownerCt.ownerCt;
+            if(classList.indexOf('fa-pencil')>-1){
+                var config = {};
+                config.initId = record.get('id');
+                openTab(form._formXtype, '修改'+form._title, form._formXtype+config.initId, config);
+            }else if(classList.indexOf('fa-trash-o')>-1){
+                //删除
+                var id = record.get('id');
+                if(id){
+                    form.BaseUtil.request({
+                        url: form._deleteUrl+id,
+                        method: 'POST',
+                    })
+                    .then(function(localJson) {
+                        if(localJson.success){
+                            //解析参数
+                            showToast('删除成功');
+                            view.ownerCt.store.load();
+                        }
+                    })
+                    .catch(function() {
+                        showToast('删除失败');
+                    });
+                }
+            }
+        }
+    },
+
+    insertFirstColumn:function(columns){
+        var me=this;
+        if(columns.length>0 && columns[0].xtype!='actioncolumn'){
+            return Ext.Array.insert(columns,0,[{
+                xtype:'actioncolumn',
+                width:70,
+                dataIndex:'actioncolumn',
+                text:'操作',
+                items: [{
+                    tooltip: '编辑',
+                    iconCls: 'x-fa fa-pencil fa-fw',
+                    scope:this
+                },{
+                    text:'删除',
+                    iconCls:'x-fa fa-trash-o fa-fw',
+                    tooltip: '删除',
+                    scope:this
+                }]
+            }]);
+        }
+        return columns;
+    },
+
+    getGridSelected:function(type){
+        var isErrorSelect = false;
+        var checkField = this.statusCodeField;
+        var me = this,
+        items = me.selModel.getSelection(),
+        data = new Array() ;
+        Ext.each(items, function(item, index){
+            if(!Ext.isEmpty(item.data[me.idField])){
+                var o = new Object();
+                if(me.idField){
+                    o['id'] = item.data[me.idField];
+                }
+                if(me.codeField){
+                    o['code'] = item.data[me.codeField];
+                }
+                if(type&&type==item.data[checkField]){
+                    isErrorSelect = true
+                }
+                data.push(o);
+            }
+        });
+        if(isErrorSelect){
+            return false;
+        }
+		return data;
+    },
+
+    /**
+     * 获得过滤条件
+     */
+    getCondition: function(items) {
+        var me = this,
+        conditions = [];
+
+        for(var i = 0; i < items.length; i++) {
+            var item = items[i];
+            var field = item.name,
+            func = item.getCondition,
+            value = item.value,
+            condition;
+
+            if(typeof func == 'function') {
+                condition = {
+                    type: 'condition',
+                    value: func(value)
+                }
+            }else {
+                var xtype = item.xtype || 'textfield',
+                type = item.fieldType || me.getDefaultFieldType(xtype),
+                operation = item.operation || me.getDefaultFieldOperation(xtype),
+                conditionValue = me.getConditionValue(xtype, value);
+    
+                if(!conditionValue) {
+                    continue;
+                }
+                condition = {
+                    type: type,
+                    field: field,
+                    operation: operation,
+                    value: conditionValue
+                }
+            }
+            conditions.push(condition);
+        };
+        return conditions;
+    },
+
+    getDefaultFieldType: function(xtype) {
+        var type;
+
+        if(Ext.Array.contains(['numberfield'], xtype)) {
+            type = 'number';
+        }else if(Ext.Array.contains(['datefield', 'condatefield'], xtype)) {
+            type = 'date';
+        }else if(Ext.Array.contains(['combobox', 'multicombo', 'combo', 'radiofield', 'radio'], xtype)) {
+            type = 'enum';
+        }else {
+            type = 'string';
+        }
+
+        return type;
+    },
+
+    getDefaultFieldOperation: function(xtype) {
+        var operation;
+
+        if(Ext.Array.contains(['numberfield'], xtype)) {
+            operation = '=';
+        }else if(Ext.Array.contains(['datefield'], xtype)) {
+            operation = '=';
+        }else if(Ext.Array.contains(['condatefield'], xtype)) {
+            operation = 'between';
+        }else if(Ext.Array.contains(['combobox', 'multicombo', 'combo'], xtype)) {
+            operation = 'in';
+        }else {
+            operation = 'like';
+        }
+
+        return operation;
+    },
+
+    /**
+     * 处理部分字段值
+     */
+    getConditionValue: function(xtype, value) {
+        var conditionValue;
+        if(xtype == 'datefield') {
+            conditionValue = Ext.Date.format(new Date(from), 'Y-m-d h:i:s');
+        }else if(xtype == 'condatefield') {
+            var from = value.from,
+            to = value.to;
+
+            conditionValue = Ext.Date.format(new Date(from), 'Y-m-d h:i:s') + ',' + Ext.Date.format(new Date(to), 'Y-m-d h:i:s');
+        }else if(xtype == 'combobox' || xtype == 'combo') {
+            conditionValue = '\'' + value + '\'';
+        }else if(xtype == 'multicombo') {
+            conditionValue = value.map(function(v) {
+                return '\'' + v.value + '\'';
+            }).join(',');
+        }else {
+            conditionValue = value;
+        }
+
+        return conditionValue;
+    },
+
+    refresh:function(){
+        //debugger
+    }
+
+})
+
+

+ 250 - 0
frontend/saas-web/app/view/sys/messagelog/DataList.js

@@ -0,0 +1,250 @@
+Ext.define('saas.view.sys.messagelog.DataList', {
+    extend: 'Ext.grid.Panel',
+    xtype: 'sys-messagelog-datalist',
+
+    autoScroll: true,
+    frame:true,
+    layout:'fit',
+    dataUrl:'api/common/messagelog/list',
+
+    tbar: [{
+        width: 150,
+        name: 'ml_caller',
+        xtype: 'textfield',
+        emptyText : '单据Caller'
+    },{
+        width: 150,
+        name: 'ml_code',
+        xtype: 'textfield',
+        emptyText : '单据编号'
+    },{
+        width: 150,
+        name: 'ml_man',
+        xtype: 'textfield',
+        emptyText : '处理人'
+    },{
+        cls:'x-formpanel-btn-orange',
+        xtype:'button',
+        text:'查询',
+        listeners: {
+            click:function(b){
+                var grid = b.ownerCt.ownerCt;
+                var tbar = b.ownerCt;
+                grid.condition = '';
+                var items = [];
+                var fields = tbar.items.items.map(f => f.name);
+                Ext.each(fields, function(f, index){
+                    var field = tbar.down('[name='+f+']');
+                    if(field){
+                        items.push(field);
+                    }
+                });
+                grid.condition = grid.getCondition(items);
+                grid.store.loadPage(1);
+            }
+        }
+    },'->'],
+
+    //字段属性
+    columns : [{
+        text : "id", 
+        width : 0, 
+        dataIndex : "id", 
+        xtype : "numbercolumn",   
+    },{
+        text:'单据Caller',
+        dataIndex : "ml_caller",
+        width : 200.0, 
+    },{
+        text : "单据编号", 
+        width : 200.0, 
+        dataIndex : "ml_code", 
+    }, 
+    {
+        text : "操作", 
+        dataIndex : "ml_content", 
+        width : 220.0, 
+    }, 
+    {
+        text : "结果", 
+        dataIndex : "ml_result", 
+        width : 120.0, 
+    }, 
+    {
+        text : "处理人", 
+        dataIndex : "ml_man", 
+        width : 200, 
+    }],
+
+    condition:'',
+
+    initComponent: function() {
+        var me = this;
+        if(me.columns){
+            var fields = me.columns.map(column => column.dataIndex);
+            me.store = Ext.create('Ext.data.Store',{
+                fields:fields,
+                autoLoad: true,
+                pageSize: 11,
+                data: [],
+                proxy: {
+                    timeout:8000,
+                    type: 'ajax',
+                    url: me.dataUrl,
+                    actionMethods: {
+                        read: 'GET'
+                    },
+                    reader: {
+                        type: 'json',
+                        rootProperty: 'data.list',
+                        totalProperty: 'data.total',
+                    }
+                },
+                listeners: {
+                    beforeload: function (store, op) {
+                        var condition = me.condition;
+                        if (Ext.isEmpty(condition)) {
+                            condition = "";
+                        }
+                        Ext.apply(store.proxy.extraParams, {
+                            number: op._page,
+                            size: store.pageSize,
+                            condition: JSON.stringify(condition)
+                        });
+                    }
+                }
+            });
+
+            Ext.apply(me, {
+                dockedItems:[{
+                    xtype: 'pagingtoolbar',
+                    dock: 'bottom',
+                    displayInfo: true,
+                    emptyMsg: "暂无数据",
+                    store: me.store,
+                    displayMsg: '显示{0}到{1}条数据,共有{2}条',
+                    beforePageText: "当前第",
+                    afterPageText: "页,共{0}页"
+                }]
+            });
+        }
+        me.callParent(arguments);
+    },
+
+    getCondition: function(f,conditionExpression){
+        var condition = '';
+        if((f.xtype == 'checkbox' || f.xtype == 'radio')&&f.logic){
+            
+        }else if(f.xtype=='textfield'&&f.value!=''){
+            condition=conditionExpression.replace(new RegExp("\\{0}","g"), f.value);
+        }
+        if(condition.length>0){
+            condition+= ' AND ';
+        }
+        return condition;
+    },
+
+     /**
+     * 获得过滤条件
+     */
+    getCondition: function(items) {
+        var me = this,
+        conditions = [];
+
+        for(var i = 0; i < items.length; i++) {
+            var item = items[i];
+            var field = item.name,
+            func = item.getCondition,
+            value = item.value,
+            condition;
+
+            if(typeof func == 'function') {
+                condition = {
+                    type: 'condition',
+                    value: func(value)
+                }
+            }else {
+                var xtype = item.xtype || 'textfield',
+                type = item.fieldType || me.getDefaultFieldType(xtype),
+                operation = item.operation || me.getDefaultFieldOperation(xtype),
+                conditionValue = me.getConditionValue(xtype, value);
+    
+                if(!conditionValue) {
+                    continue;
+                }
+                condition = {
+                    type: type,
+                    field: field,
+                    operation: operation,
+                    value: conditionValue
+                }
+            }
+            conditions.push(condition);
+        };
+        return conditions;
+    },
+
+    getDefaultFieldType: function(xtype) {
+        var type;
+
+        if(Ext.Array.contains(['numberfield'], xtype)) {
+            type = 'number';
+        }else if(Ext.Array.contains(['datefield', 'condatefield'], xtype)) {
+            type = 'date';
+        }else if(Ext.Array.contains(['combobox', 'multicombo', 'combo', 'radiofield', 'radio'], xtype)) {
+            type = 'enum';
+        }else {
+            type = 'string';
+        }
+
+        return type;
+    },
+
+    getDefaultFieldOperation: function(xtype) {
+        var operation;
+
+        if(Ext.Array.contains(['numberfield'], xtype)) {
+            operation = '=';
+        }else if(Ext.Array.contains(['datefield'], xtype)) {
+            operation = '=';
+        }else if(Ext.Array.contains(['condatefield'], xtype)) {
+            operation = 'between';
+        }else if(Ext.Array.contains(['combobox', 'multicombo', 'combo'], xtype)) {
+            operation = 'in';
+        }else {
+            operation = 'like';
+        }
+
+        return operation;
+    },
+
+    /**
+     * 处理部分字段值
+     */
+    getConditionValue: function(xtype, value) {
+        var conditionValue;
+        if(xtype == 'datefield') {
+            conditionValue = Ext.Date.format(new Date(from), 'Y-m-d h:i:s');
+        }else if(xtype == 'condatefield') {
+            var from = value.from,
+            to = value.to;
+
+            conditionValue = Ext.Date.format(new Date(from), 'Y-m-d h:i:s') + ',' + Ext.Date.format(new Date(to), 'Y-m-d h:i:s');
+        }else if(xtype == 'combobox' || xtype == 'combo') {
+            conditionValue = '\'' + value + '\'';
+        }else if(xtype == 'multicombo') {
+            conditionValue = value.map(function(v) {
+                return '\'' + v.value + '\'';
+            }).join(',');
+        }else {
+            conditionValue = value;
+        }
+
+        return conditionValue;
+    },
+
+    refresh:function(){
+        //debugger
+    }
+
+});

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

@@ -246,4 +246,27 @@
             "leaf": true
         }]
     }]
+},{
+    "text": "设置",
+    "iconCls": "x-fa fa-cog",
+    "items": [{
+        "text": "系统设置",
+        "items": [{
+            "id":"sys-messagelog-datalist",
+            "text": "操作日志",
+            "viewType": "sys-messagelog-datalist",
+            "leaf": true
+        }, {
+            "id":"sys-messagelog-datalist",
+            "text": "单据编码规则",
+            "viewType": "sys-maxnumbers-datalist",
+            "leaf": true
+        }, {
+            "id":"product-list-formpanel",
+            "text": "结账/反结账",
+            "viewType": "document-product-basepanel",
+            "addType":"document-product-formpanel",
+            "leaf": true
+        }]
+    }]
 }]