Browse Source

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

hy 7 years ago
parent
commit
20bb39219f
26 changed files with 1004 additions and 64 deletions
  1. 2 0
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/mapper/MaxnumbersMapper.java
  2. 12 7
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/impl/MaxnumberServiceImpl.java
  3. 13 0
      applications/commons/commons-server/src/main/resources/mapper/MaxnumbersMapper.xml
  4. 1 1
      applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/VendorList.java
  5. 1 1
      applications/document/document-server/src/main/resources/mapper/VendorMapper.xml
  6. 1 1
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/ProdInOutServiceImpl.java
  7. 1 0
      frontend/saas-web/app/view/core/form/FormPanel.js
  8. 12 0
      frontend/saas-web/app/view/core/form/FormPanelController.js
  9. 27 17
      frontend/saas-web/app/view/core/form/field/DetailGridField.js
  10. 1 1
      frontend/saas-web/app/view/core/query/QueryGridPanel.js
  11. 453 0
      frontend/saas-web/app/view/core/report/ReportPanel.js
  12. 29 0
      frontend/saas-web/app/view/core/report/ReportPanelController.js
  13. 4 0
      frontend/saas-web/app/view/core/report/ReportPanelModel.js
  14. 8 3
      frontend/saas-web/app/view/purchase/purchaseOut/FormPanel.js
  15. 94 0
      frontend/saas-web/app/view/purchase/report/Purchase.js
  16. 4 0
      frontend/saas-web/app/view/purchase/report/PurchaseController.js
  17. 4 0
      frontend/saas-web/app/view/purchase/report/PurchaseModel.js
  18. 66 0
      frontend/saas-web/app/view/sale/report/SaleIn.js
  19. 4 0
      frontend/saas-web/app/view/sale/report/SaleInController.js
  20. 4 0
      frontend/saas-web/app/view/sale/report/SaleInModel.js
  21. 0 8
      frontend/saas-web/app/view/sale/sale/FormPanel.js
  22. 0 8
      frontend/saas-web/app/view/sale/saleIn/FormPanel.js
  23. 0 8
      frontend/saas-web/app/view/sale/saleOut/FormPanel.js
  24. 5 3
      frontend/saas-web/app/view/stock/make/FormPanel.js
  25. 252 4
      frontend/saas-web/app/view/stock/make/FormPanelController.js
  26. 6 2
      frontend/saas-web/resources/json/navigation.json

+ 2 - 0
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/mapper/MaxnumbersMapper.java

@@ -33,4 +33,6 @@ public interface MaxnumbersMapper extends CommonBaseMapper<Maxnumbers>{
     int updateByPrimaryKey(Maxnumbers record);
 
     List<Maxnumbers> getListDataByCondition(@Param("condition") String condition, @Param("companyId") Long companyId);
+
+    Maxnumbers selectByCaller(@Param("caller")String caller, @Param("companyId") Long companyId);
 }

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

@@ -246,11 +246,8 @@ public class MaxnumberServiceImpl extends CommonBaseServiceImpl<MaxnumbersMapper
     * @Date: 2018/10/19
     */
     private Maxnumbers getMaxnumbers(String caller) {
-        MaxnumbersExample example = new MaxnumbersExample();
-        MaxnumbersExample.Criteria cta = example.createCriteria();
-        cta.andCompanyIdEqualTo(BaseContextHolder.getCompanyId());
-        cta.andMn_callerEqualTo(caller);
-        return maxnumbersMapper.selectByExample(example);
+       Long companyId = BaseContextHolder.getCompanyId();
+        return maxnumbersMapper.selectByCaller(caller, companyId);
     }
     /**
     * @Description
@@ -280,8 +277,16 @@ public class MaxnumberServiceImpl extends CommonBaseServiceImpl<MaxnumbersMapper
         String rulecode = maxnumbers.getMn_leadcode();
         String mn_rule = maxnumbers.getMn_rule();
         mn_rule = mn_rule == null ? "" : mn_rule.toUpperCase();
-        String date = "YYYYMM".equals(mn_rule) ? DateUtils.format(new Date(), "yyyyMM") :
-                DateUtils.format(new Date(), "yyyyMMdd");
+        String date = null;
+        if ("YYYYMM".equals(mn_rule)) {
+            date = DateUtils.format(new Date(), "yyyyMM");
+        } else if ("YYYYMMDD".equals(mn_rule)) {
+            date =  DateUtils.format(new Date(), "yyyyMMdd");
+        } else {
+            date = "";
+        }
+/*        String date = "YYYYMM".equals(mn_rule) ? DateUtils.format(new Date(), "yyyyMM") :
+                DateUtils.format(new Date(), "yyyyMMdd");*/
         return rulecode += date;
     }
 

+ 13 - 0
applications/commons/commons-server/src/main/resources/mapper/MaxnumbersMapper.xml

@@ -12,6 +12,7 @@
     <result column="creatorId" property="creatorId" jdbcType="INTEGER" />
     <result column="updateTime" property="updateTime" jdbcType="TIMESTAMP" />
     <result column="updaterId" property="updaterId" jdbcType="INTEGER" />
+    <result column="mn_rule" property="mn_rule" jdbcType="VARCHAR" />
   </resultMap>
   <sql id="Example_Where_Clause" >
     <where >
@@ -292,4 +293,16 @@
         </where>
         ORDER BY MN_ID DESC
     </select>
+  <select id="selectByCaller" resultMap="BaseResultMap">
+    SELECT * FROM MAXNUMBERS
+    <where>
+      <if test="caller">
+        and mn_caller=#{caller}
+      </if>
+      <if test="companyId">
+        and COMPANYID=#{companyId}
+      </if>
+    </where>
+    ORDER BY MN_ID DESC
+  </select>
 </mapper>

+ 1 - 1
applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/VendorList.java

@@ -111,7 +111,7 @@ public class VendorList implements Serializable {
 
     private String vc_name;
 
-    private Integer vc_tel;
+    private String vc_tel;
 
     private String vc_qq;
 

+ 1 - 1
applications/document/document-server/src/main/resources/mapper/VendorMapper.xml

@@ -81,7 +81,7 @@
         <result column="vc_veid" property="vc_veid" jdbcType="INTEGER" />
         <result column="vc_detno" property="vc_detno" jdbcType="INTEGER" />
         <result column="vc_name" property="vc_name" jdbcType="VARCHAR" />
-        <result column="vc_tel" property="vc_tel" jdbcType="INTEGER" />
+        <result column="vc_tel" property="vc_tel" jdbcType="VARCHAR" />
         <result column="vc_qq" property="vc_qq" jdbcType="VARCHAR" />
         <result column="vc_email" property="vc_email" jdbcType="VARCHAR" />
         <result column="vc_text1" property="vc_text1" jdbcType="VARCHAR" />

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

@@ -235,8 +235,8 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
                 id = baseDTO.getId();
             }
             singleAudit(formData.getMain());
+            baseDTO = getBaseDTOById(id,formData.getMain().getPi_class(),formData.getMain().getPi_inoutno());
         }
-        baseDTO.setId(id);
         return baseDTO;
     }
 

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

@@ -122,6 +122,7 @@ Ext.define('saas.view.core.form.FormPanel', {
             width: 150,
             cls: 'x-codeeditor',
             hidden: true,
+            allowBlank: false,
             bind: {
                 value: '{' + me._codeField + '}',
                 hidden: '{!base.codeEditable}'

+ 12 - 0
frontend/saas-web/app/view/core/form/FormPanelController.js

@@ -123,6 +123,18 @@ Ext.define('saas.view.core.form.FormPanelController', {
         viewModel = me.getViewModel(),
         modelData = viewModel.getData();
 
+        var dirty = form.isDirty();
+
+        if(dirty) {
+            showConfirm('提示', '表单数据有修改,是否先保存修改?')
+            .then(function(yes) {
+                if(yes == 'yes') {
+                    me.onSave();
+                }
+            });
+            return;
+        }
+
         var valid = form.isValid();
 
         if(!valid) {

+ 27 - 17
frontend/saas-web/app/view/core/form/field/DetailGridField.js

@@ -224,6 +224,7 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
         if(!me.editable) {
             return;
         }
+
         var detnoColumn = me.detnoColumn,
         store = me.getStore(),
         records = store.getData().items,
@@ -232,24 +233,33 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
         });
 
         var id = selectedRecord.data.id;
-        if(id&&id!=0&&(typeof id) == 'number'){
-            me.BaseUtil.request({
-                url: me.deleteDetailUrl+id,
-                params: '',
-                method: 'POST',
-            })
-            .then(function() {
-                store.remove(selectedRecord);
-                me.fireEvent('validChange');
-                //解析参数
-                showToast('删除成功');
+
+        if(id&&id!=0&&(typeof id) == 'number') {
+            showConfirm('警告', '确定删除该条明细')
+            .then(function(yes) {
+                if(yes == 'yes') {
+                    me.BaseUtil.request({
+                        url: me.deleteDetailUrl+id,
+                        params: '',
+                        method: 'POST',
+                    })
+                    .then(function() {
+                        store.remove(selectedRecord);
+                        me.fireEvent('validChange');
+                        //解析参数
+                        showToast('删除成功');
+                    })
+                    .catch(function() {
+                        me.fireEvent('validChange');
+                        //失败
+                        showToast('删除失败');
+                    });
+                }else {
+                    throw new Error();
+                }
             })
-            .catch(function() {
-                me.fireEvent('validChange');
-                //失败
-                showToast('删除失败');
-            });
-        }else{
+            .catch()
+        }else {
             store.remove(selectedRecord);
             me.fireEvent('validChange');
         }

+ 1 - 1
frontend/saas-web/app/view/core/query/QueryGridPanel.js

@@ -63,7 +63,7 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
                                 }
                             }else {
                                 console.error('exception: ', response.responseJson);
-                                showToast('exception:' + response.responseJson);
+                                showToast('请求错误:' + response.responseJson);
                             }
                         }
                     }

+ 453 - 0
frontend/saas-web/app/view/core/report/ReportPanel.js

@@ -0,0 +1,453 @@
+Ext.define('saas.view.core.report.ReportPanel', {
+    extend: 'Ext.panel.Panel',
+    xtype: 'core-report-reportpanel',
+
+    controller: 'core-report-reportpanel',
+    viewModel: 'core-report-reportpanel',
+
+    requires: [
+        'Ext.grid.plugin.Exporter'
+    ],
+
+    layout: 'vbox',
+    autoScroll: true,
+    border: 1,
+    bodyPadding: 5,
+
+    groupField: null, // 分组字段
+    listUrl: null, // 列表查询URL
+    defaultCondition: null, // 默认查询条件
+    searchItems: [], // 查询字段
+
+    initComponent: function() {
+        var me = this;
+
+        var store = me.initStore();
+
+        Ext.apply(me, {
+            items: [{
+                xtype: 'form',
+                width: '100%',
+                layout: 'column',
+                defaults:{
+                    margin: '0 5 5 0',
+                    labelAlign: 'right',
+                    labelWidth: 90,
+                    columnWidth: 0.25,
+                },
+                items: me.initSearchItems(),
+                dockedItems: [{
+                    xtype: 'toolbar',
+                    dock: 'bottom',
+                    items: ['->', {
+                        xtype: 'button',
+                        text: '查询',
+                        handler: 'onQuery'
+                    }, '->']
+                }]
+            }, {
+                xtype: 'grid',
+                width: '100%',
+                flex: 1,
+                border: 1,
+                plugins: {
+                    gridexporter: true
+                },
+                features: [{
+                    ftype: 'groupingsummary',
+                    hideGroupedHeader: false,
+                    enableGroupingMenu: false,
+                    collapsible: false
+                }, {
+                    ftype: 'summary',
+                    dock: 'bottom'
+                }],
+                store: store,
+                columns: me.initColumns(),
+                dockedItems: [{
+                    xtype: 'toolbar',
+                    dock: 'top',
+                    items: ['->', {
+                        xtype: 'button',
+                        text: '导出为...',
+                        menu: {
+                            defaults: {
+                                handler: 'exportTo'
+                            },
+                            items: [{
+                                text: 'Excel xlsx',
+                                cfg: {
+                                    type: 'excel07',
+                                    ext: 'xlsx'
+                                }
+                            }, {
+                                text: 'Excel xlsx (include groups)',
+                                cfg: {
+                                    type: 'excel07',
+                                    ext: 'xlsx',
+                                    includeGroups: true,
+                                    includeSummary: true
+                                }
+                            }, {
+                                text: 'Excel xml',
+                                cfg: {
+                                    type: 'excel03',
+                                    ext: 'xml'
+                                }
+                            }, {
+                                text: 'Excel xml (include groups)',
+                                cfg: {
+                                    includeGroups: true,
+                                    includeSummary: true
+                                }
+                            }, {
+                                text: 'CSV',
+                                cfg: {
+                                    type: 'csv'
+                                }
+                            }, {
+                                text: 'TSV',
+                                cfg: {
+                                    type: 'tsv',
+                                    ext: 'csv'
+                                }
+                            }, {
+                                text: 'HTML',
+                                cfg: {
+                                    type: 'html'
+                                }
+                            }, {
+                                text: 'HTML (include groups)',
+                                cfg: {
+                                    type: 'html',
+                                    includeGroups: true,
+                                    includeSummary: true
+                                }
+                            }]
+                        }
+                    }]
+                }, {
+                    style: {
+                        'border-top': '1px solid #35baf6 !important'
+                    },
+                    xtype: 'pagingtoolbar',
+                    dock: 'bottom',
+                    displayInfo: true,
+                    store: store
+                }],
+            }]
+        });
+
+        me.callParent(arguments);
+    },
+
+    getListGrid: function() {
+        var me = this,
+        grid = me.items.items[1];
+
+        return grid;
+    },
+
+    initStore: function() {
+        var me = this;
+        var store = Ext.create('Ext.data.Store', {
+            fields: me.getFields(),
+            autoLoad: true,
+            pageSize: 15,
+            data: [],
+            proxy: {
+                type: 'ajax',
+                url: me.listUrl,
+                timeout: 8000,
+                actionMethods: {
+                    read: 'GET'
+                },
+                reader: {
+                    type: 'json',
+                    rootProperty: 'data.list',
+                    totalProperty: 'data.total',
+                },
+                listeners: {
+                    exception: function(proxy, response, operation, eOpts) {
+                        if(operation.success) {
+                            if(response.timedout) {
+                                showToast('请求超时');
+                            }
+                        }else {
+                            console.error('exception: ', response.responseJson);
+                            showToast('请求错误:' + response.responseJson);
+                        }
+                    }
+                }
+            },
+            listeners: {
+                beforeload: function (store, op) {
+                    condition = me.getConditions(),
+                    defaultCondition = me.defaultCondition;
+    
+                    if(defaultCondition) {
+                        condition.push({
+                            type: 'condition',
+                            value: defaultCondition
+                        });
+                    }
+                    Ext.apply(store.proxy.extraParams, {
+                        number: store.exportNumber?store.exportNumber:op._page,
+                        size: store.exportPageSize?store.exportPageSize:store.pageSize,
+                        mode: 'MAIN',
+                        condition: JSON.stringify(condition)
+                    });
+    
+                }
+            }
+        });
+
+        if(me.groupField) {
+            store.setGrouper({
+                property: me.groupField
+            });
+        }
+
+        return store;
+    },
+
+    getFields: function() {
+        var me = this;
+        return me.reportColumns.filter(function(c) {
+            return !!c.dataIndex;
+        }).map(function(c) {
+            return c.dataIndex;
+        });
+    },
+
+    initColumns: function() {
+        var me = this,
+        columns = me.reportColumns;
+
+        Ext.Array.each(columns, function(c) {
+            Ext.applyIf(c, {
+                width: 120
+            });
+
+            if(c.xtype == 'datecolumn') {
+                Ext.applyIf(c, {
+                    format: 'Y-m-d'
+                })
+            }
+        })
+
+        return columns;
+    },
+
+    initSearchItems: function() {
+        var me = this,
+        items = me.searchItems,
+        viewModel = me.getViewModel();
+
+        Ext.Array.each(items, function(item) {
+            var bind = item.bind,
+            name = item.name,
+            ignore = item.ignore,
+            defaultValue = item.defaultValue;
+
+            if(item.xtype == 'numberfield') {
+                Ext.applyIf(item, {
+                    hideTrigger: true, // 隐藏trigger
+                    mouseWheelEnabled: false // 取消滚轮事件
+                });
+            }
+            // 设置model绑定
+            if(!ignore) {
+                if(bind) {
+                    if(!Ext.isString(bind)) {
+                        bind = name;
+                        Ext.apply(bind, {
+                            value: '{form.' + bind + '}'
+                        });
+                    }else {
+                        bind = name;
+                        item.bind = '{form.' + bind + '}';
+                    }
+                }else {
+                    bind = name;
+                    item.bind = '{form.' + bind + '}';
+                }
+                // 设置默认值
+                if(defaultValue) {
+                    viewModel.set('form.' + bind, defaultValue);
+                }
+            }
+        });
+
+        return items;
+    },
+
+    initToolBarItems: function () {
+        var me = this;
+
+        return ['->', {
+            ui: 'default-toolbar',
+            xtype: 'button',
+            text: '导出为...',
+            menu: {
+                defaults: {
+                    handler: 'exportTo'
+                },
+                items: [{
+                    text: 'Excel xlsx',
+                    cfg: {
+                        type: 'excel07',
+                        ext: 'xlsx'
+                    }
+                }, {
+                    text: 'Excel xlsx (include groups)',
+                    cfg: {
+                        type: 'excel07',
+                        ext: 'xlsx',
+                        includeGroups: true,
+                        includeSummary: true
+                    }
+                }, {
+                    text: 'Excel xml',
+                    cfg: {
+                        type: 'excel03',
+                        ext: 'xml'
+                    }
+                }, {
+                    text: 'Excel xml (include groups)',
+                    cfg: {
+                        includeGroups: true,
+                        includeSummary: true
+                    }
+                }, {
+                    text: 'CSV',
+                    cfg: {
+                        type: 'csv'
+                    }
+                }, {
+                    text: 'TSV',
+                    cfg: {
+                        type: 'tsv',
+                        ext: 'csv'
+                    }
+                }, {
+                    text: 'HTML',
+                    cfg: {
+                        type: 'html'
+                    }
+                }, {
+                    text: 'HTML (include groups)',
+                    cfg: {
+                        type: 'html',
+                        includeGroups: true,
+                        includeSummary: true
+                    }
+                }]
+            }
+        }]
+    },
+
+    getConditions: function() {
+        var me = this,
+        formItems = me.searchItems,
+        viewModel = me.getViewModel(),
+        viewModelData = viewModel.getData(),
+        bindItems = viewModelData['form'],
+        condition,
+        conditions = [];
+
+        for(k in bindItems) {
+            var item = Ext.Array.findBy(formItems, function(i) {
+                return i.name == k;
+            });
+            var field = item.name,
+            func = item.getCondition,
+            value = bindItems[k],
+            condition;
+
+            if(typeof func == 'function') {
+                condition = {
+                    type: 'condition',
+                    value: func(value)
+                }
+            }else {
+                var xtype = item.xtype || 'textfield',
+                type = item.fieldType || me.getDefaultFieldType(xtype),
+                operation = item.operation || me.getDefaultFieldOperation(xtype),
+                conditionValue = me.getConditionValue(xtype, value);
+    
+                if(!conditionValue) {
+                    continue;
+                }
+                condition = {
+                    type: type,
+                    field: field,
+                    operation: operation,
+                    value: conditionValue
+                }
+            }
+            conditions.push(condition);
+        }
+
+        return conditions;
+    },
+
+    getDefaultFieldType: function(xtype) {
+        var type;
+
+        if(Ext.Array.contains(['numberfield'], xtype)) {
+            type = 'number';
+        }else if(Ext.Array.contains(['datefield', 'condatefield'], xtype)) {
+            type = 'date';
+        }else if(Ext.Array.contains(['combobox', 'multicombo', 'combo', 'radiofield', 'radio'], xtype)) {
+            type = 'enum';
+        }else {
+            type = 'string';
+        }
+
+        return type;
+    },
+
+    getDefaultFieldOperation: function(xtype) {
+        var operation;
+
+        if(Ext.Array.contains(['numberfield'], xtype)) {
+            operation = '=';
+        }else if(Ext.Array.contains(['datefield'], xtype)) {
+            operation = '=';
+        }else if(Ext.Array.contains(['condatefield'], xtype)) {
+            operation = 'between';
+        }else if(Ext.Array.contains(['combobox', 'multicombo', 'combo'], xtype)) {
+            operation = 'in';
+        }else {
+            operation = 'like';
+        }
+
+        return operation;
+    },
+
+    /**
+     * 处理部分字段值
+     */
+    getConditionValue: function(xtype, value) {
+        var conditionValue;
+        if(xtype == 'datefield') {
+            conditionValue = Ext.Date.format(new Date(from), 'Y-m-d H:i:s');
+        }else if(xtype == 'condatefield') {
+            var from = value.from,
+            to = value.to;
+
+            conditionValue = Ext.Date.format(new Date(from), 'Y-m-d 00:00:00') + ',' + Ext.Date.format(new Date(to), 'Y-m-d 23:59:59');
+        }else if(xtype == 'combobox' || xtype == 'combo') {
+            conditionValue = '\'' + value + '\'';
+        }else if(xtype == 'multicombo') {
+            conditionValue = value.map(function(v) {
+                return '\'' + v.value + '\'';
+            }).join(',');
+        }else {
+            conditionValue = value;
+        }
+
+        return conditionValue;
+    },
+});

+ 29 - 0
frontend/saas-web/app/view/core/report/ReportPanelController.js

@@ -0,0 +1,29 @@
+Ext.define('saas.view.core.report.ReportPanelController', {
+    extend: 'Ext.app.ViewController',
+    alias: 'controller.core-report-reportpanel',
+
+    requires: [
+        'Ext.exporter.text.CSV',
+        'Ext.exporter.text.TSV',
+        'Ext.exporter.text.Html',
+        'Ext.exporter.excel.Xml',
+        'Ext.exporter.excel.Xlsx'
+    ],
+
+    onQuery: function (btn) {
+        var me = this,
+        reportPanel = me.getView(),
+        grid = reportPanel.getListGrid();
+
+        grid.store.loadPage(1);
+    },
+
+    exportTo: function(btn){
+        var cfg = Ext.merge({
+            title: 'Grid export demo',
+            fileName: 'GridExport' + '.' + (btn.cfg.ext || btn.cfg.type)
+        }, btn.cfg);
+
+        this.getView().saveDocumentAs(cfg);
+    }
+});

+ 4 - 0
frontend/saas-web/app/view/core/report/ReportPanelModel.js

@@ -0,0 +1,4 @@
+Ext.define('saas.view.core.report.ReportPanelModel', {
+    extend: 'Ext.app.ViewModel',
+    alias: 'viewmodel.core-report-reportpanel'
+});

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

@@ -221,10 +221,15 @@ Ext.define('saas.view.purchase.purchaseOut.FormPanel', {
                     xtype : "numberfield",
                     decimalPrecision: 8,
                     minValue:0
-                },  
+                },
                 dataIndex : "pd_orderprice", 
-                width : 120.0, 
-                xtype : "numbercolumn"
+                width : 120.0,
+                renderer : function(v) {
+                    var arr = (v + '.').split('.');
+                    var xr = (new Array(arr[1].length)).fill('0');
+                    var format = '0,000.' + xr.join();
+                    return Ext.util.Format.number(v, format);
+                },
             },{
                 text : "税率", 
                 dataIndex : "pd_taxrate", 

+ 94 - 0
frontend/saas-web/app/view/purchase/report/Purchase.js

@@ -0,0 +1,94 @@
+Ext.define('saas.view.purchase.report.Purchase', {
+    extend: 'saas.view.core.report.ReportPanel',
+    xtype: 'purchase-report-purchase',
+
+    controller: 'purchase-report-purchase',
+    viewModel: 'purchase-report-purchase',
+
+    viewName: 'purchase-report-purchase',
+
+    groupField: null,
+    listUrl: '/api/purchase/purchase/list',
+    defaultCondition: null,
+
+    searchItems: [{
+        xtype: 'condatefield',
+        name: 'pu_date',
+        fieldLabel: '单据日期',
+        columnWidth: 0.5
+    }],
+
+    reportColumns: [{
+        text: 'id',
+        dataIndex: 'id',
+        hidden: true
+    }, {
+        text: '采购单号',
+        dataIndex: 'pu_code',
+        summaryType: 'count',
+        width: 200
+    }, {
+        text: '供应商编号',
+        dataIndex: 'PU_VENDCODE',
+        width: 200
+    }, {
+        text: '供应商名称',
+        dataIndex: 'PU_VENDNAME',
+        width: 200
+    }, {
+        text: '业务状态',
+        dataIndex: 'PU_STATUS'
+    }, {
+        text: '采购员',
+        dataIndex: 'PU_BUYERNAME'
+    }, {
+        text: '单据日期',
+        xtype: 'datecolumn',
+        dataIndex: 'pu_date'
+    }, {
+        text: '序号',
+        dataIndex: 'PD_DETNO'
+    }, {
+        text: '物料编号',
+        dataIndex: 'pr_code'
+    }, {
+        text: '物料名称',
+        dataIndex: 'pr_detail'
+    }, {
+        text: '物料规格',
+        dataIndex: 'pr_spec'
+    }, {
+        text: '品牌',
+        dataIndex: 'pr_brand'
+    }, {
+        text: '单位',
+        dataIndex: 'pr_unit'
+    }, {
+        text: '采购数量',
+        dataIndex: 'PD_QTY'
+    }, {
+        text: '单价',
+        dataIndex: 'PD_PRICE'
+    }, {
+        text: '税率',
+        dataIndex: 'PD_TAXRATE'
+    }, {
+        text: '金额',
+        dataIndex: 'PD_TOTAL'
+    }, {
+        text: '不含税单价',
+        dataIndex: 'rbd_remark'
+    }, {
+        text: '不含税金额',
+        dataIndex: 'PD_TAXPRICE'
+    }, {
+        text: '收货数量',
+        dataIndex: 'PD_YQTY'
+    }, {
+        text: '收货金额',
+        dataIndex: 'PD_TOTAL'
+    }, {
+        text: '备注'
+    }]
+
+});

+ 4 - 0
frontend/saas-web/app/view/purchase/report/PurchaseController.js

@@ -0,0 +1,4 @@
+Ext.define('saas.view.purchase.report.PurchaseController', {
+    extend: 'saas.view.core.report.ReportPanelController',
+    alias: 'controller.purchase-report-purchase'
+});

+ 4 - 0
frontend/saas-web/app/view/purchase/report/PurchaseModel.js

@@ -0,0 +1,4 @@
+Ext.define('saas.view.purchase.report.PurchaseModel', {
+    extend: 'saas.view.core.report.ReportPanelModel',
+    alias: 'viewmodel.purchase-report-purchase'
+});

+ 66 - 0
frontend/saas-web/app/view/sale/report/SaleIn.js

@@ -0,0 +1,66 @@
+Ext.define('saas.view.sale.report.SaleIn', {
+    extend: 'saas.view.core.report.ReportPanel',
+    xtype: 'sale-report-salein',
+
+    controller: 'sale-report-salein',
+    viewModel: 'sale-report-salein',
+
+    viewName: 'sale-report-salein',
+
+    groupField: 'rb_custname',
+    listUrl: '/api/money/recbalance/list',
+    defaultCondition: null,
+
+    searchItems: [{
+        xtype: 'condatefield',
+        name: 'rb_date',
+        fieldLabel: '日期',
+        columnWidth: 0.5
+    }],
+
+    reportColumns: [{
+        text: 'id',
+        dataIndex: 'id',
+        hidden: true
+    }, {
+        text: '收款单号',
+        dataIndex: 'rb_code',
+        summaryType: 'count',
+        width: 200
+    }, {
+        text: '客户编号',
+        dataIndex: 'rb_custcode',
+        width: 200
+    }, {
+        text: '客户名称',
+        dataIndex: 'rb_custname',
+        width: 200
+    }, {
+        text: '业务员',
+        dataIndex: 'rb_manname'
+    }, {
+        text: '日期',
+        dataIndex: 'rb_date',
+        xtype: 'datecolumn'
+    }, {
+        text: '来源单号',
+        dataIndex: 'rbd_slcode'
+    }, {
+        text: '类型',
+        dataIndex: 'rbd_slkind'
+    }, {
+        text: '销售金额',
+        dataIndex: 'rbd_amount'
+    }, {
+        text: '本次收款',
+        dataIndex: 'rbd_nowbalance'
+    }, {
+        text: '应收余额'
+    }, {
+        text: '回款比例'
+    }, {
+        text: '备注',
+        dataIndex: 'rbd_remark'
+    }]
+
+});

+ 4 - 0
frontend/saas-web/app/view/sale/report/SaleInController.js

@@ -0,0 +1,4 @@
+Ext.define('saas.view.sale.report.SaleInController', {
+    extend: 'saas.view.core.report.ReportPanelController',
+    alias: 'controller.sale-report-salein'
+});

+ 4 - 0
frontend/saas-web/app/view/sale/report/SaleInModel.js

@@ -0,0 +1,4 @@
+Ext.define('saas.view.sale.report.SaleInModel', {
+    extend: 'saas.view.core.report.ReportPanelModel',
+    alias: 'viewmodel.sale-report-salein'
+});

+ 0 - 8
frontend/saas-web/app/view/sale/sale/FormPanel.js

@@ -184,10 +184,6 @@ Ext.define('saas.view.sale.sale.FormPanel', {
                 text : "含税金额", 
                 dataIndex : "sd_total", 
                 width : 120.0,
-                editor : {
-                    xtype : "numberfield",
-                    decimalPrecision: 2
-                },
                 renderer : function(v) {
                     var arr = (v + '.').split('.');
                     var xr = (new Array(arr[1].length)).fill('0');
@@ -205,10 +201,6 @@ Ext.define('saas.view.sale.sale.FormPanel', {
             {
                 text : "未税金额", 
                 dataIndex : "sd_nettotal",
-                editor : {
-                    xtype : "numberfield",
-                    decimalPrecision: 2
-                },
                 renderer : function(v) {
                     var arr = (v + '.').split('.');
                     var xr = (new Array(arr[1].length)).fill('0');

+ 0 - 8
frontend/saas-web/app/view/sale/saleIn/FormPanel.js

@@ -174,10 +174,6 @@ Ext.define('saas.view.sale.saleIn.FormPanel', {
                 text : "含税金额", 
                 dataIndex : "pd_ordertotal", 
                 width : 120.0, 
-                editor : {
-                    xtype : "numberfield",
-                    decimalPrecision: 2
-                },
                 renderer : function(v) {
                     var arr = (v + '.').split('.');
                     var xr = (new Array(arr[1].length)).fill('0');
@@ -205,10 +201,6 @@ Ext.define('saas.view.sale.saleIn.FormPanel', {
             {
                 text : "未税金额", 
                 dataIndex : "pd_nettotal", 
-                editor : {
-                    xtype : "numberfield",
-                    decimalPrecision: 2
-                },
                 renderer : function(v) {
                     var arr = (v + '.').split('.');
                     var xr = (new Array(arr[1].length)).fill('0');

+ 0 - 8
frontend/saas-web/app/view/sale/saleOut/FormPanel.js

@@ -185,10 +185,6 @@ Ext.define('saas.view.sale.saleout.FormPanel', {
                 text : "含税金额", 
                 dataIndex : "pd_ordertotal", 
                 width : 120.0, 
-                editor : {
-                    xtype : "numberfield",
-                    decimalPrecision: 2
-                },
                 renderer : function(v) {
                     var arr = (v + '.').split('.');
                     var xr = (new Array(arr[1].length)).fill('0');
@@ -216,10 +212,6 @@ Ext.define('saas.view.sale.saleout.FormPanel', {
             {
                 text : "未税金额", 
                 dataIndex : "pd_nettotal", 
-                editor : {
-                    xtype : "numberfield",
-                    decimalPrecision: 2
-                },
                 renderer : function(v) {
                     var arr = (v + '.').split('.');
                     var xr = (new Array(arr[1].length)).fill('0');

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

@@ -46,7 +46,7 @@ Ext.define('saas.view.stock.make.FormPanel', {
         fieldLabel: '产品id',
         columnWidth: 0
     },{
-        xtype : "textfield", 
+        xtype : "dbfindtrigger", 
         name : "ma_prodcode", 
         fieldLabel : "产品编号",
         columnWidth: 0.2
@@ -103,12 +103,14 @@ Ext.define('saas.view.stock.make.FormPanel', {
             {
                 text : "id", 
                 dataIndex : "id", 
-                xtype : "numbercolumn"
+                xtype : "numbercolumn",
+                hidden:true
             },
             {
                 text : "mm_prodidid", 
                 dataIndex : "mm_prodid", 
-                xtype : "numbercolumn"
+                xtype : "numbercolumn",
+                hidden:true
             },
             {
                 text : "物料编号", 

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

@@ -67,9 +67,132 @@ Ext.define('saas.view.stock.make.FormPanelController', {
             //             }]
             //         }) ;   
             //     }
-            // },
-            //从表单选放大镜赋值关系 以及 tpl模板
-            'dbfindtrigger[name=mm_prodcode]':{
+
+            //放大镜赋值关系 以及 tpl模板
+            'dbfindtrigger[name=ma_whname]':{
+                beforerender:function(f){
+                    Ext.apply(f,{
+                        dataUrl:'/api/document/warehouse/list',
+                        // dataUrl:'http://localhost:9480/warehouse/list',
+                        addXtype: 'other-warehouse',
+                        addTitle: '仓库资料',
+                        defaultCondition:"wh_statuscode='OPEN'",
+                        dbfinds:[{
+                            from:'id',to:'ma_whid',ignore:true                          
+                        },{
+                            from:'wh_code',to:'ma_whcode'                          
+                        },{
+                            from:'wh_description',to:'ma_whname'
+                        }],
+                        dbtpls:[{
+                            field:'pd_whcode',width:100
+                        },{
+                            field:'pd_whname',width:100
+                        }],
+                        dbSearchFields:[{
+                            emptyText:'输入仓库编号或名称',
+                            xtype : "textfield", 
+                            name : "wh_code", 
+                            allowBlank : true, 
+                            columnWidth : 0.25,
+                            getCondition:function(v){
+                                return "(upper(wh_code) like '%"+v.toUpperCase()+"%' or upper(wh_description) like '%"+v.toUpperCase()+"%')";
+                            }
+                        }],                        
+                        dbColumns:[{
+                            "text": "仓库ID",
+                            "flex": 0,
+                            "dataIndex": "id",
+                            "width": 0,
+                            "xtype": "",
+                            "items": null
+                        },{
+                            "text": "仓库编号",
+                            "flex": 1,
+                            "dataIndex": "wh_code",
+                            "width": 100,
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            "text": "仓库名称",
+                            "flex": 1,
+                            "dataIndex": "wh_description",
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            "text": "仓库类型",
+                            "flex": 1,
+                            "dataIndex": "wh_type",
+                            "xtype": "",
+                            "items": null
+                        }]
+                    }) ;   
+
+                }
+            },            
+            //放大镜赋值关系 以及 tpl模板
+            'dbfindtrigger[name=mm_whname]':{
+                beforerender:function(f){
+                    Ext.apply(f,{
+                        dataUrl:'/api/document/warehouse/list',
+                        // dataUrl:'http://localhost:9480/warehouse/list',
+                        addXtype: 'other-warehouse',
+                        addTitle: '仓库资料',
+                        defaultCondition:"wh_statuscode='OPEN'",
+                        dbfinds:[{
+                            from:'id',to:'mm_whid',ignore:true                          
+                        },{
+                            from:'wh_code',to:'mm_whcode'                          
+                        },{
+                            from:'wh_description',to:'mm_whname'
+                        }],
+                        dbtpls:[{
+                            field:'pd_whcode',width:100
+                        },{
+                            field:'pd_whname',width:100
+                        }],
+                        dbSearchFields:[{
+                            emptyText:'输入仓库编号或名称',
+                            xtype : "textfield", 
+                            name : "wh_code", 
+                            allowBlank : true, 
+                            columnWidth : 0.25,
+                            getCondition:function(v){
+                                return "(upper(wh_code) like '%"+v.toUpperCase()+"%' or upper(wh_description) like '%"+v.toUpperCase()+"%')";
+                            }
+                        }],                        
+                        dbColumns:[{
+                            "text": "仓库ID",
+                            "flex": 0,
+                            "dataIndex": "id",
+                            "width": 0,
+                            "xtype": "",
+                            "items": null
+                        },{
+                            "text": "仓库编号",
+                            "flex": 1,
+                            "dataIndex": "wh_code",
+                            "width": 100,
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            "text": "仓库名称",
+                            "flex": 1,
+                            "dataIndex": "wh_description",
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            "text": "仓库类型",
+                            "flex": 1,
+                            "dataIndex": "wh_type",
+                            "xtype": "",
+                            "items": null
+                        }]
+                    }) ;   
+
+                }
+            },
+            'multidbfindtrigger[name=mm_prodcode]':{
                 beforerender:function(f){
                     Ext.apply(f,{
                         //数据接口
@@ -80,13 +203,21 @@ Ext.define('saas.view.stock.make.FormPanelController', {
                         dbfinds:[{
                             from:'pr_code',to:'mm_prodcode'
                         },{
-                            from:'pr_unit',to:'pd_unit'
+                            from:'id',to:'mm_prodid'
+                        },{
+                            from:'pr_detail',to:'pr_detail'
+                        },{
+                            from:'pr_spec',to:'pr_spec'
+                        },{
+                            from:'pr_unit',to:'pr_spec'
                         }],
                         //联想设置
                         dbtpls:[{
                             field:'pr_code',width:100
                         },{
                             field:'pr_detail',width:100
+                        },{
+                            field:'pr_spec',width:100
                         }],
                         defaultCondition:"pr_statuscode='OPEN'",
                         //窗口字段设置
@@ -167,6 +298,123 @@ Ext.define('saas.view.stock.make.FormPanelController', {
 
                 }
             },
+            'dbfindtrigger[name=ma_prodcode]':{
+                beforerender:function(f){
+                    Ext.apply(f,{
+                        //数据接口
+                        dataUrl:'/api/document/product/list',
+                        addXtype: 'document-product-formpanel',
+                        addTitle: '物料资料',
+                        //放大镜赋值设置
+                        dbfinds:[{
+                            from:'pr_code',to:'ma_prodcode'
+                        },{
+                            from:'id',to:'ma_prodid'
+                        },{
+                            from:'pr_detail',to:'ma_proddetail'
+                        },{
+                            from:'pr_spec',to:'ma_prodspec'
+                        },{
+                            from:'pr_unit',to:'ma_produnit'
+                        }],
+                        //联想设置
+                        dbtpls:[{
+                            field:'pr_code',width:100
+                        },{
+                            field:'pr_detail',width:100
+                        },{
+                            field:'pr_spec',width:100
+                        }],
+                        defaultCondition:"pr_statuscode='OPEN'",
+                        //窗口字段设置
+                        dbSearchFields:[{
+                            emptyText:'输入物料编号、名称或规格',
+                            xtype : "textfield", 
+                            name : "search", 
+                            width: 200,
+                            getCondition: function(v) {
+                                return "(upper(pr_spec) like '%" + v.toUpperCase()+"%' or upper(pr_code) like '%"+v.toUpperCase()+"%' or upper(pr_detail) like '%"+v.toUpperCase()+"%')";
+                            },
+                            allowBlank : true, 
+                            columnWidth : 0.25
+                        }],
+                        //窗口列设置
+                        dbColumns:[{
+                            "text": "物料ID",
+                            "hidden": true,
+                            "dataIndex": "id",
+                        }, {
+                            "text": "物料编号",       
+                            "dataIndex": "pr_code",
+                            "width": 200,
+                        }, {
+                            "text": "物料名称",
+                            "width": 200,
+                            "dataIndex": "pr_detail",
+                        }, {
+                            "text": "规格",
+                            "dataIndex": "pr_spec",
+                            "width": 100,
+                        }, {
+                            "text": "单位",
+                            "dataIndex": "pr_spec",
+                            "width": 100,
+                        },{
+                            "text": "仓库id",
+                            "dataIndex": "pr_whid",
+                            "hidden": true,
+                        },{
+                            "text": "仓库编号",
+                            "dataIndex": "pr_whcode",
+                            "hidden": true,
+                        },{
+                            "text": "仓库",
+                            "dataIndex": "pr_whname",
+                            "width": 200,
+                        },{
+                            "text": "总库存数",
+                            "dataIndex": "po_onhand",
+                            "width": 100,
+                        },{
+                            "text": "类型",
+                            "dataIndex": "pr_kind",
+                            "width": 100,
+                        },{
+                            "text": "型号",
+                            "dataIndex": "pr_orispeccode",
+                            "width": 100,
+                        },{
+                            "text": "品牌",
+                            "dataIndex": "pr_brand",
+                            "width": 100,
+                        },{
+                            "text": "供应商",
+                            "dataIndex": "pr_vendname",
+                            "width": 100,
+                        },{
+                            "text": "最小包装",
+                            "dataIndex": "pr_zxbzs",
+                            "width": 100,
+                        },{
+                            "text": "L/T",
+                            "dataIndex": "pr_leadtime",
+                            "width": 100,
+                        }]
+                    }) ;   
+
+                }
+            },
+
+
+
+
+
+
+
+
+
+
+
             //从表多选放大镜赋值关系 以及 tpl模板
             'multidbfindtrigger[name=pd_prodcode]':{
                 beforerender:function(f){

+ 6 - 2
frontend/saas-web/resources/json/navigation.json

@@ -27,7 +27,9 @@
     }, {
         "text": "报表",
         "items": [{
-            "text": "采购明细表"
+            "id": "report-purchase",
+            "text": "采购明细表",
+            "viewType": "purchase-report-purchase"
         }, {
             "text": "采购付款一览表"
         }]
@@ -63,7 +65,9 @@
         "items": [{
             "text": "销售明细表"
         }, {
-            "text": "销售收款一览表"
+            "id": "report-salein",
+            "text": "销售收款一览表",
+            "viewType": "sale-report-salein"
         }, {
             "text": "销售利润表"
         }]